diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 925d646e9a..4dd9f8c915 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-07-11 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -101,7 +100,7 @@ msgstr "" #: ../../c-api/exceptions.rst:69 msgid "The setting of :data:`sys.last_exc` was added." -msgstr "" +msgstr "新增 :data:`sys.last_exc` 設定。" #: ../../c-api/exceptions.rst:75 msgid "Alias for ``PyErr_PrintEx(1)``." @@ -437,7 +436,7 @@ msgstr "" #: ../../c-api/exceptions.rst:416 msgid "The caller must hold the GIL." -msgstr "" +msgstr "呼叫者必須持有 GIL。" #: ../../c-api/exceptions.rst:420 msgid "" @@ -488,6 +487,13 @@ msgid "" " PyErr_SetRaisedException(exc);\n" "}" msgstr "" +"{\n" +" PyObject *exc = PyErr_GetRaisedException();\n" +"\n" +" /* ... 可能會產生其他錯誤的程式碼 ... */\n" +"\n" +" PyErr_SetRaisedException(exc);\n" +"}" #: ../../c-api/exceptions.rst:459 msgid "" @@ -507,7 +513,7 @@ msgstr "" #: ../../c-api/exceptions.rst:481 msgid "Use :c:func:`PyErr_GetRaisedException` instead." -msgstr "" +msgstr "請改用 :c:func:`PyErr_GetRaisedException`。" #: ../../c-api/exceptions.rst:483 msgid "" @@ -535,10 +541,18 @@ msgid "" " PyErr_Restore(type, value, traceback);\n" "}" msgstr "" +"{\n" +" PyObject *type, *value, *traceback;\n" +" PyErr_Fetch(&type, &value, &traceback);\n" +"\n" +" /* ... 可能會產生其他錯誤的程式碼 ... */\n" +"\n" +" PyErr_Restore(type, value, traceback);\n" +"}" #: ../../c-api/exceptions.rst:509 msgid "Use :c:func:`PyErr_SetRaisedException` instead." -msgstr "" +msgstr "請改用 :c:func:`PyErr_SetRaisedException`。" #: ../../c-api/exceptions.rst:511 msgid "" @@ -669,7 +683,7 @@ msgstr "" #: ../../c-api/exceptions.rst:632 msgid "Signal Handling" -msgstr "" +msgstr "訊號處理" #: ../../c-api/exceptions.rst:642 msgid "This function interacts with Python's signal handling." @@ -807,7 +821,7 @@ msgstr "" #: ../../c-api/exceptions.rst:759 msgid "Return :c:member:`~PyTypeObject.tp_name` of the exception class *ob*." -msgstr "" +msgstr "回傳例外類別 *ob* 的 :c:member:`~PyTypeObject.tp_name`。" #: ../../c-api/exceptions.rst:763 msgid "Exception Objects" @@ -864,11 +878,11 @@ msgstr "" #: ../../c-api/exceptions.rst:814 msgid "Return :attr:`~BaseException.args` of exception *ex*." -msgstr "" +msgstr "回傳例外 *ex* 的 :attr:`~BaseException.args`。" #: ../../c-api/exceptions.rst:819 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." -msgstr "" +msgstr "設定例外 *ex* 的 :attr:`~BaseException.args` 為 *args*。" #: ../../c-api/exceptions.rst:823 msgid "" @@ -884,7 +898,7 @@ msgstr "" #: ../../c-api/exceptions.rst:837 msgid "Unicode Exception Objects" -msgstr "" +msgstr "Unicode 例外物件" #: ../../c-api/exceptions.rst:839 msgid "" @@ -935,7 +949,7 @@ msgstr "" #: ../../c-api/exceptions.rst:892 msgid "Return the *reason* attribute of the given exception object." -msgstr "" +msgstr "回傳給定例外物件的 *reason* 屬性。" #: ../../c-api/exceptions.rst:898 msgid "" @@ -945,7 +959,7 @@ msgstr "" #: ../../c-api/exceptions.rst:905 msgid "Recursion Control" -msgstr "" +msgstr "遞迴控制" #: ../../c-api/exceptions.rst:907 msgid "" @@ -1037,478 +1051,256 @@ msgid "" msgstr "" #: ../../c-api/exceptions.rst:974 -msgid "Standard Exceptions" -msgstr "" +msgid "Exception and warning types" +msgstr "例外和警告型別" #: ../../c-api/exceptions.rst:976 msgid "" -"All standard Python exceptions are available as global variables whose names " -"are ``PyExc_`` followed by the Python exception name. These have the type :" -"c:expr:`PyObject*`; they are all class objects. For completeness, here are " -"all the variables:" +"All standard Python exceptions and warning categories are available as " +"global variables whose names are ``PyExc_`` followed by the Python exception " +"name. These have the type :c:expr:`PyObject*`; they are all class objects." msgstr "" -#: ../../c-api/exceptions.rst:1039 ../../c-api/exceptions.rst:1179 -#: ../../c-api/exceptions.rst:1225 -msgid "C Name" -msgstr "C 名稱" +#: ../../c-api/exceptions.rst:980 +msgid "For completeness, here are all the variables:" +msgstr "" -#: ../../c-api/exceptions.rst:1039 ../../c-api/exceptions.rst:1225 -msgid "Python Name" -msgstr "Python 名稱" +#: ../../c-api/exceptions.rst:983 +msgid "Exception types" +msgstr "例外型別" -#: ../../c-api/exceptions.rst:1039 ../../c-api/exceptions.rst:1179 -#: ../../c-api/exceptions.rst:1225 -msgid "Notes" -msgstr "註解" +#: ../../c-api/exceptions.rst:990 ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1166 +msgid "C name" +msgstr "C 名稱" -#: ../../c-api/exceptions.rst:1041 -msgid ":c:data:`PyExc_BaseException`" -msgstr ":c:data:`PyExc_BaseException`" +#: ../../c-api/exceptions.rst:991 ../../c-api/exceptions.rst:1137 +#: ../../c-api/exceptions.rst:1167 +msgid "Python name" +msgstr "Python 名稱" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:993 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1041 ../../c-api/exceptions.rst:1043 -#: ../../c-api/exceptions.rst:1045 ../../c-api/exceptions.rst:1047 -#: ../../c-api/exceptions.rst:1093 ../../c-api/exceptions.rst:1105 -msgid "[1]_" -msgstr "[1]_" - -#: ../../c-api/exceptions.rst:1043 -msgid ":c:data:`PyExc_BaseExceptionGroup`" -msgstr ":c:data:`PyExc_BaseExceptionGroup`" - -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:995 msgid ":exc:`BaseExceptionGroup`" msgstr ":exc:`BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1045 -msgid ":c:data:`PyExc_Exception`" -msgstr ":c:data:`PyExc_Exception`" - -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:997 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1047 -msgid ":c:data:`PyExc_ArithmeticError`" -msgstr ":c:data:`PyExc_ArithmeticError`" - -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:999 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1049 -msgid ":c:data:`PyExc_AssertionError`" -msgstr ":c:data:`PyExc_AssertionError`" - -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1001 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1051 -msgid ":c:data:`PyExc_AttributeError`" -msgstr ":c:data:`PyExc_AttributeError`" - -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1003 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1053 -msgid ":c:data:`PyExc_BlockingIOError`" -msgstr ":c:data:`PyExc_BlockingIOError`" - -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1005 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1055 -msgid ":c:data:`PyExc_BrokenPipeError`" -msgstr ":c:data:`PyExc_BrokenPipeError`" - -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1007 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1057 -msgid ":c:data:`PyExc_BufferError`" -msgstr ":c:data:`PyExc_BufferError`" - -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1009 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1059 -msgid ":c:data:`PyExc_ChildProcessError`" -msgstr ":c:data:`PyExc_ChildProcessError`" - -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1011 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1061 -msgid ":c:data:`PyExc_ConnectionAbortedError`" -msgstr ":c:data:`PyExc_ConnectionAbortedError`" - -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1013 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1063 -msgid ":c:data:`PyExc_ConnectionError`" -msgstr ":c:data:`PyExc_ConnectionError`" - -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1015 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1065 -msgid ":c:data:`PyExc_ConnectionRefusedError`" -msgstr ":c:data:`PyExc_ConnectionRefusedError`" - -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1017 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1067 -msgid ":c:data:`PyExc_ConnectionResetError`" -msgstr ":c:data:`PyExc_ConnectionResetError`" - -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1019 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1069 -msgid ":c:data:`PyExc_EOFError`" -msgstr ":c:data:`PyExc_EOFError`" - -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1021 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1071 -msgid ":c:data:`PyExc_FileExistsError`" -msgstr ":c:data:`PyExc_FileExistsError`" - -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1023 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1073 -msgid ":c:data:`PyExc_FileNotFoundError`" -msgstr ":c:data:`PyExc_FileNotFoundError`" - -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1075 -msgid ":c:data:`PyExc_FloatingPointError`" -msgstr ":c:data:`PyExc_FloatingPointError`" - -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1077 -msgid ":c:data:`PyExc_GeneratorExit`" -msgstr ":c:data:`PyExc_GeneratorExit`" - -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1079 -msgid ":c:data:`PyExc_ImportError`" -msgstr ":c:data:`PyExc_ImportError`" - -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1081 -msgid ":c:data:`PyExc_IndentationError`" -msgstr ":c:data:`PyExc_IndentationError`" - -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1083 -msgid ":c:data:`PyExc_IndexError`" -msgstr ":c:data:`PyExc_IndexError`" - -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1085 -msgid ":c:data:`PyExc_InterruptedError`" -msgstr ":c:data:`PyExc_InterruptedError`" - -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1087 -msgid ":c:data:`PyExc_IsADirectoryError`" -msgstr ":c:data:`PyExc_IsADirectoryError`" - -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1089 -msgid ":c:data:`PyExc_KeyError`" -msgstr ":c:data:`PyExc_KeyError`" - -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1091 -msgid ":c:data:`PyExc_KeyboardInterrupt`" -msgstr ":c:data:`PyExc_KeyboardInterrupt`" - -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1093 -msgid ":c:data:`PyExc_LookupError`" -msgstr ":c:data:`PyExc_LookupError`" - -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1095 -msgid ":c:data:`PyExc_MemoryError`" -msgstr ":c:data:`PyExc_MemoryError`" - -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1047 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1097 -msgid ":c:data:`PyExc_ModuleNotFoundError`" -msgstr ":c:data:`PyExc_ModuleNotFoundError`" - -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1049 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1099 -msgid ":c:data:`PyExc_NameError`" -msgstr ":c:data:`PyExc_NameError`" - -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1051 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1101 -msgid ":c:data:`PyExc_NotADirectoryError`" -msgstr ":c:data:`PyExc_NotADirectoryError`" - -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1053 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1103 -msgid ":c:data:`PyExc_NotImplementedError`" -msgstr ":c:data:`PyExc_NotImplementedError`" - -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1055 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1105 -msgid ":c:data:`PyExc_OSError`" -msgstr ":c:data:`PyExc_OSError`" - -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1057 ../../c-api/exceptions.rst:1140 +#: ../../c-api/exceptions.rst:1143 ../../c-api/exceptions.rst:1146 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1107 -msgid ":c:data:`PyExc_OverflowError`" -msgstr ":c:data:`PyExc_OverflowError`" - -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1059 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1109 -msgid ":c:data:`PyExc_PermissionError`" -msgstr ":c:data:`PyExc_PermissionError`" - -#: ../../c-api/exceptions.rst:1109 +#: ../../c-api/exceptions.rst:1061 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1111 -msgid ":c:data:`PyExc_ProcessLookupError`" -msgstr ":c:data:`PyExc_ProcessLookupError`" - -#: ../../c-api/exceptions.rst:1111 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1113 -msgid ":c:data:`PyExc_PythonFinalizationError`" -msgstr ":c:data:`PyExc_PythonFinalizationError`" - -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`PythonFinalizationError`" msgstr ":exc:`PythonFinalizationError`" -#: ../../c-api/exceptions.rst:1115 -msgid ":c:data:`PyExc_RecursionError`" -msgstr ":c:data:`PyExc_RecursionError`" - -#: ../../c-api/exceptions.rst:1115 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1117 -msgid ":c:data:`PyExc_ReferenceError`" -msgstr ":c:data:`PyExc_ReferenceError`" - -#: ../../c-api/exceptions.rst:1117 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1119 -msgid ":c:data:`PyExc_RuntimeError`" -msgstr ":c:data:`PyExc_RuntimeError`" - -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1121 -msgid ":c:data:`PyExc_StopAsyncIteration`" -msgstr ":c:data:`PyExc_StopAsyncIteration`" - -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1123 -msgid ":c:data:`PyExc_StopIteration`" -msgstr ":c:data:`PyExc_StopIteration`" - -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1125 -msgid ":c:data:`PyExc_SyntaxError`" -msgstr ":c:data:`PyExc_SyntaxError`" - -#: ../../c-api/exceptions.rst:1125 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1127 -msgid ":c:data:`PyExc_SystemError`" -msgstr ":c:data:`PyExc_SystemError`" - -#: ../../c-api/exceptions.rst:1127 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1129 -msgid ":c:data:`PyExc_SystemExit`" -msgstr ":c:data:`PyExc_SystemExit`" - -#: ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1131 -msgid ":c:data:`PyExc_TabError`" -msgstr ":c:data:`PyExc_TabError`" - -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1133 -msgid ":c:data:`PyExc_TimeoutError`" -msgstr ":c:data:`PyExc_TimeoutError`" - -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1135 -msgid ":c:data:`PyExc_TypeError`" -msgstr ":c:data:`PyExc_TypeError`" - -#: ../../c-api/exceptions.rst:1135 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1137 -msgid ":c:data:`PyExc_UnboundLocalError`" -msgstr ":c:data:`PyExc_UnboundLocalError`" - -#: ../../c-api/exceptions.rst:1137 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1139 -msgid ":c:data:`PyExc_UnicodeDecodeError`" -msgstr ":c:data:`PyExc_UnicodeDecodeError`" - -#: ../../c-api/exceptions.rst:1139 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1141 -msgid ":c:data:`PyExc_UnicodeEncodeError`" -msgstr ":c:data:`PyExc_UnicodeEncodeError`" - -#: ../../c-api/exceptions.rst:1141 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1143 -msgid ":c:data:`PyExc_UnicodeError`" -msgstr ":c:data:`PyExc_UnicodeError`" - -#: ../../c-api/exceptions.rst:1143 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1145 -msgid ":c:data:`PyExc_UnicodeTranslateError`" -msgstr ":c:data:`PyExc_UnicodeTranslateError`" - -#: ../../c-api/exceptions.rst:1145 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1147 -msgid ":c:data:`PyExc_ValueError`" -msgstr ":c:data:`PyExc_ValueError`" - -#: ../../c-api/exceptions.rst:1147 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1149 -msgid ":c:data:`PyExc_ZeroDivisionError`" -msgstr ":c:data:`PyExc_ZeroDivisionError`" - -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1152 +#: ../../c-api/exceptions.rst:1103 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1528,179 +1320,107 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1162 +#: ../../c-api/exceptions.rst:1113 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`。" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1116 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`。" -#: ../../c-api/exceptions.rst:1168 +#: ../../c-api/exceptions.rst:1119 msgid ":c:data:`PyExc_BaseExceptionGroup`." msgstr ":c:data:`PyExc_BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1171 -msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" -msgstr "" - -#: ../../c-api/exceptions.rst:1181 -msgid ":c:data:`!PyExc_EnvironmentError`" -msgstr ":c:data:`!PyExc_EnvironmentError`" - -#: ../../c-api/exceptions.rst:1183 -msgid ":c:data:`!PyExc_IOError`" -msgstr ":c:data:`!PyExc_IOError`" +#: ../../c-api/exceptions.rst:1124 +msgid "OSError aliases" +msgstr "OSError 別名" -#: ../../c-api/exceptions.rst:1185 -msgid ":c:data:`!PyExc_WindowsError`" -msgstr ":c:data:`!PyExc_WindowsError`" - -#: ../../c-api/exceptions.rst:1185 -msgid "[2]_" -msgstr "[2]_" +#: ../../c-api/exceptions.rst:1126 +msgid "The following are a compatibility aliases to :c:data:`PyExc_OSError`." +msgstr "" -#: ../../c-api/exceptions.rst:1188 +#: ../../c-api/exceptions.rst:1128 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1191 ../../c-api/exceptions.rst:1258 -msgid "Notes:" -msgstr "註解:" - -#: ../../c-api/exceptions.rst:1194 -msgid "This is a base class for other standard exceptions." -msgstr "" +#: ../../c-api/exceptions.rst:1138 +msgid "Notes" +msgstr "註解" -#: ../../c-api/exceptions.rst:1197 -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:1147 +msgid "[win]_" +msgstr "[win]_" -#: ../../c-api/exceptions.rst:1203 -msgid "Standard Warning Categories" -msgstr "" +#: ../../c-api/exceptions.rst:1149 +msgid "Notes:" +msgstr "註解:" -#: ../../c-api/exceptions.rst:1205 +#: ../../c-api/exceptions.rst:1152 msgid "" -"All standard Python warning categories are available as global variables " -"whose names are ``PyExc_`` followed by the Python exception name. These have " -"the type :c:expr:`PyObject*`; they are all class objects. For completeness, " -"here are all the variables:" +":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that " +"uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1227 -msgid ":c:data:`PyExc_Warning`" -msgstr ":c:data:`PyExc_Warning`" +#: ../../c-api/exceptions.rst:1159 +msgid "Warning types" +msgstr "警告型別" -#: ../../c-api/exceptions.rst:1227 +#: ../../c-api/exceptions.rst:1169 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1227 -msgid "[3]_" -msgstr "[3]_" - -#: ../../c-api/exceptions.rst:1229 -msgid ":c:data:`PyExc_BytesWarning`" -msgstr ":c:data:`PyExc_BytesWarning`" - -#: ../../c-api/exceptions.rst:1229 +#: ../../c-api/exceptions.rst:1171 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1231 -msgid ":c:data:`PyExc_DeprecationWarning`" -msgstr ":c:data:`PyExc_DeprecationWarning`" - -#: ../../c-api/exceptions.rst:1231 +#: ../../c-api/exceptions.rst:1173 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1233 -msgid ":c:data:`PyExc_EncodingWarning`" -msgstr ":c:data:`PyExc_EncodingWarning`" - -#: ../../c-api/exceptions.rst:1233 +#: ../../c-api/exceptions.rst:1175 msgid ":exc:`EncodingWarning`" msgstr ":exc:`EncodingWarning`" -#: ../../c-api/exceptions.rst:1235 -msgid ":c:data:`PyExc_FutureWarning`" -msgstr ":c:data:`PyExc_FutureWarning`" - -#: ../../c-api/exceptions.rst:1235 +#: ../../c-api/exceptions.rst:1177 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1237 -msgid ":c:data:`PyExc_ImportWarning`" -msgstr ":c:data:`PyExc_ImportWarning`" - -#: ../../c-api/exceptions.rst:1237 +#: ../../c-api/exceptions.rst:1179 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1239 -msgid ":c:data:`PyExc_PendingDeprecationWarning`" -msgstr ":c:data:`PyExc_PendingDeprecationWarning`" - -#: ../../c-api/exceptions.rst:1239 +#: ../../c-api/exceptions.rst:1181 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1241 -msgid ":c:data:`PyExc_ResourceWarning`" -msgstr ":c:data:`PyExc_ResourceWarning`" - -#: ../../c-api/exceptions.rst:1241 +#: ../../c-api/exceptions.rst:1183 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1243 -msgid ":c:data:`PyExc_RuntimeWarning`" -msgstr ":c:data:`PyExc_RuntimeWarning`" - -#: ../../c-api/exceptions.rst:1243 +#: ../../c-api/exceptions.rst:1185 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1245 -msgid ":c:data:`PyExc_SyntaxWarning`" -msgstr ":c:data:`PyExc_SyntaxWarning`" - -#: ../../c-api/exceptions.rst:1245 +#: ../../c-api/exceptions.rst:1187 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1247 -msgid ":c:data:`PyExc_UnicodeWarning`" -msgstr ":c:data:`PyExc_UnicodeWarning`" - -#: ../../c-api/exceptions.rst:1247 +#: ../../c-api/exceptions.rst:1189 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1249 -msgid ":c:data:`PyExc_UserWarning`" -msgstr ":c:data:`PyExc_UserWarning`" - -#: ../../c-api/exceptions.rst:1249 +#: ../../c-api/exceptions.rst:1191 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1252 +#: ../../c-api/exceptions.rst:1193 msgid ":c:data:`PyExc_ResourceWarning`." -msgstr ":c:data:`PyExc_ResourceWarning`." +msgstr ":c:data:`PyExc_ResourceWarning`。" -#: ../../c-api/exceptions.rst:1255 +#: ../../c-api/exceptions.rst:1196 msgid ":c:data:`PyExc_EncodingWarning`." -msgstr ":c:data:`PyExc_EncodingWarning`" - -#: ../../c-api/exceptions.rst:1261 -msgid "This is a base class for other standard warning categories." -msgstr "" +msgstr ":c:data:`PyExc_EncodingWarning`。" #: ../../c-api/exceptions.rst:183 msgid "strerror (C function)" @@ -1724,283 +1444,3 @@ msgstr "SIGINT(C 巨集)" #: ../../c-api/exceptions.rst:683 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_BaseException (C var)" -msgstr "PyExc_BaseException(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_BaseExceptionGroup (C var)" -msgstr "PyExc_BaseExceptionGroup(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_Exception (C var)" -msgstr "PyExc_Exception(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ArithmeticError (C var)" -msgstr "PyExc_ArithmeticError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_AssertionError (C var)" -msgstr "PyExc_AssertionError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_AttributeError (C var)" -msgstr "PyExc_AttributeError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_BlockingIOError (C var)" -msgstr "PyExc_BlockingIOError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_BrokenPipeError (C var)" -msgstr "PyExc_BrokenPipeError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_BufferError (C var)" -msgstr "PyExc_BufferError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ChildProcessError (C var)" -msgstr "PyExc_ChildProcessError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ConnectionAbortedError (C var)" -msgstr "PyExc_ConnectionAbortedError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ConnectionError (C var)" -msgstr "PyExc_ConnectionError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ConnectionRefusedError (C var)" -msgstr "PyExc_ConnectionRefusedError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ConnectionResetError (C var)" -msgstr "PyExc_ConnectionResetError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_EOFError (C var)" -msgstr "PyExc_EOFError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_FileExistsError (C var)" -msgstr "PyExc_FileExistsError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_FileNotFoundError (C var)" -msgstr "PyExc_FileNotFoundError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_FloatingPointError (C var)" -msgstr "PyExc_FloatingPointError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_GeneratorExit (C var)" -msgstr "PyExc_GeneratorExit(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ImportError (C var)" -msgstr "PyExc_ImportError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_IndentationError (C var)" -msgstr "PyExc_IndentationError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_IndexError (C var)" -msgstr "PyExc_IndexError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_InterruptedError (C var)" -msgstr "PyExc_InterruptedError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_IsADirectoryError (C var)" -msgstr "PyExc_IsADirectoryError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_KeyError (C var)" -msgstr "PyExc_KeyError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_KeyboardInterrupt (C var)" -msgstr "PyExc_KeyboardInterrupt(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_LookupError (C var)" -msgstr "PyExc_LookupError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_MemoryError (C var)" -msgstr "PyExc_MemoryError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ModuleNotFoundError (C var)" -msgstr "PyExc_ModuleNotFoundError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_NameError (C var)" -msgstr "PyExc_NameError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_NotADirectoryError (C var)" -msgstr "PyExc_NotADirectoryError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_NotImplementedError (C var)" -msgstr "PyExc_NotImplementedError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_OSError (C var)" -msgstr "PyExc_OSError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_OverflowError (C var)" -msgstr "PyExc_OverflowError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_PermissionError (C var)" -msgstr "PyExc_PermissionError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ProcessLookupError (C var)" -msgstr "PyExc_ProcessLookupError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_PythonFinalizationError (C var)" -msgstr "PyExc_PythonFinalizationError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_RecursionError (C var)" -msgstr "PyExc_RecursionError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ReferenceError (C var)" -msgstr "PyExc_ReferenceError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_RuntimeError (C var)" -msgstr "PyExc_RuntimeError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_StopAsyncIteration (C var)" -msgstr "PyExc_StopAsyncIteration(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_StopIteration (C var)" -msgstr "PyExc_StopIteration(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_SyntaxError (C var)" -msgstr "PyExc_SyntaxError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_SystemError (C var)" -msgstr "PyExc_SystemError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_SystemExit (C var)" -msgstr "PyExc_SystemExit(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_TabError (C var)" -msgstr "PyExc_TabError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_TimeoutError (C var)" -msgstr "PyExc_TimeoutError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_TypeError (C var)" -msgstr "PyExc_TypeError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_UnboundLocalError (C var)" -msgstr "PyExc_UnboundLocalError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_UnicodeDecodeError (C var)" -msgstr "PyExc_UnicodeDecodeError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_UnicodeEncodeError (C var)" -msgstr "PyExc_UnicodeEncodeError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_UnicodeError (C var)" -msgstr "PyExc_UnicodeError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_UnicodeTranslateError (C var)" -msgstr "PyExc_UnicodeTranslateError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ValueError (C var)" -msgstr "PyExc_ValueError(C 變數)" - -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ZeroDivisionError (C var)" -msgstr "PyExc_ZeroDivisionError(C 變數)" - -#: ../../c-api/exceptions.rst:1173 -msgid "PyExc_EnvironmentError (C var)" -msgstr "PyExc_EnvironmentError(C 變數)" - -#: ../../c-api/exceptions.rst:1173 -msgid "PyExc_IOError (C var)" -msgstr "PyExc_IOError(C 變數)" - -#: ../../c-api/exceptions.rst:1173 -msgid "PyExc_WindowsError (C var)" -msgstr "PyExc_WindowsError(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_Warning (C var)" -msgstr "PyExc_Warning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_BytesWarning (C var)" -msgstr "PyExc_BytesWarning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_DeprecationWarning (C var)" -msgstr "PyExc_DeprecationWarning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_EncodingWarning (C var)" -msgstr "PyExc_EncodingWarning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_FutureWarning (C var)" -msgstr "PyExc_FutureWarning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_ImportWarning (C var)" -msgstr "PyExc_ImportWarning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_PendingDeprecationWarning (C var)" -msgstr "PyExc_PendingDeprecationWarning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_ResourceWarning (C var)" -msgstr "PyExc_ResourceWarning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_RuntimeWarning (C var)" -msgstr "PyExc_RuntimeWarning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_SyntaxWarning (C var)" -msgstr "PyExc_SyntaxWarning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_UnicodeWarning (C var)" -msgstr "PyExc_UnicodeWarning(C 變數)" - -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_UserWarning (C var)" -msgstr "PyExc_UserWarning(C 變數)" diff --git a/glossary.po b/glossary.po index df20e8a0a7..b37eac2b1d 100644 --- a/glossary.po +++ b/glossary.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-03-19 00:14+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,23 +68,22 @@ msgid "" "define interfaces when other techniques like :func:`hasattr` would be clumsy " "or subtly wrong (for example with :ref:`magic methods `). " "ABCs introduce virtual subclasses, which are classes that don't inherit from " -"a class but are still recognized by :func:`isinstance` " -"and :func:`issubclass`; see the :mod:`abc` module documentation. Python " -"comes with many built-in ABCs for data structures (in " -"the :mod:`collections.abc` module), numbers (in the :mod:`numbers` module), " -"streams (in the :mod:`io` module), import finders and loaders (in " -"the :mod:`importlib.abc` module). You can create your own ABCs with " -"the :mod:`abc` module." +"a class but are still recognized by :func:`isinstance` and :func:" +"`issubclass`; see the :mod:`abc` module documentation. Python comes with " +"many built-in ABCs for data structures (in the :mod:`collections.abc` " +"module), numbers (in the :mod:`numbers` module), streams (in the :mod:`io` " +"module), import finders and loaders (in the :mod:`importlib.abc` module). " +"You can create your own ABCs with the :mod:`abc` module." msgstr "" "抽象基底類別(又稱為 ABC)提供了一種定義介面的方法,作為 :term:`duck-" "typing`\\ (鴨子型別)的補充。其他類似的技術,像是 :func:`hasattr`,則顯得笨" "拙或是帶有細微的錯誤(例如使用\\ :ref:`魔術方法 (magic method) `\\ )。ABC 採用虛擬的 subclass(子類別),它們並不繼承自另一個 class" -"(類別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參" -"閱 :mod:`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構" -"(在 :mod:`collections.abc` 模組)、數字(在 :mod:`numbers` 模組)、串流" -"(在 :mod:`io` 模組)及 import 尋檢器和載入器(在 :mod:`importlib.abc` 模" -"組)。你可以使用 :mod:`abc` 模組建立自己的 ABC。" +"(類別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參閱 :" +"mod:`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構(在 :mod:" +"`collections.abc` 模組)、數字(在 :mod:`numbers` 模組)、串流(在 :mod:`io` " +"模組)及 import 尋檢器和載入器(在 :mod:`importlib.abc` 模組)。你可以使用 :" +"mod:`abc` 模組建立自己的 ABC。" #: ../../glossary.rst:38 msgid "annotation" @@ -112,12 +111,12 @@ msgstr "" #: ../../glossary.rst:50 msgid "" "See :term:`variable annotation`, :term:`function annotation`, :pep:`484` " -"and :pep:`526`, which describe this functionality. Also " -"see :ref:`annotations-howto` for best practices on working with annotations." +"and :pep:`526`, which describe this functionality. Also see :ref:" +"`annotations-howto` for best practices on working with annotations." msgstr "" "請參閱 :term:`variable annotation`、:term:`function annotation`、:pep:`484` " -"和 :pep:`526`,這些章節皆有此功能的說明。關於註釋的最佳實踐方法也請參" -"閱 :ref:`annotations-howto`。" +"和 :pep:`526`,這些章節皆有此功能的說明。關於註釋的最佳實踐方法也請參閱 :ref:" +"`annotations-howto`。" #: ../../glossary.rst:54 msgid "argument" @@ -197,12 +196,12 @@ msgstr "asynchronous context manager(非同步情境管理器)" #: ../../glossary.rst:86 msgid "" "An object which controls the environment seen in an :keyword:`async with` " -"statement by defining :meth:`~object.__aenter__` " -"and :meth:`~object.__aexit__` methods. Introduced by :pep:`492`." +"statement by defining :meth:`~object.__aenter__` and :meth:`~object." +"__aexit__` methods. Introduced by :pep:`492`." msgstr "" -"一個可以控制 :keyword:`async with` 陳述式中所見環境的物件,而它是透過定" -"義 :meth:`~object.__aenter__` 和 :meth:`~object.__aexit__` method(方法)來控" -"制的。由 :pep:`492` 引入。" +"一個可以控制 :keyword:`async with` 陳述式中所見環境的物件,而它是透過定義 :" +"meth:`~object.__aenter__` 和 :meth:`~object.__aexit__` method(方法)來控制" +"的。由 :pep:`492` 引入。" #: ../../glossary.rst:89 msgid "asynchronous generator" @@ -217,8 +216,8 @@ msgid "" msgstr "" "一個會回傳 :term:`asynchronous generator iterator`\\ (非同步產生器疊代器)的" "函式。它看起來像一個以 :keyword:`async def` 定義的協程函式 (coroutine " -"function),但不同的是它包含了 :keyword:`yield` 運算式,能生成一系列可用" -"於 :keyword:`async for` 迴圈的值。" +"function),但不同的是它包含了 :keyword:`yield` 運算式,能生成一系列可用於 :" +"keyword:`async for` 迴圈的值。" #: ../../glossary.rst:96 msgid "" @@ -249,15 +248,15 @@ msgstr "" #: ../../glossary.rst:107 msgid "" -"This is an :term:`asynchronous iterator` which when called using " -"the :meth:`~object.__anext__` method returns an awaitable object which will " -"execute the body of the asynchronous generator function until the " -"next :keyword:`yield` expression." +"This is an :term:`asynchronous iterator` which when called using the :meth:" +"`~object.__anext__` method returns an awaitable object which will execute " +"the body of the asynchronous generator function until the next :keyword:" +"`yield` expression." msgstr "" -"這是一個 :term:`asynchronous iterator`\\ (非同步疊代器),當它" -"以 :meth:`~object.__anext__` method 被呼叫時,會回傳一個可等待物件 " -"(awaitable object),該物件將執行非同步產生器的函式主體,直到遇到下一" -"個 :keyword:`yield` 運算式。" +"這是一個 :term:`asynchronous iterator`\\ (非同步疊代器),當它以 :meth:" +"`~object.__anext__` method 被呼叫時,會回傳一個可等待物件 (awaitable " +"object),該物件將執行非同步產生器的函式主體,直到遇到下一個 :keyword:`yield` " +"運算式。" #: ../../glossary.rst:112 msgid "" @@ -268,9 +267,9 @@ msgid "" "off. See :pep:`492` and :pep:`525`." msgstr "" "每個 :keyword:`yield` 會暫停處理程序,並記住執行狀態(包括區域變數及擱置中的 " -"try 陳述式)。當\\ *非同步產生器疊代器*\\ 以另一個" -"被 :meth:`~object.__anext__` 回傳的可等待物件有效地回復時,它會從停止的地方繼" -"續執行。請參閱 :pep:`492` 和 :pep:`525`。" +"try 陳述式)。當\\ *非同步產生器疊代器*\\ 以另一個被 :meth:`~object." +"__anext__` 回傳的可等待物件有效地回復時,它會從停止的地方繼續執行。請參閱 :" +"pep:`492` 和 :pep:`525`。" #: ../../glossary.rst:117 msgid "asynchronous iterable" @@ -282,9 +281,9 @@ msgid "" "return an :term:`asynchronous iterator` from its :meth:`~object.__aiter__` " "method. Introduced by :pep:`492`." msgstr "" -"一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它" -"的 :meth:`~object.__aiter__` method 回傳一個 :term:`asynchronous iterator`\\ " -"(非同步疊代器)。由 :pep:`492` 引入。" +"一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它的 :meth:" +"`~object.__aiter__` method 回傳一個 :term:`asynchronous iterator`\\ (非同步" +"疊代器)。由 :pep:`492` 引入。" #: ../../glossary.rst:122 msgid "asynchronous iterator" @@ -292,18 +291,17 @@ msgstr "asynchronous iterator(非同步疊代器)" #: ../../glossary.rst:124 msgid "" -"An object that implements the :meth:`~object.__aiter__` " -"and :meth:`~object.__anext__` methods. :meth:`~object.__anext__` must " -"return an :term:`awaitable` object. :keyword:`async for` resolves the " -"awaitables returned by an asynchronous iterator's :meth:`~object.__anext__` " -"method until it raises a :exc:`StopAsyncIteration` exception. Introduced " -"by :pep:`492`." +"An object that implements the :meth:`~object.__aiter__` and :meth:`~object." +"__anext__` methods. :meth:`~object.__anext__` must return an :term:" +"`awaitable` object. :keyword:`async for` resolves the awaitables returned by " +"an asynchronous iterator's :meth:`~object.__anext__` method until it raises " +"a :exc:`StopAsyncIteration` exception. Introduced by :pep:`492`." msgstr "" "一個實作 :meth:`~object.__aiter__` 和 :meth:`~object.__anext__` method 的物" "件。:meth:`~object.__anext__` 必須回傳一個 :term:`awaitable`\\ (可等待物" "件)。:keyword:`async for` 會解析非同步疊代器的 :meth:`~object.__anext__` " -"method 所回傳的可等待物件,直到它引發 :exc:`StopAsyncIteration` 例外。" -"由 :pep:`492` 引入。" +"method 所回傳的可等待物件,直到它引發 :exc:`StopAsyncIteration` 例外。由 :" +"pep:`492` 引入。" #: ../../glossary.rst:129 msgid "attribute" @@ -321,10 +319,10 @@ msgstr "" #: ../../glossary.rst:136 msgid "" "It is possible to give an object an attribute whose name is not an " -"identifier as defined by :ref:`identifiers`, for example " -"using :func:`setattr`, if the object allows it. Such an attribute will not " -"be accessible using a dotted expression, and would instead need to be " -"retrieved with :func:`getattr`." +"identifier as defined by :ref:`identifiers`, for example using :func:" +"`setattr`, if the object allows it. Such an attribute will not be accessible " +"using a dotted expression, and would instead need to be retrieved with :func:" +"`getattr`." msgstr "" "如果一個物件允許,給予該物件一個名稱不是由\\ :ref:`identifiers`\\ 所定義之識" "別符 (identifier) 的屬性是有可能的,例如使用 :func:`setattr`。像這樣的屬性將" @@ -336,13 +334,13 @@ msgstr "awaitable(可等待物件)" #: ../../glossary.rst:143 msgid "" -"An object that can be used in an :keyword:`await` expression. Can be " -"a :term:`coroutine` or an object with an :meth:`~object.__await__` method. " -"See also :pep:`492`." +"An object that can be used in an :keyword:`await` expression. Can be a :" +"term:`coroutine` or an object with an :meth:`~object.__await__` method. See " +"also :pep:`492`." msgstr "" -"一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一" -"個 :term:`coroutine`\\ (協程),或是一個有 :meth:`~object.__await__` method " -"的物件。另請參閱 :pep:`492`。" +"一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一個 :term:" +"`coroutine`\\ (協程),或是一個有 :meth:`~object.__await__` method 的物件。" +"另請參閱 :pep:`492`。" #: ../../glossary.rst:146 msgid "BDFL" @@ -350,8 +348,8 @@ msgstr "BDFL" #: ../../glossary.rst:148 msgid "" -"Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." +"Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." msgstr "" "Benevolent Dictator For Life(終身仁慈獨裁者),又名 `Guido van Rossum " "`_,Python 的創造者。" @@ -364,23 +362,23 @@ msgstr "binary file(二進位檔案)" msgid "" "A :term:`file object` able to read and write :term:`bytes-like objects " "`. Examples of binary files are files opened in binary " -"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer " -"`, :data:`sys.stdout.buffer `, and instances " -"of :class:`io.BytesIO` and :class:`gzip.GzipFile`." +"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer `, :data:`sys.stdout.buffer `, and instances of :class:`io." +"BytesIO` and :class:`gzip.GzipFile`." msgstr "" "一個能夠讀取和寫入 :term:`bytes-like objects `\\ (類位元" "組串物件)的 :term:`file object`\\ (檔案物件)。二進位檔案的例子有:以二進位" "模式(``'rb'``、``'wb'`` 或 ``'rb+'``)開啟的檔案、:data:`sys.stdin.buffer " -"`、:data:`sys.stdout.buffer `,以" -"及 :class:`io.BytesIO` 和 :class:`gzip.GzipFile` 實例。" +"`、:data:`sys.stdout.buffer `,以及 :class:`io." +"BytesIO` 和 :class:`gzip.GzipFile` 實例。" #: ../../glossary.rst:159 msgid "" -"See also :term:`text file` for a file object able to read and " -"write :class:`str` objects." +"See also :term:`text file` for a file object able to read and write :class:" +"`str` objects." msgstr "" -"另請參閱 :term:`text file`\\ (文字檔案),它是一個能夠讀取和寫" -"入 :class:`str` 物件的檔案物件。" +"另請參閱 :term:`text file`\\ (文字檔案),它是一個能夠讀取和寫入 :class:" +"`str` 物件的檔案物件。" #: ../../glossary.rst:161 msgid "borrowed reference" @@ -402,8 +400,8 @@ msgstr "" msgid "" "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " "to convert it to a :term:`strong reference` in-place, except when the object " -"cannot be destroyed before the last usage of the borrowed reference. " -"The :c:func:`Py_NewRef` function can be used to create a new :term:`strong " +"cannot be destroyed before the last usage of the borrowed reference. The :c:" +"func:`Py_NewRef` function can be used to create a new :term:`strong " "reference`." msgstr "" "對 :term:`borrowed reference` 呼叫 :c:func:`Py_INCREF` 以將它原地 (in-place) " @@ -417,12 +415,12 @@ msgstr "bytes-like object(類位元組串物件)" #: ../../glossary.rst:176 msgid "" -"An object that supports the :ref:`bufferobjects` and can export a " -"C-:term:`contiguous` buffer. This includes " -"all :class:`bytes`, :class:`bytearray`, and :class:`array.array` objects, as " -"well as many common :class:`memoryview` objects. Bytes-like objects can be " -"used for various operations that work with binary data; these include " -"compression, saving to a binary file, and sending over a socket." +"An object that supports the :ref:`bufferobjects` and can export a C-:term:" +"`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, " +"and :class:`array.array` objects, as well as many common :class:`memoryview` " +"objects. Bytes-like objects can be used for various operations that work " +"with binary data; these include compression, saving to a binary file, and " +"sending over a socket." msgstr "" "一個支援\\ :ref:`bufferobjects`\\ 且能夠匯出 C-:term:`contiguous` 緩衝區的物" "件。這包括所有的 :class:`bytes`、:class:`bytearray` 和 :class:`array.array` " @@ -433,9 +431,9 @@ msgstr "" msgid "" "Some operations need the binary data to be mutable. The documentation often " "refers to these as \"read-write bytes-like objects\". Example mutable " -"buffer objects include :class:`bytearray` and a :class:`memoryview` of " -"a :class:`bytearray`. Other operations require the binary data to be stored " -"in immutable objects (\"read-only bytes-like objects\"); examples of these " +"buffer objects include :class:`bytearray` and a :class:`memoryview` of a :" +"class:`bytearray`. Other operations require the binary data to be stored in " +"immutable objects (\"read-only bytes-like objects\"); examples of these " "include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." msgstr "" "有些運算需要二進位資料是可變的。說明文件通常會將這些物件稱為「可讀寫的類位元" @@ -469,8 +467,8 @@ msgstr "" #: ../../glossary.rst:203 msgid "" -"A list of bytecode instructions can be found in the documentation " -"for :ref:`the dis module `." +"A list of bytecode instructions can be found in the documentation for :ref:" +"`the dis module `." msgstr "" "位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" @@ -483,8 +481,8 @@ msgid "" "A callable is an object that can be called, possibly with a set of arguments " "(see :term:`argument`), with the following syntax::" msgstr "" -"一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請" -"見 :term:`argument`): ::" +"一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請見 :" +"term:`argument`): ::" #: ../../glossary.rst:210 msgid "callable(argument1, argument2, argumentN)" @@ -496,8 +494,8 @@ msgid "" "instance of a class that implements the :meth:`~object.__call__` method is " "also a callable." msgstr "" -"一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實" -"作 :meth:`~object.__call__` 方法的 class 之實例也是個 callable。" +"一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實作 :" +"meth:`~object.__call__` 方法的 class 之實例也是個 callable。" #: ../../glossary.rst:215 msgid "callback" @@ -542,9 +540,9 @@ msgstr "closure variable(閉包變數)" msgid "" "A :term:`free variable` referenced from a :term:`nested scope` that is " "defined in an outer scope rather than being resolved at runtime from the " -"globals or builtin namespaces. May be explicitly defined with " -"the :keyword:`nonlocal` keyword to allow write access, or implicitly defined " -"if the variable is only being read." +"globals or builtin namespaces. May be explicitly defined with the :keyword:" +"`nonlocal` keyword to allow write access, or implicitly defined if the " +"variable is only being read." msgstr "" "從外部作用域中定義且從\\ :term:`巢狀作用域 `\\ 參照的\\ :term:`" "自由變數 `,不是於 runtime 從全域或內建命名空間解析。可以使" @@ -609,10 +607,10 @@ msgstr "" "一個我們熟悉的實數系統的擴充,在此所有數字都會被表示為一個實部和一個虛部之" "和。虛數就是虛數單位(``-1`` 的平方根)的實數倍,此單位通常在數學中被寫為 " "``i``,在工程學中被寫為 ``j``。Python 內建了對複數的支援,它是用後者的記法來" -"表示複數;虛部會帶著一個後綴的 ``j`` 被編寫,例如 ``3+1j``。若要" -"將 :mod:`math` 模組內的工具等效地用於複數,請使用 :mod:`cmath` 模組。複數的使" -"用是一個相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可" -"以安全地忽略它們。" +"表示複數;虛部會帶著一個後綴的 ``j`` 被編寫,例如 ``3+1j``。若要將 :mod:" +"`math` 模組內的工具等效地用於複數,請使用 :mod:`cmath` 模組。複數的使用是一個" +"相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" +"忽略它們。" #: ../../glossary.rst:262 msgid "context" @@ -632,10 +630,9 @@ msgstr "" #: ../../glossary.rst:269 msgid "" -"The collection of key­value bindings associated with a " -"particular :class:`contextvars.Context` object and accessed " -"via :class:`~contextvars.ContextVar` objects. Also see :term:`context " -"variable`." +"The collection of key­value bindings associated with a particular :class:" +"`contextvars.Context` object and accessed via :class:`~contextvars." +"ContextVar` objects. Also see :term:`context variable`." msgstr "" #: ../../glossary.rst:273 @@ -653,8 +650,8 @@ msgid "" "The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by " "the :keyword:`with` statement. See :pep:`343`." msgstr "" -"由 :keyword:`with` 陳述式所呼叫的 :meth:`~object.__enter__` " -"和 :meth:`~object.__exit__` 方法。另請參閱 :pep:`343`。" +"由 :keyword:`with` 陳述式所呼叫的 :meth:`~object.__enter__` 和 :meth:" +"`~object.__exit__` 方法。另請參閱 :pep:`343`。" #: ../../glossary.rst:279 msgid "context manager" @@ -663,8 +660,8 @@ msgstr "context manager(情境管理器)" #: ../../glossary.rst:281 msgid "" "An object which implements the :term:`context management protocol` and " -"controls the environment seen in a :keyword:`with` statement. " -"See :pep:`343`." +"controls the environment seen in a :keyword:`with` statement. See :pep:" +"`343`." msgstr "" #: ../../glossary.rst:284 @@ -722,14 +719,13 @@ msgstr "coroutine function(協程函式)" #: ../../glossary.rst:311 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " -"may be defined with the :keyword:`async def` statement, and may " -"contain :keyword:`await`, :keyword:`async for`, and :keyword:`async with` " -"keywords. These were introduced by :pep:`492`." +"may be defined with the :keyword:`async def` statement, and may contain :" +"keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords. " +"These were introduced by :pep:`492`." msgstr "" -"一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能" -"以 :keyword:`async def` 陳述式被定義,並可能會包" -"含 :keyword:`await`、:keyword:`async for` 和 :keyword:`async with` 關鍵字。這" -"些關鍵字由 :pep:`492` 引入。" +"一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能以 :keyword:" +"`async def` 陳述式被定義,並可能會包含 :keyword:`await`、:keyword:`async " +"for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" #: ../../glossary.rst:316 msgid "CPython" @@ -755,9 +751,9 @@ msgid "" "The :term:`context` (:class:`contextvars.Context` object) that is currently " "used by :class:`~contextvars.ContextVar` objects to access (get or set) the " "values of :term:`context variables `. Each thread has its " -"own current context. Frameworks for executing asynchronous tasks " -"(see :mod:`asyncio`) associate each task with a context which becomes the " -"current context whenever the task starts or resumes execution." +"own current context. Frameworks for executing asynchronous tasks (see :mod:" +"`asyncio`) associate each task with a context which becomes the current " +"context whenever the task starts or resumes execution." msgstr "" #: ../../glossary.rst:330 @@ -804,8 +800,8 @@ msgid "" "the documentation for :ref:`function definitions ` and :ref:`class " "definitions ` for more about decorators." msgstr "" -"Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱" -"\\ :ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" +"Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" +"ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" #: ../../glossary.rst:350 msgid "descriptor" @@ -813,24 +809,23 @@ msgstr "descriptor(描述器)" #: ../../glossary.rst:352 msgid "" -"Any object which defines the " -"methods :meth:`~object.__get__`, :meth:`~object.__set__`, " -"or :meth:`~object.__delete__`. When a class attribute is a descriptor, its " -"special binding behavior is triggered upon attribute lookup. Normally, " -"using *a.b* to get, set or delete an attribute looks up the object named *b* " -"in the class dictionary for *a*, but if *b* is a descriptor, the respective " -"descriptor method gets called. Understanding descriptors is a key to a deep " -"understanding of Python because they are the basis for many features " -"including functions, methods, properties, class methods, static methods, and " -"reference to super classes." -msgstr "" -"任何定義了 :meth:`~object.__get__`、:meth:`~object.__set__` " -"或 :meth:`~object.__delete__` method 的物件。當一個 class 屬性是一個描述器" -"時,它的特殊連結行為會在屬性查找時被觸發。通常,使用 *a.b* 來取得、設定或刪除" -"某個屬性時,會在 *a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個" -"描述器,則相對應的描述器 method 會被呼叫。對描述器的理解是深入理解 Python 的" -"關鍵,因為它們是許多功能的基礎,這些功能包括函式、method、屬性 (property)、" -"class method、靜態 method,以及對 super class(父類別)的參照。" +"Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." +"__set__`, or :meth:`~object.__delete__`. When a class attribute is a " +"descriptor, its special binding behavior is triggered upon attribute " +"lookup. Normally, using *a.b* to get, set or delete an attribute looks up " +"the object named *b* in the class dictionary for *a*, but if *b* is a " +"descriptor, the respective descriptor method gets called. Understanding " +"descriptors is a key to a deep understanding of Python because they are the " +"basis for many features including functions, methods, properties, class " +"methods, static methods, and reference to super classes." +msgstr "" +"任何定義了 :meth:`~object.__get__`、:meth:`~object.__set__` 或 :meth:" +"`~object.__delete__` method 的物件。當一個 class 屬性是一個描述器時,它的特殊" +"連結行為會在屬性查找時被觸發。通常,使用 *a.b* 來取得、設定或刪除某個屬性時," +"會在 *a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器,則相" +"對應的描述器 method 會被呼叫。對描述器的理解是深入理解 Python 的關鍵,因為它" +"們是許多功能的基礎,這些功能包括函式、method、屬性 (property)、class method、" +"靜態 method,以及對 super class(父類別)的參照。" #: ../../glossary.rst:363 msgid "" @@ -875,11 +870,11 @@ msgstr "dictionary view(字典檢視)" #: ../../glossary.rst:379 msgid "" -"The objects returned from :meth:`dict.keys`, :meth:`dict.values`, " -"and :meth:`dict.items` are called dictionary views. They provide a dynamic " -"view on the dictionary’s entries, which means that when the dictionary " -"changes, the view reflects these changes. To force the dictionary view to " -"become a full list use ``list(dictview)``. See :ref:`dict-views`." +"The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" +"`dict.items` are called dictionary views. They provide a dynamic view on the " +"dictionary’s entries, which means that when the dictionary changes, the view " +"reflects these changes. To force the dictionary view to become a full list " +"use ``list(dictview)``. See :ref:`dict-views`." msgstr "" "從 :meth:`dict.keys`、:meth:`dict.values` 及 :meth:`dict.items` 回傳的物件被" "稱為字典檢視。它們提供了字典中項目的動態檢視,這表示當字典有變動時,該檢視會" @@ -899,9 +894,9 @@ msgid "" "introspection, it is the canonical place for documentation of the object." msgstr "" "一個在 class、函式或模組中,作為第一個運算式出現的字串文本。雖然它在套件執行" -"時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組" -"的 :attr:`~definition.__doc__` 屬性中。由於說明字串可以透過內省 " -"(introspection) 來瀏覽,因此它是物件的說明文件存放的標準位置。" +"時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組的 :attr:" +"`~definition.__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏" +"覽,因此它是物件的說明文件存放的標準位置。" #: ../../glossary.rst:393 msgid "duck-typing" @@ -914,10 +909,10 @@ msgid "" "called or used (\"If it looks like a duck and quacks like a duck, it must be " "a duck.\") By emphasizing interfaces rather than specific types, well-" "designed code improves its flexibility by allowing polymorphic " -"substitution. Duck-typing avoids tests using :func:`type` " -"or :func:`isinstance`. (Note, however, that duck-typing can be complemented " -"with :term:`abstract base classes `.) Instead, it " -"typically employs :func:`hasattr` tests or :term:`EAFP` programming." +"substitution. Duck-typing avoids tests using :func:`type` or :func:" +"`isinstance`. (Note, however, that duck-typing can be complemented with :" +"term:`abstract base classes `.) Instead, it typically " +"employs :func:`hasattr` tests or :term:`EAFP` programming." msgstr "" "一種程式設計風格,它不是藉由檢查一個物件的型別來確定它是否具有正確的介面;取" "而代之的是,method 或屬性會單純地被呼叫或使用。(「如果它看起來像一隻鴨子而且" @@ -943,9 +938,9 @@ msgid "" msgstr "" "Easier to ask for forgiveness than permission.(請求寬恕比請求許可更容易。)" "這種常見的 Python 編碼風格會先假設有效的鍵或屬性的存在,並在該假設被推翻時再" -"捕獲例外。這種乾淨且快速的風格,其特色是存在許多的 :keyword:`try` " -"和 :keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見" -"的 :term:`LBYL` 風格形成了對比。" +"捕獲例外。這種乾淨且快速的風格,其特色是存在許多的 :keyword:`try` 和 :" +"keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" +"格形成了對比。" #: ../../glossary.rst:412 msgid "expression" @@ -1019,10 +1014,9 @@ msgid "" "The canonical way to create a file object is by using the :func:`open` " "function." msgstr "" -"實際上,有三種檔案物件:原始的\\ :term:`二進位檔案 `、緩衝的" -"\\ :term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們" -"的介面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函" -"式。" +"實際上,有三種檔案物件:原始的\\ :term:`二進位檔案 `、緩衝的\\ :" +"term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們的介" +"面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函式。" #: ../../glossary.rst:445 msgid "file-like object" @@ -1055,9 +1049,9 @@ msgstr "" #: ../../glossary.rst:457 msgid "" -"The :func:`sys.getfilesystemencoding` " -"and :func:`sys.getfilesystemencodeerrors` functions can be used to get the " -"filesystem encoding and error handler." +"The :func:`sys.getfilesystemencoding` and :func:`sys." +"getfilesystemencodeerrors` functions can be used to get the filesystem " +"encoding and error handler." msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" @@ -1065,14 +1059,14 @@ msgstr "" #: ../../glossary.rst:461 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " -"startup by the :c:func:`PyConfig_Read` function: " -"see :c:member:`~PyConfig.filesystem_encoding` " -"and :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." +"startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." +"filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" +"c:type:`PyConfig`." msgstr "" ":term:`filesystem encoding and error handler`\\ (檔案系統編碼和錯誤處理函" -"式)會在 Python 啟動時由 :c:func:`PyConfig_Read` 函式來配置:請參" -"閱 :c:member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成" -"員 :c:member:`~PyConfig.filesystem_errors`。" +"式)會在 Python 啟動時由 :c:func:`PyConfig_Read` 函式來配置:請參閱 :c:" +"member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成員 :c:" +"member:`~PyConfig.filesystem_errors`。" #: ../../glossary.rst:466 msgid "See also the :term:`locale encoding`." @@ -1128,8 +1122,8 @@ msgstr "free threading(自由執行緒)" #: ../../glossary.rst:486 msgid "" "A threading model where multiple threads can run Python bytecode " -"simultaneously within the same interpreter. This is in contrast to " -"the :term:`global interpreter lock` which allows only one thread to execute " +"simultaneously within the same interpreter. This is in contrast to the :" +"term:`global interpreter lock` which allows only one thread to execute " "Python bytecode at a time. See :pep:`703`." msgstr "" "為一種執行緒模型,多個執行緒可以在同一直譯器中同時運行 Python 位元組碼。這與" @@ -1158,13 +1152,13 @@ msgstr "function(函式)" msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " -"execution of the body. See also :term:`parameter`, :term:`method`, and " -"the :ref:`function` section." +"execution of the body. See also :term:`parameter`, :term:`method`, and the :" +"ref:`function` section." msgstr "" "一連串的陳述式,它能夠向呼叫者回傳一些值。它也可以被傳遞零個或多個\\ :term:`" -"引數 `,這些引數可被使用於函式本體的執行。另請參" -"閱 :term:`parameter`\\ (參數)、:term:`method`\\ (方法),以及" -"\\ :ref:`function`\\ 章節。" +"引數 `,這些引數可被使用於函式本體的執行。另請參閱 :term:" +"`parameter`\\ (參數)、:term:`method`\\ (方法),以及\\ :ref:`function`\\ " +"章節。" #: ../../glossary.rst:503 msgid "function annotation" @@ -1212,8 +1206,8 @@ msgstr "__future__" msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " -"that will become standard in a future release of Python. " -"The :mod:`__future__` module documents the possible values of *feature*. By " +"that will become standard in a future release of Python. The :mod:" +"`__future__` module documents the possible values of *feature*. By " "importing this module and evaluating its variables, you can see when a new " "feature was first added to the language and when it will (or did) become the " "default::" @@ -1332,11 +1326,11 @@ msgstr "" #: ../../glossary.rst:578 msgid "" -"See also the :term:`single dispatch` glossary entry, " -"the :func:`functools.singledispatch` decorator, and :pep:`443`." +"See also the :term:`single dispatch` glossary entry, the :func:`functools." +"singledispatch` decorator, and :pep:`443`." msgstr "" -"另請參閱 :term:`single dispatch`\\ (單一調度)術語表條" -"目、:func:`functools.singledispatch` 裝飾器和 :pep:`443`。" +"另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、:func:`functools." +"singledispatch` 裝飾器和 :pep:`443`。" #: ../../glossary.rst:580 msgid "generic type" @@ -1345,21 +1339,20 @@ msgstr "generic type(泛型型別)" #: ../../glossary.rst:582 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " -"class` such as :class:`list` or :class:`dict`. Used " -"for :term:`type hints ` and :term:`annotations `." +"class` such as :class:`list` or :class:`dict`. Used for :" +"term:`type hints ` and :term:`annotations `." msgstr "" -"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一" -"個 :ref:`容器型別 `,像是 :class:`list` 和 :class:`dict`。它" -"被用於\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" +"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一個 :ref:" +"`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" +"\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" #: ../../glossary.rst:587 msgid "" -"For more details, see :ref:`generic alias types`, :pep:`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` " -"module." +"For more details, see :ref:`generic alias types`, :pep:" +"`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." msgstr "" -"詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:`484`、:pep:`585` 和 :mod:`typing` 模組。" +"詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" +"`484`、:pep:`585` 和 :mod:`typing` 模組。" #: ../../glossary.rst:589 msgid "GIL" @@ -1440,10 +1433,10 @@ msgid "" "compared to other objects (it needs an :meth:`~object.__eq__` method). " "Hashable objects which compare equal must have the same hash value." msgstr "" -"如果一個物件有一個雜湊值,該值在其生命週期中永不改變(它需要一" -"個 :meth:`~object.__hash__` method),且可與其他物件互相比較(它需要一" -"個 :meth:`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結" -"果為相等的多個可雜湊物件,它們必須擁有相同的雜湊值。" +"如果一個物件有一個雜湊值,該值在其生命週期中永不改變(它需要一個 :meth:" +"`~object.__hash__` method),且可與其他物件互相比較(它需要一個 :meth:" +"`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的" +"多個可雜湊物件,它們必須擁有相同的雜湊值。" #: ../../glossary.rst:627 msgid "" @@ -1488,8 +1481,8 @@ msgstr "immortal(不滅)" #: ../../glossary.rst:644 msgid "" -"*Immortal objects* are a CPython implementation detail introduced " -"in :pep:`683`." +"*Immortal objects* are a CPython implementation detail introduced in :pep:" +"`683`." msgstr "*不滅物件 (Immortal objects)* 是 :pep:`683` 引入的 CPython 實作細節。" #: ../../glossary.rst:647 @@ -1499,8 +1492,8 @@ msgid "" "example, :const:`True` and :const:`None` are immortal in CPython." msgstr "" "如果一個物件是不滅的,它的\\ :term:`參照計數 `\\ 永遠不會被" -"修改,因此在直譯器運行時它永遠不會被釋放。例如,:const:`True` " -"和 :const:`None` 在 CPython 中是不滅的。" +"修改,因此在直譯器運行時它永遠不會被釋放。例如,:const:`True` 和 :const:" +"`None` 在 CPython 中是不滅的。" #: ../../glossary.rst:650 msgid "immutable" @@ -1552,11 +1545,11 @@ msgstr "importer(引入器)" #: ../../glossary.rst:670 msgid "" -"An object that both finds and loads a module; both a :term:`finder` " -"and :term:`loader` object." +"An object that both finds and loads a module; both a :term:`finder` and :" +"term:`loader` object." msgstr "" -"一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也" -"是 :term:`loader`\\ (載入器)物件。" +"一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" +"`loader`\\ (載入器)物件。" #: ../../glossary.rst:672 msgid "interactive" @@ -1602,12 +1595,12 @@ msgstr "interpreter shutdown(直譯器關閉)" msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " -"critical internal structures. It also makes several calls to " -"the :term:`garbage collector `. This can trigger the " -"execution of code in user-defined destructors or weakref callbacks. Code " -"executed during the shutdown phase can encounter various exceptions as the " -"resources it relies on may not function anymore (common examples are library " -"modules or the warnings machinery)." +"critical internal structures. It also makes several calls to the :term:" +"`garbage collector `. This can trigger the execution of " +"code in user-defined destructors or weakref callbacks. Code executed during " +"the shutdown phase can encounter various exceptions as the resources it " +"relies on may not function anymore (common examples are library modules or " +"the warnings machinery)." msgstr "" "當 Python 直譯器被要求關閉時,它會進入一個特殊階段,在此它逐漸釋放所有被配置" "的資源,例如模組和各種關鍵內部結構。它也會多次呼叫\\ :term:`垃圾回收器 " @@ -1631,39 +1624,36 @@ msgstr "iterable(可疊代物件)" msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " -"and :class:`tuple`) and some non-sequence types " -"like :class:`dict`, :term:`file objects `, and objects of any " -"classes you define with an :meth:`~object.__iter__` method or with " -"a :meth:`~object.__getitem__` method that implements :term:`sequence` " -"semantics." +"and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" +"`file objects `, and objects of any classes you define with an :" +"meth:`~object.__iter__` method or with a :meth:`~object.__getitem__` method " +"that implements :term:`sequence` semantics." msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" -"是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像" -"是 :class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物" -"件,只要那些 class 有實作 :term:`sequence`\\ (序列)語意" -"的 :meth:`~object.__iter__` 或是 :meth:`~object.__getitem__` method,該物件就" -"是可疊代物件。" +"是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像是 :" +"class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物件," +"只要那些 class 有實作 :term:`sequence`\\ (序列)語意的 :meth:`~object." +"__iter__` 或是 :meth:`~object.__getitem__` method,該物件就是可疊代物件。" #: ../../glossary.rst:713 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " -"iterable object is passed as an argument to the built-in " -"function :func:`iter`, it returns an iterator for the object. This iterator " -"is good for one pass over the set of values. When using iterables, it is " -"usually not necessary to call :func:`iter` or deal with iterator objects " -"yourself. The :keyword:`for` statement does that automatically for you, " -"creating a temporary unnamed variable to hold the iterator for the duration " -"of the loop. See also :term:`iterator`, :term:`sequence`, " -"and :term:`generator`." -msgstr "" -"可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 " -"(:func:`zip`、:func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函" -"式 :func:`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行" -"一遍 (one pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理" -"疊代器物件。:keyword:`for` 陳述式會自動地為你處理這些事,它會建立一個暫時性的" -"未命名變數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代" -"器)、:term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" +"iterable object is passed as an argument to the built-in function :func:" +"`iter`, it returns an iterator for the object. This iterator is good for " +"one pass over the set of values. When using iterables, it is usually not " +"necessary to call :func:`iter` or deal with iterator objects yourself. The :" +"keyword:`for` statement does that automatically for you, creating a " +"temporary unnamed variable to hold the iterator for the duration of the " +"loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`." +msgstr "" +"可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 (:func:" +"`zip`、:func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函式 :func:" +"`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行一遍 (one " +"pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理疊代器物" +"件。:keyword:`for` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變" +"數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:" +"term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" #: ../../glossary.rst:723 msgid "iterator" @@ -1671,33 +1661,32 @@ msgstr "iterator(疊代器)" #: ../../glossary.rst:725 msgid "" -"An object representing a stream of data. Repeated calls to the " -"iterator's :meth:`~iterator.__next__` method (or passing it to the built-in " -"function :func:`next`) return successive items in the stream. When no more " -"data are available a :exc:`StopIteration` exception is raised instead. At " -"this point, the iterator object is exhausted and any further calls to " -"its :meth:`!__next__` method just raise :exc:`StopIteration` again. " -"Iterators are required to have an :meth:`~iterator.__iter__` method that " -"returns the iterator object itself so every iterator is also iterable and " -"may be used in most places where other iterables are accepted. One notable " -"exception is code which attempts multiple iteration passes. A container " -"object (such as a :class:`list`) produces a fresh new iterator each time you " -"pass it to the :func:`iter` function or use it in a :keyword:`for` loop. " -"Attempting this with an iterator will just return the same exhausted " -"iterator object used in the previous iteration pass, making it appear like " -"an empty container." +"An object representing a stream of data. Repeated calls to the iterator's :" +"meth:`~iterator.__next__` method (or passing it to the built-in function :" +"func:`next`) return successive items in the stream. When no more data are " +"available a :exc:`StopIteration` exception is raised instead. At this " +"point, the iterator object is exhausted and any further calls to its :meth:`!" +"__next__` method just raise :exc:`StopIteration` again. Iterators are " +"required to have an :meth:`~iterator.__iter__` method that returns the " +"iterator object itself so every iterator is also iterable and may be used in " +"most places where other iterables are accepted. One notable exception is " +"code which attempts multiple iteration passes. A container object (such as " +"a :class:`list`) produces a fresh new iterator each time you pass it to the :" +"func:`iter` function or use it in a :keyword:`for` loop. Attempting this " +"with an iterator will just return the same exhausted iterator object used in " +"the previous iteration pass, making it appear like an empty container." msgstr "" "一個表示資料流的物件。重複地呼叫疊代器的 :meth:`~iterator.__next__` method" "(或是將它傳遞給內建函式 :func:`next`\\ )會依序回傳資料流中的各項目。當不再" "有資料時,則會引發 :exc:`StopIteration` 例外。此時,該疊代器物件已被用盡,而" -"任何對其 :meth:`!__next__` method 的進一步呼叫,都只會再次引" -"發 :exc:`StopIteration`。疊代器必須有一個 :meth:`~iterator.__iter__` method," -"它會回傳疊代器物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用" -"其他可疊代物件的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration " -"passes) 的程式碼。一個容器物件(像是 :class:`list`)在每次你將它傳遞" -"給 :func:`iter` 函式或在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊" -"代器。使用疊代器嘗試此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一" -"個已被用盡的疊代器物件,使其看起來就像一個空的容器。" +"任何對其 :meth:`!__next__` method 的進一步呼叫,都只會再次引發 :exc:" +"`StopIteration`。疊代器必須有一個 :meth:`~iterator.__iter__` method,它會回傳" +"疊代器物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊" +"代物件的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程" +"式碼。一個容器物件(像是 :class:`list`)在每次你將它傳遞給 :func:`iter` 函式" +"或在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試" +"此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" +"件,使其看起來就像一個空的容器。" #: ../../glossary.rst:740 msgid "More information can be found in :ref:`typeiter`." @@ -1705,14 +1694,13 @@ msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" #: ../../glossary.rst:744 msgid "" -"CPython does not consistently apply the requirement that an iterator " -"define :meth:`~iterator.__iter__`. And also please note that the free-" -"threading CPython does not guarantee the thread-safety of iterator " -"operations." +"CPython does not consistently apply the requirement that an iterator define :" +"meth:`~iterator.__iter__`. And also please note that the free-threading " +"CPython does not guarantee the thread-safety of iterator operations." msgstr "" -"CPython 並不是始終如一地都會檢查「疊代器有定" -"義 :meth:`~iterator.__iter__`\\ 」這個規定。另請注意,free-threading(自由執" -"行緒)CPython 不保證疊代器操作的執行緒安全。" +"CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`~iterator." +"__iter__`\\ 」這個規定。另請注意,free-threading(自由執行緒)CPython 不保證" +"疊代器操作的執行緒安全。" #: ../../glossary.rst:749 msgid "key function" @@ -1731,31 +1719,31 @@ msgstr "" #: ../../glossary.rst:756 msgid "" "A number of tools in Python accept key functions to control how elements are " -"ordered or grouped. They " -"include :func:`min`, :func:`max`, :func:`sorted`, :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq.nlargest`, " -"and :func:`itertools.groupby`." +"ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" +"meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq." +"nlargest`, and :func:`itertools.groupby`." msgstr "" -"Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包" -"括 :func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq.merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` " -"和 :func:`itertools.groupby`。" +"Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包括 :" +"func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq." +"merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." +"groupby`。" #: ../../glossary.rst:762 msgid "" -"There are several ways to create a key function. For example. " -"the :meth:`str.lower` method can serve as a key function for case " -"insensitive sorts. Alternatively, a key function can be built from " -"a :keyword:`lambda` expression such as ``lambda r: (r[0], r[2])``. " -"Also, :func:`operator.attrgetter`, :func:`operator.itemgetter`, " -"and :func:`operator.methodcaller` are three key function constructors. See " -"the :ref:`Sorting HOW TO ` for examples of how to create and " -"use key functions." +"There are several ways to create a key function. For example. the :meth:" +"`str.lower` method can serve as a key function for case insensitive sorts. " +"Alternatively, a key function can be built from a :keyword:`lambda` " +"expression such as ``lambda r: (r[0], r[2])``. Also, :func:`operator." +"attrgetter`, :func:`operator.itemgetter`, and :func:`operator.methodcaller` " +"are three key function constructors. See the :ref:`Sorting HOW TO " +"` for examples of how to create and use key functions." msgstr "" "有幾種方法可以建立一個鍵函式。例如,:meth:`str.lower` method 可以作為不分大小" "寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造,例" -"如 ``lambda r: (r[0], r[2])``。另" -"外,:func:`operator.attrgetter`、:func:`operator.itemgetter` " -"和 :func:`operator.methodcaller` 為三個鍵函式的建構函式 (constructor)。關於如" -"何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 `。" +"如 ``lambda r: (r[0], r[2])``。另外,:func:`operator.attrgetter`、:func:" +"`operator.itemgetter` 和 :func:`operator.methodcaller` 為三個鍵函式的建構函" +"式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " +"`。" #: ../../glossary.rst:769 msgid "keyword argument" @@ -1791,8 +1779,8 @@ msgid "" "statements." msgstr "" "Look before you leap.(三思而後行。)這種編碼風格會在進行呼叫或查找之前,明確" -"地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許" -"多 :keyword:`if` 陳述式的存在。" +"地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" +"keyword:`if` 陳述式的存在。" #: ../../glossary.rst:784 msgid "" @@ -1844,9 +1832,9 @@ msgid "" msgstr "" "一種用來處理一個序列中的全部或部分元素,並將處理結果以一個 list 回傳的簡要方" "法。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會產" -"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 " -"(0x..)。:keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有" -"元素都會被處理。" +"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 (0x..)。:" +"keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" +"處理。" #: ../../glossary.rst:806 msgid "loader" @@ -1854,10 +1842,10 @@ msgstr "loader(載入器)" #: ../../glossary.rst:808 msgid "" -"An object that loads a module. It must define the :meth:`!exec_module` " -"and :meth:`!create_module` methods to implement " -"the :class:`~importlib.abc.Loader` interface. A loader is typically returned " -"by a :term:`finder`. See also:" +"An object that loads a module. It must define the :meth:`!exec_module` and :" +"meth:`!create_module` methods to implement the :class:`~importlib.abc." +"Loader` interface. A loader is typically returned by a :term:`finder`. See " +"also:" msgstr "" "一個能夠載入模組的物件。它必須定義 :meth:`!exec_module` 和 :meth:`!" "create_module` 方法以實作 :class:`~importlib.abc.Loader` 介面。載入器通常是" @@ -1881,17 +1869,15 @@ msgstr "locale encoding(區域編碼)" #: ../../glossary.rst:819 msgid "" -"On Unix, it is the encoding of the LC_CTYPE locale. It can be set " -"with :func:`locale.setlocale(locale.LC_CTYPE, new_locale) " -"`." +"On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" +"`locale.setlocale(locale.LC_CTYPE, new_locale) `." msgstr "" -"在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以" -"用 :func:`locale.setlocale(locale.LC_CTYPE, new_locale) ` " -"來設定。" +"在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." +"setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" #: ../../glossary.rst:822 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." -msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``\"cp1252\"``\\ )。" +msgstr "在 Windows 上,它是 ANSI 碼頁(code page,例如 ``\"cp1252\"``\\ )。" #: ../../glossary.rst:824 msgid "" @@ -1921,18 +1907,17 @@ msgstr "mapping(對映)" #: ../../glossary.rst:836 msgid "" "A container object that supports arbitrary key lookups and implements the " -"methods specified in the :class:`collections.abc.Mapping` " -"or :class:`collections.abc.MutableMapping` :ref:`abstract base classes " -"`. Examples " -"include :class:`dict`, :class:`collections.defaultdict`, :class:`collections.OrderedDict` " -"and :class:`collections.Counter`." +"methods specified in the :class:`collections.abc.Mapping` or :class:" +"`collections.abc.MutableMapping` :ref:`abstract base classes `. Examples include :class:`dict`, :class:" +"`collections.defaultdict`, :class:`collections.OrderedDict` and :class:" +"`collections.Counter`." msgstr "" "一個容器物件,它支援任意鍵的查找,且能實作 :ref:`abstract base classes(抽象" -"基底類別) `\\ " -"中,:class:`collections.abc.Mapping` " -"或 :class:`collections.abc.MutableMapping` 所指定的 method。範例包" -"括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections.OrderedDict` " -"和 :class:`collections.Counter`。" +"基底類別) `\\ 中,:class:`collections." +"abc.Mapping` 或 :class:`collections.abc.MutableMapping` 所指定的 method。範例" +"包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." +"OrderedDict` 和 :class:`collections.Counter`。" #: ../../glossary.rst:842 msgid "meta path finder" @@ -1991,8 +1976,8 @@ msgstr "method(方法)" msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " -"first :term:`argument` (which is usually called ``self``). " -"See :term:`function` and :term:`nested scope`." +"first :term:`argument` (which is usually called ``self``). See :term:" +"`function` and :term:`nested scope`." msgstr "" "一個在 class 本體內被定義的函式。如果 method 作為其 class 實例的一個屬性被呼" "叫,則它將會得到該實例物件成為它的第一個 :term:`argument`\\ (引數)(此引數" @@ -2039,8 +2024,8 @@ msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." msgstr "" -"一個命名空間,它包含用於載入模組的 import 相關資訊。它" -"是 :class:`importlib.machinery.ModuleSpec` 的一個實例。" +"一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." +"machinery.ModuleSpec` 的一個實例。" #: ../../glossary.rst:886 msgid "See also :ref:`module-specs`." @@ -2060,11 +2045,11 @@ msgstr "mutable(可變物件)" #: ../../glossary.rst:892 msgid "" -"Mutable objects can change their value but keep their :func:`id`. See " -"also :term:`immutable`." +"Mutable objects can change their value but keep their :func:`id`. See also :" +"term:`immutable`." msgstr "" -"可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參" -"閱 :term:`immutable`\\ (不可變物件)。" +"可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" +"`immutable`\\ (不可變物件)。" #: ../../glossary.rst:894 msgid "named tuple" @@ -2082,9 +2067,9 @@ msgstr "" #: ../../glossary.rst:900 msgid "" -"Several built-in types are named tuples, including the values returned " -"by :func:`time.localtime` and :func:`os.stat`. Another example " -"is :data:`sys.float_info`::" +"Several built-in types are named tuples, including the values returned by :" +"func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." +"float_info`::" msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" @@ -2098,24 +2083,29 @@ msgid "" ">>> isinstance(sys.float_info, tuple) # kind of tuple\n" "True" msgstr "" +">>> sys.float_info[1] # 以索引存取\n" +"1024\n" +">>> sys.float_info.max_exp # 以欄位名稱存取\n" +"1024\n" +">>> isinstance(sys.float_info, tuple) # 屬於 tuple 型別\n" +"True" #: ../../glossary.rst:911 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " "that inherits from :class:`tuple` and that defines named fields. Such a " -"class can be written by hand, or it can be created by " -"inheriting :class:`typing.NamedTuple`, or with the factory " -"function :func:`collections.namedtuple`. The latter techniques also add " -"some extra methods that may not be found in hand-written or built-in named " -"tuples." +"class can be written by hand, or it can be created by inheriting :class:" +"`typing.NamedTuple`, or with the factory function :func:`collections." +"namedtuple`. The latter techniques also add some extra methods that may not " +"be found in hand-written or built-in named tuples." msgstr "" "有些 named tuple 是內建型別(如上例)。或者,一個 named tuple 也可以從一個正" "規的 class 定義來建立,只要該 class 是繼承自 :class:`tuple`,且定義了附名欄" -"位 (named field) 即可。這類的 class 可以手工編寫、可以繼承" -"自 :class:`typing.NamedTuple` 來建立,也可以使用工廠函式 (factory " -"function) :func:`collections.namedtuple` 來建立。後者技術也增加了一些額外的 " -"method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到的。" +"位 (named field) 即可。這類的 class 可以手工編寫、可以繼承自 :class:`typing." +"NamedTuple` 來建立,也可以使用工廠函式 (factory function) :func:`collections." +"namedtuple` 來建立。後者技術也增加了一些額外的 method,這些 method 可能是在手" +"寫或內建的 named tuple 中,無法找到的。" #: ../../glossary.rst:919 msgid "namespace" @@ -2126,21 +2116,20 @@ msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " "as nested namespaces in objects (in methods). Namespaces support modularity " -"by preventing naming conflicts. For instance, the " -"functions :func:`builtins.open <.open>` and :func:`os.open` are " -"distinguished by their namespaces. Namespaces also aid readability and " -"maintainability by making it clear which module implements a function. For " -"instance, writing :func:`random.seed` or :func:`itertools.islice` makes it " -"clear that those functions are implemented by the :mod:`random` " -"and :mod:`itertools` modules, respectively." +"by preventing naming conflicts. For instance, the functions :func:`builtins." +"open <.open>` and :func:`os.open` are distinguished by their namespaces. " +"Namespaces also aid readability and maintainability by making it clear which " +"module implements a function. For instance, writing :func:`random.seed` or :" +"func:`itertools.islice` makes it clear that those functions are implemented " +"by the :mod:`random` and :mod:`itertools` modules, respectively." msgstr "" "變數被儲存的地方。命名空間是以 dictionary(字典)被實作。有區域的、全域的及內" "建的命名空間,而在物件中(在 method 中)也有巢狀的命名空間。命名空間藉由防止" -"命名衝突,來支援模組化。例如,函式 :func:`builtins.open <.open>` " -"和 :func:`os.open` 是透過它們的命名空間來區分彼此。命名空間也藉由明確地區分是" -"哪個模組在實作一個函式,來增進可讀性及可維護性。例如,寫" -"出 :func:`random.seed` 或 :func:`itertools.islice` 明確地表示,這些函式分別是" -"由 :mod:`random` 和 :mod:`itertools` 模組在實作。" +"命名衝突,來支援模組化。例如,函式 :func:`builtins.open <.open>` 和 :func:" +"`os.open` 是透過它們的命名空間來區分彼此。命名空間也藉由明確地區分是哪個模組" +"在實作一個函式,來增進可讀性及可維護性。例如,寫出 :func:`random.seed` 或 :" +"func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" +"`itertools` 模組在實作。" #: ../../glossary.rst:931 msgid "namespace package" @@ -2201,15 +2190,13 @@ msgstr "new-style class(新式類別)" msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " -"versatile features like :attr:`~object.__slots__`, descriptors, " -"properties, :meth:`~object.__getattribute__`, class methods, and static " -"methods." +"versatile features like :attr:`~object.__slots__`, descriptors, properties, :" +"meth:`~object.__getattribute__`, class methods, and static methods." msgstr "" "一個舊名,它是指現在所有的 class 物件所使用的 class 風格。在早期的 Python 版" -"本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像" -"是 :attr:`~object.__slots__`、描述器 (descriptor)、屬性 " -"(property)、:meth:`~object.__getattribute__`、class method(類別方法)和 " -"static method(靜態方法)。" +"本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像是 :attr:`~object." +"__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." +"__getattribute__`、class method(類別方法)和 static method(靜態方法)。" #: ../../glossary.rst:960 msgid "object" @@ -2220,8 +2207,8 @@ msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." msgstr "" -"具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任" -"何 :term:`new-style class`\\ (新式類別)的最終 base class(基底類別)。" +"具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" +"`new-style class`\\ (新式類別)的最終 base class(基底類別)。" #: ../../glossary.rst:965 msgid "optimized scope" @@ -2357,8 +2344,8 @@ msgstr "" msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " -"the :class:`inspect.Parameter` class, the :ref:`function` section, " -"and :pep:`362`." +"the :class:`inspect.Parameter` class, the :ref:`function` section, and :pep:" +"`362`." msgstr "" "另請參閱術語表的 :term:`argument`\\ (引數)條目、常見問題中的\\ :ref:`引數和" "參數之間的差異 `、:class:`inspect.Parameter` " @@ -2382,21 +2369,21 @@ msgstr "path entry finder(路徑項目尋檢器)" #: ../../glossary.rst:1040 msgid "" -"A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. " -"a :term:`path entry hook`) which knows how to locate modules given " -"a :term:`path entry`." +"A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" +"term:`path entry hook`) which knows how to locate modules given a :term:" +"`path entry`." msgstr "" -"被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一" -"個 :term:`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一" -"個 :term:`path entry`\\ 定位模組。" +"被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一個 :term:" +"`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" +"`path entry`\\ 定位模組。" #: ../../glossary.rst:1044 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" -"關於路徑項目尋檢器實作的 method,請參" -"閱 :class:`importlib.abc.PathEntryFinder`。" +"關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." +"PathEntryFinder`。" #: ../../glossary.rst:1046 msgid "path entry hook" @@ -2430,21 +2417,21 @@ msgstr "path-like object(類路徑物件)" #: ../../glossary.rst:1057 msgid "" -"An object representing a file system path. A path-like object is either " -"a :class:`str` or :class:`bytes` object representing a path, or an object " -"implementing the :class:`os.PathLike` protocol. An object that supports " -"the :class:`os.PathLike` protocol can be converted to a :class:`str` " -"or :class:`bytes` file system path by calling the :func:`os.fspath` " -"function; :func:`os.fsdecode` and :func:`os.fsencode` can be used to " -"guarantee a :class:`str` or :class:`bytes` result instead, respectively. " -"Introduced by :pep:`519`." -msgstr "" -"一個表示檔案系統路徑的物件。類路徑物件可以是一個表示路徑的 :class:`str` " -"或 :class:`bytes` 物件,或是一個實作 :class:`os.PathLike` 協定的物件。透過呼" -"叫 :func:`os.fspath` 函式,一個支援 :class:`os.PathLike` 協定的物件可以被轉換" -"為 :class:`str` 或 :class:`bytes` 檔案系統路徑;而 :func:`os.fsdecode` " -"及 :func:`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結" -"果。由 :pep:`519` 引入。" +"An object representing a file system path. A path-like object is either a :" +"class:`str` or :class:`bytes` object representing a path, or an object " +"implementing the :class:`os.PathLike` protocol. An object that supports the :" +"class:`os.PathLike` protocol can be converted to a :class:`str` or :class:" +"`bytes` file system path by calling the :func:`os.fspath` function; :func:" +"`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a :class:" +"`str` or :class:`bytes` result instead, respectively. Introduced by :pep:" +"`519`." +msgstr "" +"一個表示檔案系統路徑的物件。類路徑物件可以是一個表示路徑的 :class:`str` 或 :" +"class:`bytes` 物件,或是一個實作 :class:`os.PathLike` 協定的物件。透過呼叫 :" +"func:`os.fspath` 函式,一個支援 :class:`os.PathLike` 協定的物件可以被轉換為 :" +"class:`str` 或 :class:`bytes` 檔案系統路徑;而 :func:`os.fsdecode` 及 :func:" +"`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" +"pep:`519` 引入。" #: ../../glossary.rst:1065 msgid "PEP" @@ -2566,9 +2553,9 @@ msgid "" "Python sometimes use a numerical counter instead::" msgstr "" "一個想法或一段程式碼,它應用了 Python 語言最常見的慣用語,而不是使用其他語言" -"常見的概念來實作程式碼。例如,Python 中常見的一種習慣用法,是使用一" -"個 :keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並" -"沒有這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" +"常見的概念來實作程式碼。例如,Python 中常見的一種習慣用法,是使用一個 :" +"keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" +"這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" #: ../../glossary.rst:1122 msgid "" @@ -2634,8 +2621,8 @@ msgstr "" #: ../../glossary.rst:1148 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " -"dotted path to the module, including any parent packages, e.g. " -"``email.mime.text``::" +"dotted path to the module, including any parent packages, e.g. ``email.mime." +"text``::" msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" @@ -2667,8 +2654,8 @@ msgstr "" "對於一個物件的參照次數。當一個物件的參照計數下降到零時,它會被解除配置 " "(deallocated)。有些物件是「\\ :term:`不滅的 ` (immortal)」並擁有不" "會被改變的參照計數,也因此永遠不會被解除配置。參照計數通常在 Python 程式碼中" -"看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼" -"叫 :func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" +"看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :" +"func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" #: ../../glossary.rst:1165 msgid "regular package" @@ -2676,8 +2663,8 @@ msgstr "regular package(正規套件)" #: ../../glossary.rst:1167 msgid "" -"A traditional :term:`package`, such as a directory containing an " -"``__init__.py`` file." +"A traditional :term:`package`, such as a directory containing an ``__init__." +"py`` file." msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" @@ -2692,8 +2679,8 @@ msgstr "REPL" #: ../../glossary.rst:1173 msgid "" -"An acronym for the \"read–eval–print loop\", another name for " -"the :term:`interactive` interpreter shell." +"An acronym for the \"read–eval–print loop\", another name for the :term:" +"`interactive` interpreter shell." msgstr "" "「read-eval-print 迴圈 (read–eval–print loop)」的縮寫,是\\ :term:`互動式 " "`\\ 直譯器 shell 的另一個名稱。" @@ -2722,38 +2709,38 @@ msgstr "sequence(序列)" #: ../../glossary.rst:1184 msgid "" "An :term:`iterable` which supports efficient element access using integer " -"indices via the :meth:`~object.__getitem__` special method and defines " -"a :meth:`~object.__len__` method that returns the length of the sequence. " -"Some built-in sequence types " -"are :class:`list`, :class:`str`, :class:`tuple`, and :class:`bytes`. Note " -"that :class:`dict` also supports :meth:`~object.__getitem__` and :meth:`!" -"__len__`, but is considered a mapping rather than a sequence because the " -"lookups use arbitrary :term:`hashable` keys rather than integers." +"indices via the :meth:`~object.__getitem__` special method and defines a :" +"meth:`~object.__len__` method that returns the length of the sequence. Some " +"built-in sequence types are :class:`list`, :class:`str`, :class:`tuple`, " +"and :class:`bytes`. Note that :class:`dict` also supports :meth:`~object." +"__getitem__` and :meth:`!__len__`, but is considered a mapping rather than a " +"sequence because the lookups use arbitrary :term:`hashable` keys rather than " +"integers." msgstr "" "一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`~object.__getitem__` " "special method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一" -"個 :meth:`~object.__len__` method 來回傳該序列的長度。一些內建序列型別包" -"括 :class:`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖" -"然 :class:`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`!__len__`,但它" -"被視為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` " -"鍵,而不是整數。" +"個 :meth:`~object.__len__` method 來回傳該序列的長度。一些內建序列型別包括 :" +"class:`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :" +"class:`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`!__len__`,但它被視" +"為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` 鍵," +"而不是整數。" #: ../../glossary.rst:1193 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " -"richer interface that goes beyond just :meth:`~object.__getitem__` " -"and :meth:`~object.__len__`, adding :meth:`!count`, :meth:`!" -"index`, :meth:`~object.__contains__`, and :meth:`~object.__reversed__`. " -"Types that implement this expanded interface can be registered explicitly " -"using :func:`~abc.ABCMeta.register`. For more documentation on sequence " -"methods generally, see :ref:`Common Sequence Operations `." +"richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" +"`~object.__len__`, adding :meth:`!count`, :meth:`!index`, :meth:`~object." +"__contains__`, and :meth:`~object.__reversed__`. Types that implement this " +"expanded interface can be registered explicitly using :func:`~abc.ABCMeta." +"register`. For more documentation on sequence methods generally, see :ref:" +"`Common Sequence Operations `." msgstr "" "抽象基底類別 (abstract base class) :class:`collections.abc.Sequence` 定義了一" -"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` " -"和 :meth:`~object.__len__`,還增加了 :meth:`!count`、:meth:`!" -"index`、:meth:`~object.__contains__` 和 :meth:`~object.__reversed__`。實作此" -"擴充介面的型別,可以使用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於" -"序列方法的文件,請見\\ :ref:`常見序列操作 `。" +"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` 和 :meth:`~object." +"__len__`,還增加了 :meth:`!count`、:meth:`!index`、:meth:`~object." +"__contains__` 和 :meth:`~object.__reversed__`。實作此擴充介面的型別,可以使" +"用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文件,請見" +"\\ :ref:`常見序列操作 `。" #: ../../glossary.rst:1202 msgid "set comprehension" @@ -2763,8 +2750,8 @@ msgstr "set comprehension(集合綜合運算)" msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " -"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. " -"See :ref:`comprehensions`." +"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See :ref:" +"`comprehensions`." msgstr "" "一種緊密的方法,用來處理一個可疊代物件中的全部或部分元素,並將處理結果以一個 " "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" @@ -2833,57 +2820,89 @@ msgstr "special method(特殊方法)" msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " -"with double underscores. Special methods are documented " -"in :ref:`specialnames`." +"with double underscores. Special methods are documented in :ref:" +"`specialnames`." msgstr "" "一種會被 Python 自動呼叫的 method,用於對某種型別執行某種運算,例如加法。這" -"種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在" -"\\ :ref:`specialnames`\\ 中有詳細說明。" +"種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" +"`specialnames`\\ 中有詳細說明。" #: ../../glossary.rst:1237 +msgid "standard library" +msgstr "標準函式庫" + +#: ../../glossary.rst:1239 +msgid "" +"The collection of :term:`packages `, :term:`modules ` and :" +"term:`extension modules ` distributed as a part of the " +"official Python interpreter package. The exact membership of the collection " +"may vary based on platform, available system libraries, or other criteria. " +"Documentation can be found at :ref:`library-index`." +msgstr "" +"包含\\ :term:`套件 `、:term:`模組 `\\ 和\\ " +":term:`擴充模組 `\\ 的集合,它們是作為官方 Python " +"直譯器套件的一部分來發行。該集合的成員可能會因平台、可用的系統函式庫或其他條件而有所不同。" +"相關文件可以在 :ref:`library-index` 中找到。" + +#: ../../glossary.rst:1245 +msgid "" +"See also :data:`sys.stdlib_module_names` for a list of all possible standard " +"library module names." +msgstr "" +"請參閱 :data:`sys.stdlib_module_names` 以取得所有可能的標準函式庫模組名稱的列表。" + +#: ../../glossary.rst:1247 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1239 +#: ../../glossary.rst:1249 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " -"an :term:`expression` or one of several constructs with a keyword, such " -"as :keyword:`if`, :keyword:`while` or :keyword:`for`." +"an :term:`expression` or one of several constructs with a keyword, such as :" +"keyword:`if`, :keyword:`while` or :keyword:`for`." msgstr "" -"陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一" -"個 :term:`expression`\\ (運算式),或是含有關鍵字(例" -"如 :keyword:`if`、:keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" +"陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一個 :" +"term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" +"`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1242 +#: ../../glossary.rst:1252 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1244 +#: ../../glossary.rst:1254 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " -"such as incorrect types. See also :term:`type hints ` and " -"the :mod:`typing` module." +"such as incorrect types. See also :term:`type hints ` and the :" +"mod:`typing` module." msgstr "" "會讀取 Python 程式碼並分析的外部工具,能夠找出錯誤,像是使用了不正確的型別。" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1247 +#: ../../glossary.rst:1257 +msgid "stdlib" +msgstr "stdlib(標準函式庫)" + +#: ../../glossary.rst:1259 +msgid "An abbreviation of :term:`standard library`." +msgstr ":term:`standard library` 的縮寫。" + +#: ../../glossary.rst:1260 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1262 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " -"calling :c:func:`Py_INCREF` when the reference is created and released " -"with :c:func:`Py_DECREF` when the reference is deleted." +"calling :c:func:`Py_INCREF` when the reference is created and released with :" +"c:func:`Py_DECREF` when the reference is deleted." msgstr "" "在 Python 的 C API 中,強參照是對物件的參照,該物件為持有該參照的程式碼所擁" -"有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透" -"過 :c:func:`Py_DECREF` 釋放強參照。" +"有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" +"func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1255 +#: ../../glossary.rst:1268 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2893,15 +2912,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1260 +#: ../../glossary.rst:1273 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1261 +#: ../../glossary.rst:1274 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1263 +#: ../../glossary.rst:1276 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -2910,7 +2929,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1267 +#: ../../glossary.rst:1280 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2918,7 +2937,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1270 +#: ../../glossary.rst:1283 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2926,56 +2945,54 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1273 +#: ../../glossary.rst:1286 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1275 +#: ../../glossary.rst:1288 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " -"text file actually accesses a byte-oriented datastream and handles " -"the :term:`text encoding` automatically. Examples of text files are files " -"opened in text mode (``'r'`` or " -"``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and instances " -"of :class:`io.StringIO`." +"text file actually accesses a byte-oriented datastream and handles the :term:" +"`text encoding` automatically. Examples of text files are files opened in " +"text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and " +"instances of :class:`io.StringIO`." msgstr "" "一個能夠讀取和寫入 :class:`str` 物件的一個 :term:`file object`\\ (檔案物" "件)。通常,文字檔案實際上是存取位元組導向的資料流 (byte-oriented " "datastream) 並會自動處理 :term:`text encoding`\\ (文字編碼)。文字檔案的例子" -"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔" -"案、:data:`sys.stdin`、:data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" +"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" +"`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1282 +#: ../../glossary.rst:1295 msgid "" -"See also :term:`binary file` for a file object able to read and " -"write :term:`bytes-like objects `." +"See also :term:`binary file` for a file object able to read and write :term:" +"`bytes-like objects `." msgstr "" -"另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入" -"\\ :term:`類位元組串物件 (bytes-like object) ` 的檔案物" -"件。" +"另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" +"term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1284 +#: ../../glossary.rst:1297 msgid "token" msgstr "" -#: ../../glossary.rst:1287 +#: ../../glossary.rst:1300 msgid "" "A small unit of source code, generated by the :ref:`lexical analyzer " "` (also called the *tokenizer*). Names, numbers, strings, " "operators, newlines and similar are represented by tokens." msgstr "" -#: ../../glossary.rst:1292 +#: ../../glossary.rst:1305 msgid "" -"The :mod:`tokenize` module exposes Python's lexical analyzer. " -"The :mod:`token` module contains information on the various types of tokens." +"The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:" +"`token` module contains information on the various types of tokens." msgstr "" -#: ../../glossary.rst:1295 +#: ../../glossary.rst:1308 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1297 +#: ../../glossary.rst:1310 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2990,37 +3007,36 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1304 +#: ../../glossary.rst:1317 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1306 +#: ../../glossary.rst:1319 msgid "" "The type of a Python object determines what kind of object it is; every " -"object has a type. An object's type is accessible as " -"its :attr:`~object.__class__` attribute or can be retrieved with " -"``type(obj)``." +"object has a type. An object's type is accessible as its :attr:`~object." +"__class__` attribute or can be retrieved with ``type(obj)``." msgstr "" "一個 Python 物件的型別決定了它是什麼類型的物件;每個物件都有一個型別。一個物" "件的型別可以用它的 :attr:`~object.__class__` 屬性來存取,或以 ``type(obj)`` " "來檢索。" -#: ../../glossary.rst:1310 +#: ../../glossary.rst:1323 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1312 +#: ../../glossary.rst:1325 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1314 +#: ../../glossary.rst:1327 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1317 +#: ../../glossary.rst:1330 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -3030,11 +3046,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1321 +#: ../../glossary.rst:1334 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1323 +#: ../../glossary.rst:1336 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -3046,15 +3062,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1328 ../../glossary.rst:1342 +#: ../../glossary.rst:1341 ../../glossary.rst:1355 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1329 +#: ../../glossary.rst:1342 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1331 +#: ../../glossary.rst:1344 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -3062,7 +3078,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1334 +#: ../../glossary.rst:1347 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -3072,45 +3088,45 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1338 +#: ../../glossary.rst:1351 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." msgstr "" -"全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使" -"用 :func:`typing.get_type_hints` 來存取。" +"全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" +"`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1343 +#: ../../glossary.rst:1356 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1345 +#: ../../glossary.rst:1358 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " "Windows convention ``'\\r\\n'``, and the old Macintosh convention " -"``'\\r'``. See :pep:`278` and :pep:`3116`, as well " -"as :func:`bytes.splitlines` for an additional use." +"``'\\r'``. See :pep:`278` and :pep:`3116`, as well as :func:`bytes." +"splitlines` for an additional use." msgstr "" "一種解譯文字流 (text stream) 的方式,會將以下所有的情況識別為一行的結束:" "Unix 行尾慣例 ``'\\n'``、Windows 慣例 ``'\\r\\n'`` 和舊的 Macintosh 慣例 " -"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用" -"於 :func:`bytes.splitlines` 的附加用途。" +"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." +"splitlines` 的附加用途。" -#: ../../glossary.rst:1350 +#: ../../glossary.rst:1363 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1352 +#: ../../glossary.rst:1365 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1354 +#: ../../glossary.rst:1367 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1356 +#: ../../glossary.rst:1369 msgid "" "class C:\n" " field: 'annotation'" @@ -3118,7 +3134,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1359 +#: ../../glossary.rst:1372 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -3126,15 +3142,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1363 +#: ../../glossary.rst:1376 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1365 +#: ../../glossary.rst:1378 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1367 +#: ../../glossary.rst:1380 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3143,11 +3159,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1371 +#: ../../glossary.rst:1384 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1373 +#: ../../glossary.rst:1386 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3158,27 +3174,27 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1378 +#: ../../glossary.rst:1391 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1379 +#: ../../glossary.rst:1392 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1381 +#: ../../glossary.rst:1394 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." msgstr "" -"一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行" -"由 :term:`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" +"一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" +"`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1383 +#: ../../glossary.rst:1396 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1385 +#: ../../glossary.rst:1398 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3205,12 +3221,12 @@ msgstr "special" #~ msgid "" #~ "An object which controls the environment seen in a :keyword:`with` " -#~ "statement by defining :meth:`~object.__enter__` " -#~ "and :meth:`~object.__exit__` methods. See :pep:`343`." +#~ "statement by defining :meth:`~object.__enter__` and :meth:`~object." +#~ "__exit__` methods. See :pep:`343`." #~ msgstr "" -#~ "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定" -#~ "義 :meth:`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。" -#~ "請參閱 :pep:`343`。" +#~ "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" +#~ "`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。請參閱 :" +#~ "pep:`343`。" #~ msgid "" #~ "A variable which can have different values depending on its context. This " diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index bb686c54de..d4055b489d 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-07 10:49+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -5368,11 +5368,62 @@ msgid "" "2025-07-02 13:54:47,234 DEBUG can't get fooled again" msgstr "" +#: ../../howto/logging-cookbook.rst:4130 +msgid "" +"If, on the other hand, you are concerned about `log injection `_, you can use a formatter which " +"escapes newlines, as per the following example:" +msgstr "" + #: ../../howto/logging-cookbook.rst:4134 +msgid "" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"class EscapingFormatter(logging.Formatter):\n" +" def format(self, record):\n" +" s = super().format(record)\n" +" return s.replace('\\n', r'\\n')\n" +"\n" +"if __name__ == '__main__':\n" +" h = logging.StreamHandler()\n" +" h.setFormatter(EscapingFormatter('%(asctime)s %(levelname)-9s " +"%(message)s'))\n" +" logging.basicConfig(level=logging.DEBUG, handlers = [h])\n" +" logger.debug('Single line')\n" +" logger.debug('Multiple lines:\\nfool me once ...')\n" +" logger.debug('Another single line')\n" +" logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled " +"again')" +msgstr "" + +#: ../../howto/logging-cookbook.rst:4154 +msgid "" +"You can, of course, use whatever escaping scheme makes the most sense for " +"you. The script, when run, should produce output like this:" +msgstr "" + +#: ../../howto/logging-cookbook.rst:4157 +msgid "" +"2025-07-09 06:47:33,783 DEBUG Single line\n" +"2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me once ...\n" +"2025-07-09 06:47:33,783 DEBUG Another single line\n" +"2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me ...\\ncan't get " +"fooled again" +msgstr "" + +#: ../../howto/logging-cookbook.rst:4164 +msgid "" +"Escaping behaviour can't be the stdlib default , as it would break backwards " +"compatibility." +msgstr "" + +#: ../../howto/logging-cookbook.rst:4170 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:4136 +#: ../../howto/logging-cookbook.rst:4172 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -5380,11 +5431,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:4142 +#: ../../howto/logging-cookbook.rst:4178 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:4144 +#: ../../howto/logging-cookbook.rst:4180 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -5392,32 +5443,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:4149 +#: ../../howto/logging-cookbook.rst:4185 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -#: ../../howto/logging-cookbook.rst:4152 +#: ../../howto/logging-cookbook.rst:4188 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." msgstr "" -#: ../../howto/logging-cookbook.rst:4155 +#: ../../howto/logging-cookbook.rst:4191 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " "module, for example." msgstr "" -#: ../../howto/logging-cookbook.rst:4159 +#: ../../howto/logging-cookbook.rst:4195 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" msgstr "" -#: ../../howto/logging-cookbook.rst:4162 +#: ../../howto/logging-cookbook.rst:4198 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -5426,7 +5477,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:4168 +#: ../../howto/logging-cookbook.rst:4204 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " @@ -5436,17 +5487,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:4175 +#: ../../howto/logging-cookbook.rst:4211 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:4179 +#: ../../howto/logging-cookbook.rst:4215 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:4181 +#: ../../howto/logging-cookbook.rst:4217 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -5457,13 +5508,13 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:4190 +#: ../../howto/logging-cookbook.rst:4226 msgid "" "Adding handlers other than :class:`~logging.NullHandler` to a logger in a " "library" msgstr "" -#: ../../howto/logging-cookbook.rst:4192 +#: ../../howto/logging-cookbook.rst:4228 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -5471,11 +5522,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:4198 +#: ../../howto/logging-cookbook.rst:4234 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:4200 +#: ../../howto/logging-cookbook.rst:4236 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " @@ -5486,38 +5537,38 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:4211 +#: ../../howto/logging-cookbook.rst:4247 msgid "Other resources" msgstr "其他資源" -#: ../../howto/logging-cookbook.rst:4215 +#: ../../howto/logging-cookbook.rst:4251 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:4216 +#: ../../howto/logging-cookbook.rst:4252 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4218 +#: ../../howto/logging-cookbook.rst:4254 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:4219 +#: ../../howto/logging-cookbook.rst:4255 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4221 +#: ../../howto/logging-cookbook.rst:4257 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:4222 +#: ../../howto/logging-cookbook.rst:4258 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4224 +#: ../../howto/logging-cookbook.rst:4260 msgid ":ref:`Basic Tutorial `" msgstr ":ref:`基礎教學 `" -#: ../../howto/logging-cookbook.rst:4226 +#: ../../howto/logging-cookbook.rst:4262 msgid ":ref:`Advanced Tutorial `" msgstr ":ref:`進階教學 `" diff --git a/library/argparse.po b/library/argparse.po index 283ac46a94..0cf492ac45 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-07-09 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1302,33 +1302,17 @@ msgstr "" #: ../../library/argparse.rst:747 msgid "" -"Only actions that consume command-line arguments (e.g. ``'store'``, " -"``'append'`` or ``'extend'``) can be used with positional arguments." -msgstr "" - -#: ../../library/argparse.rst:752 -msgid "" "You may also specify an arbitrary action by passing an :class:`Action` " -"subclass or other object that implements the same interface. The :class:`!" -"BooleanOptionalAction` is available in :mod:`!argparse` and adds support for " -"boolean actions such as ``--foo`` and ``--no-foo``::" +"subclass (e.g. :class:`BooleanOptionalAction`) or other object that " +"implements the same interface. Only actions that consume command-line " +"arguments (e.g. ``'store'``, ``'append'``, ``'extend'``, or custom actions " +"with non-zero ``nargs``) can be used with positional arguments." msgstr "" +"你也可以傳遞一個 :class:`Action` 子類別(例如 :class:`BooleanOptionalAction`)" +"或實作相同介面的其他物件。只有會消耗命令列引數的 action(例如 ``'store'``、" +"``'append'``、``'extend'`` 或 ``nargs`` 不為零的自定義 action)可以被用於位置引數。" -#: ../../library/argparse.rst:757 -msgid "" -">>> import argparse\n" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" -">>> parser.parse_args(['--no-foo'])\n" -"Namespace(foo=False)" -msgstr "" -">>> import argparse\n" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" -">>> parser.parse_args(['--no-foo'])\n" -"Namespace(foo=False)" - -#: ../../library/argparse.rst:765 +#: ../../library/argparse.rst:753 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " @@ -1337,11 +1321,11 @@ msgid "" "their registered name." msgstr "" -#: ../../library/argparse.rst:770 +#: ../../library/argparse.rst:758 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:772 +#: ../../library/argparse.rst:760 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1362,15 +1346,15 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: ../../library/argparse.rst:790 +#: ../../library/argparse.rst:778 msgid "For more details, see :class:`Action`." msgstr "更多詳情請見 :class:`Action`。" -#: ../../library/argparse.rst:796 +#: ../../library/argparse.rst:784 msgid "nargs" msgstr "nargs" -#: ../../library/argparse.rst:798 +#: ../../library/argparse.rst:786 msgid "" ":class:`ArgumentParser` objects usually associate a single command-line " "argument with a single action to be taken. The ``nargs`` keyword argument " @@ -1379,13 +1363,13 @@ msgid "" "are:" msgstr "" -#: ../../library/argparse.rst:803 +#: ../../library/argparse.rst:791 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:806 +#: ../../library/argparse.rst:794 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1399,13 +1383,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:812 +#: ../../library/argparse.rst:800 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:817 +#: ../../library/argparse.rst:805 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1415,7 +1399,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:824 +#: ../../library/argparse.rst:812 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1437,13 +1421,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:834 +#: ../../library/argparse.rst:822 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:837 +#: ../../library/argparse.rst:825 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1469,7 +1453,7 @@ msgstr "" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:851 +#: ../../library/argparse.rst:839 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1477,7 +1461,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:856 +#: ../../library/argparse.rst:844 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1493,14 +1477,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:865 +#: ../../library/argparse.rst:853 msgid "" "``'+'``. Just like ``'*'``, all command-line arguments present are gathered " "into a list. Additionally, an error message will be generated if there " "wasn't at least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:869 +#: ../../library/argparse.rst:857 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1518,7 +1502,7 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:877 +#: ../../library/argparse.rst:865 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1527,11 +1511,11 @@ msgid "" "``'store_const'``) set ``nargs=0``." msgstr "" -#: ../../library/argparse.rst:887 +#: ../../library/argparse.rst:875 msgid "const" msgstr "const" -#: ../../library/argparse.rst:889 +#: ../../library/argparse.rst:877 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1539,7 +1523,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:893 +#: ../../library/argparse.rst:881 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1549,7 +1533,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:901 +#: ../../library/argparse.rst:889 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1559,17 +1543,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:908 +#: ../../library/argparse.rst:896 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:915 +#: ../../library/argparse.rst:903 msgid "default" msgstr "default" -#: ../../library/argparse.rst:917 +#: ../../library/argparse.rst:905 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1579,7 +1563,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:924 +#: ../../library/argparse.rst:912 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1595,13 +1579,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:931 +#: ../../library/argparse.rst:919 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" -#: ../../library/argparse.rst:934 +#: ../../library/argparse.rst:922 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1613,7 +1597,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:939 +#: ../../library/argparse.rst:927 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1621,7 +1605,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:944 +#: ../../library/argparse.rst:932 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -1635,13 +1619,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:950 +#: ../../library/argparse.rst:938 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:953 +#: ../../library/argparse.rst:941 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -1657,20 +1641,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:960 +#: ../../library/argparse.rst:948 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: ../../library/argparse.rst:964 +#: ../../library/argparse.rst:952 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:967 +#: ../../library/argparse.rst:955 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -1686,11 +1670,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:978 +#: ../../library/argparse.rst:966 msgid "type" msgstr "type" -#: ../../library/argparse.rst:980 +#: ../../library/argparse.rst:968 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1699,13 +1683,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:986 +#: ../../library/argparse.rst:974 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:989 +#: ../../library/argparse.rst:977 msgid "" "The argument to ``type`` can be a callable that accepts a single string or " "the name of a registered type (see :meth:`~ArgumentParser.register`) If the " @@ -1714,11 +1698,11 @@ msgid "" "is displayed. Other exception types are not handled." msgstr "" -#: ../../library/argparse.rst:995 +#: ../../library/argparse.rst:983 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:997 +#: ../../library/argparse.rst:985 msgid "" "import argparse\n" "import pathlib\n" @@ -1744,11 +1728,11 @@ msgstr "" "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:1010 +#: ../../library/argparse.rst:998 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:1012 +#: ../../library/argparse.rst:1000 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -1766,14 +1750,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1022 +#: ../../library/argparse.rst:1010 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1026 +#: ../../library/argparse.rst:1014 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1781,7 +1765,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1031 +#: ../../library/argparse.rst:1019 msgid "" "For example, JSON or YAML conversions have complex error cases that require " "better reporting than can be given by the ``type`` keyword. A :exc:`~json." @@ -1789,7 +1773,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1036 +#: ../../library/argparse.rst:1024 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -1799,17 +1783,17 @@ msgid "" "files." msgstr "" -#: ../../library/argparse.rst:1043 +#: ../../library/argparse.rst:1031 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1050 +#: ../../library/argparse.rst:1038 msgid "choices" msgstr "choices" -#: ../../library/argparse.rst:1052 +#: ../../library/argparse.rst:1040 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -1818,7 +1802,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1058 +#: ../../library/argparse.rst:1046 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -1838,26 +1822,26 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1067 +#: ../../library/argparse.rst:1055 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified." msgstr "" -#: ../../library/argparse.rst:1071 +#: ../../library/argparse.rst:1059 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1074 +#: ../../library/argparse.rst:1062 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1077 +#: ../../library/argparse.rst:1065 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -1865,11 +1849,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1086 +#: ../../library/argparse.rst:1074 msgid "required" msgstr "required" -#: ../../library/argparse.rst:1088 +#: ../../library/argparse.rst:1076 msgid "" "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -1877,7 +1861,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1093 +#: ../../library/argparse.rst:1081 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -1895,24 +1879,24 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1101 +#: ../../library/argparse.rst:1089 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1107 +#: ../../library/argparse.rst:1095 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1114 +#: ../../library/argparse.rst:1102 msgid "help" msgstr "help" -#: ../../library/argparse.rst:1116 +#: ../../library/argparse.rst:1104 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -1920,7 +1904,7 @@ msgid "" "each argument." msgstr "" -#: ../../library/argparse.rst:1121 +#: ../../library/argparse.rst:1109 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1929,7 +1913,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1126 +#: ../../library/argparse.rst:1114 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -1955,19 +1939,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1138 +#: ../../library/argparse.rst:1126 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1141 +#: ../../library/argparse.rst:1129 msgid "" ":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1144 +#: ../../library/argparse.rst:1132 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -1985,11 +1969,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1156 +#: ../../library/argparse.rst:1144 msgid "metavar" msgstr "metavar" -#: ../../library/argparse.rst:1158 +#: ../../library/argparse.rst:1146 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, :class:`!ArgumentParser` " @@ -2001,7 +1985,7 @@ msgid "" "command-line argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1167 +#: ../../library/argparse.rst:1155 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2033,11 +2017,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1182 +#: ../../library/argparse.rst:1170 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1184 +#: ../../library/argparse.rst:1172 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2069,21 +2053,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1199 +#: ../../library/argparse.rst:1187 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1203 +#: ../../library/argparse.rst:1191 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1207 +#: ../../library/argparse.rst:1195 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2107,11 +2091,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1222 +#: ../../library/argparse.rst:1210 msgid "dest" msgstr "dest" -#: ../../library/argparse.rst:1224 +#: ../../library/argparse.rst:1212 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2121,7 +2105,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1231 +#: ../../library/argparse.rst:1219 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2133,7 +2117,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1236 +#: ../../library/argparse.rst:1224 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2145,7 +2129,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1245 +#: ../../library/argparse.rst:1233 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2163,11 +2147,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1253 +#: ../../library/argparse.rst:1241 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1255 +#: ../../library/argparse.rst:1243 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2179,11 +2163,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1264 +#: ../../library/argparse.rst:1252 msgid "deprecated" msgstr "deprecated" -#: ../../library/argparse.rst:1266 +#: ../../library/argparse.rst:1254 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2194,7 +2178,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1276 +#: ../../library/argparse.rst:1264 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='snake.py')\n" @@ -2214,11 +2198,11 @@ msgstr "" "snake.py: warning: option '--legs' is deprecated\n" "Namespace(legs=4)" -#: ../../library/argparse.rst:1289 +#: ../../library/argparse.rst:1277 msgid "Action classes" msgstr "Action 類別" -#: ../../library/argparse.rst:1291 +#: ../../library/argparse.rst:1279 msgid "" ":class:`!Action` classes implement the Action API, a callable which returns " "a callable which processes arguments from the command-line. Any object which " @@ -2226,7 +2210,7 @@ msgid "" "`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1300 +#: ../../library/argparse.rst:1288 msgid "" ":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " "the information needed to parse a single argument from one or more strings " @@ -2235,7 +2219,7 @@ msgid "" "`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1306 +#: ../../library/argparse.rst:1294 msgid "" "Instances of :class:`!Action` (or return value of any callable to the " "``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" @@ -2244,46 +2228,46 @@ msgid "" "is to call :meth:`!Action.__init__`." msgstr "" -#: ../../library/argparse.rst:1314 +#: ../../library/argparse.rst:1302 msgid "" ":class:`!Action` instances should be callable, so subclasses must override " "the :meth:`!__call__` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1317 +#: ../../library/argparse.rst:1305 msgid "" "*parser* - The :class:`ArgumentParser` object which contains this action." msgstr "" -#: ../../library/argparse.rst:1319 +#: ../../library/argparse.rst:1307 msgid "" "*namespace* - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1323 +#: ../../library/argparse.rst:1311 msgid "" "*values* - The associated command-line arguments, with any type conversions " "applied. Type conversions are specified with the type_ keyword argument to :" "meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1327 +#: ../../library/argparse.rst:1315 msgid "" "*option_string* - The option string that was used to invoke this action. The " "``option_string`` argument is optional, and will be absent if the action is " "associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1331 +#: ../../library/argparse.rst:1319 msgid "" "The :meth:`!__call__` method may perform arbitrary actions, but will " "typically set attributes on the ``namespace`` based on ``dest`` and " "``values``." msgstr "" -#: ../../library/argparse.rst:1336 +#: ../../library/argparse.rst:1324 msgid "" ":class:`!Action` subclasses can define a :meth:`!format_usage` method that " "takes no argument and return a string which will be used when printing the " @@ -2291,47 +2275,69 @@ msgid "" "will be used." msgstr "" -#: ../../library/argparse.rst:1342 +#: ../../library/argparse.rst:1330 +msgid "" +"A subclass of :class:`Action` for handling boolean flags with positive and " +"negative options. Adding a single argument such as ``--foo`` automatically " +"creates both ``--foo`` and ``--no-foo`` options, storing ``True`` and " +"``False`` respectively::" +msgstr "" + +#: ../../library/argparse.rst:1335 +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" +">>> parser.parse_args(['--no-foo'])\n" +"Namespace(foo=False)" +msgstr "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" +">>> parser.parse_args(['--no-foo'])\n" +"Namespace(foo=False)" + +#: ../../library/argparse.rst:1345 msgid "The parse_args() method" msgstr "parse_args() 方法" -#: ../../library/argparse.rst:1346 +#: ../../library/argparse.rst:1349 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1349 +#: ../../library/argparse.rst:1352 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:`!" "add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1353 +#: ../../library/argparse.rst:1356 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1356 +#: ../../library/argparse.rst:1359 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1361 +#: ../../library/argparse.rst:1364 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1363 +#: ../../library/argparse.rst:1366 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1367 +#: ../../library/argparse.rst:1370 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2349,14 +2355,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1375 +#: ../../library/argparse.rst:1378 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1379 +#: ../../library/argparse.rst:1382 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2364,13 +2370,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1382 +#: ../../library/argparse.rst:1385 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1385 +#: ../../library/argparse.rst:1388 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2378,13 +2384,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1388 +#: ../../library/argparse.rst:1391 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1391 +#: ../../library/argparse.rst:1394 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2400,11 +2406,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1400 +#: ../../library/argparse.rst:1403 msgid "Invalid arguments" msgstr "無效引數" -#: ../../library/argparse.rst:1402 +#: ../../library/argparse.rst:1405 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2412,7 +2418,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1407 +#: ../../library/argparse.rst:1410 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2452,11 +2458,11 @@ msgstr "" "usage: PROG [-h] [--foo FOO] [bar]\n" "PROG: error: extra arguments found: badger" -#: ../../library/argparse.rst:1428 +#: ../../library/argparse.rst:1431 msgid "Arguments containing ``-``" msgstr "包含 ``-`` 的引數" -#: ../../library/argparse.rst:1430 +#: ../../library/argparse.rst:1433 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2468,7 +2474,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1438 +#: ../../library/argparse.rst:1441 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2501,7 +2507,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1468 +#: ../../library/argparse.rst:1471 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2509,7 +2515,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1473 +#: ../../library/argparse.rst:1476 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2517,24 +2523,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1476 +#: ../../library/argparse.rst:1479 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1482 +#: ../../library/argparse.rst:1485 msgid "Argument abbreviations (prefix matching)" msgstr "引數縮寫 (前綴匹配)" -#: ../../library/argparse.rst:1484 +#: ../../library/argparse.rst:1487 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1488 +#: ../../library/argparse.rst:1491 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2558,17 +2564,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1499 +#: ../../library/argparse.rst:1502 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1505 +#: ../../library/argparse.rst:1508 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1507 +#: ../../library/argparse.rst:1510 msgid "" "Sometimes it may be useful to have an :class:`ArgumentParser` parse " "arguments other than those of :data:`sys.argv`. This can be accomplished by " @@ -2576,7 +2582,7 @@ msgid "" "useful for testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1512 +#: ../../library/argparse.rst:1515 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2602,24 +2608,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1527 +#: ../../library/argparse.rst:1530 msgid "The Namespace object" msgstr "命名空間物件" -#: ../../library/argparse.rst:1531 +#: ../../library/argparse.rst:1534 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1534 +#: ../../library/argparse.rst:1537 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1538 +#: ../../library/argparse.rst:1541 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2633,14 +2639,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1544 +#: ../../library/argparse.rst:1547 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1548 +#: ../../library/argparse.rst:1551 msgid "" ">>> class C:\n" "... pass\n" @@ -2662,15 +2668,15 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1560 +#: ../../library/argparse.rst:1563 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1563 +#: ../../library/argparse.rst:1566 msgid "Sub-commands" msgstr "子命令" -#: ../../library/argparse.rst:1570 +#: ../../library/argparse.rst:1573 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " @@ -2685,69 +2691,69 @@ msgid "" "returns an :class:`!ArgumentParser` object that can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1582 +#: ../../library/argparse.rst:1585 msgid "Description of parameters:" msgstr "參數的解釋:" -#: ../../library/argparse.rst:1584 +#: ../../library/argparse.rst:1587 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1588 +#: ../../library/argparse.rst:1591 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1591 +#: ../../library/argparse.rst:1594 msgid "" "*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1595 +#: ../../library/argparse.rst:1598 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" -#: ../../library/argparse.rst:1598 +#: ../../library/argparse.rst:1601 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1601 +#: ../../library/argparse.rst:1604 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1604 +#: ../../library/argparse.rst:1607 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1607 +#: ../../library/argparse.rst:1610 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1609 +#: ../../library/argparse.rst:1612 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1612 +#: ../../library/argparse.rst:1615 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1614 +#: ../../library/argparse.rst:1617 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2770,7 +2776,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1633 +#: ../../library/argparse.rst:1636 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -2780,7 +2786,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1640 +#: ../../library/argparse.rst:1643 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -2789,7 +2795,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1648 +#: ../../library/argparse.rst:1651 msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" @@ -2847,14 +2853,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1676 +#: ../../library/argparse.rst:1679 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1680 +#: ../../library/argparse.rst:1683 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -2890,7 +2896,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1697 +#: ../../library/argparse.rst:1700 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -2898,7 +2904,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1702 +#: ../../library/argparse.rst:1705 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -2914,13 +2920,13 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1709 +#: ../../library/argparse.rst:1712 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1723 +#: ../../library/argparse.rst:1726 msgid "" "One particularly effective way of handling subcommands is to combine the use " "of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " @@ -2928,7 +2934,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1728 +#: ../../library/argparse.rst:1731 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -2963,7 +2969,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1760 +#: ../../library/argparse.rst:1763 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -2973,7 +2979,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1767 +#: ../../library/argparse.rst:1770 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -2993,15 +2999,15 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1776 +#: ../../library/argparse.rst:1779 msgid "New *required* keyword-only parameter." msgstr "" -#: ../../library/argparse.rst:1781 +#: ../../library/argparse.rst:1784 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1785 +#: ../../library/argparse.rst:1788 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -3010,7 +3016,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1791 +#: ../../library/argparse.rst:1794 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -3028,14 +3034,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1797 +#: ../../library/argparse.rst:1800 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1801 +#: ../../library/argparse.rst:1804 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -3047,15 +3053,15 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1806 +#: ../../library/argparse.rst:1809 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1811 +#: ../../library/argparse.rst:1814 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1816 +#: ../../library/argparse.rst:1819 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3064,7 +3070,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1822 +#: ../../library/argparse.rst:1825 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3088,7 +3094,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1833 +#: ../../library/argparse.rst:1836 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3099,7 +3105,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:1841 +#: ../../library/argparse.rst:1844 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3137,7 +3143,7 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1859 +#: ../../library/argparse.rst:1862 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -3146,13 +3152,13 @@ msgid "" "rather than the entire parser." msgstr "" -#: ../../library/argparse.rst:1864 +#: ../../library/argparse.rst:1867 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1867 +#: ../../library/argparse.rst:1870 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3160,18 +3166,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:1875 +#: ../../library/argparse.rst:1878 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1879 +#: ../../library/argparse.rst:1882 msgid "" "Create a mutually exclusive group. :mod:`!argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1883 +#: ../../library/argparse.rst:1886 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3197,14 +3203,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:1895 +#: ../../library/argparse.rst:1898 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:1899 +#: ../../library/argparse.rst:1902 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3222,7 +3228,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:1907 +#: ../../library/argparse.rst:1910 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3230,7 +3236,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:1913 +#: ../../library/argparse.rst:1916 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3266,7 +3272,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1930 +#: ../../library/argparse.rst:1933 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3274,11 +3280,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:1938 +#: ../../library/argparse.rst:1941 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:1942 +#: ../../library/argparse.rst:1945 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3287,7 +3293,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:1948 +#: ../../library/argparse.rst:1951 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3301,12 +3307,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:1954 +#: ../../library/argparse.rst:1957 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:1956 +#: ../../library/argparse.rst:1959 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3320,20 +3326,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:1962 +#: ../../library/argparse.rst:1965 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:1968 +#: ../../library/argparse.rst:1971 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:1972 +#: ../../library/argparse.rst:1975 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3345,54 +3351,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:1979 +#: ../../library/argparse.rst:1982 msgid "Printing help" msgstr "印出幫助訊息" -#: ../../library/argparse.rst:1981 +#: ../../library/argparse.rst:1984 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:1987 +#: ../../library/argparse.rst:1990 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:1993 +#: ../../library/argparse.rst:1996 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:1997 +#: ../../library/argparse.rst:2000 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:2002 +#: ../../library/argparse.rst:2005 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:2007 +#: ../../library/argparse.rst:2010 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:2012 +#: ../../library/argparse.rst:2015 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2016 +#: ../../library/argparse.rst:2019 msgid "" "Sometimes a script only needs to handle a specific set of command-line " "arguments, leaving any unrecognized arguments for another script or program. " @@ -3400,7 +3406,7 @@ msgid "" "useful." msgstr "" -#: ../../library/argparse.rst:2021 +#: ../../library/argparse.rst:2024 msgid "" "This method works similarly to :meth:`~ArgumentParser.parse_args`, but it " "does not raise an error for extra, unrecognized arguments. Instead, it " @@ -3408,7 +3414,7 @@ msgid "" "populated namespace and the list of any unrecognized arguments." msgstr "" -#: ../../library/argparse.rst:2028 +#: ../../library/argparse.rst:2031 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3422,7 +3428,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2035 +#: ../../library/argparse.rst:2038 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3430,11 +3436,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2042 +#: ../../library/argparse.rst:2045 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2046 +#: ../../library/argparse.rst:2049 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3442,20 +3448,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2051 +#: ../../library/argparse.rst:2054 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2055 +#: ../../library/argparse.rst:2058 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2058 +#: ../../library/argparse.rst:2061 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3465,18 +3471,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2064 +#: ../../library/argparse.rst:2067 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2068 +#: ../../library/argparse.rst:2071 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2072 +#: ../../library/argparse.rst:2075 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3490,17 +3496,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2080 +#: ../../library/argparse.rst:2083 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2085 +#: ../../library/argparse.rst:2088 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2090 +#: ../../library/argparse.rst:2093 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3508,7 +3514,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2095 +#: ../../library/argparse.rst:2098 msgid "" "These parsers do not support all the :mod:`!argparse` features, and will " "raise exceptions if unsupported features are used. In particular, " @@ -3516,7 +3522,7 @@ msgid "" "positionals are not supported." msgstr "" -#: ../../library/argparse.rst:2100 +#: ../../library/argparse.rst:2103 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3524,7 +3530,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2106 +#: ../../library/argparse.rst:2109 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3544,7 +3550,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2115 +#: ../../library/argparse.rst:2118 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3552,11 +3558,11 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2124 +#: ../../library/argparse.rst:2127 msgid "Registering custom types or actions" msgstr "" -#: ../../library/argparse.rst:2128 +#: ../../library/argparse.rst:2131 msgid "" "Sometimes it's desirable to use a custom string in error messages to provide " "more user-friendly output. In these cases, :meth:`!register` can be used to " @@ -3564,7 +3570,7 @@ msgid "" "the type by their registered name instead of their callable name." msgstr "" -#: ../../library/argparse.rst:2133 +#: ../../library/argparse.rst:2136 msgid "" "The :meth:`!register` method accepts three arguments - a *registry_name*, " "specifying the internal registry where the object will be stored (e.g., " @@ -3572,12 +3578,12 @@ msgid "" "be registered, and object, the callable to be registered." msgstr "" -#: ../../library/argparse.rst:2138 +#: ../../library/argparse.rst:2141 msgid "" "The following example shows how to register a custom type with a parser::" msgstr "" -#: ../../library/argparse.rst:2140 +#: ../../library/argparse.rst:2143 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -3593,42 +3599,42 @@ msgid "" "PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" msgstr "" -#: ../../library/argparse.rst:2152 +#: ../../library/argparse.rst:2155 msgid "Exceptions" msgstr "例外" -#: ../../library/argparse.rst:2156 +#: ../../library/argparse.rst:2159 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2158 +#: ../../library/argparse.rst:2161 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2163 +#: ../../library/argparse.rst:2166 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:2167 +#: ../../library/argparse.rst:2170 msgid "Guides and Tutorials" msgstr "" -#: ../../library/argparse.rst:815 +#: ../../library/argparse.rst:803 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:815 ../../library/argparse.rst:849 -#: ../../library/argparse.rst:863 +#: ../../library/argparse.rst:803 ../../library/argparse.rst:837 +#: ../../library/argparse.rst:851 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:849 +#: ../../library/argparse.rst:837 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:863 +#: ../../library/argparse.rst:851 msgid "+ (plus)" msgstr "+ (加號)" diff --git a/library/codecs.po b/library/codecs.po index 1c6c9fcef5..768839988e 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-01 00:18+0000\n" +"POT-Creation-Date: 2025-07-12 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -106,7 +105,7 @@ msgstr "" #: ../../library/codecs.rst:84 msgid "The name of the encoding." -msgstr "" +msgstr "編碼的名稱。" #: ../../library/codecs.rst:90 msgid "" @@ -259,7 +258,7 @@ msgstr "" #: ../../library/codecs.rst:216 msgid "The ``'U'`` mode has been removed." -msgstr "" +msgstr "已移除 ``'U'`` 模式。" #: ../../library/codecs.rst:222 msgid "" @@ -290,9 +289,9 @@ msgstr "" #: ../../library/codecs.rst:241 msgid "" "Uses an incremental encoder to iteratively encode the input provided by " -"*iterator*. This function is a :term:`generator`. The *errors* argument (as " -"well as any other keyword argument) is passed through to the incremental " -"encoder." +"*iterator*. *iterator* must yield :class:`str` objects. This function is a :" +"term:`generator`. The *errors* argument (as well as any other keyword " +"argument) is passed through to the incremental encoder." msgstr "" #: ../../library/codecs.rst:246 @@ -305,9 +304,9 @@ msgstr "" #: ../../library/codecs.rst:253 msgid "" "Uses an incremental decoder to iteratively decode the input provided by " -"*iterator*. This function is a :term:`generator`. The *errors* argument (as " -"well as any other keyword argument) is passed through to the incremental " -"decoder." +"*iterator*. *iterator* must yield :class:`bytes` objects. This function is " +"a :term:`generator`. The *errors* argument (as well as any other keyword " +"argument) is passed through to the incremental decoder." msgstr "" #: ../../library/codecs.rst:258 @@ -318,13 +317,32 @@ msgid "" "`iterencode`." msgstr "" -#: ../../library/codecs.rst:264 +#: ../../library/codecs.rst:266 +msgid "" +"Return a :class:`tuple` containing the raw bytes of *buffer*, a :ref:`buffer-" +"compatible object ` or :class:`str` (encoded to UTF-8 before " +"processing), and their length in bytes." +msgstr "" + +#: ../../library/codecs.rst:270 +msgid "The *errors* argument is ignored." +msgstr "忽略 *errors* 引數。" + +#: ../../library/codecs.rst:272 +msgid "" +">>> codecs.readbuffer_encode(b\"Zito\")\n" +"(b'Zito', 4)" +msgstr "" +">>> codecs.readbuffer_encode(b\"Zito\")\n" +"(b'Zito', 4)" + +#: ../../library/codecs.rst:278 msgid "" "The module also provides the following constants which are useful for " "reading and writing to platform dependent files:" msgstr "" -#: ../../library/codecs.rst:279 +#: ../../library/codecs.rst:293 msgid "" "These constants define various byte sequences, being Unicode byte order " "marks (BOMs) for several encodings. They are used in UTF-16 and UTF-32 data " @@ -336,18 +354,18 @@ msgid "" "represent the BOM in UTF-8 and UTF-32 encodings." msgstr "" -#: ../../library/codecs.rst:293 +#: ../../library/codecs.rst:307 msgid "Codec Base Classes" msgstr "" -#: ../../library/codecs.rst:295 +#: ../../library/codecs.rst:309 msgid "" "The :mod:`codecs` module defines a set of base classes which define the " "interfaces for working with codec objects, and can also be used as the basis " "for custom codec implementations." msgstr "" -#: ../../library/codecs.rst:299 +#: ../../library/codecs.rst:313 msgid "" "Each codec has to define four interfaces to make it usable as codec in " "Python: stateless encoder, stateless decoder, stream reader and stream " @@ -356,69 +374,69 @@ msgid "" "how the codec will handle encoding and decoding errors." msgstr "" -#: ../../library/codecs.rst:310 +#: ../../library/codecs.rst:324 msgid "Error Handlers" msgstr "" -#: ../../library/codecs.rst:312 +#: ../../library/codecs.rst:326 msgid "" "To simplify and standardize error handling, codecs may implement different " "error handling schemes by accepting the *errors* string argument:" msgstr "" -#: ../../library/codecs.rst:332 +#: ../../library/codecs.rst:346 msgid "" "The following error handlers can be used with all Python :ref:`standard-" "encodings` codecs:" msgstr "" -#: ../../library/codecs.rst:338 ../../library/codecs.rst:381 -#: ../../library/codecs.rst:401 +#: ../../library/codecs.rst:352 ../../library/codecs.rst:395 +#: ../../library/codecs.rst:415 msgid "Value" msgstr "" -#: ../../library/codecs.rst:338 ../../library/codecs.rst:381 -#: ../../library/codecs.rst:401 ../../library/codecs.rst:1339 -#: ../../library/codecs.rst:1407 ../../library/codecs.rst:1462 +#: ../../library/codecs.rst:352 ../../library/codecs.rst:395 +#: ../../library/codecs.rst:415 ../../library/codecs.rst:1353 +#: ../../library/codecs.rst:1425 ../../library/codecs.rst:1480 msgid "Meaning" msgstr "含義" -#: ../../library/codecs.rst:340 +#: ../../library/codecs.rst:354 msgid "``'strict'``" msgstr "``'strict'``" -#: ../../library/codecs.rst:340 +#: ../../library/codecs.rst:354 msgid "" "Raise :exc:`UnicodeError` (or a subclass), this is the default. Implemented " "in :func:`strict_errors`." msgstr "" -#: ../../library/codecs.rst:344 +#: ../../library/codecs.rst:358 msgid "``'ignore'``" msgstr "``'ignore'``" -#: ../../library/codecs.rst:344 +#: ../../library/codecs.rst:358 msgid "" "Ignore the malformed data and continue without further notice. Implemented " "in :func:`ignore_errors`." msgstr "" -#: ../../library/codecs.rst:348 +#: ../../library/codecs.rst:362 msgid "``'replace'``" msgstr "``'replace'``" -#: ../../library/codecs.rst:348 +#: ../../library/codecs.rst:362 msgid "" "Replace with a replacement marker. On encoding, use ``?`` (ASCII character). " "On decoding, use ``�`` (U+FFFD, the official REPLACEMENT CHARACTER). " "Implemented in :func:`replace_errors`." msgstr "" -#: ../../library/codecs.rst:354 +#: ../../library/codecs.rst:368 msgid "``'backslashreplace'``" msgstr "``'backslashreplace'``" -#: ../../library/codecs.rst:354 +#: ../../library/codecs.rst:368 msgid "" "Replace with backslashed escape sequences. On encoding, use hexadecimal form " "of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :" @@ -426,11 +444,11 @@ msgid "" "format :samp:`\\\\x{hh}`. Implemented in :func:`backslashreplace_errors`." msgstr "" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:377 msgid "``'surrogateescape'``" msgstr "``'surrogateescape'``" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:377 msgid "" "On decoding, replace byte with individual surrogate code ranging from " "``U+DC80`` to ``U+DCFF``. This code will then be turned back into the same " @@ -438,92 +456,92 @@ msgid "" "data. (See :pep:`383` for more.)" msgstr "" -#: ../../library/codecs.rst:377 +#: ../../library/codecs.rst:391 msgid "" "The following error handlers are only applicable to encoding (within :term:" "`text encodings `):" msgstr "" -#: ../../library/codecs.rst:383 +#: ../../library/codecs.rst:397 msgid "``'xmlcharrefreplace'``" msgstr "``'xmlcharrefreplace'``" -#: ../../library/codecs.rst:383 +#: ../../library/codecs.rst:397 msgid "" "Replace with XML/HTML numeric character reference, which is a decimal form " "of Unicode code point with format :samp:`&#{num};`. Implemented in :func:" "`xmlcharrefreplace_errors`." msgstr "" -#: ../../library/codecs.rst:389 +#: ../../library/codecs.rst:403 msgid "``'namereplace'``" msgstr "``'namereplace'``" -#: ../../library/codecs.rst:389 +#: ../../library/codecs.rst:403 msgid "" "Replace with ``\\N{...}`` escape sequences, what appears in the braces is " "the Name property from Unicode Character Database. Implemented in :func:" "`namereplace_errors`." msgstr "" -#: ../../library/codecs.rst:398 +#: ../../library/codecs.rst:412 msgid "" "In addition, the following error handler is specific to the given codecs:" msgstr "" -#: ../../library/codecs.rst:13 ../../library/codecs.rst:401 +#: ../../library/codecs.rst:13 ../../library/codecs.rst:415 msgid "Codecs" msgstr "" -#: ../../library/codecs.rst:403 +#: ../../library/codecs.rst:417 msgid "``'surrogatepass'``" msgstr "``'surrogatepass'``" -#: ../../library/codecs.rst:403 +#: ../../library/codecs.rst:417 msgid "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" msgstr "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" -#: ../../library/codecs.rst:403 +#: ../../library/codecs.rst:417 msgid "" "Allow encoding and decoding surrogate code point (``U+D800`` - ``U+DFFF``) " "as normal code point. Otherwise these codecs treat the presence of surrogate " "code point in :class:`str` as an error." msgstr "" -#: ../../library/codecs.rst:410 +#: ../../library/codecs.rst:424 msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." msgstr "" -#: ../../library/codecs.rst:413 +#: ../../library/codecs.rst:427 msgid "" "The ``'surrogatepass'`` error handler now works with utf-16\\* and utf-32\\* " "codecs." msgstr "" -#: ../../library/codecs.rst:417 +#: ../../library/codecs.rst:431 msgid "The ``'namereplace'`` error handler." msgstr "" -#: ../../library/codecs.rst:420 +#: ../../library/codecs.rst:434 msgid "" "The ``'backslashreplace'`` error handler now works with decoding and " "translating." msgstr "" -#: ../../library/codecs.rst:424 +#: ../../library/codecs.rst:438 msgid "" "The set of allowed values can be extended by registering a new named error " "handler:" msgstr "" -#: ../../library/codecs.rst:429 +#: ../../library/codecs.rst:443 msgid "" "Register the error handling function *error_handler* under the name *name*. " "The *error_handler* argument will be called during encoding and decoding in " "case of an error, when *name* is specified as the errors parameter." msgstr "" -#: ../../library/codecs.rst:433 +#: ../../library/codecs.rst:447 msgid "" "For encoding, *error_handler* will be called with a :exc:" "`UnicodeEncodeError` instance, which contains information about the location " @@ -538,66 +556,66 @@ msgid "" "position is out of bound an :exc:`IndexError` will be raised." msgstr "" -#: ../../library/codecs.rst:445 +#: ../../library/codecs.rst:459 msgid "" "Decoding and translating works similarly, except :exc:`UnicodeDecodeError` " "or :exc:`UnicodeTranslateError` will be passed to the handler and that the " "replacement from the error handler will be put into the output directly." msgstr "" -#: ../../library/codecs.rst:450 +#: ../../library/codecs.rst:464 msgid "" "Previously registered error handlers (including the standard error handlers) " "can be looked up by name:" msgstr "" -#: ../../library/codecs.rst:455 +#: ../../library/codecs.rst:469 msgid "Return the error handler previously registered under the name *name*." msgstr "" -#: ../../library/codecs.rst:457 +#: ../../library/codecs.rst:471 msgid "Raises a :exc:`LookupError` in case the handler cannot be found." msgstr "" -#: ../../library/codecs.rst:459 +#: ../../library/codecs.rst:473 msgid "" "The following standard error handlers are also made available as module " "level functions:" msgstr "" -#: ../../library/codecs.rst:464 +#: ../../library/codecs.rst:478 msgid "Implements the ``'strict'`` error handling." msgstr "" -#: ../../library/codecs.rst:466 +#: ../../library/codecs.rst:480 msgid "Each encoding or decoding error raises a :exc:`UnicodeError`." msgstr "" -#: ../../library/codecs.rst:471 +#: ../../library/codecs.rst:485 msgid "Implements the ``'ignore'`` error handling." msgstr "" -#: ../../library/codecs.rst:473 +#: ../../library/codecs.rst:487 msgid "" "Malformed data is ignored; encoding or decoding is continued without further " "notice." msgstr "" -#: ../../library/codecs.rst:479 +#: ../../library/codecs.rst:493 msgid "Implements the ``'replace'`` error handling." msgstr "" -#: ../../library/codecs.rst:481 +#: ../../library/codecs.rst:495 msgid "" "Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, " "the official REPLACEMENT CHARACTER) for decoding errors." msgstr "" -#: ../../library/codecs.rst:487 +#: ../../library/codecs.rst:501 msgid "Implements the ``'backslashreplace'`` error handling." msgstr "" -#: ../../library/codecs.rst:489 +#: ../../library/codecs.rst:503 msgid "" "Malformed data is replaced by a backslashed escape sequence. On encoding, " "use the hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}" @@ -605,30 +623,30 @@ msgid "" "hexadecimal form of byte value with format :samp:`\\\\x{hh}`." msgstr "" -#: ../../library/codecs.rst:495 +#: ../../library/codecs.rst:509 msgid "Works with decoding and translating." msgstr "" -#: ../../library/codecs.rst:501 +#: ../../library/codecs.rst:515 msgid "" "Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :" "term:`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:504 +#: ../../library/codecs.rst:518 msgid "" "The unencodable character is replaced by an appropriate XML/HTML numeric " "character reference, which is a decimal form of Unicode code point with " "format :samp:`&#{num};` ." msgstr "" -#: ../../library/codecs.rst:511 +#: ../../library/codecs.rst:525 msgid "" "Implements the ``'namereplace'`` error handling (for encoding within :term:" "`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:514 +#: ../../library/codecs.rst:528 msgid "" "The unencodable character is replaced by a ``\\N{...}`` escape sequence. The " "set of characters that appear in the braces is the Name property from " @@ -636,17 +654,17 @@ msgid "" "will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}`` ." msgstr "" -#: ../../library/codecs.rst:525 +#: ../../library/codecs.rst:539 msgid "Stateless Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:527 +#: ../../library/codecs.rst:541 msgid "" "The base :class:`Codec` class defines these methods which also define the " "function interfaces of the stateless encoder and decoder:" msgstr "" -#: ../../library/codecs.rst:535 +#: ../../library/codecs.rst:549 msgid "" "Encodes the object *input* and returns a tuple (output object, length " "consumed). For instance, :term:`text encoding` converts a string object to a " @@ -654,26 +672,26 @@ msgid "" "``iso-8859-1``)." msgstr "" -#: ../../library/codecs.rst:540 ../../library/codecs.rst:562 +#: ../../library/codecs.rst:554 ../../library/codecs.rst:576 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." msgstr "" -#: ../../library/codecs.rst:543 +#: ../../library/codecs.rst:557 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamWriter` for codecs which have to keep state in order to make encoding " "efficient." msgstr "" -#: ../../library/codecs.rst:547 +#: ../../library/codecs.rst:561 msgid "" "The encoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:553 +#: ../../library/codecs.rst:567 msgid "" "Decodes the object *input* and returns a tuple (output object, length " "consumed). For instance, for a :term:`text encoding`, decoding converts a " @@ -681,31 +699,31 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:558 +#: ../../library/codecs.rst:572 msgid "" "For text encodings and bytes-to-bytes codecs, *input* must be a bytes object " "or one which provides the read-only buffer interface -- for example, buffer " "objects and memory mapped files." msgstr "" -#: ../../library/codecs.rst:565 +#: ../../library/codecs.rst:579 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamReader` for codecs which have to keep state in order to make decoding " "efficient." msgstr "" -#: ../../library/codecs.rst:569 +#: ../../library/codecs.rst:583 msgid "" "The decoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:574 +#: ../../library/codecs.rst:588 msgid "Incremental Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:576 +#: ../../library/codecs.rst:590 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -716,7 +734,7 @@ msgid "" "during method calls." msgstr "" -#: ../../library/codecs.rst:584 +#: ../../library/codecs.rst:598 msgid "" "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" "`~IncrementalDecoder.decode` method is the same as if all the single inputs " @@ -724,36 +742,36 @@ msgid "" "encoder/decoder." msgstr "" -#: ../../library/codecs.rst:593 +#: ../../library/codecs.rst:607 msgid "IncrementalEncoder Objects" msgstr "IncrementalEncoder 物件" -#: ../../library/codecs.rst:595 +#: ../../library/codecs.rst:609 msgid "" "The :class:`IncrementalEncoder` class is used for encoding an input in " "multiple steps. It defines the following methods which every incremental " "encoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:602 +#: ../../library/codecs.rst:616 msgid "Constructor for an :class:`IncrementalEncoder` instance." -msgstr "" +msgstr ":class:`IncrementalEncoder` 的建構函式。" -#: ../../library/codecs.rst:604 +#: ../../library/codecs.rst:618 msgid "" "All incremental encoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:608 +#: ../../library/codecs.rst:622 msgid "" "The :class:`IncrementalEncoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:612 +#: ../../library/codecs.rst:626 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -761,21 +779,21 @@ msgid "" "`IncrementalEncoder` object." msgstr "" -#: ../../library/codecs.rst:620 +#: ../../library/codecs.rst:634 msgid "" "Encodes *object* (taking the current state of the encoder into account) and " "returns the resulting encoded object. If this is the last call to :meth:" "`encode` *final* must be true (the default is false)." msgstr "" -#: ../../library/codecs.rst:627 +#: ../../library/codecs.rst:641 msgid "" "Reset the encoder to the initial state. The output is discarded: call ``." "encode(object, final=True)``, passing an empty byte or text string if " "necessary, to reset the encoder and to get the output." msgstr "" -#: ../../library/codecs.rst:634 +#: ../../library/codecs.rst:648 msgid "" "Return the current state of the encoder which must be an integer. The " "implementation should make sure that ``0`` is the most common state. (States " @@ -784,42 +802,42 @@ msgid "" "into an integer.)" msgstr "" -#: ../../library/codecs.rst:643 +#: ../../library/codecs.rst:657 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:650 +#: ../../library/codecs.rst:664 msgid "IncrementalDecoder Objects" msgstr "IncrementalDecoder 物件" -#: ../../library/codecs.rst:652 +#: ../../library/codecs.rst:666 msgid "" "The :class:`IncrementalDecoder` class is used for decoding an input in " "multiple steps. It defines the following methods which every incremental " "decoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:659 +#: ../../library/codecs.rst:673 msgid "Constructor for an :class:`IncrementalDecoder` instance." -msgstr "" +msgstr ":class:`IncrementalDecoder` 的建構函式。" -#: ../../library/codecs.rst:661 +#: ../../library/codecs.rst:675 msgid "" "All incremental decoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:665 +#: ../../library/codecs.rst:679 msgid "" "The :class:`IncrementalDecoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:669 +#: ../../library/codecs.rst:683 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -827,7 +845,7 @@ msgid "" "`IncrementalDecoder` object." msgstr "" -#: ../../library/codecs.rst:677 +#: ../../library/codecs.rst:691 msgid "" "Decodes *object* (taking the current state of the decoder into account) and " "returns the resulting decoded object. If this is the last call to :meth:" @@ -838,11 +856,11 @@ msgid "" "(which might raise an exception)." msgstr "" -#: ../../library/codecs.rst:688 +#: ../../library/codecs.rst:702 msgid "Reset the decoder to the initial state." -msgstr "" +msgstr "將解碼器重設到初始狀態。" -#: ../../library/codecs.rst:693 +#: ../../library/codecs.rst:707 msgid "" "Return the current state of the decoder. This must be a tuple with two " "items, the first must be the buffer containing the still undecoded input. " @@ -857,59 +875,59 @@ msgid "" "bytes of the resulting string into an integer.)" msgstr "" -#: ../../library/codecs.rst:708 +#: ../../library/codecs.rst:722 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:713 +#: ../../library/codecs.rst:727 msgid "Stream Encoding and Decoding" -msgstr "" +msgstr "串流編碼和解碼" -#: ../../library/codecs.rst:716 +#: ../../library/codecs.rst:730 msgid "" "The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " "working interfaces which can be used to implement new encoding submodules " "very easily. See :mod:`!encodings.utf_8` for an example of how this is done." msgstr "" -#: ../../library/codecs.rst:724 +#: ../../library/codecs.rst:738 msgid "StreamWriter Objects" msgstr "StreamWriter 物件" -#: ../../library/codecs.rst:726 +#: ../../library/codecs.rst:740 msgid "" "The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines " "the following methods which every stream writer must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:733 +#: ../../library/codecs.rst:747 msgid "Constructor for a :class:`StreamWriter` instance." -msgstr "" +msgstr ":class:`StreamWriter` 的建構函式。" -#: ../../library/codecs.rst:735 +#: ../../library/codecs.rst:749 msgid "" "All stream writers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:739 +#: ../../library/codecs.rst:753 msgid "" "The *stream* argument must be a file-like object open for writing text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:742 +#: ../../library/codecs.rst:756 msgid "" "The :class:`StreamWriter` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:746 +#: ../../library/codecs.rst:760 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -917,70 +935,70 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:752 +#: ../../library/codecs.rst:766 msgid "Writes the object's contents encoded to the stream." msgstr "" -#: ../../library/codecs.rst:757 +#: ../../library/codecs.rst:771 msgid "" "Writes the concatenated iterable of strings to the stream (possibly by " "reusing the :meth:`write` method). Infinite or very large iterables are not " "supported. The standard bytes-to-bytes codecs do not support this method." msgstr "" -#: ../../library/codecs.rst:765 ../../library/codecs.rst:860 +#: ../../library/codecs.rst:779 ../../library/codecs.rst:874 msgid "Resets the codec buffers used for keeping internal state." msgstr "" -#: ../../library/codecs.rst:767 +#: ../../library/codecs.rst:781 msgid "" "Calling this method should ensure that the data on the output is put into a " "clean state that allows appending of new fresh data without having to rescan " "the whole stream to recover state." msgstr "" -#: ../../library/codecs.rst:772 +#: ../../library/codecs.rst:786 msgid "" "In addition to the above methods, the :class:`StreamWriter` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:779 +#: ../../library/codecs.rst:793 msgid "StreamReader Objects" msgstr "StreamReader 物件" -#: ../../library/codecs.rst:781 +#: ../../library/codecs.rst:795 msgid "" "The :class:`StreamReader` class is a subclass of :class:`Codec` and defines " "the following methods which every stream reader must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:788 +#: ../../library/codecs.rst:802 msgid "Constructor for a :class:`StreamReader` instance." -msgstr "" +msgstr ":class:`StreamReader` 的建構函式。" -#: ../../library/codecs.rst:790 +#: ../../library/codecs.rst:804 msgid "" "All stream readers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:794 +#: ../../library/codecs.rst:808 msgid "" "The *stream* argument must be a file-like object open for reading text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:797 +#: ../../library/codecs.rst:811 msgid "" "The :class:`StreamReader` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:801 +#: ../../library/codecs.rst:815 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -988,24 +1006,24 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:805 +#: ../../library/codecs.rst:819 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" -#: ../../library/codecs.rst:811 +#: ../../library/codecs.rst:825 msgid "Decodes data from the stream and returns the resulting object." msgstr "" -#: ../../library/codecs.rst:813 +#: ../../library/codecs.rst:827 msgid "" "The *chars* argument indicates the number of decoded code points or bytes to " "return. The :func:`read` method will never return more data than requested, " "but it might return less, if there is not enough available." msgstr "" -#: ../../library/codecs.rst:818 +#: ../../library/codecs.rst:832 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -1014,13 +1032,13 @@ msgid "" "huge files in one step." msgstr "" -#: ../../library/codecs.rst:825 +#: ../../library/codecs.rst:839 msgid "" "The *firstline* flag indicates that it would be sufficient to only return " "the first line, if there are decoding errors on later lines." msgstr "" -#: ../../library/codecs.rst:829 +#: ../../library/codecs.rst:843 msgid "" "The method should use a greedy read strategy meaning that it should read as " "much data as is allowed within the definition of the encoding and the given " @@ -1028,68 +1046,68 @@ msgid "" "the stream, these should be read too." msgstr "" -#: ../../library/codecs.rst:837 +#: ../../library/codecs.rst:851 msgid "Read one line from the input stream and return the decoded data." msgstr "" -#: ../../library/codecs.rst:839 +#: ../../library/codecs.rst:853 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." msgstr "" -#: ../../library/codecs.rst:842 +#: ../../library/codecs.rst:856 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "" -#: ../../library/codecs.rst:848 +#: ../../library/codecs.rst:862 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "" -#: ../../library/codecs.rst:851 +#: ../../library/codecs.rst:865 msgid "" "Line-endings are implemented using the codec's :meth:`decode` method and are " "included in the list entries if *keepends* is true." msgstr "" -#: ../../library/codecs.rst:854 +#: ../../library/codecs.rst:868 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." msgstr "" -#: ../../library/codecs.rst:862 +#: ../../library/codecs.rst:876 msgid "" "Note that no stream repositioning should take place. This method is " "primarily intended to be able to recover from decoding errors." msgstr "" -#: ../../library/codecs.rst:866 +#: ../../library/codecs.rst:880 msgid "" "In addition to the above methods, the :class:`StreamReader` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:872 +#: ../../library/codecs.rst:886 msgid "StreamReaderWriter Objects" msgstr "StreamReaderWriter 物件" -#: ../../library/codecs.rst:874 +#: ../../library/codecs.rst:888 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." msgstr "" -#: ../../library/codecs.rst:877 ../../library/codecs.rst:901 +#: ../../library/codecs.rst:891 ../../library/codecs.rst:915 msgid "" "The design is such that one can use the factory functions returned by the :" "func:`lookup` function to construct the instance." msgstr "" -#: ../../library/codecs.rst:883 +#: ../../library/codecs.rst:897 msgid "" "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " "object. *Reader* and *Writer* must be factory functions or classes providing " @@ -1098,24 +1116,24 @@ msgid "" "writers." msgstr "" -#: ../../library/codecs.rst:888 +#: ../../library/codecs.rst:902 msgid "" ":class:`StreamReaderWriter` instances define the combined interfaces of :" "class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " "other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:896 +#: ../../library/codecs.rst:910 msgid "StreamRecoder Objects" msgstr "StreamRecoder 物件" -#: ../../library/codecs.rst:898 +#: ../../library/codecs.rst:912 msgid "" "The :class:`StreamRecoder` translates data from one encoding to another, " "which is sometimes useful when dealing with different encoding environments." msgstr "" -#: ../../library/codecs.rst:907 +#: ../../library/codecs.rst:921 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " "conversion: *encode* and *decode* work on the frontend — the data visible to " @@ -1123,17 +1141,17 @@ msgid "" "while *Reader* and *Writer* work on the backend — the data in *stream*." msgstr "" -#: ../../library/codecs.rst:913 +#: ../../library/codecs.rst:927 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." msgstr "" -#: ../../library/codecs.rst:916 +#: ../../library/codecs.rst:930 msgid "The *stream* argument must be a file-like object." -msgstr "" +msgstr "*stream* 引數必須是類檔案物件。" -#: ../../library/codecs.rst:918 +#: ../../library/codecs.rst:932 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1141,24 +1159,24 @@ msgid "" "interface respectively." msgstr "" -#: ../../library/codecs.rst:923 +#: ../../library/codecs.rst:937 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." msgstr "" -#: ../../library/codecs.rst:927 +#: ../../library/codecs.rst:941 msgid "" ":class:`StreamRecoder` instances define the combined interfaces of :class:" "`StreamReader` and :class:`StreamWriter` classes. They inherit all other " "methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:935 +#: ../../library/codecs.rst:949 msgid "Encodings and Unicode" -msgstr "" +msgstr "編碼和 Unicode" -#: ../../library/codecs.rst:937 +#: ../../library/codecs.rst:951 msgid "" "Strings are stored internally as sequences of code points in range " "``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " @@ -1170,7 +1188,7 @@ msgid "" "which are collectivity referred to as :term:`text encodings `." msgstr "" -#: ../../library/codecs.rst:947 +#: ../../library/codecs.rst:961 msgid "" "The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " "the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " @@ -1181,7 +1199,7 @@ msgid "" "position 3: ordinal not in range(256)``." msgstr "" -#: ../../library/codecs.rst:955 +#: ../../library/codecs.rst:969 msgid "" "There's another group of encodings (the so called charmap encodings) that " "choose a different subset of all Unicode code points and how these code " @@ -1191,7 +1209,7 @@ msgid "" "that shows you which character is mapped to which byte value." msgstr "" -#: ../../library/codecs.rst:962 +#: ../../library/codecs.rst:976 msgid "" "All of these encodings can only encode 256 of the 1114112 code points " "defined in Unicode. A simple and straightforward way that can store each " @@ -1221,7 +1239,7 @@ msgid "" "normal character that will be decoded like any other." msgstr "" -#: ../../library/codecs.rst:988 +#: ../../library/codecs.rst:1002 msgid "" "There's another encoding that is able to encode the full range of Unicode " "characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " @@ -1232,59 +1250,59 @@ msgid "" "which when concatenated give the Unicode character):" msgstr "" -#: ../../library/codecs.rst:997 +#: ../../library/codecs.rst:1011 msgid "Range" msgstr "" -#: ../../library/codecs.rst:997 +#: ../../library/codecs.rst:1011 msgid "Encoding" msgstr "" -#: ../../library/codecs.rst:999 +#: ../../library/codecs.rst:1013 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "``U-00000000`` ... ``U-0000007F``" -#: ../../library/codecs.rst:999 +#: ../../library/codecs.rst:1013 msgid "0xxxxxxx" msgstr "0xxxxxxx" -#: ../../library/codecs.rst:1001 +#: ../../library/codecs.rst:1015 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "``U-00000080`` ... ``U-000007FF``" -#: ../../library/codecs.rst:1001 +#: ../../library/codecs.rst:1015 msgid "110xxxxx 10xxxxxx" msgstr "110xxxxx 10xxxxxx" -#: ../../library/codecs.rst:1003 +#: ../../library/codecs.rst:1017 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "``U-00000800`` ... ``U-0000FFFF``" -#: ../../library/codecs.rst:1003 +#: ../../library/codecs.rst:1017 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "1110xxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:1005 +#: ../../library/codecs.rst:1019 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "``U-00010000`` ... ``U-0010FFFF``" -#: ../../library/codecs.rst:1005 +#: ../../library/codecs.rst:1019 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:1008 +#: ../../library/codecs.rst:1022 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "" -#: ../../library/codecs.rst:1010 +#: ../../library/codecs.rst:1024 msgid "" "As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` " "character in the decoded string (even if it's the first character) is " "treated as a ``ZERO WIDTH NO-BREAK SPACE``." msgstr "" -#: ../../library/codecs.rst:1014 +#: ../../library/codecs.rst:1028 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " @@ -1310,7 +1328,7 @@ msgstr "" msgid "INVERTED QUESTION MARK" msgstr "" -#: ../../library/codecs.rst:1030 +#: ../../library/codecs.rst:1044 msgid "" "in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding " "can be correctly guessed from the byte sequence. So here the BOM is not used " @@ -1322,11 +1340,11 @@ msgid "" "the use of the BOM is discouraged and should generally be avoided." msgstr "" -#: ../../library/codecs.rst:1043 +#: ../../library/codecs.rst:1057 msgid "Standard Encodings" -msgstr "" +msgstr "標準編碼" -#: ../../library/codecs.rst:1045 +#: ../../library/codecs.rst:1059 msgid "" "Python comes with a number of codecs built-in, either implemented as C " "functions or with dictionaries as mapping tables. The following table lists " @@ -1338,7 +1356,7 @@ msgid "" "alias for the ``'utf_8'`` codec." msgstr "" -#: ../../library/codecs.rst:1055 +#: ../../library/codecs.rst:1069 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1348,11 +1366,11 @@ msgid "" "Using alternative aliases for these encodings may result in slower execution." msgstr "" -#: ../../library/codecs.rst:1063 +#: ../../library/codecs.rst:1077 msgid "Optimization opportunity recognized for us-ascii." msgstr "" -#: ../../library/codecs.rst:1066 +#: ../../library/codecs.rst:1080 msgid "" "Many of the character sets support the same languages. They vary in " "individual characters (e.g. whether the EURO SIGN is supported or not), and " @@ -1360,504 +1378,504 @@ msgid "" "languages in particular, the following variants typically exist:" msgstr "" -#: ../../library/codecs.rst:1071 +#: ../../library/codecs.rst:1085 msgid "an ISO 8859 codeset" msgstr "" -#: ../../library/codecs.rst:1073 +#: ../../library/codecs.rst:1087 msgid "" "a Microsoft Windows code page, which is typically derived from an 8859 " "codeset, but replaces control characters with additional graphic characters" msgstr "" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1090 msgid "an IBM EBCDIC code page" msgstr "" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1092 msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: ../../library/codecs.rst:1083 ../../library/codecs.rst:1339 -#: ../../library/codecs.rst:1407 ../../library/codecs.rst:1462 +#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1353 +#: ../../library/codecs.rst:1425 ../../library/codecs.rst:1480 msgid "Codec" msgstr "" -#: ../../library/codecs.rst:1083 ../../library/codecs.rst:1339 -#: ../../library/codecs.rst:1407 ../../library/codecs.rst:1462 +#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1353 +#: ../../library/codecs.rst:1425 ../../library/codecs.rst:1480 msgid "Aliases" msgstr "" -#: ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1097 msgid "Languages" msgstr "語言" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1099 msgid "ascii" msgstr "ascii" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1099 msgid "646, us-ascii" msgstr "646, us-ascii" -#: ../../library/codecs.rst:1085 ../../library/codecs.rst:1091 -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1099 ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1113 msgid "English" msgstr "英文" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1101 msgid "big5" msgstr "big5" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1101 msgid "big5-tw, csbig5" msgstr "big5-tw, csbig5" -#: ../../library/codecs.rst:1087 ../../library/codecs.rst:1089 -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1162 msgid "Traditional Chinese" msgstr "繁體中文" -#: ../../library/codecs.rst:1089 +#: ../../library/codecs.rst:1103 msgid "big5hkscs" msgstr "big5hkscs" -#: ../../library/codecs.rst:1089 +#: ../../library/codecs.rst:1103 msgid "big5-hkscs, hkscs" msgstr "big5-hkscs, hkscs" -#: ../../library/codecs.rst:1091 +#: ../../library/codecs.rst:1105 msgid "cp037" msgstr "cp037" -#: ../../library/codecs.rst:1091 +#: ../../library/codecs.rst:1105 msgid "IBM037, IBM039" msgstr "IBM037, IBM039" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1107 msgid "cp273" msgstr "cp273" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1107 msgid "273, IBM273, csIBM273" msgstr "273, IBM273, csIBM273" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1107 msgid "German" msgstr "德文" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1111 msgid "cp424" msgstr "cp424" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1111 msgid "EBCDIC-CP-HE, IBM424" msgstr "EBCDIC-CP-HE, IBM424" -#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1117 -#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1171 -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1111 ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1141 ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1248 msgid "Hebrew" msgstr "希伯來文" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1113 msgid "cp437" msgstr "cp437" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1113 msgid "437, IBM437" msgstr "437, IBM437" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1115 msgid "cp500" msgstr "cp500" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1115 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1110 -#: ../../library/codecs.rst:1121 ../../library/codecs.rst:1158 -#: ../../library/codecs.rst:1165 ../../library/codecs.rst:1218 -#: ../../library/codecs.rst:1246 ../../library/codecs.rst:1274 +#: ../../library/codecs.rst:1115 ../../library/codecs.rst:1124 +#: ../../library/codecs.rst:1135 ../../library/codecs.rst:1172 +#: ../../library/codecs.rst:1179 ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1260 ../../library/codecs.rst:1288 msgid "Western Europe" msgstr "" -#: ../../library/codecs.rst:1104 +#: ../../library/codecs.rst:1118 msgid "cp720" msgstr "cp720" -#: ../../library/codecs.rst:1104 ../../library/codecs.rst:1131 -#: ../../library/codecs.rst:1173 ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1118 ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1187 ../../library/codecs.rst:1244 msgid "Arabic" msgstr "阿拉伯文" -#: ../../library/codecs.rst:1106 +#: ../../library/codecs.rst:1120 msgid "cp737" msgstr "cp737" -#: ../../library/codecs.rst:1106 ../../library/codecs.rst:1137 -#: ../../library/codecs.rst:1141 ../../library/codecs.rst:1167 -#: ../../library/codecs.rst:1232 ../../library/codecs.rst:1267 +#: ../../library/codecs.rst:1120 ../../library/codecs.rst:1151 +#: ../../library/codecs.rst:1155 ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1246 ../../library/codecs.rst:1281 msgid "Greek" msgstr "希臘文" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1122 msgid "cp775" msgstr "cp775" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1122 msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1108 ../../library/codecs.rst:1175 -#: ../../library/codecs.rst:1225 ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1122 ../../library/codecs.rst:1189 +#: ../../library/codecs.rst:1239 ../../library/codecs.rst:1256 msgid "Baltic languages" msgstr "" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1124 msgid "cp850" msgstr "cp850" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1124 msgid "850, IBM850" msgstr "850, IBM850" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1126 msgid "cp852" msgstr "cp852" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1126 msgid "852, IBM852" msgstr "852, IBM852" -#: ../../library/codecs.rst:1112 ../../library/codecs.rst:1160 -#: ../../library/codecs.rst:1221 ../../library/codecs.rst:1271 +#: ../../library/codecs.rst:1126 ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1235 ../../library/codecs.rst:1285 msgid "Central and Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1128 msgid "cp855" msgstr "cp855" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1128 msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1114 ../../library/codecs.rst:1162 -#: ../../library/codecs.rst:1227 ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1128 ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1241 ../../library/codecs.rst:1278 msgid "Belarusian, Bulgarian, Macedonian, Russian, Serbian" msgstr "" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1131 msgid "cp856" msgstr "cp856" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1133 msgid "cp857" msgstr "cp857" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1133 msgid "857, IBM857" msgstr "857, IBM857" -#: ../../library/codecs.rst:1119 ../../library/codecs.rst:1152 -#: ../../library/codecs.rst:1169 ../../library/codecs.rst:1236 -#: ../../library/codecs.rst:1276 +#: ../../library/codecs.rst:1133 ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1183 ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1290 msgid "Turkish" msgstr "土耳其文" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1135 msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1135 msgid "858, IBM858" msgstr "858, IBM858" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1137 msgid "cp860" msgstr "cp860" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1137 msgid "860, IBM860" msgstr "860, IBM860" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1137 msgid "Portuguese" msgstr "" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1139 msgid "cp861" msgstr "cp861" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1139 msgid "861, CP-IS, IBM861" msgstr "861, CP-IS, IBM861" -#: ../../library/codecs.rst:1125 ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1139 ../../library/codecs.rst:1283 msgid "Icelandic" msgstr "" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1141 msgid "cp862" msgstr "cp862" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1141 msgid "862, IBM862" msgstr "862, IBM862" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1143 msgid "cp863" msgstr "cp863" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1143 msgid "863, IBM863" msgstr "863, IBM863" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1143 msgid "Canadian" msgstr "" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1145 msgid "cp864" msgstr "cp864" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1145 msgid "IBM864" msgstr "IBM864" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1147 msgid "cp865" msgstr "cp865" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1147 msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1147 msgid "Danish, Norwegian" msgstr "" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1149 msgid "cp866" msgstr "cp866" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1149 msgid "866, IBM866" msgstr "866, IBM866" -#: ../../library/codecs.rst:1135 ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1149 ../../library/codecs.rst:1266 msgid "Russian" msgstr "俄羅斯文" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1151 msgid "cp869" msgstr "cp869" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1151 msgid "869, CP-GR, IBM869" msgstr "869, CP-GR, IBM869" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1153 msgid "cp874" msgstr "cp874" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1153 msgid "Thai" msgstr "泰文" -#: ../../library/codecs.rst:1141 +#: ../../library/codecs.rst:1155 msgid "cp875" msgstr "cp875" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1157 msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1157 msgid "932, ms932, mskanji, ms-kanji, windows-31j" msgstr "932, ms932, mskanji, ms-kanji, windows-31j" -#: ../../library/codecs.rst:1143 ../../library/codecs.rst:1179 -#: ../../library/codecs.rst:1181 ../../library/codecs.rst:1183 -#: ../../library/codecs.rst:1200 ../../library/codecs.rst:1203 -#: ../../library/codecs.rst:1208 ../../library/codecs.rst:1211 -#: ../../library/codecs.rst:1213 ../../library/codecs.rst:1281 -#: ../../library/codecs.rst:1284 ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1157 ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1195 ../../library/codecs.rst:1197 +#: ../../library/codecs.rst:1214 ../../library/codecs.rst:1217 +#: ../../library/codecs.rst:1222 ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1227 ../../library/codecs.rst:1295 +#: ../../library/codecs.rst:1298 ../../library/codecs.rst:1301 msgid "Japanese" msgstr "日文" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1160 msgid "cp949" msgstr "cp949" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1160 msgid "949, ms949, uhc" msgstr "949, ms949, uhc" -#: ../../library/codecs.rst:1146 ../../library/codecs.rst:1185 -#: ../../library/codecs.rst:1215 ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1160 ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1229 ../../library/codecs.rst:1264 msgid "Korean" msgstr "韓文" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1162 msgid "cp950" msgstr "cp950" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1162 msgid "950, ms950" msgstr "950, ms950" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1164 msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1164 msgid "Urdu" msgstr "" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1166 msgid "cp1026" msgstr "cp1026" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1166 msgid "ibm1026" msgstr "ibm1026" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1168 msgid "cp1125" msgstr "cp1125" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1168 msgid "1125, ibm1125, cp866u, ruscii" msgstr "1125, ibm1125, cp866u, ruscii" -#: ../../library/codecs.rst:1154 ../../library/codecs.rst:1258 +#: ../../library/codecs.rst:1168 ../../library/codecs.rst:1272 msgid "Ukrainian" msgstr "烏克蘭文" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1172 msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1172 msgid "ibm1140" msgstr "ibm1140" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1174 msgid "cp1250" msgstr "cp1250" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1174 msgid "windows-1250" msgstr "windows-1250" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1176 msgid "cp1251" msgstr "cp1251" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1176 msgid "windows-1251" msgstr "windows-1251" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1179 msgid "cp1252" msgstr "cp1252" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1179 msgid "windows-1252" msgstr "windows-1252" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1181 msgid "cp1253" msgstr "cp1253" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1181 msgid "windows-1253" msgstr "windows-1253" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1183 msgid "cp1254" msgstr "cp1254" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1183 msgid "windows-1254" msgstr "windows-1254" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1185 msgid "cp1255" msgstr "cp1255" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1185 msgid "windows-1255" msgstr "windows-1255" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1187 msgid "cp1256" msgstr "cp1256" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1187 msgid "windows-1256" msgstr "windows-1256" -#: ../../library/codecs.rst:1175 +#: ../../library/codecs.rst:1189 msgid "cp1257" msgstr "cp1257" -#: ../../library/codecs.rst:1175 +#: ../../library/codecs.rst:1189 msgid "windows-1257" msgstr "windows-1257" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1191 msgid "cp1258" msgstr "cp1258" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1191 msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1191 msgid "Vietnamese" msgstr "越南文" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1193 msgid "euc_jp" msgstr "euc_jp" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1193 msgid "eucjp, ujis, u-jis" msgstr "eucjp, ujis, u-jis" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1195 msgid "euc_jis_2004" msgstr "euc_jis_2004" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1195 msgid "jisx0213, eucjis2004" msgstr "jisx0213, eucjis2004" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1197 msgid "euc_jisx0213" msgstr "euc_jisx0213" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1197 msgid "eucjisx0213" msgstr "eucjisx0213" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1199 msgid "euc_kr" msgstr "euc_kr" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1199 msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgstr "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" -#: ../../library/codecs.rst:1189 +#: ../../library/codecs.rst:1203 msgid "gb2312" msgstr "gb2312" -#: ../../library/codecs.rst:1189 +#: ../../library/codecs.rst:1203 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" @@ -1865,446 +1883,446 @@ msgstr "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" -#: ../../library/codecs.rst:1189 ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1203 ../../library/codecs.rst:1212 msgid "Simplified Chinese" msgstr "簡體中文" -#: ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1208 msgid "gbk" msgstr "gbk" -#: ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1208 msgid "936, cp936, ms936" msgstr "936, cp936, ms936" -#: ../../library/codecs.rst:1194 ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1208 ../../library/codecs.rst:1210 msgid "Unified Chinese" msgstr "" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1210 msgid "gb18030" msgstr "gb18030" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1210 msgid "gb18030-2000" msgstr "gb18030-2000" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1212 msgid "hz" msgstr "hz" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1212 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "hzgb, hz-gb, hz-gb-2312" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1214 msgid "iso2022_jp" msgstr "iso2022_jp" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1214 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "csiso2022jp, iso2022jp, iso-2022-jp" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1217 msgid "iso2022_jp_1" msgstr "iso2022_jp_1" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1217 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "iso2022jp-1, iso-2022-jp-1" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1219 msgid "iso2022_jp_2" msgstr "iso2022_jp_2" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1219 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "iso2022jp-2, iso-2022-jp-2" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1219 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1222 msgid "iso2022_jp_2004" msgstr "iso2022_jp_2004" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1222 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "iso2022jp-2004, iso-2022-jp-2004" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1225 msgid "iso2022_jp_3" msgstr "iso2022_jp_3" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1225 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "iso2022jp-3, iso-2022-jp-3" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1227 msgid "iso2022_jp_ext" msgstr "iso2022_jp_ext" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1227 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "iso2022jp-ext, iso-2022-jp-ext" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1229 msgid "iso2022_kr" msgstr "iso2022_kr" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1229 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "csiso2022kr, iso2022kr, iso-2022-kr" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1232 msgid "latin_1" msgstr "latin_1" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1232 msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgstr "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1235 msgid "iso8859_2" msgstr "iso8859_2" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1235 msgid "iso-8859-2, latin2, L2" msgstr "iso-8859-2, latin2, L2" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1237 msgid "iso8859_3" msgstr "iso8859_3" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1237 msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1237 msgid "Esperanto, Maltese" msgstr "" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1239 msgid "iso8859_4" msgstr "iso8859_4" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1239 msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1241 msgid "iso8859_5" msgstr "iso8859_5" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1241 msgid "iso-8859-5, cyrillic" msgstr "iso-8859-5, cyrillic" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1244 msgid "iso8859_6" msgstr "iso8859_6" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1244 msgid "iso-8859-6, arabic" msgstr "iso-8859-6, arabic" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1246 msgid "iso8859_7" msgstr "iso8859_7" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1246 msgid "iso-8859-7, greek, greek8" msgstr "iso-8859-7, greek, greek8" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1248 msgid "iso8859_8" msgstr "iso8859_8" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1248 msgid "iso-8859-8, hebrew" msgstr "iso-8859-8, hebrew" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1250 msgid "iso8859_9" msgstr "iso8859_9" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1250 msgid "iso-8859-9, latin5, L5" msgstr "iso-8859-9, latin5, L5" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1252 msgid "iso8859_10" msgstr "iso8859_10" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1252 msgid "iso-8859-10, latin6, L6" msgstr "iso-8859-10, latin6, L6" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1252 msgid "Nordic languages" msgstr "" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1254 msgid "iso8859_11" msgstr "iso8859_11" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1254 msgid "iso-8859-11, thai" msgstr "iso-8859-11, thai" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1254 msgid "Thai languages" msgstr "泰語" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1256 msgid "iso8859_13" msgstr "iso8859_13" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1256 msgid "iso-8859-13, latin7, L7" msgstr "iso-8859-13, latin7, L7" -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1258 msgid "iso8859_14" msgstr "iso8859_14" -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1258 msgid "iso-8859-14, latin8, L8" msgstr "iso-8859-14, latin8, L8" -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1258 msgid "Celtic languages" msgstr "" -#: ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1260 msgid "iso8859_15" msgstr "iso8859_15" -#: ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1260 msgid "iso-8859-15, latin9, L9" msgstr "iso-8859-15, latin9, L9" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1262 msgid "iso8859_16" msgstr "iso8859_16" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1262 msgid "iso-8859-16, latin10, L10" msgstr "iso-8859-16, latin10, L10" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1262 msgid "South-Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1264 msgid "johab" msgstr "" -#: ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1264 msgid "cp1361, ms1361" msgstr "cp1361, ms1361" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1266 msgid "koi8_r" msgstr "koi8_r" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1268 msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1268 msgid "Tajik" msgstr "" -#: ../../library/codecs.rst:1258 +#: ../../library/codecs.rst:1272 msgid "koi8_u" msgstr "koi8_u" -#: ../../library/codecs.rst:1260 +#: ../../library/codecs.rst:1274 msgid "kz1048" msgstr "kz1048" -#: ../../library/codecs.rst:1260 +#: ../../library/codecs.rst:1274 msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1260 ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1274 ../../library/codecs.rst:1292 msgid "Kazakh" msgstr "" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1278 msgid "mac_cyrillic" msgstr "mac_cyrillic" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1278 msgid "maccyrillic" msgstr "" -#: ../../library/codecs.rst:1267 +#: ../../library/codecs.rst:1281 msgid "mac_greek" msgstr "mac_greek" -#: ../../library/codecs.rst:1267 +#: ../../library/codecs.rst:1281 msgid "macgreek" msgstr "" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1283 msgid "mac_iceland" msgstr "mac_iceland" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1283 msgid "maciceland" msgstr "" -#: ../../library/codecs.rst:1271 +#: ../../library/codecs.rst:1285 msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1271 +#: ../../library/codecs.rst:1285 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "maclatin2, maccentraleurope, mac_centeuro" -#: ../../library/codecs.rst:1274 +#: ../../library/codecs.rst:1288 msgid "mac_roman" msgstr "mac_roman" -#: ../../library/codecs.rst:1274 +#: ../../library/codecs.rst:1288 msgid "macroman, macintosh" msgstr "macroman, macintosh" -#: ../../library/codecs.rst:1276 +#: ../../library/codecs.rst:1290 msgid "mac_turkish" msgstr "mac_turkish" -#: ../../library/codecs.rst:1276 +#: ../../library/codecs.rst:1290 msgid "macturkish" msgstr "" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1292 msgid "ptcp154" msgstr "ptcp154" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1292 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "csptcp154, pt154, cp154, cyrillic-asian" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1295 msgid "shift_jis" msgstr "shift_jis" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1295 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "csshiftjis, shiftjis, sjis, s_jis" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1298 msgid "shift_jis_2004" msgstr "shift_jis_2004" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1298 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "shiftjis2004, sjis_2004, sjis2004" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1301 msgid "shift_jisx0213" msgstr "shift_jisx0213" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1301 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "shiftjisx0213, sjisx0213, s_jisx0213" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1304 msgid "utf_32" msgstr "utf_32" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1304 msgid "U32, utf32" msgstr "U32, utf32" -#: ../../library/codecs.rst:1290 ../../library/codecs.rst:1292 -#: ../../library/codecs.rst:1294 ../../library/codecs.rst:1296 -#: ../../library/codecs.rst:1298 ../../library/codecs.rst:1300 -#: ../../library/codecs.rst:1302 ../../library/codecs.rst:1304 -#: ../../library/codecs.rst:1306 +#: ../../library/codecs.rst:1304 ../../library/codecs.rst:1306 +#: ../../library/codecs.rst:1308 ../../library/codecs.rst:1310 +#: ../../library/codecs.rst:1312 ../../library/codecs.rst:1314 +#: ../../library/codecs.rst:1316 ../../library/codecs.rst:1318 +#: ../../library/codecs.rst:1320 msgid "all languages" msgstr "" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1306 msgid "utf_32_be" msgstr "utf_32_be" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1306 msgid "UTF-32BE" msgstr "UTF-32BE" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1308 msgid "utf_32_le" msgstr "utf_32_le" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1308 msgid "UTF-32LE" msgstr "UTF-32LE" -#: ../../library/codecs.rst:1296 +#: ../../library/codecs.rst:1310 msgid "utf_16" msgstr "utf_16" -#: ../../library/codecs.rst:1296 +#: ../../library/codecs.rst:1310 msgid "U16, utf16" msgstr "U16, utf16" -#: ../../library/codecs.rst:1298 +#: ../../library/codecs.rst:1312 msgid "utf_16_be" msgstr "utf_16_be" -#: ../../library/codecs.rst:1298 +#: ../../library/codecs.rst:1312 msgid "UTF-16BE" msgstr "UTF-16BE" -#: ../../library/codecs.rst:1300 +#: ../../library/codecs.rst:1314 msgid "utf_16_le" msgstr "utf_16_le" -#: ../../library/codecs.rst:1300 +#: ../../library/codecs.rst:1314 msgid "UTF-16LE" msgstr "UTF-16LE" -#: ../../library/codecs.rst:1302 +#: ../../library/codecs.rst:1316 msgid "utf_7" msgstr "utf_7" -#: ../../library/codecs.rst:1302 +#: ../../library/codecs.rst:1316 msgid "U7, unicode-1-1-utf-7" msgstr "U7, unicode-1-1-utf-7" -#: ../../library/codecs.rst:1304 +#: ../../library/codecs.rst:1318 msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1304 +#: ../../library/codecs.rst:1318 msgid "U8, UTF, utf8, cp65001" msgstr "U8, UTF, utf8, cp65001" -#: ../../library/codecs.rst:1306 +#: ../../library/codecs.rst:1320 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1309 +#: ../../library/codecs.rst:1323 msgid "" "The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " "(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " "decode byte sequences that correspond to surrogate code points." msgstr "" -#: ../../library/codecs.rst:1315 +#: ../../library/codecs.rst:1329 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "``cp65001`` 現在是 ``utf_8`` 的別名。" -#: ../../library/codecs.rst:1320 +#: ../../library/codecs.rst:1334 msgid "Python Specific Encodings" msgstr "" -#: ../../library/codecs.rst:1322 +#: ../../library/codecs.rst:1336 msgid "" "A number of predefined codecs are specific to Python, so their codec names " "have no meaning outside Python. These are listed in the tables below based " @@ -2314,268 +2332,332 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1344 msgid "Text Encodings" msgstr "" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1346 msgid "" "The following codecs provide :class:`str` to :class:`bytes` encoding and :" "term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " "text encodings." msgstr "" -#: ../../library/codecs.rst:1341 +#: ../../library/codecs.rst:1355 msgid "idna" msgstr "idna" -#: ../../library/codecs.rst:1341 +#: ../../library/codecs.rst:1355 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1361 msgid "mbcs" msgstr "mbcs" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1361 msgid "ansi, dbcs" msgstr "ansi, dbcs" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1361 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1365 msgid "oem" msgstr "oem" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1365 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1371 msgid "palmos" msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1371 msgid "Encoding of PalmOS 3.5." msgstr "" -#: ../../library/codecs.rst:1359 +#: ../../library/codecs.rst:1373 msgid "punycode" msgstr "" -#: ../../library/codecs.rst:1359 +#: ../../library/codecs.rst:1373 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: ../../library/codecs.rst:1363 +#: ../../library/codecs.rst:1377 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1363 +#: ../../library/codecs.rst:1377 msgid "" "Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " "other code points. Existing backslashes are not escaped in any way. It is " "used in the Python pickle protocol." msgstr "" -#: ../../library/codecs.rst:1373 +#: ../../library/codecs.rst:1387 msgid "undefined" msgstr "" -#: ../../library/codecs.rst:1373 +#: ../../library/codecs.rst:1387 +msgid "This Codec should only be used for testing purposes." +msgstr "" + +#: ../../library/codecs.rst:1391 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1378 +#: ../../library/codecs.rst:1396 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1378 +#: ../../library/codecs.rst:1396 msgid "" "Encoding suitable as the contents of a Unicode literal in ASCII-encoded " "Python source code, except that quotes are not escaped. Decode from Latin-1 " "source code. Beware that Python source code actually uses UTF-8 by default." msgstr "" -#: ../../library/codecs.rst:1390 +#: ../../library/codecs.rst:1408 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1415 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1399 +#: ../../library/codecs.rst:1417 msgid "" "The following codecs provide binary transforms: :term:`bytes-like object` " "to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " "(which only produces :class:`str` output)." msgstr "" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1425 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1409 +#: ../../library/codecs.rst:1427 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1409 +#: ../../library/codecs.rst:1427 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1409 +#: ../../library/codecs.rst:1427 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1414 +#: ../../library/codecs.rst:1432 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1409 +#: ../../library/codecs.rst:1427 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1438 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1438 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1438 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1438 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1441 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1441 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1441 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1441 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1428 +#: ../../library/codecs.rst:1446 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1428 +#: ../../library/codecs.rst:1446 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1428 +#: ../../library/codecs.rst:1446 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1428 +#: ../../library/codecs.rst:1446 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1432 +#: ../../library/codecs.rst:1450 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1432 +#: ../../library/codecs.rst:1450 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1432 +#: ../../library/codecs.rst:1450 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1453 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1453 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1453 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1453 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1439 +#: ../../library/codecs.rst:1457 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1443 +#: ../../library/codecs.rst:1461 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1464 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1453 +#: ../../library/codecs.rst:1471 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1455 +#: ../../library/codecs.rst:1473 msgid "" "The following codec provides a text transform: a :class:`str` to :class:" "`str` mapping. It is not supported by :meth:`str.encode` (which only " "produces :class:`bytes` output)." msgstr "" -#: ../../library/codecs.rst:1464 +#: ../../library/codecs.rst:1482 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1464 +#: ../../library/codecs.rst:1482 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1464 +#: ../../library/codecs.rst:1482 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1469 +#: ../../library/codecs.rst:1487 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1472 +#: ../../library/codecs.rst:1490 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1477 +#: ../../library/codecs.rst:1495 +msgid ":mod:`encodings` --- Encodings package" +msgstr "" + +#: ../../library/codecs.rst:1500 +msgid "This module implements the following functions:" +msgstr "" + +#: ../../library/codecs.rst:1504 +msgid "Normalize encoding name *encoding*." +msgstr "" + +#: ../../library/codecs.rst:1506 +msgid "" +"Normalization works as follows: all non-alphanumeric characters except the " +"dot used for Python package names are collapsed and replaced with a single " +"underscore, leading and trailing underscores are removed. For example, ``' " +"-;#'`` becomes ``'_'``." +msgstr "" + +#: ../../library/codecs.rst:1511 +msgid "Note that *encoding* should be ASCII only." +msgstr "" + +#: ../../library/codecs.rst:1515 +msgid "" +"The following function should not be used directly, except for testing " +"purposes; :func:`codecs.lookup` should be used instead." +msgstr "" + +#: ../../library/codecs.rst:1521 +msgid "" +"Search for the codec module corresponding to the given encoding name " +"*encoding*." +msgstr "" + +#: ../../library/codecs.rst:1524 +msgid "" +"This function first normalizes the *encoding* using :func:" +"`normalize_encoding`, then looks for a corresponding alias. It attempts to " +"import a codec module from the encodings package using either the alias or " +"the normalized name. If the module is found and defines a valid " +"``getregentry()`` function that returns a :class:`codecs.CodecInfo` object, " +"the codec is cached and returned." +msgstr "" + +#: ../../library/codecs.rst:1531 +msgid "" +"If the codec module defines a ``getaliases()`` function any returned aliases " +"are registered for future use." +msgstr "" + +#: ../../library/codecs.rst:1535 +msgid "This module implements the following exception:" +msgstr "" + +#: ../../library/codecs.rst:1539 +msgid "Raised when a codec is invalid or incompatible." +msgstr "" + +#: ../../library/codecs.rst:1543 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1483 +#: ../../library/codecs.rst:1549 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2583,13 +2665,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1488 +#: ../../library/codecs.rst:1554 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party :pypi:`idna` module." msgstr "" -#: ../../library/codecs.rst:1491 +#: ../../library/codecs.rst:1557 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " "domain names. A domain name containing non-ASCII characters (such as ``www." @@ -2603,7 +2685,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1502 +#: ../../library/codecs.rst:1568 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2620,14 +2702,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1515 +#: ../../library/codecs.rst:1581 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " "present such host names to the user should decode them to Unicode." msgstr "" -#: ../../library/codecs.rst:1519 +#: ../../library/codecs.rst:1585 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2635,49 +2717,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1527 +#: ../../library/codecs.rst:1593 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1533 +#: ../../library/codecs.rst:1599 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1539 +#: ../../library/codecs.rst:1605 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1543 +#: ../../library/codecs.rst:1609 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" -msgstr "" +msgstr ":mod:`encodings.mbcs` --- Windows ANSI 碼頁" -#: ../../library/codecs.rst:1548 +#: ../../library/codecs.rst:1614 msgid "This module implements the ANSI codepage (CP_ACP)." -msgstr "" +msgstr "這個模組實作了 ANSI 碼頁 (CP_ACP)。" -#: ../../library/codecs.rst:1550 +#: ../../library/codecs.rst:1616 msgid "Availability" msgstr "可用性" -#: ../../library/codecs.rst:1552 +#: ../../library/codecs.rst:1618 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1556 +#: ../../library/codecs.rst:1622 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1561 +#: ../../library/codecs.rst:1627 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1567 +#: ../../library/codecs.rst:1633 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " @@ -2706,71 +2788,71 @@ msgstr "streams(串流)" msgid "stackable" msgstr "stackable(可堆疊)" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "strict" msgstr "strict" -#: ../../library/codecs.rst:320 ../../library/codecs.rst:372 -#: ../../library/codecs.rst:395 +#: ../../library/codecs.rst:334 ../../library/codecs.rst:386 +#: ../../library/codecs.rst:409 msgid "error handler's name" msgstr "error handler's name(錯誤處理器名稱)" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "ignore" msgstr "ignore" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "replace" msgstr "replace" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "backslashreplace" msgstr "backslashreplace" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "surrogateescape" msgstr "surrogateescape" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "replacement character" msgstr "replacement character(替代字元)" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/codecs.rst:320 ../../library/codecs.rst:372 +#: ../../library/codecs.rst:334 ../../library/codecs.rst:386 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "\\x" msgstr "\\x" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "\\u" msgstr "\\u" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "\\U" msgstr "\\U" -#: ../../library/codecs.rst:372 +#: ../../library/codecs.rst:386 msgid "xmlcharrefreplace" msgstr "xmlcharrefreplace" -#: ../../library/codecs.rst:372 +#: ../../library/codecs.rst:386 msgid "namereplace" msgstr "namereplace" -#: ../../library/codecs.rst:372 +#: ../../library/codecs.rst:386 msgid "\\N" msgstr "\\N" -#: ../../library/codecs.rst:395 +#: ../../library/codecs.rst:409 msgid "surrogatepass" msgstr "surrogatepass" diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 3d8265d6fc..1be28eae02 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-07-07 17:47+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -236,8 +236,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:183 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by :meth:`~email.message.EmailMessage." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by :meth:`~email.message.EmailMessage." "set_content` and the related ``make`` and ``add`` methods." msgstr "" @@ -288,8 +288,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:226 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by :meth:`~email.message.EmailMessage." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by :meth:`~email.message.EmailMessage." "get_content` and :meth:`~email.message.EmailMessage.iter_parts`." msgstr "" @@ -302,8 +302,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:238 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by :meth:`~email.message.EmailMessage." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by :meth:`~email.message.EmailMessage." "set_content`." msgstr "" @@ -337,9 +337,9 @@ msgstr "" #: ../../library/email.compat32-message.rst:267 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by the *charset* parameter of the :meth:" -"`email.emailmessage.EmailMessage.set_content` method." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by the *charset* parameter of the :meth:`email." +"message.EmailMessage.set_content` method." msgstr "" #: ../../library/email.compat32-message.rst:275 @@ -350,8 +350,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:278 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class it always returns ``None``." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"it always returns ``None``." msgstr "" #: ../../library/email.compat32-message.rst:283 @@ -618,9 +618,9 @@ msgstr "" #: ../../library/email.compat32-message.rst:488 #: ../../library/email.compat32-message.rst:526 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by the *params* property of the " -"individual header objects returned by the header access methods." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by the *params* property of the individual " +"header objects returned by the header access methods." msgstr "" #: ../../library/email.compat32-message.rst:496 @@ -739,8 +739,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:581 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by the ``make_`` and ``add_`` methods." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by the ``make_`` and ``add_`` methods." msgstr "" #: ../../library/email.compat32-message.rst:588 diff --git a/library/email.parser.po b/library/email.parser.po index 770ac9a254..c89f7718a9 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-19 00:13+0000\n" +"POT-Creation-Date: 2025-07-11 10:17+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,35 +43,35 @@ msgid "" "root :class:`~email.message.EmailMessage` instance of the object structure. " "For simple, non-MIME messages the payload of this root object will likely be " "a string containing the text of the message. For MIME messages, the root " -"object will return ``True`` from " -"its :meth:`~email.message.EmailMessage.is_multipart` method, and the " -"subparts can be accessed via the payload manipulation methods, such " -"as :meth:`~email.message.EmailMessage.get_body`, :meth:`~email.message.EmailMessage.iter_parts`, " -"and :meth:`~email.message.EmailMessage.walk`." +"object will return ``True`` from its :meth:`~email.message.EmailMessage." +"is_multipart` method, and the subparts can be accessed via the payload " +"manipulation methods, such as :meth:`~email.message.EmailMessage.get_body`, :" +"meth:`~email.message.EmailMessage.iter_parts`, and :meth:`~email.message." +"EmailMessage.walk`." msgstr "" #: ../../library/email.parser.rst:30 msgid "" -"There are actually two parser interfaces available for use, " -"the :class:`Parser` API and the incremental :class:`FeedParser` API. " -"The :class:`Parser` API is most useful if you have the entire text of the " -"message in memory, or if the entire message lives in a file on the file " -"system. :class:`FeedParser` is more appropriate when you are reading the " -"message from a stream which might block waiting for more input (such as " -"reading an email message from a socket). The :class:`FeedParser` can " -"consume and parse the message incrementally, and only returns the root " -"object when you close the parser." +"There are actually two parser interfaces available for use, the :class:" +"`Parser` API and the incremental :class:`FeedParser` API. The :class:" +"`Parser` API is most useful if you have the entire text of the message in " +"memory, or if the entire message lives in a file on the file system. :class:" +"`FeedParser` is more appropriate when you are reading the message from a " +"stream which might block waiting for more input (such as reading an email " +"message from a socket). The :class:`FeedParser` can consume and parse the " +"message incrementally, and only returns the root object when you close the " +"parser." msgstr "" #: ../../library/email.parser.rst:39 msgid "" "Note that the parser can be extended in limited ways, and of course you can " "implement your own parser completely from scratch. All of the logic that " -"connects the :mod:`email` package's bundled parser and " -"the :class:`~email.message.EmailMessage` class is embodied in " -"the :class:`~email.policy.Policy` class, so a custom parser can create " -"message object trees any way it finds necessary by implementing custom " -"versions of the appropriate :class:`!Policy` methods." +"connects the :mod:`email` package's bundled parser and the :class:`~email." +"message.EmailMessage` class is embodied in the :class:`~email.policy.Policy` " +"class, so a custom parser can create message object trees any way it finds " +"necessary by implementing custom versions of the appropriate :class:`!" +"Policy` methods." msgstr "" #: ../../library/email.parser.rst:49 @@ -80,14 +80,14 @@ msgstr "" #: ../../library/email.parser.rst:51 msgid "" -"The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` " -"module, provides an API that is conducive to incremental parsing of email " -"messages, such as would be necessary when reading the text of an email " -"message from a source that can block (such as a socket). " -"The :class:`BytesFeedParser` can of course be used to parse an email message " -"fully contained in a :term:`bytes-like object`, string, or file, but " -"the :class:`BytesParser` API may be more convenient for such use cases. The " -"semantics and results of the two parser APIs are identical." +"The :class:`BytesFeedParser`, imported from the :mod:`email.parser." +"FeedParser` module, provides an API that is conducive to incremental parsing " +"of email messages, such as would be necessary when reading the text of an " +"email message from a source that can block (such as a socket). The :class:" +"`BytesFeedParser` can of course be used to parse an email message fully " +"contained in a :term:`bytes-like object`, string, or file, but the :class:" +"`BytesParser` API may be more convenient for such use cases. The semantics " +"and results of the two parser APIs are identical." msgstr "" #: ../../library/email.parser.rst:60 @@ -97,10 +97,10 @@ msgid "" "to retrieve the root message object. The :class:`BytesFeedParser` is " "extremely accurate when parsing standards-compliant messages, and it does a " "very good job of parsing non-compliant messages, providing information about " -"how a message was deemed broken. It will populate a message " -"object's :attr:`~email.message.EmailMessage.defects` attribute with a list " -"of any problems it found in a message. See the :mod:`email.errors` module " -"for the list of defects that it can find." +"how a message was deemed broken. It will populate a message object's :attr:" +"`~email.message.EmailMessage.defects` attribute with a list of any problems " +"it found in a message. See the :mod:`email.errors` module for the list of " +"defects that it can find." msgstr "" #: ../../library/email.parser.rst:70 @@ -110,21 +110,21 @@ msgstr "" #: ../../library/email.parser.rst:75 msgid "" "Create a :class:`BytesFeedParser` instance. Optional *_factory* is a no-" -"argument callable; if not specified use " -"the :attr:`~email.policy.Policy.message_factory` from the *policy*. Call " -"*_factory* whenever a new message object is needed." +"argument callable; if not specified use the :attr:`~email.policy.Policy." +"message_factory` from the *policy*. Call *_factory* whenever a new message " +"object is needed." msgstr "" #: ../../library/email.parser.rst:80 msgid "" "If *policy* is specified use the rules it specifies to update the " -"representation of the message. If *policy* is not set, use " -"the :class:`compat32 ` policy, which maintains " -"backward compatibility with the Python 3.2 version of the email package and " -"provides :class:`~email.message.Message` as the default factory. All other " -"policies provide :class:`~email.message.EmailMessage` as the default " -"*_factory*. For more information on what else *policy* controls, see " -"the :mod:`~email.policy` documentation." +"representation of the message. If *policy* is not set, use the :class:" +"`compat32 ` policy, which maintains backward " +"compatibility with the Python 3.2 version of the email package and provides :" +"class:`~email.message.Message` as the default factory. All other policies " +"provide :class:`~email.message.EmailMessage` as the default *_factory*. For " +"more information on what else *policy* controls, see the :mod:`~email." +"policy` documentation." msgstr "" #: ../../library/email.parser.rst:89 ../../library/email.parser.rst:145 @@ -159,10 +159,10 @@ msgstr "" #: ../../library/email.parser.rst:116 msgid "" -"Works like :class:`BytesFeedParser` except that the input to " -"the :meth:`~BytesFeedParser.feed` method must be a string. This is of " -"limited utility, since the only way for such a message to be valid is for it " -"to contain only ASCII text or, if :attr:`~email.policy.Policy.utf8` is " +"Works like :class:`BytesFeedParser` except that the input to the :meth:" +"`~BytesFeedParser.feed` method must be a string. This is of limited " +"utility, since the only way for such a message to be valid is for it to " +"contain only ASCII text or, if :attr:`~email.policy.EmailPolicy.utf8` is " "``True``, no binary attachments." msgstr "" @@ -175,13 +175,13 @@ msgid "" "The :class:`BytesParser` class, imported from the :mod:`email.parser` " "module, provides an API that can be used to parse a message when the " "complete contents of the message are available in a :term:`bytes-like " -"object` or file. The :mod:`email.parser` module also " -"provides :class:`Parser` for parsing strings, and header-only " -"parsers, :class:`BytesHeaderParser` and :class:`HeaderParser`, which can be " -"used if you're only interested in the headers of the " -"message. :class:`BytesHeaderParser` and :class:`HeaderParser` can be much " -"faster in these situations, since they do not attempt to parse the message " -"body, instead setting the payload to the raw body." +"object` or file. The :mod:`email.parser` module also provides :class:" +"`Parser` for parsing strings, and header-only parsers, :class:" +"`BytesHeaderParser` and :class:`HeaderParser`, which can be used if you're " +"only interested in the headers of the message. :class:`BytesHeaderParser` " +"and :class:`HeaderParser` can be much faster in these situations, since they " +"do not attempt to parse the message body, instead setting the payload to the " +"raw body." msgstr "" #: ../../library/email.parser.rst:141 @@ -205,19 +205,19 @@ msgstr "" #: ../../library/email.parser.rst:156 msgid "" "Read all the data from the binary file-like object *fp*, parse the resulting " -"bytes, and return the message object. *fp* must support both " -"the :meth:`~io.IOBase.readline` and the :meth:`~io.IOBase.read` methods." +"bytes, and return the message object. *fp* must support both the :meth:`~io." +"IOBase.readline` and the :meth:`~io.TextIOBase.read` methods." msgstr "" #: ../../library/email.parser.rst:161 msgid "" "The bytes contained in *fp* must be formatted as a block of :rfc:`5322` (or, " -"if :attr:`~email.policy.Policy.utf8` is ``True``, :rfc:`6532`) style headers " -"and header continuation lines, optionally preceded by an envelope header. " -"The header block is terminated either by the end of the data or by a blank " -"line. Following the header block is the body of the message (which may " -"contain MIME-encoded subparts, including subparts with " -"a :mailheader:`Content-Transfer-Encoding` of ``8bit``)." +"if :attr:`~email.policy.EmailPolicy.utf8` is ``True``, :rfc:`6532`) style " +"headers and header continuation lines, optionally preceded by an envelope " +"header. The header block is terminated either by the end of the data or by " +"a blank line. Following the header block is the body of the message (which " +"may contain MIME-encoded subparts, including subparts with a :mailheader:" +"`Content-Transfer-Encoding` of ``8bit``)." msgstr "" #: ../../library/email.parser.rst:169 @@ -230,9 +230,9 @@ msgstr "" #: ../../library/email.parser.rst:176 msgid "" "Similar to the :meth:`parse` method, except it takes a :term:`bytes-like " -"object` instead of a file-like object. Calling this method on " -"a :term:`bytes-like object` is equivalent to wrapping *bytes* in " -"a :class:`~io.BytesIO` instance first and calling :meth:`parse`." +"object` instead of a file-like object. Calling this method on a :term:" +"`bytes-like object` is equivalent to wrapping *bytes* in a :class:`~io." +"BytesIO` instance first and calling :meth:`parse`." msgstr "" #: ../../library/email.parser.rst:181 ../../library/email.parser.rst:221 @@ -266,16 +266,16 @@ msgstr "" #: ../../library/email.parser.rst:210 msgid "" -"Other than the text mode requirement, this method operates " -"like :meth:`BytesParser.parse`." +"Other than the text mode requirement, this method operates like :meth:" +"`BytesParser.parse`." msgstr "" #: ../../library/email.parser.rst:216 msgid "" "Similar to the :meth:`parse` method, except it takes a string object instead " "of a file-like object. Calling this method on a string is equivalent to " -"wrapping *text* in a :class:`~io.StringIO` instance first and " -"calling :meth:`parse`." +"wrapping *text* in a :class:`~io.StringIO` instance first and calling :meth:" +"`parse`." msgstr "" #: ../../library/email.parser.rst:226 @@ -346,39 +346,37 @@ msgstr "" msgid "" "Most non-\\ :mimetype:`multipart` type messages are parsed as a single " "message object with a string payload. These objects will return ``False`` " -"for :meth:`~email.message.EmailMessage.is_multipart`, " -"and :meth:`~email.message.EmailMessage.iter_parts` will yield an empty list." +"for :meth:`~email.message.EmailMessage.is_multipart`, and :meth:`~email." +"message.EmailMessage.iter_parts` will yield an empty list." msgstr "" #: ../../library/email.parser.rst:300 msgid "" "All :mimetype:`multipart` type messages will be parsed as a container " "message object with a list of sub-message objects for their payload. The " -"outer container message will return ``True`` " -"for :meth:`~email.message.EmailMessage.is_multipart`, " -"and :meth:`~email.message.EmailMessage.iter_parts` will yield a list of " -"subparts." +"outer container message will return ``True`` for :meth:`~email.message." +"EmailMessage.is_multipart`, and :meth:`~email.message.EmailMessage." +"iter_parts` will yield a list of subparts." msgstr "" #: ../../library/email.parser.rst:306 msgid "" -"Most messages with a content type of :mimetype:`message/\\*` (such " -"as :mimetype:`message/delivery-status` and :mimetype:`message/rfc822`) will " -"also be parsed as container object containing a list payload of length 1. " -"Their :meth:`~email.message.EmailMessage.is_multipart` method will return " -"``True``. The single element yielded " -"by :meth:`~email.message.EmailMessage.iter_parts` will be a sub-message " -"object." +"Most messages with a content type of :mimetype:`message/\\*` (such as :" +"mimetype:`message/delivery-status` and :mimetype:`message/rfc822`) will also " +"be parsed as container object containing a list payload of length 1. Their :" +"meth:`~email.message.EmailMessage.is_multipart` method will return ``True``. " +"The single element yielded by :meth:`~email.message.EmailMessage.iter_parts` " +"will be a sub-message object." msgstr "" #: ../../library/email.parser.rst:313 msgid "" "Some non-standards-compliant messages may not be internally consistent about " -"their :mimetype:`multipart`\\ -edness. Such messages may have " -"a :mailheader:`Content-Type` header of type :mimetype:`multipart`, but " -"their :meth:`~email.message.EmailMessage.is_multipart` method may return " -"``False``. If such messages were parsed with " -"the :class:`~email.parser.FeedParser`, they will have an instance of " -"the :class:`~email.errors.MultipartInvariantViolationDefect` class in their " -"*defects* attribute list. See :mod:`email.errors` for details." +"their :mimetype:`multipart`\\ -edness. Such messages may have a :mailheader:" +"`Content-Type` header of type :mimetype:`multipart`, but their :meth:`~email." +"message.EmailMessage.is_multipart` method may return ``False``. If such " +"messages were parsed with the :class:`~email.parser.FeedParser`, they will " +"have an instance of the :class:`~email.errors." +"MultipartInvariantViolationDefect` class in their *defects* attribute list. " +"See :mod:`email.errors` for details." msgstr "" diff --git a/library/exceptions.po b/library/exceptions.po index 484c10cf19..2208e56a09 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-07-09 00:17+0000\n" "PO-Revision-Date: 2024-12-20 16:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -325,34 +325,37 @@ msgstr "" #: ../../library/exceptions.rst:207 msgid "" -"The :attr:`name` and :attr:`obj` attributes can be set using keyword-only " -"arguments to the constructor. When set they represent the name of the " -"attribute that was attempted to be accessed and the object that was accessed " -"for said attribute, respectively." -msgstr "" -":attr:`name` 和 :attr:`obj` 屬性可以使用建構函式的僅限關鍵字 (keyword-only) " -"引數來設定。當被設定的時候,它們分別代表被嘗試存取的屬性名稱以及被以該屬性存" -"取的物件。" +"The optional *name* and *obj* keyword-only arguments set the corresponding " +"attributes:" +msgstr "可選的僅限關鍵字引數 *name* 和 *obj* 會設定對應的屬性:" #: ../../library/exceptions.rst:212 +msgid "The name of the attribute that was attempted to be accessed." +msgstr "嘗試被存取的屬性名稱。" + +#: ../../library/exceptions.rst:216 +msgid "The object that was accessed for the named attribute." +msgstr "存取指定屬性的物件。" + +#: ../../library/exceptions.rst:218 msgid "Added the :attr:`name` and :attr:`obj` attributes." msgstr "新增 :attr:`name` 與 :attr:`obj` 屬性。" -#: ../../library/exceptions.rst:217 +#: ../../library/exceptions.rst:223 msgid "" "Raised when the :func:`input` function hits an end-of-file condition (EOF) " -"without reading any data. (N.B.: the :meth:`io.IOBase.read` and :meth:`io." +"without reading any data. (Note: the :meth:`!io.IOBase.read` and :meth:`io." "IOBase.readline` methods return an empty string when they hit EOF.)" msgstr "" "當 :func:`input` 函式在沒有讀到任何資料而到達檔案結尾 (end-of-file, EOF) 條件" -"的時候被引發。(注意::meth:`io.IOBase.read` 和 :meth:`io.IOBase.readline` 方" +"的時候被引發。(注意::meth:`!io.IOBase.read` 和 :meth:`io.IOBase.readline` 方" "法當達到 EOF 時會回傳空字串。)" -#: ../../library/exceptions.rst:224 +#: ../../library/exceptions.rst:230 msgid "Not currently used." msgstr "目前沒有被使用。" -#: ../../library/exceptions.rst:229 +#: ../../library/exceptions.rst:235 msgid "" "Raised when a :term:`generator` or :term:`coroutine` is closed; see :meth:" "`generator.close` and :meth:`coroutine.close`. It directly inherits from :" @@ -363,7 +366,7 @@ msgstr "" "`generator.close` 和 :meth:`coroutine.close`。此例外直接繼承自 :exc:" "`BaseException` 而不是 :exc:`Exception`,因為技術上來說這不是一個錯誤。" -#: ../../library/exceptions.rst:237 +#: ../../library/exceptions.rst:243 msgid "" "Raised when the :keyword:`import` statement has troubles trying to load a " "module. Also raised when the \"from list\" in ``from ... import`` has a " @@ -372,25 +375,25 @@ msgstr "" "當 :keyword:`import` 陳述式嘗試載入模組遇到問題的時候會被引發。當 ``from ... " "import`` 裡的 \"from list\" 包含找不到的名稱時也會被引發。" -#: ../../library/exceptions.rst:241 +#: ../../library/exceptions.rst:247 msgid "" "The optional *name* and *path* keyword-only arguments set the corresponding " "attributes:" msgstr "可選的僅限關鍵字引數 *name* 和 *path* 設定對應的屬性:" -#: ../../library/exceptions.rst:246 +#: ../../library/exceptions.rst:252 msgid "The name of the module that was attempted to be imported." msgstr "嘗試引入 (import) 的模組名稱。" -#: ../../library/exceptions.rst:250 +#: ../../library/exceptions.rst:256 msgid "The path to any file which triggered the exception." msgstr "觸發此例外的任何檔案的路徑。" -#: ../../library/exceptions.rst:252 +#: ../../library/exceptions.rst:258 msgid "Added the :attr:`name` and :attr:`path` attributes." msgstr "新增 :attr:`name` 與 :attr:`path` 屬性。" -#: ../../library/exceptions.rst:257 +#: ../../library/exceptions.rst:263 msgid "" "A subclass of :exc:`ImportError` which is raised by :keyword:`import` when a " "module could not be located. It is also raised when ``None`` is found in :" @@ -399,7 +402,7 @@ msgstr "" ":exc:`ImportError` 的子類別,當模組不能被定位的時候會被 :keyword:`import` 所" "引發。當在 :data:`sys.modules` 裡找到 ``None`` 時也會被引發。" -#: ../../library/exceptions.rst:266 +#: ../../library/exceptions.rst:272 msgid "" "Raised when a sequence subscript is out of range. (Slice indices are " "silently truncated to fall in the allowed range; if an index is not an " @@ -408,13 +411,13 @@ msgstr "" "當序列的索引超出範圍的時候會被引發。(切片索引 (slice indices) 會默默地被截短" "使其能落在允許的範圍內;如果索引不是整數,:exc:`TypeError` 會被引發。)" -#: ../../library/exceptions.rst:275 +#: ../../library/exceptions.rst:281 msgid "" "Raised when a mapping (dictionary) key is not found in the set of existing " "keys." msgstr "當對映(字典)的鍵無法在已存在的鍵的集合中被找到時會被引發。" -#: ../../library/exceptions.rst:282 +#: ../../library/exceptions.rst:288 msgid "" "Raised when the user hits the interrupt key (normally :kbd:`Control-C` or :" "kbd:`Delete`). During execution, a check for interrupts is made regularly. " @@ -427,7 +430,7 @@ msgstr "" "exc:`BaseException` 以防止意外地被捕捉 :exc:`Exception` 的程式碼所捕捉,而因" "此讓直譯器無法結束。" -#: ../../library/exceptions.rst:290 +#: ../../library/exceptions.rst:296 msgid "" "Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " "it can be raised at unpredictable points, it may, in some circumstances, " @@ -440,7 +443,7 @@ msgstr "" "exc:`KeyboardInterrupt` 越快結束程式越好,或者完全避免引發它。(參考 :ref:" "`handlers-and-exceptions`。)" -#: ../../library/exceptions.rst:300 +#: ../../library/exceptions.rst:306 msgid "" "Raised when an operation runs out of memory but the situation may still be " "rescued (by deleting some objects). The associated value is a string " @@ -456,7 +459,7 @@ msgstr "" "整地從該情況中修復;僅管如此,它還是引發例外以讓堆疊回溯可以被印出,以防原因" "出在失控的程式。" -#: ../../library/exceptions.rst:311 +#: ../../library/exceptions.rst:317 msgid "" "Raised when a local or global name is not found. This applies only to " "unqualified names. The associated value is an error message that includes " @@ -465,20 +468,19 @@ msgstr "" "當找不到本地或全域的名稱時會被引發。這只應用在不合格的名稱 (unqualified " "name) 上。關聯值是一個錯誤訊息,包含那個無法被找到的名稱。" -#: ../../library/exceptions.rst:315 -msgid "" -"The :attr:`name` attribute can be set using a keyword-only argument to the " -"constructor. When set it represent the name of the variable that was " -"attempted to be accessed." -msgstr "" -":attr:`name` 屬性可以使用僅限關鍵字引數來設定到建構函式。當被設定的時候它代表" -"被嘗試存取的變數名稱。" +#: ../../library/exceptions.rst:321 +msgid "The optional *name* keyword-only argument sets the attribute:" +msgstr "可選的僅限關鍵字引數 *name* 設定對應的屬性:" -#: ../../library/exceptions.rst:319 +#: ../../library/exceptions.rst:325 +msgid "The name of the variable that was attempted to be accessed." +msgstr "嘗試被存取的變數名稱。" + +#: ../../library/exceptions.rst:327 msgid "Added the :attr:`name` attribute." msgstr "新增 :attr:`name` 屬性。" -#: ../../library/exceptions.rst:325 +#: ../../library/exceptions.rst:333 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " @@ -489,7 +491,7 @@ msgstr "" "生類別覆寫該方法時應該要引發此例外,或者當類別正在開發中,可用此例外表示還需" "要加入真正的實作。" -#: ../../library/exceptions.rst:332 +#: ../../library/exceptions.rst:340 msgid "" "It should not be used to indicate that an operator or method is not meant to " "be supported at all -- in that case either leave the operator / method " @@ -498,7 +500,7 @@ msgstr "" "此例外不應該用來表示根本沒有要支援的運算子或方法 ── 在這個情況下可以讓該運算" "子或方法保持未定義,或者如果是子類別的話將其設成 :data:`None`。" -#: ../../library/exceptions.rst:338 +#: ../../library/exceptions.rst:346 msgid "" ":exc:`!NotImplementedError` and :data:`!NotImplemented` are not " "interchangeable. This exception should only be used as described above; see :" @@ -508,7 +510,7 @@ msgstr "" "外只能用在上面描述的情況;參考 :data:`NotImplemented` 裡關於內建常數正確使用" "方法的細節。" -#: ../../library/exceptions.rst:349 +#: ../../library/exceptions.rst:357 msgid "" "This exception is raised when a system function returns a system-related " "error, including I/O failures such as \"file not found\" or \"disk " @@ -517,7 +519,7 @@ msgstr "" "當系統函式回傳系統相關錯誤,包含像\"找不到檔案\"或\"硬碟已滿\"的 I/O 失敗會引" "發此例外(而非不合法的引數或其他次要的錯誤)。" -#: ../../library/exceptions.rst:353 +#: ../../library/exceptions.rst:361 msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " @@ -529,7 +531,7 @@ msgstr "" "const:`None`。為了向後相容,如果傳入三個引數,:attr:`~BaseException.args` 屬" "性只會是包含建構函式前兩個引數的雙元素元組。" -#: ../../library/exceptions.rst:359 +#: ../../library/exceptions.rst:367 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -542,11 +544,11 @@ msgstr "" "個行為只發生在直接建構 :exc:`OSError` 或透過別名,且產生子類別的時候不會被繼" "承。" -#: ../../library/exceptions.rst:367 +#: ../../library/exceptions.rst:375 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "從 C 變數 :c:data:`errno` 而來的數值錯誤代碼。" -#: ../../library/exceptions.rst:371 +#: ../../library/exceptions.rst:379 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " @@ -555,7 +557,7 @@ msgstr "" "在 Windows 下,這會提供你原生的 Windows 錯誤代碼。而 :attr:`.errno` 屬性是一" "個該原生錯誤代碼對於 POSIX 來說的近似翻譯。" -#: ../../library/exceptions.rst:375 +#: ../../library/exceptions.rst:383 msgid "" "Under Windows, if the *winerror* constructor argument is an integer, the :" "attr:`.errno` attribute is determined from the Windows error code, and the " @@ -566,16 +568,16 @@ msgstr "" "據該 Windows 錯誤代碼來決定,且 *errno* 引數會被忽略。在其他平台上," "*winerror* 引數會被忽略,而 :attr:`winerror` 屬性會不存在。" -#: ../../library/exceptions.rst:383 +#: ../../library/exceptions.rst:391 msgid "" "The corresponding error message, as provided by the operating system. It is " -"formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" -"`FormatMessage` under Windows." +"formatted by the C functions :c:func:`!perror` under POSIX, and :c:func:`!" +"FormatMessage` under Windows." msgstr "" -"作業系統提供的對應錯誤訊息。在 POSIX 下會使用 C 函式 :c:func:`perror` 做格式" -"化,而在 Windows 下會使用 :c:func:`FormatMessage`。" +"作業系統提供的對應錯誤訊息。在 POSIX 下會使用 C 函式 :c:func:`!perror` 做格式" +"化,而在 Windows 下會使用 :c:func:`!FormatMessage`。" -#: ../../library/exceptions.rst:391 +#: ../../library/exceptions.rst:399 msgid "" "For exceptions that involve a file system path (such as :func:`open` or :" "func:`os.unlink`), :attr:`filename` is the file name passed to the function. " @@ -587,17 +589,17 @@ msgstr "" "`filename` 是傳入函式的檔案名稱。對於包含兩個檔案系統路徑的函式(像是 :func:" "`os.rename`),:attr:`filename2` 對應到傳入函式的第二個檔案名稱。" -#: ../../library/exceptions.rst:398 +#: ../../library/exceptions.rst:406 msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." -"error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" -"`OSError`, and the constructor may return a subclass." +"error`, :exc:`select.error` and :exc:`!mmap.error` have been merged into :" +"exc:`OSError`, and the constructor may return a subclass." msgstr "" ":exc:`EnvironmentError`、:exc:`IOError`、:exc:`WindowsError`、:exc:`socket." -"error`、:exc:`select.error` 及 :exc:`mmap.error` 已合併進 :exc:`OSError`,而" +"error`、:exc:`select.error` 及 :exc:`!mmap.error` 已合併進 :exc:`OSError`,而" "建構函式可能會回傳子類別。" -#: ../../library/exceptions.rst:404 +#: ../../library/exceptions.rst:412 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " "function, instead of the name encoded to or decoded from the :term:" @@ -608,7 +610,7 @@ msgstr "" "和錯誤處理函式 `\\ 編碼或解碼過的名" "稱。並且新增 *filename2* 建構函式引數與屬性。" -#: ../../library/exceptions.rst:413 +#: ../../library/exceptions.rst:421 msgid "" "Raised when the result of an arithmetic operation is too large to be " "represented. This cannot occur for integers (which would rather raise :exc:" @@ -622,7 +624,7 @@ msgstr "" "有時候會因為整數在要求範圍之外而引發。因為在 C 裡面缺乏浮點數例外處理的標準" "化,大部分的浮點數運算都沒有被檢查。" -#: ../../library/exceptions.rst:423 +#: ../../library/exceptions.rst:431 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when an " "operation is blocked during interpreter shutdown also known as :term:`Python " @@ -632,7 +634,7 @@ msgstr "" "`Python 最終化 (Python finalization) `)期間被阻塞會引" "發此例外。" -#: ../../library/exceptions.rst:427 +#: ../../library/exceptions.rst:435 msgid "" "Examples of operations which can be blocked with a :exc:" "`PythonFinalizationError` during the Python finalization:" @@ -640,23 +642,23 @@ msgstr "" "在 Python 最終化期間,能夠以 :exc:`PythonFinalizationError` 被阻塞的操作範" "例:" -#: ../../library/exceptions.rst:430 +#: ../../library/exceptions.rst:438 msgid "Creating a new Python thread." msgstr "建立新的 Python 執行緒。" -#: ../../library/exceptions.rst:431 +#: ../../library/exceptions.rst:439 msgid ":func:`os.fork`." msgstr ":func:`os.fork`。" -#: ../../library/exceptions.rst:433 +#: ../../library/exceptions.rst:441 msgid "See also the :func:`sys.is_finalizing` function." msgstr "也可以參閱 :func:`sys.is_finalizing` 函式。" -#: ../../library/exceptions.rst:435 ../../library/exceptions.rst:445 +#: ../../library/exceptions.rst:443 ../../library/exceptions.rst:453 msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "在之前,會引發一般的 :exc:`RuntimeError`。" -#: ../../library/exceptions.rst:441 +#: ../../library/exceptions.rst:449 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " "interpreter detects that the maximum recursion depth (see :func:`sys." @@ -665,7 +667,7 @@ msgstr "" "此例外衍生自 :exc:`RuntimeError`。當直譯器偵測到超過最大的遞迴深度(參考 :" "func:`sys.getrecursionlimit`)時會引發此例外。" -#: ../../library/exceptions.rst:451 +#: ../../library/exceptions.rst:459 msgid "" "This exception is raised when a weak reference proxy, created by the :func:" "`weakref.proxy` function, is used to access an attribute of the referent " @@ -676,7 +678,7 @@ msgstr "" "用來存取已經被垃圾回收 (garbage collected) 的參照物屬性時會引發此例外。更多關" "於弱參照的資訊參考 :mod:`weakref` 模組。" -#: ../../library/exceptions.rst:459 +#: ../../library/exceptions.rst:467 msgid "" "Raised when an error is detected that doesn't fall in any of the other " "categories. The associated value is a string indicating what precisely went " @@ -685,7 +687,7 @@ msgstr "" "當偵測到一個不屬於任何其他種類的錯誤時會引發此例外。關聯值是一個表示確切什麼" "地方出錯的字串。" -#: ../../library/exceptions.rst:466 +#: ../../library/exceptions.rst:474 msgid "" "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" "`~iterator.__next__` method to signal that there are no further items " @@ -694,7 +696,7 @@ msgstr "" "會被內建函式 :func:`next` 及 :term:`iterator` 的 :meth:`~iterator.__next__` " "方法引發,用來表示疊代器沒有更多項目可以產生。" -#: ../../library/exceptions.rst:472 +#: ../../library/exceptions.rst:480 msgid "" "The exception object has a single attribute :attr:`!value`, which is given " "as an argument when constructing the exception, and defaults to :const:" @@ -703,7 +705,7 @@ msgstr "" "此例外物件有單一屬性 :attr:`!value`,當建構此例外時會以引數給定,預設為 :" "const:`None`。" -#: ../../library/exceptions.rst:476 +#: ../../library/exceptions.rst:484 msgid "" "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" "`StopIteration` instance is raised, and the value returned by the function " @@ -713,7 +715,7 @@ msgstr "" "`StopIteration` 實例會被引發,而該函式的回傳值會被用來當作此例外建構函式的 :" "attr:`value` 參數。" -#: ../../library/exceptions.rst:481 +#: ../../library/exceptions.rst:489 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " @@ -722,13 +724,13 @@ msgstr "" "如果產生器程式直接或間接引發 :exc:`StopIteration`,則其會被轉換成 :exc:" "`RuntimeError`\\ (保留 :exc:`StopIteration` 作為新例外的成因)。" -#: ../../library/exceptions.rst:485 +#: ../../library/exceptions.rst:493 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." msgstr "新增 ``value`` 屬性且產生器函式可以用它來回傳值。" -#: ../../library/exceptions.rst:489 +#: ../../library/exceptions.rst:497 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." @@ -736,7 +738,7 @@ msgstr "" "透過 ``from __future__ import generator_stop`` 引入 RuntimeError 的轉換,參" "考 :pep:`479`。" -#: ../../library/exceptions.rst:493 +#: ../../library/exceptions.rst:501 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." @@ -744,7 +746,7 @@ msgstr "" "預設對所有程式啟用 :pep:`479`:在產生器引發的 :exc:`StopIteration` 錯誤會轉換" "成 :exc:`RuntimeError`。" -#: ../../library/exceptions.rst:499 +#: ../../library/exceptions.rst:507 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." @@ -752,7 +754,7 @@ msgstr "" "此例外必須被 :term:`asynchronous iterator` 物件的 :meth:`~object.__anext__` " "方法引發來停止疊代。" -#: ../../library/exceptions.rst:506 +#: ../../library/exceptions.rst:514 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" @@ -763,7 +765,7 @@ msgstr "" "呼叫內建函式 :func:`compile`、:func:`exec` 或 :func:`eval` 的時候,或者在讀取" "初始腳本或標準輸入(也包含互動式)的時候。" -#: ../../library/exceptions.rst:512 +#: ../../library/exceptions.rst:520 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." @@ -771,18 +773,18 @@ msgstr "" "例外實例的 :func:`str` 只回傳錯誤訊息。Details 是個元組,其成員也能夠以分開的" "屬性取得。" -#: ../../library/exceptions.rst:517 +#: ../../library/exceptions.rst:525 msgid "The name of the file the syntax error occurred in." msgstr "發生語法錯誤所在的檔案名稱。" -#: ../../library/exceptions.rst:521 +#: ../../library/exceptions.rst:529 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" "發生錯誤所在檔案的列號。這是以 1 開始的索引:檔案第一列的 ``lineno`` 是 1。" -#: ../../library/exceptions.rst:526 +#: ../../library/exceptions.rst:534 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." @@ -790,11 +792,11 @@ msgstr "" "發生錯誤所在該列的欄號 (column)。這是以 1 開始的索引:該列第一個字元的 " "``offset`` 是 1。" -#: ../../library/exceptions.rst:531 +#: ../../library/exceptions.rst:539 msgid "The source code text involved in the error." msgstr "涉及該錯誤的原始程式碼文字。" -#: ../../library/exceptions.rst:535 +#: ../../library/exceptions.rst:543 msgid "" "Which line number in the file the error occurred ends in. This is 1-indexed: " "the first line in the file has a ``lineno`` of 1." @@ -802,7 +804,7 @@ msgstr "" "發生錯誤所在檔案的結束列號。這是以 1 開始的索引:檔案第一列的 ``lineno`` 是 " "1。" -#: ../../library/exceptions.rst:540 +#: ../../library/exceptions.rst:548 msgid "" "The column in the end line where the error occurred finishes. This is 1-" "indexed: the first character in the line has an ``offset`` of 1." @@ -810,7 +812,7 @@ msgstr "" "發生錯誤所在該結束列的欄號。這是以 1 開始的索引:該列第一個字元的 ``offset`` " "是 1。" -#: ../../library/exceptions.rst:543 +#: ../../library/exceptions.rst:551 msgid "" "For errors in f-string fields, the message is prefixed by \"f-string: \" and " "the offsets are offsets in a text constructed from the replacement " @@ -821,18 +823,18 @@ msgstr "" "(offset) 是從替代表達式建構的文字的偏移量。例如編譯 f'Bad {a b} field' 會得到" "這個 args 屬性:('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))。" -#: ../../library/exceptions.rst:548 +#: ../../library/exceptions.rst:556 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." msgstr "新增 :attr:`end_lineno` 與 :attr:`end_offset` 屬性。" -#: ../../library/exceptions.rst:553 +#: ../../library/exceptions.rst:561 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" "與不正確的縮排有關的語法錯誤的基礎類別。這是 :exc:`SyntaxError` 的子類別。" -#: ../../library/exceptions.rst:559 +#: ../../library/exceptions.rst:567 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." @@ -840,7 +842,7 @@ msgstr "" "當縮排包含製表符號 (tab) 和空白的不一致用法時會引發此例外。這是 :exc:" "`IndentationError` 的子類別。" -#: ../../library/exceptions.rst:565 +#: ../../library/exceptions.rst:573 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " @@ -853,7 +855,7 @@ msgstr "" "`CPython` 中,這可能是因為錯誤地使用 Python 的 C API,例如回傳一個 ``NULL`` " "值而沒有設定例外。" -#: ../../library/exceptions.rst:571 +#: ../../library/exceptions.rst:579 msgid "" "If you're confident that this exception wasn't your fault, or the fault of a " "package you're using, you should report this to the author or maintainer of " @@ -868,7 +870,7 @@ msgstr "" "互動式 Python 會話的開頭被印出)、確切的錯誤訊息(該例外的關聯值)及如果可能" "的話,觸發此錯誤的程式來源。" -#: ../../library/exceptions.rst:582 +#: ../../library/exceptions.rst:590 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -877,7 +879,7 @@ msgid "" "it is not handled, the Python interpreter exits; no stack traceback is " "printed. The constructor accepts the same optional argument passed to :func:" "`sys.exit`. If the value is an integer, it specifies the system exit status " -"(passed to C's :c:func:`exit` function); if it is ``None``, the exit status " +"(passed to C's :c:func:`!exit` function); if it is ``None``, the exit status " "is zero; if it has another type (such as a string), the object's value is " "printed and the exit status is one." msgstr "" @@ -885,11 +887,11 @@ msgstr "" "exc:`Exception` 因此不會被捕捉 :exc:`Exception` 的程式意外地捕捉。這允許例外" "可以正確地向上傳遞並導致直譯器結束。當它未被處理時,Python 直譯器會結束;不會" "印出堆疊回溯。建構函式接受跟傳入 :func:`sys.exit` 一樣的可選引數。如果該值是" -"整數,它會指定系統的結束狀態(傳入 C 的 :c:func:`exit` 函式 );如果它是 " +"整數,它會指定系統的結束狀態(傳入 C 的 :c:func:`!exit` 函式);如果它是 " "``None``,結束狀態會是 0;如果它是其他型別(例如字串),則物件的值會被印出而" "結束狀態是 1。" -#: ../../library/exceptions.rst:593 +#: ../../library/exceptions.rst:601 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -903,13 +905,13 @@ msgstr "" "風險下執行腳本。如果在絕對有必要立即結束的情況(例如在子行程呼叫完 :func:`os." "fork` 之後 )可以使用 :func:`os._exit` 函式。" -#: ../../library/exceptions.rst:602 +#: ../../library/exceptions.rst:610 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "傳入建構函式的結束狀態或錯誤訊息。(預設是 ``None``。 )" -#: ../../library/exceptions.rst:608 +#: ../../library/exceptions.rst:616 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " @@ -918,7 +920,7 @@ msgstr "" "當一個操作或函式被用在不適合的型別的物件時會引發此例外。關聯值是一個字串,提" "供關於不相符型別的細節。" -#: ../../library/exceptions.rst:611 +#: ../../library/exceptions.rst:619 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -929,7 +931,7 @@ msgstr "" "這樣做。如果一個物件有意要支援某個給定的操作但尚未提供實作,該引發的正確例外" "是 :exc:`NotImplementedError`。" -#: ../../library/exceptions.rst:616 +#: ../../library/exceptions.rst:624 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -940,7 +942,7 @@ msgstr "" "導致 :exc:`TypeError`,但傳入帶有錯誤值的引數(例如超出預期範圍的數值)應該要" "導致 :exc:`ValueError`。" -#: ../../library/exceptions.rst:623 +#: ../../library/exceptions.rst:631 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" @@ -949,7 +951,7 @@ msgstr "" "當在函式或方法裡引用某個區域變數,但該變數尚未被繫結到任何值的時候會引發此例" "外。這是 :exc:`NameError` 的子類別。" -#: ../../library/exceptions.rst:630 +#: ../../library/exceptions.rst:638 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." @@ -957,7 +959,7 @@ msgstr "" "當 Unicode 相關的編碼或解碼錯誤發生時會引發此例外。這是 :exc:`ValueError` 的" "子類別。" -#: ../../library/exceptions.rst:633 +#: ../../library/exceptions.rst:641 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " @@ -966,27 +968,27 @@ msgstr "" ":exc:`UnicodeError` 有屬性描述編碼或解碼錯誤。例如 ``err.object[err.start:" "err.end]`` 會提供讓編解碼器失敗的具體無效輸入。" -#: ../../library/exceptions.rst:639 +#: ../../library/exceptions.rst:647 msgid "The name of the encoding that raised the error." msgstr "引發錯誤的編碼名稱。" -#: ../../library/exceptions.rst:643 +#: ../../library/exceptions.rst:651 msgid "A string describing the specific codec error." msgstr "描述特定編解碼器錯誤的字串。" -#: ../../library/exceptions.rst:647 +#: ../../library/exceptions.rst:655 msgid "The object the codec was attempting to encode or decode." msgstr "編解碼器嘗試編碼或解碼的物件。" -#: ../../library/exceptions.rst:651 +#: ../../library/exceptions.rst:659 msgid "The first index of invalid data in :attr:`object`." msgstr "在 :attr:`object` 中無效資料的開始索引。" -#: ../../library/exceptions.rst:655 +#: ../../library/exceptions.rst:663 msgid "The index after the last invalid data in :attr:`object`." msgstr "在 :attr:`object` 中最後的無效資料後的索引。" -#: ../../library/exceptions.rst:660 +#: ../../library/exceptions.rst:668 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." @@ -994,7 +996,7 @@ msgstr "" "在編碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:666 +#: ../../library/exceptions.rst:674 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." @@ -1002,7 +1004,7 @@ msgstr "" "在解碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:672 +#: ../../library/exceptions.rst:680 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." @@ -1010,7 +1012,7 @@ msgstr "" "在轉譯當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:678 +#: ../../library/exceptions.rst:686 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " @@ -1019,7 +1021,7 @@ msgstr "" "當一個操作或函式收到引數是正確型別但是不適合的值,且該情況無法被更精確的例外" "例如 :exc:`IndexError` 所描述時會引發此例外。" -#: ../../library/exceptions.rst:685 +#: ../../library/exceptions.rst:693 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " @@ -1028,7 +1030,7 @@ msgstr "" "當除法或模數運算 (modulo operation) 的第二個引數是 0 的時候會引發此例外。關聯" "值是一個字串,表示運算元及運算的類型。" -#: ../../library/exceptions.rst:690 +#: ../../library/exceptions.rst:698 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." @@ -1036,21 +1038,21 @@ msgstr "" "以下例外是為了相容於之前版本而保留;從 Python 3.3 開始,它們是 :exc:" "`OSError` 的別名。" -#: ../../library/exceptions.rst:699 +#: ../../library/exceptions.rst:707 msgid "Only available on Windows." msgstr "僅限於在 Windows 中使用。" -#: ../../library/exceptions.rst:703 +#: ../../library/exceptions.rst:711 msgid "OS exceptions" msgstr "作業系統例外" -#: ../../library/exceptions.rst:705 +#: ../../library/exceptions.rst:713 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "以下的例外是 :exc:`OSError` 的子類別,它們根據系統錯誤代碼來引發。" -#: ../../library/exceptions.rst:710 +#: ../../library/exceptions.rst:718 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1061,14 +1063,14 @@ msgstr "" "到 :c:data:`errno` :py:const:`~errno.EAGAIN`、:py:const:`~errno.EALREADY`、:" "py:const:`~errno.EWOULDBLOCK` 及 :py:const:`~errno.EINPROGRESS`。" -#: ../../library/exceptions.rst:715 +#: ../../library/exceptions.rst:723 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" "除了 :exc:`OSError` 的那些屬性之外,:exc:`BlockingIOError` 有多一個屬性:" -#: ../../library/exceptions.rst:720 +#: ../../library/exceptions.rst:728 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " @@ -1077,7 +1079,7 @@ msgstr "" "一個整數,內容為在其阻塞之前,已寫進串流的字元數。當使用 :mod:`io` 模組裡的緩" "衝 I/O 類別時這個屬性是可用的。" -#: ../../library/exceptions.rst:726 +#: ../../library/exceptions.rst:734 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` :py:const:`~errno.ECHILD`." @@ -1085,11 +1087,11 @@ msgstr "" "當子行程上的操作失敗時會引發此例外。對應到 :c:data:`errno` :py:const:`~errno." "ECHILD`。" -#: ../../library/exceptions.rst:731 +#: ../../library/exceptions.rst:739 msgid "A base class for connection-related issues." msgstr "連線相關問題的基礎類別。" -#: ../../library/exceptions.rst:733 +#: ../../library/exceptions.rst:741 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." @@ -1097,7 +1099,7 @@ msgstr "" "子類別有 :exc:`BrokenPipeError`、:exc:`ConnectionAbortedError`、:exc:" "`ConnectionRefusedError` 及 :exc:`ConnectionResetError`。" -#: ../../library/exceptions.rst:738 +#: ../../library/exceptions.rst:746 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " @@ -1108,7 +1110,7 @@ msgstr "" "會引發此例外,或者當嘗試寫入已關閉寫入的 socket 時也會引發。對應到 :c:data:" "`errno` :py:const:`~errno.EPIPE` 及 :py:const:`~errno.ESHUTDOWN`。" -#: ../../library/exceptions.rst:745 +#: ../../library/exceptions.rst:753 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1117,7 +1119,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線的嘗試被對等端點 (peer) 中斷時會引" "發此例外。對應到 :c:data:`errno` :py:const:`~errno.ECONNABORTED`。" -#: ../../library/exceptions.rst:751 +#: ../../library/exceptions.rst:759 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1126,7 +1128,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線的嘗試被對等端點拒絕時會引發此例" "外。對應到 :c:data:`errno` :py:const:`~errno.ECONNREFUSED`。" -#: ../../library/exceptions.rst:757 +#: ../../library/exceptions.rst:765 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." @@ -1134,7 +1136,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線被對等端點重置時會引發此例外。對應" "到 :c:data:`errno` :py:const:`~errno.ECONNRESET`。" -#: ../../library/exceptions.rst:763 +#: ../../library/exceptions.rst:771 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." @@ -1142,7 +1144,7 @@ msgstr "" "當嘗試建立已存在的檔案或目錄時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.EEXIST`。" -#: ../../library/exceptions.rst:768 +#: ../../library/exceptions.rst:776 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` :py:const:`~errno.ENOENT`." @@ -1150,7 +1152,7 @@ msgstr "" "當請求不存在的檔案或目錄時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.ENOENT`。" -#: ../../library/exceptions.rst:773 +#: ../../library/exceptions.rst:781 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." @@ -1158,7 +1160,7 @@ msgstr "" "當系統呼叫被傳入的信號中斷時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.EINTR`。" -#: ../../library/exceptions.rst:776 +#: ../../library/exceptions.rst:784 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " @@ -1167,7 +1169,7 @@ msgstr "" "現在當 syscall 被信號中斷時 Python 會重試系統呼叫而不會引發 :exc:" "`InterruptedError`,除非信號處理器引發例外(理由可參考 :pep:`475`)。" -#: ../../library/exceptions.rst:783 +#: ../../library/exceptions.rst:791 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." @@ -1175,7 +1177,7 @@ msgstr "" "當在目錄上請求檔案操作(例如 :func:`os.remove`)時會引發此例外。對應到 :c:" "data:`errno` :py:const:`~errno.EISDIR`。" -#: ../../library/exceptions.rst:789 +#: ../../library/exceptions.rst:797 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " @@ -1187,7 +1189,7 @@ msgstr "" "外。在大多數的 POSIX 平台上,如果嘗試操作開啟或遍歷一個當作目錄的非目錄檔案也" "會引發此例外。對應到 :c:data:`errno` :py:const:`~errno.ENOTDIR`。" -#: ../../library/exceptions.rst:797 +#: ../../library/exceptions.rst:805 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" @@ -1198,14 +1200,14 @@ msgstr "" "到 :c:data:`errno` :py:const:`~errno.EACCES`、:py:const:`~errno.EPERM` 及 :" "py:const:`~errno.ENOTCAPABLE`。" -#: ../../library/exceptions.rst:802 +#: ../../library/exceptions.rst:810 msgid "" "WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" "`PermissionError`." msgstr "" "WASI 的 :py:const:`~errno.ENOTCAPABLE` 現在對應到 :exc:`PermissionError`。" -#: ../../library/exceptions.rst:808 +#: ../../library/exceptions.rst:816 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" "py:const:`~errno.ESRCH`." @@ -1213,7 +1215,7 @@ msgstr "" "當給定的行程不存在時會引發此例外。對應到 :c:data:`errno` :py:const:`~errno." "ESRCH`。" -#: ../../library/exceptions.rst:813 +#: ../../library/exceptions.rst:821 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` :py:const:`~errno.ETIMEDOUT`." @@ -1221,40 +1223,40 @@ msgstr "" "當系統函式在系統層級超時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.ETIMEDOUT`。" -#: ../../library/exceptions.rst:816 +#: ../../library/exceptions.rst:824 msgid "All the above :exc:`OSError` subclasses were added." msgstr "加入以上所有的 :exc:`OSError` 子類別。" -#: ../../library/exceptions.rst:822 +#: ../../library/exceptions.rst:830 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr ":pep:`3151` — 改寫作業系統與 IO 例外階層" -#: ../../library/exceptions.rst:828 +#: ../../library/exceptions.rst:836 msgid "Warnings" msgstr "警告" -#: ../../library/exceptions.rst:830 +#: ../../library/exceptions.rst:838 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" "以下的例外是當作警告的種類使用;更多細節參考 :ref:`warning-categories` 文件。" -#: ../../library/exceptions.rst:835 +#: ../../library/exceptions.rst:843 msgid "Base class for warning categories." msgstr "警告種類的基礎類別。" -#: ../../library/exceptions.rst:840 +#: ../../library/exceptions.rst:848 msgid "Base class for warnings generated by user code." msgstr "使用者程式碼產生的警告的基礎類別。" -#: ../../library/exceptions.rst:845 +#: ../../library/exceptions.rst:853 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "關於已棄用功能的警告的基礎類別,且當那些警告是針對其他 Python 開發者。" -#: ../../library/exceptions.rst:848 +#: ../../library/exceptions.rst:856 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " @@ -1263,17 +1265,17 @@ msgstr "" "會被預設的警告過濾器忽略,在 ``__main__`` 模組裡除外 (:pep:`565`)。啟用 :ref:" "`Python 開發模式 `\\ 會顯示此警告。" -#: ../../library/exceptions.rst:852 ../../library/exceptions.rst:868 +#: ../../library/exceptions.rst:860 ../../library/exceptions.rst:876 msgid "The deprecation policy is described in :pep:`387`." msgstr "棄用原則描述在 :pep:`387` 裡。" -#: ../../library/exceptions.rst:857 +#: ../../library/exceptions.rst:865 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "關於過時且預期未來要被棄用,但目前尚未被棄用的功能的警告的基礎類別。" -#: ../../library/exceptions.rst:861 +#: ../../library/exceptions.rst:869 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " @@ -1282,8 +1284,8 @@ msgstr "" "因為發出關於可能即將被棄用的警告是不尋常的,此類別很少被使用,而對已經被棄用" "的情況會優先使用 :exc:`DeprecationWarning`。" -#: ../../library/exceptions.rst:865 ../../library/exceptions.rst:891 -#: ../../library/exceptions.rst:918 +#: ../../library/exceptions.rst:873 ../../library/exceptions.rst:899 +#: ../../library/exceptions.rst:926 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." @@ -1291,15 +1293,15 @@ msgstr "" "會被預設的警告過濾器忽略。啟用 :ref:`Python 開發模式 `\\ 會顯示此警" "告。" -#: ../../library/exceptions.rst:873 +#: ../../library/exceptions.rst:881 msgid "Base class for warnings about dubious syntax." msgstr "關於可疑語法的警告的基礎類別。" -#: ../../library/exceptions.rst:878 +#: ../../library/exceptions.rst:886 msgid "Base class for warnings about dubious runtime behavior." msgstr "關於可疑執行環境行為的警告的基礎類別。" -#: ../../library/exceptions.rst:883 +#: ../../library/exceptions.rst:891 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." @@ -1307,36 +1309,36 @@ msgstr "" "關於已棄用功能的警告的基礎類別,且當那些警告是針對以 Python 寫的應用程式的終" "端使用者。" -#: ../../library/exceptions.rst:889 +#: ../../library/exceptions.rst:897 msgid "Base class for warnings about probable mistakes in module imports." msgstr "關於在模組引入的可能錯誤的警告的基礎類別。" -#: ../../library/exceptions.rst:897 +#: ../../library/exceptions.rst:905 msgid "Base class for warnings related to Unicode." msgstr "Unicode 相關警告的基礎類別。" -#: ../../library/exceptions.rst:902 +#: ../../library/exceptions.rst:910 msgid "Base class for warnings related to encodings." msgstr "編碼相關警告的基礎類別。" -#: ../../library/exceptions.rst:904 +#: ../../library/exceptions.rst:912 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節參考\\ :ref:`io-encoding-warning`。" -#: ../../library/exceptions.rst:911 +#: ../../library/exceptions.rst:919 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr ":class:`bytes` 及 :class:`bytearray` 相關警告的基礎類別。" -#: ../../library/exceptions.rst:916 +#: ../../library/exceptions.rst:924 msgid "Base class for warnings related to resource usage." msgstr "資源用法相關警告的基礎類別。" -#: ../../library/exceptions.rst:927 +#: ../../library/exceptions.rst:935 msgid "Exception groups" msgstr "例外群組" -#: ../../library/exceptions.rst:929 +#: ../../library/exceptions.rst:937 msgid "" "The following are used when it is necessary to raise multiple unrelated " "exceptions. They are part of the exception hierarchy so they can be handled " @@ -1348,7 +1350,7 @@ msgstr "" "所有其他例外一樣使用 :keyword:`except` 來處理。此外,它們會以包含的例外型別為" "基礎來比對其子群組而被 :keyword:`except*` 辨認出來。" -#: ../../library/exceptions.rst:938 +#: ../../library/exceptions.rst:946 msgid "" "Both of these exception types wrap the exceptions in the sequence ``excs``. " "The ``msg`` parameter must be a string. The difference between the two " @@ -1364,7 +1366,7 @@ msgstr "" "`Exception` 的子類別。這個設計使得 ``except Exception`` 可以捕捉 :exc:" "`ExceptionGroup` 但不能捕捉 :exc:`BaseExceptionGroup`。" -#: ../../library/exceptions.rst:946 +#: ../../library/exceptions.rst:954 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1377,17 +1379,17 @@ msgstr "" "使用來讓這樣的選擇自動化。另一方面來說,如果任何包含的例外不是 :exc:" "`Exception` 的子類別,:exc:`ExceptionGroup` 建構函式會引發 :exc:`TypeError`。" -#: ../../library/exceptions.rst:955 +#: ../../library/exceptions.rst:963 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "建構函式的 ``msg`` 引數。這是一個唯讀的屬性。" -#: ../../library/exceptions.rst:959 +#: ../../library/exceptions.rst:967 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "指定給建構函式 ``excs`` 序列中的例外組成的元組。這是一個唯讀的屬性。" -#: ../../library/exceptions.rst:964 +#: ../../library/exceptions.rst:972 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." @@ -1395,7 +1397,7 @@ msgstr "" "回傳只包含從現有群組比對到 *condition* 的例外的例外群組,或者當結果為空時回" "傳 ``None``。" -#: ../../library/exceptions.rst:967 +#: ../../library/exceptions.rst:975 msgid "" "The condition can be an exception type or tuple of exception types, in which " "case each exception is checked for a match using the same check that is used " @@ -1408,7 +1410,7 @@ msgstr "" "物件(除了型別物件之外),其接受一個例外作為單一引數,而如果該例外應該在子群" "組中就回傳 true。" -#: ../../library/exceptions.rst:973 +#: ../../library/exceptions.rst:981 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`~BaseException." @@ -1421,7 +1423,7 @@ msgstr "" "__context__` 及 :attr:`~BaseException.__notes__` 欄位的值也一樣。空的巢狀群組" "會從結果裡排除。" -#: ../../library/exceptions.rst:980 +#: ../../library/exceptions.rst:988 msgid "" "The condition is checked for all exceptions in the nested exception group, " "including the top-level and any nested exception groups. If the condition is " @@ -1430,11 +1432,11 @@ msgstr "" "條件會對巢狀例外群組裡的所有例外做檢查,包括頂層及任何巢狀的例外群組。如果條" "件對這樣的例外群組為 true,它會被完整包含在結果裡。" -#: ../../library/exceptions.rst:984 +#: ../../library/exceptions.rst:992 msgid "``condition`` can be any callable which is not a type object." msgstr "``condition`` 可以是任何不是型別物件的可呼叫物件。" -#: ../../library/exceptions.rst:989 +#: ../../library/exceptions.rst:997 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" @@ -1443,13 +1445,13 @@ msgstr "" "像 :meth:`subgroup` 一樣,但回傳一對 ``(match, rest)``,其中 ``match`` 是 " "``subgroup(condition)`` 而 ``rest`` 是剩下沒有比對到的部分。" -#: ../../library/exceptions.rst:995 +#: ../../library/exceptions.rst:1003 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "回傳有相同 :attr:`message` 但將例外包裝在 ``excs`` 的例外群組。" -#: ../../library/exceptions.rst:998 +#: ../../library/exceptions.rst:1006 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`, which are used in " "various contexts to break up an exception group. A subclass needs to " @@ -1460,7 +1462,7 @@ msgstr "" "組。子類別需要覆寫它來讓 :meth:`subgroup` 及 :meth:`split` 回傳子類別而不是 :" "exc:`ExceptionGroup` 的實例。" -#: ../../library/exceptions.rst:1004 +#: ../../library/exceptions.rst:1012 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`~BaseException." "__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." @@ -1473,7 +1475,7 @@ msgstr "" "`~BaseException.__context__` 和 :attr:`~BaseException.__notes__` 欄位到 :" "meth:`derive` 所回傳的例外群組上,因此這些欄位不需要被 :meth:`derive` 更新。" -#: ../../library/exceptions.rst:1011 +#: ../../library/exceptions.rst:1019 msgid "" ">>> class MyGroup(ExceptionGroup):\n" "... def derive(self, excs):\n" @@ -1527,7 +1529,7 @@ msgstr "" ">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" "True" -#: ../../library/exceptions.rst:1037 +#: ../../library/exceptions.rst:1045 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " "subclasses that need a different constructor signature need to override that " @@ -1539,7 +1541,7 @@ msgstr "" "建構函式簽名的子類別需要覆寫它而不是 :meth:`~object.__init__`。例如下面定義了" "一個例外群組子類別接受 exit_code 並從中建構群組的訊息。: ::" -#: ../../library/exceptions.rst:1043 +#: ../../library/exceptions.rst:1051 msgid "" "class Errors(ExceptionGroup):\n" " def __new__(cls, errors, exit_code):\n" @@ -1559,7 +1561,7 @@ msgstr "" " def derive(self, excs):\n" " return Errors(excs, self.exit_code)" -#: ../../library/exceptions.rst:1052 +#: ../../library/exceptions.rst:1060 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" @@ -1568,15 +1570,15 @@ msgstr "" "像 :exc:`ExceptionGroup` 一樣,任何 :exc:`BaseExceptionGroup` 的子類別且也" "是 :exc:`Exception` 的子類別只能包裝 :exc:`Exception` 的實例。" -#: ../../library/exceptions.rst:1060 +#: ../../library/exceptions.rst:1068 msgid "Exception hierarchy" msgstr "例外階層" -#: ../../library/exceptions.rst:1062 +#: ../../library/exceptions.rst:1070 msgid "The class hierarchy for built-in exceptions is:" msgstr "內建例外的類別階層如下:" -#: ../../library/exceptions.rst:1064 +#: ../../library/exceptions.rst:1072 msgid "" "BaseException\n" " ├── BaseExceptionGroup\n" @@ -1757,10 +1759,28 @@ msgstr "__suppress_context__(例外屬性)" msgid "assert" msgstr "assert" -#: ../../library/exceptions.rst:347 +#: ../../library/exceptions.rst:355 msgid "module" msgstr "module(模組)" -#: ../../library/exceptions.rst:347 +#: ../../library/exceptions.rst:355 msgid "errno" msgstr "errno" + +#~ msgid "" +#~ "The :attr:`name` and :attr:`obj` attributes can be set using keyword-only " +#~ "arguments to the constructor. When set they represent the name of the " +#~ "attribute that was attempted to be accessed and the object that was " +#~ "accessed for said attribute, respectively." +#~ msgstr "" +#~ ":attr:`name` 和 :attr:`obj` 屬性可以使用建構函式的僅限關鍵字 (keyword-" +#~ "only) 引數來設定。當被設定的時候,它們分別代表被嘗試存取的屬性名稱以及被以" +#~ "該屬性存取的物件。" + +#~ msgid "" +#~ "The :attr:`name` attribute can be set using a keyword-only argument to " +#~ "the constructor. When set it represent the name of the variable that was " +#~ "attempted to be accessed." +#~ msgstr "" +#~ ":attr:`name` 屬性可以使用僅限關鍵字引數來設定到建構函式。當被設定的時候它" +#~ "代表被嘗試存取的變數名稱。" diff --git a/library/functools.po b/library/functools.po index af426e5f3d..69858cd1de 100644 --- a/library/functools.po +++ b/library/functools.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-28 00:13+0000\n" +"POT-Creation-Date: 2025-07-12 00:16+0000\n" "PO-Revision-Date: 2024-05-11 16:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,7 +61,7 @@ msgstr "" "裝器。因為它永遠不需要丟棄舊值,所以這比有大小限制的 :func:`lru_cache` 更小、" "更快。" -#: ../../library/functools.rst:39 ../../library/functools.rst:291 +#: ../../library/functools.rst:39 ../../library/functools.rst:297 msgid "For example::" msgstr "舉例來說: ::" @@ -80,6 +80,16 @@ msgid "" "cached\n" "479001600" msgstr "" +"@cache\n" +"def factorial(n):\n" +" return n * factorial(n-1) if n else 1\n" +"\n" +">>> factorial(10) # 沒有先前的快取結果,會進行 11 次遞迴呼叫\n" +"3628800\n" +">>> factorial(5) # 只查詢快取的結果\n" +"120\n" +">>> factorial(12) # 進行兩次新的遞迴呼叫,其他 10 次是快取的\n" +"479001600" #: ../../library/functools.rst:52 ../../library/functools.rst:158 msgid "" @@ -111,7 +121,7 @@ msgstr "" "屬性外實質上幾乎是不可變 (immutable) 的實例,針對其所需要繁重計算會很有用。" #: ../../library/functools.rst:70 ../../library/functools.rst:142 -#: ../../library/functools.rst:383 +#: ../../library/functools.rst:389 msgid "Example::" msgstr "範例: ::" @@ -352,24 +362,24 @@ msgstr "" "的 :class:`dict` 以顯示 *maxsize* 和 *typed* 的值。這僅能顯示資訊,改變其值不" "會有任何效果。" -#: ../../library/functools.rst:202 +#: ../../library/functools.rst:205 msgid "" "To help measure the effectiveness of the cache and tune the *maxsize* " -"parameter, the wrapped function is instrumented with a :func:`cache_info` " +"parameter, the wrapped function is instrumented with a :func:`!cache_info` " "function that returns a :term:`named tuple` showing *hits*, *misses*, " "*maxsize* and *currsize*." msgstr "" "為了輔助測量快取的有效性並調整 *maxsize* 參數,包裝的函式使用了一個 :func:" -"`cache_info` 函式來做檢測,該函式會回傳一個\\ :term:`附名元組 `\\ 來顯示 *hits*、*misses*、*maxsize* 和 *currsize*。" -#: ../../library/functools.rst:207 +#: ../../library/functools.rst:213 msgid "" -"The decorator also provides a :func:`cache_clear` function for clearing or " +"The decorator also provides a :func:`!cache_clear` function for clearing or " "invalidating the cache." -msgstr "裝飾器還提供了一個 :func:`cache_clear` 函式來清除或使快取失效。" +msgstr "裝飾器還提供了一個 :func:`!cache_clear` 函式來清除或使快取失效。" -#: ../../library/functools.rst:210 +#: ../../library/functools.rst:216 msgid "" "The original underlying function is accessible through the :attr:" "`__wrapped__` attribute. This is useful for introspection, for bypassing " @@ -378,14 +388,14 @@ msgstr "" "原本的底層函式可以透過 :attr:`__wrapped__` 屬性存取。這對於要自我檢查 " "(introspection)、繞過快取或使用不同的快取重新包裝函式時非常有用。" -#: ../../library/functools.rst:214 +#: ../../library/functools.rst:220 msgid "" "The cache keeps references to the arguments and return values until they age " "out of the cache or until the cache is cleared." msgstr "" "快取會保留對引數和回傳值的參照,直到快取過時 (age out) 或快取被清除為止。" -#: ../../library/functools.rst:217 +#: ../../library/functools.rst:223 msgid "" "If a method is cached, the ``self`` instance argument is included in the " "cache. See :ref:`faq-cache-method-calls`" @@ -393,7 +403,7 @@ msgstr "" "如果方法被快取起來,則 ``self`` 實例引數將包含在快取中。請參閱\\ :ref:`faq-" "cache-method-calls`" -#: ../../library/functools.rst:220 +#: ../../library/functools.rst:226 msgid "" "An `LRU (least recently used) cache `_ works best when the " @@ -408,7 +418,7 @@ msgstr "" "能發揮最好的效果。快取的大小限制可確保快取不會在長時間運行的行程(例如 Web 伺" "服器)上無限制地成長。" -#: ../../library/functools.rst:227 +#: ../../library/functools.rst:233 msgid "" "In general, the LRU cache should only be used when you want to reuse " "previously computed values. Accordingly, it doesn't make sense to cache " @@ -420,11 +430,11 @@ msgstr "" "side-effects 的函式、需要在每次呼叫時建立不同可變物件的函式(例如產生器和非同" "步函式)或不純函式(impure function,例如 time() 或 random())是沒有意義的。" -#: ../../library/functools.rst:233 +#: ../../library/functools.rst:239 msgid "Example of an LRU cache for static web content::" msgstr "靜態網頁內容的 LRU 快取範例: ::" -#: ../../library/functools.rst:235 +#: ../../library/functools.rst:241 msgid "" "@lru_cache(maxsize=32)\n" "def get_pep(num):\n" @@ -443,8 +453,24 @@ msgid "" ">>> get_pep.cache_info()\n" "CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)" msgstr "" +"@lru_cache(maxsize=32)\n" +"def get_pep(num):\n" +" '取得 Python 改進提案的文字'\n" +" resource = f'https://peps.python.org/pep-{num:04d}'\n" +" try:\n" +" with urllib.request.urlopen(resource) as s:\n" +" return s.read()\n" +" except urllib.error.HTTPError:\n" +" return 'Not Found'\n" +"\n" +">>> for n in 8, 290, 308, 320, 8, 218, 320, 279, 289, 320, 9991:\n" +"... pep = get_pep(n)\n" +"... print(n, len(pep))\n" +"\n" +">>> get_pep.cache_info()\n" +"CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)" -#: ../../library/functools.rst:252 +#: ../../library/functools.rst:258 msgid "" "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " @@ -454,7 +480,7 @@ msgstr "" "wiki/Dynamic_programming>`_ 技法以有效率地計算\\ `費波那契數 (Fibonacci " "numbers) `_ 的範例: ::" -#: ../../library/functools.rst:258 +#: ../../library/functools.rst:264 msgid "" "@lru_cache(maxsize=None)\n" "def fib(n):\n" @@ -468,20 +494,31 @@ msgid "" ">>> fib.cache_info()\n" "CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)" msgstr "" +"@lru_cache(maxsize=None)\n" +"def fib(n):\n" +" if n < 2:\n" +" return n\n" +" return fib(n-1) + fib(n-2)\n" +"\n" +">>> [fib(n) for n in range(16)]\n" +"[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]\n" +"\n" +">>> fib.cache_info()\n" +"CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)" -#: ../../library/functools.rst:272 +#: ../../library/functools.rst:278 msgid "Added the *typed* option." msgstr "新增 *typed* 選項。" -#: ../../library/functools.rst:275 +#: ../../library/functools.rst:281 msgid "Added the *user_function* option." msgstr "新增 *user_function* 選項。" -#: ../../library/functools.rst:278 +#: ../../library/functools.rst:284 msgid "Added the function :func:`!cache_parameters`" msgstr "新增 :func:`!cache_parameters` 函式。" -#: ../../library/functools.rst:283 +#: ../../library/functools.rst:289 msgid "" "Given a class defining one or more rich comparison ordering methods, this " "class decorator supplies the rest. This simplifies the effort involved in " @@ -490,16 +527,16 @@ msgstr "" "給定一個定義一個或多個 rich comparison 排序方法的類別,該類別裝飾器會提供其餘" "部分。這簡化了指定所有可能的 rich comparison 操作所涉及的工作:" -#: ../../library/functools.rst:287 +#: ../../library/functools.rst:293 msgid "" -"The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, " -"or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` " -"method." +"The class must define one of :meth:`~object.__lt__`, :meth:`~object." +"__le__`, :meth:`~object.__gt__`, or :meth:`~object.__ge__`. In addition, the " +"class should supply an :meth:`~object.__eq__` method." msgstr "" -"類別必須定義 :meth:`__lt__`、:meth:`__le__`、:meth:`__gt__` 或 :meth:" -"`__ge__` 其中之一。此外,該類別應該提供 :meth:`__eq__` 方法。" +"類別必須定義 :meth:`~object.__lt__`、:meth:`~object.__le__`、:meth:`~object.__gt__` " +"或 :meth:`~object.__ge__` 其中之一。此外,該類別應該提供 :meth:`~object.__eq__` 方法。" -#: ../../library/functools.rst:293 +#: ../../library/functools.rst:299 msgid "" "@total_ordering\n" "class Student:\n" @@ -533,7 +570,7 @@ msgstr "" " return ((self.lastname.lower(), self.firstname.lower()) <\n" " (other.lastname.lower(), other.firstname.lower()))" -#: ../../library/functools.rst:311 +#: ../../library/functools.rst:317 msgid "" "While this decorator makes it easy to create well behaved totally ordered " "types, it *does* come at the cost of slower execution and more complex stack " @@ -546,7 +583,7 @@ msgstr "" "其代價。如果效能基準測試顯示這是給定應用程式的效能瓶頸,那麼實作全部六種 " "rich comparison 方法通常能輕鬆地提升速度。" -#: ../../library/functools.rst:320 +#: ../../library/functools.rst:326 msgid "" "This decorator makes no attempt to override methods that have been declared " "in the class *or its superclasses*. Meaning that if a superclass defines a " @@ -557,13 +594,13 @@ msgstr "" "如果超類別定義了比較運算子,*total_ordering* 將不會再次實作它,即使原始方法是" "抽象的。" -#: ../../library/functools.rst:327 +#: ../../library/functools.rst:333 msgid "" "Returning ``NotImplemented`` from the underlying comparison function for " "unrecognised types is now supported." msgstr "現在支援從底層對於未識別型別的比較函式回傳 ``NotImplemented``。" -#: ../../library/functools.rst:333 +#: ../../library/functools.rst:339 msgid "" "Return a new :ref:`partial object` which when called will " "behave like *func* called with the positional arguments *args* and keyword " @@ -576,7 +613,7 @@ msgstr "" "引數,它們將被附加到 *args*。如果提供了額外的關鍵字引數,它們會擴充並覆寫 " "*keywords*。大致相當於: ::" -#: ../../library/functools.rst:340 +#: ../../library/functools.rst:346 msgid "" "def partial(func, /, *args, **keywords):\n" " def newfunc(*fargs, **fkeywords):\n" @@ -596,7 +633,7 @@ msgstr "" " newfunc.keywords = keywords\n" " return newfunc" -#: ../../library/functools.rst:349 +#: ../../library/functools.rst:355 msgid "" "The :func:`partial` is used for partial function application which " "\"freezes\" some portion of a function's arguments and/or keywords resulting " @@ -608,7 +645,7 @@ msgstr "" "分,從而產生具有簡化簽名的新物件。例如,:func:`partial` 可用來建立可呼叫函" "式,其行為類似於 :func:`int` 函式,其中 *base* 引數預設為 2:" -#: ../../library/functools.rst:364 +#: ../../library/functools.rst:370 msgid "" "Return a new :class:`partialmethod` descriptor which behaves like :class:" "`partial` except that it is designed to be used as a method definition " @@ -617,7 +654,7 @@ msgstr "" "回傳一個新的 :class:`partialmethod` 描述器 (descriptor),其行為類似於 :class:" "`partial`,只不過它被設計為用於方法定義而不能直接呼叫。" -#: ../../library/functools.rst:368 +#: ../../library/functools.rst:374 msgid "" "*func* must be a :term:`descriptor` or a callable (objects which are both, " "like normal functions, are handled as descriptors)." @@ -625,20 +662,20 @@ msgstr "" "*func* 必須是一個 :term:`descriptor` 或可呼叫物件(兩者兼具的物件,就像普通函" "式一樣,會被當作描述器處理)。" -#: ../../library/functools.rst:371 +#: ../../library/functools.rst:377 msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" -"`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " +"`classmethod`, :func:`staticmethod`, :func:`~abc.abstractmethod` or another " "instance of :class:`partialmethod`), calls to ``__get__`` are delegated to " "the underlying descriptor, and an appropriate :ref:`partial object` returned as the result." msgstr "" "當 *func* 是描述器時(例如普通的 Python 函式、:func:`classmethod`、:func:" -"`staticmethod`、:func:`abstractmethod` 或 :class:`partialmethod` 的另一個實" +"`staticmethod`、:func:`~abc.abstractmethod` 或 :class:`partialmethod` 的另一個實" "例),對 ``__get__`` 的呼叫將被委託 (delegated) 給底層描述器,且一個適當的 :" "ref:`partial 物件 `\\ 會被作為結果回傳。" -#: ../../library/functools.rst:377 +#: ../../library/functools.rst:383 msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " "created dynamically. This behaves like a normal Python function when used as " @@ -651,7 +688,7 @@ msgstr "" "*self* 引數將作為第一個位置引數插入,甚至會在提供給 :class:`partialmethod` 建" "構函式的 *args* 和 *keywords* 的前面。" -#: ../../library/functools.rst:385 +#: ../../library/functools.rst:391 msgid "" ">>> class Cell:\n" "... def __init__(self):\n" @@ -689,7 +726,7 @@ msgstr "" ">>> c.alive\n" "True" -#: ../../library/functools.rst:408 +#: ../../library/functools.rst:414 msgid "" "Apply *function* of two arguments cumulatively to the items of *iterable*, " "from left to right, so as to reduce the iterable to a single value. For " @@ -708,11 +745,11 @@ msgstr "" "物件的項目之前,並在可疊代物件為空時作為預設值。如果未給定 *initial* 且 " "*iterable* 僅包含一個項目,則回傳第一個項目。" -#: ../../library/functools.rst:417 +#: ../../library/functools.rst:423 msgid "Roughly equivalent to::" msgstr "大致相當於: ::" -#: ../../library/functools.rst:419 +#: ../../library/functools.rst:425 msgid "" "initial_missing = object()\n" "\n" @@ -738,7 +775,7 @@ msgstr "" " value = function(value, element)\n" " return value" -#: ../../library/functools.rst:431 +#: ../../library/functools.rst:437 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." @@ -746,7 +783,7 @@ msgstr "" "請參閱 :func:`itertools.accumulate` 以了解產生 (yield) 所有中間值 " "(intermediate value) 的疊代器。" -#: ../../library/functools.rst:436 +#: ../../library/functools.rst:442 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." @@ -754,7 +791,7 @@ msgstr "" "將函式轉換為\\ :term:`單一調度 `\\ :term:`泛型函式 `。" -#: ../../library/functools.rst:439 +#: ../../library/functools.rst:445 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. When defining a function using ``@singledispatch``, note that the " @@ -764,7 +801,7 @@ msgstr "" "``@singledispatch`` 定義函式時,分派調度 (dispatch) 是發生在第一個引數的型別" "上: ::" -#: ../../library/functools.rst:443 +#: ../../library/functools.rst:449 msgid "" ">>> from functools import singledispatch\n" ">>> @singledispatch\n" @@ -780,17 +817,17 @@ msgstr "" "... print(\"Let me just say,\", end=\" \")\n" "... print(arg)" -#: ../../library/functools.rst:450 +#: ../../library/functools.rst:459 msgid "" -"To add overloaded implementations to the function, use the :func:`register` " +"To add overloaded implementations to the function, use the :func:`!register` " "attribute of the generic function, which can be used as a decorator. For " "functions annotated with types, the decorator will infer the type of the " "first argument automatically::" msgstr "" -"若要為函式新增過載實作,請使用泛型函式的 :func:`register` 屬性,該屬性可用作" +"若要為函式新增過載實作,請使用泛型函式的 :func:`!register` 屬性,該屬性可用作" "裝飾器。對於以型別來註釋的函式,裝飾器將自動推斷第一個引數的型別: ::" -#: ../../library/functools.rst:455 +#: ../../library/functools.rst:464 msgid "" ">>> @fun.register\n" "... def _(arg: int, verbose=False):\n" @@ -818,11 +855,11 @@ msgstr "" "... for i, elem in enumerate(arg):\n" "... print(i, elem)" -#: ../../library/functools.rst:468 +#: ../../library/functools.rst:477 msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" msgstr "也可以使用 :data:`types.UnionType` 和 :data:`typing.Union`: ::" -#: ../../library/functools.rst:470 +#: ../../library/functools.rst:479 msgid "" ">>> @fun.register\n" "... def _(arg: int | float, verbose=False):\n" @@ -854,14 +891,14 @@ msgstr "" "... print(i, elem)\n" "..." -#: ../../library/functools.rst:485 +#: ../../library/functools.rst:494 msgid "" "For code which doesn't use type annotations, the appropriate type argument " "can be passed explicitly to the decorator itself::" msgstr "" "對於不使用型別註釋的程式碼,可以將適當的型別引數明確傳遞給裝飾器本身: ::" -#: ../../library/functools.rst:488 +#: ../../library/functools.rst:497 msgid "" ">>> @fun.register(complex)\n" "... def _(arg, verbose=False):\n" @@ -877,7 +914,7 @@ msgstr "" "... print(arg.real, arg.imag)\n" "..." -#: ../../library/functools.rst:495 +#: ../../library/functools.rst:504 msgid "" "For code that dispatches on a collections type (e.g., ``list``), but wants " "to typehint the items of the collection (e.g., ``list[int]``), the dispatch " @@ -885,7 +922,7 @@ msgid "" "going into the function definition::" msgstr "" -#: ../../library/functools.rst:500 +#: ../../library/functools.rst:509 msgid "" ">>> @fun.register(list)\n" "... def _(arg: list[int], verbose=False):\n" @@ -901,7 +938,7 @@ msgstr "" "... for i, elem in enumerate(arg):\n" "... print(i, elem)" -#: ../../library/functools.rst:509 +#: ../../library/functools.rst:518 msgid "" "At runtime the function will dispatch on an instance of a list regardless of " "the type contained within the list i.e. ``[1,2,3]`` will be dispatched the " @@ -909,15 +946,16 @@ msgid "" "example is for static type checkers only and has no runtime impact." msgstr "" -#: ../../library/functools.rst:515 +#: ../../library/functools.rst:524 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " -"the :func:`register` attribute can also be used in a functional form::" +"the :func:`~singledispatch.register` attribute can also be used in a " +"functional form::" msgstr "" -"若要啟用註冊 :term:`lambdas` 和預先存在的函式,:func:`register` 屬性" -"也能以函式形式使用: ::" +"若要啟用註冊 :term:`lambdas` 和預先存在的函式,:func:`~singledispatch.register` " +"屬性也能以函式形式使用: ::" -#: ../../library/functools.rst:518 +#: ../../library/functools.rst:527 msgid "" ">>> def nothing(arg, verbose=False):\n" "... print(\"Nothing.\")\n" @@ -929,16 +967,16 @@ msgstr "" "...\n" ">>> fun.register(type(None), nothing)" -#: ../../library/functools.rst:523 +#: ../../library/functools.rst:532 msgid "" -"The :func:`register` attribute returns the undecorated function. This " -"enables decorator stacking, :mod:`pickling`, and the creation of " -"unit tests for each variant independently::" +"The :func:`~singledispatch.register` attribute returns the undecorated " +"function. This enables decorator stacking, :mod:`pickling`, and the " +"creation of unit tests for each variant independently::" msgstr "" -":func:`register` 屬性回傳未加裝飾器的函式。這讓使得裝飾器堆疊 (decorator " +":func:`~singledispatch.register` 屬性回傳未加裝飾器的函式。這讓使得裝飾器堆疊 (decorator " "stacking)、:mod:`pickling` 以及為每個變體獨立建立單元測試成為可能:" -#: ../../library/functools.rst:527 +#: ../../library/functools.rst:536 msgid "" ">>> @fun.register(float)\n" "... @fun.register(Decimal)\n" @@ -960,13 +998,13 @@ msgstr "" ">>> fun_num is fun\n" "False" -#: ../../library/functools.rst:537 +#: ../../library/functools.rst:546 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "呼叫時,泛型函式會分派第一個引數的型別: ::" -#: ../../library/functools.rst:540 +#: ../../library/functools.rst:549 msgid "" ">>> fun(\"Hello, world.\")\n" "Hello, world.\n" @@ -1002,7 +1040,7 @@ msgstr "" ">>> fun(1.23)\n" "0.615" -#: ../../library/functools.rst:557 +#: ../../library/functools.rst:566 msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " @@ -1014,7 +1052,7 @@ msgstr "" "尋找更通用的實作。用 ``@singledispatch`` 裝飾的原始函式是為基底 :class:" "`object` 型別註冊的,這意味著如果沒有找到更好的實作就會使用它。" -#: ../../library/functools.rst:563 +#: ../../library/functools.rst:572 msgid "" "If an implementation is registered to an :term:`abstract base class`, " "virtual subclasses of the base class will be dispatched to that " @@ -1023,7 +1061,7 @@ msgstr "" "如果一個實作有被註冊到一個\\ :term:`抽象基底類別 `,則基" "底類別的虛擬子類別將被分派到該實作: ::" -#: ../../library/functools.rst:567 +#: ../../library/functools.rst:576 msgid "" ">>> from collections.abc import Mapping\n" ">>> @fun.register\n" @@ -1047,14 +1085,14 @@ msgstr "" ">>> fun({\"a\": \"b\"})\n" "a => b" -#: ../../library/functools.rst:578 +#: ../../library/functools.rst:587 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" "若要檢查泛型函式將為給定型別選擇哪種實作,請使用 ``dispatch()`` 屬性: ::" -#: ../../library/functools.rst:581 +#: ../../library/functools.rst:590 msgid "" ">>> fun.dispatch(float)\n" "\n" @@ -1062,13 +1100,13 @@ msgid "" "" msgstr "" -#: ../../library/functools.rst:586 +#: ../../library/functools.rst:595 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "若要存取所有已註冊的實作,請使用唯讀 ``registry`` 屬性: ::" -#: ../../library/functools.rst:589 +#: ../../library/functools.rst:598 msgid "" ">>> fun.registry.keys()\n" "dict_keys([, , ,\n" @@ -1088,19 +1126,21 @@ msgstr "" ">>> fun.registry[object]\n" "" -#: ../../library/functools.rst:600 -msgid "The :func:`register` attribute now supports using type annotations." -msgstr ":func:`register` 屬性現在支援使用型別註釋。" +#: ../../library/functools.rst:609 +msgid "" +"The :func:`~singledispatch.register` attribute now supports using type " +"annotations." +msgstr ":func:`~singledispatch.register` 屬性現在支援使用型別註釋。" -#: ../../library/functools.rst:603 +#: ../../library/functools.rst:612 msgid "" -"The :func:`register` attribute now supports :data:`types.UnionType` and :" -"data:`typing.Union` as type annotations." +"The :func:`~singledispatch.register` attribute now supports :data:`types." +"UnionType` and :data:`typing.Union` as type annotations." msgstr "" -":func:`register` 屬性現在支援以 :data:`types.UnionType` 和 :data:`typing." +":func:`~singledispatch.register` 屬性現在支援以 :data:`types.UnionType` 和 :data:`typing." "Union` 作為型別註釋。" -#: ../../library/functools.rst:610 +#: ../../library/functools.rst:619 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." @@ -1108,7 +1148,7 @@ msgstr "" "將方法轉換為\\ :term:`單一調度 `\\ :term:`泛型函式 `。" -#: ../../library/functools.rst:613 +#: ../../library/functools.rst:622 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a function using ``@singledispatchmethod``, note " @@ -1119,7 +1159,7 @@ msgstr "" "用 ``@singledispatchmethod`` 定義函式時,分派調度是發生在第一個非 *self* 或" "非 *cls* 引數的型別上: ::" -#: ../../library/functools.rst:618 +#: ../../library/functools.rst:627 msgid "" "class Negator:\n" " @singledispatchmethod\n" @@ -1147,7 +1187,7 @@ msgstr "" " def _(self, arg: bool):\n" " return not arg" -#: ../../library/functools.rst:631 +#: ../../library/functools.rst:640 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "func:`@classmethod`. Note that to allow for ``dispatcher." @@ -1160,7 +1200,7 @@ msgstr "" "``singledispatchmethod`` 必須是\\ *最外面的*\\ 裝飾器。以下範例是 " "``Negator`` 類別,其 ``neg`` 方法繫結到該類別,而不是該類別的實例: ::" -#: ../../library/functools.rst:637 +#: ../../library/functools.rst:646 msgid "" "class Negator:\n" " @singledispatchmethod\n" @@ -1194,7 +1234,7 @@ msgstr "" " def _(cls, arg: bool):\n" " return not arg" -#: ../../library/functools.rst:653 +#: ../../library/functools.rst:662 msgid "" "The same pattern can be used for other similar decorators: :func:" "`@staticmethod`, :func:`@abstractmethod`, " @@ -1203,7 +1243,7 @@ msgstr "" "相同的模式可用於其他類似的裝飾器::func:`@staticmethod`、:func:" "`@abstractmethod` 等。" -#: ../../library/functools.rst:662 +#: ../../library/functools.rst:671 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -1227,7 +1267,7 @@ msgstr "" "`~function.__doc__` 文件字串 (docstring))和 ``WRAPPER_UPDATES``\\ (更新包" "裝器函式的 :attr:`~function.__dict__`,即實例字典)。" -#: ../../library/functools.rst:674 +#: ../../library/functools.rst:683 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -1238,7 +1278,7 @@ msgstr "" "飾器,如 :func:`lru_cache`),此函式會自動向包裝器新增 ``__wrapped__`` 屬性," "該包裝器參照被包裝的函式。" -#: ../../library/functools.rst:679 +#: ../../library/functools.rst:688 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -1250,7 +1290,7 @@ msgstr "" "裝器函式未更新,則回傳函式的元資料 (metadata) 將反映包裝器定義而非原始函式定" "義,這通常不太會有幫助。" -#: ../../library/functools.rst:685 +#: ../../library/functools.rst:694 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -1263,7 +1303,7 @@ msgstr "" "器函式上設定它們)。如果包裝函式本身缺少 *updated* 中指定的任何屬性,仍然會引" "發 :exc:`AttributeError`。" -#: ../../library/functools.rst:691 +#: ../../library/functools.rst:700 msgid "" "The ``__wrapped__`` attribute is now automatically added. The :attr:" "`~function.__annotations__` attribute is now copied by default. Missing " @@ -1272,7 +1312,7 @@ msgstr "" "現在會自動新增 ``__wrapped__`` 屬性。現在預設會複製 :attr:`~function." "__annotations__` 屬性。缺少的屬性不再觸發 :exc:`AttributeError`。" -#: ../../library/functools.rst:696 +#: ../../library/functools.rst:705 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" @@ -1281,12 +1321,12 @@ msgstr "" "``__wrapped__`` 屬性現在都會參照包裝函式,即便函式有定義 ``__wrapped__`` 屬" "性。(參見 :issue:`17482`)" -#: ../../library/functools.rst:701 +#: ../../library/functools.rst:710 msgid "" "The :attr:`~function.__type_params__` attribute is now copied by default." msgstr "現在預設會複製 :attr:`~function.__type_params__` 屬性。" -#: ../../library/functools.rst:707 +#: ../../library/functools.rst:716 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -1297,7 +1337,7 @@ msgstr "" "式裝飾器。它相當於 ``partial(update_wrapper, wrapped=wrapped, " "assigned=assigned, updated=updated)``。例如: ::" -#: ../../library/functools.rst:712 +#: ../../library/functools.rst:721 msgid "" ">>> from functools import wraps\n" ">>> def my_decorator(f):\n" @@ -1321,20 +1361,20 @@ msgid "" "'Docstring'" msgstr "" -#: ../../library/functools.rst:733 +#: ../../library/functools.rst:742 msgid "" "Without the use of this decorator factory, the name of the example function " -"would have been ``'wrapper'``, and the docstring of the original :func:" -"`example` would have been lost." +"would have been ``'wrapper'``, and the docstring of the original :func:`!" +"example` would have been lost." msgstr "" "如果不使用這個裝飾器工廠 (decorator factory),範例函式的名稱將會是 " -"``'wrapper'``,並且原始 :func:`example` 的文件字串將會遺失。" +"``'wrapper'``,並且原始 :func:`!example` 的文件字串將會遺失。" -#: ../../library/functools.rst:741 +#: ../../library/functools.rst:750 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:743 +#: ../../library/functools.rst:752 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" @@ -1342,7 +1382,7 @@ msgstr "" ":class:`partial` 物件是由 :func:`partial` 所建立的可呼叫物件。它們有三個唯讀" "屬性:" -#: ../../library/functools.rst:749 +#: ../../library/functools.rst:758 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." @@ -1350,7 +1390,7 @@ msgstr "" "一個可呼叫的物件或函式。對 :class:`partial` 物件的呼叫將被轉送到帶有新引數和" "關鍵字的 :attr:`func`。" -#: ../../library/functools.rst:755 +#: ../../library/functools.rst:764 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." @@ -1358,13 +1398,13 @@ msgstr "" "最左邊的位置引數將會被加入到提供給 :class:`partial` 物件呼叫的位置引數的前" "面。" -#: ../../library/functools.rst:761 +#: ../../library/functools.rst:770 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "呼叫 :class:`partial` 物件時將提供的關鍵字引數。" -#: ../../library/functools.rst:764 +#: ../../library/functools.rst:773 msgid "" ":class:`partial` objects are like :ref:`function objects ` in that they are callable, weak referenceable, and can have " diff --git a/library/os.path.po b/library/os.path.po index dd776816d6..4383cdef76 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: 2023-07-13 14:06+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -115,12 +115,12 @@ msgstr "" #: ../../library/os.path.rst:215 ../../library/os.path.rst:227 #: ../../library/os.path.rst:236 ../../library/os.path.rst:246 #: ../../library/os.path.rst:260 ../../library/os.path.rst:270 -#: ../../library/os.path.rst:289 ../../library/os.path.rst:308 -#: ../../library/os.path.rst:380 ../../library/os.path.rst:400 -#: ../../library/os.path.rst:440 ../../library/os.path.rst:469 -#: ../../library/os.path.rst:485 ../../library/os.path.rst:496 -#: ../../library/os.path.rst:510 ../../library/os.path.rst:526 -#: ../../library/os.path.rst:551 ../../library/os.path.rst:615 +#: ../../library/os.path.rst:289 ../../library/os.path.rst:309 +#: ../../library/os.path.rst:381 ../../library/os.path.rst:401 +#: ../../library/os.path.rst:441 ../../library/os.path.rst:470 +#: ../../library/os.path.rst:486 ../../library/os.path.rst:497 +#: ../../library/os.path.rst:511 ../../library/os.path.rst:527 +#: ../../library/os.path.rst:552 ../../library/os.path.rst:616 msgid "Accepts a :term:`path-like object`." msgstr "接受一個 :term:`path-like object`。" @@ -144,9 +144,9 @@ msgid "" "relative pathnames, if *paths* are on different drives, or if *paths* is " "empty. Unlike :func:`commonprefix`, this returns a valid path." msgstr "" -"回傳可疊代物件 *paths* 中每個路徑名稱的最長共同子路徑。如果 *paths* 同時包含絕對路徑名稱" -"和相對路徑名稱、*paths* 位於不同的驅動機或 *paths* 為空,則引發 :exc:" -"`ValueError`。與 :func:`commonprefix` 不同,此函式回傳的是有效路徑。" +"回傳可疊代物件 *paths* 中每個路徑名稱的最長共同子路徑。如果 *paths* 同時包含" +"絕對路徑名稱和相對路徑名稱、*paths* 位於不同的驅動機或 *paths* 為空,則引發 :" +"exc:`ValueError`。與 :func:`commonprefix` 不同,此函式回傳的是有效路徑。" #: ../../library/os.path.rst:90 msgid "Accepts a sequence of :term:`path-like objects `." @@ -388,23 +388,26 @@ msgid "" "different device than *path*, or whether :file:`{path}/..` and *path* point " "to the same i-node on the same device --- this should detect mount points " "for all Unix and POSIX variants. It is not able to reliably detect bind " -"mounts on the same filesystem. On Windows, a drive letter root and a share " -"UNC are always mount points, and for any other path ``GetVolumePathName`` is " -"called to see if it is different from the input path." +"mounts on the same filesystem. On Linux systems, it will always return " +"``True`` for btrfs subvolumes, even if they aren't mount points. On Windows, " +"a drive letter root and a share UNC are always mount points, and for any " +"other path ``GetVolumePathName`` is called to see if it is different from " +"the input path." msgstr "" "如果路徑名 *path* 是一個掛載點 (:dfn:`mount point`),則回傳 ``True``:即在檔" "案系統中掛載了不同的檔案系統。在 POSIX 系統上,該函式檢查 *path* 的父目錄 :" "file:`{path}/..` 是否位於不同的設備上,或者 :file:`{path}/..` 和 *path* 是否" "指向同一設備上的相同 i-node --- 這應該能夠檢測出所有 Unix 和 POSIX 變體的掛載" -"點。但無法可靠地檢測出相同檔案系統上的綁定掛載點 (bind mount)。在 Windows " +"點。但無法可靠地檢測出相同檔案系統上的綁定掛載點 (bind mount)。在 Linux 系統上," +"即使它們不是掛載點,也會始終回傳 ``True`` 給 btrfs 子卷(subvolumes)。在 Windows " "上,以驅動機字母開頭的根目錄和 UNC 共享路徑始終是掛載點,對於任何其他路徑,會" "呼叫 ``GetVolumePathName`` 函式來檢查它是否與輸入路徑不同。" -#: ../../library/os.path.rst:305 +#: ../../library/os.path.rst:306 msgid "Added support for detecting non-root mount points on Windows." msgstr "新增在 Windows 上檢測非根目錄掛載點的支援。" -#: ../../library/os.path.rst:314 +#: ../../library/os.path.rst:315 msgid "" "Return ``True`` if pathname *path* is located on a Windows Dev Drive. A Dev " "Drive is optimized for developer scenarios, and offers faster performance " @@ -416,7 +419,7 @@ msgstr "" "開發人員場景進行了優化,提供更快的讀寫檔案性能。建議將其用於原始程式碼、臨時" "建置目錄、封包快取和其他 I/O 密集型操作。" -#: ../../library/os.path.rst:320 +#: ../../library/os.path.rst:321 msgid "" "May raise an error for an invalid path, for example, one without a " "recognizable drive, but returns ``False`` on platforms that do not support " @@ -427,17 +430,17 @@ msgstr "" "碟機的平台上返回 ``False``。請參閱 `Windows 文件 `_\\ 以了解有關啟用和建立 Dev 驅動機的資訊。" -#: ../../library/os.path.rst:327 +#: ../../library/os.path.rst:328 msgid "" "The function is now available on all platforms, and will always return " "``False`` on those that have no support for Dev Drives" msgstr "" -#: ../../library/os.path.rst:333 +#: ../../library/os.path.rst:334 msgid "Return ``True`` if *path* is a reserved pathname on the current system." msgstr "" -#: ../../library/os.path.rst:335 +#: ../../library/os.path.rst:336 msgid "" "On Windows, reserved filenames include those that end with a space or dot; " "those that contain colons (i.e. file streams such as \"name:stream\"), " @@ -446,7 +449,7 @@ msgid "" "\", \"AUX\", \"PRN\", \"COM1\", and \"LPT1\"." msgstr "" -#: ../../library/os.path.rst:343 +#: ../../library/os.path.rst:344 msgid "" "This function approximates rules for reserved paths on most Windows systems. " "These rules change over time in various Windows releases. This function may " @@ -454,11 +457,11 @@ msgid "" "available." msgstr "" -#: ../../library/os.path.rst:348 +#: ../../library/os.path.rst:349 msgid "Availability" msgstr "可用性" -#: ../../library/os.path.rst:355 +#: ../../library/os.path.rst:356 msgid "" "Join one or more path segments intelligently. The return value is the " "concatenation of *path* and all members of *\\*paths*, with exactly one " @@ -473,7 +476,7 @@ msgstr "" "個部分為空或以分隔符號結尾,結果只會以分隔符號結尾。如果一個段是絕對路徑(在 " "Windows 上需要驅動機和根),則忽略所有之前的段,並從絕對路徑段繼續連接。" -#: ../../library/os.path.rst:363 +#: ../../library/os.path.rst:364 msgid "" "On Windows, the drive is not reset when a rooted path segment (e.g., " "``r'\\foo'``) is encountered. If a segment is on a different drive or is an " @@ -488,11 +491,11 @@ msgstr "" "對於驅動機 :file:`C:` 的目前目錄的路徑(即 :file:`c:foo`),而不是 :file:`c:" "\\\\foo`。" -#: ../../library/os.path.rst:370 +#: ../../library/os.path.rst:371 msgid "Accepts a :term:`path-like object` for *path* and *paths*." msgstr "*path* 和 *paths* 接受 :term:`path-like object` 作為參數。" -#: ../../library/os.path.rst:376 +#: ../../library/os.path.rst:377 msgid "" "Normalize the case of a pathname. On Windows, convert all characters in the " "pathname to lowercase, and also convert forward slashes to backward slashes. " @@ -501,7 +504,7 @@ msgstr "" "將路徑名的大小寫規範化。在 Windows 上,將路徑名中的所有字元轉換為小寫,並將正" "斜線轉換為反斜線。在其他作業系統上,回傳原始路徑。" -#: ../../library/os.path.rst:386 +#: ../../library/os.path.rst:387 msgid "" "Normalize a pathname by collapsing redundant separators and up-level " "references so that ``A//B``, ``A/B/``, ``A/./B`` and ``A/foo/../B`` all " @@ -514,7 +517,7 @@ msgstr "" "結的路徑的含義。在 Windows 上,它將正斜線轉換為反斜線。要標準化大小寫,請使" "用 :func:`normcase`。" -#: ../../library/os.path.rst:393 +#: ../../library/os.path.rst:394 msgid "" "On POSIX systems, in accordance with `IEEE Std 1003.1 2013 Edition; 4.13 " "Pathname Resolution >> splitdrive(\"c:/dir\")\n" "(\"c:\", \"/dir\")" @@ -714,12 +716,12 @@ msgstr "" ">>> splitdrive(\"c:/dir\")\n" "(\"c:\", \"/dir\")" -#: ../../library/os.path.rst:545 +#: ../../library/os.path.rst:546 msgid "" "If the path contains a UNC path, drive will contain the host name and share::" msgstr "如果路徑包含 UNC 路徑,則驅動機將包含主機名和共享名: ::" -#: ../../library/os.path.rst:548 +#: ../../library/os.path.rst:549 msgid "" ">>> splitdrive(\"//host/computer/dir\")\n" "(\"//host/computer\", \"/dir\")" @@ -727,7 +729,7 @@ msgstr "" ">>> splitdrive(\"//host/computer/dir\")\n" "(\"//host/computer\", \"/dir\")" -#: ../../library/os.path.rst:557 +#: ../../library/os.path.rst:558 msgid "" "Split the pathname *path* into a 3-item tuple ``(drive, root, tail)`` where " "*drive* is a device name or mount point, *root* is a string of separators " @@ -740,7 +742,7 @@ msgstr "" "這些項目中的任何一個都可能是空字串。在所有情況下,``drive + root + tail`` 將" "與 *path* 相同。" -#: ../../library/os.path.rst:563 +#: ../../library/os.path.rst:564 msgid "" "On POSIX systems, *drive* is always empty. The *root* may be empty (if " "*path* is relative), a single forward slash (if *path* is absolute), or two " @@ -754,7 +756,7 @@ msgstr "" "onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>`_ 的實作定義)。例" "如: ::" -#: ../../library/os.path.rst:569 +#: ../../library/os.path.rst:570 msgid "" ">>> splitroot('/home/sam')\n" "('', '/', 'home/sam')\n" @@ -770,7 +772,7 @@ msgstr "" ">>> splitroot('///home/sam')\n" "('', '/', '//home/sam')" -#: ../../library/os.path.rst:576 +#: ../../library/os.path.rst:577 msgid "" "On Windows, *drive* may be empty, a drive-letter name, a UNC share, or a " "device name. The *root* may be empty, a forward slash, or a backward slash. " @@ -779,7 +781,7 @@ msgstr "" "在 Windows 上,*drive* 可能為空、驅動機名稱、UNC 共享或設備名稱。*root* 可能" "為空,斜線或反斜線。例如: ::" -#: ../../library/os.path.rst:580 +#: ../../library/os.path.rst:581 msgid "" ">>> splitroot('C:/Users/Sam')\n" "('C:', '/', 'Users/Sam')\n" @@ -791,7 +793,7 @@ msgstr "" ">>> splitroot('//Server/Share/Users/Sam')\n" "('//Server/Share', '/', 'Users/Sam')" -#: ../../library/os.path.rst:590 +#: ../../library/os.path.rst:591 msgid "" "Split the pathname *path* into a pair ``(root, ext)`` such that ``root + " "ext == path``, and the extension, *ext*, is empty or begins with a period " @@ -800,11 +802,11 @@ msgstr "" "將路徑名 *path* 拆分為一對 ``(root, ext)``,使得 ``root + ext == path``,且副" "檔名 *ext* 為空或以點開頭且最多包含一個點 (period)。" -#: ../../library/os.path.rst:594 +#: ../../library/os.path.rst:595 msgid "If the path contains no extension, *ext* will be ``''``::" msgstr "如果路徑不包含副檔名,則 *ext* 將為 ``''``: ::" -#: ../../library/os.path.rst:596 +#: ../../library/os.path.rst:597 msgid "" ">>> splitext('bar')\n" "('bar', '')" @@ -812,7 +814,7 @@ msgstr "" ">>> splitext('bar')\n" "('bar', '')" -#: ../../library/os.path.rst:599 +#: ../../library/os.path.rst:600 msgid "" "If the path contains an extension, then *ext* will be set to this extension, " "including the leading period. Note that previous periods will be ignored::" @@ -820,7 +822,7 @@ msgstr "" "如果路徑包含副檔名,則 *ext* 將設置為該副檔名,包括前導的點。請注意,前面的點" "將被忽略: ::" -#: ../../library/os.path.rst:602 +#: ../../library/os.path.rst:603 msgid "" ">>> splitext('foo.bar.exe')\n" "('foo.bar', '.exe')\n" @@ -832,13 +834,13 @@ msgstr "" ">>> splitext('/foo/bar.exe')\n" "('/foo/bar', '.exe')" -#: ../../library/os.path.rst:607 +#: ../../library/os.path.rst:608 msgid "" "Leading periods of the last component of the path are considered to be part " "of the root::" msgstr "路徑的最後一個部份的前導點被認為是根的一部分: ::" -#: ../../library/os.path.rst:610 +#: ../../library/os.path.rst:611 msgid "" ">>> splitext('.cshrc')\n" "('.cshrc', '')\n" @@ -850,7 +852,7 @@ msgstr "" ">>> splitext('/foo/....jpg')\n" "('/foo/....jpg', '')" -#: ../../library/os.path.rst:621 +#: ../../library/os.path.rst:622 msgid "" "``True`` if arbitrary Unicode strings can be used as file names (within " "limitations imposed by the file system)." diff --git a/library/platform.po b/library/platform.po index 8abe17dd5e..f411588e97 100644 --- a/library/platform.po +++ b/library/platform.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-04 00:16+0000\n" +"POT-Creation-Date: 2025-07-13 00:18+0000\n" "PO-Revision-Date: 2022-06-11 14:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -88,8 +88,8 @@ msgid "" "To get at the \"64-bitness\" of the current interpreter, it is more reliable " "to query the :data:`sys.maxsize` attribute::" msgstr "" -"要取得目前直譯器的 \"64 位元性 (64-bitness)\",更可靠的做法是查" -"詢 :data:`sys.maxsize` 屬性: ::" +"要取得目前直譯器的 \"64 位元性 (64-bitness)\",更可靠的做法是查詢 :data:`sys." +"maxsize` 屬性: ::" #: ../../library/platform.rst:51 msgid "is_64bits = sys.maxsize > 2**32" @@ -264,13 +264,12 @@ msgstr "" #: ../../library/platform.rst:172 msgid "" "Fairly portable uname interface. Returns a :func:`~collections.namedtuple` " -"containing six " -"attributes: :attr:`system`, :attr:`node`, :attr:`release`, :attr:`version`, :attr:`machine`, " -"and :attr:`processor`." +"containing six attributes: :attr:`system`, :attr:`node`, :attr:`release`, :" +"attr:`version`, :attr:`machine`, and :attr:`processor`." msgstr "" -"具有高可攜性 (portable) 的 uname 介面。回傳包含六個屬性" -"的 :func:`~collections.namedtuple`::attr:`system`、:attr:`node`、:attr:`release`、:attr:`version`、:attr:`machine` " -"和 :attr:`processor`。" +"具有高可攜性 (portable) 的 uname 介面。回傳包含六個屬性的 :func:" +"`~collections.namedtuple`::attr:`system`、:attr:`node`、:attr:`release`、:" +"attr:`version`、:attr:`machine` 和 :attr:`processor`。" #: ../../library/platform.rst:176 msgid ":attr:`processor` is resolved late, on demand." @@ -278,12 +277,11 @@ msgstr ":attr:`processor` 會延遲解析,有需求時才會解析" #: ../../library/platform.rst:178 msgid "" -"Note: the first two attribute names differ from the names presented " -"by :func:`os.uname`, where they are named :attr:`sysname` " -"and :attr:`nodename`." +"Note: the first two attribute names differ from the names presented by :func:" +"`os.uname`, where they are named :attr:`!sysname` and :attr:`!nodename`." msgstr "" -"注意:前兩個屬性名稱與 :func:`os.uname` 提供的名稱不同,它們分別命名" -"為 :attr:`sysname` 和 :attr:`nodename`。" +"注意:前兩個屬性名稱與 :func:`os.uname` 提供的名稱不同,它們分別命名為 :attr:" +"`!sysname` 和 :attr:`!nodename`。" #: ../../library/platform.rst:182 msgid "Entries which cannot be determined are set to ``''``." @@ -344,8 +342,8 @@ msgid "" "As a hint: *ptype* is ``'Uniprocessor Free'`` on single processor NT " "machines and ``'Multiprocessor Free'`` on multi processor machines. The " "``'Free'`` refers to the OS version being free of debugging code. It could " -"also state ``'Checked'`` which means the OS version uses debugging code, " -"i.e. code that checks arguments, ranges, etc." +"also state ``'Checked'`` which means the OS version uses debugging code, i." +"e. code that checks arguments, ranges, etc." msgstr "" "一點提示:*ptype* 在單個處理器的 NT 機器上為 ``'Uniprocessor Free'``,而在多" "個處理器的機器上為 ``'Multiprocessor Free'``。``'Free'`` 是指該 OS 版本沒有除" @@ -396,8 +394,8 @@ msgstr "iOS 平台" #: ../../library/platform.rst:260 msgid "" -"Get iOS version information and return it as " -"a :func:`~collections.namedtuple` with the following attributes:" +"Get iOS version information and return it as a :func:`~collections." +"namedtuple` with the following attributes:" msgstr "" #: ../../library/platform.rst:263 @@ -475,8 +473,8 @@ msgid "" "Raises :exc:`OSError` or subclass when neither ``/etc/os-release`` nor ``/" "usr/lib/os-release`` can be read." msgstr "" -"當 ``/etc/os-release`` 與 ``/usr/lib/os-release`` 均無法被讀取時將引" -"發 :exc:`OSError` 或其子類別。" +"當 ``/etc/os-release`` 與 ``/usr/lib/os-release`` 均無法被讀取時將引發 :exc:" +"`OSError` 或其子類別。" #: ../../library/platform.rst:304 msgid "" @@ -535,8 +533,8 @@ msgstr "" #: ../../library/platform.rst:340 msgid "" "``api_level`` - API level of the running device, as an integer (e.g. ``34`` " -"for Android 14). To get the API level which Python was built against, " -"see :func:`sys.getandroidapilevel`." +"for Android 14). To get the API level which Python was built against, see :" +"func:`sys.getandroidapilevel`." msgstr "" #: ../../library/platform.rst:344 @@ -565,8 +563,8 @@ msgstr "" #: ../../library/platform.rst:358 msgid "" -"Google maintains a `list of known model and device names `__." +"Google maintains a `list of known model and device names `__." msgstr "" #: ../../library/platform.rst:366 @@ -589,8 +587,8 @@ msgstr "可接受以下選項:" #: ../../library/platform.rst:379 msgid "" -"Print terse information about the platform. This is equivalent to " -"calling :func:`platform.platform` with the *terse* argument set to ``True``." +"Print terse information about the platform. This is equivalent to calling :" +"func:`platform.platform` with the *terse* argument set to ``True``." msgstr "" #: ../../library/platform.rst:384 diff --git a/library/sqlite3.po b/library/sqlite3.po index 3e0270c411..3c5ccfd31d 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-03-19 00:14+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,8 +38,8 @@ msgstr "" #: ../../library/sqlite3.rst:32 msgid "" "The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an " -"SQL interface compliant with the DB-API 2.0 specification described " -"by :pep:`249`, and requires SQLite 3.15.2 or newer." +"SQL interface compliant with the DB-API 2.0 specification described by :pep:" +"`249`, and requires SQLite 3.15.2 or newer." msgstr "" #: ../../library/sqlite3.rst:36 @@ -128,8 +128,8 @@ msgstr "" #: ../../library/sqlite3.rst:89 msgid "" "In order to execute SQL statements and fetch results from SQL queries, we " -"will need to use a database cursor. Call :meth:`con.cursor() " -"` to create the :class:`Cursor`:" +"will need to use a database cursor. Call :meth:`con.cursor() ` to create the :class:`Cursor`:" msgstr "" #: ../../library/sqlite3.rst:93 @@ -142,8 +142,8 @@ msgid "" "database table ``movie`` with columns for title, release year, and review " "score. For simplicity, we can just use column names in the table declaration " "-- thanks to the `flexible typing`_ feature of SQLite, specifying the data " -"types is optional. Execute the ``CREATE TABLE`` statement by " -"calling :meth:`cur.execute(...) `:" +"types is optional. Execute the ``CREATE TABLE`` statement by calling :meth:" +"`cur.execute(...) `:" msgstr "" #: ../../library/sqlite3.rst:106 @@ -155,9 +155,9 @@ msgid "" "We can verify that the new table has been created by querying the " "``sqlite_master`` table built-in to SQLite, which should now contain an " "entry for the ``movie`` table definition (see `The Schema Table`_ for " -"details). Execute that query by calling :meth:`cur.execute(...) " -"`, assign the result to ``res``, and " -"call :meth:`res.fetchone() ` to fetch the resulting row:" +"details). Execute that query by calling :meth:`cur.execute(...) `, assign the result to ``res``, and call :meth:`res.fetchone() " +"` to fetch the resulting row:" msgstr "" #: ../../library/sqlite3.rst:121 @@ -172,10 +172,9 @@ msgstr "" #: ../../library/sqlite3.rst:127 msgid "" -"We can see that the table has been created, as the query returns " -"a :class:`tuple` containing the table's name. If we query ``sqlite_master`` " -"for a non-existent table ``spam``, :meth:`!res.fetchone` will return " -"``None``:" +"We can see that the table has been created, as the query returns a :class:" +"`tuple` containing the table's name. If we query ``sqlite_master`` for a non-" +"existent table ``spam``, :meth:`!res.fetchone` will return ``None``:" msgstr "" #: ../../library/sqlite3.rst:132 @@ -191,8 +190,8 @@ msgstr "" #: ../../library/sqlite3.rst:138 msgid "" "Now, add two rows of data supplied as SQL literals by executing an " -"``INSERT`` statement, once again by calling :meth:`cur.execute(...) " -"`:" +"``INSERT`` statement, once again by calling :meth:`cur.execute(...) `:" msgstr "" #: ../../library/sqlite3.rst:142 @@ -213,8 +212,8 @@ msgstr "" msgid "" "The ``INSERT`` statement implicitly opens a transaction, which needs to be " "committed before changes are saved in the database (see :ref:`sqlite3-" -"controlling-transactions` for details). Call :meth:`con.commit() " -"` on the connection object to commit the transaction:" +"controlling-transactions` for details). Call :meth:`con.commit() ` on the connection object to commit the transaction:" msgstr "" #: ../../library/sqlite3.rst:156 @@ -225,8 +224,8 @@ msgstr "con.commit()" msgid "" "We can verify that the data was inserted correctly by executing a ``SELECT`` " "query. Use the now-familiar :meth:`cur.execute(...) ` to " -"assign the result to ``res``, and call :meth:`res.fetchall() " -"` to return all resulting rows:" +"assign the result to ``res``, and call :meth:`res.fetchall() ` to return all resulting rows:" msgstr "" #: ../../library/sqlite3.rst:166 @@ -247,8 +246,8 @@ msgstr "" #: ../../library/sqlite3.rst:175 msgid "" -"Now, insert three more rows by calling :meth:`cur.executemany(...) " -"`:" +"Now, insert three more rows by calling :meth:`cur.executemany(...) `:" msgstr "" #: ../../library/sqlite3.rst:178 @@ -304,10 +303,9 @@ msgstr "" #: ../../library/sqlite3.rst:211 msgid "" -"Finally, verify that the database has been written to disk by " -"calling :meth:`con.close() ` to close the existing " -"connection, opening a new one, creating a new cursor, then querying the " -"database:" +"Finally, verify that the database has been written to disk by calling :meth:" +"`con.close() ` to close the existing connection, opening a " +"new one, creating a new cursor, then querying the database:" msgstr "" #: ../../library/sqlite3.rst:216 @@ -396,9 +394,9 @@ msgstr "" #: ../../library/sqlite3.rst:277 msgid "" -"How many seconds the connection should wait before raising " -"an :exc:`OperationalError` when a table is locked. If another connection " -"opens a transaction to modify a table, that table will be locked until the " +"How many seconds the connection should wait before raising an :exc:" +"`OperationalError` when a table is locked. If another connection opens a " +"transaction to modify a table, that table will be locked until the " "transaction is committed. Default five seconds." msgstr "" @@ -407,20 +405,19 @@ msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " "converters registered with :func:`register_converter`. Set it to any " -"combination (using ``|``, bitwise or) of :const:`PARSE_DECLTYPES` " -"and :const:`PARSE_COLNAMES` to enable this. Column names takes precedence " -"over declared types if both flags are set. By default (``0``), type " -"detection is disabled." +"combination (using ``|``, bitwise or) of :const:`PARSE_DECLTYPES` and :const:" +"`PARSE_COLNAMES` to enable this. Column names takes precedence over declared " +"types if both flags are set. By default (``0``), type detection is disabled." msgstr "" #: ../../library/sqlite3.rst:295 msgid "" -"Control legacy transaction handling behaviour. " -"See :attr:`Connection.isolation_level` and :ref:`sqlite3-transaction-control-" -"isolation-level` for more information. Can be ``\"DEFERRED\"`` (default), " -"``\"EXCLUSIVE\"`` or ``\"IMMEDIATE\"``; or ``None`` to disable opening " -"transactions implicitly. Has no effect unless :attr:`Connection.autocommit` " -"is set to :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default)." +"Control legacy transaction handling behaviour. See :attr:`Connection." +"isolation_level` and :ref:`sqlite3-transaction-control-isolation-level` for " +"more information. Can be ``\"DEFERRED\"`` (default), ``\"EXCLUSIVE\"`` or " +"``\"IMMEDIATE\"``; or ``None`` to disable opening transactions implicitly. " +"Has no effect unless :attr:`Connection.autocommit` is set to :const:" +"`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default)." msgstr "" #: ../../library/sqlite3.rst:305 @@ -455,11 +452,11 @@ msgstr "" #: ../../library/sqlite3.rst:332 msgid "" -"Control :pep:`249` transaction handling behaviour. " -"See :attr:`Connection.autocommit` and :ref:`sqlite3-transaction-control-" -"autocommit` for more information. *autocommit* currently defaults " -"to :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL`. The default will change to " -"``False`` in a future Python release." +"Control :pep:`249` transaction handling behaviour. See :attr:`Connection." +"autocommit` and :ref:`sqlite3-transaction-control-autocommit` for more " +"information. *autocommit* currently defaults to :const:`~sqlite3." +"LEGACY_TRANSACTION_CONTROL`. The default will change to ``False`` in a " +"future Python release." msgstr "" #: ../../library/sqlite3.rst:0 @@ -471,8 +468,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -"引發一個附帶引數 ``database`` 的\\ :ref:`稽核事件 ` " -"``sqlite3.connect``。" +"引發一個附帶引數 ``database`` 的\\ :ref:`稽核事件 ` ``sqlite3." +"connect``。" #: ../../library/sqlite3.rst:344 msgid "" @@ -620,8 +617,8 @@ msgstr "" #: ../../library/sqlite3.rst:459 msgid "" -"Generated fields (for example ``MAX(p)``) are returned as :class:`str`. " -"Use :const:`!PARSE_COLNAMES` to enforce types for such queries." +"Generated fields (for example ``MAX(p)``) are returned as :class:`str`. Use :" +"const:`!PARSE_COLNAMES` to enforce types for such queries." msgstr "" #: ../../library/sqlite3.rst:464 @@ -688,8 +685,8 @@ msgstr "" #: ../../library/sqlite3.rst:510 msgid "" -"Version number of the runtime SQLite library as a :class:`tuple` " -"of :class:`integers `." +"Version number of the runtime SQLite library as a :class:`tuple` of :class:" +"`integers `." msgstr "" #: ../../library/sqlite3.rst:515 @@ -806,8 +803,8 @@ msgstr "" #: ../../library/sqlite3.rst:589 msgid "" -"These constants are used for the :meth:`Connection.setconfig` " -"and :meth:`~Connection.getconfig` methods." +"These constants are used for the :meth:`Connection.setconfig` and :meth:" +"`~Connection.getconfig` methods." msgstr "" #: ../../library/sqlite3.rst:592 @@ -831,9 +828,8 @@ msgstr "Connection 物件" #: ../../library/sqlite3.rst:610 msgid "" "Each open SQLite database is represented by a ``Connection`` object, which " -"is created using :func:`sqlite3.connect`. Their main purpose is " -"creating :class:`Cursor` objects, and :ref:`sqlite3-controlling-" -"transactions`." +"is created using :func:`sqlite3.connect`. Their main purpose is creating :" +"class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." msgstr "" #: ../../library/sqlite3.rst:617 @@ -842,8 +838,8 @@ msgstr ":ref:`sqlite3-connection-shortcuts`" #: ../../library/sqlite3.rst:623 msgid "" -"A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before " -"a :class:`!Connection` object is deleted." +"A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before a :" +"class:`!Connection` object is deleted." msgstr "" #: ../../library/sqlite3.rst:626 @@ -853,9 +849,8 @@ msgstr "一個 SQLite 資料庫連線具有以下屬性和方法:" #: ../../library/sqlite3.rst:630 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " -"single optional parameter *factory*. If supplied, this must be " -"a :term:`callable` returning an instance of :class:`Cursor` or its " -"subclasses." +"single optional parameter *factory*. If supplied, this must be a :term:" +"`callable` returning an instance of :class:`Cursor` or its subclasses." msgstr "" #: ../../library/sqlite3.rst:637 @@ -904,17 +899,17 @@ msgstr "" #: ../../library/sqlite3.rst:672 msgid "" "Commit any pending transaction to the database. If :attr:`autocommit` is " -"``True``, or there is no open transaction, this method does nothing. " -"If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened " -"if a pending transaction was committed by this method." +"``True``, or there is no open transaction, this method does nothing. If :" +"attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a " +"pending transaction was committed by this method." msgstr "" #: ../../library/sqlite3.rst:680 msgid "" "Roll back to the start of any pending transaction. If :attr:`autocommit` is " -"``True``, or there is no open transaction, this method does nothing. " -"If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened " -"if a pending transaction was rolled back by this method." +"``True``, or there is no open transaction, this method does nothing. If :" +"attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a " +"pending transaction was rolled back by this method." msgstr "" #: ../../library/sqlite3.rst:688 @@ -1285,17 +1280,17 @@ msgstr "" #: ../../library/sqlite3.rst:953 msgid "" "Call this method from a different thread to abort any queries that might be " -"executing on the connection. Aborted queries will raise " -"an :exc:`OperationalError`." +"executing on the connection. Aborted queries will raise an :exc:" +"`OperationalError`." msgstr "" #: ../../library/sqlite3.rst:960 msgid "" "Register :term:`callable` *authorizer_callback* to be invoked for each " "attempt to access a column of a table in the database. The callback should " -"return one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, " -"or :const:`SQLITE_IGNORE` to signal how access to the column should be " -"handled by the underlying SQLite library." +"return one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:" +"`SQLITE_IGNORE` to signal how access to the column should be handled by the " +"underlying SQLite library." msgstr "" #: ../../library/sqlite3.rst:967 @@ -1367,11 +1362,10 @@ msgstr "" msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " -"that the backend does not only run statements passed to " -"the :meth:`Cursor.execute` methods. Other sources include " -"the :ref:`transaction management ` of " -"the :mod:`!sqlite3` module and the execution of triggers defined in the " -"current database." +"that the backend does not only run statements passed to the :meth:`Cursor." +"execute` methods. Other sources include the :ref:`transaction management " +"` of the :mod:`!sqlite3` module and the " +"execution of triggers defined in the current database." msgstr "" #: ../../library/sqlite3.rst:1020 @@ -1405,8 +1399,8 @@ msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " "are compiled without this feature. To get loadable extension support, you " -"must pass the :option:`--enable-loadable-sqlite-extensions` option " -"to :program:`configure`." +"must pass the :option:`--enable-loadable-sqlite-extensions` option to :" +"program:`configure`." msgstr "" #: ../../library/sqlite3.rst:1053 @@ -1487,8 +1481,8 @@ msgstr "新增 *entrypoint* 參數。" #: ../../library/sqlite3.rst:1120 msgid "" "Return an :term:`iterator` to dump the database as SQL source code. Useful " -"when saving an in-memory database for later restoration. Similar to the " -"``.dump`` command in the :program:`sqlite3` shell." +"when saving an in-memory database for later restoration. Similar to the ``." +"dump`` command in the :program:`sqlite3` shell." msgstr "" #: ../../library/sqlite3.rst:1124 @@ -1615,8 +1609,8 @@ msgstr "" #: ../../library/sqlite3.rst:1232 msgid "" -"Example, query the maximum length of an SQL statement " -"for :class:`Connection` ``con`` (the default is 1000000000):" +"Example, query the maximum length of an SQL statement for :class:" +"`Connection` ``con`` (the default is 1000000000):" msgstr "" #: ../../library/sqlite3.rst:1242 @@ -1701,10 +1695,10 @@ msgstr "" #: ../../library/sqlite3.rst:1336 msgid "" -"Deserialize a :meth:`serialized ` database into " -"a :class:`Connection`. This method causes the database connection to " -"disconnect from database *name*, and reopen *name* as an in-memory database " -"based on the serialization contained in *data*." +"Deserialize a :meth:`serialized ` database into a :class:" +"`Connection`. This method causes the database connection to disconnect from " +"database *name*, and reopen *name* as an in-memory database based on the " +"serialization contained in *data*." msgstr "" #: ../../library/sqlite3.rst:1342 @@ -1743,9 +1737,9 @@ msgstr "" #: ../../library/sqlite3.rst:1371 msgid "" -"``False``: Select :pep:`249`-compliant transaction behaviour, implying " -"that :mod:`!sqlite3` ensures a transaction is always open. " -"Use :meth:`commit` and :meth:`rollback` to close transactions." +"``False``: Select :pep:`249`-compliant transaction behaviour, implying that :" +"mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :" +"meth:`rollback` to close transactions." msgstr "" #: ../../library/sqlite3.rst:1375 @@ -1754,8 +1748,8 @@ msgstr "" #: ../../library/sqlite3.rst:1377 msgid "" -"``True``: Use SQLite's `autocommit mode`_. :meth:`commit` " -"and :meth:`rollback` have no effect in this mode." +"``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:" +"`rollback` have no effect in this mode." msgstr "" #: ../../library/sqlite3.rst:1380 @@ -1780,8 +1774,8 @@ msgstr "更多詳情請見 :ref:`sqlite3-transaction-control-autocommit`。" #: ../../library/sqlite3.rst:1393 msgid "" -"The :attr:`isolation_level` attribute has no effect " -"unless :attr:`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." +"The :attr:`isolation_level` attribute has no effect unless :attr:" +"`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." msgstr "" #: ../../library/sqlite3.rst:1400 @@ -1823,10 +1817,10 @@ msgstr "" #: ../../library/sqlite3.rst:1430 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " -"from this connection. Assigning to this attribute does not affect " -"the :attr:`!row_factory` of existing cursors belonging to this connection, " -"only new ones. Is ``None`` by default, meaning each row is returned as " -"a :class:`tuple`." +"from this connection. Assigning to this attribute does not affect the :attr:" +"`!row_factory` of existing cursors belonging to this connection, only new " +"ones. Is ``None`` by default, meaning each row is returned as a :class:" +"`tuple`." msgstr "" #: ../../library/sqlite3.rst:1437 ../../library/sqlite3.rst:1723 @@ -1859,15 +1853,15 @@ msgstr "Cursor 物件" msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " -"created using :meth:`Connection.cursor`, or by using any of " -"the :ref:`connection shortcut methods `." +"created using :meth:`Connection.cursor`, or by using any of the :ref:" +"`connection shortcut methods `." msgstr "" #: ../../library/sqlite3.rst:1466 msgid "" -"Cursor objects are :term:`iterators `, meaning that if " -"you :meth:`~Cursor.execute` a ``SELECT`` query, you can simply iterate over " -"the cursor to fetch the resulting rows:" +"Cursor objects are :term:`iterators `, meaning that if you :meth:" +"`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " +"to fetch the resulting rows:" msgstr "" #: ../../library/sqlite3.rst:1477 @@ -1884,8 +1878,8 @@ msgstr ":class:`Cursor` 實例具有以下屬性和方法。" #: ../../library/sqlite3.rst:1498 msgid "" -"Execute a single SQL statement, optionally binding Python values " -"using :ref:`placeholders `." +"Execute a single SQL statement, optionally binding Python values using :ref:" +"`placeholders `." msgstr "" #: ../../library/sqlite3.rst:1502 @@ -1905,19 +1899,18 @@ msgstr "" #: ../../library/sqlite3.rst:1515 msgid "" -"If :attr:`~Connection.autocommit` " -"is :data:`LEGACY_TRANSACTION_CONTROL`, :attr:`~Connection.isolation_level` " -"is not ``None``, *sql* is an ``INSERT``, ``UPDATE``, ``DELETE``, or " -"``REPLACE`` statement, and there is no open transaction, a transaction is " -"implicitly opened before executing *sql*." +"If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :" +"attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, " +"``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is no open " +"transaction, a transaction is implicitly opened before executing *sql*." msgstr "" #: ../../library/sqlite3.rst:1524 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of " -"a :class:`dict`. Starting with Python 3.14, :exc:`ProgrammingError` will be " -"raised instead." +"placeholders>` are used and *parameters* is a sequence instead of a :class:" +"`dict`. Starting with Python 3.14, :exc:`ProgrammingError` will be raised " +"instead." msgstr "" #: ../../library/sqlite3.rst:1530 @@ -1982,16 +1975,16 @@ msgstr "" #: ../../library/sqlite3.rst:1586 msgid "" -"Execute the SQL statements in *sql_script*. If " -"the :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and " -"there is a pending transaction, an implicit ``COMMIT`` statement is executed " -"first. No other implicit transaction control is performed; any transaction " -"control must be added to *sql_script*." +"Execute the SQL statements in *sql_script*. If the :attr:`~Connection." +"autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending " +"transaction, an implicit ``COMMIT`` statement is executed first. No other " +"implicit transaction control is performed; any transaction control must be " +"added to *sql_script*." msgstr "" #: ../../library/sqlite3.rst:1594 msgid "*sql_script* must be a :class:`string `." -msgstr "" +msgstr "*sql_script* 必須是一個 :class:`string `。" #: ../../library/sqlite3.rst:1598 msgid "" @@ -2055,9 +2048,9 @@ msgstr "" #: ../../library/sqlite3.rst:1644 msgid "" -"The cursor will be unusable from this point forward; " -"a :exc:`ProgrammingError` exception will be raised if any operation is " -"attempted with the cursor." +"The cursor will be unusable from this point forward; a :exc:" +"`ProgrammingError` exception will be raised if any operation is attempted " +"with the cursor." msgstr "" #: ../../library/sqlite3.rst:1649 ../../library/sqlite3.rst:1653 @@ -2066,17 +2059,17 @@ msgstr "" #: ../../library/sqlite3.rst:1657 msgid "" -"Read/write attribute that controls the number of rows returned " -"by :meth:`fetchmany`. The default value is 1 which means a single row would " -"be fetched per call." +"Read/write attribute that controls the number of rows returned by :meth:" +"`fetchmany`. The default value is 1 which means a single row would be " +"fetched per call." msgstr "" #: ../../library/sqlite3.rst:1662 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " -"belonging to the cursor. A :class:`Cursor` object created by " -"calling :meth:`con.cursor() ` will have " -"a :attr:`connection` attribute that refers to *con*:" +"belonging to the cursor. A :class:`Cursor` object created by calling :meth:" +"`con.cursor() ` will have a :attr:`connection` attribute " +"that refers to *con*:" msgstr "" #: ../../library/sqlite3.rst:1667 @@ -2144,8 +2137,8 @@ msgstr "" #: ../../library/sqlite3.rst:1718 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" -"Cursor` was created. Assigning to this attribute does not " -"affect :attr:`Connection.row_factory` of the parent connection." +"Cursor` was created. Assigning to this attribute does not affect :attr:" +"`Connection.row_factory` of the parent connection." msgstr "" #: ../../library/sqlite3.rst:1734 @@ -2154,10 +2147,10 @@ msgstr "Row 物件" #: ../../library/sqlite3.rst:1738 msgid "" -"A :class:`!Row` instance serves as a highly " -"optimized :attr:`~Connection.row_factory` for :class:`Connection` objects. " -"It supports iteration, equality testing, :func:`len`, and :term:`mapping` " -"access by column name and index." +"A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." +"row_factory` for :class:`Connection` objects. It supports iteration, " +"equality testing, :func:`len`, and :term:`mapping` access by column name and " +"index." msgstr "" #: ../../library/sqlite3.rst:1743 @@ -2169,8 +2162,8 @@ msgstr "" #: ../../library/sqlite3.rst:1750 msgid "" "Return a :class:`list` of column names as :class:`strings `. " -"Immediately after a query, it is the first member of each tuple " -"in :attr:`Cursor.description`." +"Immediately after a query, it is the first member of each tuple in :attr:" +"`Cursor.description`." msgstr "" #: ../../library/sqlite3.rst:1754 @@ -2184,9 +2177,9 @@ msgstr "Blob 物件" #: ../../library/sqlite3.rst:1767 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " -"write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. " -"Call :func:`len(blob) ` to get the size (number of bytes) of the blob. " -"Use indices and :term:`slices ` for direct access to the blob data." +"write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" +"`len(blob) ` to get the size (number of bytes) of the blob. Use indices " +"and :term:`slices ` for direct access to the blob data." msgstr "" #: ../../library/sqlite3.rst:1772 @@ -2223,24 +2216,24 @@ msgstr "" #: ../../library/sqlite3.rst:1805 msgid "" -"The blob will be unusable from this point onward. " -"An :class:`~sqlite3.Error` (or subclass) exception will be raised if any " -"further operation is attempted with the blob." +"The blob will be unusable from this point onward. An :class:`~sqlite3." +"Error` (or subclass) exception will be raised if any further operation is " +"attempted with the blob." msgstr "" #: ../../library/sqlite3.rst:1811 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " -"will be returned. When *length* is not specified, or is " -"negative, :meth:`~Blob.read` will read until the end of the blob." +"will be returned. When *length* is not specified, or is negative, :meth:" +"`~Blob.read` will read until the end of the blob." msgstr "" #: ../../library/sqlite3.rst:1819 msgid "" "Write *data* to the blob at the current offset. This function cannot change " -"the blob length. Writing beyond the end of the blob will " -"raise :exc:`ValueError`." +"the blob length. Writing beyond the end of the blob will raise :exc:" +"`ValueError`." msgstr "" #: ../../library/sqlite3.rst:1825 @@ -2297,8 +2290,8 @@ msgstr "" #: ../../library/sqlite3.rst:1871 msgid "" -"The numeric error code from the `SQLite API `_" +"The numeric error code from the `SQLite API `_" msgstr "" #: ../../library/sqlite3.rst:1878 @@ -2354,8 +2347,8 @@ msgstr "" msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " -"closed :class:`Connection`. ``ProgrammingError`` is a subclass " -"of :exc:`DatabaseError`." +"closed :class:`Connection`. ``ProgrammingError`` is a subclass of :exc:" +"`DatabaseError`." msgstr "" #: ../../library/sqlite3.rst:1932 @@ -2476,8 +2469,8 @@ msgstr "" #: ../../library/sqlite3.rst:2005 msgid "" -"A converter for :ref:`declared ` \"date\" types " -"to :class:`datetime.date` objects." +"A converter for :ref:`declared ` \"date\" types to :" +"class:`datetime.date` objects." msgstr "" #: ../../library/sqlite3.rst:2007 @@ -2763,8 +2756,8 @@ msgstr "" #: ../../library/sqlite3.rst:2238 msgid "" -"Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | " -"sqlite3.PARSE_COLNAMES``. Column names take precedence over declared types." +"Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." +"PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" #: ../../library/sqlite3.rst:2242 @@ -2832,7 +2825,7 @@ msgid "" "\n" "def adapt_datetime_iso(val):\n" " \"\"\"Adapt datetime.datetime to timezone-naive ISO 8601 date.\"\"\"\n" -" return val.isoformat()\n" +" return val.replace(tzinfo=None).isoformat()\n" "\n" "def adapt_datetime_epoch(val):\n" " \"\"\"Adapt datetime.datetime to Unix timestamp.\"\"\"\n" @@ -2865,14 +2858,14 @@ msgstr "" #: ../../library/sqlite3.rst:2361 msgid "" -"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, " -"and :meth:`~Connection.executescript` methods of the :class:`Connection` " -"class, your code can be written more concisely because you don't have to " -"create the (often superfluous) :class:`Cursor` objects explicitly. Instead, " -"the :class:`Cursor` objects are created implicitly and these shortcut " -"methods return the cursor objects. This way, you can execute a ``SELECT`` " -"statement and iterate over it directly using only a single call on " -"the :class:`Connection` object." +"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" +"meth:`~Connection.executescript` methods of the :class:`Connection` class, " +"your code can be written more concisely because you don't have to create the " +"(often superfluous) :class:`Cursor` objects explicitly. Instead, the :class:" +"`Cursor` objects are created implicitly and these shortcut methods return " +"the cursor objects. This way, you can execute a ``SELECT`` statement and " +"iterate over it directly using only a single call on the :class:`Connection` " +"object." msgstr "" #: ../../library/sqlite3.rst:2370 @@ -2925,15 +2918,15 @@ msgstr "" #: ../../library/sqlite3.rst:2420 msgid "" "The context manager neither implicitly opens a new transaction nor closes " -"the connection. If you need a closing context manager, consider " -"using :meth:`contextlib.closing`." +"the connection. If you need a closing context manager, consider using :meth:" +"`contextlib.closing`." msgstr "" #: ../../library/sqlite3.rst:2424 msgid "" "con = sqlite3.connect(\":memory:\")\n" -"con.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)" -"\")\n" +"con.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR " +"UNIQUE)\")\n" "\n" "# Successful, con.commit() is called automatically afterwards\n" "with con:\n" @@ -2963,7 +2956,7 @@ msgstr "" #: ../../library/sqlite3.rst:2458 msgid "Open a database in read-only mode:" -msgstr "" +msgstr "以唯讀模式開啟資料庫:" #: ../../library/sqlite3.rst:2460 msgid "" @@ -3037,17 +3030,17 @@ msgstr "" #: ../../library/sqlite3.rst:2505 msgid "" -"By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If " -"a :class:`!tuple` does not suit your needs, you can use " -"the :class:`sqlite3.Row` class or a custom :attr:`~Cursor.row_factory`." +"By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" +"class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." +"Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" #: ../../library/sqlite3.rst:2510 msgid "" -"While :attr:`!row_factory` exists as an attribute both on " -"the :class:`Cursor` and the :class:`Connection`, it is recommended to " -"set :class:`Connection.row_factory`, so all cursors created from the " -"connection will use the same row factory." +"While :attr:`!row_factory` exists as an attribute both on the :class:" +"`Cursor` and the :class:`Connection`, it is recommended to set :class:" +"`Connection.row_factory`, so all cursors created from the connection will " +"use the same row factory." msgstr "" #: ../../library/sqlite3.rst:2515 @@ -3182,21 +3175,21 @@ msgstr "" #: ../../library/sqlite3.rst:2595 msgid "" -"With some adjustments, the above recipe can be adapted to use " -"a :class:`~dataclasses.dataclass`, or any other custom class, instead of " -"a :class:`~collections.namedtuple`." +"With some adjustments, the above recipe can be adapted to use a :class:" +"`~dataclasses.dataclass`, or any other custom class, instead of a :class:" +"`~collections.namedtuple`." msgstr "" #: ../../library/sqlite3.rst:2603 msgid "How to handle non-UTF-8 text encodings" -msgstr "" +msgstr "如何處理非 UTF-8 的文字編碼" #: ../../library/sqlite3.rst:2605 msgid "" "By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with " "the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might " -"fail for other encodings and invalid UTF-8. You can use a " -"custom :attr:`~Connection.text_factory` to handle such cases." +"fail for other encodings and invalid UTF-8. You can use a custom :attr:" +"`~Connection.text_factory` to handle such cases." msgstr "" #: ../../library/sqlite3.rst:2611 @@ -3205,9 +3198,9 @@ msgid "" "table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or " "even arbitrary data. To demonstrate, let's assume we have a database with " "ISO-8859-2 (Latin-2) encoded text, for example a table of Czech-English " -"dictionary entries. Assuming we now have a :class:`Connection` " -"instance :py:data:`!con` connected to this database, we can decode the " -"Latin-2 encoded text using this :attr:`~Connection.text_factory`:" +"dictionary entries. Assuming we now have a :class:`Connection` instance :py:" +"data:`!con` connected to this database, we can decode the Latin-2 encoded " +"text using this :attr:`~Connection.text_factory`:" msgstr "" #: ../../library/sqlite3.rst:2620 @@ -3256,9 +3249,9 @@ msgstr "" #: ../../library/sqlite3.rst:2663 msgid "" -"The recommended way of controlling transaction behaviour is through " -"the :attr:`Connection.autocommit` attribute, which should preferably be set " -"using the *autocommit* parameter of :func:`connect`." +"The recommended way of controlling transaction behaviour is through the :" +"attr:`Connection.autocommit` attribute, which should preferably be set using " +"the *autocommit* parameter of :func:`connect`." msgstr "" #: ../../library/sqlite3.rst:2668 @@ -3269,11 +3262,11 @@ msgstr "" #: ../../library/sqlite3.rst:2672 msgid "" -":mod:`!sqlite3` ensures that a transaction is always open, " -"so :func:`connect`, :meth:`Connection.commit`, " -"and :meth:`Connection.rollback` will implicitly open a new transaction " -"(immediately after closing the pending one, for the latter two). :mod:`!" -"sqlite3` uses ``BEGIN DEFERRED`` statements when opening transactions." +":mod:`!sqlite3` ensures that a transaction is always open, so :func:" +"`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " +"implicitly open a new transaction (immediately after closing the pending " +"one, for the latter two). :mod:`!sqlite3` uses ``BEGIN DEFERRED`` statements " +"when opening transactions." msgstr "" #: ../../library/sqlite3.rst:2677 @@ -3286,8 +3279,8 @@ msgstr "" #: ../../library/sqlite3.rst:2679 msgid "" -"An implicit rollback is performed if the database " -"is :meth:`~Connection.close`-ed with pending changes." +"An implicit rollback is performed if the database is :meth:`~Connection." +"close`-ed with pending changes." msgstr "" #: ../../library/sqlite3.rst:2682 @@ -3295,16 +3288,15 @@ msgid "" "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " "mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " "effect. Note that SQLite's autocommit mode is distinct from the :pep:`249`-" -"compliant :attr:`Connection.autocommit` attribute; " -"use :attr:`Connection.in_transaction` to query the low-level SQLite " -"autocommit mode." +"compliant :attr:`Connection.autocommit` attribute; use :attr:`Connection." +"in_transaction` to query the low-level SQLite autocommit mode." msgstr "" #: ../../library/sqlite3.rst:2690 msgid "" "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " -"control behaviour to the :attr:`Connection.isolation_level` attribute. " -"See :ref:`sqlite3-transaction-control-isolation-level` for more information." +"control behaviour to the :attr:`Connection.isolation_level` attribute. See :" +"ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" #: ../../library/sqlite3.rst:2699 @@ -3313,31 +3305,31 @@ msgstr "" #: ../../library/sqlite3.rst:2703 msgid "" -"The recommended way of controlling transactions is via " -"the :attr:`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-" -"control-autocommit`." +"The recommended way of controlling transactions is via the :attr:" +"`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" +"autocommit`." msgstr "" #: ../../library/sqlite3.rst:2707 msgid "" -"If :attr:`Connection.autocommit` is set " -"to :data:`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour " -"is controlled using the :attr:`Connection.isolation_level` attribute. " +"If :attr:`Connection.autocommit` is set to :data:" +"`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " +"controlled using the :attr:`Connection.isolation_level` attribute. " "Otherwise, :attr:`!isolation_level` has no effect." msgstr "" #: ../../library/sqlite3.rst:2713 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " -"``None``, new transactions are implicitly opened " -"before :meth:`~Cursor.execute` and :meth:`~Cursor.executemany` executes " -"``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statements; for other " -"statements, no implicit transaction handling is performed. Use " -"the :meth:`~Connection.commit` and :meth:`~Connection.rollback` methods to " -"respectively commit and roll back pending transactions. You can choose the " -"underlying `SQLite transaction behaviour`_ — that is, whether and what type " -"of ``BEGIN`` statements :mod:`!sqlite3` implicitly executes – via " -"the :attr:`~Connection.isolation_level` attribute." +"``None``, new transactions are implicitly opened before :meth:`~Cursor." +"execute` and :meth:`~Cursor.executemany` executes ``INSERT``, ``UPDATE``, " +"``DELETE``, or ``REPLACE`` statements; for other statements, no implicit " +"transaction handling is performed. Use the :meth:`~Connection.commit` and :" +"meth:`~Connection.rollback` methods to respectively commit and roll back " +"pending transactions. You can choose the underlying `SQLite transaction " +"behaviour`_ — that is, whether and what type of ``BEGIN`` statements :mod:`!" +"sqlite3` implicitly executes – via the :attr:`~Connection.isolation_level` " +"attribute." msgstr "" #: ../../library/sqlite3.rst:2726 @@ -3346,8 +3338,8 @@ msgid "" "are implicitly opened at all. This leaves the underlying SQLite library in " "`autocommit mode`_, but also allows the user to perform their own " "transaction handling using explicit SQL statements. The underlying SQLite " -"library autocommit mode can be queried using " -"the :attr:`~Connection.in_transaction` attribute." +"library autocommit mode can be queried using the :attr:`~Connection." +"in_transaction` attribute." msgstr "" #: ../../library/sqlite3.rst:2734 @@ -3365,8 +3357,8 @@ msgstr "" #: ../../library/sqlite3.rst:2742 msgid "" -"The recommended way of controlling transactions is now via " -"the :attr:`~Connection.autocommit` attribute." +"The recommended way of controlling transactions is now via the :attr:" +"`~Connection.autocommit` attribute." msgstr "" #: ../../library/sqlite3.rst:1493 diff --git a/library/stdtypes.po b/library/stdtypes.po index 0c11bd015b..f8065e1a26 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: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-07-13 07:25+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -135,8 +135,8 @@ msgstr "結果" #: ../../library/stdtypes.rst:86 ../../library/stdtypes.rst:276 #: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:965 -#: ../../library/stdtypes.rst:1173 ../../library/stdtypes.rst:2634 -#: ../../library/stdtypes.rst:3853 +#: ../../library/stdtypes.rst:1173 ../../library/stdtypes.rst:2636 +#: ../../library/stdtypes.rst:3855 msgid "Notes" msgstr "註解" @@ -149,8 +149,8 @@ msgid "if *x* is true, then *x*, else *y*" msgstr "假如 *x* 為真,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:88 ../../library/stdtypes.rst:967 -#: ../../library/stdtypes.rst:970 ../../library/stdtypes.rst:1186 -#: ../../library/stdtypes.rst:2640 ../../library/stdtypes.rst:3859 +#: ../../library/stdtypes.rst:970 ../../library/stdtypes.rst:1188 +#: ../../library/stdtypes.rst:2642 ../../library/stdtypes.rst:3861 msgid "\\(1)" msgstr "\\(1)" @@ -163,9 +163,9 @@ msgid "if *x* is false, then *x*, else *y*" msgstr "假如 *x* 為假,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:91 ../../library/stdtypes.rst:289 -#: ../../library/stdtypes.rst:309 ../../library/stdtypes.rst:1214 -#: ../../library/stdtypes.rst:2644 ../../library/stdtypes.rst:2646 -#: ../../library/stdtypes.rst:3863 ../../library/stdtypes.rst:3865 +#: ../../library/stdtypes.rst:309 ../../library/stdtypes.rst:1216 +#: ../../library/stdtypes.rst:2646 ../../library/stdtypes.rst:2648 +#: ../../library/stdtypes.rst:3865 ../../library/stdtypes.rst:3867 msgid "\\(2)" msgstr "\\(2)" @@ -177,18 +177,18 @@ msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" msgstr "假如 *x* 為假,則 ``True``,否則 ``False``" -#: ../../library/stdtypes.rst:94 ../../library/stdtypes.rst:1217 -#: ../../library/stdtypes.rst:2648 ../../library/stdtypes.rst:2650 -#: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:2654 -#: ../../library/stdtypes.rst:3867 ../../library/stdtypes.rst:3869 -#: ../../library/stdtypes.rst:3871 ../../library/stdtypes.rst:3873 +#: ../../library/stdtypes.rst:94 ../../library/stdtypes.rst:1219 +#: ../../library/stdtypes.rst:2650 ../../library/stdtypes.rst:2652 +#: ../../library/stdtypes.rst:2654 ../../library/stdtypes.rst:2656 +#: ../../library/stdtypes.rst:3869 ../../library/stdtypes.rst:3871 +#: ../../library/stdtypes.rst:3873 ../../library/stdtypes.rst:3875 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:103 ../../library/stdtypes.rst:320 #: ../../library/stdtypes.rst:434 ../../library/stdtypes.rst:1016 -#: ../../library/stdtypes.rst:1226 ../../library/stdtypes.rst:2680 -#: ../../library/stdtypes.rst:3903 +#: ../../library/stdtypes.rst:1228 ../../library/stdtypes.rst:2682 +#: ../../library/stdtypes.rst:3905 msgid "Notes:" msgstr "註解:" @@ -235,9 +235,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "這個表格統整所有比較運算:" -#: ../../library/stdtypes.rst:144 ../../library/stdtypes.rst:2466 -#: ../../library/stdtypes.rst:2611 ../../library/stdtypes.rst:2634 -#: ../../library/stdtypes.rst:3830 ../../library/stdtypes.rst:3853 +#: ../../library/stdtypes.rst:144 ../../library/stdtypes.rst:2468 +#: ../../library/stdtypes.rst:2613 ../../library/stdtypes.rst:2636 +#: ../../library/stdtypes.rst:3832 ../../library/stdtypes.rst:3855 msgid "Meaning" msgstr "含義" @@ -557,8 +557,8 @@ msgid "" "zero." msgstr "一個複數,其實部為 *re*,虛部為 *im*。*im* 預設為零。" -#: ../../library/stdtypes.rst:302 ../../library/stdtypes.rst:1207 -#: ../../library/stdtypes.rst:2642 ../../library/stdtypes.rst:3890 +#: ../../library/stdtypes.rst:302 ../../library/stdtypes.rst:1209 +#: ../../library/stdtypes.rst:2644 ../../library/stdtypes.rst:3892 msgid "\\(6)" msgstr "\\(6)" @@ -595,10 +595,10 @@ msgid "*x* to the power *y*" msgstr "*x* 的 *y* 次方" #: ../../library/stdtypes.rst:311 ../../library/stdtypes.rst:313 -#: ../../library/stdtypes.rst:1196 ../../library/stdtypes.rst:1199 -#: ../../library/stdtypes.rst:2667 ../../library/stdtypes.rst:2670 -#: ../../library/stdtypes.rst:2673 ../../library/stdtypes.rst:3886 -#: ../../library/stdtypes.rst:3893 +#: ../../library/stdtypes.rst:1198 ../../library/stdtypes.rst:1201 +#: ../../library/stdtypes.rst:2669 ../../library/stdtypes.rst:2672 +#: ../../library/stdtypes.rst:2675 ../../library/stdtypes.rst:3888 +#: ../../library/stdtypes.rst:3895 msgid "\\(5)" msgstr "\\(5)" @@ -756,9 +756,9 @@ msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "*x* 及 *y* 的位元 :dfn:`或`" #: ../../library/stdtypes.rst:418 ../../library/stdtypes.rst:421 -#: ../../library/stdtypes.rst:424 ../../library/stdtypes.rst:1221 -#: ../../library/stdtypes.rst:2656 ../../library/stdtypes.rst:2660 -#: ../../library/stdtypes.rst:3875 ../../library/stdtypes.rst:3879 +#: ../../library/stdtypes.rst:424 ../../library/stdtypes.rst:1223 +#: ../../library/stdtypes.rst:2658 ../../library/stdtypes.rst:2662 +#: ../../library/stdtypes.rst:3877 ../../library/stdtypes.rst:3881 msgid "\\(4)" msgstr "\\(4)" @@ -1687,7 +1687,7 @@ msgid "" "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:3861 +#: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:3863 msgid "\\(8)" msgstr "\\(8)" @@ -1941,125 +1941,126 @@ msgid "``del s[i:j]``" msgstr "``del s[i:j]``" #: ../../library/stdtypes.rst:1184 -msgid "same as ``s[i:j] = []``" -msgstr "和 ``s[i:j] = []`` 相同" +msgid "" +"removes the elements of ``s[i:j]`` from the list (same as ``s[i:j] = []``)" +msgstr "移除串列中 ``s[i:j]`` 的元素(和 ``s[i:j] = []`` 相同)" -#: ../../library/stdtypes.rst:1186 +#: ../../library/stdtypes.rst:1188 msgid "``s[i:j:k] = t``" msgstr "``s[i:j:k] = t``" -#: ../../library/stdtypes.rst:1186 +#: ../../library/stdtypes.rst:1188 msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*" msgstr "``s[i:j:k]`` 的元素被 *t* 的元素取代" -#: ../../library/stdtypes.rst:1189 +#: ../../library/stdtypes.rst:1191 msgid "``del s[i:j:k]``" msgstr "``del s[i:j:k]``" -#: ../../library/stdtypes.rst:1189 +#: ../../library/stdtypes.rst:1191 msgid "removes the elements of ``s[i:j:k]`` from the list" msgstr "移除串列中 ``s[i:j:k]`` 的元素" -#: ../../library/stdtypes.rst:1192 +#: ../../library/stdtypes.rst:1194 msgid "``s.append(x)``" msgstr "``s.append(x)``" -#: ../../library/stdtypes.rst:1192 +#: ../../library/stdtypes.rst:1194 msgid "" "appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1196 +#: ../../library/stdtypes.rst:1198 msgid "``s.clear()``" msgstr "``s.clear()``" -#: ../../library/stdtypes.rst:1196 +#: ../../library/stdtypes.rst:1198 msgid "removes all items from *s* (same as ``del s[:]``)" msgstr "移除 *s* 中的所有項目(和 ``del s[:]`` 相同)" -#: ../../library/stdtypes.rst:1199 +#: ../../library/stdtypes.rst:1201 msgid "``s.copy()``" msgstr "``s.copy()``" -#: ../../library/stdtypes.rst:1199 +#: ../../library/stdtypes.rst:1201 msgid "creates a shallow copy of *s* (same as ``s[:]``)" msgstr "建立 *s* 的淺層複製(和 ``s[:]`` 相同)" -#: ../../library/stdtypes.rst:1202 +#: ../../library/stdtypes.rst:1204 msgid "``s.extend(t)`` or ``s += t``" msgstr "``s.extend(t)`` 或 ``s += t``" -#: ../../library/stdtypes.rst:1202 +#: ../../library/stdtypes.rst:1204 msgid "" "extends *s* with the contents of *t* (for the most part the same as " "``s[len(s):len(s)] = t``)" msgstr "" -#: ../../library/stdtypes.rst:1207 +#: ../../library/stdtypes.rst:1209 msgid "``s *= n``" msgstr "``s *= n``" -#: ../../library/stdtypes.rst:1207 +#: ../../library/stdtypes.rst:1209 msgid "updates *s* with its contents repeated *n* times" msgstr "" -#: ../../library/stdtypes.rst:1210 +#: ../../library/stdtypes.rst:1212 msgid "``s.insert(i, x)``" msgstr "``s.insert(i, x)``" -#: ../../library/stdtypes.rst:1210 +#: ../../library/stdtypes.rst:1212 msgid "" "inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1214 +#: ../../library/stdtypes.rst:1216 msgid "``s.pop()`` or ``s.pop(i)``" msgstr "``s.pop()`` 或 ``s.pop(i)``" -#: ../../library/stdtypes.rst:1214 +#: ../../library/stdtypes.rst:1216 msgid "retrieves the item at *i* and also removes it from *s*" msgstr "" -#: ../../library/stdtypes.rst:1217 +#: ../../library/stdtypes.rst:1219 msgid "``s.remove(x)``" msgstr "``s.remove(x)``" -#: ../../library/stdtypes.rst:1217 +#: ../../library/stdtypes.rst:1219 msgid "removes the first item from *s* where ``s[i]`` is equal to *x*" msgstr "" -#: ../../library/stdtypes.rst:1221 +#: ../../library/stdtypes.rst:1223 msgid "``s.reverse()``" msgstr "``s.reverse()``" -#: ../../library/stdtypes.rst:1221 +#: ../../library/stdtypes.rst:1223 msgid "reverses the items of *s* in place" msgstr "" -#: ../../library/stdtypes.rst:1229 +#: ../../library/stdtypes.rst:1231 msgid "" "If *k* is not equal to ``1``, *t* must have the same length as the slice it " "is replacing." msgstr "" -#: ../../library/stdtypes.rst:1232 +#: ../../library/stdtypes.rst:1234 msgid "" "The optional argument *i* defaults to ``-1``, so that by default the last " "item is removed and returned." msgstr "" -#: ../../library/stdtypes.rst:1236 +#: ../../library/stdtypes.rst:1238 msgid ":meth:`remove` raises :exc:`ValueError` when *x* is not found in *s*." -msgstr "" +msgstr "在 *x* 不在 *s* 中時 :meth:`remove` 會引發 :exc:`ValueError`。" -#: ../../library/stdtypes.rst:1239 +#: ../../library/stdtypes.rst:1241 msgid "" "The :meth:`reverse` method modifies the sequence in place for economy of " "space when reversing a large sequence. To remind users that it operates by " "side effect, it does not return the reversed sequence." msgstr "" -#: ../../library/stdtypes.rst:1244 +#: ../../library/stdtypes.rst:1246 msgid "" ":meth:`clear` and :meth:`!copy` are included for consistency with the " "interfaces of mutable containers that don't support slicing operations (such " @@ -2068,11 +2069,11 @@ msgid "" "classes provide it." msgstr "" -#: ../../library/stdtypes.rst:1250 +#: ../../library/stdtypes.rst:1252 msgid ":meth:`clear` and :meth:`!copy` methods." msgstr ":meth:`clear` 和 :meth:`!copy` 方法。" -#: ../../library/stdtypes.rst:1254 +#: ../../library/stdtypes.rst:1256 msgid "" "The value *n* is an integer, or an object implementing :meth:`~object." "__index__`. Zero and negative values of *n* clear the sequence. Items in " @@ -2080,39 +2081,39 @@ msgid "" "explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" -#: ../../library/stdtypes.rst:1263 +#: ../../library/stdtypes.rst:1265 msgid "Lists" msgstr "List(串列)" -#: ../../library/stdtypes.rst:1267 +#: ../../library/stdtypes.rst:1269 msgid "" "Lists are mutable sequences, typically used to store collections of " "homogeneous items (where the precise degree of similarity will vary by " "application)." msgstr "" -#: ../../library/stdtypes.rst:1273 +#: ../../library/stdtypes.rst:1275 msgid "Lists may be constructed in several ways:" msgstr "" -#: ../../library/stdtypes.rst:1275 +#: ../../library/stdtypes.rst:1277 msgid "Using a pair of square brackets to denote the empty list: ``[]``" msgstr "" -#: ../../library/stdtypes.rst:1276 +#: ../../library/stdtypes.rst:1278 msgid "" "Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" msgstr "" -#: ../../library/stdtypes.rst:1277 +#: ../../library/stdtypes.rst:1279 msgid "Using a list comprehension: ``[x for x in iterable]``" -msgstr "" +msgstr "使用串列綜合運算式:``[x for x in iterable]``" -#: ../../library/stdtypes.rst:1278 +#: ../../library/stdtypes.rst:1280 msgid "Using the type constructor: ``list()`` or ``list(iterable)``" -msgstr "" +msgstr "使用型別建構函式:``list()`` 或 ``list(iterable)``" -#: ../../library/stdtypes.rst:1280 +#: ../../library/stdtypes.rst:1282 msgid "" "The constructor builds a list whose items are the same and in the same order " "as *iterable*'s items. *iterable* may be either a sequence, a container " @@ -2123,20 +2124,20 @@ msgid "" "new empty list, ``[]``." msgstr "" -#: ../../library/stdtypes.rst:1289 +#: ../../library/stdtypes.rst:1291 msgid "" "Many other operations also produce lists, including the :func:`sorted` built-" "in." msgstr "" -#: ../../library/stdtypes.rst:1292 +#: ../../library/stdtypes.rst:1294 msgid "" "Lists implement all of the :ref:`common ` and :ref:`mutable " "` sequence operations. Lists also provide the following " "additional method:" msgstr "" -#: ../../library/stdtypes.rst:1298 +#: ../../library/stdtypes.rst:1300 msgid "" "This method sorts the list in place, using only ``<`` comparisons between " "items. Exceptions are not suppressed - if any comparison operations fail, " @@ -2144,13 +2145,13 @@ msgid "" "partially modified state)." msgstr "" -#: ../../library/stdtypes.rst:1303 +#: ../../library/stdtypes.rst:1305 msgid "" ":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:" "`keyword-only arguments `):" msgstr "" -#: ../../library/stdtypes.rst:1306 +#: ../../library/stdtypes.rst:1308 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each list element (for example, ``key=str.lower``). The " @@ -2159,19 +2160,19 @@ msgid "" "list items are sorted directly without calculating a separate key value." msgstr "" -#: ../../library/stdtypes.rst:1313 +#: ../../library/stdtypes.rst:1315 msgid "" "The :func:`functools.cmp_to_key` utility is available to convert a 2.x style " "*cmp* function to a *key* function." msgstr "" -#: ../../library/stdtypes.rst:1316 +#: ../../library/stdtypes.rst:1318 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/stdtypes.rst:1319 +#: ../../library/stdtypes.rst:1321 msgid "" "This method modifies the sequence in place for economy of space when sorting " "a large sequence. To remind users that it operates by side effect, it does " @@ -2179,7 +2180,7 @@ msgid "" "new sorted list instance)." msgstr "" -#: ../../library/stdtypes.rst:1324 +#: ../../library/stdtypes.rst:1326 msgid "" "The :meth:`sort` method is guaranteed to be stable. A sort is stable if it " "guarantees not to change the relative order of elements that compare equal " @@ -2187,12 +2188,12 @@ msgid "" "department, then by salary grade)." msgstr "" -#: ../../library/stdtypes.rst:1329 +#: ../../library/stdtypes.rst:1331 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/stdtypes.rst:1333 +#: ../../library/stdtypes.rst:1335 msgid "" "While a list is being sorted, the effect of attempting to mutate, or even " "inspect, the list is undefined. The C implementation of Python makes the " @@ -2200,11 +2201,11 @@ msgid "" "detect that the list has been mutated during a sort." msgstr "" -#: ../../library/stdtypes.rst:1342 +#: ../../library/stdtypes.rst:1344 msgid "Tuples" msgstr "" -#: ../../library/stdtypes.rst:1346 +#: ../../library/stdtypes.rst:1348 msgid "" "Tuples are immutable sequences, typically used to store collections of " "heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` " @@ -2213,27 +2214,27 @@ msgid "" "class:`dict` instance)." msgstr "" -#: ../../library/stdtypes.rst:1354 +#: ../../library/stdtypes.rst:1356 msgid "Tuples may be constructed in a number of ways:" -msgstr "" +msgstr "元組可以以多種方式建構:" -#: ../../library/stdtypes.rst:1356 +#: ../../library/stdtypes.rst:1358 msgid "Using a pair of parentheses to denote the empty tuple: ``()``" -msgstr "" +msgstr "使用一對圓括號表示空元組:``()``" -#: ../../library/stdtypes.rst:1357 +#: ../../library/stdtypes.rst:1359 msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``" -msgstr "" +msgstr "使用末尾的逗號表示單元素元組:``a,`` 或 ``(a,)``" -#: ../../library/stdtypes.rst:1358 +#: ../../library/stdtypes.rst:1360 msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``" -msgstr "" +msgstr "使用逗號分隔項目:``a, b, c`` 或 ``(a, b, c)``" -#: ../../library/stdtypes.rst:1359 +#: ../../library/stdtypes.rst:1361 msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1361 +#: ../../library/stdtypes.rst:1363 msgid "" "The constructor builds a tuple whose items are the same and in the same " "order as *iterable*'s items. *iterable* may be either a sequence, a " @@ -2244,7 +2245,7 @@ msgid "" "``()``." msgstr "" -#: ../../library/stdtypes.rst:1369 +#: ../../library/stdtypes.rst:1371 msgid "" "Note that it is actually the comma which makes a tuple, not the parentheses. " "The parentheses are optional, except in the empty tuple case, or when they " @@ -2253,30 +2254,30 @@ msgid "" "call with a 3-tuple as the sole argument." msgstr "" -#: ../../library/stdtypes.rst:1375 +#: ../../library/stdtypes.rst:1377 msgid "" "Tuples implement all of the :ref:`common ` sequence " "operations." msgstr "" -#: ../../library/stdtypes.rst:1378 +#: ../../library/stdtypes.rst:1380 msgid "" "For heterogeneous collections of data where access by name is clearer than " "access by index, :func:`collections.namedtuple` may be a more appropriate " "choice than a simple tuple object." msgstr "" -#: ../../library/stdtypes.rst:1386 +#: ../../library/stdtypes.rst:1388 msgid "Ranges" msgstr "" -#: ../../library/stdtypes.rst:1390 +#: ../../library/stdtypes.rst:1392 msgid "" "The :class:`range` type represents an immutable sequence of numbers and is " "commonly used for looping a specific number of times in :keyword:`for` loops." msgstr "" -#: ../../library/stdtypes.rst:1397 +#: ../../library/stdtypes.rst:1399 msgid "" "The arguments to the range constructor must be integers (either built-in :" "class:`int` or any object that implements the :meth:`~object.__index__` " @@ -2285,38 +2286,38 @@ msgid "" "zero, :exc:`ValueError` is raised." msgstr "" -#: ../../library/stdtypes.rst:1403 +#: ../../library/stdtypes.rst:1405 msgid "" "For a positive *step*, the contents of a range ``r`` are determined by the " "formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." msgstr "" -#: ../../library/stdtypes.rst:1407 +#: ../../library/stdtypes.rst:1409 msgid "" "For a negative *step*, the contents of the range are still determined by the " "formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and " "``r[i] > stop``." msgstr "" -#: ../../library/stdtypes.rst:1411 +#: ../../library/stdtypes.rst:1413 msgid "" "A range object will be empty if ``r[0]`` does not meet the value constraint. " "Ranges do support negative indices, but these are interpreted as indexing " "from the end of the sequence determined by the positive indices." msgstr "" -#: ../../library/stdtypes.rst:1416 +#: ../../library/stdtypes.rst:1418 msgid "" "Ranges containing absolute values larger than :data:`sys.maxsize` are " "permitted but some features (such as :func:`len`) may raise :exc:" "`OverflowError`." msgstr "" -#: ../../library/stdtypes.rst:1420 +#: ../../library/stdtypes.rst:1422 msgid "Range examples::" msgstr "" -#: ../../library/stdtypes.rst:1422 +#: ../../library/stdtypes.rst:1424 msgid "" ">>> list(range(10))\n" "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n" @@ -2348,7 +2349,7 @@ msgstr "" ">>> list(range(1, 0))\n" "[]" -#: ../../library/stdtypes.rst:1437 +#: ../../library/stdtypes.rst:1439 msgid "" "Ranges implement all of the :ref:`common ` sequence " "operations except concatenation and repetition (due to the fact that range " @@ -2356,23 +2357,23 @@ msgid "" "repetition and concatenation will usually violate that pattern)." msgstr "" -#: ../../library/stdtypes.rst:1444 +#: ../../library/stdtypes.rst:1446 msgid "" "The value of the *start* parameter (or ``0`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1449 +#: ../../library/stdtypes.rst:1451 msgid "The value of the *stop* parameter" msgstr "" -#: ../../library/stdtypes.rst:1453 +#: ../../library/stdtypes.rst:1455 msgid "" "The value of the *step* parameter (or ``1`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1456 +#: ../../library/stdtypes.rst:1458 msgid "" "The advantage of the :class:`range` type over a regular :class:`list` or :" "class:`tuple` is that a :class:`range` object will always take the same " @@ -2381,14 +2382,14 @@ msgid "" "individual items and subranges as needed)." msgstr "" -#: ../../library/stdtypes.rst:1462 +#: ../../library/stdtypes.rst:1464 msgid "" "Range objects implement the :class:`collections.abc.Sequence` ABC, and " "provide features such as containment tests, element index lookup, slicing " "and support for negative indices (see :ref:`typesseq`):" msgstr "" -#: ../../library/stdtypes.rst:1482 +#: ../../library/stdtypes.rst:1484 msgid "" "Testing range objects for equality with ``==`` and ``!=`` compares them as " "sequences. That is, two range objects are considered equal if they " @@ -2398,111 +2399,111 @@ msgid "" "3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)" msgstr "" -#: ../../library/stdtypes.rst:1489 +#: ../../library/stdtypes.rst:1491 msgid "" "Implement the Sequence ABC. Support slicing and negative indices. Test :" "class:`int` objects for membership in constant time instead of iterating " "through all items." msgstr "" -#: ../../library/stdtypes.rst:1495 +#: ../../library/stdtypes.rst:1497 msgid "" "Define '==' and '!=' to compare range objects based on the sequence of " "values they define (instead of comparing based on object identity)." msgstr "" -#: ../../library/stdtypes.rst:1500 +#: ../../library/stdtypes.rst:1502 msgid "" "Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " "attributes." msgstr "" -#: ../../library/stdtypes.rst:1505 +#: ../../library/stdtypes.rst:1507 msgid "" "The `linspace recipe `_ shows how to implement a lazy version of range " "suitable for floating-point applications." msgstr "" -#: ../../library/stdtypes.rst:1517 +#: ../../library/stdtypes.rst:1519 msgid "Text Sequence Type --- :class:`str`" msgstr "" -#: ../../library/stdtypes.rst:1519 +#: ../../library/stdtypes.rst:1521 msgid "" "Textual data in Python is handled with :class:`str` objects, or :dfn:" "`strings`. Strings are immutable :ref:`sequences ` of Unicode code " "points. String literals are written in a variety of ways:" msgstr "" -#: ../../library/stdtypes.rst:1524 +#: ../../library/stdtypes.rst:1526 msgid "Single quotes: ``'allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:1525 +#: ../../library/stdtypes.rst:1527 msgid "Double quotes: ``\"allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:1526 +#: ../../library/stdtypes.rst:1528 msgid "" "Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double " "quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:1528 +#: ../../library/stdtypes.rst:1530 msgid "" "Triple quoted strings may span multiple lines - all associated whitespace " "will be included in the string literal." msgstr "" -#: ../../library/stdtypes.rst:1531 +#: ../../library/stdtypes.rst:1533 msgid "" "String literals that are part of a single expression and have only " "whitespace between them will be implicitly converted to a single string " "literal. That is, ``(\"spam \" \"eggs\") == \"spam eggs\"``." msgstr "" -#: ../../library/stdtypes.rst:1535 +#: ../../library/stdtypes.rst:1537 msgid "" "See :ref:`strings` for more about the various forms of string literal, " "including supported :ref:`escape sequences `, and the " "``r`` (\"raw\") prefix that disables most escape sequence processing." msgstr "" -#: ../../library/stdtypes.rst:1539 +#: ../../library/stdtypes.rst:1541 msgid "" "Strings may also be created from other objects using the :class:`str` " "constructor." msgstr "" -#: ../../library/stdtypes.rst:1542 +#: ../../library/stdtypes.rst:1544 msgid "" "Since there is no separate \"character\" type, indexing a string produces " "strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``." msgstr "" -#: ../../library/stdtypes.rst:1548 +#: ../../library/stdtypes.rst:1550 msgid "" "There is also no mutable string type, but :meth:`str.join` or :class:`io." "StringIO` can be used to efficiently construct strings from multiple " "fragments." msgstr "" -#: ../../library/stdtypes.rst:1552 +#: ../../library/stdtypes.rst:1554 msgid "" "For backwards compatibility with the Python 2 series, the ``u`` prefix is " "once again permitted on string literals. It has no effect on the meaning of " "string literals and cannot be combined with the ``r`` prefix." msgstr "" -#: ../../library/stdtypes.rst:1564 +#: ../../library/stdtypes.rst:1566 msgid "" "Return a :ref:`string ` version of *object*. If *object* is not " "provided, returns the empty string. Otherwise, the behavior of ``str()`` " "depends on whether *encoding* or *errors* is given, as follows." msgstr "" -#: ../../library/stdtypes.rst:1568 +#: ../../library/stdtypes.rst:1570 msgid "" "If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:" "`type(object).__str__(object) `, which is the \"informal\" " @@ -2512,7 +2513,7 @@ msgid "" "`repr(object) `." msgstr "" -#: ../../library/stdtypes.rst:1580 +#: ../../library/stdtypes.rst:1582 msgid "" "If at least one of *encoding* or *errors* is given, *object* should be a :" "term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " @@ -2524,7 +2525,7 @@ msgid "" "buffer objects." msgstr "" -#: ../../library/stdtypes.rst:1589 +#: ../../library/stdtypes.rst:1591 msgid "" "Passing a :class:`bytes` object to :func:`str` without the *encoding* or " "*errors* arguments falls under the first case of returning the informal " @@ -2532,7 +2533,7 @@ msgid "" "Python). For example::" msgstr "" -#: ../../library/stdtypes.rst:1594 +#: ../../library/stdtypes.rst:1596 msgid "" ">>> str(b'Zoot!')\n" "\"b'Zoot!'\"" @@ -2540,7 +2541,7 @@ msgstr "" ">>> str(b'Zoot!')\n" "\"b'Zoot!'\"" -#: ../../library/stdtypes.rst:1597 +#: ../../library/stdtypes.rst:1599 msgid "" "For more information on the ``str`` class and its methods, see :ref:" "`textseq` and the :ref:`string-methods` section below. To output formatted " @@ -2548,17 +2549,17 @@ msgid "" "addition, see the :ref:`stringservices` section." msgstr "" -#: ../../library/stdtypes.rst:1609 +#: ../../library/stdtypes.rst:1611 msgid "String Methods" msgstr "" -#: ../../library/stdtypes.rst:1614 +#: ../../library/stdtypes.rst:1616 msgid "" "Strings implement all of the :ref:`common ` sequence " "operations, along with the additional methods described below." msgstr "" -#: ../../library/stdtypes.rst:1617 +#: ../../library/stdtypes.rst:1619 msgid "" "Strings also support two styles of string formatting, one providing a large " "degree of flexibility and customization (see :meth:`str.format`, :ref:" @@ -2568,33 +2569,33 @@ msgid "" "handle (:ref:`old-string-formatting`)." msgstr "" -#: ../../library/stdtypes.rst:1624 +#: ../../library/stdtypes.rst:1626 msgid "" "The :ref:`textservices` section of the standard library covers a number of " "other modules that provide various text related utilities (including regular " "expression support in the :mod:`re` module)." msgstr "" -#: ../../library/stdtypes.rst:1630 +#: ../../library/stdtypes.rst:1632 msgid "" "Return a copy of the string with its first character capitalized and the " "rest lowercased." msgstr "" -#: ../../library/stdtypes.rst:1633 +#: ../../library/stdtypes.rst:1635 msgid "" "The first character is now put into titlecase rather than uppercase. This " "means that characters like digraphs will only have their first letter " "capitalized, instead of the full character." msgstr "" -#: ../../library/stdtypes.rst:1640 +#: ../../library/stdtypes.rst:1642 msgid "" "Return a casefolded copy of the string. Casefolded strings may be used for " "caseless matching." msgstr "" -#: ../../library/stdtypes.rst:1643 +#: ../../library/stdtypes.rst:1645 msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " @@ -2603,21 +2604,21 @@ msgid "" "`casefold` converts it to ``\"ss\"``." msgstr "" -#: ../../library/stdtypes.rst:1649 +#: ../../library/stdtypes.rst:1651 msgid "" "The casefolding algorithm is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:1658 +#: ../../library/stdtypes.rst:1660 msgid "" "Return centered in a string of length *width*. Padding is done using the " "specified *fillchar* (default is an ASCII space). The original string is " "returned if *width* is less than or equal to ``len(s)``. For example::" msgstr "" -#: ../../library/stdtypes.rst:1662 +#: ../../library/stdtypes.rst:1664 msgid "" ">>> 'Python'.center(10)\n" "' Python '\n" @@ -2633,20 +2634,20 @@ msgstr "" ">>> 'Python'.center(4)\n" "'Python'" -#: ../../library/stdtypes.rst:1672 +#: ../../library/stdtypes.rst:1674 msgid "" "Return the number of non-overlapping occurrences of substring *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:1676 +#: ../../library/stdtypes.rst:1678 msgid "" "If *sub* is empty, returns the number of empty strings between characters " "which is the length of the string plus one. For example::" msgstr "" -#: ../../library/stdtypes.rst:1679 +#: ../../library/stdtypes.rst:1681 msgid "" ">>> 'spam, spam, spam'.count('spam')\n" "3\n" @@ -2670,17 +2671,17 @@ msgstr "" ">>> 'spam, spam, spam'.count('')\n" "17" -#: ../../library/stdtypes.rst:1692 +#: ../../library/stdtypes.rst:1694 msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1694 ../../library/stdtypes.rst:3026 +#: ../../library/stdtypes.rst:1696 ../../library/stdtypes.rst:3028 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." msgstr "" -#: ../../library/stdtypes.rst:1697 +#: ../../library/stdtypes.rst:1699 msgid "" "*errors* controls how encoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -2689,14 +2690,14 @@ msgid "" "register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:1704 +#: ../../library/stdtypes.rst:1706 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless an encoding error actually occurs, :ref:`devmode` is enabled or a :" "ref:`debug build ` is used. For example::" msgstr "" -#: ../../library/stdtypes.rst:1710 +#: ../../library/stdtypes.rst:1712 msgid "" ">>> encoded_str_to_bytes = 'Python'.encode()\n" ">>> type(encoded_str_to_bytes)\n" @@ -2710,17 +2711,17 @@ msgstr "" ">>> encoded_str_to_bytes\n" "b'Python'" -#: ../../library/stdtypes.rst:1717 ../../library/stdtypes.rst:3045 +#: ../../library/stdtypes.rst:1719 ../../library/stdtypes.rst:3047 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1720 ../../library/stdtypes.rst:3048 +#: ../../library/stdtypes.rst:1722 ../../library/stdtypes.rst:3050 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." msgstr "" -#: ../../library/stdtypes.rst:1727 +#: ../../library/stdtypes.rst:1729 msgid "" "Return ``True`` if the string ends with the specified *suffix*, otherwise " "return ``False``. *suffix* can also be a tuple of suffixes to look for. " @@ -2729,7 +2730,7 @@ msgid "" "equivalent to ``str[start:end].endswith(suffix)``. For example::" msgstr "" -#: ../../library/stdtypes.rst:1733 +#: ../../library/stdtypes.rst:1735 msgid "" ">>> 'Python'.endswith('on')\n" "True\n" @@ -2749,11 +2750,11 @@ msgstr "" ">>> 'Python is amazing'.endswith('is', 0, 9)\n" "True" -#: ../../library/stdtypes.rst:1742 +#: ../../library/stdtypes.rst:1744 msgid "See also :meth:`startswith` and :meth:`removesuffix`." msgstr "另請參閱 :meth:`startswith` 和 :meth:`removesuffix`。" -#: ../../library/stdtypes.rst:1747 +#: ../../library/stdtypes.rst:1749 msgid "" "Return a copy of the string where all tab characters are replaced by one or " "more spaces, depending on the current column and the given tab size. Tab " @@ -2769,7 +2770,7 @@ msgid "" "printed. For example::" msgstr "" -#: ../../library/stdtypes.rst:1760 +#: ../../library/stdtypes.rst:1762 msgid "" ">>> '01\\t012\\t0123\\t01234'.expandtabs()\n" "'01 012 0123 01234'\n" @@ -2787,21 +2788,21 @@ msgstr "" "01 012\n" "0123 01234" -#: ../../library/stdtypes.rst:1771 +#: ../../library/stdtypes.rst:1773 msgid "" "Return the lowest index in the string where substring *sub* is found within " "the slice ``s[start:end]``. Optional arguments *start* and *end* are " "interpreted as in slice notation. Return ``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:1777 +#: ../../library/stdtypes.rst:1779 msgid "" "The :meth:`~str.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:1781 +#: ../../library/stdtypes.rst:1783 msgid "" ">>> 'Py' in 'Python'\n" "True" @@ -2809,7 +2810,7 @@ msgstr "" ">>> 'Py' in 'Python'\n" "True" -#: ../../library/stdtypes.rst:1787 +#: ../../library/stdtypes.rst:1789 msgid "" "Perform a string formatting operation. The string on which this method is " "called can contain literal text or replacement fields delimited by braces " @@ -2819,13 +2820,13 @@ msgid "" "the corresponding argument." msgstr "" -#: ../../library/stdtypes.rst:1797 +#: ../../library/stdtypes.rst:1799 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." msgstr "" -#: ../../library/stdtypes.rst:1801 +#: ../../library/stdtypes.rst:1803 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -2836,26 +2837,26 @@ msgid "" "This temporary change affects other threads." msgstr "" -#: ../../library/stdtypes.rst:1810 +#: ../../library/stdtypes.rst:1812 msgid "" "When formatting a number with the ``n`` type, the function sets temporarily " "the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" -#: ../../library/stdtypes.rst:1818 +#: ../../library/stdtypes.rst:1820 msgid "" "Similar to ``str.format(**mapping)``, except that ``mapping`` is used " "directly and not copied to a :class:`dict`. This is useful if for example " "``mapping`` is a dict subclass:" msgstr "" -#: ../../library/stdtypes.rst:1834 +#: ../../library/stdtypes.rst:1836 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1840 +#: ../../library/stdtypes.rst:1842 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -2863,7 +2864,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:1848 +#: ../../library/stdtypes.rst:1850 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -2875,14 +2876,14 @@ msgid "" "pdf>`_." msgstr "" -#: ../../library/stdtypes.rst:1859 +#: ../../library/stdtypes.rst:1861 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range " "U+0000-U+007F." msgstr "" -#: ../../library/stdtypes.rst:1868 +#: ../../library/stdtypes.rst:1870 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -2891,7 +2892,7 @@ msgid "" "General Category \"Nd\"." msgstr "" -#: ../../library/stdtypes.rst:1878 +#: ../../library/stdtypes.rst:1880 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -2901,23 +2902,23 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:1888 +#: ../../library/stdtypes.rst:1890 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:1891 +#: ../../library/stdtypes.rst:1893 msgid "" ":func:`keyword.iskeyword` can be used to test whether string ``s`` is a " "reserved identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:1894 +#: ../../library/stdtypes.rst:1896 msgid "Example: ::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:1897 +#: ../../library/stdtypes.rst:1899 msgid "" ">>> from keyword import iskeyword\n" "\n" @@ -2933,13 +2934,13 @@ msgstr "" ">>> 'def'.isidentifier(), iskeyword('def')\n" "(True, True)" -#: ../../library/stdtypes.rst:1907 +#: ../../library/stdtypes.rst:1909 msgid "" "Return ``True`` if all cased characters [4]_ in the string are lowercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1913 +#: ../../library/stdtypes.rst:1915 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -2949,13 +2950,13 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric." msgstr "" -#: ../../library/stdtypes.rst:1923 +#: ../../library/stdtypes.rst:1925 msgid "" "Return ``True`` if all characters in the string are printable, ``False`` if " "it contains at least one non-printable character." msgstr "" -#: ../../library/stdtypes.rst:1926 +#: ../../library/stdtypes.rst:1928 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 " @@ -2963,7 +2964,7 @@ msgid "" "written to :data:`sys.stdout` or :data:`sys.stderr`." msgstr "" -#: ../../library/stdtypes.rst:1931 +#: ../../library/stdtypes.rst:1933 msgid "" "The printable characters are those which in the Unicode character database " "(see :mod:`unicodedata`) have a general category in group Letter, Mark, " @@ -2972,20 +2973,20 @@ msgid "" "C), except the ASCII space." msgstr "" -#: ../../library/stdtypes.rst:1940 +#: ../../library/stdtypes.rst:1942 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:1943 +#: ../../library/stdtypes.rst:1945 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:1951 +#: ../../library/stdtypes.rst:1953 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 " @@ -2993,13 +2994,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:1958 +#: ../../library/stdtypes.rst:1960 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:1976 +#: ../../library/stdtypes.rst:1978 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 " @@ -3007,27 +3008,27 @@ msgid "" "elements is the string providing this method." msgstr "" -#: ../../library/stdtypes.rst:1984 +#: ../../library/stdtypes.rst:1986 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:1991 +#: ../../library/stdtypes.rst:1993 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:1994 +#: ../../library/stdtypes.rst:1996 msgid "" "The lowercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2001 +#: ../../library/stdtypes.rst:2003 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 " @@ -3036,7 +3037,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2006 +#: ../../library/stdtypes.rst:2008 msgid "" ">>> ' spacious '.lstrip()\n" "'spacious '\n" @@ -3048,13 +3049,13 @@ msgstr "" ">>> 'www.example.com'.lstrip('cmowz.')\n" "'example.com'" -#: ../../library/stdtypes.rst:2011 +#: ../../library/stdtypes.rst:2013 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:2014 +#: ../../library/stdtypes.rst:2016 msgid "" ">>> 'Arthur: three!'.lstrip('Arthur: ')\n" "'ee!'\n" @@ -3066,13 +3067,13 @@ msgstr "" ">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" "'three!'" -#: ../../library/stdtypes.rst:2022 +#: ../../library/stdtypes.rst:2024 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:2024 +#: ../../library/stdtypes.rst:2026 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, " @@ -3080,7 +3081,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:2029 +#: ../../library/stdtypes.rst:2031 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 " @@ -3088,7 +3089,7 @@ msgid "" "whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:2037 +#: ../../library/stdtypes.rst:2039 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 " @@ -3096,13 +3097,13 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:2045 +#: ../../library/stdtypes.rst:2047 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:2049 +#: ../../library/stdtypes.rst:2051 msgid "" ">>> 'TestHook'.removeprefix('Test')\n" "'Hook'\n" @@ -3114,14 +3115,14 @@ msgstr "" ">>> 'BaseTestCase'.removeprefix('Test')\n" "'BaseTestCase'" -#: ../../library/stdtypes.rst:2059 +#: ../../library/stdtypes.rst:2061 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:2063 +#: ../../library/stdtypes.rst:2065 msgid "" ">>> 'MiscTests'.removesuffix('Tests')\n" "'Misc'\n" @@ -3133,7 +3134,7 @@ msgstr "" ">>> 'TmpDirMixin'.removesuffix('Tests')\n" "'TmpDirMixin'" -#: ../../library/stdtypes.rst:2073 +#: ../../library/stdtypes.rst:2075 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 " @@ -3141,31 +3142,31 @@ msgid "" "replaced." msgstr "" -#: ../../library/stdtypes.rst:2077 +#: ../../library/stdtypes.rst:2079 msgid "*count* is now supported as a keyword argument." msgstr "*count* 現在作為關鍵字引數被支援。" -#: ../../library/stdtypes.rst:2083 +#: ../../library/stdtypes.rst:2085 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:2090 +#: ../../library/stdtypes.rst:2092 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2098 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:2103 +#: ../../library/stdtypes.rst:2105 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 " @@ -3173,7 +3174,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2111 +#: ../../library/stdtypes.rst:2113 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 " @@ -3182,7 +3183,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2120 +#: ../../library/stdtypes.rst:2122 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 " @@ -3191,7 +3192,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2125 +#: ../../library/stdtypes.rst:2127 msgid "" ">>> ' spacious '.rstrip()\n" "' spacious'\n" @@ -3203,13 +3204,13 @@ msgstr "" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" -#: ../../library/stdtypes.rst:2130 +#: ../../library/stdtypes.rst:2132 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:2133 +#: ../../library/stdtypes.rst:2135 msgid "" ">>> 'Monty Python'.rstrip(' Python')\n" "'M'\n" @@ -3221,7 +3222,7 @@ msgstr "" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" -#: ../../library/stdtypes.rst:2140 +#: ../../library/stdtypes.rst:2142 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, " @@ -3230,7 +3231,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2146 +#: ../../library/stdtypes.rst:2148 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -3240,20 +3241,20 @@ msgid "" "``['']``." msgstr "" -#: ../../library/stdtypes.rst:2153 ../../library/stdtypes.rst:2171 -#: ../../library/stdtypes.rst:2183 ../../library/stdtypes.rst:2235 -#: ../../library/stdtypes.rst:2303 ../../library/stdtypes.rst:2371 -#: ../../library/stdtypes.rst:3363 ../../library/stdtypes.rst:3381 -#: ../../library/stdtypes.rst:3472 ../../library/stdtypes.rst:3488 -#: ../../library/stdtypes.rst:3513 ../../library/stdtypes.rst:3527 -#: ../../library/stdtypes.rst:3555 ../../library/stdtypes.rst:3569 -#: ../../library/stdtypes.rst:3587 ../../library/stdtypes.rst:3614 -#: ../../library/stdtypes.rst:3637 ../../library/stdtypes.rst:3664 -#: ../../library/stdtypes.rst:3706 ../../library/stdtypes.rst:3730 +#: ../../library/stdtypes.rst:2155 ../../library/stdtypes.rst:2173 +#: ../../library/stdtypes.rst:2185 ../../library/stdtypes.rst:2237 +#: ../../library/stdtypes.rst:2305 ../../library/stdtypes.rst:2373 +#: ../../library/stdtypes.rst:3365 ../../library/stdtypes.rst:3383 +#: ../../library/stdtypes.rst:3474 ../../library/stdtypes.rst:3490 +#: ../../library/stdtypes.rst:3515 ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:3557 ../../library/stdtypes.rst:3571 +#: ../../library/stdtypes.rst:3589 ../../library/stdtypes.rst:3616 +#: ../../library/stdtypes.rst:3639 ../../library/stdtypes.rst:3666 +#: ../../library/stdtypes.rst:3708 ../../library/stdtypes.rst:3732 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/stdtypes.rst:2155 +#: ../../library/stdtypes.rst:2157 msgid "" ">>> '1,2,3'.split(',')\n" "['1', '2', '3']\n" @@ -3273,7 +3274,7 @@ msgstr "" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" -#: ../../library/stdtypes.rst:2164 +#: ../../library/stdtypes.rst:2166 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, " @@ -3283,7 +3284,7 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2173 +#: ../../library/stdtypes.rst:2175 msgid "" ">>> '1 2 3'.split()\n" "['1', '2', '3']\n" @@ -3299,13 +3300,13 @@ msgstr "" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" -#: ../../library/stdtypes.rst:2180 +#: ../../library/stdtypes.rst:2182 msgid "" "If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only " "leading runs of consecutive whitespace are considered." msgstr "" -#: ../../library/stdtypes.rst:2185 +#: ../../library/stdtypes.rst:2187 msgid "" ">>> \"\".split(None, 0)\n" "[]\n" @@ -3321,120 +3322,120 @@ msgstr "" ">>> \" foo \".split(maxsplit=0)\n" "['foo ']" -#: ../../library/stdtypes.rst:2198 +#: ../../library/stdtypes.rst:2200 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:2202 +#: ../../library/stdtypes.rst:2204 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2206 +#: ../../library/stdtypes.rst:2208 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2206 +#: ../../library/stdtypes.rst:2208 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2208 +#: ../../library/stdtypes.rst:2210 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2208 +#: ../../library/stdtypes.rst:2210 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2210 +#: ../../library/stdtypes.rst:2212 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2210 +#: ../../library/stdtypes.rst:2212 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2212 +#: ../../library/stdtypes.rst:2214 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2212 +#: ../../library/stdtypes.rst:2214 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2214 +#: ../../library/stdtypes.rst:2216 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2214 +#: ../../library/stdtypes.rst:2216 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2216 +#: ../../library/stdtypes.rst:2218 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2216 +#: ../../library/stdtypes.rst:2218 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2218 +#: ../../library/stdtypes.rst:2220 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2218 +#: ../../library/stdtypes.rst:2220 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2220 +#: ../../library/stdtypes.rst:2222 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2220 +#: ../../library/stdtypes.rst:2222 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2222 +#: ../../library/stdtypes.rst:2224 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2222 +#: ../../library/stdtypes.rst:2224 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2224 +#: ../../library/stdtypes.rst:2226 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2224 +#: ../../library/stdtypes.rst:2226 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2226 +#: ../../library/stdtypes.rst:2228 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2226 +#: ../../library/stdtypes.rst:2228 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2228 +#: ../../library/stdtypes.rst:2230 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2228 +#: ../../library/stdtypes.rst:2230 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2233 +#: ../../library/stdtypes.rst:2235 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2237 +#: ../../library/stdtypes.rst:2239 msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "['ab c', '', 'de fg', 'kl']\n" @@ -3446,14 +3447,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:2242 +#: ../../library/stdtypes.rst:2244 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:2246 +#: ../../library/stdtypes.rst:2248 msgid "" ">>> \"\".splitlines()\n" "[]\n" @@ -3465,11 +3466,11 @@ msgstr "" ">>> \"One line\\n\".splitlines()\n" "['One line']" -#: ../../library/stdtypes.rst:2251 +#: ../../library/stdtypes.rst:2253 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2253 +#: ../../library/stdtypes.rst:2255 msgid "" ">>> ''.split('\\n')\n" "['']\n" @@ -3481,7 +3482,7 @@ msgstr "" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" -#: ../../library/stdtypes.rst:2261 +#: ../../library/stdtypes.rst:2263 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -3489,7 +3490,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2269 +#: ../../library/stdtypes.rst:2271 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 " @@ -3498,7 +3499,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2275 +#: ../../library/stdtypes.rst:2277 msgid "" ">>> ' spacious '.strip()\n" "'spacious'\n" @@ -3510,7 +3511,7 @@ msgstr "" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" -#: ../../library/stdtypes.rst:2280 +#: ../../library/stdtypes.rst:2282 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -3518,7 +3519,7 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2286 +#: ../../library/stdtypes.rst:2288 msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" @@ -3528,20 +3529,20 @@ msgstr "" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" -#: ../../library/stdtypes.rst:2293 +#: ../../library/stdtypes.rst:2295 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:2300 +#: ../../library/stdtypes.rst:2302 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:2305 +#: ../../library/stdtypes.rst:2307 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" @@ -3549,7 +3550,7 @@ msgstr "" ">>> 'Hello world'.title()\n" "'Hello World'" -#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3674 +#: ../../library/stdtypes.rst:2310 ../../library/stdtypes.rst:3676 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 " @@ -3557,7 +3558,7 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2313 +#: ../../library/stdtypes.rst:2315 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" @@ -3565,19 +3566,19 @@ msgstr "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:2316 +#: ../../library/stdtypes.rst:2318 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2319 +#: ../../library/stdtypes.rst:2321 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2322 +#: ../../library/stdtypes.rst:2324 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -3597,7 +3598,7 @@ msgstr "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:2334 +#: ../../library/stdtypes.rst:2336 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 " @@ -3609,19 +3610,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2343 +#: ../../library/stdtypes.rst:2345 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2346 +#: ../../library/stdtypes.rst:2348 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2352 +#: ../../library/stdtypes.rst:2354 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`` " @@ -3630,14 +3631,14 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2358 +#: ../../library/stdtypes.rst:2360 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2365 +#: ../../library/stdtypes.rst:2367 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 " @@ -3645,7 +3646,7 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2373 +#: ../../library/stdtypes.rst:2375 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" @@ -3657,27 +3658,27 @@ msgstr "" ">>> \"-42\".zfill(5)\n" "'-0042'" -#: ../../library/stdtypes.rst:2394 +#: ../../library/stdtypes.rst:2396 msgid "Formatted String Literals (f-strings)" msgstr "" -#: ../../library/stdtypes.rst:2397 +#: ../../library/stdtypes.rst:2399 msgid "" "The :keyword:`await` and :keyword:`async for` can be used in expressions " "within f-strings." msgstr "" -#: ../../library/stdtypes.rst:2400 +#: ../../library/stdtypes.rst:2402 msgid "Added the debugging operator (``=``)" msgstr "" -#: ../../library/stdtypes.rst:2402 +#: ../../library/stdtypes.rst:2404 msgid "" "Many restrictions on expressions within f-strings have been removed. " "Notably, nested strings, comments, and backslashes are now permitted." msgstr "" -#: ../../library/stdtypes.rst:2406 +#: ../../library/stdtypes.rst:2408 msgid "" "An :dfn:`f-string` (formally a :dfn:`formatted string literal`) is a string " "literal that is prefixed with ``f`` or ``F``. This type of string literal " @@ -3687,7 +3688,7 @@ msgid "" "into regular :class:`str` objects. For example:" msgstr "" -#: ../../library/stdtypes.rst:2414 +#: ../../library/stdtypes.rst:2416 msgid "" ">>> who = 'nobody'\n" ">>> nationality = 'Spanish'\n" @@ -3699,11 +3700,11 @@ msgstr "" ">>> f'{who.title()} expects the {nationality} Inquisition!'\n" "'Nobody expects the Spanish Inquisition!'" -#: ../../library/stdtypes.rst:2421 +#: ../../library/stdtypes.rst:2423 msgid "It is also possible to use a multi line f-string:" msgstr "" -#: ../../library/stdtypes.rst:2423 +#: ../../library/stdtypes.rst:2425 msgid "" ">>> f'''This is a string\n" "... on two lines'''\n" @@ -3713,13 +3714,13 @@ msgstr "" "... on two lines'''\n" "'This is a string\\non two lines'" -#: ../../library/stdtypes.rst:2429 +#: ../../library/stdtypes.rst:2431 msgid "" "A single opening curly bracket, ``'{'``, marks a *replacement field* that " "can contain any Python expression:" msgstr "" -#: ../../library/stdtypes.rst:2432 +#: ../../library/stdtypes.rst:2434 msgid "" ">>> nationality = 'Spanish'\n" ">>> f'The {nationality} Inquisition!'\n" @@ -3729,11 +3730,11 @@ msgstr "" ">>> f'The {nationality} Inquisition!'\n" "'The Spanish Inquisition!'" -#: ../../library/stdtypes.rst:2438 +#: ../../library/stdtypes.rst:2440 msgid "To include a literal ``{`` or ``}``, use a double bracket:" msgstr "" -#: ../../library/stdtypes.rst:2440 +#: ../../library/stdtypes.rst:2442 msgid "" ">>> x = 42\n" ">>> f'{{x}} is {x}'\n" @@ -3743,12 +3744,12 @@ msgstr "" ">>> f'{{x}} is {x}'\n" "'{x} is 42'" -#: ../../library/stdtypes.rst:2446 +#: ../../library/stdtypes.rst:2448 msgid "" "Functions can also be used, and :ref:`format specifiers `:" msgstr "" -#: ../../library/stdtypes.rst:2448 +#: ../../library/stdtypes.rst:2450 msgid "" ">>> from math import sqrt\n" ">>> f'√2 \\N{ALMOST EQUAL TO} {sqrt(2):.5f}'\n" @@ -3758,11 +3759,11 @@ msgstr "" ">>> f'√2 \\N{ALMOST EQUAL TO} {sqrt(2):.5f}'\n" "'√2 ≈ 1.41421'" -#: ../../library/stdtypes.rst:2454 +#: ../../library/stdtypes.rst:2456 msgid "Any non-string expression is converted using :func:`str`, by default:" msgstr "" -#: ../../library/stdtypes.rst:2456 +#: ../../library/stdtypes.rst:2458 msgid "" ">>> from fractions import Fraction\n" ">>> f'{Fraction(1, 3)}'\n" @@ -3772,46 +3773,46 @@ msgstr "" ">>> f'{Fraction(1, 3)}'\n" "'1/3'" -#: ../../library/stdtypes.rst:2462 +#: ../../library/stdtypes.rst:2464 msgid "" "To use an explicit conversion, use the ``!`` (exclamation mark) operator, " "followed by any of the valid formats, which are:" msgstr "" -#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:2634 -#: ../../library/stdtypes.rst:3853 +#: ../../library/stdtypes.rst:2468 ../../library/stdtypes.rst:2636 +#: ../../library/stdtypes.rst:3855 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2468 +#: ../../library/stdtypes.rst:2470 msgid "``!a``" msgstr "``!a``" -#: ../../library/stdtypes.rst:2468 +#: ../../library/stdtypes.rst:2470 msgid ":func:`ascii`" msgstr ":func:`ascii`" -#: ../../library/stdtypes.rst:2469 +#: ../../library/stdtypes.rst:2471 msgid "``!r``" msgstr "``!r``" -#: ../../library/stdtypes.rst:2469 +#: ../../library/stdtypes.rst:2471 msgid ":func:`repr`" msgstr ":func:`repr`" -#: ../../library/stdtypes.rst:2470 +#: ../../library/stdtypes.rst:2472 msgid "``!s``" msgstr "``!s``" -#: ../../library/stdtypes.rst:2470 +#: ../../library/stdtypes.rst:2472 msgid ":func:`str`" msgstr ":func:`str`" -#: ../../library/stdtypes.rst:2473 +#: ../../library/stdtypes.rst:2475 msgid "For example:" msgstr "舉例來說:" -#: ../../library/stdtypes.rst:2475 +#: ../../library/stdtypes.rst:2477 msgid "" ">>> from fractions import Fraction\n" ">>> f'{Fraction(1, 3)!s}'\n" @@ -3831,7 +3832,7 @@ msgstr "" ">>> print(f'{question!a}')\n" "'\\xbfD\\xf3nde est\\xe1 el Presidente?'" -#: ../../library/stdtypes.rst:2486 +#: ../../library/stdtypes.rst:2488 msgid "" "While debugging it may be helpful to see both the expression and its value, " "by using the equals sign (``=``) after the expression. This preserves spaces " @@ -3839,7 +3840,7 @@ msgid "" "debugging operator uses the :func:`repr` (``!r``) conversion. For example:" msgstr "" -#: ../../library/stdtypes.rst:2492 +#: ../../library/stdtypes.rst:2494 msgid "" ">>> from fractions import Fraction\n" ">>> calculation = Fraction(1, 3)\n" @@ -3859,7 +3860,7 @@ msgstr "" ">>> f'{calculation = !s}'\n" "'calculation = 1/3'" -#: ../../library/stdtypes.rst:2503 +#: ../../library/stdtypes.rst:2505 msgid "" "Once the output has been evaluated, it can be formatted using a :ref:`format " "specifier ` following a colon (``':'``). After the expression " @@ -3869,7 +3870,7 @@ msgid "" "used as the final value for the replacement field. For example:" msgstr "" -#: ../../library/stdtypes.rst:2511 +#: ../../library/stdtypes.rst:2513 msgid "" ">>> from fractions import Fraction\n" ">>> f'{Fraction(1, 7):.6f}'\n" @@ -3878,11 +3879,11 @@ msgid "" "'___+1/7___'" msgstr "" -#: ../../library/stdtypes.rst:2523 +#: ../../library/stdtypes.rst:2525 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2536 +#: ../../library/stdtypes.rst:2538 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 " @@ -3893,7 +3894,7 @@ msgid "" "or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2544 +#: ../../library/stdtypes.rst:2546 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -3903,13 +3904,13 @@ msgid "" "function in the C language. For example:" msgstr "" -#: ../../library/stdtypes.rst:2551 +#: ../../library/stdtypes.rst:2553 msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." msgstr "" -#: ../../library/stdtypes.rst:2556 +#: ../../library/stdtypes.rst:2558 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 " @@ -3917,36 +3918,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2566 ../../library/stdtypes.rst:3785 +#: ../../library/stdtypes.rst:2568 ../../library/stdtypes.rst:3787 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2569 ../../library/stdtypes.rst:3788 +#: ../../library/stdtypes.rst:2571 ../../library/stdtypes.rst:3790 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2571 ../../library/stdtypes.rst:3790 +#: ../../library/stdtypes.rst:2573 ../../library/stdtypes.rst:3792 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2574 ../../library/stdtypes.rst:3793 +#: ../../library/stdtypes.rst:2576 ../../library/stdtypes.rst:3795 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2577 ../../library/stdtypes.rst:3796 +#: ../../library/stdtypes.rst:2579 ../../library/stdtypes.rst:3798 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:2581 ../../library/stdtypes.rst:3800 +#: ../../library/stdtypes.rst:2583 ../../library/stdtypes.rst:3802 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -3954,15 +3955,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2586 ../../library/stdtypes.rst:3805 +#: ../../library/stdtypes.rst:2588 ../../library/stdtypes.rst:3807 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2588 ../../library/stdtypes.rst:3807 +#: ../../library/stdtypes.rst:2590 ../../library/stdtypes.rst:3809 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2590 +#: ../../library/stdtypes.rst:2592 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 " @@ -3970,275 +3971,275 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2599 ../../library/stdtypes.rst:3818 +#: ../../library/stdtypes.rst:2601 ../../library/stdtypes.rst:3820 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2602 ../../library/stdtypes.rst:3821 +#: ../../library/stdtypes.rst:2604 ../../library/stdtypes.rst:3823 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2611 ../../library/stdtypes.rst:3830 +#: ../../library/stdtypes.rst:2613 ../../library/stdtypes.rst:3832 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2613 ../../library/stdtypes.rst:3832 +#: ../../library/stdtypes.rst:2615 ../../library/stdtypes.rst:3834 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2613 ../../library/stdtypes.rst:3832 +#: ../../library/stdtypes.rst:2615 ../../library/stdtypes.rst:3834 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2616 ../../library/stdtypes.rst:3835 +#: ../../library/stdtypes.rst:2618 ../../library/stdtypes.rst:3837 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2616 ../../library/stdtypes.rst:3835 +#: ../../library/stdtypes.rst:2618 ../../library/stdtypes.rst:3837 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2618 ../../library/stdtypes.rst:3837 +#: ../../library/stdtypes.rst:2620 ../../library/stdtypes.rst:3839 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2618 ../../library/stdtypes.rst:3837 +#: ../../library/stdtypes.rst:2620 ../../library/stdtypes.rst:3839 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2621 ../../library/stdtypes.rst:3840 +#: ../../library/stdtypes.rst:2623 ../../library/stdtypes.rst:3842 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2621 ../../library/stdtypes.rst:3840 +#: ../../library/stdtypes.rst:2623 ../../library/stdtypes.rst:3842 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2624 ../../library/stdtypes.rst:3843 +#: ../../library/stdtypes.rst:2626 ../../library/stdtypes.rst:3845 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2624 ../../library/stdtypes.rst:3843 +#: ../../library/stdtypes.rst:2626 ../../library/stdtypes.rst:3845 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2628 ../../library/stdtypes.rst:3847 +#: ../../library/stdtypes.rst:2630 ../../library/stdtypes.rst:3849 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:2631 ../../library/stdtypes.rst:3850 +#: ../../library/stdtypes.rst:2633 ../../library/stdtypes.rst:3852 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2636 ../../library/stdtypes.rst:3855 +#: ../../library/stdtypes.rst:2638 ../../library/stdtypes.rst:3857 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2636 ../../library/stdtypes.rst:2638 -#: ../../library/stdtypes.rst:3855 ../../library/stdtypes.rst:3857 +#: ../../library/stdtypes.rst:2638 ../../library/stdtypes.rst:2640 +#: ../../library/stdtypes.rst:3857 ../../library/stdtypes.rst:3859 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2638 ../../library/stdtypes.rst:3857 +#: ../../library/stdtypes.rst:2640 ../../library/stdtypes.rst:3859 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2640 ../../library/stdtypes.rst:3859 +#: ../../library/stdtypes.rst:2642 ../../library/stdtypes.rst:3861 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2640 ../../library/stdtypes.rst:3859 +#: ../../library/stdtypes.rst:2642 ../../library/stdtypes.rst:3861 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2642 ../../library/stdtypes.rst:3861 +#: ../../library/stdtypes.rst:2644 ../../library/stdtypes.rst:3863 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2642 ../../library/stdtypes.rst:3861 +#: ../../library/stdtypes.rst:2644 ../../library/stdtypes.rst:3863 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2644 ../../library/stdtypes.rst:3863 +#: ../../library/stdtypes.rst:2646 ../../library/stdtypes.rst:3865 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2644 ../../library/stdtypes.rst:3863 +#: ../../library/stdtypes.rst:2646 ../../library/stdtypes.rst:3865 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2646 ../../library/stdtypes.rst:3865 +#: ../../library/stdtypes.rst:2648 ../../library/stdtypes.rst:3867 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2646 ../../library/stdtypes.rst:3865 +#: ../../library/stdtypes.rst:2648 ../../library/stdtypes.rst:3867 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2648 ../../library/stdtypes.rst:3867 +#: ../../library/stdtypes.rst:2650 ../../library/stdtypes.rst:3869 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2648 ../../library/stdtypes.rst:3867 +#: ../../library/stdtypes.rst:2650 ../../library/stdtypes.rst:3869 msgid "Floating-point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2650 ../../library/stdtypes.rst:3869 +#: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:3871 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2650 ../../library/stdtypes.rst:3869 +#: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:3871 msgid "Floating-point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:3871 +#: ../../library/stdtypes.rst:2654 ../../library/stdtypes.rst:3873 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:2654 -#: ../../library/stdtypes.rst:3871 ../../library/stdtypes.rst:3873 +#: ../../library/stdtypes.rst:2654 ../../library/stdtypes.rst:2656 +#: ../../library/stdtypes.rst:3873 ../../library/stdtypes.rst:3875 msgid "Floating-point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2654 ../../library/stdtypes.rst:3873 +#: ../../library/stdtypes.rst:2656 ../../library/stdtypes.rst:3875 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2656 ../../library/stdtypes.rst:3875 +#: ../../library/stdtypes.rst:2658 ../../library/stdtypes.rst:3877 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2656 ../../library/stdtypes.rst:3875 +#: ../../library/stdtypes.rst:2658 ../../library/stdtypes.rst:3877 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:2660 ../../library/stdtypes.rst:3879 +#: ../../library/stdtypes.rst:2662 ../../library/stdtypes.rst:3881 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2660 ../../library/stdtypes.rst:3879 +#: ../../library/stdtypes.rst:2662 ../../library/stdtypes.rst:3881 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:2664 ../../library/stdtypes.rst:3883 +#: ../../library/stdtypes.rst:2666 ../../library/stdtypes.rst:3885 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2664 +#: ../../library/stdtypes.rst:2666 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2667 ../../library/stdtypes.rst:3896 +#: ../../library/stdtypes.rst:2669 ../../library/stdtypes.rst:3898 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2667 +#: ../../library/stdtypes.rst:2669 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2670 ../../library/stdtypes.rst:3890 +#: ../../library/stdtypes.rst:2672 ../../library/stdtypes.rst:3892 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2670 +#: ../../library/stdtypes.rst:2672 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2673 ../../library/stdtypes.rst:3893 +#: ../../library/stdtypes.rst:2675 ../../library/stdtypes.rst:3895 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2673 +#: ../../library/stdtypes.rst:2675 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2676 ../../library/stdtypes.rst:3899 +#: ../../library/stdtypes.rst:2678 ../../library/stdtypes.rst:3901 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2676 ../../library/stdtypes.rst:3899 +#: ../../library/stdtypes.rst:2678 ../../library/stdtypes.rst:3901 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2683 ../../library/stdtypes.rst:3906 +#: ../../library/stdtypes.rst:2685 ../../library/stdtypes.rst:3908 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2687 ../../library/stdtypes.rst:3910 +#: ../../library/stdtypes.rst:2689 ../../library/stdtypes.rst:3912 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:2691 ../../library/stdtypes.rst:3914 +#: ../../library/stdtypes.rst:2693 ../../library/stdtypes.rst:3916 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2694 ../../library/stdtypes.rst:3917 +#: ../../library/stdtypes.rst:2696 ../../library/stdtypes.rst:3919 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2698 ../../library/stdtypes.rst:3921 +#: ../../library/stdtypes.rst:2700 ../../library/stdtypes.rst:3923 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:2701 ../../library/stdtypes.rst:3924 +#: ../../library/stdtypes.rst:2703 ../../library/stdtypes.rst:3926 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2705 ../../library/stdtypes.rst:3928 +#: ../../library/stdtypes.rst:2707 ../../library/stdtypes.rst:3930 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2708 ../../library/stdtypes.rst:3937 +#: ../../library/stdtypes.rst:2710 ../../library/stdtypes.rst:3939 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`。" -#: ../../library/stdtypes.rst:2710 +#: ../../library/stdtypes.rst:2712 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:2715 +#: ../../library/stdtypes.rst:2717 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2726 +#: ../../library/stdtypes.rst:2728 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2734 +#: ../../library/stdtypes.rst:2736 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 :" @@ -4246,17 +4247,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2739 +#: ../../library/stdtypes.rst:2741 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:2745 +#: ../../library/stdtypes.rst:2747 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2749 +#: ../../library/stdtypes.rst:2751 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -4264,40 +4265,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2756 +#: ../../library/stdtypes.rst:2758 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:2759 +#: ../../library/stdtypes.rst:2761 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2760 +#: ../../library/stdtypes.rst:2762 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:2761 +#: ../../library/stdtypes.rst:2763 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2763 +#: ../../library/stdtypes.rst:2765 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:2767 +#: ../../library/stdtypes.rst:2769 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:2771 +#: ../../library/stdtypes.rst:2773 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -4310,29 +4311,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:2781 +#: ../../library/stdtypes.rst:2783 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:2784 +#: ../../library/stdtypes.rst:2786 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:2785 +#: ../../library/stdtypes.rst:2787 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2786 +#: ../../library/stdtypes.rst:2788 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:2788 +#: ../../library/stdtypes.rst:2790 msgid "Also see the :ref:`bytes ` built-in." msgstr "另見內建的 :ref:`bytes `。" -#: ../../library/stdtypes.rst:2790 +#: ../../library/stdtypes.rst:2792 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -4340,32 +4341,32 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:2796 +#: ../../library/stdtypes.rst:2798 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:2803 +#: ../../library/stdtypes.rst:2805 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:2807 +#: ../../library/stdtypes.rst:2809 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2812 ../../library/stdtypes.rst:2897 +#: ../../library/stdtypes.rst:2814 ../../library/stdtypes.rst:2899 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:2818 +#: ../../library/stdtypes.rst:2820 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, " @@ -4374,13 +4375,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2835 +#: ../../library/stdtypes.rst:2837 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:2839 +#: ../../library/stdtypes.rst:2841 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 " @@ -4388,58 +4389,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2844 +#: ../../library/stdtypes.rst:2846 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:2852 +#: ../../library/stdtypes.rst:2854 msgid "Bytearray Objects" msgstr "Bytearray 物件" -#: ../../library/stdtypes.rst:2856 +#: ../../library/stdtypes.rst:2858 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2861 +#: ../../library/stdtypes.rst:2863 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2864 +#: ../../library/stdtypes.rst:2866 msgid "Creating an empty instance: ``bytearray()``" msgstr "建立一個空的實例:``bytearray()``" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2867 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2866 +#: ../../library/stdtypes.rst:2868 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2867 +#: ../../library/stdtypes.rst:2869 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2871 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " "operations described in :ref:`bytes-methods`." msgstr "" -#: ../../library/stdtypes.rst:2873 +#: ../../library/stdtypes.rst:2875 msgid "Also see the :ref:`bytearray ` built-in." msgstr "另見內建的 :ref:`bytearray `。" -#: ../../library/stdtypes.rst:2875 +#: ../../library/stdtypes.rst:2877 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -4447,33 +4448,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2881 +#: ../../library/stdtypes.rst:2883 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:2888 +#: ../../library/stdtypes.rst:2890 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2892 +#: ../../library/stdtypes.rst:2894 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2905 +#: ../../library/stdtypes.rst:2907 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:2910 +#: ../../library/stdtypes.rst:2912 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 " @@ -4481,7 +4482,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2915 +#: ../../library/stdtypes.rst:2917 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -4489,11 +4490,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2924 +#: ../../library/stdtypes.rst:2926 msgid "Bytes and Bytearray Operations" msgstr "Bytes 和 Bytearray 的操作" -#: ../../library/stdtypes.rst:2929 +#: ../../library/stdtypes.rst:2931 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -4502,14 +4503,14 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2937 +#: ../../library/stdtypes.rst:2939 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:2941 +#: ../../library/stdtypes.rst:2943 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" @@ -4517,11 +4518,11 @@ msgstr "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" -#: ../../library/stdtypes.rst:2944 +#: ../../library/stdtypes.rst:2946 msgid "and::" msgstr "和: ::" -#: ../../library/stdtypes.rst:2946 +#: ../../library/stdtypes.rst:2948 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" @@ -4529,60 +4530,60 @@ msgstr "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" -#: ../../library/stdtypes.rst:2949 +#: ../../library/stdtypes.rst:2951 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:2954 +#: ../../library/stdtypes.rst:2956 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:2957 +#: ../../library/stdtypes.rst:2959 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2963 +#: ../../library/stdtypes.rst:2965 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:2967 ../../library/stdtypes.rst:3072 -#: ../../library/stdtypes.rst:3094 ../../library/stdtypes.rst:3160 -#: ../../library/stdtypes.rst:3173 +#: ../../library/stdtypes.rst:2969 ../../library/stdtypes.rst:3074 +#: ../../library/stdtypes.rst:3096 ../../library/stdtypes.rst:3162 +#: ../../library/stdtypes.rst:3175 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:2970 +#: ../../library/stdtypes.rst:2972 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:2973 ../../library/stdtypes.rst:3084 -#: ../../library/stdtypes.rst:3097 ../../library/stdtypes.rst:3163 -#: ../../library/stdtypes.rst:3176 +#: ../../library/stdtypes.rst:2975 ../../library/stdtypes.rst:3086 +#: ../../library/stdtypes.rst:3099 ../../library/stdtypes.rst:3165 +#: ../../library/stdtypes.rst:3178 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2980 +#: ../../library/stdtypes.rst:2982 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:2984 +#: ../../library/stdtypes.rst:2986 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" @@ -4594,32 +4595,32 @@ msgstr "" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" -#: ../../library/stdtypes.rst:2989 +#: ../../library/stdtypes.rst:2991 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "*prefix* 可以是任何的 :term:`bytes-like object`。" -#: ../../library/stdtypes.rst:2993 ../../library/stdtypes.rst:3015 -#: ../../library/stdtypes.rst:3148 ../../library/stdtypes.rst:3241 -#: ../../library/stdtypes.rst:3255 ../../library/stdtypes.rst:3286 -#: ../../library/stdtypes.rst:3300 ../../library/stdtypes.rst:3342 -#: ../../library/stdtypes.rst:3413 ../../library/stdtypes.rst:3431 -#: ../../library/stdtypes.rst:3459 ../../library/stdtypes.rst:3598 -#: ../../library/stdtypes.rst:3653 ../../library/stdtypes.rst:3696 -#: ../../library/stdtypes.rst:3717 ../../library/stdtypes.rst:3739 -#: ../../library/stdtypes.rst:3941 +#: ../../library/stdtypes.rst:2995 ../../library/stdtypes.rst:3017 +#: ../../library/stdtypes.rst:3150 ../../library/stdtypes.rst:3243 +#: ../../library/stdtypes.rst:3257 ../../library/stdtypes.rst:3288 +#: ../../library/stdtypes.rst:3302 ../../library/stdtypes.rst:3344 +#: ../../library/stdtypes.rst:3415 ../../library/stdtypes.rst:3433 +#: ../../library/stdtypes.rst:3461 ../../library/stdtypes.rst:3600 +#: ../../library/stdtypes.rst:3655 ../../library/stdtypes.rst:3698 +#: ../../library/stdtypes.rst:3719 ../../library/stdtypes.rst:3741 +#: ../../library/stdtypes.rst:3943 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:3002 +#: ../../library/stdtypes.rst:3004 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:3006 +#: ../../library/stdtypes.rst:3008 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" @@ -4631,15 +4632,15 @@ msgstr "" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" -#: ../../library/stdtypes.rst:3011 +#: ../../library/stdtypes.rst:3013 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3024 +#: ../../library/stdtypes.rst:3026 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:3029 +#: ../../library/stdtypes.rst:3031 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -4647,21 +4648,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:3035 +#: ../../library/stdtypes.rst:3037 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" "`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:3041 +#: ../../library/stdtypes.rst:3043 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:3056 +#: ../../library/stdtypes.rst:3058 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -4669,11 +4670,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3061 +#: ../../library/stdtypes.rst:3063 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3067 +#: ../../library/stdtypes.rst:3069 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 " @@ -4681,14 +4682,14 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3077 +#: ../../library/stdtypes.rst:3079 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:3081 +#: ../../library/stdtypes.rst:3083 msgid "" ">>> b'Py' in b'Python'\n" "True" @@ -4696,13 +4697,13 @@ msgstr "" ">>> b'Py' in b'Python'\n" "True" -#: ../../library/stdtypes.rst:3091 +#: ../../library/stdtypes.rst:3093 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:3104 +#: ../../library/stdtypes.rst:3106 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 " @@ -4712,7 +4713,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:3115 +#: ../../library/stdtypes.rst:3117 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 " @@ -4720,7 +4721,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:3126 +#: ../../library/stdtypes.rst:3128 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 " @@ -4729,24 +4730,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:3133 ../../library/stdtypes.rst:3190 +#: ../../library/stdtypes.rst:3135 ../../library/stdtypes.rst:3192 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3139 +#: ../../library/stdtypes.rst:3141 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:3143 +#: ../../library/stdtypes.rst:3145 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3155 +#: ../../library/stdtypes.rst:3157 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -4754,13 +4755,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:3170 +#: ../../library/stdtypes.rst:3172 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3183 +#: ../../library/stdtypes.rst:3185 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 " @@ -4769,7 +4770,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:3196 +#: ../../library/stdtypes.rst:3198 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -4777,11 +4778,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3201 +#: ../../library/stdtypes.rst:3203 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3207 +#: ../../library/stdtypes.rst:3209 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 " @@ -4789,18 +4790,18 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:3212 +#: ../../library/stdtypes.rst:3214 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:3215 +#: ../../library/stdtypes.rst:3217 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:3218 +#: ../../library/stdtypes.rst:3220 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" @@ -4808,11 +4809,11 @@ msgstr "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" -#: ../../library/stdtypes.rst:3221 +#: ../../library/stdtypes.rst:3223 msgid "*delete* is now supported as a keyword argument." msgstr "支援 *delete* 關鍵字引數。" -#: ../../library/stdtypes.rst:3225 +#: ../../library/stdtypes.rst:3227 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 " @@ -4821,7 +4822,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3234 +#: ../../library/stdtypes.rst:3236 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). " @@ -4829,7 +4830,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3248 +#: ../../library/stdtypes.rst:3250 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). " @@ -4837,7 +4838,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3262 +#: ../../library/stdtypes.rst:3264 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 " @@ -4847,7 +4848,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3269 +#: ../../library/stdtypes.rst:3271 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" @@ -4859,14 +4860,14 @@ msgstr "" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" -#: ../../library/stdtypes.rst:3274 +#: ../../library/stdtypes.rst:3276 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:3279 +#: ../../library/stdtypes.rst:3281 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" @@ -4878,7 +4879,7 @@ msgstr "" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" -#: ../../library/stdtypes.rst:3293 +#: ../../library/stdtypes.rst:3295 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). " @@ -4886,7 +4887,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3307 +#: ../../library/stdtypes.rst:3309 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 " @@ -4896,7 +4897,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3318 +#: ../../library/stdtypes.rst:3320 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 " @@ -4906,7 +4907,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3325 +#: ../../library/stdtypes.rst:3327 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" @@ -4918,14 +4919,14 @@ msgstr "" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" -#: ../../library/stdtypes.rst:3330 +#: ../../library/stdtypes.rst:3332 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:3335 +#: ../../library/stdtypes.rst:3337 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" @@ -4937,7 +4938,7 @@ msgstr "" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" -#: ../../library/stdtypes.rst:3349 +#: ../../library/stdtypes.rst:3351 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 " @@ -4946,7 +4947,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3355 +#: ../../library/stdtypes.rst:3357 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',')`` " @@ -4957,7 +4958,7 @@ msgid "" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3365 +#: ../../library/stdtypes.rst:3367 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -4977,7 +4978,7 @@ msgstr "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" -#: ../../library/stdtypes.rst:3374 +#: ../../library/stdtypes.rst:3376 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 " @@ -4987,7 +4988,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3384 +#: ../../library/stdtypes.rst:3386 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -5003,7 +5004,7 @@ msgstr "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" -#: ../../library/stdtypes.rst:3395 +#: ../../library/stdtypes.rst:3397 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 " @@ -5013,7 +5014,7 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3403 +#: ../../library/stdtypes.rst:3405 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" @@ -5025,13 +5026,13 @@ msgstr "" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" -#: ../../library/stdtypes.rst:3408 +#: ../../library/stdtypes.rst:3410 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3417 +#: ../../library/stdtypes.rst:3419 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 " @@ -5039,14 +5040,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3425 +#: ../../library/stdtypes.rst:3427 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:3438 +#: ../../library/stdtypes.rst:3440 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 " @@ -5062,7 +5063,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3452 +#: ../../library/stdtypes.rst:3454 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" @@ -5074,7 +5075,7 @@ msgstr "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" -#: ../../library/stdtypes.rst:3466 +#: ../../library/stdtypes.rst:3468 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -5083,7 +5084,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3474 +#: ../../library/stdtypes.rst:3476 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" @@ -5095,7 +5096,7 @@ msgstr "" ">>> b'ABC abc1'.isalnum()\n" "False" -#: ../../library/stdtypes.rst:3483 +#: ../../library/stdtypes.rst:3485 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -5103,7 +5104,7 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3490 +#: ../../library/stdtypes.rst:3492 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" @@ -5115,20 +5116,20 @@ msgstr "" ">>> b'ABCabc1'.isalpha()\n" "False" -#: ../../library/stdtypes.rst:3499 +#: ../../library/stdtypes.rst:3501 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:3509 +#: ../../library/stdtypes.rst:3511 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:3515 +#: ../../library/stdtypes.rst:3517 msgid "" ">>> b'1234'.isdigit()\n" "True\n" @@ -5140,13 +5141,13 @@ msgstr "" ">>> b'1.23'.isdigit()\n" "False" -#: ../../library/stdtypes.rst:3524 +#: ../../library/stdtypes.rst:3526 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:3529 +#: ../../library/stdtypes.rst:3531 msgid "" ">>> b'hello world'.islower()\n" "True\n" @@ -5158,16 +5159,16 @@ msgstr "" ">>> b'Hello world'.islower()\n" "False" -#: ../../library/stdtypes.rst:3534 ../../library/stdtypes.rst:3576 -#: ../../library/stdtypes.rst:3592 ../../library/stdtypes.rst:3642 -#: ../../library/stdtypes.rst:3711 +#: ../../library/stdtypes.rst:3536 ../../library/stdtypes.rst:3578 +#: ../../library/stdtypes.rst:3594 ../../library/stdtypes.rst:3644 +#: ../../library/stdtypes.rst:3713 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:3542 +#: ../../library/stdtypes.rst:3544 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -5175,14 +5176,14 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3551 +#: ../../library/stdtypes.rst:3553 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:3557 +#: ../../library/stdtypes.rst:3559 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" @@ -5194,14 +5195,14 @@ msgstr "" ">>> b'Hello world'.istitle()\n" "False" -#: ../../library/stdtypes.rst:3566 +#: ../../library/stdtypes.rst:3568 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:3571 +#: ../../library/stdtypes.rst:3573 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" @@ -5213,13 +5214,13 @@ msgstr "" ">>> b'Hello world'.isupper()\n" "False" -#: ../../library/stdtypes.rst:3584 +#: ../../library/stdtypes.rst:3586 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:3591 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" @@ -5227,7 +5228,7 @@ msgstr "" ">>> b'Hello World'.lower()\n" "b'hello world'" -#: ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:3611 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 " @@ -5235,7 +5236,7 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3616 +#: ../../library/stdtypes.rst:3618 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" @@ -5247,14 +5248,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:3621 +#: ../../library/stdtypes.rst:3623 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:3625 +#: ../../library/stdtypes.rst:3627 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" @@ -5266,13 +5267,13 @@ msgstr "" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" -#: ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:3636 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:3639 +#: ../../library/stdtypes.rst:3641 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" @@ -5280,7 +5281,7 @@ msgstr "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" -#: ../../library/stdtypes.rst:3646 +#: ../../library/stdtypes.rst:3648 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -5288,14 +5289,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3660 +#: ../../library/stdtypes.rst:3662 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:3666 +#: ../../library/stdtypes.rst:3668 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" @@ -5303,7 +5304,7 @@ msgstr "" ">>> b'Hello world'.title()\n" "b'Hello World'" -#: ../../library/stdtypes.rst:3669 +#: ../../library/stdtypes.rst:3671 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -5311,7 +5312,7 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3679 +#: ../../library/stdtypes.rst:3681 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" @@ -5319,12 +5320,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:3682 +#: ../../library/stdtypes.rst:3684 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3684 +#: ../../library/stdtypes.rst:3686 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -5346,13 +5347,13 @@ msgstr "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:3703 +#: ../../library/stdtypes.rst:3705 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3708 +#: ../../library/stdtypes.rst:3710 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" @@ -5360,7 +5361,7 @@ msgstr "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" -#: ../../library/stdtypes.rst:3724 +#: ../../library/stdtypes.rst:3726 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 " @@ -5369,7 +5370,7 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3732 +#: ../../library/stdtypes.rst:3734 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" @@ -5381,11 +5382,11 @@ msgstr "" ">>> b\"-42\".zfill(5)\n" "b'-0042'" -#: ../../library/stdtypes.rst:3746 +#: ../../library/stdtypes.rst:3748 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3763 +#: ../../library/stdtypes.rst:3765 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 " @@ -5393,7 +5394,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3768 +#: ../../library/stdtypes.rst:3770 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -5403,7 +5404,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3775 +#: ../../library/stdtypes.rst:3777 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 " @@ -5411,7 +5412,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3809 +#: ../../library/stdtypes.rst:3811 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 " @@ -5419,73 +5420,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3883 +#: ../../library/stdtypes.rst:3885 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3886 +#: ../../library/stdtypes.rst:3888 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3886 +#: ../../library/stdtypes.rst:3888 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`~object.__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3890 +#: ../../library/stdtypes.rst:3892 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3893 +#: ../../library/stdtypes.rst:3895 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3896 +#: ../../library/stdtypes.rst:3898 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3896 +#: ../../library/stdtypes.rst:3898 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3931 +#: ../../library/stdtypes.rst:3933 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%s'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:3934 +#: ../../library/stdtypes.rst:3936 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%r'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:3946 +#: ../../library/stdtypes.rst:3948 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3953 +#: ../../library/stdtypes.rst:3955 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3955 +#: ../../library/stdtypes.rst:3957 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying." msgstr "" -#: ../../library/stdtypes.rst:3961 +#: ../../library/stdtypes.rst:3963 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:3965 +#: ../../library/stdtypes.rst:3967 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 " @@ -5493,32 +5494,32 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3970 +#: ../../library/stdtypes.rst:3972 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:3974 +#: ../../library/stdtypes.rst:3976 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -#: ../../library/stdtypes.rst:3977 +#: ../../library/stdtypes.rst:3979 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3980 +#: ../../library/stdtypes.rst:3982 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3983 +#: ../../library/stdtypes.rst:3985 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -5540,7 +5541,7 @@ msgstr "" ">>> bytes(v[1:4])\n" "b'bce'" -#: ../../library/stdtypes.rst:3993 +#: ../../library/stdtypes.rst:3995 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 " @@ -5551,11 +5552,11 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:4002 +#: ../../library/stdtypes.rst:4004 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:4004 +#: ../../library/stdtypes.rst:4006 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -5577,13 +5578,13 @@ msgstr "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" -#: ../../library/stdtypes.rst:4014 +#: ../../library/stdtypes.rst:4016 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:4017 +#: ../../library/stdtypes.rst:4019 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -5623,14 +5624,14 @@ msgstr "" ">>> data\n" "bytearray(b'z1spam')" -#: ../../library/stdtypes.rst:4035 +#: ../../library/stdtypes.rst:4037 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:4039 +#: ../../library/stdtypes.rst:4041 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -5648,40 +5649,40 @@ msgstr "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" -#: ../../library/stdtypes.rst:4047 +#: ../../library/stdtypes.rst:4049 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:4051 +#: ../../library/stdtypes.rst:4053 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:4055 +#: ../../library/stdtypes.rst:4057 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:4058 +#: ../../library/stdtypes.rst:4060 msgid ":class:`memoryview` has several methods:" msgstr ":class:`memoryview` 有幾個方法:" -#: ../../library/stdtypes.rst:4062 +#: ../../library/stdtypes.rst:4064 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:4066 +#: ../../library/stdtypes.rst:4068 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:4069 +#: ../../library/stdtypes.rst:4071 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -5715,14 +5716,14 @@ msgstr "" ">>> z.tolist() == c.tolist()\n" "True" -#: ../../library/stdtypes.rst:4085 +#: ../../library/stdtypes.rst:4087 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:4089 +#: ../../library/stdtypes.rst:4091 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -5748,25 +5749,25 @@ msgstr "" ">>> a == b\n" "False" -#: ../../library/stdtypes.rst:4101 +#: ../../library/stdtypes.rst:4103 msgid "" "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:4104 +#: ../../library/stdtypes.rst:4106 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:4110 +#: ../../library/stdtypes.rst:4112 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:4113 +#: ../../library/stdtypes.rst:4115 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -5780,7 +5781,7 @@ msgstr "" ">>> bytes(m)\n" "b'abc'" -#: ../../library/stdtypes.rst:4119 +#: ../../library/stdtypes.rst:4121 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -5788,7 +5789,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:4124 +#: ../../library/stdtypes.rst:4126 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' " @@ -5797,13 +5798,13 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:4133 +#: ../../library/stdtypes.rst:4135 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:4136 +#: ../../library/stdtypes.rst:4138 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" @@ -5813,18 +5814,18 @@ msgstr "" ">>> m.hex()\n" "'616263'" -#: ../../library/stdtypes.rst:4142 +#: ../../library/stdtypes.rst:4144 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:4149 +#: ../../library/stdtypes.rst:4151 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:4151 +#: ../../library/stdtypes.rst:4153 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -5842,19 +5843,19 @@ msgstr "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" -#: ../../library/stdtypes.rst:4159 +#: ../../library/stdtypes.rst:4161 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:4166 +#: ../../library/stdtypes.rst:4168 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:4169 +#: ../../library/stdtypes.rst:4171 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -5880,7 +5881,7 @@ msgstr "" ">>> mm.tolist()\n" "[43, 98, 99]" -#: ../../library/stdtypes.rst:4185 +#: ../../library/stdtypes.rst:4187 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 :" @@ -5889,14 +5890,14 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:4191 +#: ../../library/stdtypes.rst:4193 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:4195 +#: ../../library/stdtypes.rst:4197 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -5912,13 +5913,13 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4202 +#: ../../library/stdtypes.rst:4204 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:4205 +#: ../../library/stdtypes.rst:4207 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -5938,7 +5939,7 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4218 +#: ../../library/stdtypes.rst:4220 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 " @@ -5947,7 +5948,7 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:4224 +#: ../../library/stdtypes.rst:4226 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 " @@ -5955,11 +5956,11 @@ msgid "" "Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:4230 +#: ../../library/stdtypes.rst:4232 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:4232 +#: ../../library/stdtypes.rst:4234 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -6003,11 +6004,11 @@ msgstr "" ">>> y.nbytes\n" "24" -#: ../../library/stdtypes.rst:4253 +#: ../../library/stdtypes.rst:4255 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4255 +#: ../../library/stdtypes.rst:4257 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -6031,11 +6032,11 @@ msgstr "" ">>> b\n" "bytearray(b'ayz')" -#: ../../library/stdtypes.rst:4266 +#: ../../library/stdtypes.rst:4268 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4268 +#: ../../library/stdtypes.rst:4270 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -6085,11 +6086,11 @@ msgstr "" ">>> z.nbytes\n" "48" -#: ../../library/stdtypes.rst:4292 +#: ../../library/stdtypes.rst:4294 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4294 +#: ../../library/stdtypes.rst:4296 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -6111,19 +6112,19 @@ msgstr "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" -#: ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:4308 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4309 +#: ../../library/stdtypes.rst:4311 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4313 +#: ../../library/stdtypes.rst:4315 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4315 +#: ../../library/stdtypes.rst:4317 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" @@ -6135,14 +6136,14 @@ msgstr "" ">>> m.obj is b\n" "True" -#: ../../library/stdtypes.rst:4324 +#: ../../library/stdtypes.rst:4326 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:4328 +#: ../../library/stdtypes.rst:4330 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -6174,11 +6175,11 @@ msgstr "" ">>> len(y.tobytes())\n" "12" -#: ../../library/stdtypes.rst:4343 +#: ../../library/stdtypes.rst:4345 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4345 +#: ../../library/stdtypes.rst:4347 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" @@ -6202,11 +6203,11 @@ msgstr "" ">>> y.nbytes\n" "96" -#: ../../library/stdtypes.rst:4360 +#: ../../library/stdtypes.rst:4362 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4364 +#: ../../library/stdtypes.rst:4366 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 " @@ -6214,17 +6215,17 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4371 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:4375 +#: ../../library/stdtypes.rst:4377 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4377 +#: ../../library/stdtypes.rst:4379 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -6244,49 +6245,49 @@ msgstr "" ">>> struct.calcsize('H') == m.itemsize\n" "True" -#: ../../library/stdtypes.rst:4388 +#: ../../library/stdtypes.rst:4390 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4393 +#: ../../library/stdtypes.rst:4395 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:4396 ../../library/stdtypes.rst:4404 +#: ../../library/stdtypes.rst:4398 ../../library/stdtypes.rst:4406 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:4403 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:4409 +#: ../../library/stdtypes.rst:4411 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4413 +#: ../../library/stdtypes.rst:4415 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4419 +#: ../../library/stdtypes.rst:4421 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4425 +#: ../../library/stdtypes.rst:4427 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4433 +#: ../../library/stdtypes.rst:4435 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4437 +#: ../../library/stdtypes.rst:4439 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -6296,7 +6297,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4444 +#: ../../library/stdtypes.rst:4446 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 " @@ -6304,7 +6305,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4449 +#: ../../library/stdtypes.rst:4451 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -6316,18 +6317,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4457 +#: ../../library/stdtypes.rst:4459 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:4461 +#: ../../library/stdtypes.rst:4463 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4466 +#: ../../library/stdtypes.rst:4468 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 " @@ -6335,92 +6336,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4472 +#: ../../library/stdtypes.rst:4474 msgid "Sets can be created by several means:" -msgstr "" +msgstr "集合可以以多種方式建立:" -#: ../../library/stdtypes.rst:4474 +#: ../../library/stdtypes.rst:4476 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4475 +#: ../../library/stdtypes.rst:4477 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4476 +#: ../../library/stdtypes.rst:4478 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4478 +#: ../../library/stdtypes.rst:4480 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4483 +#: ../../library/stdtypes.rst:4485 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4487 +#: ../../library/stdtypes.rst:4489 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4491 +#: ../../library/stdtypes.rst:4493 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4495 +#: ../../library/stdtypes.rst:4497 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:4501 +#: ../../library/stdtypes.rst:4503 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4505 +#: ../../library/stdtypes.rst:4507 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4511 +#: ../../library/stdtypes.rst:4513 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4515 +#: ../../library/stdtypes.rst:4517 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4521 +#: ../../library/stdtypes.rst:4523 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4526 +#: ../../library/stdtypes.rst:4528 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4531 +#: ../../library/stdtypes.rst:4533 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4536 +#: ../../library/stdtypes.rst:4538 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4540 +#: ../../library/stdtypes.rst:4542 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4543 +#: ../../library/stdtypes.rst:4545 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -6430,7 +6431,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4550 +#: ../../library/stdtypes.rst:4552 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 " @@ -6440,14 +6441,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4557 +#: ../../library/stdtypes.rst:4559 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:4561 +#: ../../library/stdtypes.rst:4563 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 " @@ -6455,71 +6456,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4566 +#: ../../library/stdtypes.rst:4568 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:4569 +#: ../../library/stdtypes.rst:4571 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4571 +#: ../../library/stdtypes.rst:4573 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:4575 +#: ../../library/stdtypes.rst:4577 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4581 +#: ../../library/stdtypes.rst:4583 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4586 +#: ../../library/stdtypes.rst:4588 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4591 +#: ../../library/stdtypes.rst:4593 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4596 +#: ../../library/stdtypes.rst:4598 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4600 +#: ../../library/stdtypes.rst:4602 msgid "Add element *elem* to the set." msgstr "將元素 *elem* 加入集合。" -#: ../../library/stdtypes.rst:4604 +#: ../../library/stdtypes.rst:4606 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4609 +#: ../../library/stdtypes.rst:4611 msgid "Remove element *elem* from the set if it is present." msgstr "如果 *elem* 存在於集合中則將其移除。" -#: ../../library/stdtypes.rst:4613 +#: ../../library/stdtypes.rst:4615 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4618 +#: ../../library/stdtypes.rst:4620 msgid "Remove all elements from the set." msgstr "從集合中移除所有元素。" -#: ../../library/stdtypes.rst:4621 +#: ../../library/stdtypes.rst:4623 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -6527,18 +6528,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4626 +#: ../../library/stdtypes.rst:4628 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:4635 +#: ../../library/stdtypes.rst:4637 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4645 +#: ../../library/stdtypes.rst:4647 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -6547,7 +6548,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4651 +#: ../../library/stdtypes.rst:4653 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -6556,33 +6557,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4662 +#: ../../library/stdtypes.rst:4664 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4665 +#: ../../library/stdtypes.rst:4667 msgid "Dictionaries can be created by several means:" msgstr "字典可以用數種方式建立:" -#: ../../library/stdtypes.rst:4667 +#: ../../library/stdtypes.rst:4669 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:4669 +#: ../../library/stdtypes.rst:4671 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4670 +#: ../../library/stdtypes.rst:4672 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4673 +#: ../../library/stdtypes.rst:4675 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 " @@ -6595,7 +6596,7 @@ msgid "" "that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4683 +#: ../../library/stdtypes.rst:4685 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 " @@ -6603,13 +6604,13 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4688 ../../library/stdtypes.rst:4706 +#: ../../library/stdtypes.rst:4690 ../../library/stdtypes.rst:4708 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:4691 +#: ../../library/stdtypes.rst:4693 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -6618,7 +6619,7 @@ msgid "" "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4697 +#: ../../library/stdtypes.rst:4699 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -6638,13 +6639,13 @@ msgstr "" ">>> a == b == c == d == e == f\n" "True" -#: ../../library/stdtypes.rst:4709 +#: ../../library/stdtypes.rst:4711 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:4712 +#: ../../library/stdtypes.rst:4714 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -6676,33 +6677,33 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:4727 +#: ../../library/stdtypes.rst:4729 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4731 +#: ../../library/stdtypes.rst:4733 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4736 +#: ../../library/stdtypes.rst:4738 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4740 +#: ../../library/stdtypes.rst:4742 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4744 +#: ../../library/stdtypes.rst:4746 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4749 +#: ../../library/stdtypes.rst:4751 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 " @@ -6713,7 +6714,7 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4757 +#: ../../library/stdtypes.rst:4759 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -6737,51 +6738,51 @@ msgstr "" ">>> c['red']\n" "1" -#: ../../library/stdtypes.rst:4768 +#: ../../library/stdtypes.rst:4770 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:4774 +#: ../../library/stdtypes.rst:4776 msgid "Set ``d[key]`` to *value*." msgstr "將 ``d[key]`` 設為 *value*。" -#: ../../library/stdtypes.rst:4778 +#: ../../library/stdtypes.rst:4780 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "從 *d* 中移除 ``d[key]``。若 *key* 不在對映中則引發 :exc:`KeyError`。" -#: ../../library/stdtypes.rst:4783 +#: ../../library/stdtypes.rst:4785 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "若 *d* 有鍵 *key* 則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/stdtypes.rst:4787 +#: ../../library/stdtypes.rst:4789 msgid "Equivalent to ``not key in d``." msgstr "等價於 ``not key in d``。" -#: ../../library/stdtypes.rst:4791 +#: ../../library/stdtypes.rst:4793 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4796 +#: ../../library/stdtypes.rst:4798 msgid "Remove all items from the dictionary." msgstr "從字典中移除所有項目。" -#: ../../library/stdtypes.rst:4800 +#: ../../library/stdtypes.rst:4802 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4804 +#: ../../library/stdtypes.rst:4806 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4806 +#: ../../library/stdtypes.rst:4808 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 " @@ -6790,70 +6791,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4814 +#: ../../library/stdtypes.rst:4816 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:4820 +#: ../../library/stdtypes.rst:4822 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4825 +#: ../../library/stdtypes.rst:4827 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4830 +#: ../../library/stdtypes.rst:4832 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:4836 +#: ../../library/stdtypes.rst:4838 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:4839 +#: ../../library/stdtypes.rst:4841 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:4843 +#: ../../library/stdtypes.rst:4845 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4849 +#: ../../library/stdtypes.rst:4851 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4856 +#: ../../library/stdtypes.rst:4858 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:4862 +#: ../../library/stdtypes.rst:4864 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4865 +#: ../../library/stdtypes.rst:4867 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -6862,20 +6863,20 @@ msgid "" "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4873 +#: ../../library/stdtypes.rst:4875 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4876 +#: ../../library/stdtypes.rst:4878 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:4880 +#: ../../library/stdtypes.rst:4882 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -6885,25 +6886,25 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:4886 +#: ../../library/stdtypes.rst:4888 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:4894 +#: ../../library/stdtypes.rst:4896 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:4900 +#: ../../library/stdtypes.rst:4902 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4902 +#: ../../library/stdtypes.rst:4904 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -6925,21 +6926,21 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:4912 +#: ../../library/stdtypes.rst:4914 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4917 +#: ../../library/stdtypes.rst:4919 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4924 +#: ../../library/stdtypes.rst:4926 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4926 +#: ../../library/stdtypes.rst:4928 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 " @@ -6947,23 +6948,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4931 +#: ../../library/stdtypes.rst:4933 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4936 +#: ../../library/stdtypes.rst:4938 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4940 +#: ../../library/stdtypes.rst:4942 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4943 +#: ../../library/stdtypes.rst:4945 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -6971,39 +6972,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4948 +#: ../../library/stdtypes.rst:4950 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:4951 +#: ../../library/stdtypes.rst:4953 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4956 +#: ../../library/stdtypes.rst:4958 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:4961 +#: ../../library/stdtypes.rst:4963 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:4964 +#: ../../library/stdtypes.rst:4966 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4971 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4976 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 " @@ -7017,11 +7018,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:4986 +#: ../../library/stdtypes.rst:4988 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:4990 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -7062,11 +7063,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:5032 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:5037 +#: ../../library/stdtypes.rst:5039 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 " @@ -7077,7 +7078,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:5045 +#: ../../library/stdtypes.rst:5047 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 " @@ -7088,7 +7089,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:5050 +#: ../../library/stdtypes.rst:5052 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -7097,7 +7098,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:5054 +#: ../../library/stdtypes.rst:5056 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 " @@ -7111,7 +7112,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的目前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:5064 +#: ../../library/stdtypes.rst:5066 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -7123,7 +7124,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:5069 +#: ../../library/stdtypes.rst:5071 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -7138,7 +7139,7 @@ msgstr "" "(propagate)。執行此方法期間發生的例外會取代 :keyword:`!with` 陳述式主體中發生" "的任何例外。" -#: ../../library/stdtypes.rst:5076 +#: ../../library/stdtypes.rst:5078 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -7150,7 +7151,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:5082 +#: ../../library/stdtypes.rst:5084 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -7162,7 +7163,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:5088 +#: ../../library/stdtypes.rst:5090 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -7177,7 +7178,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:5095 +#: ../../library/stdtypes.rst:5097 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 " @@ -7189,7 +7190,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:5103 +#: ../../library/stdtypes.rst:5105 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -7197,7 +7198,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" "ref:`聯合 (Union) `" -#: ../../library/stdtypes.rst:5108 +#: ../../library/stdtypes.rst:5110 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -7205,11 +7206,11 @@ msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" -#: ../../library/stdtypes.rst:5115 +#: ../../library/stdtypes.rst:5117 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:5121 +#: ../../library/stdtypes.rst:5123 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -7225,7 +7226,7 @@ msgstr "" "立的。``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使" "用。" -#: ../../library/stdtypes.rst:5131 +#: ../../library/stdtypes.rst:5133 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -7233,7 +7234,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:5134 +#: ../../library/stdtypes.rst:5136 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -7241,7 +7242,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:5137 +#: ../../library/stdtypes.rst:5139 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 " @@ -7253,7 +7254,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:5143 +#: ../../library/stdtypes.rst:5145 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 " @@ -7265,7 +7266,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 `\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:5149 +#: ../../library/stdtypes.rst:5151 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 " @@ -7277,7 +7278,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:5155 +#: ../../library/stdtypes.rst:5157 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." @@ -7290,7 +7291,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match ` 物件。" -#: ../../library/stdtypes.rst:5161 +#: ../../library/stdtypes.rst:5163 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -7299,7 +7300,7 @@ msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" -#: ../../library/stdtypes.rst:5167 +#: ../../library/stdtypes.rst:5169 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -7309,7 +7310,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:5172 +#: ../../library/stdtypes.rst:5174 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -7317,7 +7318,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:5175 +#: ../../library/stdtypes.rst:5177 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 " @@ -7328,7 +7329,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:5180 +#: ../../library/stdtypes.rst:5182 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -7336,7 +7337,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:5183 +#: ../../library/stdtypes.rst:5185 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -7344,7 +7345,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:5186 +#: ../../library/stdtypes.rst:5188 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -7356,7 +7357,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:5191 +#: ../../library/stdtypes.rst:5193 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -7368,7 +7369,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:5197 +#: ../../library/stdtypes.rst:5199 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -7378,13 +7379,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:5201 +#: ../../library/stdtypes.rst:5203 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5204 +#: ../../library/stdtypes.rst:5206 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -7402,13 +7403,13 @@ msgstr "" ">>> type(l)\n" "" -#: ../../library/stdtypes.rst:5212 +#: ../../library/stdtypes.rst:5214 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5214 +#: ../../library/stdtypes.rst:5216 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -7422,7 +7423,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5220 +#: ../../library/stdtypes.rst:5222 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -7430,7 +7431,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5223 +#: ../../library/stdtypes.rst:5225 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -7442,7 +7443,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5228 +#: ../../library/stdtypes.rst:5230 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -7452,7 +7453,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5232 +#: ../../library/stdtypes.rst:5234 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -7464,253 +7465,253 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5239 +#: ../../library/stdtypes.rst:5241 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5241 +#: ../../library/stdtypes.rst:5243 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5244 +#: ../../library/stdtypes.rst:5246 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5245 +#: ../../library/stdtypes.rst:5247 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5246 +#: ../../library/stdtypes.rst:5248 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5247 +#: ../../library/stdtypes.rst:5249 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5248 +#: ../../library/stdtypes.rst:5250 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5249 +#: ../../library/stdtypes.rst:5251 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5250 +#: ../../library/stdtypes.rst:5252 msgid ":class:`asyncio.Future`" msgstr ":class:`asyncio.Future`" -#: ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5253 msgid ":class:`asyncio.Task`" msgstr ":class:`asyncio.Task`" -#: ../../library/stdtypes.rst:5252 +#: ../../library/stdtypes.rst:5254 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5253 +#: ../../library/stdtypes.rst:5255 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5254 +#: ../../library/stdtypes.rst:5256 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5255 +#: ../../library/stdtypes.rst:5257 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5256 +#: ../../library/stdtypes.rst:5258 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5257 +#: ../../library/stdtypes.rst:5259 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5258 +#: ../../library/stdtypes.rst:5260 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5261 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5260 +#: ../../library/stdtypes.rst:5262 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5261 +#: ../../library/stdtypes.rst:5263 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5262 +#: ../../library/stdtypes.rst:5264 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5263 +#: ../../library/stdtypes.rst:5265 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5264 +#: ../../library/stdtypes.rst:5266 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5265 +#: ../../library/stdtypes.rst:5267 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5266 +#: ../../library/stdtypes.rst:5268 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5267 +#: ../../library/stdtypes.rst:5269 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5268 +#: ../../library/stdtypes.rst:5270 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5269 +#: ../../library/stdtypes.rst:5271 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5270 +#: ../../library/stdtypes.rst:5272 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5271 +#: ../../library/stdtypes.rst:5273 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5272 +#: ../../library/stdtypes.rst:5274 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5273 +#: ../../library/stdtypes.rst:5275 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5274 +#: ../../library/stdtypes.rst:5276 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5275 +#: ../../library/stdtypes.rst:5277 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5276 +#: ../../library/stdtypes.rst:5278 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5277 +#: ../../library/stdtypes.rst:5279 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5278 +#: ../../library/stdtypes.rst:5280 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5279 +#: ../../library/stdtypes.rst:5281 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5280 +#: ../../library/stdtypes.rst:5282 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5281 +#: ../../library/stdtypes.rst:5283 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5282 +#: ../../library/stdtypes.rst:5284 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5283 +#: ../../library/stdtypes.rst:5285 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5284 +#: ../../library/stdtypes.rst:5286 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5285 +#: ../../library/stdtypes.rst:5287 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5286 +#: ../../library/stdtypes.rst:5288 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5287 +#: ../../library/stdtypes.rst:5289 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5288 +#: ../../library/stdtypes.rst:5290 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5289 +#: ../../library/stdtypes.rst:5291 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5290 +#: ../../library/stdtypes.rst:5292 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5291 +#: ../../library/stdtypes.rst:5293 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5292 +#: ../../library/stdtypes.rst:5294 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5293 +#: ../../library/stdtypes.rst:5295 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5294 +#: ../../library/stdtypes.rst:5296 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5295 +#: ../../library/stdtypes.rst:5297 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5296 +#: ../../library/stdtypes.rst:5298 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5297 +#: ../../library/stdtypes.rst:5299 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:5300 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5299 +#: ../../library/stdtypes.rst:5301 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5304 +#: ../../library/stdtypes.rst:5306 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5306 +#: ../../library/stdtypes.rst:5308 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5310 +#: ../../library/stdtypes.rst:5312 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5312 +#: ../../library/stdtypes.rst:5314 msgid "" ">>> list[int].__origin__\n" "" @@ -7718,7 +7719,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5318 +#: ../../library/stdtypes.rst:5320 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 " @@ -7727,7 +7728,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5322 +#: ../../library/stdtypes.rst:5324 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -7735,7 +7736,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5328 +#: ../../library/stdtypes.rst:5330 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -7743,7 +7744,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5331 +#: ../../library/stdtypes.rst:5333 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -7757,7 +7758,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5339 +#: ../../library/stdtypes.rst:5341 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -7767,7 +7768,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5346 +#: ../../library/stdtypes.rst:5348 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -7775,19 +7776,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5354 +#: ../../library/stdtypes.rst:5356 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5355 +#: ../../library/stdtypes.rst:5357 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5357 +#: ../../library/stdtypes.rst:5359 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5358 +#: ../../library/stdtypes.rst:5360 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -7796,7 +7797,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5362 +#: ../../library/stdtypes.rst:5364 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -7804,18 +7805,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:5363 +#: ../../library/stdtypes.rst:5365 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:5372 +#: ../../library/stdtypes.rst:5374 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5378 +#: ../../library/stdtypes.rst:5380 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -7828,7 +7829,7 @@ msgstr "" "釋 (type annotation) `。與 :data:`typing.Union` 相比,聯合型別運" "算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5385 +#: ../../library/stdtypes.rst:5387 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 " @@ -7839,7 +7840,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:5392 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -7847,7 +7848,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:5395 +#: ../../library/stdtypes.rst:5397 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 " @@ -7860,58 +7861,58 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:5405 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:5405 +#: ../../library/stdtypes.rst:5407 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:5407 +#: ../../library/stdtypes.rst:5409 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:5409 +#: ../../library/stdtypes.rst:5411 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:5411 +#: ../../library/stdtypes.rst:5413 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:5413 +#: ../../library/stdtypes.rst:5415 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:5415 +#: ../../library/stdtypes.rst:5417 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:5417 +#: ../../library/stdtypes.rst:5419 msgid "It is compatible with :data:`typing.Union`::" msgstr "它與 :data:`typing.Union` 相容: ::" -#: ../../library/stdtypes.rst:5419 +#: ../../library/stdtypes.rst:5421 msgid "int | str == typing.Union[int, str]" msgstr "int | str == typing.Union[int, str]" -#: ../../library/stdtypes.rst:5421 +#: ../../library/stdtypes.rst:5423 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:5423 +#: ../../library/stdtypes.rst:5425 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:5428 +#: ../../library/stdtypes.rst:5430 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:5431 +#: ../../library/stdtypes.rst:5433 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -7919,14 +7920,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:5434 +#: ../../library/stdtypes.rst:5436 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:5437 +#: ../../library/stdtypes.rst:5439 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -7936,7 +7937,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:5444 +#: ../../library/stdtypes.rst:5446 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 " @@ -7945,7 +7946,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`types." "UnionType` 存取並用於 :func:`isinstance` 檢查。物件不能以型別來實例化: ::" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5450 msgid "" ">>> import types\n" ">>> isinstance(int | str, types.UnionType)\n" @@ -7963,7 +7964,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'types.UnionType' instances" -#: ../../library/stdtypes.rst:5457 +#: ../../library/stdtypes.rst:5459 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 " @@ -7972,7 +7973,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:5461 +#: ../../library/stdtypes.rst:5463 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -7998,25 +7999,25 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:5477 +#: ../../library/stdtypes.rst:5479 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:5485 +#: ../../library/stdtypes.rst:5487 msgid "Other Built-in Types" msgstr "其他內建型別" -#: ../../library/stdtypes.rst:5487 +#: ../../library/stdtypes.rst:5489 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5494 +#: ../../library/stdtypes.rst:5496 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5496 +#: ../../library/stdtypes.rst:5498 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 " @@ -8027,7 +8028,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5503 +#: ../../library/stdtypes.rst:5505 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -8038,32 +8039,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5511 +#: ../../library/stdtypes.rst:5513 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5519 +#: ../../library/stdtypes.rst:5521 msgid "Classes and Class Instances" msgstr "類別與類別實例" -#: ../../library/stdtypes.rst:5521 +#: ../../library/stdtypes.rst:5523 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "請見 :ref:`objects` 和 :ref:`class`。" -#: ../../library/stdtypes.rst:5527 +#: ../../library/stdtypes.rst:5529 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5529 +#: ../../library/stdtypes.rst:5531 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:5532 +#: ../../library/stdtypes.rst:5534 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -8071,15 +8072,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5536 +#: ../../library/stdtypes.rst:5538 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:5542 +#: ../../library/stdtypes.rst:5544 msgid "Methods" msgstr "方法" -#: ../../library/stdtypes.rst:5546 +#: ../../library/stdtypes.rst:5548 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -8087,7 +8088,7 @@ msgid "" "Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5553 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:" @@ -8100,7 +8101,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5562 +#: ../../library/stdtypes.rst:5564 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -8111,7 +8112,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:5570 +#: ../../library/stdtypes.rst:5572 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -8139,15 +8140,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:5585 +#: ../../library/stdtypes.rst:5587 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5595 msgid "Code Objects" msgstr "程式碼物件" -#: ../../library/stdtypes.rst:5599 +#: ../../library/stdtypes.rst:5601 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -8157,7 +8158,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5606 +#: ../../library/stdtypes.rst:5608 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -8166,21 +8167,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:5613 +#: ../../library/stdtypes.rst:5615 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:5616 +#: ../../library/stdtypes.rst:5618 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:5622 +#: ../../library/stdtypes.rst:5624 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5628 +#: ../../library/stdtypes.rst:5630 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 " @@ -8188,30 +8189,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5633 +#: ../../library/stdtypes.rst:5635 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:5641 msgid "The Null Object" msgstr "Null 物件" -#: ../../library/stdtypes.rst:5641 +#: ../../library/stdtypes.rst:5643 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:5645 +#: ../../library/stdtypes.rst:5647 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:5652 +#: ../../library/stdtypes.rst:5654 msgid "The Ellipsis Object" msgstr "Ellipsis 物件" -#: ../../library/stdtypes.rst:5654 +#: ../../library/stdtypes.rst:5656 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -8219,15 +8220,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5659 +#: ../../library/stdtypes.rst:5661 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:5665 +#: ../../library/stdtypes.rst:5667 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:5667 +#: ../../library/stdtypes.rst:5669 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 " @@ -8235,64 +8236,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5672 +#: ../../library/stdtypes.rst:5674 msgid "It is written as :code:`NotImplemented`." msgstr "" -#: ../../library/stdtypes.rst:5678 +#: ../../library/stdtypes.rst:5680 msgid "Internal Objects" msgstr "內部物件" -#: ../../library/stdtypes.rst:5680 +#: ../../library/stdtypes.rst:5682 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:5688 +#: ../../library/stdtypes.rst:5690 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:5690 +#: ../../library/stdtypes.rst:5692 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:5697 +#: ../../library/stdtypes.rst:5699 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5703 +#: ../../library/stdtypes.rst:5705 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5711 +#: ../../library/stdtypes.rst:5713 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:5716 +#: ../../library/stdtypes.rst:5718 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:5721 +#: ../../library/stdtypes.rst:5723 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:5731 +#: ../../library/stdtypes.rst:5733 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5733 +#: ../../library/stdtypes.rst:5735 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 " @@ -8300,7 +8301,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5738 +#: ../../library/stdtypes.rst:5740 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 " @@ -8310,24 +8311,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5745 +#: ../../library/stdtypes.rst:5747 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:5747 +#: ../../library/stdtypes.rst:5749 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:5751 +#: ../../library/stdtypes.rst:5753 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5753 +#: ../../library/stdtypes.rst:5755 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -8351,7 +8352,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:5773 +#: ../../library/stdtypes.rst:5775 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -8359,11 +8360,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5778 +#: ../../library/stdtypes.rst:5780 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5780 +#: ../../library/stdtypes.rst:5782 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -8381,84 +8382,84 @@ msgstr "" "... '571186405732').to_bytes(53, 'big')\n" "..." -#: ../../library/stdtypes.rst:5793 +#: ../../library/stdtypes.rst:5795 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:5795 +#: ../../library/stdtypes.rst:5797 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5798 +#: ../../library/stdtypes.rst:5800 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:5799 +#: ../../library/stdtypes.rst:5801 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5800 +#: ../../library/stdtypes.rst:5802 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5801 +#: ../../library/stdtypes.rst:5803 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5802 +#: ../../library/stdtypes.rst:5804 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5805 +#: ../../library/stdtypes.rst:5807 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5807 +#: ../../library/stdtypes.rst:5809 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5808 +#: ../../library/stdtypes.rst:5810 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:5809 +#: ../../library/stdtypes.rst:5811 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:5810 +#: ../../library/stdtypes.rst:5812 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5811 +#: ../../library/stdtypes.rst:5813 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5812 +#: ../../library/stdtypes.rst:5814 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5815 +#: ../../library/stdtypes.rst:5817 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:5817 +#: ../../library/stdtypes.rst:5819 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:5820 +#: ../../library/stdtypes.rst:5822 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:5823 +#: ../../library/stdtypes.rst:5825 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -8466,7 +8467,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:5825 +#: ../../library/stdtypes.rst:5827 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 " @@ -8475,38 +8476,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5831 +#: ../../library/stdtypes.rst:5833 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5834 +#: ../../library/stdtypes.rst:5836 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:5838 +#: ../../library/stdtypes.rst:5840 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5840 +#: ../../library/stdtypes.rst:5842 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5842 +#: ../../library/stdtypes.rst:5844 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:5849 +#: ../../library/stdtypes.rst:5851 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 " @@ -8518,7 +8519,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5858 +#: ../../library/stdtypes.rst:5860 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 " @@ -8526,11 +8527,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5864 +#: ../../library/stdtypes.rst:5866 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:5866 +#: ../../library/stdtypes.rst:5868 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 " @@ -8538,11 +8539,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:5871 +#: ../../library/stdtypes.rst:5873 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:5873 +#: ../../library/stdtypes.rst:5875 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -8564,38 +8565,38 @@ msgstr "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" -#: ../../library/stdtypes.rst:5883 +#: ../../library/stdtypes.rst:5885 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5887 +#: ../../library/stdtypes.rst:5889 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:5888 +#: ../../library/stdtypes.rst:5890 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5891 +#: ../../library/stdtypes.rst:5893 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5894 +#: ../../library/stdtypes.rst:5896 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5896 +#: ../../library/stdtypes.rst:5898 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:5899 +#: ../../library/stdtypes.rst:5901 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -8608,13 +8609,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:316 #: ../../library/stdtypes.rst:393 ../../library/stdtypes.rst:950 #: ../../library/stdtypes.rst:1120 ../../library/stdtypes.rst:1142 -#: ../../library/stdtypes.rst:1157 ../../library/stdtypes.rst:4637 -#: ../../library/stdtypes.rst:5624 +#: ../../library/stdtypes.rst:1157 ../../library/stdtypes.rst:4639 +#: ../../library/stdtypes.rst:5626 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1157 -#: ../../library/stdtypes.rst:4637 +#: ../../library/stdtypes.rst:4639 msgid "statement" msgstr "statement(陳述式)" @@ -8733,14 +8734,14 @@ msgstr "is not" #: ../../library/stdtypes.rst:163 ../../library/stdtypes.rst:208 #: ../../library/stdtypes.rst:934 ../../library/stdtypes.rst:1120 -#: ../../library/stdtypes.rst:1142 ../../library/stdtypes.rst:1265 -#: ../../library/stdtypes.rst:1344 ../../library/stdtypes.rst:1388 -#: ../../library/stdtypes.rst:1509 ../../library/stdtypes.rst:1545 -#: ../../library/stdtypes.rst:2728 ../../library/stdtypes.rst:2747 -#: ../../library/stdtypes.rst:2854 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:4637 ../../library/stdtypes.rst:5117 -#: ../../library/stdtypes.rst:5374 ../../library/stdtypes.rst:5544 -#: ../../library/stdtypes.rst:5588 +#: ../../library/stdtypes.rst:1142 ../../library/stdtypes.rst:1267 +#: ../../library/stdtypes.rst:1346 ../../library/stdtypes.rst:1390 +#: ../../library/stdtypes.rst:1511 ../../library/stdtypes.rst:1547 +#: ../../library/stdtypes.rst:2730 ../../library/stdtypes.rst:2749 +#: ../../library/stdtypes.rst:2856 ../../library/stdtypes.rst:4437 +#: ../../library/stdtypes.rst:4639 ../../library/stdtypes.rst:5119 +#: ../../library/stdtypes.rst:5376 ../../library/stdtypes.rst:5546 +#: ../../library/stdtypes.rst:5590 msgid "object" msgstr "object(物件)" @@ -8832,9 +8833,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:950 -#: ../../library/stdtypes.rst:1120 ../../library/stdtypes.rst:4637 -#: ../../library/stdtypes.rst:5595 ../../library/stdtypes.rst:5609 -#: ../../library/stdtypes.rst:5624 +#: ../../library/stdtypes.rst:1120 ../../library/stdtypes.rst:4639 +#: ../../library/stdtypes.rst:5597 ../../library/stdtypes.rst:5611 +#: ../../library/stdtypes.rst:5626 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -8850,8 +8851,8 @@ msgstr "float" msgid "complex" msgstr "complex(複數)" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2604 -#: ../../library/stdtypes.rst:3823 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2606 +#: ../../library/stdtypes.rst:3825 msgid "+ (plus)" msgstr "+ (加號)" @@ -8863,13 +8864,13 @@ msgstr "unary operator(一元運算子)" msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2604 -#: ../../library/stdtypes.rst:3823 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2606 +#: ../../library/stdtypes.rst:3825 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2561 -#: ../../library/stdtypes.rst:3780 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2563 +#: ../../library/stdtypes.rst:3782 msgid "* (asterisk)" msgstr "* (星號)" @@ -8881,8 +8882,8 @@ msgstr "/ (斜線)" msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2525 -#: ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2527 +#: ../../library/stdtypes.rst:3750 msgid "% (percent)" msgstr "% (百分號)" @@ -8892,7 +8893,7 @@ msgstr "**" #: ../../library/stdtypes.rst:316 ../../library/stdtypes.rst:393 #: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:1157 -#: ../../library/stdtypes.rst:4637 +#: ../../library/stdtypes.rst:4639 msgid "operations on" msgstr "operations on(操作於)" @@ -8900,8 +8901,8 @@ msgstr "operations on(操作於)" msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" -#: ../../library/stdtypes.rst:335 ../../library/stdtypes.rst:1611 -#: ../../library/stdtypes.rst:2728 ../../library/stdtypes.rst:5624 +#: ../../library/stdtypes.rst:335 ../../library/stdtypes.rst:1613 +#: ../../library/stdtypes.rst:2730 ../../library/stdtypes.rst:5626 msgid "module" msgstr "模組" @@ -8969,7 +8970,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:5032 +#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:5034 msgid "protocol" msgstr "protocol(協定)" @@ -8995,7 +8996,7 @@ msgstr "container(容器)" msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:4637 +#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:4639 msgid "len" msgstr "len" @@ -9055,7 +9056,7 @@ msgstr "loop over(迴圈)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../library/stdtypes.rst:1120 ../../library/stdtypes.rst:1344 +#: ../../library/stdtypes.rst:1120 ../../library/stdtypes.rst:1346 msgid "tuple" msgstr "tuple(元組)" @@ -9068,18 +9069,18 @@ msgid "mutable" msgstr "mutable(可變)" #: ../../library/stdtypes.rst:1142 ../../library/stdtypes.rst:1157 -#: ../../library/stdtypes.rst:1265 +#: ../../library/stdtypes.rst:1267 msgid "list" msgstr "list(串列)" -#: ../../library/stdtypes.rst:1142 ../../library/stdtypes.rst:2728 -#: ../../library/stdtypes.rst:2854 ../../library/stdtypes.rst:2926 -#: ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:1142 ../../library/stdtypes.rst:2730 +#: ../../library/stdtypes.rst:2856 ../../library/stdtypes.rst:2928 +#: ../../library/stdtypes.rst:3750 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1157 ../../library/stdtypes.rst:4637 -#: ../../library/stdtypes.rst:5374 ../../library/stdtypes.rst:5624 +#: ../../library/stdtypes.rst:1157 ../../library/stdtypes.rst:4639 +#: ../../library/stdtypes.rst:5376 ../../library/stdtypes.rst:5626 msgid "type" msgstr "type(型別)" @@ -9087,7 +9088,7 @@ msgstr "type(型別)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1157 ../../library/stdtypes.rst:4637 +#: ../../library/stdtypes.rst:1157 ../../library/stdtypes.rst:4639 msgid "del" msgstr "del" @@ -9123,284 +9124,287 @@ msgstr "remove()(序列方法)" msgid "reverse() (sequence method)" msgstr "reverse()(序列方法)" -#: ../../library/stdtypes.rst:1388 +#: ../../library/stdtypes.rst:1390 msgid "range" msgstr "range" -#: ../../library/stdtypes.rst:1509 ../../library/stdtypes.rst:1558 -#: ../../library/stdtypes.rst:1603 ../../library/stdtypes.rst:2379 -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:1511 ../../library/stdtypes.rst:1560 +#: ../../library/stdtypes.rst:1605 ../../library/stdtypes.rst:2381 +#: ../../library/stdtypes.rst:2527 msgid "string" msgstr "string(字串)" -#: ../../library/stdtypes.rst:1509 +#: ../../library/stdtypes.rst:1511 msgid "text sequence type" msgstr "text sequence type(文字序列型別)" -#: ../../library/stdtypes.rst:1509 ../../library/stdtypes.rst:1558 -#: ../../library/stdtypes.rst:1576 +#: ../../library/stdtypes.rst:1511 ../../library/stdtypes.rst:1560 +#: ../../library/stdtypes.rst:1578 msgid "str (built-in class)" msgstr "str(內建類別)" -#: ../../library/stdtypes.rst:1509 +#: ../../library/stdtypes.rst:1511 msgid "(see also string)" msgstr "(亦請見 string)" -#: ../../library/stdtypes.rst:1545 +#: ../../library/stdtypes.rst:1547 msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1576 ../../library/stdtypes.rst:2720 +#: ../../library/stdtypes.rst:1578 ../../library/stdtypes.rst:2722 msgid "buffer protocol" msgstr "buffer protocol(緩衝區協定)" -#: ../../library/stdtypes.rst:1576 ../../library/stdtypes.rst:2728 -#: ../../library/stdtypes.rst:2747 ../../library/stdtypes.rst:2926 -#: ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:1578 ../../library/stdtypes.rst:2730 +#: ../../library/stdtypes.rst:2749 ../../library/stdtypes.rst:2928 +#: ../../library/stdtypes.rst:3750 msgid "bytes" msgstr "bytes(位元組)" -#: ../../library/stdtypes.rst:1603 ../../library/stdtypes.rst:2926 +#: ../../library/stdtypes.rst:1605 ../../library/stdtypes.rst:2928 msgid "methods" msgstr "methods(方法)" -#: ../../library/stdtypes.rst:1611 +#: ../../library/stdtypes.rst:1613 msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2193 ../../library/stdtypes.rst:3602 +#: ../../library/stdtypes.rst:2195 ../../library/stdtypes.rst:3604 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/stdtypes.rst:2193 +#: ../../library/stdtypes.rst:2195 msgid "str.splitlines method" msgstr "str.splitlines 方法" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "! formatted string literal" msgstr "! formatted string literals(! 格式化字串常數)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "formatted string literals" msgstr "formatted string literals(格式化字串常數)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "! f-string" msgstr "! f-string(! f 字串)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "! (exclamation mark)" msgstr "! (驚嘆號)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "= (equals)" msgstr "= (等號)" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "for help in debugging using string literals" msgstr "" -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:2527 msgid "formatting, string (%)" msgstr "formatting(格式化)、字串 (%)" -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:2527 msgid "interpolation, string (%)" msgstr "interpolation(插值)、字串 (%)" -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:2527 msgid "formatting, printf" msgstr "formatting(格式化)、printf" -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:2527 msgid "interpolation, printf" msgstr "interpolation(插值)、printf" -#: ../../library/stdtypes.rst:2525 ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:2527 ../../library/stdtypes.rst:3750 msgid "printf-style formatting" msgstr "printf 風格格式化" -#: ../../library/stdtypes.rst:2525 ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:2527 ../../library/stdtypes.rst:3750 msgid "sprintf-style formatting" msgstr "sprintf 風格格式化" -#: ../../library/stdtypes.rst:2561 ../../library/stdtypes.rst:3780 +#: ../../library/stdtypes.rst:2563 ../../library/stdtypes.rst:3782 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/stdtypes.rst:2561 ../../library/stdtypes.rst:2604 -#: ../../library/stdtypes.rst:3780 ../../library/stdtypes.rst:3823 +#: ../../library/stdtypes.rst:2563 ../../library/stdtypes.rst:2606 +#: ../../library/stdtypes.rst:3782 ../../library/stdtypes.rst:3825 msgid "in printf-style formatting" msgstr "於 printf 風格格式化" -#: ../../library/stdtypes.rst:2561 ../../library/stdtypes.rst:3780 +#: ../../library/stdtypes.rst:2563 ../../library/stdtypes.rst:3782 msgid ". (dot)" msgstr ". (點)" -#: ../../library/stdtypes.rst:2604 ../../library/stdtypes.rst:3823 +#: ../../library/stdtypes.rst:2606 ../../library/stdtypes.rst:3825 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/stdtypes.rst:2604 ../../library/stdtypes.rst:3823 +#: ../../library/stdtypes.rst:2606 ../../library/stdtypes.rst:3825 msgid "space" msgstr "space(空白)" -#: ../../library/stdtypes.rst:2720 +#: ../../library/stdtypes.rst:2722 msgid "binary sequence types" msgstr "binary sequence types(二進位序列型別)" -#: ../../library/stdtypes.rst:2728 +#: ../../library/stdtypes.rst:2730 msgid "memoryview" msgstr "memoryview(記憶體視圖)" -#: ../../library/stdtypes.rst:2728 +#: ../../library/stdtypes.rst:2730 msgid "array" msgstr "array(陣列)" -#: ../../library/stdtypes.rst:3602 +#: ../../library/stdtypes.rst:3604 msgid "bytes.splitlines method" msgstr "bytes.splitlines 方法" -#: ../../library/stdtypes.rst:3602 +#: ../../library/stdtypes.rst:3604 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines 方法" -#: ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:3750 msgid "formatting" msgstr "formatting(格式化)" -#: ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:3750 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:3750 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:3750 msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:4437 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:4637 +#: ../../library/stdtypes.rst:4639 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:4637 +#: ../../library/stdtypes.rst:4639 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:4747 +#: ../../library/stdtypes.rst:4749 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:5032 +#: ../../library/stdtypes.rst:5034 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:5032 +#: ../../library/stdtypes.rst:5034 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:5032 +#: ../../library/stdtypes.rst:5034 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:5105 +#: ../../library/stdtypes.rst:5107 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:5105 +#: ../../library/stdtypes.rst:5107 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:5117 +#: ../../library/stdtypes.rst:5119 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:5117 +#: ../../library/stdtypes.rst:5119 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:5117 +#: ../../library/stdtypes.rst:5119 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5374 +#: ../../library/stdtypes.rst:5376 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5374 +#: ../../library/stdtypes.rst:5376 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5546 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5588 +#: ../../library/stdtypes.rst:5590 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5588 +#: ../../library/stdtypes.rst:5590 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5595 +#: ../../library/stdtypes.rst:5597 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5595 +#: ../../library/stdtypes.rst:5597 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5611 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5611 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5648 +#: ../../library/stdtypes.rst:5650 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5648 +#: ../../library/stdtypes.rst:5650 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" + +#~ msgid "same as ``s[i:j] = []``" +#~ msgstr "和 ``s[i:j] = []`` 相同" diff --git a/library/time.po b/library/time.po index dfd10d6f86..f4ff4dcee8 100644 --- a/library/time.po +++ b/library/time.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-01 00:18+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: 2024-11-20 15:25+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -264,14 +264,14 @@ msgstr "" #: ../../library/time.rst:153 ../../library/time.rst:165 #: ../../library/time.rst:178 ../../library/time.rst:187 #: ../../library/time.rst:200 ../../library/time.rst:209 -#: ../../library/time.rst:752 ../../library/time.rst:776 -#: ../../library/time.rst:872 ../../library/time.rst:883 -#: ../../library/time.rst:893 ../../library/time.rst:903 -#: ../../library/time.rst:912 ../../library/time.rst:921 -#: ../../library/time.rst:930 ../../library/time.rst:941 -#: ../../library/time.rst:949 ../../library/time.rst:960 -#: ../../library/time.rst:971 ../../library/time.rst:980 -#: ../../library/time.rst:993 +#: ../../library/time.rst:754 ../../library/time.rst:778 +#: ../../library/time.rst:874 ../../library/time.rst:885 +#: ../../library/time.rst:895 ../../library/time.rst:905 +#: ../../library/time.rst:914 ../../library/time.rst:923 +#: ../../library/time.rst:932 ../../library/time.rst:943 +#: ../../library/time.rst:951 ../../library/time.rst:962 +#: ../../library/time.rst:973 ../../library/time.rst:982 +#: ../../library/time.rst:995 msgid "Availability" msgstr "可用性" @@ -474,7 +474,7 @@ msgstr "" "示)。該時鐘不受系統時鐘更新的影響。回傳值的參考點沒有定義,因此只有兩次呼叫" "結果之間的差異才是有效的。" -#: ../../library/time.rst:294 ../../library/time.rst:713 +#: ../../library/time.rst:294 ../../library/time.rst:715 msgid "Clock:" msgstr "時鐘:" @@ -510,30 +510,32 @@ msgid "" msgstr "使用 :func:`monotonic_ns` 以避免 :class:`float` 型別造成的精確度損失。" #: ../../library/time.rst:308 -msgid "The function is now always available and always system-wide." -msgstr "此函式現在始終可用且涵蓋整個系統。" +msgid "" +"The function is now always available and the clock is now the same for all " +"processes." +msgstr "此函式現在始終可用且時鐘對於所有行程都會是相同。" -#: ../../library/time.rst:311 -msgid "On macOS, the function is now system-wide." -msgstr "在 macOS 上,此函式現在涵蓋整個系統。" +#: ../../library/time.rst:312 +msgid "On macOS, the clock is now the same for all processes." +msgstr "在 macOS 上,時鐘對於所有行程都會是相同。" -#: ../../library/time.rst:317 +#: ../../library/time.rst:318 msgid "Similar to :func:`monotonic`, but return time as nanoseconds." msgstr "類似於 :func:`monotonic`,但回傳以奈秒為單位的時間。" -#: ../../library/time.rst:326 +#: ../../library/time.rst:327 msgid "" "Return the value (in fractional seconds) of a performance counter, i.e. a " "clock with the highest available resolution to measure a short duration. It " -"does include time elapsed during sleep and is system-wide. The reference " -"point of the returned value is undefined, so that only the difference " -"between the results of two calls is valid." +"does include time elapsed during sleep. The clock is the same for all " +"processes. The reference point of the returned value is undefined, so that " +"only the difference between the results of two calls is valid." msgstr "" "回傳性能計數器的值(以帶有小數的秒數表示),即具有最高可用解析度來測量短時間" -"間隔的時鐘。它包括睡眠時經過的時間,並且涵蓋整個系統。回傳值的參考點沒有定" +"間隔的時鐘。它包括睡眠時經過的時間,且時鐘對於所有行程都會是相同。回傳值的參考點沒有定" "義,因此只有兩次呼叫結果之間的差異才是有效的。" -#: ../../library/time.rst:334 +#: ../../library/time.rst:336 msgid "" "On CPython, use the same clock as :func:`time.monotonic` and is a monotonic " "clock, i.e. a clock that cannot go backwards." @@ -541,26 +543,26 @@ msgstr "" "在 CPython 上,使用與 :func:`time.monotonic` 相同的時鐘,且其為單調時鐘(即不" "能倒轉的時鐘)。" -#: ../../library/time.rst:337 +#: ../../library/time.rst:339 msgid "" "Use :func:`perf_counter_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" "使用 :func:`perf_counter_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:342 -msgid "On Windows, the function is now system-wide." -msgstr "在 Windows 上,此函式現在涵蓋整個系統。" +#: ../../library/time.rst:344 +msgid "On Windows, the clock is now the same for all processes." +msgstr "在 Windows 上,時鐘對於所有行程都會是相同。" -#: ../../library/time.rst:345 +#: ../../library/time.rst:347 msgid "Use the same clock as :func:`time.monotonic`." msgstr "使用與 :func:`time.monotonic` 相同的時鐘。" -#: ../../library/time.rst:351 +#: ../../library/time.rst:353 msgid "Similar to :func:`perf_counter`, but return time as nanoseconds." msgstr "類似於 :func:`perf_counter`,但回傳以奈秒為單位的時間。" -#: ../../library/time.rst:363 +#: ../../library/time.rst:365 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current process. It does not include time elapsed during " @@ -572,18 +574,18 @@ msgstr "" "經過的時間。根據定義,它涵蓋整個行程。回傳值的參考點沒有定義,因此只有兩次呼" "叫結果之間的差異才是有效的。" -#: ../../library/time.rst:369 +#: ../../library/time.rst:371 msgid "" "Use :func:`process_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" "使用 :func:`process_time_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:376 +#: ../../library/time.rst:378 msgid "Similar to :func:`process_time` but return time as nanoseconds." msgstr "類似於 :func:`process_time`,但回傳以奈秒為單位的時間。" -#: ../../library/time.rst:382 +#: ../../library/time.rst:384 msgid "" "Suspend execution of the calling thread for the given number of seconds. The " "argument may be a floating-point number to indicate a more precise sleep " @@ -592,7 +594,7 @@ msgstr "" "在一個給定的秒數內暫停呼叫執行緒 (calling thread) 的執行。引數可以是浮點數," "以表示更精確的睡眠時間。" -#: ../../library/time.rst:386 +#: ../../library/time.rst:388 msgid "" "If the sleep is interrupted by a signal and no exception is raised by the " "signal handler, the sleep is restarted with a recomputed timeout." @@ -600,17 +602,17 @@ msgstr "" "如果睡眠被訊號中斷且訊號處理器未引發例外,則睡眠將以重新計算過的逾時 " "(timeout) 重新開始。" -#: ../../library/time.rst:389 +#: ../../library/time.rst:391 msgid "" "The suspension time may be longer than requested by an arbitrary amount, " "because of the scheduling of other activity in the system." msgstr "由於系統中其他活動的調度,暫停時間可能會比請求的時間長任意的量。" -#: ../../library/time.rst:393 +#: ../../library/time.rst:395 msgid "Windows implementation" msgstr "Windows 實作" -#: ../../library/time.rst:394 +#: ../../library/time.rst:396 msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " "time slice to any other thread that is ready to run. If there are no other " @@ -626,34 +628,34 @@ msgstr "" "learn.microsoft.com/windows-hardware/drivers/kernel/high-resolution-" "timers>`_,其解析度為 100 奈秒。如果 *secs* 為零,則使用 ``Sleep(0)``。" -#: ../../library/time.rst:403 +#: ../../library/time.rst:405 msgid "Unix implementation" msgstr "Unix 實作" -#: ../../library/time.rst:404 +#: ../../library/time.rst:406 msgid "Use ``clock_nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "如果可以,使用 ``clock_nanosleep()``\\ (解析度:1 奈秒);" -#: ../../library/time.rst:405 +#: ../../library/time.rst:407 msgid "Or use ``nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "或者使用 ``nanosleep()``\\ (解析度:1 奈秒);" -#: ../../library/time.rst:406 +#: ../../library/time.rst:408 msgid "Or use ``select()`` (resolution: 1 microsecond)." msgstr "或使用 ``select()``\\ (解析度:1 微秒)。" -#: ../../library/time.rst:410 +#: ../../library/time.rst:412 msgid "" "To emulate a \"no-op\", use :keyword:`pass` instead of ``time.sleep(0)``." msgstr "" -#: ../../library/time.rst:412 +#: ../../library/time.rst:414 msgid "" "To voluntarily relinquish the CPU, specify a real-time :ref:`scheduling " "policy ` and use :func:`os.sched_yield` instead." msgstr "" -#: ../../library/time.rst:415 +#: ../../library/time.rst:417 msgid "" "Raises an :ref:`auditing event ` ``time.sleep`` with argument " "``secs``." @@ -661,7 +663,7 @@ msgstr "" "引發一個帶有引數 ``secs`` 的\\ :ref:`稽核事件 (auditing event) ` " "``time.sleep``。" -#: ../../library/time.rst:417 +#: ../../library/time.rst:419 msgid "" "The function now sleeps at least *secs* even if the sleep is interrupted by " "a signal, except if the signal handler raises an exception (see :pep:`475` " @@ -670,7 +672,7 @@ msgstr "" "即使睡眠被訊號中斷,此函式現在至少還是會睡眠 *secs*,除非訊號處理器引發例外" "(理由請參閱 :pep:`475`)。" -#: ../../library/time.rst:422 +#: ../../library/time.rst:424 msgid "" "On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " "used if available. On Windows, a waitable timer is now used." @@ -678,11 +680,11 @@ msgstr "" "在 Unix 上,如果可以的話現在會使用 ``clock_nanosleep()`` 和 ``nanosleep()`` " "函式。在 Windows 上,現在使用可等待的計時器。" -#: ../../library/time.rst:426 +#: ../../library/time.rst:428 msgid "Raises an auditing event." msgstr "引發一個稽核事件。" -#: ../../library/time.rst:434 +#: ../../library/time.rst:436 msgid "" "Convert a tuple or :class:`struct_time` representing a time as returned by :" "func:`gmtime` or :func:`localtime` to a string as specified by the *format* " @@ -695,7 +697,7 @@ msgstr "" "func:`localtime` 回傳的目前時間。*format* 必須是一個字串。如果 *t* 中的任何欄" "位超出允許範圍,將會引發 :exc:`ValueError`。" -#: ../../library/time.rst:440 +#: ../../library/time.rst:442 msgid "" "0 is a legal argument for any position in the time tuple; if it is normally " "illegal the value is forced to a correct one." @@ -703,7 +705,7 @@ msgstr "" "0 在時間元組中的任何位置都是合法引數;如果元組中出現常見的錯誤,該值將被強制" "更改為正確的值。" -#: ../../library/time.rst:443 +#: ../../library/time.rst:445 msgid "" "The following directives can be embedded in the *format* string. They are " "shown without the optional field width and precision specification, and are " @@ -712,151 +714,151 @@ msgstr "" "以下指令可以嵌入在 *format* 字串中。它們顯示時不帶可選的欄位寬度和精度規範," "並在 :func:`strftime` 的結果中被標示的字元替換:" -#: ../../library/time.rst:448 +#: ../../library/time.rst:450 msgid "Directive" msgstr "指令" -#: ../../library/time.rst:448 +#: ../../library/time.rst:450 msgid "Meaning" msgstr "意義" -#: ../../library/time.rst:448 +#: ../../library/time.rst:450 msgid "Notes" msgstr "註解" -#: ../../library/time.rst:450 +#: ../../library/time.rst:452 msgid "``%a``" msgstr "``%a``" -#: ../../library/time.rst:450 +#: ../../library/time.rst:452 msgid "Locale's abbreviated weekday name." msgstr "區域設定的週間日 (weekday) 縮寫名稱。" -#: ../../library/time.rst:453 +#: ../../library/time.rst:455 msgid "``%A``" msgstr "``%A``" -#: ../../library/time.rst:453 +#: ../../library/time.rst:455 msgid "Locale's full weekday name." msgstr "區域設定的完整週間日名稱。" -#: ../../library/time.rst:455 +#: ../../library/time.rst:457 msgid "``%b``" msgstr "``%b``" -#: ../../library/time.rst:455 +#: ../../library/time.rst:457 msgid "Locale's abbreviated month name." msgstr "區域設定的縮寫月份名稱。" -#: ../../library/time.rst:458 +#: ../../library/time.rst:460 msgid "``%B``" msgstr "``%B``" -#: ../../library/time.rst:458 +#: ../../library/time.rst:460 msgid "Locale's full month name." msgstr "區域設定的完整月份名稱。" -#: ../../library/time.rst:460 +#: ../../library/time.rst:462 msgid "``%c``" msgstr "``%c``" -#: ../../library/time.rst:460 +#: ../../library/time.rst:462 msgid "Locale's appropriate date and time representation." msgstr "區域設定的合適的日期和時間的表示法。" -#: ../../library/time.rst:463 +#: ../../library/time.rst:465 msgid "``%d``" msgstr "``%d``" -#: ../../library/time.rst:463 +#: ../../library/time.rst:465 msgid "Day of the month as a decimal number [01,31]." msgstr "月份中的日期,表示為十進位數 [01,31]。" -#: ../../library/time.rst:466 +#: ../../library/time.rst:468 msgid "``%f``" msgstr "``%f``" -#: ../../library/time.rst:466 +#: ../../library/time.rst:468 msgid "Microseconds as a decimal number" msgstr "微秒,表示為十進位數" -#: ../../library/time.rst:467 +#: ../../library/time.rst:469 msgid "[000000,999999]." msgstr "[000000,999999]。" -#: ../../library/time.rst:466 +#: ../../library/time.rst:468 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/time.rst:470 +#: ../../library/time.rst:472 msgid "``%H``" msgstr "``%H``" -#: ../../library/time.rst:470 +#: ../../library/time.rst:472 msgid "Hour (24-hour clock) as a decimal number [00,23]." msgstr "小時(24 小時制),表示為十進位數 [00,23]。" -#: ../../library/time.rst:473 +#: ../../library/time.rst:475 msgid "``%I``" msgstr "``%I``" -#: ../../library/time.rst:473 +#: ../../library/time.rst:475 msgid "Hour (12-hour clock) as a decimal number [01,12]." msgstr "小時(12 小時制),表示為十進位數 [01,12]。" -#: ../../library/time.rst:476 +#: ../../library/time.rst:478 msgid "``%j``" msgstr "``%j``" -#: ../../library/time.rst:476 +#: ../../library/time.rst:478 msgid "Day of the year as a decimal number [001,366]." msgstr "一年中的第幾天,表示為十進位數 [001,366]。" -#: ../../library/time.rst:479 +#: ../../library/time.rst:481 msgid "``%m``" msgstr "``%m``" -#: ../../library/time.rst:479 +#: ../../library/time.rst:481 msgid "Month as a decimal number [01,12]." msgstr "月份,表示為十進位數 [01,12]。" -#: ../../library/time.rst:482 +#: ../../library/time.rst:484 msgid "``%M``" msgstr "``%M``" -#: ../../library/time.rst:482 +#: ../../library/time.rst:484 msgid "Minute as a decimal number [00,59]." msgstr "分鐘,表示為十進位數 [00,59]。" -#: ../../library/time.rst:485 +#: ../../library/time.rst:487 msgid "``%p``" msgstr "``%p``" -#: ../../library/time.rst:485 +#: ../../library/time.rst:487 msgid "Locale's equivalent of either AM or PM." msgstr "區域設定中相當於 AM 或 PM 的表示。" -#: ../../library/time.rst:485 +#: ../../library/time.rst:487 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/time.rst:488 +#: ../../library/time.rst:490 msgid "``%S``" msgstr "``%S``" -#: ../../library/time.rst:488 +#: ../../library/time.rst:490 msgid "Second as a decimal number [00,61]." msgstr "秒,表示為十進位數 [00,61]。" -#: ../../library/time.rst:488 +#: ../../library/time.rst:490 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/time.rst:491 +#: ../../library/time.rst:493 msgid "``%U``" msgstr "``%U``" -#: ../../library/time.rst:491 +#: ../../library/time.rst:493 msgid "" "Week number of the year (Sunday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Sunday are " @@ -865,31 +867,31 @@ msgstr "" "一年中的週數(星期天作為一週的第一天),表示為十進位數 [00,53]。新的一年中," "在第一個星期天之前的所有日子都被認定為第 0 週。" -#: ../../library/time.rst:491 ../../library/time.rst:505 +#: ../../library/time.rst:493 ../../library/time.rst:507 msgid "\\(4)" msgstr "\\(4)" -#: ../../library/time.rst:499 +#: ../../library/time.rst:501 msgid "``%u``" msgstr "``%u``" -#: ../../library/time.rst:499 +#: ../../library/time.rst:501 msgid "Day of the week (Monday is 1; Sunday is 7) as a decimal number [1, 7]." msgstr "一週中的日期(周一為 1;週日為 7),表示為十進位數 [1,7]。" -#: ../../library/time.rst:502 +#: ../../library/time.rst:504 msgid "``%w``" msgstr "``%w``" -#: ../../library/time.rst:502 +#: ../../library/time.rst:504 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "週間日,表示為十進位數 [0(星期天),6]。" -#: ../../library/time.rst:505 +#: ../../library/time.rst:507 msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:505 +#: ../../library/time.rst:507 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Monday are " @@ -898,43 +900,43 @@ msgstr "" "一年中的週數(星期一作為一週的第一天),表示為十進位數 [00,53]。新的一年中," "在第一個星期一之前的所有日子都被認定為第 0 週。" -#: ../../library/time.rst:513 +#: ../../library/time.rst:515 msgid "``%x``" msgstr "``%x``" -#: ../../library/time.rst:513 +#: ../../library/time.rst:515 msgid "Locale's appropriate date representation." msgstr "區域設定的合適的日期表示法。" -#: ../../library/time.rst:516 +#: ../../library/time.rst:518 msgid "``%X``" msgstr "``%X``" -#: ../../library/time.rst:516 +#: ../../library/time.rst:518 msgid "Locale's appropriate time representation." msgstr "區域設定的合適的時間表示法。" -#: ../../library/time.rst:519 +#: ../../library/time.rst:521 msgid "``%y``" msgstr "``%y``" -#: ../../library/time.rst:519 +#: ../../library/time.rst:521 msgid "Year without century as a decimal number [00,99]." msgstr "去掉世紀的年份,表示為十進位數 [00,99]。" -#: ../../library/time.rst:522 +#: ../../library/time.rst:524 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/time.rst:522 +#: ../../library/time.rst:524 msgid "Year with century as a decimal number." msgstr "帶世紀的年份,表示為十進位數。" -#: ../../library/time.rst:525 +#: ../../library/time.rst:527 msgid "``%z``" msgstr "``%z``" -#: ../../library/time.rst:525 +#: ../../library/time.rst:527 msgid "" "Time zone offset indicating a positive or negative time difference from UTC/" "GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M " @@ -943,19 +945,19 @@ msgstr "" "時區偏移量,表示與 UTC/GMT 的正或負時間差,形式為 +HHMM 或 -HHMM,其中 H 代表" "十進位的小時數碼 (digits),M 代表十進位的分鐘數碼 [-23:59, +23:59]。 [1]_" -#: ../../library/time.rst:531 +#: ../../library/time.rst:533 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/time.rst:531 +#: ../../library/time.rst:533 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "時區名稱(如果不存在時區,則無字元)。已被棄用。 [1]_" -#: ../../library/time.rst:534 +#: ../../library/time.rst:536 msgid "``%G``" msgstr "``%G``" -#: ../../library/time.rst:534 +#: ../../library/time.rst:536 msgid "" "ISO 8601 year (similar to ``%Y`` but follows the rules for the ISO 8601 " "calendar year). The year starts with the week that contains the first " @@ -964,11 +966,11 @@ msgstr "" "ISO 8601 年(類似於 ``%Y``,但遵循 ISO 8601 日曆年的規則)。年份從包含該日曆" "年第一個星期四的那一週開始。" -#: ../../library/time.rst:539 +#: ../../library/time.rst:541 msgid "``%V``" msgstr "``%V``" -#: ../../library/time.rst:539 +#: ../../library/time.rst:541 msgid "" "ISO 8601 week number (as a decimal number [01,53]). The first week of the " "year is the one that contains the first Thursday of the year. Weeks start on " @@ -977,19 +979,19 @@ msgstr "" "ISO 8601 週數(以十進位數表示 [01,53])。年份的第一週是包含該年第一個星期四的" "那一週。每週從星期一開始。" -#: ../../library/time.rst:544 +#: ../../library/time.rst:546 msgid "``%%``" msgstr "``%%``" -#: ../../library/time.rst:544 +#: ../../library/time.rst:546 msgid "A literal ``'%'`` character." msgstr "字面意義上的 ``'%'`` 字元。" -#: ../../library/time.rst:547 +#: ../../library/time.rst:549 msgid "Notes:" msgstr "註解:" -#: ../../library/time.rst:550 +#: ../../library/time.rst:552 msgid "" "The ``%f`` format directive only applies to :func:`strptime`, not to :func:" "`strftime`. However, see also :meth:`datetime.datetime.strptime` and :meth:" @@ -1000,7 +1002,7 @@ msgstr "" "在 :meth:`datetime.datetime.strptime` 和 :meth:`datetime.datetime.strftime` " "其中的 ``%f`` 格式的指令\\ :ref:`適用於微秒 `。" -#: ../../library/time.rst:556 +#: ../../library/time.rst:558 msgid "" "When used with the :func:`strptime` function, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " @@ -1009,7 +1011,7 @@ msgstr "" "當與 :func:`strptime` 函式一起使用時,``%p`` 指令僅在使用 ``%I`` 指令剖析小時" "時影響輸出小時的欄位。" -#: ../../library/time.rst:562 +#: ../../library/time.rst:564 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " @@ -1018,7 +1020,7 @@ msgstr "" "範圍確實是從 ``0`` 到 ``61``;數值 ``60`` 在表示 `leap seconds`_ 的時間戳中是" "有效的,而數值 ``61`` 是出於歷史因素而被支援。" -#: ../../library/time.rst:567 +#: ../../library/time.rst:569 msgid "" "When used with the :func:`strptime` function, ``%U`` and ``%W`` are only " "used in calculations when the day of the week and the year are specified." @@ -1026,7 +1028,7 @@ msgstr "" "當與 :func:`strptime` 函式一起使用時,``%U`` 和 ``%W`` 僅在指定週間的某天和年" "份時用於計算中。" -#: ../../library/time.rst:570 +#: ../../library/time.rst:572 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" @@ -1034,7 +1036,7 @@ msgstr "" "以下是一個範例,其為一種與 :rfc:`2822` 網際網路電子郵件標準中指定的日期格式兼" "容的格式。 [1]_: ::" -#: ../../library/time.rst:573 +#: ../../library/time.rst:575 msgid "" ">>> from time import gmtime, strftime\n" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" @@ -1044,7 +1046,7 @@ msgstr "" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" "'Thu, 28 Jun 2001 14:17:15 +0000'" -#: ../../library/time.rst:577 +#: ../../library/time.rst:579 msgid "" "Additional directives may be supported on certain platforms, but only the " "ones listed here have a meaning standardized by ANSI C. To see the full set " @@ -1054,7 +1056,7 @@ msgstr "" "某些平台可能支援額外的指令,但只有這裡列出的指令具有 ANSI C 標準化的意義。要" "查看你的平台上支援的完整格式碼集,請參閱 :manpage:`strftime(3)` 文件。" -#: ../../library/time.rst:582 +#: ../../library/time.rst:584 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -1064,7 +1066,7 @@ msgstr "" "在某些平台上,可選的欄位寬度和精度規範可以以此順序緊跟在指令初始的 ``'%'`` 之" "後;這也是不可攜 (portable) 的。欄位寬度通常為 2,除了 ``%j`` 為 3。" -#: ../../library/time.rst:593 +#: ../../library/time.rst:595 msgid "" "Parse a string representing a time according to a format. The return value " "is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." @@ -1072,7 +1074,7 @@ msgstr "" "根據格式剖析表示時間的字串。回傳值是 :class:`struct_time`,如同由 :func:" "`gmtime` 或 :func:`localtime` 回傳的一樣。" -#: ../../library/time.rst:597 +#: ../../library/time.rst:599 msgid "" "The *format* parameter uses the same directives as those used by :func:" "`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches the " @@ -1088,11 +1090,11 @@ msgstr "" "時,用來填充任何缺失資料的預設值為 ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``。" "*string* 和 *format* 都必須是字串。" -#: ../../library/time.rst:605 +#: ../../library/time.rst:607 msgid "For example:" msgstr "例如:" -#: ../../library/time.rst:612 +#: ../../library/time.rst:614 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -1103,7 +1105,7 @@ msgstr "" "因此,除了識別始終已知的 UTC 和 GMT(且被考慮為非日光節約時區)外,這是特定於" "平台的。" -#: ../../library/time.rst:617 +#: ../../library/time.rst:619 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -1115,7 +1117,7 @@ msgstr "" "提供比列出的還要更多的指令。但是 ``strptime()`` 與任何平台無關,因此不一定支" "援所有未記載為支援的指令。" -#: ../../library/time.rst:626 +#: ../../library/time.rst:628 msgid "" "The type of the time value sequence returned by :func:`gmtime`, :func:" "`localtime`, and :func:`strptime`. It is an object with a :term:`named " @@ -1126,110 +1128,110 @@ msgstr "" "別。它是一個具有 :term:`named tuple` 介面的物件:值可以通過索引和屬性名稱存" "取。包含以下值:" -#: ../../library/time.rst:633 +#: ../../library/time.rst:635 msgid "Index" msgstr "索引" -#: ../../library/time.rst:634 +#: ../../library/time.rst:636 msgid "Attribute" msgstr "屬性" -#: ../../library/time.rst:635 +#: ../../library/time.rst:637 msgid "Values" msgstr "值" -#: ../../library/time.rst:637 +#: ../../library/time.rst:639 msgid "0" msgstr "0" -#: ../../library/time.rst:639 +#: ../../library/time.rst:641 msgid "(for example, 1993)" msgstr "(例如 1993)" -#: ../../library/time.rst:641 +#: ../../library/time.rst:643 msgid "1" msgstr "1" -#: ../../library/time.rst:643 +#: ../../library/time.rst:645 msgid "range [1, 12]" msgstr "範圍 [1, 12]" -#: ../../library/time.rst:645 +#: ../../library/time.rst:647 msgid "2" msgstr "2" -#: ../../library/time.rst:647 +#: ../../library/time.rst:649 msgid "range [1, 31]" msgstr "範圍 [1, 31]" -#: ../../library/time.rst:649 +#: ../../library/time.rst:651 msgid "3" msgstr "3" -#: ../../library/time.rst:651 +#: ../../library/time.rst:653 msgid "range [0, 23]" msgstr "範圍 [0, 23]" -#: ../../library/time.rst:653 +#: ../../library/time.rst:655 msgid "4" msgstr "4" -#: ../../library/time.rst:655 +#: ../../library/time.rst:657 msgid "range [0, 59]" msgstr "範圍 [0, 59]" -#: ../../library/time.rst:657 +#: ../../library/time.rst:659 msgid "5" msgstr "5" -#: ../../library/time.rst:659 +#: ../../library/time.rst:661 msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" "範圍 [0, 61];參見 :func:`strftime` 中的\\ :ref:`註釋 (2) `" -#: ../../library/time.rst:661 +#: ../../library/time.rst:663 msgid "6" msgstr "6" -#: ../../library/time.rst:663 +#: ../../library/time.rst:665 msgid "range [0, 6]; Monday is 0" msgstr "範圍 [0, 6];星期一是 0" -#: ../../library/time.rst:665 +#: ../../library/time.rst:667 msgid "7" msgstr "7" -#: ../../library/time.rst:667 +#: ../../library/time.rst:669 msgid "range [1, 366]" msgstr "範圍 [1, 366]" -#: ../../library/time.rst:669 +#: ../../library/time.rst:671 msgid "8" msgstr "8" -#: ../../library/time.rst:671 +#: ../../library/time.rst:673 msgid "0, 1 or -1; see below" msgstr "0、1 或 -1;見下文" -#: ../../library/time.rst:673 ../../library/time.rst:677 +#: ../../library/time.rst:675 ../../library/time.rst:679 msgid "N/A" msgstr "N/A" -#: ../../library/time.rst:675 +#: ../../library/time.rst:677 msgid "abbreviation of timezone name" msgstr "時區名稱的縮寫" -#: ../../library/time.rst:679 +#: ../../library/time.rst:681 msgid "offset east of UTC in seconds" msgstr "UTC 向東的偏移量(以秒為單位)" -#: ../../library/time.rst:681 +#: ../../library/time.rst:683 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "請注意,與 C 結構不同,月份值的範圍是 [1, 12],而不是 [0, 11]。" -#: ../../library/time.rst:684 +#: ../../library/time.rst:686 msgid "" "In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight " "savings time is in effect, and 0 when it is not. A value of -1 indicates " @@ -1239,7 +1241,7 @@ msgstr "" "在呼叫 :func:`mktime` 時,當日光節約時間生效的時候,:attr:`tm_isdst` 可以設定" "為 1,不生效時設定為 0。值 -1 表示未知是否生效,通常結果會填入正確的狀態。" -#: ../../library/time.rst:688 +#: ../../library/time.rst:690 msgid "" "When a tuple with an incorrect length is passed to a function expecting a :" "class:`struct_time`, or having elements of the wrong type, a :exc:" @@ -1248,7 +1250,7 @@ msgstr "" "當一個長度不正確的元組被傳遞給預期得到 :class:`struct_time` 的函式時,或者其" "中有元素型別錯誤時,將引發 :exc:`TypeError`。" -#: ../../library/time.rst:694 +#: ../../library/time.rst:696 msgid "" "Return the time in seconds since the epoch_ as a floating-point number. The " "handling of `leap seconds`_ is platform dependent. On Windows and most Unix " @@ -1260,7 +1262,7 @@ msgstr "" "關的。在 Windows 和大多數 Unix 系統上,閏秒不計入自 epoch_ 起的秒數中。這通常" "被稱為 `Unix 時間 `_。" -#: ../../library/time.rst:700 +#: ../../library/time.rst:702 msgid "" "Note that even though the time is always returned as a floating-point " "number, not all systems provide time with a better precision than 1 second. " @@ -1272,7 +1274,7 @@ msgstr "" "間。雖然此函式通常回傳非遞減的值,但如果在兩次呼叫之間系統時鐘被回調,則它可" "能回傳比之前呼叫更小的值。" -#: ../../library/time.rst:706 +#: ../../library/time.rst:708 msgid "" "The number returned by :func:`.time` may be converted into a more common " "time format (i.e. year, month, day, hour, etc...) in UTC by passing it to :" @@ -1286,25 +1288,25 @@ msgstr "" "為當地時間。在這兩種情況下都會回傳一個 :class:`struct_time` 物件,從中可以作" "為屬性存取日曆日期的組成部分。" -#: ../../library/time.rst:715 +#: ../../library/time.rst:717 msgid "On Windows, call ``GetSystemTimePreciseAsFileTime()``." msgstr "在 Windows 上,呼叫 ``GetSystemTimePreciseAsFileTime()``。" -#: ../../library/time.rst:716 +#: ../../library/time.rst:718 msgid "Call ``clock_gettime(CLOCK_REALTIME)`` if available." msgstr "如果可以的話,呼叫 ``clock_gettime(CLOCK_REALTIME)``。" -#: ../../library/time.rst:717 +#: ../../library/time.rst:719 msgid "Otherwise, call ``gettimeofday()``." msgstr "否則,呼叫 ``gettimeofday()``。" -#: ../../library/time.rst:719 +#: ../../library/time.rst:721 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "使用 :func:`time_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:724 +#: ../../library/time.rst:726 msgid "" "On Windows, calls ``GetSystemTimePreciseAsFileTime()`` instead of " "``GetSystemTimeAsFileTime()``." @@ -1312,13 +1314,13 @@ msgstr "" "在 Windows 上,呼叫 ``GetSystemTimePreciseAsFileTime()`` 而不是 " "``GetSystemTimeAsFileTime()``。" -#: ../../library/time.rst:730 +#: ../../library/time.rst:732 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "類似於 :func:`~time.time`,但回傳自 epoch_ 起的以奈秒為單位的整數。" -#: ../../library/time.rst:743 +#: ../../library/time.rst:745 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current thread. It does not include time elapsed during " @@ -1330,22 +1332,22 @@ msgstr "" "期間經過的時間。根據定義,這是執行緒特定 (thread-specific) 的。回傳值的參照點" "未定義,因此只有同一執行緒中兩次呼叫結果之間的差異才是有效的。" -#: ../../library/time.rst:749 +#: ../../library/time.rst:751 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" "使用 :func:`thread_time_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:754 +#: ../../library/time.rst:756 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "有支援 ``CLOCK_THREAD_CPUTIME_ID`` 的 Unix 系統。" -#: ../../library/time.rst:761 +#: ../../library/time.rst:763 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "類似於 :func:`thread_time`,但回傳以奈秒為單位的時間。" -#: ../../library/time.rst:768 +#: ../../library/time.rst:770 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1362,7 +1364,7 @@ msgstr "" "``daylight``\\ (如果該時區沒有日光節約時間規則,則設定為 0;如果在過去、現在" "或未來的某個時間有日光節約時間規則,則設置為非零的值)。" -#: ../../library/time.rst:780 +#: ../../library/time.rst:782 msgid "" "Although in many cases, changing the :envvar:`TZ` environment variable may " "affect the output of functions like :func:`localtime` without calling :func:" @@ -1371,30 +1373,30 @@ msgstr "" "雖然在許多情況下,更改 :envvar:`TZ` 環境變數可能會在沒有呼叫 :func:`tzset` 的" "情況下影響 :func:`localtime` 等函式的輸出,但是這種行為是不該被依賴的。" -#: ../../library/time.rst:784 +#: ../../library/time.rst:786 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr ":envvar:`TZ` 環境變數不應包含空格字元。" -#: ../../library/time.rst:786 +#: ../../library/time.rst:788 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" ":envvar:`TZ` 環境變數的標準格式為(為了清楚表達,中間增加了空格字元): ::" -#: ../../library/time.rst:789 +#: ../../library/time.rst:791 msgid "std offset [dst [offset [,start[/time], end[/time]]]]" msgstr "std offset [dst [offset [,start[/time], end[/time]]]]" -#: ../../library/time.rst:791 +#: ../../library/time.rst:793 msgid "Where the components are:" msgstr "其中各個組成部分為:" -#: ../../library/time.rst:793 +#: ../../library/time.rst:795 msgid "``std`` and ``dst``" msgstr "``std`` 和 ``dst``" -#: ../../library/time.rst:794 +#: ../../library/time.rst:796 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" @@ -1402,11 +1404,11 @@ msgstr "" "三個或更多字母與數字 (alphanumerics) 組成的時區縮寫。這些縮寫會被傳播到 time." "tzname 中。" -#: ../../library/time.rst:797 +#: ../../library/time.rst:799 msgid "``offset``" msgstr "``offset``" -#: ../../library/time.rst:798 +#: ../../library/time.rst:800 msgid "" "The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added " "the local time to arrive at UTC. If preceded by a '-', the timezone is east " @@ -1417,22 +1419,22 @@ msgstr "" "果以 '-' 開頭,則表示該時區位於本初子午線以東;否則,位於其西。如果 dst 之後" "沒有偏移量,則假定日光時間比標準時間快一小時。" -#: ../../library/time.rst:803 +#: ../../library/time.rst:805 msgid "``start[/time], end[/time]``" msgstr "``start[/time], end[/time]``" -#: ../../library/time.rst:804 +#: ../../library/time.rst:806 msgid "" "Indicates when to change to and back from DST. The format of the start and " "end dates are one of the following:" msgstr "" "表示何時切換至日光節約時間及何時切換回來。開始和結束日期的格式如以下其一:" -#: ../../library/time.rst:807 +#: ../../library/time.rst:809 msgid ":samp:`J{n}`" msgstr ":samp:`J{n}`" -#: ../../library/time.rst:808 +#: ../../library/time.rst:810 msgid "" "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " "years February 28 is day 59 and March 1 is day 60." @@ -1440,22 +1442,22 @@ msgstr "" "儒略日 (Julian day) *n*(1 <= *n* <= 365)。閏日不計算,因此在所有年份中,2 " "月 28 日是第 59 天,3 月 1 日是第 60 天。" -#: ../../library/time.rst:811 +#: ../../library/time.rst:813 msgid ":samp:`{n}`" msgstr ":samp:`{n}`" -#: ../../library/time.rst:812 +#: ../../library/time.rst:814 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" "從 0 開始的儒略日 (0 <= *n* <= 365)。閏日會計算,因此可以適用至 2 月 29 日。" -#: ../../library/time.rst:815 +#: ../../library/time.rst:817 msgid ":samp:`M{m}.{n}.{d}`" msgstr ":samp:`M{m}.{n}.{d}`" -#: ../../library/time.rst:816 +#: ../../library/time.rst:818 msgid "" "The *d*'th day (0 <= *d* <= 6) of week *n* of month *m* of the year (1 <= " "*n* <= 5, 1 <= *m* <= 12, where week 5 means \"the last *d* day in month " @@ -1466,7 +1468,7 @@ msgstr "" "*m* <= 12,其中 *n* 為 5 表示「該月的最後一個第 *d* 天」,這可能出現在第四或" "第五週)。第 1 週是 *d* 天首次出現的那一週。第零天為星期天。" -#: ../../library/time.rst:822 +#: ../../library/time.rst:824 msgid "" "``time`` has the same format as ``offset`` except that no leading sign ('-' " "or '+') is allowed. The default, if time is not given, is 02:00:00." @@ -1474,7 +1476,7 @@ msgstr "" "``time`` 的格式與 ``offset`` 相同,但不允許出現前導符號('-' 或 '+')。如果未" "指定時間,則預設為 02:00:00。" -#: ../../library/time.rst:827 +#: ../../library/time.rst:829 msgid "" ">>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'\n" ">>> time.tzset()\n" @@ -1494,7 +1496,7 @@ msgstr "" ">>> time.strftime('%X %x %Z')\n" "'16:08:12 05/08/03 AEST'" -#: ../../library/time.rst:836 +#: ../../library/time.rst:838 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1511,7 +1513,7 @@ msgstr "" "Eastern'``、``'Australia/Melbourne'``、``'Egypt'`` 或 ``'Europe/" "Amsterdam'``。 ::" -#: ../../library/time.rst:844 +#: ../../library/time.rst:846 msgid "" ">>> os.environ['TZ'] = 'US/Eastern'\n" ">>> time.tzset()\n" @@ -1531,24 +1533,24 @@ msgstr "" ">>> time.tzname\n" "('EET', 'EEST')" -#: ../../library/time.rst:857 +#: ../../library/time.rst:859 msgid "Clock ID Constants" msgstr "時鐘 ID 常數" -#: ../../library/time.rst:859 +#: ../../library/time.rst:861 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." msgstr "這些常數用作 :func:`clock_getres` 和 :func:`clock_gettime` 的參數。" -#: ../../library/time.rst:864 +#: ../../library/time.rst:866 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" "與 :data:`CLOCK_MONOTONIC` 基本相同,不同之處在於它還包括系統暫停的任何時間。" -#: ../../library/time.rst:867 +#: ../../library/time.rst:869 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " @@ -1559,7 +1561,7 @@ msgstr "" "`CLOCK_REALTIME` 的複雜情況,後者在使用 ``settimeofday()`` 或類似函式更改時間" "時可能會出現不連續的情況。" -#: ../../library/time.rst:879 +#: ../../library/time.rst:881 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " @@ -1568,13 +1570,13 @@ msgstr "" "Solaris 作業系統具有 ``CLOCK_HIGHRES`` 計時器,它嘗試使用最佳的硬體資源,並可" "能提供接近奈秒的解析度。``CLOCK_HIGHRES`` 是不可調整且高解析度的時鐘。" -#: ../../library/time.rst:890 +#: ../../library/time.rst:892 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "該時鐘無法被設定,其表示自某個未指定起點以來的單調時間。" -#: ../../library/time.rst:900 +#: ../../library/time.rst:902 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." @@ -1582,7 +1584,7 @@ msgstr "" "類似於 :data:`CLOCK_MONOTONIC`,但提供對基於硬體的原始時間的存取,此時間不受 " "NTP 調整的影響。" -#: ../../library/time.rst:909 +#: ../../library/time.rst:911 msgid "" "Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the " "system at context switch and hence has less accuracy." @@ -1590,11 +1592,11 @@ msgstr "" "類似於 :data:`CLOCK_MONOTONIC_RAW`,但讀取的是系統在情境切換時快取的值,因此" "精準度較低。" -#: ../../library/time.rst:919 ../../library/time.rst:928 +#: ../../library/time.rst:921 ../../library/time.rst:930 msgid "High-resolution per-process timer from the CPU." msgstr "來自 CPU 的高解析度每個行程的計時器。" -#: ../../library/time.rst:936 +#: ../../library/time.rst:938 msgid "" "`International Atomic Time `_" @@ -1602,18 +1604,18 @@ msgstr "" "`國際原子時間 `_" -#: ../../library/time.rst:938 +#: ../../library/time.rst:940 msgid "" "The system must have a current leap second table in order for this to give " "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" "系統必須擁有目前的閏秒表才能給出正確答案。PTP 或 NTP 軟體可以維護閏秒表。" -#: ../../library/time.rst:947 +#: ../../library/time.rst:949 msgid "Thread-specific CPU-time clock." msgstr "執行緒相關的 CPU 時間時鐘。" -#: ../../library/time.rst:956 +#: ../../library/time.rst:958 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." @@ -1621,7 +1623,7 @@ msgstr "" "表示系統運作且無暫停的絕對時間,提供包括絕對時間 (absolute) 和時間區間 " "(interval) 的精確的正常上線時間 (uptime) 測量。" -#: ../../library/time.rst:967 +#: ../../library/time.rst:969 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " @@ -1630,7 +1632,7 @@ msgstr "" "單調增量的時鐘,從某個任意點開始計時,不受頻率或時間調整影響,並且在系統休眠" "時不增量。" -#: ../../library/time.rst:977 +#: ../../library/time.rst:979 msgid "" "Like :data:`CLOCK_UPTIME_RAW`, but the value is cached by the system at " "context switches and therefore has less accuracy." @@ -1638,23 +1640,23 @@ msgstr "" "類似於 :data:`CLOCK_UPTIME_RAW`,但該值在情境切換時由系統快取,因此精準度較" "低。" -#: ../../library/time.rst:984 +#: ../../library/time.rst:986 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." msgstr "以下常數是唯一可以傳遞給 :func:`clock_settime` 的參數。" -#: ../../library/time.rst:990 +#: ../../library/time.rst:992 msgid "" -"System-wide real-time clock. Setting this clock requires appropriate " -"privileges." -msgstr "涵蓋整個系統的即時時鐘。設定此時鐘需要適當的權限。" +"Real-time clock. Setting this clock requires appropriate privileges. The " +"clock is the same for all processes." +msgstr "即時時鐘。設定此時鐘需要適當的權限。時鐘對於所有行程都會是相同。" -#: ../../library/time.rst:1001 +#: ../../library/time.rst:1003 msgid "Timezone Constants" msgstr "時區常數" -#: ../../library/time.rst:1005 +#: ../../library/time.rst:1007 msgid "" "The offset of the local DST timezone, in seconds west of UTC, if one is " "defined. This is negative if the local DST timezone is east of UTC (as in " @@ -1665,11 +1667,11 @@ msgstr "" "為單位)。若本地 DST 時區位於 UTC 以東(例如包括英國在內的西歐),則此值為負" "值。僅在 ``daylight`` 為非零時使用此值。詳情請參見下方註釋。" -#: ../../library/time.rst:1011 +#: ../../library/time.rst:1013 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "如果定義了 DST 時區,則為非零值。詳情請參見下方註釋。" -#: ../../library/time.rst:1015 +#: ../../library/time.rst:1017 msgid "" "The offset of the local (non-DST) timezone, in seconds west of UTC (negative " "in most of Western Europe, positive in the US, zero in the UK). See note " @@ -1678,7 +1680,7 @@ msgstr "" "本地(非 DST)時區相對於 UTC 以西的偏移量(以秒為單位),西歐大多數地區為負," "美國為正,英國為零。詳情請參見下方註釋。" -#: ../../library/time.rst:1020 +#: ../../library/time.rst:1022 msgid "" "A tuple of two strings: the first is the name of the local non-DST timezone, " "the second is the name of the local DST timezone. If no DST timezone is " @@ -1687,7 +1689,7 @@ msgstr "" "一個包含兩個字串的元組:第一個是本地非 DST 時區的名稱,第二個是本地 DST 時區" "的名稱。如果沒有定義 DST 時區,則不應使用第二個字串。詳情請參見下方註釋。" -#: ../../library/time.rst:1026 +#: ../../library/time.rst:1028 msgid "" "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" "`timezone`, and :data:`tzname`), the value is determined by the timezone " @@ -1701,19 +1703,19 @@ msgstr "" "決定,且過去的時間可能會不準確。建議使用 :func:`localtime` 回傳的 :attr:" "`~struct_time.tm_gmtoff` 和 :attr:`~struct_time.tm_zone` 來取得時區資訊。" -#: ../../library/time.rst:1035 +#: ../../library/time.rst:1037 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/time.rst:1036 +#: ../../library/time.rst:1038 msgid "More object-oriented interface to dates and times." msgstr "更多物件導向的日期和時間介面。" -#: ../../library/time.rst:1038 +#: ../../library/time.rst:1040 msgid "Module :mod:`locale`" msgstr ":mod:`locale` 模組" -#: ../../library/time.rst:1039 +#: ../../library/time.rst:1041 msgid "" "Internationalization services. The locale setting affects the " "interpretation of many format specifiers in :func:`strftime` and :func:" @@ -1722,11 +1724,11 @@ msgstr "" "國際化服務。區域設定會影響 :func:`strftime` 和 :func:`strptime` 中許多格式指" "定符號 (format specifiers) 的解譯。" -#: ../../library/time.rst:1042 +#: ../../library/time.rst:1044 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/time.rst:1043 +#: ../../library/time.rst:1045 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." @@ -1734,11 +1736,11 @@ msgstr "" "通用的日曆相關函式。:func:`~calendar.timegm` 是本模組中 :func:`gmtime` 的反函" "式。" -#: ../../library/time.rst:1047 +#: ../../library/time.rst:1049 msgid "Footnotes" msgstr "註解" -#: ../../library/time.rst:1048 +#: ../../library/time.rst:1050 msgid "" "The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to " "the preferred hour/minute offset is not supported by all ANSI C libraries. " @@ -1782,31 +1784,23 @@ msgstr "Greenwich Mean Time(格林威治標準時間)" msgid "Daylight Saving Time" msgstr "Daylight Saving Time(日光節約時間)" -#: ../../library/time.rst:323 ../../library/time.rst:358 -#: ../../library/time.rst:738 +#: ../../library/time.rst:324 ../../library/time.rst:360 +#: ../../library/time.rst:740 msgid "benchmarking" msgstr "benchmarking(基準測試)" -#: ../../library/time.rst:358 ../../library/time.rst:738 +#: ../../library/time.rst:360 ../../library/time.rst:740 msgid "CPU time" msgstr "CPU time(CPU 時間)" -#: ../../library/time.rst:358 ../../library/time.rst:738 +#: ../../library/time.rst:360 ../../library/time.rst:740 msgid "processor time" msgstr "processor time(處理器時間)" -#: ../../library/time.rst:429 ../../library/time.rst:588 +#: ../../library/time.rst:431 ../../library/time.rst:590 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/time.rst:429 ../../library/time.rst:588 +#: ../../library/time.rst:431 ../../library/time.rst:590 msgid "datetime format" msgstr "datetime format(日期時間格式)" - -#~ msgid "" -#~ "UTC is Coordinated Universal Time (formerly known as Greenwich Mean Time, " -#~ "or GMT). The acronym UTC is not a mistake but a compromise between " -#~ "English and French." -#~ msgstr "" -#~ "UTC 是 Coordinated Universal Time --- 世界協調時間(原稱為格林威治標準時" -#~ "間,或 GMT)。縮寫 UTC 並不是寫錯,而是英文和法文之間折衷的結果。" diff --git a/library/venv.po b/library/venv.po index 6ee64fe52b..659bbd17f1 100644 --- a/library/venv.po +++ b/library/venv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2025-07-12 00:16+0000\n" "PO-Revision-Date: 2025-05-23 10:20+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,13 +30,13 @@ msgstr "**原始碼:**\\ :source:`Lib/venv/`" #: ../../library/venv.rst:21 msgid "" -"The :mod:`!venv` module supports creating lightweight \"virtual environments" -"\", each with their own independent set of Python packages installed in " -"their :mod:`site` directories. A virtual environment is created on top of an " -"existing Python installation, known as the virtual environment's \"base\" " -"Python, and may optionally be isolated from the packages in the base " -"environment, so only those explicitly installed in the virtual environment " -"are available." +"The :mod:`!venv` module supports creating lightweight \"virtual " +"environments\", each with their own independent set of Python packages " +"installed in their :mod:`site` directories. A virtual environment is created " +"on top of an existing Python installation, known as the virtual " +"environment's \"base\" Python, and may optionally be isolated from the " +"packages in the base environment, so only those explicitly installed in the " +"virtual environment are available." msgstr "" ":mod:`!venv` 模組支援建立輕量級的「虛擬環境」,每個虛擬環境都有獨立安裝在其 :" "mod:`site` 目錄中的一組 Python 套件。虛擬環境是建立在既有的 Python 安裝上(稱" @@ -187,80 +187,71 @@ msgid "" "\n" "Creates virtual Python environments in one or more target directories.\n" "\n" -"positional arguments:\n" -" ENV_DIR A directory to create the environment in.\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --system-site-packages\n" -" Give the virtual environment access to the system\n" -" site-packages dir.\n" -" --symlinks Try to use symlinks rather than copies, when\n" -" symlinks are not the default for the platform.\n" -" --copies Try to use copies rather than symlinks, even when\n" -" symlinks are the default for the platform.\n" -" --clear Delete the contents of the environment directory\n" -" if it already exists, before environment creation.\n" -" --upgrade Upgrade the environment directory to use this\n" -" version of Python, assuming Python has been\n" -" upgraded in-place.\n" -" --without-pip Skips installing or upgrading pip in the virtual\n" -" environment (pip is bootstrapped by default)\n" -" --prompt PROMPT Provides an alternative prompt prefix for this\n" -" environment.\n" -" --upgrade-deps Upgrade core dependencies (pip) to the latest\n" -" version in PyPI\n" -" --without-scm-ignore-files\n" -" Skips adding SCM ignore files to the environment\n" -" directory (Git is supported by default).\n" -"\n" "Once an environment has been created, you may wish to activate it, e.g. by\n" "sourcing an activate script in its bin directory." msgstr "" -"usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]\n" -" [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-deps]\n" -" [--without-scm-ignore-files]\n" -" ENV_DIR [ENV_DIR ...]\n" -"\n" -"Creates virtual Python environments in one or more target directories.\n" -"\n" -"positional arguments:\n" -" ENV_DIR A directory to create the environment in.\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --system-site-packages\n" -" Give the virtual environment access to the system\n" -" site-packages dir.\n" -" --symlinks Try to use symlinks rather than copies, when\n" -" symlinks are not the default for the platform.\n" -" --copies Try to use copies rather than symlinks, even when\n" -" symlinks are the default for the platform.\n" -" --clear Delete the contents of the environment directory\n" -" if it already exists, before environment creation.\n" -" --upgrade Upgrade the environment directory to use this\n" -" version of Python, assuming Python has been\n" -" upgraded in-place.\n" -" --without-pip Skips installing or upgrading pip in the virtual\n" -" environment (pip is bootstrapped by default)\n" -" --prompt PROMPT Provides an alternative prompt prefix for this\n" -" environment.\n" -" --upgrade-deps Upgrade core dependencies (pip) to the latest\n" -" version in PyPI\n" -" --without-scm-ignore-files\n" -" Skips adding SCM ignore files to the environment\n" -" directory (Git is supported by default).\n" -"\n" -"Once an environment has been created, you may wish to activate it, e.g. by\n" -"sourcing an activate script in its bin directory." -#: ../../library/venv.rst:136 +#: ../../library/venv.rst:113 +msgid "" +"A required argument specifying the directory to create the environment in." +msgstr "" + +#: ../../library/venv.rst:117 +msgid "" +"Give the virtual environment access to the system site-packages directory." +msgstr "" + +#: ../../library/venv.rst:121 +msgid "" +"Try to use symlinks rather than copies, when symlinks are not the default " +"for the platform." +msgstr "" + +#: ../../library/venv.rst:125 +msgid "" +"Try to use copies rather than symlinks, even when symlinks are the default " +"for the platform." +msgstr "" + +#: ../../library/venv.rst:129 +msgid "" +"Delete the contents of the environment directory if it already exists, " +"before environment creation." +msgstr "" + +#: ../../library/venv.rst:133 +msgid "" +"Upgrade the environment directory to use this version of Python, assuming " +"Python has been upgraded in-place." +msgstr "" + +#: ../../library/venv.rst:137 +msgid "" +"Skips installing or upgrading pip in the virtual environment (pip is " +"bootstrapped by default)." +msgstr "" + +#: ../../library/venv.rst:141 +msgid "Provides an alternative prompt prefix for this environment." +msgstr "" + +#: ../../library/venv.rst:145 +msgid "Upgrade core dependencies (pip) to the latest version in PyPI." +msgstr "" + +#: ../../library/venv.rst:149 +msgid "" +"Skips adding SCM ignore files to the environment directory (Git is supported " +"by default)." +msgstr "" + +#: ../../library/venv.rst:152 msgid "" "Installs pip by default, added the ``--without-pip`` and ``--copies`` " "options." msgstr "預設會安裝 pip,並新增了 ``--without-pip`` 和 ``--copies`` 選項" -#: ../../library/venv.rst:140 +#: ../../library/venv.rst:156 msgid "" "In earlier versions, if the target directory already existed, an error was " "raised, unless the ``--clear`` or ``--upgrade`` option was provided." @@ -268,26 +259,26 @@ msgstr "" "在較早的版本中,如果目標目錄已存在,除非提供了 ``--clear`` 或 ``--upgrade`` " "選項,否則會引發錯誤。" -#: ../../library/venv.rst:144 +#: ../../library/venv.rst:160 msgid "" "Add ``--upgrade-deps`` option to upgrade pip + setuptools to the latest on " "PyPI." msgstr "" "新增 ``--upgrade-deps`` 選項以將 pip 和 setuptools 升級至 PyPI 上的最新版本" -#: ../../library/venv.rst:149 +#: ../../library/venv.rst:165 msgid "``setuptools`` is no longer a core venv dependency." msgstr "``setuptools`` 不再是 venv 的核心相依套件。" -#: ../../library/venv.rst:153 +#: ../../library/venv.rst:169 msgid "Added the ``--without-scm-ignore-files`` option." msgstr "新增 ``--without-scm-ignore-files`` 選項" -#: ../../library/venv.rst:154 +#: ../../library/venv.rst:170 msgid "``venv`` now creates a :file:`.gitignore` file for Git by default." msgstr "``venv`` 現在預設會為 Git 建立 :file:`.gitignore` 檔案。" -#: ../../library/venv.rst:158 +#: ../../library/venv.rst:174 msgid "" "While symlinks are supported on Windows, they are not recommended. Of " "particular note is that double-clicking ``python.exe`` in File Explorer will " @@ -296,7 +287,7 @@ msgstr "" "雖然在 Windows 上支援符號連結,但並不建議使用。特別需要注意的是,在檔案總管中" "按兩下 ``python.exe`` 會急切地解析符號連結並忽略虛擬環境。" -#: ../../library/venv.rst:163 +#: ../../library/venv.rst:179 msgid "" "On Microsoft Windows, it may be required to enable the ``Activate.ps1`` " "script by setting the execution policy for the user. You can do this by " @@ -305,13 +296,13 @@ msgstr "" "在 Microsoft Windows 上,可能需要通過設置使用者的執行策略來啟用 ``Activate." "ps1`` 腳本。你可以發出以下 PowerShell 命令來執行此操作:" -#: ../../library/venv.rst:167 +#: ../../library/venv.rst:183 msgid "" "PS C:\\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" msgstr "" "PS C:\\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" -#: ../../library/venv.rst:171 +#: ../../library/venv.rst:187 msgid "" "See `About Execution Policies `_ for more information." @@ -319,7 +310,7 @@ msgstr "" "有關更多資訊,請參閱\\ `關於執行策略 `_。" -#: ../../library/venv.rst:175 +#: ../../library/venv.rst:191 msgid "" "The created :file:`pyvenv.cfg` file also includes the ``include-system-site-" "packages`` key, set to ``true`` if ``venv`` is run with the ``--system-site-" @@ -329,7 +320,7 @@ msgstr "" "鍵,如果使用 ``venv`` 執行時帶有 ``--system-site-packages`` 選項,則設置為 " "``true``,否則設置為 ``false``。" -#: ../../library/venv.rst:179 +#: ../../library/venv.rst:195 msgid "" "Unless the ``--without-pip`` option is given, :mod:`ensurepip` will be " "invoked to bootstrap ``pip`` into the virtual environment." @@ -337,7 +328,7 @@ msgstr "" "除非 ``--without-pip`` 選項被提供,否則將叫用 :mod:`ensurepip` 來啟動 " "``pip`` 到虛擬環境中。" -#: ../../library/venv.rst:182 +#: ../../library/venv.rst:198 msgid "" "Multiple paths can be given to ``venv``, in which case an identical virtual " "environment will be created, according to the given options, at each " @@ -346,11 +337,11 @@ msgstr "" "可以向 ``venv`` 提供多個路徑,這樣每個提供的路徑都將根據給定的選項建立一個相" "同的虛擬環境。" -#: ../../library/venv.rst:189 +#: ../../library/venv.rst:205 msgid "How venvs work" msgstr "虛擬環境如何運作" -#: ../../library/venv.rst:191 +#: ../../library/venv.rst:207 msgid "" "When a Python interpreter is running from a virtual environment, :data:`sys." "prefix` and :data:`sys.exec_prefix` point to the directories of the virtual " @@ -364,7 +355,7 @@ msgstr "" "base_exec_prefix` 會指向建立虛擬環境的基礎 Python 的目錄。檢查 ``sys.prefix !" "= sys.base_prefix`` 就可以確定目前的直譯器是否跑在虛擬環境中。" -#: ../../library/venv.rst:200 +#: ../../library/venv.rst:216 msgid "" "A virtual environment may be \"activated\" using a script in its binary " "directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " @@ -380,85 +371,85 @@ msgstr "" "用完整的路徑。啟動腳本的方式因平台而異(:samp:`{}` 需要替換成包含虛擬環" "境的目錄路徑)" -#: ../../library/venv.rst:210 +#: ../../library/venv.rst:226 msgid "Platform" msgstr "平台" -#: ../../library/venv.rst:210 +#: ../../library/venv.rst:226 msgid "Shell" msgstr "Shell" -#: ../../library/venv.rst:210 +#: ../../library/venv.rst:226 msgid "Command to activate virtual environment" msgstr "啟動虛擬環境的指令" -#: ../../library/venv.rst:212 +#: ../../library/venv.rst:228 msgid "POSIX" msgstr "POSIX" -#: ../../library/venv.rst:212 +#: ../../library/venv.rst:228 msgid "bash/zsh" msgstr "bash/zsh" -#: ../../library/venv.rst:212 +#: ../../library/venv.rst:228 msgid ":samp:`$ source {}/bin/activate`" msgstr ":samp:`$ source {}/bin/activate`" -#: ../../library/venv.rst:214 +#: ../../library/venv.rst:230 msgid "fish" msgstr "fish" -#: ../../library/venv.rst:214 +#: ../../library/venv.rst:230 msgid ":samp:`$ source {}/bin/activate.fish`" msgstr ":samp:`$ source {}/bin/activate.fish`" -#: ../../library/venv.rst:216 +#: ../../library/venv.rst:232 msgid "csh/tcsh" msgstr "csh/tcsh" -#: ../../library/venv.rst:216 +#: ../../library/venv.rst:232 msgid ":samp:`$ source {}/bin/activate.csh`" msgstr ":samp:`$ source {}/bin/activate.csh`" -#: ../../library/venv.rst:218 +#: ../../library/venv.rst:234 msgid "pwsh" msgstr "pwsh" -#: ../../library/venv.rst:218 +#: ../../library/venv.rst:234 msgid ":samp:`$ {}/bin/Activate.ps1`" msgstr ":samp:`$ {}/bin/Activate.ps1`" -#: ../../library/venv.rst:220 +#: ../../library/venv.rst:236 msgid "Windows" msgstr "Windows" -#: ../../library/venv.rst:220 +#: ../../library/venv.rst:236 msgid "cmd.exe" msgstr "cmd.exe" -#: ../../library/venv.rst:220 +#: ../../library/venv.rst:236 msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" -#: ../../library/venv.rst:222 +#: ../../library/venv.rst:238 msgid "PowerShell" msgstr "PowerShell" -#: ../../library/venv.rst:222 +#: ../../library/venv.rst:238 msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" -#: ../../library/venv.rst:225 +#: ../../library/venv.rst:241 msgid ":program:`fish` and :program:`csh` activation scripts." msgstr ":program:`fish` 和 :program:`csh` 啟動腳本。" -#: ../../library/venv.rst:228 +#: ../../library/venv.rst:244 msgid "" "PowerShell activation scripts installed under POSIX for PowerShell Core " "support." msgstr "PowerShell 的啟動腳本安裝在 POSIX 上支援 PowerShell Core。" -#: ../../library/venv.rst:232 +#: ../../library/venv.rst:248 msgid "" "You don't specifically *need* to activate a virtual environment, as you can " "just specify the full path to that environment's Python interpreter when " @@ -469,7 +460,7 @@ msgstr "" "整路徑。此外,所有安裝在環境裡的腳本都應該都可以在未啟用虛擬環境的情況下運" "行。" -#: ../../library/venv.rst:238 +#: ../../library/venv.rst:254 msgid "" "In order to achieve this, scripts installed into virtual environments have a " "\"shebang\" line which points to the environment's Python interpreter, :samp:" @@ -487,7 +478,7 @@ msgstr "" "Explorer)中雙擊已安裝的腳本,應該可以在沒有啟用環境或將其加入 :envvar:" "`PATH` 的情況下正確地運行。" -#: ../../library/venv.rst:247 +#: ../../library/venv.rst:263 msgid "" "When a virtual environment has been activated, the :envvar:`!VIRTUAL_ENV` " "environment variable is set to the path of the environment. Since explicitly " @@ -499,7 +490,7 @@ msgstr "" "於不需要明確啟用虛擬環境才能使用它。因此,無法依賴 :envvar:`!VIRTUAL_ENV` 來" "判斷是否正在使用虛擬環境。" -#: ../../library/venv.rst:253 +#: ../../library/venv.rst:269 msgid "" "Because scripts installed in environments should not expect the environment " "to be activated, their shebang lines contain the absolute paths to their " @@ -522,7 +513,7 @@ msgstr "" "位置重新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應" "該在新位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" -#: ../../library/venv.rst:267 +#: ../../library/venv.rst:283 msgid "" "You can deactivate a virtual environment by typing ``deactivate`` in your " "shell. The exact mechanism is platform-specific and is an internal " @@ -531,11 +522,11 @@ msgstr "" "你可以在 shell 輸入 ``deactivate`` 來關閉虛擬環境。具體的使用方式因平台而異," "是內部實作的細節(通常會使用腳本或是 shell 函式)" -#: ../../library/venv.rst:275 +#: ../../library/venv.rst:291 msgid "API" msgstr "API" -#: ../../library/venv.rst:279 +#: ../../library/venv.rst:295 msgid "" "The high-level method described above makes use of a simple API which " "provides mechanisms for third-party virtual environment creators to " @@ -545,13 +536,13 @@ msgstr "" "上述提到的高階 method(方法)透過簡單的 API 使用, 為第三方虛擬環境建立者提供" "可以依據他們需求來建立環境的客製化機制: :class:`EnvBuilder` class。" -#: ../../library/venv.rst:288 +#: ../../library/venv.rst:304 msgid "" "The :class:`EnvBuilder` class accepts the following keyword arguments on " "instantiation:" msgstr "進行實例化時,class :class:`EnvBuilder` 接受下列的關鍵字引數:" -#: ../../library/venv.rst:291 +#: ../../library/venv.rst:307 msgid "" "*system_site_packages* -- a boolean value indicating that the system Python " "site-packages should be available to the environment (defaults to ``False``)." @@ -559,7 +550,7 @@ msgstr "" "*system_site_packages* -- 為一個 boolean (布林值),並表明系統的 Python " "site-packages 是否可以在環境中可用(預設為 ``False`` )。" -#: ../../library/venv.rst:294 +#: ../../library/venv.rst:310 msgid "" "*clear* -- a boolean value which, if true, will delete the contents of any " "existing target directory, before creating the environment." @@ -567,7 +558,7 @@ msgstr "" "*clear* -- 為一個 boolean,如果為 true,則在建立環境之前,刪除目標目錄內所有" "存在的內容。" -#: ../../library/venv.rst:297 +#: ../../library/venv.rst:313 msgid "" "*symlinks* -- a boolean value indicating whether to attempt to symlink the " "Python binary rather than copying." @@ -575,7 +566,7 @@ msgstr "" "*symlinks* -- 為一個 boolean,並表明是否嘗試與 Python 二進位檔案建立符號連結" "而不是複製該檔案。" -#: ../../library/venv.rst:300 +#: ../../library/venv.rst:316 msgid "" "*upgrade* -- a boolean value which, if true, will upgrade an existing " "environment with the running Python - for use when that Python has been " @@ -584,7 +575,7 @@ msgstr "" "*upgrade* -- 為一個 boolean,若為 true,則會在執行 Python 時為現有的環境進行" "升級。目的是讓 Python 可以升級到位(預設為 ``False``)。" -#: ../../library/venv.rst:304 +#: ../../library/venv.rst:320 msgid "" "*with_pip* -- a boolean value which, if true, ensures pip is installed in " "the virtual environment. This uses :mod:`ensurepip` with the ``--default-" @@ -593,7 +584,7 @@ msgstr "" "*with_pip* -- 為一個 boolean,若為 true,則確保 pip 有安裝至虛擬環境之中。當" "有 ``--default-pip`` 的選項時,會使用 :mod:`ensurepip`。" -#: ../../library/venv.rst:308 +#: ../../library/venv.rst:324 msgid "" "*prompt* -- a string to be used after virtual environment is activated " "(defaults to ``None`` which means directory name of the environment would be " @@ -604,11 +595,11 @@ msgstr "" "``None``,代表該環境的目錄名稱會被使用)倘若出現特殊字串 ``\".\"`` ,則目前目" "錄的 basename 會做為提示路徑使用。" -#: ../../library/venv.rst:313 +#: ../../library/venv.rst:329 msgid "*upgrade_deps* -- Update the base venv modules to the latest on PyPI" msgstr "*upgrade_deps* -- 更新基礎 venv 模組至 PyPI 的最新版本" -#: ../../library/venv.rst:315 +#: ../../library/venv.rst:331 msgid "" "*scm_ignore_files* -- Create ignore files based for the specified source " "control managers (SCM) in the iterable. Support is defined by having a " @@ -619,27 +610,27 @@ msgstr "" "檔。支援情況取決於是否有名為 ``create_{scm}_ignore_file`` 的方法。預設唯一支" "援的值是 ``\"git\"``,透過 :meth:`create_git_ignore_file` 方法提供支援。" -#: ../../library/venv.rst:321 +#: ../../library/venv.rst:337 msgid "Added the ``with_pip`` parameter" msgstr "新增 ``with_pip`` 參數" -#: ../../library/venv.rst:324 +#: ../../library/venv.rst:340 msgid "Added the ``prompt`` parameter" msgstr "新增 ``prompt`` 參數" -#: ../../library/venv.rst:327 +#: ../../library/venv.rst:343 msgid "Added the ``upgrade_deps`` parameter" msgstr "新增 ``upgrade_deps`` 參數" -#: ../../library/venv.rst:330 +#: ../../library/venv.rst:346 msgid "Added the ``scm_ignore_files`` parameter" msgstr "新增 ``scm_ignore_files`` 參數" -#: ../../library/venv.rst:333 +#: ../../library/venv.rst:349 msgid ":class:`EnvBuilder` may be used as a base class." msgstr ":class:`EnvBuilder` 可以被用作為基底類別。" -#: ../../library/venv.rst:337 +#: ../../library/venv.rst:353 msgid "" "Create a virtual environment by specifying the target directory (absolute or " "relative to the current directory) which is to contain the virtual " @@ -650,7 +641,7 @@ msgstr "" "目錄),也就是在該目錄中容納虛擬環境。``create`` method 將會在指定的目錄下建" "立環境,或是觸發適當的例外。" -#: ../../library/venv.rst:343 +#: ../../library/venv.rst:359 msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" @@ -658,7 +649,7 @@ msgstr "" ":class:`EnvBuilder` class 的 ``create`` method 會闡述可用的 Hooks 以客製化 " "subclass (子類別)::" -#: ../../library/venv.rst:346 +#: ../../library/venv.rst:362 msgid "" "def create(self, env_dir):\n" " \"\"\"\n" @@ -684,7 +675,7 @@ msgstr "" " self.setup_scripts(context)\n" " self.post_setup(context)" -#: ../../library/venv.rst:358 +#: ../../library/venv.rst:374 msgid "" "Each of the methods :meth:`ensure_directories`, :meth:" "`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" @@ -693,7 +684,7 @@ msgstr "" "每個 methods :meth:`ensure_directories`、:meth:`create_configuration`、:meth:" "`setup_python`、:meth:`setup_scripts` 及 :meth:`post_setup` 都可以被覆寫。" -#: ../../library/venv.rst:364 +#: ../../library/venv.rst:380 msgid "" "Creates the environment directory and all necessary subdirectories that " "don't already exist, and returns a context object. This context object is " @@ -707,7 +698,7 @@ msgstr "" "class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內容將" "被清空,以及所有必要的子目錄將被重新建立。" -#: ../../library/venv.rst:371 +#: ../../library/venv.rst:387 msgid "" "The returned context object is a :class:`types.SimpleNamespace` with the " "following attributes:" @@ -715,7 +706,7 @@ msgstr "" "回傳的情境物件(context object)其型別會是 :class:`types.SimpleNamespace`,並" "包含以下屬性:" -#: ../../library/venv.rst:374 +#: ../../library/venv.rst:390 msgid "" "``env_dir`` - The location of the virtual environment. Used for " "``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." @@ -723,7 +714,7 @@ msgstr "" "``env_dir`` —— 虛擬環境的位置。用於啟用腳本中的 ``__VENV_DIR__``\\ (參見 :" "meth:`install_scripts`)。" -#: ../../library/venv.rst:377 +#: ../../library/venv.rst:393 msgid "" "``env_name`` - The name of the virtual environment. Used for " "``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." @@ -731,15 +722,15 @@ msgstr "" "``env_name`` —— 虛擬環境的名稱。用於啟用腳本中的 ``__VENV_NAME__``\\ (參見 :" "meth:`install_scripts`)。" -#: ../../library/venv.rst:380 +#: ../../library/venv.rst:396 msgid "" "``prompt`` - The prompt to be used by the activation scripts. Used for " "``__VENV_PROMPT__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -"``prompt`` —— 啟用腳本所使用的提示字元。用於啟用腳本中的 ``__VENV_PROMPT__``" -"\\ (參見 :meth:`install_scripts`)。" +"``prompt`` —— 啟用腳本所使用的提示字元。用於啟用腳本中的 " +"``__VENV_PROMPT__``\\ (參見 :meth:`install_scripts`)。" -#: ../../library/venv.rst:383 +#: ../../library/venv.rst:399 msgid "" "``executable`` - The underlying Python executable used by the virtual " "environment. This takes into account the case where a virtual environment is " @@ -748,19 +739,19 @@ msgstr "" "``executable`` —— 虛擬環境所使用的底層 Python 執行檔。在從其他虛擬環境建立虛" "擬環境的情況下,也會一併考慮該情境。" -#: ../../library/venv.rst:387 +#: ../../library/venv.rst:403 msgid "``inc_path`` - The include path for the virtual environment." msgstr "``inc_path`` —— 虛擬環境的 include 路徑。" -#: ../../library/venv.rst:389 +#: ../../library/venv.rst:405 msgid "``lib_path`` - The purelib path for the virtual environment." msgstr "``lib_path`` —— 虛擬環境的 purelib 路徑。" -#: ../../library/venv.rst:391 +#: ../../library/venv.rst:407 msgid "``bin_path`` - The script path for the virtual environment." msgstr "``bin_path`` —— 虛擬環境的腳本路徑。" -#: ../../library/venv.rst:393 +#: ../../library/venv.rst:409 msgid "" "``bin_name`` - The name of the script path relative to the virtual " "environment location. Used for ``__VENV_BIN_NAME__`` in activation scripts " @@ -769,7 +760,7 @@ msgstr "" "``bin_name`` —— 相對於虛擬環境位置的腳本路徑名稱。用於啟用腳本中的 " "``__VENV_BIN_NAME__``\\ (參見 :meth:`install_scripts`)。" -#: ../../library/venv.rst:397 +#: ../../library/venv.rst:413 msgid "" "``env_exe`` - The name of the Python interpreter in the virtual environment. " "Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" @@ -778,7 +769,7 @@ msgstr "" "``env_exe`` —— 虛擬環境中 Python 直譯器的名稱。用於啟用腳本中的 " "``__VENV_PYTHON__``\\ (參見 :meth:`install_scripts`)。" -#: ../../library/venv.rst:401 +#: ../../library/venv.rst:417 msgid "" "``env_exec_cmd`` - The name of the Python interpreter, taking into account " "filesystem redirections. This can be used to run Python in the virtual " @@ -787,7 +778,7 @@ msgstr "" "``env_exec_cmd`` —— Python 直譯器名稱,會將檔案系統重新導向後納入考慮。可用於" "在虛擬環境中執行 Python。" -#: ../../library/venv.rst:406 +#: ../../library/venv.rst:422 msgid "" "The *venv* :ref:`sysconfig installation scheme ` is used " "to construct the paths of the created directories." @@ -795,17 +786,17 @@ msgstr "" "*venv* 使用 :ref:`sysconfig 安裝配置方案 ` 來建構所建立目" "錄的路徑。" -#: ../../library/venv.rst:411 +#: ../../library/venv.rst:427 msgid "" "The attribute ``lib_path`` was added to the context, and the context object " "was documented." msgstr "``lib_path`` 屬性已新增至情境中,且情境物件已加入文件說明。" -#: ../../library/venv.rst:417 +#: ../../library/venv.rst:433 msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." msgstr "在環境中建立 ``pyvenv.cfg`` 設定檔。" -#: ../../library/venv.rst:421 +#: ../../library/venv.rst:437 msgid "" "Creates a copy or symlink to the Python executable in the environment. On " "POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " @@ -816,13 +807,13 @@ msgstr "" "``python3.x`` 執行檔,將建立指向該執行檔的 ``python`` 與 ``python3`` 符號連結" "(除非這些名稱的檔案已存在)。" -#: ../../library/venv.rst:428 +#: ../../library/venv.rst:444 msgid "" "Installs activation scripts appropriate to the platform into the virtual " "environment." msgstr "將符合平台的啟用腳本安裝到虛擬環境中。" -#: ../../library/venv.rst:433 +#: ../../library/venv.rst:449 msgid "" "Upgrades the core venv dependency packages (currently :pypi:`pip`) in the " "environment. This is done by shelling out to the ``pip`` executable in the " @@ -831,11 +822,11 @@ msgstr "" "更新虛擬環境中的核心 venv 相依套件(目前為 :pypi:`pip`)。此動作會透過執行虛" "擬環境中的 ``pip`` 執行檔來完成。" -#: ../../library/venv.rst:440 +#: ../../library/venv.rst:456 msgid ":pypi:`setuptools` is no longer a core venv dependency." msgstr ":pypi:`setuptools` 不再是核心 venv 的相依項目。" -#: ../../library/venv.rst:444 +#: ../../library/venv.rst:460 msgid "" "A placeholder method which can be overridden in third party implementations " "to pre-install packages in the virtual environment or perform other post-" @@ -844,7 +835,7 @@ msgstr "" "此佔位方法在虛擬環境中預先安裝套件,或執行其他建立後的動作,可由第三方實作覆" "寫。" -#: ../../library/venv.rst:450 +#: ../../library/venv.rst:466 msgid "" "This method can be called from :meth:`setup_scripts` or :meth:`post_setup` " "in subclasses to assist in installing custom scripts into the virtual " @@ -853,7 +844,7 @@ msgstr "" "此方法可由子類別中的 :meth:`setup_scripts` 或 :meth:`post_setup` 呼叫,協助將" "自訂腳本安裝到虛擬環境中。" -#: ../../library/venv.rst:454 +#: ../../library/venv.rst:470 msgid "" "*path* is the path to a directory that should contain subdirectories " "``common``, ``posix``, ``nt``; each containing scripts destined for the " @@ -865,19 +856,19 @@ msgstr "" "每個子目錄中都包含指向環境中 ``bin`` 目錄的腳本。在執行部分佔位符文字替換後," "將會複製 ``common`` 及與 :data:`os.name` 對應的目錄的內容:" -#: ../../library/venv.rst:460 +#: ../../library/venv.rst:476 msgid "" "``__VENV_DIR__`` is replaced with the absolute path of the environment " "directory." msgstr "``__VENV_DIR__`` 會被替換為環境目錄的絕對路徑。" -#: ../../library/venv.rst:463 +#: ../../library/venv.rst:479 msgid "" "``__VENV_NAME__`` is replaced with the environment name (final path segment " "of environment directory)." msgstr "``__VENV_NAME__`` 會被替換為環境的名稱(即該環境目錄路徑的最後一段)。" -#: ../../library/venv.rst:466 +#: ../../library/venv.rst:482 msgid "" "``__VENV_PROMPT__`` is replaced with the prompt (the environment name " "surrounded by parentheses and with a following space)" @@ -885,7 +876,7 @@ msgstr "" "``__VENV_PROMPT__`` 會被替換為提示字元(即以括號包裹的環境名稱,並附帶一個空" "格)。" -#: ../../library/venv.rst:469 +#: ../../library/venv.rst:485 msgid "" "``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " "``bin`` or ``Scripts``)." @@ -893,26 +884,26 @@ msgstr "" "``__VENV_BIN_NAME__`` 會被替換為 bin 目錄的名稱(可能是 ``bin`` 或 " "``Scripts``)。" -#: ../../library/venv.rst:472 +#: ../../library/venv.rst:488 msgid "" "``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " "executable." msgstr "``__VENV_PYTHON__`` 會被替換為環境中 Python 執行檔的絕對路徑。" -#: ../../library/venv.rst:475 +#: ../../library/venv.rst:491 msgid "" "The directories are allowed to exist (for when an existing environment is " "being upgraded)." msgstr "允許這些目錄存在(例如當更新既有環境時)。" -#: ../../library/venv.rst:480 +#: ../../library/venv.rst:496 msgid "" "Creates a ``.gitignore`` file within the virtual environment that causes the " "entire directory to be ignored by the Git source control manager." msgstr "" "在虛擬環境中建立一個 ``.gitignore`` 檔案,讓 Git 原始碼控管工具忽略整個目錄。" -#: ../../library/venv.rst:485 +#: ../../library/venv.rst:501 msgid "" "Windows now uses redirector scripts for ``python[w].exe`` instead of copying " "the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " @@ -922,7 +913,7 @@ msgstr "" "檔。在 3.7.2 中,只有當從原始碼樹中建構時,:meth:`setup_python` 才會執行操" "作。" -#: ../../library/venv.rst:490 +#: ../../library/venv.rst:506 msgid "" "Windows copies the redirector scripts as part of :meth:`setup_python` " "instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " @@ -932,11 +923,11 @@ msgstr "" "`setup_scripts` 中進行。這在 3.7.2 中並非如此。若使用符號連結,則會連結至原始" "的可執行檔。" -#: ../../library/venv.rst:495 +#: ../../library/venv.rst:511 msgid "There is also a module-level convenience function:" msgstr "也有一個方便的模組層級的函式:" -#: ../../library/venv.rst:501 +#: ../../library/venv.rst:517 msgid "" "Create an :class:`EnvBuilder` with the given keyword arguments, and call " "its :meth:`~EnvBuilder.create` method with the *env_dir* argument." @@ -944,27 +935,27 @@ msgstr "" "使用提供的關鍵字引數建立一個 :class:`EnvBuilder`,並以 *env_dir* 作為引數呼叫" "其 :meth:`~EnvBuilder.create` 方法。" -#: ../../library/venv.rst:506 +#: ../../library/venv.rst:522 msgid "Added the *with_pip* parameter" msgstr "新增 *with_pip* 參數" -#: ../../library/venv.rst:509 +#: ../../library/venv.rst:525 msgid "Added the *prompt* parameter" msgstr "新增 *prompt* 參數" -#: ../../library/venv.rst:512 +#: ../../library/venv.rst:528 msgid "Added the *upgrade_deps* parameter" msgstr "新增 *upgrade_deps* 參數" -#: ../../library/venv.rst:515 +#: ../../library/venv.rst:531 msgid "Added the *scm_ignore_files* parameter" msgstr "新增 *scm_ignore_files* 參數" -#: ../../library/venv.rst:519 +#: ../../library/venv.rst:535 msgid "An example of extending ``EnvBuilder``" msgstr "一個擴展 ``EnvBuilder`` 的範例" -#: ../../library/venv.rst:521 +#: ../../library/venv.rst:537 msgid "" "The following script shows how to extend :class:`EnvBuilder` by implementing " "a subclass which installs setuptools and pip into a created virtual " @@ -973,7 +964,7 @@ msgstr "" "以下的腳本展示了如何透過實作子類別來擴充 :class:`EnvBuilder`,並在建立的虛擬" "環境中安裝 setuptools 與 pip: ::" -#: ../../library/venv.rst:524 +#: ../../library/venv.rst:540 msgid "" "import os\n" "import os.path\n" @@ -1392,7 +1383,7 @@ msgstr "" " print('Error: %s' % e, file=sys.stderr)\n" " sys.exit(rc)" -#: ../../library/venv.rst:732 +#: ../../library/venv.rst:748 msgid "" "This script is also available for download `online `_." @@ -1406,3 +1397,90 @@ msgstr "Environments (環境)" #: ../../library/venv.rst:14 msgid "virtual" msgstr "virtual (虛擬)" + +#~ msgid "" +#~ "usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--" +#~ "clear]\n" +#~ " [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-" +#~ "deps]\n" +#~ " [--without-scm-ignore-files]\n" +#~ " ENV_DIR [ENV_DIR ...]\n" +#~ "\n" +#~ "Creates virtual Python environments in one or more target directories.\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " ENV_DIR A directory to create the environment in.\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --system-site-packages\n" +#~ " Give the virtual environment access to the " +#~ "system\n" +#~ " site-packages dir.\n" +#~ " --symlinks Try to use symlinks rather than copies, when\n" +#~ " symlinks are not the default for the platform.\n" +#~ " --copies Try to use copies rather than symlinks, even " +#~ "when\n" +#~ " symlinks are the default for the platform.\n" +#~ " --clear Delete the contents of the environment directory\n" +#~ " if it already exists, before environment " +#~ "creation.\n" +#~ " --upgrade Upgrade the environment directory to use this\n" +#~ " version of Python, assuming Python has been\n" +#~ " upgraded in-place.\n" +#~ " --without-pip Skips installing or upgrading pip in the virtual\n" +#~ " environment (pip is bootstrapped by default)\n" +#~ " --prompt PROMPT Provides an alternative prompt prefix for this\n" +#~ " environment.\n" +#~ " --upgrade-deps Upgrade core dependencies (pip) to the latest\n" +#~ " version in PyPI\n" +#~ " --without-scm-ignore-files\n" +#~ " Skips adding SCM ignore files to the environment\n" +#~ " directory (Git is supported by default).\n" +#~ "\n" +#~ "Once an environment has been created, you may wish to activate it, e.g. " +#~ "by\n" +#~ "sourcing an activate script in its bin directory." +#~ msgstr "" +#~ "usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--" +#~ "clear]\n" +#~ " [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-" +#~ "deps]\n" +#~ " [--without-scm-ignore-files]\n" +#~ " ENV_DIR [ENV_DIR ...]\n" +#~ "\n" +#~ "Creates virtual Python environments in one or more target directories.\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " ENV_DIR A directory to create the environment in.\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --system-site-packages\n" +#~ " Give the virtual environment access to the " +#~ "system\n" +#~ " site-packages dir.\n" +#~ " --symlinks Try to use symlinks rather than copies, when\n" +#~ " symlinks are not the default for the platform.\n" +#~ " --copies Try to use copies rather than symlinks, even " +#~ "when\n" +#~ " symlinks are the default for the platform.\n" +#~ " --clear Delete the contents of the environment directory\n" +#~ " if it already exists, before environment " +#~ "creation.\n" +#~ " --upgrade Upgrade the environment directory to use this\n" +#~ " version of Python, assuming Python has been\n" +#~ " upgraded in-place.\n" +#~ " --without-pip Skips installing or upgrading pip in the virtual\n" +#~ " environment (pip is bootstrapped by default)\n" +#~ " --prompt PROMPT Provides an alternative prompt prefix for this\n" +#~ " environment.\n" +#~ " --upgrade-deps Upgrade core dependencies (pip) to the latest\n" +#~ " version in PyPI\n" +#~ " --without-scm-ignore-files\n" +#~ " Skips adding SCM ignore files to the environment\n" +#~ " directory (Git is supported by default).\n" +#~ "\n" +#~ "Once an environment has been created, you may wish to activate it, e.g. " +#~ "by\n" +#~ "sourcing an activate script in its bin directory." diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 8e84e172e9..6d004c8a49 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -3949,7 +3949,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:2761 msgid "New ``make regen-all`` build target" -msgstr "" +msgstr "新增 ``make regen-all`` 建置目標" #: ../../whatsnew/2.7.rst:2763 msgid "" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index f79b665bae..354052c2b3 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -4624,7 +4624,7 @@ msgstr "" #: ../../whatsnew/3.10.rst:2351 msgid "Notable changes in 3.10.12" -msgstr "" +msgstr "Python 3.10.12 中顯著的變更" #: ../../whatsnew/3.10.rst:2354 msgid "tarfile" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 270fd31027..1df4dc841a 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # Translators: # Matt Wang , 2022-2023 @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-07-09 00:17+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,8 +33,8 @@ msgstr "Pablo Galindo Salgado" #: ../../whatsnew/3.11.rst:47 msgid "" "This article explains the new features in Python 3.11, compared to 3.10. " -"Python 3.11 was released on October 24, 2022. For full details, see " -"the :ref:`changelog `." +"Python 3.11 was released on October 24, 2022. For full details, see the :ref:" +"`changelog `." msgstr "" "此文章解釋了 Python 3.11 和 3.10 相比多了哪些新功能。Python 3.11 於 2022 年 " "10 月 24 日發布。完整細節請見 :ref:`changelog`。" @@ -46,8 +46,8 @@ msgstr "發布重點摘要" #: ../../whatsnew/3.11.rst:60 msgid "" "Python 3.11 is between 10-60% faster than Python 3.10. On average, we " -"measured a 1.25x speedup on the standard benchmark suite. " -"See :ref:`whatsnew311-faster-cpython` for details." +"measured a 1.25x speedup on the standard benchmark suite. See :ref:" +"`whatsnew311-faster-cpython` for details." msgstr "" "Python 3.11 比 Python 3.10 快了 10-60%。我們使用了標準基準量測套裝軟體 " "(benchmark suite) 測得平均加速了 1.25x。細節請見\\ :ref:`whatsnew311-faster-" @@ -244,13 +244,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:159 msgid "" "Additionally, the information used by the enhanced traceback feature is made " -"available via a general API, that can be used to " -"correlate :term:`bytecode` :ref:`instructions ` with source code " -"location. This information can be retrieved using:" +"available via a general API, that can be used to correlate :term:`bytecode` :" +"ref:`instructions ` with source code location. This information " +"can be retrieved using:" msgstr "" -"此外,強化回溯特性所使用的資訊可以透過一般的 API 來取得,以用來" -"使 :term:`bytecode` :ref:`指示 (instruction) `\\ 與原始碼位置相互" -"關聯。此項資訊可以用以下方式取得:" +"此外,強化回溯特性所使用的資訊可以透過一般的 API 來取得,以用來使 :term:" +"`bytecode` :ref:`指示 (instruction) `\\ 與原始碼位置相互關聯。此項" +"資訊可以用以下方式取得:" #: ../../whatsnew/3.11.rst:164 msgid "The :meth:`codeobject.co_positions` method in Python." @@ -265,8 +265,8 @@ msgid "" "See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan " "Taskaya and Ammar Askar in :issue:`43950`.)" msgstr "" -"詳情請見 :pep:`657`。(由 Pablo Galindo、Batuhan Taskaya 與 Ammar Askar " -"於 :issue:`43950` 中所貢獻。)" +"詳情請見 :pep:`657`。(由 Pablo Galindo、Batuhan Taskaya 與 Ammar Askar 於 :" +"issue:`43950` 中所貢獻。)" #: ../../whatsnew/3.11.rst:171 msgid "" @@ -274,8 +274,8 @@ msgid "" "may result in a small increase in interpreter memory usage and disk usage " "for compiled Python files. To avoid storing the extra information and " "deactivate printing the extra traceback information, use the :option:`-X " -"no_debug_ranges <-X>` command line option or " -"the :envvar:`PYTHONNODEBUGRANGES` environment variable." +"no_debug_ranges <-X>` command line option or the :envvar:" +"`PYTHONNODEBUGRANGES` environment variable." msgstr "" "這個特性必須要將欄的位置 (column position) 儲存於 :ref:`codeobjects`,這可能" "會導致直譯器用於編譯 Python 檔案的記憶體使用量與硬碟使用量增加。為了避免儲存" @@ -289,16 +289,16 @@ msgstr "PEP 654:例外群組與 ``except*``" #: ../../whatsnew/3.11.rst:185 msgid "" ":pep:`654` introduces language features that enable a program to raise and " -"handle multiple unrelated exceptions simultaneously. The builtin " -"types :exc:`ExceptionGroup` and :exc:`BaseExceptionGroup` make it possible " -"to group exceptions and raise them together, and the new :keyword:`except* " +"handle multiple unrelated exceptions simultaneously. The builtin types :exc:" +"`ExceptionGroup` and :exc:`BaseExceptionGroup` make it possible to group " +"exceptions and raise them together, and the new :keyword:`except* " "` syntax generalizes :keyword:`except` to match subgroups of " "exception groups." msgstr "" ":pep:`654` 引入了新的的語言特性,可讓程式同時引發並處理多個相互無關的例外。內" "建型別 :exc:`ExceptionGroup` 和 :exc:`BaseExceptionGroup` 使得程式可為多個例" -"外組成群組並同時引發,新的 :keyword:`except* ` 語法也" -"將 :keyword:`except` 泛用化、能夠比對例外群組的子群組。" +"外組成群組並同時引發,新的 :keyword:`except* ` 語法也將 :" +"keyword:`except` 泛用化、能夠比對例外群組的子群組。" #: ../../whatsnew/3.11.rst:192 msgid "See :pep:`654` for more details." @@ -346,33 +346,33 @@ msgstr "Windows ``py.exe`` 啟動程式 (launcher) 的改進" #: ../../whatsnew/3.11.rst:219 msgid "" "The copy of the :ref:`launcher` included with Python 3.11 has been " -"significantly updated. It now supports company/tag syntax as defined " -"in :pep:`514` using the :samp:`-V:{}/{}` argument instead of " -"the limited :samp:`-{}.{}`. This allows launching " -"distributions other than ``PythonCore``, the one hosted on `python.org " -"`_." +"significantly updated. It now supports company/tag syntax as defined in :pep:" +"`514` using the :samp:`-V:{}/{}` argument instead of the " +"limited :samp:`-{}.{}`. This allows launching distributions " +"other than ``PythonCore``, the one hosted on `python.org `_." msgstr "" -"Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支" -"援 :pep:`514` 所定義的公司/標籤 (tag) 語法,可用 :samp:`-V:{}/" -"{}` 引數來取代受限的 :samp:`-{}.{}`。這允許了 `python.org " -"`_ 上的 ``PythonCore`` 以外的發行版本發布。" +"Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支援 :pep:" +"`514` 所定義的公司/標籤 (tag) 語法,可用 :samp:`-V:{}/{}` 引數" +"來取代受限的 :samp:`-{}.{}`。這允許了 `python.org `_ 上的 ``PythonCore`` 以外的發行版本發布。" #: ../../whatsnew/3.11.rst:225 msgid "" "When using ``-V:`` selectors, either company or tag can be omitted, but all " "installs will be searched. For example, ``-V:OtherPython/`` will select the " -"\"best\" tag registered for ``OtherPython``, while ``-V:3.11`` or ``-V:/" -"3.11`` will select the \"best\" distribution with tag ``3.11``." +"\"best\" tag registered for ``OtherPython``, while ``-V:3.11`` or ``-" +"V:/3.11`` will select the \"best\" distribution with tag ``3.11``." msgstr "" -"使用 ``-V:`` 選擇器時,可以省略公司或標籤,但會搜尋所有安裝。例如,``-" -"V:OtherPython/`` 將選擇 ``OtherPython`` 註冊的「最佳」標籤,而 ``-V:3.11`` " -"或 ``-V:/3.11`` 將選擇帶有 ``3.11`` 標籤的「最佳」發行版。" +"使用 ``-V:`` 選擇器時,可以省略公司或標籤,但會搜尋所有安裝。例如,``-V:" +"OtherPython/`` 將選擇 ``OtherPython`` 註冊的「最佳」標籤,而 ``-V:3.11`` 或 " +"``-V:/3.11`` 將選擇帶有 ``3.11`` 標籤的「最佳」發行版。" #: ../../whatsnew/3.11.rst:230 msgid "" -"When using the legacy :samp:`-{}`, :samp:`-{}.{}" -"`, :samp:`-{}-{}` or :samp:`-{}.{}-{}" -"` arguments, all existing behaviour should be preserved from past versions, " +"When using the legacy :samp:`-{}`, :samp:`-{}.{}`, :" +"samp:`-{}-{}` or :samp:`-{}.{}-{}` " +"arguments, all existing behaviour should be preserved from past versions, " "and only releases from ``PythonCore`` will be selected. However, the ``-64`` " "suffix now implies \"not 32-bit\" (not necessarily x86-64), as there are " "multiple supported 64-bit platforms. 32-bit runtimes are detected by " @@ -393,8 +393,8 @@ msgstr "型別提示相關的新特性" #: ../../whatsnew/3.11.rst:246 msgid "" -"This section covers major changes affecting :pep:`484` type hints and " -"the :mod:`typing` module." +"This section covers major changes affecting :pep:`484` type hints and the :" +"mod:`typing` module." msgstr "" "這個部分涵蓋影響 :pep:`484` 型別提示 (type hints) 與 :mod:`typing` 模組的重大" "變更。" @@ -406,10 +406,10 @@ msgstr "PEP 646:可變參數泛型 (variadic generics)" #: ../../whatsnew/3.11.rst:255 msgid "" ":pep:`484` previously introduced :data:`~typing.TypeVar`, enabling creation " -"of generics parameterised with a single type. :pep:`646` " -"adds :data:`~typing.TypeVarTuple`, enabling parameterisation with an " -"*arbitrary* number of types. In other words, a :data:`~typing.TypeVarTuple` " -"is a *variadic* type variable, enabling *variadic* generics." +"of generics parameterised with a single type. :pep:`646` adds :data:`~typing." +"TypeVarTuple`, enabling parameterisation with an *arbitrary* number of " +"types. In other words, a :data:`~typing.TypeVarTuple` is a *variadic* type " +"variable, enabling *variadic* generics." msgstr "" ":pep:`484` 先前引入了 :data:`~typing.TypeVar`,開啟了帶有單一型別的泛型參數" "化。:pep:`646` 新增 :data:`~typing.TypeVarTuple`,開啟了帶有\\ *任意*\\ 數量" @@ -450,9 +450,9 @@ msgstr "PEP 655:標記獨立 ``TypedDict`` 項目為必要或不必要" #: ../../whatsnew/3.11.rst:280 msgid "" ":data:`~typing.Required` and :data:`~typing.NotRequired` provide a " -"straightforward way to mark whether individual items in " -"a :class:`~typing.TypedDict` must be present. Previously, this was only " -"possible using inheritance." +"straightforward way to mark whether individual items in a :class:`~typing." +"TypedDict` must be present. Previously, this was only possible using " +"inheritance." msgstr "" ":data:`~typing.Required` 與 :data:`~typing.NotRequired` 提供了標記一個獨立項" "目在 :class:`~typing.TypedDict` 中是否必須存在的直覺方法。在這之前,這只有透" @@ -524,9 +524,9 @@ msgstr "" #: ../../whatsnew/3.11.rst:322 msgid "" -"Common use cases include alternative constructors provided " -"as :func:`classmethod `\\s, and :meth:`~object.__enter__` " -"methods that return ``self``::" +"Common use cases include alternative constructors provided as :func:" +"`classmethod `\\s, and :meth:`~object.__enter__` methods that " +"return ``self``::" msgstr "" "常見用例包括作為 :func:`classmethod ` 的替代建構函式和會回傳 " "``self`` 的 :meth:`~object.__enter__` 方法: ::" @@ -622,6 +622,21 @@ msgid "" " f\"SELECT * FROM students WHERE name = {arbitrary_string}\"\n" " )" msgstr "" +"def run_query(sql: LiteralString) -> ...\n" +" ...\n" +"\n" +"def caller(\n" +" arbitrary_string: str,\n" +" query_string: LiteralString,\n" +" table_name: LiteralString,\n" +") -> None:\n" +" run_query(\"SELECT * FROM students\") # ok\n" +" run_query(query_string) # ok\n" +" run_query(\"SELECT * FROM \" + table_name) # ok\n" +" run_query(arbitrary_string) # 型別檢查器錯誤\n" +" run_query( # 型別檢查器錯誤\n" +" f\"SELECT * FROM students WHERE name = {arbitrary_string}\"\n" +" )" #: ../../whatsnew/3.11.rst:380 msgid "See :pep:`675` for more details." @@ -644,8 +659,8 @@ msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " "``@dataclass_transform()`` tells a static type checker that the decorated " -"object performs runtime \"magic\" that transforms a class, giving " -"it :func:`dataclass `-like behaviors." +"object performs runtime \"magic\" that transforms a class, giving it :func:" +"`dataclass `-like behaviors." msgstr "" ":data:`~typing.dataclass_transform` 可以用來裝飾一個類別、元類別 " "(metaclass)、或是一個本身就是裝飾器的函式。``@dataclass_transform()`` 的存在" @@ -674,6 +689,21 @@ msgid "" "\n" "c = CustomerModel(id=327, name=\"Eric Idle\")" msgstr "" +"# create_model 裝飾器是由一個函式庫定義。\n" +"@typing.dataclass_transform()\n" +"def create_model(cls: Type[T]) -> Type[T]:\n" +" cls.__init__ = ...\n" +" cls.__eq__ = ...\n" +" cls.__ne__ = ...\n" +" return cls\n" +"\n" +"# create_model 裝飾器現在可以被用來建立新的模型類別:\n" +"@create_model\n" +"class CustomerModel:\n" +" id: int\n" +" name: str\n" +"\n" +"c = CustomerModel(id=327, name=\"Eric Idle\")" #: ../../whatsnew/3.11.rst:415 msgid "See :pep:`681` for more details." @@ -732,51 +762,51 @@ msgstr "" #: ../../whatsnew/3.11.rst:447 msgid "" -"A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` " -"in :keyword:`with` statements and :meth:`contextlib.ExitStack.enter_context` " -"for objects that do not support the :term:`context manager` protocol, and " -"in :keyword:`async with` statements " -"and :meth:`contextlib.AsyncExitStack.enter_async_context` for objects not " -"supporting the :term:`asynchronous context manager` protocol. (Contributed " -"by Serhiy Storchaka in :issue:`12022` and :issue:`44471`.)" +"A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` in :" +"keyword:`with` statements and :meth:`contextlib.ExitStack.enter_context` for " +"objects that do not support the :term:`context manager` protocol, and in :" +"keyword:`async with` statements and :meth:`contextlib.AsyncExitStack." +"enter_async_context` for objects not supporting the :term:`asynchronous " +"context manager` protocol. (Contributed by Serhiy Storchaka in :issue:" +"`12022` and :issue:`44471`.)" msgstr "" "現在在不支援 :term:`context manager` 協定的物件上使用 :keyword:`with` 陳述式" "和 :meth:`contextlib.ExitStack.enter_context` 或在不支援 :term:`asynchronous " -"context manager` 協定的物件上使用 :keyword:`async with` 陳述式" -"和 :meth:`contextlib.AsyncExitStack.enter_async_context`,會引" -"發 :exc:`TypeError` 而不是 :exc:`AttributeError`。(由 Serhiy Storchaka " -"在 :issue:`12022` 和 :issue:`44471` 中貢獻。)" +"context manager` 協定的物件上使用 :keyword:`async with` 陳述式和 :meth:" +"`contextlib.AsyncExitStack.enter_async_context`,會引發 :exc:`TypeError` 而不" +"是 :exc:`AttributeError`。(由 Serhiy Storchaka 在 :issue:`12022` 和 :issue:" +"`44471` 中貢獻。)" #: ../../whatsnew/3.11.rst:455 msgid "" "Added :meth:`object.__getstate__`, which provides the default implementation " "of the :meth:`!__getstate__` method. :mod:`copy`\\ing and :mod:`pickle`\\ing " -"instances of subclasses of builtin " -"types :class:`bytearray`, :class:`set`, :class:`frozenset`, :class:`collections.OrderedDict`, :class:`collections.deque`, :class:`weakref.WeakSet`, " -"and :class:`datetime.tzinfo` now copies and pickles instance attributes " -"implemented as :term:`slots <__slots__>`. This change has an unintended side " -"effect: It trips up a small minority of existing Python projects not " -"expecting :meth:`object.__getstate__` to exist. See the later comments " -"on :gh:`70766` for discussions of what workarounds such code may need. " -"(Contributed by Serhiy Storchaka in :issue:`26579`.)" +"instances of subclasses of builtin types :class:`bytearray`, :class:`set`, :" +"class:`frozenset`, :class:`collections.OrderedDict`, :class:`collections." +"deque`, :class:`weakref.WeakSet`, and :class:`datetime.tzinfo` now copies " +"and pickles instance attributes implemented as :term:`slots <__slots__>`. " +"This change has an unintended side effect: It trips up a small minority of " +"existing Python projects not expecting :meth:`object.__getstate__` to exist. " +"See the later comments on :gh:`70766` for discussions of what workarounds " +"such code may need. (Contributed by Serhiy Storchaka in :issue:`26579`.)" msgstr "" #: ../../whatsnew/3.11.rst:470 msgid "" "Added a :option:`-P` command line option and a :envvar:`PYTHONSAFEPATH` " -"environment variable, which disable the automatic prepending " -"to :data:`sys.path` of the script's directory when running a script, or the " -"current directory when using :option:`-c` and :option:`-m`. This ensures " -"only stdlib and installed modules are picked up by :keyword:`import`, and " -"avoids unintentionally or maliciously shadowing modules with those in a " -"local (and typically user-writable) directory. (Contributed by Victor " -"Stinner in :gh:`57684`.)" +"environment variable, which disable the automatic prepending to :data:`sys." +"path` of the script's directory when running a script, or the current " +"directory when using :option:`-c` and :option:`-m`. This ensures only stdlib " +"and installed modules are picked up by :keyword:`import`, and avoids " +"unintentionally or maliciously shadowing modules with those in a local (and " +"typically user-writable) directory. (Contributed by Victor Stinner in :gh:" +"`57684`.)" msgstr "" "新增了一個 :option:`-P` 命令列選項和一個 :envvar:`PYTHONSAFEPATH` 環境變數," "它們禁用了當使用 :option:`-c` 和 :option:`-m` 以在運行腳本或目前目錄時自動添" -"加到腳本目錄的 :data:`sys.path`。這確保只有 stdlib 和已安裝的模組會" -"被 :keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可" -"寫入的)目錄中的模組重疊。(由 Victor Stinner 在 :gh:`57684` 中貢獻。)" +"加到腳本目錄的 :data:`sys.path`。這確保只有 stdlib 和已安裝的模組會被 :" +"keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可寫入" +"的)目錄中的模組重疊。(由 Victor Stinner 在 :gh:`57684` 中貢獻。)" #: ../../whatsnew/3.11.rst:481 msgid "" @@ -797,10 +827,10 @@ msgid "" "Thomas Grainger in :gh:`91181`.)" msgstr "" ":data:`sys.path` 不再接受位元組。支援已在 Python 3.2 和 3.6 之間的某個時間停" -"止,直到 Python 3.10.0 發布後才引起人們的注意。此外,由於混合使" -"用 :class:`str` 和 :class:`bytes` 鍵時 :option:`-b` " -"和 :data:`sys.path_importer_cache` 會出現的交互作用,恢復這項支援會出現問題。" -"(由 Thomas Grainger 在 :gh:`91181` 中貢獻。)" +"止,直到 Python 3.10.0 發布後才引起人們的注意。此外,由於混合使用 :class:" +"`str` 和 :class:`bytes` 鍵時 :option:`-b` 和 :data:`sys.path_importer_cache` " +"會出現的交互作用,恢復這項支援會出現問題。(由 Thomas Grainger 在 :gh:" +"`91181` 中貢獻。)" #: ../../whatsnew/3.11.rst:497 msgid "Other CPython Implementation Changes" @@ -808,15 +838,15 @@ msgstr "其他 CPython 實作更動" #: ../../whatsnew/3.11.rst:499 msgid "" -"The special methods :meth:`~object.__complex__` for :class:`complex` " -"and :meth:`~object.__bytes__` for :class:`bytes` are implemented to support " -"the :class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` " -"protocols. (Contributed by Mark Dickinson and Donghee Na in :issue:`24234`.)" +"The special methods :meth:`~object.__complex__` for :class:`complex` and :" +"meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :" +"class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` protocols. " +"(Contributed by Mark Dickinson and Donghee Na in :issue:`24234`.)" msgstr "" "為支援 :class:`typing.SupportsComplex` 與 :class:`typing.SupportsBytes` 協" -"定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方" -"法 :meth:`~object.__complex__` 與 :meth:`~object.__bytes__`。(由 Mark " -"Dickinson 和 Donghee Na 於 :issue:`24234` 中所貢獻。)" +"定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方法 :meth:`~object." +"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Donghee Na " +"於 :issue:`24234` 中所貢獻。)" #: ../../whatsnew/3.11.rst:504 msgid "" @@ -830,16 +860,16 @@ msgstr "" "新增 ``siphash13`` 以作為內部的雜湊演算法,它有與 ``siphash24`` 相似的安全特" "性,但是在處理較長的輸入時會更快一些。現在是 :class:`str`、:class:`bytes` 和" "一些其他型別的 :func:`hash` 預設演算法。:pep:`552` :ref:`基於雜湊的 .pyc 檔" -"案 ` 現在也使用 ``siphash13``。(由 Inada Naoki " -"於 :issue:`29410` 中貢獻。)" +"案 ` 現在也使用 ``siphash13``。(由 Inada Naoki 於 :issue:" +"`29410` 中貢獻。)" #: ../../whatsnew/3.11.rst:513 msgid "" "When an active exception is re-raised by a :keyword:`raise` statement with " -"no parameters, the traceback attached to this exception is now always " -"``sys.exc_info()[1].__traceback__``. This means that changes made to the " -"traceback in the current :keyword:`except` clause are reflected in the re-" -"raised exception. (Contributed by Irit Katriel in :issue:`45711`.)" +"no parameters, the traceback attached to this exception is now always ``sys." +"exc_info()[1].__traceback__``. This means that changes made to the traceback " +"in the current :keyword:`except` clause are reflected in the re-raised " +"exception. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" "當一個仍有效的例外被 :keyword:`raise` 陳述式在沒有參數的情況下重新引發,被附" "於該例外的追蹤資訊現在都會是 ``sys.exc_info()[1].__traceback__``。這代表對於" @@ -876,10 +906,9 @@ msgid "" "initialize :data:`sys.path`. Otherwise, initialization will recalculate the " "path and replace any values added to ``module_search_paths``." msgstr "" -"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始" -"化 :data:`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須" -"被設為 1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` " -"的值。" +"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始化 :data:" +"`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " +"1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" #: ../../whatsnew/3.11.rst:536 msgid "" @@ -890,9 +919,9 @@ msgid "" "help-all`. (Contributed by Éric Araujo in :issue:`46142`.)" msgstr "" ":option:`--help` 選項的輸出現在會在 50 列、80 欄的大小之內,:ref:`Python 環境" -"變數 `\\ 和 :option:`-X` 選項的資訊現在能夠分別透" -"過 :option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-" -"all` 一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)" +"變數 `\\ 和 :option:`-X` 選項的資訊現在能夠分別透過 :" +"option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-all` " +"一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)" #: ../../whatsnew/3.11.rst:543 msgid "" @@ -908,11 +937,11 @@ msgid "" msgstr "" "在除 2(binary、二進制)、4、8(octal、八進制)、16(hexadecimal、十六進制)" "或 32 以外的基數中,例如以 10(decimal、十進制)為基數,進行 :class:`int` " -"和 :class:`str` 之間的轉換且字串形式的位數超過限制,現在會引" -"發 :exc:`ValueError`,以避免由於演算法複雜性而導致的潛在阻斷服務攻擊 (denial " -"of service attacks)。這是針對 :cve:`2020-10735` 的緩解措施,可以透過環境變" -"數、命令列旗標或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉" -"換長度限制 ` 文件。預設限制為字串形式的 4300 位數字。" +"和 :class:`str` 之間的轉換且字串形式的位數超過限制,現在會引發 :exc:" +"`ValueError`,以避免由於演算法複雜性而導致的潛在阻斷服務攻擊 (denial of " +"service attacks)。這是針對 :cve:`2020-10735` 的緩解措施,可以透過環境變數、命" +"令列旗標或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉換長度" +"限制 ` 文件。預設限制為字串形式的 4300 位數字。" #: ../../whatsnew/3.11.rst:557 msgid "New Modules" @@ -946,9 +975,9 @@ msgstr "asyncio" msgid "" "Added the :class:`~asyncio.TaskGroup` class, an :ref:`asynchronous context " "manager ` holding a group of tasks that will wait " -"for all of them upon exit. For new code this is recommended over " -"using :func:`~asyncio.create_task` and :func:`~asyncio.gather` directly. " -"(Contributed by Yury Selivanov and others in :gh:`90908`.)" +"for all of them upon exit. For new code this is recommended over using :func:" +"`~asyncio.create_task` and :func:`~asyncio.gather` directly. (Contributed by " +"Yury Selivanov and others in :gh:`90908`.)" msgstr "" "添加了 :class:`~asyncio.TaskGroup` 類別,為一個會持有任務群組並在退出時等待全" "部完成的\\ :ref:`非同步情境管理器 (asynchronous context manager) ` (the default " -"for :func:`format`, :meth:`str.format` and :term:`f-string`\\s) to always " -"produce the same result as :meth:`Enum.__str__() `: for " -"enums inheriting from :class:`~enum.ReprEnum` it will be the member's value; " -"for all other enums it will be the enum and member name (e.g. ``Color.RED``)." +"Changed :meth:`Enum.__format__() ` (the default for :" +"func:`format`, :meth:`str.format` and :term:`f-string`\\s) to always produce " +"the same result as :meth:`Enum.__str__() `: for enums " +"inheriting from :class:`~enum.ReprEnum` it will be the member's value; for " +"all other enums it will be the enum and member name (e.g. ``Color.RED``)." msgstr "" -"改變了 :meth:`Enum.__format__() ` " -"(被 :func:`format`、:meth:`str.format` 和 :term:`f-string` 預設使用),以使" -"其與 :meth:`enum.Enum.__str__ ` 產生相同結果:對於繼承" -"自 :class:`~enum.ReprEnum` 的列舉,這會是成員之值;而其他的列舉會是列舉與成員" -"名稱(例如 ``Color.RED``)。" +"改變了 :meth:`Enum.__format__() ` (被 :func:" +"`format`、:meth:`str.format` 和 :term:`f-string` 預設使用),以使其與 :meth:" +"`enum.Enum.__str__ ` 產生相同結果:對於繼承自 :class:" +"`~enum.ReprEnum` 的列舉,這會是成員之值;而其他的列舉會是列舉與成員名稱(例" +"如 ``Color.RED``)。" #: ../../whatsnew/3.11.rst:678 msgid "" -"Added a new *boundary* class parameter to :class:`~enum.Flag` enums and " -"the :class:`~enum.FlagBoundary` enum with its options, to control how to " -"handle out-of-range flag values." +"Added a new *boundary* class parameter to :class:`~enum.Flag` enums and the :" +"class:`~enum.FlagBoundary` enum with its options, to control how to handle " +"out-of-range flag values." msgstr "" -"新增 *boundary* 類別參數與其選項到 :class:`~enum.Flag` 列舉" -"和 :class:`~enum.FlagBoundary` 列舉以控制處理超出範圍旗標數值的方法。" +"新增 *boundary* 類別參數與其選項到 :class:`~enum.Flag` 列舉和 :class:`~enum." +"FlagBoundary` 列舉以控制處理超出範圍旗標數值的方法。" #: ../../whatsnew/3.11.rst:682 msgid "" -"Added the :func:`~enum.verify` enum decorator and " -"the :class:`~enum.EnumCheck` enum with its options, to check enum classes " -"against several specific constraints." +"Added the :func:`~enum.verify` enum decorator and the :class:`~enum." +"EnumCheck` enum with its options, to check enum classes against several " +"specific constraints." msgstr "" "新增了 :func:`~enum.verify` 列舉裝飾器和 :class:`~enum.EnumCheck` 列舉及其選" "項,以根據幾個特定限制檢查列舉類別。" @@ -1156,35 +1181,34 @@ msgstr "" #: ../../whatsnew/3.11.rst:689 msgid "" -"Added the :func:`~enum.property` decorator, which works " -"like :func:`property` except for enums. Use this instead " -"of :func:`types.DynamicClassAttribute`." +"Added the :func:`~enum.property` decorator, which works like :func:" +"`property` except for enums. Use this instead of :func:`types." +"DynamicClassAttribute`." msgstr "" "新增 :func:`~enum.property` 裝飾器,它的作用類似 :func:`property` 但是是用於" "列舉,用以替代 :func:`types.DynamicClassAttribute`。" #: ../../whatsnew/3.11.rst:693 msgid "" -"Added the :func:`~enum.global_enum` enum decorator, which " -"adjusts :meth:`~object.__repr__` and :meth:`~object.__str__` to show values " -"as members of their module rather than the enum class. For example, " -"``'re.ASCII'`` for the :const:`~re.ASCII` member of :class:`re.RegexFlag` " -"rather than ``'RegexFlag.ASCII'``." +"Added the :func:`~enum.global_enum` enum decorator, which adjusts :meth:" +"`~object.__repr__` and :meth:`~object.__str__` to show values as members of " +"their module rather than the enum class. For example, ``'re.ASCII'`` for " +"the :const:`~re.ASCII` member of :class:`re.RegexFlag` rather than " +"``'RegexFlag.ASCII'``." msgstr "" "新增 :func:`~enum.global_enum` 列舉裝飾器,用來調整 :meth:`~object.__repr__` " -"和 :meth:`~object.__str__` 以模組成員形式而非列舉類別來顯示值。例" -"如,:class:`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 " +"和 :meth:`~object.__str__` 以模組成員形式而非列舉類別來顯示值。例如,:class:" +"`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 " "``'RegexFlag.ASCII'``。" #: ../../whatsnew/3.11.rst:699 msgid "" -"Enhanced :class:`~enum.Flag` to support :func:`len`, iteration " -"and :keyword:`in`/:keyword:`not in` on its members. For example, the " -"following now works: ``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, " -"AFlag.TWO)``" +"Enhanced :class:`~enum.Flag` to support :func:`len`, iteration and :keyword:" +"`in`/:keyword:`not in` on its members. For example, the following now works: " +"``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" msgstr "" -"強化 :class:`~enum.Flag` 以支援使用 :func:`len`、疊代 (iteration) " -"和 :keyword:`in`/:keyword:`not in` 於其成員。例如,以下程式現在能夠作用了:" +"強化 :class:`~enum.Flag` 以支援使用 :func:`len`、疊代 (iteration) 和 :" +"keyword:`in`/:keyword:`not in` 於其成員。例如,以下程式現在能夠作用了:" "``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" #: ../../whatsnew/3.11.rst:704 @@ -1193,9 +1217,9 @@ msgid "" "defined before :meth:`~object.__init_subclass__` is called; :func:`dir` now " "includes methods, etc., from mixed-in data types." msgstr "" -"更改了 :class:`~enum.Enum` 和 :class:`~enum.Flag` 以在呼" -"叫 :meth:`~object.__init_subclass__` 之前就定義成員;:func:`dir` 現在包括來自" -"混合資料型別的方法。" +"更改了 :class:`~enum.Enum` 和 :class:`~enum.Flag` 以在呼叫 :meth:`~object." +"__init_subclass__` 之前就定義成員;:func:`dir` 現在包括來自混合資料型別的方" +"法。" #: ../../whatsnew/3.11.rst:709 msgid "" @@ -1248,11 +1272,11 @@ msgstr "functools" #: ../../whatsnew/3.11.rst:743 msgid "" -":func:`functools.singledispatch` now supports :data:`types.UnionType` " -"and :data:`typing.Union` as annotations to the dispatch argument.::" +":func:`functools.singledispatch` now supports :data:`types.UnionType` and :" +"data:`typing.Union` as annotations to the dispatch argument.::" msgstr "" -":func:`functools.singledispatch` 現在支援 :data:`types.UnionType` " -"和 :data:`typing.Union` 作為調度 (dispatch) 引數的標註。 ::" +":func:`functools.singledispatch` 現在支援 :data:`types.UnionType` 和 :data:" +"`typing.Union` 作為調度 (dispatch) 引數的標註。 ::" #: ../../whatsnew/3.11.rst:746 msgid "" @@ -1311,14 +1335,13 @@ msgstr "gzip" #: ../../whatsnew/3.11.rst:776 msgid "" "The :func:`gzip.compress` function is now faster when used with the " -"**mtime=0** argument as it delegates the compression entirely to a " -"single :func:`zlib.compress` operation. There is one side effect of this " -"change: The gzip file header contains an \"OS\" byte in its header. That was " -"traditionally always set to a value of 255 representing \"unknown\" by " -"the :mod:`gzip` module. Now, when using :func:`~gzip.compress` with " -"**mtime=0**, it may be set to a different value by the underlying zlib C " -"library Python was linked against. (See :gh:`112346` for details on the side " -"effect.)" +"**mtime=0** argument as it delegates the compression entirely to a single :" +"func:`zlib.compress` operation. There is one side effect of this change: The " +"gzip file header contains an \"OS\" byte in its header. That was " +"traditionally always set to a value of 255 representing \"unknown\" by the :" +"mod:`gzip` module. Now, when using :func:`~gzip.compress` with **mtime=0**, " +"it may be set to a different value by the underlying zlib C library Python " +"was linked against. (See :gh:`112346` for details on the side effect.)" msgstr "" #: ../../whatsnew/3.11.rst:789 @@ -1372,8 +1395,8 @@ msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" msgstr "" -"當帶有輸入與輸出地儲存 Shell 時,也會包含提示字元。(由 Terry Jan Reedy " -"於 :gh:`95191` 中所貢獻。)" +"當帶有輸入與輸出地儲存 Shell 時,也會包含提示字元。(由 Terry Jan Reedy 於 :" +"gh:`95191` 中所貢獻。)" #: ../../whatsnew/3.11.rst:822 msgid "inspect" @@ -1392,12 +1415,11 @@ msgstr "" #: ../../whatsnew/3.11.rst:828 msgid "" "Add :func:`~inspect.ismethodwrapper` for checking if the type of an object " -"is a :class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik " -"in :issue:`29418`.)" +"is a :class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik in :" +"issue:`29418`.)" msgstr "" -"新增 :func:`inspect.ismethodwrapper`,用來檢查一個物件的型別是否" -"為 :class:`~types.MethodWrapperType`。(由 Hakan Çelik 於 :issue:`29418` 中所" -"貢獻。)" +"新增 :func:`inspect.ismethodwrapper`,用來檢查一個物件的型別是否為 :class:" +"`~types.MethodWrapperType`。(由 Hakan Çelik 於 :issue:`29418` 中所貢獻。)" #: ../../whatsnew/3.11.rst:832 msgid "" @@ -1407,10 +1429,10 @@ msgid "" "interfaces) that includes the extended :pep:`657` position information (end " "line number, column and end column). The affected functions are:" msgstr "" -"更改 :mod:`inspect` 模組中與幀相關的函式以回傳新" -"的 :class:`~inspect.FrameInfo` 和 :class:`~inspect.Traceback` 類別實例(向後" -"相容之前類似於 :term:`named tuple` 的介面),包括擴充的 :pep:`657` 位置資訊" -"(結束行號、欄和結束欄)。受影響的功能是:" +"更改 :mod:`inspect` 模組中與幀相關的函式以回傳新的 :class:`~inspect." +"FrameInfo` 和 :class:`~inspect.Traceback` 類別實例(向後相容之前類似於 :term:" +"`named tuple` 的介面),包括擴充的 :pep:`657` 位置資訊(結束行號、欄和結束" +"欄)。受影響的功能是:" #: ../../whatsnew/3.11.rst:838 msgid ":func:`inspect.getframeinfo`" @@ -1443,8 +1465,8 @@ msgstr "locale" #: ../../whatsnew/3.11.rst:852 msgid "" "Add :func:`locale.getencoding` to get the current locale encoding. It is " -"similar to ``locale.getpreferredencoding(False)`` but ignores " -"the :ref:`Python UTF-8 Mode `." +"similar to ``locale.getpreferredencoding(False)`` but ignores the :ref:" +"`Python UTF-8 Mode `." msgstr "" "新增 :func:`locale.getencoding` 以取得目前的區域編碼 (locale encoding)。和 " "``locale.getpreferredencoding(False)`` 類似但不考慮 :ref:`Python UTF-8 模式 " @@ -1457,9 +1479,9 @@ msgstr "logging" #: ../../whatsnew/3.11.rst:862 msgid "" "Added :func:`~logging.getLevelNamesMapping` to return a mapping from logging " -"level names (e.g. ``'CRITICAL'``) to the values of their " -"corresponding :ref:`levels` (e.g. ``50``, by default). (Contributed by " -"Andrei Kulakovin in :gh:`88024`.)" +"level names (e.g. ``'CRITICAL'``) to the values of their corresponding :ref:" +"`levels` (e.g. ``50``, by default). (Contributed by Andrei Kulakovin in :gh:" +"`88024`.)" msgstr "" "新增 :func:`~logging.getLevelNamesMapping` 以回傳一個日誌級別名稱(例如 " "``'CRITICAL'``)指到對應的 :ref:`levels` 數值(例如,預設為 ``50``)的對映。" @@ -1467,19 +1489,17 @@ msgstr "" #: ../../whatsnew/3.11.rst:867 msgid "" -"Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method " -"to :class:`~logging.handlers.SysLogHandler`, to " -"match :meth:`SocketHandler.createSocket() " -"`. It is called automatically " -"during handler initialization and when emitting an event, if there is no " -"active socket. (Contributed by Kirill Pinchuk in :gh:`88457`.)" +"Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method to :" +"class:`~logging.handlers.SysLogHandler`, to match :meth:`SocketHandler." +"createSocket() `. It is called " +"automatically during handler initialization and when emitting an event, if " +"there is no active socket. (Contributed by Kirill Pinchuk in :gh:`88457`.)" msgstr "" -"添加了一個 :meth:`~logging.handlers.SysLogHandler.createSocket` 方法" -"到 :class:`~logging.handlers.SysLogHandler`,以匹" -"配 :meth:`SocketHandler.createSocket() " -"` 。如果沒有已啟用的 socket,它" -"會在處理程式初始化期間和發出一個事件時自動呼叫。(由 Kirill Pinchuk " -"在 :gh:`88457` 中貢獻。)" +"添加了一個 :meth:`~logging.handlers.SysLogHandler.createSocket` 方法到 :" +"class:`~logging.handlers.SysLogHandler`,以匹配 :meth:`SocketHandler." +"createSocket() ` 。如果沒有已啟" +"用的 socket,它會在處理程式初始化期間和發出一個事件時自動呼叫。(由 Kirill " +"Pinchuk 在 :gh:`88457` 中貢獻。)" #: ../../whatsnew/3.11.rst:879 msgid "math" @@ -1490,29 +1510,29 @@ msgid "" "Add :func:`math.exp2`: return 2 raised to the power of x. (Contributed by " "Gideon Mitchell in :issue:`45917`.)" msgstr "" -"新增 :func:`math.exp2`:回傳 2 的 x 次方。(由 Gideon Mitchell " -"於 :issue:`45917` 中所貢獻。)" +"新增 :func:`math.exp2`:回傳 2 的 x 次方。(由 Gideon Mitchell 於 :issue:" +"`45917` 中所貢獻。)" #: ../../whatsnew/3.11.rst:884 msgid "" "Add :func:`math.cbrt`: return the cube root of x. (Contributed by Ajith " "Ramachandran in :issue:`44357`.)" msgstr "" -"新增 :func:`math.cbrt`:回傳 x 的立方根。(由 Ajith Ramachandran " -"於 :issue:`44357` 中所貢獻。)" +"新增 :func:`math.cbrt`:回傳 x 的立方根。(由 Ajith Ramachandran 於 :issue:" +"`44357` 中所貢獻。)" #: ../../whatsnew/3.11.rst:887 msgid "" "The behaviour of two :func:`math.pow` corner cases was changed, for " -"consistency with the IEEE 754 specification. The operations ``math.pow(0.0, " -"-math.inf)`` and ``math.pow(-0.0, -math.inf)`` now return ``inf``. " -"Previously they raised :exc:`ValueError`. (Contributed by Mark Dickinson " -"in :issue:`44339`.)" +"consistency with the IEEE 754 specification. The operations ``math.pow(0.0, -" +"math.inf)`` and ``math.pow(-0.0, -math.inf)`` now return ``inf``. Previously " +"they raised :exc:`ValueError`. (Contributed by Mark Dickinson in :issue:" +"`44339`.)" msgstr "" "為了與 IEEE 754 規範保持一致,更改了兩個 :func:`math.pow` 邊角案例 (corner " "case) 的行為。``math.pow(0.0, -math.inf)`` 和 ``math.pow(-0.0, -math.inf)`` " -"現在回傳 ``inf``,之前它們會引發 :exc:`ValueError`。(由 Mark Dickinson " -"在 :issue:`44339` 中貢獻。)" +"現在回傳 ``inf``,之前它們會引發 :exc:`ValueError`。(由 Mark Dickinson 在 :" +"issue:`44339` 中貢獻。)" #: ../../whatsnew/3.11.rst:893 msgid "" @@ -1528,9 +1548,9 @@ msgstr "operator" #: ../../whatsnew/3.11.rst:902 msgid "" -"A new function ``operator.call`` has been added, such that " -"``operator.call(obj, *args, **kwargs) == obj(*args, **kwargs)``. " -"(Contributed by Antony Lee in :issue:`44019`.)" +"A new function ``operator.call`` has been added, such that ``operator." +"call(obj, *args, **kwargs) == obj(*args, **kwargs)``. (Contributed by Antony " +"Lee in :issue:`44019`.)" msgstr "" "新增 ``operator.call`` 函式,使得 ``operator.call(obj, *args, **kwargs) == " "obj(*args, **kwargs)``。(由 Antony Lee 於 :issue:`44019` 中所貢獻。)" @@ -1542,8 +1562,8 @@ msgstr "os" #: ../../whatsnew/3.11.rst:912 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " -"``CryptGenRandom()`` which is deprecated. (Contributed by Donghee Na " -"in :issue:`44611`.)" +"``CryptGenRandom()`` which is deprecated. (Contributed by Donghee Na in :" +"issue:`44611`.)" msgstr "" "在 Windows 上,:func:`os.urandom` 現在使用 ``BCryptGenRandom()`` 以取代被棄用" "的 ``CryptGenRandom()``。(由 Donghee Na 於 :issue:`44611` 中所貢獻。)" @@ -1555,9 +1575,9 @@ msgstr "pathlib" #: ../../whatsnew/3.11.rst:922 msgid "" ":meth:`~pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` return only " -"directories if *pattern* ends with a pathname components " -"separator: :data:`~os.sep` or :data:`~os.altsep`. (Contributed by Eisuke " -"Kawasima in :issue:`22276` and :issue:`33392`.)" +"directories if *pattern* ends with a pathname components separator: :data:" +"`~os.sep` or :data:`~os.altsep`. (Contributed by Eisuke Kawasima in :issue:" +"`22276` and :issue:`33392`.)" msgstr "" "如果 *pattern* 以路徑名稱元件分隔符號 :data:`~os.sep` 或 :data:`~os.altsep` " "結尾,:meth:`~pathlib.Path.glob` 和 :meth:`~pathlib.Path.rglob` 只回傳目錄。" @@ -1575,8 +1595,8 @@ msgid "" msgstr "" "現在規則運算式 (regular expression) 是有支援原子性群組 (atomic grouping) " "(``(?>...)``) 和佔有性量詞 (possessive quantifier) (``*+``, ``++``, ``?+``, " -"``{m,n}+``) 的。(由 Jeffrey C. Jacobs 和 Serhiy Storchaka " -"在 :issue:`433030` 中貢獻。)" +"``{m,n}+``) 的。(由 Jeffrey C. Jacobs 和 Serhiy Storchaka 在 :issue:" +"`433030` 中貢獻。)" #: ../../whatsnew/3.11.rst:941 msgid "shutil" @@ -1587,8 +1607,8 @@ msgid "" "Add optional parameter *dir_fd* in :func:`shutil.rmtree`. (Contributed by " "Serhiy Storchaka in :issue:`46245`.)" msgstr "" -"新增 :func:`shutil.rmtree` 的可選參數 *dir_fd*。(由 Serhiy Storchaka " -"於 :issue:`46245` 中所貢獻。)" +"新增 :func:`shutil.rmtree` 的可選參數 *dir_fd*。(由 Serhiy Storchaka 於 :" +"issue:`46245` 中所貢獻。)" #: ../../whatsnew/3.11.rst:950 msgid "socket" @@ -1596,8 +1616,8 @@ msgstr "socket" #: ../../whatsnew/3.11.rst:952 msgid "" -"Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner " -"in :issue:`30512`.)" +"Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner in :issue:" +"`30512`.)" msgstr "" "新增 NetBSD 對於 CAN Socket 的支援。(由 Thomas Klausner 於 :issue:`30512` 中" "所貢獻。)" @@ -1609,8 +1629,8 @@ msgid "" "raising the last error. (Contributed by Irit Katriel in :issue:`29980`.)" msgstr "" "當連接失敗時,:meth:`~socket.create_connection` 有個選項可以引發一個包含所有" -"錯誤的 :exc:`ExceptionGroup`,而非只引發最後一個錯誤。(由 Irit Katriel " -"於 :issue:`29980` 中貢獻。)" +"錯誤的 :exc:`ExceptionGroup`,而非只引發最後一個錯誤。(由 Irit Katriel 於 :" +"issue:`29980` 中貢獻。)" #: ../../whatsnew/3.11.rst:964 msgid "sqlite3" @@ -1618,49 +1638,48 @@ msgstr "sqlite3" #: ../../whatsnew/3.11.rst:966 msgid "" -"You can now disable the authorizer by passing :const:`None` " -"to :meth:`~sqlite3.Connection.set_authorizer`. (Contributed by Erlend E. " -"Aasland in :issue:`44491`.)" +"You can now disable the authorizer by passing :const:`None` to :meth:" +"`~sqlite3.Connection.set_authorizer`. (Contributed by Erlend E. Aasland in :" +"issue:`44491`.)" msgstr "" -"現在可以透過將 :const:`None` 傳遞" -"給 :meth:`~sqlite3.Connection.set_authorizer` 來停用 authorizer。(由 " -"Erlend E. Aasland 於 :issue:`44491` 中貢獻。)" +"現在可以透過將 :const:`None` 傳遞給 :meth:`~sqlite3.Connection." +"set_authorizer` 來停用 authorizer。(由 Erlend E. Aasland 於 :issue:`44491` " +"中貢獻。)" #: ../../whatsnew/3.11.rst:970 msgid "" "Collation name :meth:`~sqlite3.Connection.create_collation` can now contain " -"any Unicode character. Collation names with invalid characters now " -"raise :exc:`UnicodeEncodeError` instead of :exc:`sqlite3.ProgrammingError`. " +"any Unicode character. Collation names with invalid characters now raise :" +"exc:`UnicodeEncodeError` instead of :exc:`sqlite3.ProgrammingError`. " "(Contributed by Erlend E. Aasland in :issue:`44688`.)" msgstr "" "定序 (collation) 名稱 :meth:`~sqlite3.Connection.create_collation` 現在可以包" -"含任何 Unicode 字元。帶有無效字元的定序名稱現在會引" -"發 :exc:`UnicodeEncodeError` 而不是 :exc:`sqlite3.ProgrammingError`。(由 " -"Erlend E. Aasland 在 :issue:`44688` 中貢獻。)" +"含任何 Unicode 字元。帶有無效字元的定序名稱現在會引發 :exc:" +"`UnicodeEncodeError` 而不是 :exc:`sqlite3.ProgrammingError`。(由 Erlend E. " +"Aasland 在 :issue:`44688` 中貢獻。)" #: ../../whatsnew/3.11.rst:975 msgid "" -":mod:`sqlite3` exceptions now include the SQLite extended error code " -"as :attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name " -"as :attr:`~sqlite3.Error.sqlite_errorname`. (Contributed by Aviv Palivoda, " -"Daniel Shahaf, and Erlend E. Aasland in :issue:`16379` and :issue:`24139`.)" +":mod:`sqlite3` exceptions now include the SQLite extended error code as :" +"attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name as :attr:" +"`~sqlite3.Error.sqlite_errorname`. (Contributed by Aviv Palivoda, Daniel " +"Shahaf, and Erlend E. Aasland in :issue:`16379` and :issue:`24139`.)" msgstr "" -":mod:`sqlite3` 例外現在包含 SQLite 擴充錯誤碼和 SQLite 錯誤名稱(分別" -"為 :attr:`~sqlite3.Error.sqlite_errorcode` " -"和 :attr:`~sqlite3.Error.sqlite_errorname`)。(由 Aviv Palivoda、Daniel " -"Shahaf 和 Erlend E. Aasland 在 :issue:`16379` 和 :issue:`24139` 中貢獻。)" +":mod:`sqlite3` 例外現在包含 SQLite 擴充錯誤碼和 SQLite 錯誤名稱(分別為 :" +"attr:`~sqlite3.Error.sqlite_errorcode` 和 :attr:`~sqlite3.Error." +"sqlite_errorname`)。(由 Aviv Palivoda、Daniel Shahaf 和 Erlend E. Aasland " +"在 :issue:`16379` 和 :issue:`24139` 中貢獻。)" #: ../../whatsnew/3.11.rst:981 msgid "" -"Add :meth:`~sqlite3.Connection.setlimit` " -"and :meth:`~sqlite3.Connection.getlimit` to :class:`sqlite3.Connection` for " -"setting and getting SQLite limits by connection basis. (Contributed by " -"Erlend E. Aasland in :issue:`45243`.)" +"Add :meth:`~sqlite3.Connection.setlimit` and :meth:`~sqlite3.Connection." +"getlimit` to :class:`sqlite3.Connection` for setting and getting SQLite " +"limits by connection basis. (Contributed by Erlend E. Aasland in :issue:" +"`45243`.)" msgstr "" -"將 :meth:`~sqlite3.Connection.setlimit` " -"和 :meth:`~sqlite3.Connection.getlimit` 新增到 :class:`sqlite3.Connection` 以" -"根據連線來設定和取得 SQLite 限制。(由 Erlend E. Aasland 在 :issue:`45243` 中" -"貢獻。)" +"將 :meth:`~sqlite3.Connection.setlimit` 和 :meth:`~sqlite3.Connection." +"getlimit` 新增到 :class:`sqlite3.Connection` 以根據連線來設定和取得 SQLite 限" +"制。(由 Erlend E. Aasland 在 :issue:`45243` 中貢獻。)" #: ../../whatsnew/3.11.rst:986 msgid "" @@ -1691,43 +1710,40 @@ msgid "" "(Contributed by Erlend E. Aasland in :issue:`44092`.)" msgstr "" "跨越不同回滾 (rollback) 的拿取動作不再引發 :exc:`~sqlite3.InterfaceError`,我" -"們將其留給 SQLite 函式庫來處理這些情況。(由 Erlend E. Aasland " -"在 :issue:`44092` 中貢獻。)" +"們將其留給 SQLite 函式庫來處理這些情況。(由 Erlend E. Aasland 在 :issue:" +"`44092` 中貢獻。)" #: ../../whatsnew/3.11.rst:1000 msgid "" -"Add :meth:`~sqlite3.Connection.serialize` " -"and :meth:`~sqlite3.Connection.deserialize` to :class:`sqlite3.Connection` " -"for serializing and deserializing databases. (Contributed by Erlend E. " -"Aasland in :issue:`41930`.)" +"Add :meth:`~sqlite3.Connection.serialize` and :meth:`~sqlite3.Connection." +"deserialize` to :class:`sqlite3.Connection` for serializing and " +"deserializing databases. (Contributed by Erlend E. Aasland in :issue:" +"`41930`.)" msgstr "" -"將 :meth:`~sqlite3.Connection.serialize` " -"和 :meth:`~sqlite3.Connection.deserialize` 新增" -"到 :class:`sqlite3.Connection` 以用於序列化和反序列化資料庫。(由 Erlend E. " -"Aasland 在 :issue:`41930` 中貢獻。)" +"將 :meth:`~sqlite3.Connection.serialize` 和 :meth:`~sqlite3.Connection." +"deserialize` 新增到 :class:`sqlite3.Connection` 以用於序列化和反序列化資料" +"庫。(由 Erlend E. Aasland 在 :issue:`41930` 中貢獻。)" #: ../../whatsnew/3.11.rst:1005 msgid "" -"Add :meth:`~sqlite3.Connection.create_window_function` " -"to :class:`sqlite3.Connection` for creating aggregate window functions. " -"(Contributed by Erlend E. Aasland in :issue:`34916`.)" +"Add :meth:`~sqlite3.Connection.create_window_function` to :class:`sqlite3." +"Connection` for creating aggregate window functions. (Contributed by Erlend " +"E. Aasland in :issue:`34916`.)" msgstr "" -"於 :class:`sqlite3.Connection` 加" -"入 :meth:`~sqlite3.Connection.create_window_function` 已建立聚合視窗函式 " -"(aggregate window function)。(由 Erlend E. Aasland 於 :issue:`34916` 中貢" -"獻。)" +"於 :class:`sqlite3.Connection` 加入 :meth:`~sqlite3.Connection." +"create_window_function` 已建立聚合視窗函式 (aggregate window function)。(由 " +"Erlend E. Aasland 於 :issue:`34916` 中貢獻。)" #: ../../whatsnew/3.11.rst:1009 msgid "" -"Add :meth:`~sqlite3.Connection.blobopen` " -"to :class:`sqlite3.Connection`. :class:`sqlite3.Blob` allows incremental I/O " -"operations on blobs. (Contributed by Aviv Palivoda and Erlend E. Aasland " -"in :issue:`24905`.)" +"Add :meth:`~sqlite3.Connection.blobopen` to :class:`sqlite3.Connection`. :" +"class:`sqlite3.Blob` allows incremental I/O operations on blobs. " +"(Contributed by Aviv Palivoda and Erlend E. Aasland in :issue:`24905`.)" msgstr "" -"在 :class:`sqlite3.Connection` 新" -"增 :meth:`~sqlite3.Connection.blobopen`。 :class:`sqlite3.Blob` 允許對 blob " -"進行增量 I/O 操作 (incremental I/O operations)。(由 Aviv Palivoda 和 Erlend " -"E. Aasland 在 :issue:`24905` 中貢獻。)" +"在 :class:`sqlite3.Connection` 新增 :meth:`~sqlite3.Connection.blobopen`。 :" +"class:`sqlite3.Blob` 允許對 blob 進行增量 I/O 操作 (incremental I/O " +"operations)。(由 Aviv Palivoda 和 Erlend E. Aasland 在 :issue:`24905` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:1017 msgid "string" @@ -1735,15 +1751,15 @@ msgstr "string" #: ../../whatsnew/3.11.rst:1019 msgid "" -"Add :meth:`~string.Template.get_identifiers` " -"and :meth:`~string.Template.is_valid` to :class:`string.Template`, which " -"respectively return all valid placeholders, and whether any invalid " -"placeholders are present. (Contributed by Ben Kehoe in :gh:`90465`.)" +"Add :meth:`~string.Template.get_identifiers` and :meth:`~string.Template." +"is_valid` to :class:`string.Template`, which respectively return all valid " +"placeholders, and whether any invalid placeholders are present. (Contributed " +"by Ben Kehoe in :gh:`90465`.)" msgstr "" -"新增 :meth:`~string.Template.get_identifiers` " -"和 :meth:`~string.Template.is_valid` 於 :class:`string.Template`,分別能夠回" -"傳所有合格的預留位置 (placeholder) 與是否有任何不合格的預留位置存在。(由 " -"Ben Kehoe 於 :gh:`90465` 中貢獻。)" +"新增 :meth:`~string.Template.get_identifiers` 和 :meth:`~string.Template." +"is_valid` 於 :class:`string.Template`,分別能夠回傳所有合格的預留位置 " +"(placeholder) 與是否有任何不合格的預留位置存在。(由 Ben Kehoe 於 :gh:" +"`90465` 中貢獻。)" #: ../../whatsnew/3.11.rst:1029 msgid "sys" @@ -1754,8 +1770,8 @@ msgid "" ":func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields from " "the ``value`` (the exception instance), so when an exception is modified " "while it is being handled, the changes are reflected in the results of " -"subsequent calls to :func:`!exc_info`. (Contributed by Irit Katriel " -"in :issue:`45711`.)" +"subsequent calls to :func:`!exc_info`. (Contributed by Irit Katriel in :" +"issue:`45711`.)" msgstr "" ":func:`sys.exc_info` 現在從 ``value``\\ (例外實例)衍生出 ``type`` 和 " "``traceback`` 欄位,因此當例外在處理過程中被修改時,變更會反映在 :func:`!" @@ -1764,20 +1780,20 @@ msgstr "" #: ../../whatsnew/3.11.rst:1037 msgid "" "Add :func:`sys.exception` which returns the active exception instance " -"(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel " -"in :issue:`46328`.)" +"(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel in :" +"issue:`46328`.)" msgstr "" -"新增會回傳活躍例外實例 (active exception instance) " -"的 :func:`sys.exception`\\ (等價於 ``sys.exc_info()[1]``\\ )。(由 Irit " -"Katriel 於 :issue:`46328` 中所貢獻。)" +"新增會回傳活躍例外實例 (active exception instance) 的 :func:`sys." +"exception`\\ (等價於 ``sys.exc_info()[1]``\\ )。(由 Irit Katriel 於 :" +"issue:`46328` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1041 msgid "" "Add the :data:`sys.flags.safe_path ` flag. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" -"新增 :data:`sys.flags.safe_path ` 旗標。(由 Victor Stinner " -"於 :gh:`57684` 中所貢獻。)" +"新增 :data:`sys.flags.safe_path ` 旗標。(由 Victor Stinner 於 :" +"gh:`57684` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1048 msgid "sysconfig" @@ -1813,13 +1829,13 @@ msgid "" ":class:`~tempfile.SpooledTemporaryFile` objects now fully implement the " "methods of :class:`io.BufferedIOBase` or :class:`io.TextIOBase` (depending " "on file mode). This lets them work correctly with APIs that expect file-like " -"objects, such as compression modules. (Contributed by Carey Metcalfe " -"in :gh:`70363`.)" +"objects, such as compression modules. (Contributed by Carey Metcalfe in :gh:" +"`70363`.)" msgstr "" -":class:`~tempfile.SpooledTemporaryFile` 物件現在完整實作" -"了 :class:`io.BufferedIOBase` 或 :class:`io.TextIOBase` 的方法(取決於檔案模" -"式),這使它們能夠正確地使用需要類檔案物件的 API,例如壓縮模組。(由 Carey " -"Metcalfe 在 :gh:`70363` 中貢獻。)" +":class:`~tempfile.SpooledTemporaryFile` 物件現在完整實作了 :class:`io." +"BufferedIOBase` 或 :class:`io.TextIOBase` 的方法(取決於檔案模式),這使它們" +"能夠正確地使用需要類檔案物件的 API,例如壓縮模組。(由 Carey Metcalfe 在 :gh:" +"`70363` 中貢獻。)" #: ../../whatsnew/3.11.rst:1080 msgid "threading" @@ -1831,13 +1847,13 @@ msgid "" "(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses " "the monotonic clock (:const:`time.CLOCK_MONOTONIC`) for the timeout, rather " "than using the system clock (:const:`time.CLOCK_REALTIME`), to not be " -"affected by system clock changes. (Contributed by Victor Stinner " -"in :issue:`41710`.)" +"affected by system clock changes. (Contributed by Victor Stinner in :issue:" +"`41710`.)" msgstr "" "在 Unix 上,如果 ``sem_clockwait()`` 函式在 C 函式庫(glibc 2.30 與其更新的版" -"本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 " -"(:const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 " -"(:const:`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner " +"本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 (:" +"const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:" +"const:`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner " "在 :issue:`41710` 中貢獻。)" #: ../../whatsnew/3.11.rst:1093 @@ -1853,10 +1869,9 @@ msgid "" "Benjamin Szőke and Victor Stinner in :issue:`21302`.)" msgstr "" "在 Unix 上,如果可用的話,:func:`time.sleep` 現在會使用 " -"``clock_nanosleep()`` 或 ``nanosleep()`` 函式,其解析度為 1 納秒" -"(10\\ :sup:`-9` 秒),而不是使用解析度為 1 微秒(10\\ :sup:`-6` 秒)的 " -"``select()``。(由 Benjamin Szőke 和 Victor Stinner 在 :issue:`21302` 中貢" -"獻。)" +"``clock_nanosleep()`` 或 ``nanosleep()`` 函式,其解析度為 1 納秒(10\\ :sup:" +"`-9` 秒),而不是使用解析度為 1 微秒(10\\ :sup:`-6` 秒)的 ``select()``。" +"(由 Benjamin Szőke 和 Victor Stinner 在 :issue:`21302` 中貢獻。)" #: ../../whatsnew/3.11.rst:1101 msgid "" @@ -1865,15 +1880,15 @@ msgid "" "hardware/drivers/kernel/high-resolution-timers>`_ which has a resolution of " "100 nanoseconds (10\\ :sup:`-7` seconds). Previously, it had a resolution of " "1 millisecond (10\\ :sup:`-3` seconds). (Contributed by Benjamin Szőke, " -"Donghee Na, Eryk Sun and Victor Stinner in :issue:`21302` " -"and :issue:`45429`.)" +"Donghee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:" +"`45429`.)" msgstr "" "在 Windows 8.1 或更新的平台上,:func:`time.sleep` 現在使用了一個基於\\ `高解" "析度計時器 `_\\ 的可等待 (waitable) 計時器,解析度為 100 奈秒" "(即 10\\ :sup:`-7` 秒)。在這之前,它只有 1 微秒(10\\ :sup:`-3` 秒) 的解析" -"度。(由 Benjamin Szőke、Donghee Na、Eryk Sun 和 Victor Stinner " -"於 :issue:`21302` 與 :issue:`45429` 中貢獻。)" +"度。(由 Benjamin Szőke、Donghee Na、Eryk Sun 和 Victor Stinner 於 :issue:" +"`21302` 與 :issue:`45429` 中貢獻。)" #: ../../whatsnew/3.11.rst:1112 msgid "tkinter" @@ -1904,13 +1919,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:1129 msgid "" -"Add :func:`traceback.TracebackException.print`, which prints the " -"formatted :exc:`~traceback.TracebackException` instance to a file. " -"(Contributed by Irit Katriel in :issue:`33809`.)" +"Add :func:`traceback.TracebackException.print`, which prints the formatted :" +"exc:`~traceback.TracebackException` instance to a file. (Contributed by Irit " +"Katriel in :issue:`33809`.)" msgstr "" -"新增 :func:`traceback.TracebackException.print`,它會印出格式化" -"的 :exc:`~traceback.TracebackException` 實例至一個檔案。(由 Irit Katriel " -"在 :issue:`33809` 中貢獻。)" +"新增 :func:`traceback.TracebackException.print`,它會印出格式化的 :exc:" +"`~traceback.TracebackException` 實例至一個檔案。(由 Irit Katriel 在 :issue:" +"`33809` 中貢獻。)" #: ../../whatsnew/3.11.rst:1137 msgid "typing" @@ -1922,16 +1937,14 @@ msgstr "重大變更請見 :ref:`new-feat-related-type-hints-311`。" #: ../../whatsnew/3.11.rst:1141 msgid "" -"Add :func:`typing.assert_never` " -"and :class:`typing.Never`. :func:`typing.assert_never` is useful for asking " -"a type checker to confirm that a line of code is not reachable. At runtime, " -"it raises an :exc:`AssertionError`. (Contributed by Jelle Zijlstra " -"in :gh:`90633`.)" +"Add :func:`typing.assert_never` and :class:`typing.Never`. :func:`typing." +"assert_never` is useful for asking a type checker to confirm that a line of " +"code is not reachable. At runtime, it raises an :exc:`AssertionError`. " +"(Contributed by Jelle Zijlstra in :gh:`90633`.)" msgstr "" -"新增 :func:`typing.assert_never` " -"和 :class:`typing.Never`。 :func:`typing.assert_never` 可用於要型別檢查器確認" -"某行程式碼是否不可觸及。在執行環境,它會引發 :exc:`AssertionError`。(由 " -"Jelle Zijlstra 在 :gh:`90633` 中貢獻。)" +"新增 :func:`typing.assert_never` 和 :class:`typing.Never`。 :func:`typing." +"assert_never` 可用於要型別檢查器確認某行程式碼是否不可觸及。在執行環境,它會" +"引發 :exc:`AssertionError`。(由 Jelle Zijlstra 在 :gh:`90633` 中貢獻。)" #: ../../whatsnew/3.11.rst:1147 msgid "" @@ -1959,16 +1972,16 @@ msgid "" ":data:`typing.TypedDict` types can now be generic. (Contributed by Samodya " "Abeysiriwardane in :gh:`89026`.)" msgstr "" -":data:`typing.TypedDict` 型別現可為泛型。(由 Samodya Abeysiriwardane " -"於 :gh:`89026` 中所貢獻。)" +":data:`typing.TypedDict` 型別現可為泛型。(由 Samodya Abeysiriwardane 於 :gh:" +"`89026` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1160 msgid "" ":class:`~typing.NamedTuple` types can now be generic. (Contributed by Serhiy " "Storchaka in :issue:`43923`.)" msgstr "" -":class:`~typing.NamedTuple` 型別現可為泛型。(由 Serhiy Storchaka " -"於 :issue:`43923` 中所貢獻。)" +":class:`~typing.NamedTuple` 型別現可為泛型。(由 Serhiy Storchaka 於 :issue:" +"`43923` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1163 msgid "" @@ -1991,8 +2004,8 @@ msgstr "" msgid "" "The :func:`typing.get_overloads` function can be used for introspecting the " "overloads of a function. :func:`typing.clear_overloads` can be used to clear " -"all registered overloads of a function. (Contributed by Jelle Zijlstra " -"in :gh:`89263`.)" +"all registered overloads of a function. (Contributed by Jelle Zijlstra in :" +"gh:`89263`.)" msgstr "" ":func:`typing.get_overloads` 函式可用於自我檢查 (introspect) 一個函式的過載 " "(overload)。:func:`typing.clear_overloads` 可用於清除一個函式的所有已註冊過" @@ -2031,28 +2044,28 @@ msgid "" "references in :ref:`PEP 585 generic aliases `. " "(Contributed by Niklas Rosenstein in :gh:`85542`.)" msgstr "" -"作為\\ :ref:`PEP 585 泛化別名 `\\ 中的前向參" -"照,:func:`typing.get_type_hints` 現支援了為字串求值 (evaluate)。(由 Niklas " +"作為\\ :ref:`PEP 585 泛化別名 `\\ 中的前向參照,:func:" +"`typing.get_type_hints` 現支援了為字串求值 (evaluate)。(由 Niklas " "Rosenstein 在 :gh:`85542` 中貢獻。)" #: ../../whatsnew/3.11.rst:1192 msgid "" ":func:`typing.get_type_hints` no longer adds :data:`~typing.Optional` to " -"parameters with ``None`` as a default. (Contributed by Nikita Sobolev " -"in :gh:`90353`.)" +"parameters with ``None`` as a default. (Contributed by Nikita Sobolev in :gh:" +"`90353`.)" msgstr "" ":func:`typing.get_type_hints` 不再將 :data:`~typing.Optional` 新增到預設為 " "``None`` 的參數中。(由 Nikita Sobolev 在 :gh:`90353` 中貢獻。)" #: ../../whatsnew/3.11.rst:1196 msgid "" -":func:`typing.get_type_hints` now supports evaluating bare " -"stringified :data:`~typing.ClassVar` annotations. (Contributed by Gregory " -"Beauregard in :gh:`90711`.)" +":func:`typing.get_type_hints` now supports evaluating bare stringified :data:" +"`~typing.ClassVar` annotations. (Contributed by Gregory Beauregard in :gh:" +"`90711`.)" msgstr "" ":func:`typing.get_type_hints` 現在支援為無修飾 (bare) 字串化 (stringified) " -"的 :data:`~typing.ClassVar` 標註來求值。(由 Gregory Beauregard " -"在 :gh:`90711` 中貢獻。)" +"的 :data:`~typing.ClassVar` 標註來求值。(由 Gregory Beauregard 在 :gh:" +"`90711` 中貢獻。)" #: ../../whatsnew/3.11.rst:1200 msgid "" @@ -2081,21 +2094,17 @@ msgstr "unittest" #: ../../whatsnew/3.11.rst:1219 msgid "" -"Added methods :meth:`~unittest.TestCase.enterContext` " -"and :meth:`~unittest.TestCase.enterClassContext` of " -"class :class:`~unittest.TestCase`, " -"method :meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` of " -"class :class:`~unittest.IsolatedAsyncioTestCase` and " -"function :func:`unittest.enterModuleContext`. (Contributed by Serhiy " -"Storchaka in :issue:`45046`.)" -msgstr "" -"新增 :class:`~unittest.TestCase` 類別" -"的 :meth:`~unittest.TestCase.enterContext` " -"與 :meth:`~unittest.TestCase.enterClassContext` 方" -"法、 :class:`~unittest.IsolatedAsyncioTestCase` 類別 " -"的 :meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` 方" -"法、:func:`unittest.enterModuleContext` 函式。(由 Serhiy Storchaka " -"於 :issue:`45046` 貢獻。)" +"Added methods :meth:`~unittest.TestCase.enterContext` and :meth:`~unittest." +"TestCase.enterClassContext` of class :class:`~unittest.TestCase`, method :" +"meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` of class :class:" +"`~unittest.IsolatedAsyncioTestCase` and function :func:`unittest." +"enterModuleContext`. (Contributed by Serhiy Storchaka in :issue:`45046`.)" +msgstr "" +"新增 :class:`~unittest.TestCase` 類別的 :meth:`~unittest.TestCase." +"enterContext` 與 :meth:`~unittest.TestCase.enterClassContext` 方法、 :class:" +"`~unittest.IsolatedAsyncioTestCase` 類別 的 :meth:`~unittest." +"IsolatedAsyncioTestCase.enterAsyncContext` 方法、:func:`unittest." +"enterModuleContext` 函式。(由 Serhiy Storchaka 於 :issue:`45046` 貢獻。)" #: ../../whatsnew/3.11.rst:1231 msgid "venv" @@ -2109,8 +2118,8 @@ msgid "" "installation scheme is the default. That means that downstream distributors " "can change the default sysconfig install scheme without changing behavior of " "virtual environments. Third party code that also creates new virtual " -"environments should do the same. (Contributed by Miro Hrončok " -"in :issue:`45413`.)" +"environments should do the same. (Contributed by Miro Hrončok in :issue:" +"`45413`.)" msgstr "" "建立新的 Python 虛擬環境時,*venv* :ref:`sysconfig 安裝方案 " "`\\ 會被用於確定環境內的路徑。當 Python 在虛擬環境中運行" @@ -2124,10 +2133,10 @@ msgstr "warnings" #: ../../whatsnew/3.11.rst:1249 msgid "" -":func:`warnings.catch_warnings` now accepts arguments " -"for :func:`warnings.simplefilter`, providing a more concise way to locally " -"ignore warnings or convert them to errors. (Contributed by Zac Hatfield-" -"Dodds in :issue:`47074`.)" +":func:`warnings.catch_warnings` now accepts arguments for :func:`warnings." +"simplefilter`, providing a more concise way to locally ignore warnings or " +"convert them to errors. (Contributed by Zac Hatfield-Dodds in :issue:" +"`47074`.)" msgstr "" ":func:`warnings.catch_warnings` 現在接受 :func:`warnings.simplefilter` 的引" "數,提供了一種更簡潔的方法來在本地端忽略警告或將它們轉換為錯誤。(由 Zac " @@ -2139,8 +2148,8 @@ msgstr "zipfile" #: ../../whatsnew/3.11.rst:1259 msgid "" -"Added support for specifying member name encoding for reading metadata in " -"a :class:`~zipfile.ZipFile`'s directory and file headers. (Contributed by " +"Added support for specifying member name encoding for reading metadata in a :" +"class:`~zipfile.ZipFile`'s directory and file headers. (Contributed by " "Stephen J. Turnbull and Serhiy Storchaka in :issue:`28080`.)" msgstr "" "新增了對指定成員名稱編碼的支援,以便在 :class:`~zipfile.ZipFile` 的目錄和檔案" @@ -2157,13 +2166,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:1267 msgid "" -"Added :attr:`~zipfile.Path.stem`, :attr:`~zipfile.Path.suffix` " -"and :attr:`~zipfile.Path.suffixes` to :class:`zipfile.Path`. (Contributed by " -"Miguel Brito in :gh:`88261`.)" +"Added :attr:`~zipfile.Path.stem`, :attr:`~zipfile.Path.suffix` and :attr:" +"`~zipfile.Path.suffixes` to :class:`zipfile.Path`. (Contributed by Miguel " +"Brito in :gh:`88261`.)" msgstr "" -"於 :class:`zipfile.Path` 新" -"增 :attr:`~zipfile.Path.stem`、:attr:`~zipfile.Path.suffix` " -"和 :attr:`~zipfile.Path.suffixes`。(由 Miguel Brito 於 :gh:`88261` 貢獻。)" +"於 :class:`zipfile.Path` 新增 :attr:`~zipfile.Path.stem`、:attr:`~zipfile." +"Path.suffix` 和 :attr:`~zipfile.Path.suffixes`。(由 Miguel Brito 於 :gh:" +"`88261` 貢獻。)" #: ../../whatsnew/3.11.rst:1275 msgid "Optimizations" @@ -2171,9 +2180,8 @@ msgstr "最佳化" #: ../../whatsnew/3.11.rst:1277 msgid "" -"This section covers specific optimizations independent of " -"the :ref:`whatsnew311-faster-cpython` project, which is covered in its own " -"section." +"This section covers specific optimizations independent of the :ref:" +"`whatsnew311-faster-cpython` project, which is covered in its own section." msgstr "" "這個部分會涵蓋到特定的最佳化,但獨立於擁有自己一個說明的\\ :ref:`whatsnew311-" "faster-cpython` 計畫。" @@ -2194,8 +2202,8 @@ msgstr "" msgid "" "Integer division (``//``) is better tuned for optimization by compilers. It " "is now around 20% faster on x86-64 when dividing an :class:`int` by a value " -"smaller than ``2**30``. (Contributed by Gregory P. Smith and Tim Peters " -"in :gh:`90564`.)" +"smaller than ``2**30``. (Contributed by Gregory P. Smith and Tim Peters in :" +"gh:`90564`.)" msgstr "" "整數除法 (``//``) 為了編譯器最佳化而被調校過。現在將 :class:`int` 除以小於 " "``2**30`` 的值時,在 x86-64 上快了大約 20%。(由 Gregory P. Smith 和 Tim " @@ -2211,21 +2219,20 @@ msgstr "" #: ../../whatsnew/3.11.rst:1294 msgid "" -"Resizing lists is streamlined for the common case, speeding " -"up :meth:`list.append` by ≈15% and simple :term:`list comprehension`\\s by " -"up to 20-30% (Contributed by Dennis Sweeney in :gh:`91165`.)" +"Resizing lists is streamlined for the common case, speeding up :meth:`!list." +"append` by ≈15% and simple :term:`list comprehension`\\s by up to 20-30% " +"(Contributed by Dennis Sweeney in :gh:`91165`.)" msgstr "" -"調整 list 大小在常見情況下增進了效能,為 :meth:`list.append` 加快了約 15% 並" -"為簡單的 :term:`list comprehension` 加快了高達 20-30%(由 Dennis Sweeney " -"在 :gh:`91165` 中貢獻。)" +"調整 list 大小在常見情況下增進了效能,為 :meth:`!list.append` 加快了約 15% 並" +"為簡單的 :term:`list comprehension` 加快了高達 20-30%(由 Dennis Sweeney 在 :" +"gh:`91165` 中貢獻。)" #: ../../whatsnew/3.11.rst:1299 msgid "" "Dictionaries don't store hash values when all keys are Unicode objects, " -"decreasing :class:`dict` size. For example, " -"``sys.getsizeof(dict.fromkeys(\"abcdefg\"))`` is reduced from 352 bytes to " -"272 bytes (23% smaller) on 64-bit platforms. (Contributed by Inada Naoki " -"in :issue:`46845`.)" +"decreasing :class:`dict` size. For example, ``sys.getsizeof(dict." +"fromkeys(\"abcdefg\"))`` is reduced from 352 bytes to 272 bytes (23% " +"smaller) on 64-bit platforms. (Contributed by Inada Naoki in :issue:`46845`.)" msgstr "" "當所有鍵都是 Unicode 物件時,字典不儲存雜湊值,減少了 :class:`dict` 的大小。" "例如,``sys.getsizeof(dict.fromkeys(\"abcdefg\"))`` 在 64-bit 平台上從 352 位" @@ -2239,8 +2246,8 @@ msgid "" "for a ≈60 MiB file. (Contributed by msoxzw in :gh:`91487`.)" msgstr "" "使用 :class:`asyncio.DatagramProtocol` 以透過 UDP 傳輸大文件時,現在速度提高" -"了幾個數量級,傳輸 ≈60 MiB 檔案的速度提高了 100 多倍。(由 msoxzw " -"在 :gh:`91487` 中貢獻。)" +"了幾個數量級,傳輸 ≈60 MiB 檔案的速度提高了 100 多倍。(由 msoxzw 在 :gh:" +"`91487` 中貢獻。)" #: ../../whatsnew/3.11.rst:1310 msgid "" @@ -2249,22 +2256,21 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`37295`.)" msgstr "" ":mod:`math` 函式 :func:`~math.comb` 和 :func:`~math.perm` 針對較大引數現在快" -"了 ≈10 倍(對於更大的 *k* 有更大的加速)。(由 Serhiy Storchaka " -"在 :issue:`37295` 中貢獻。)" +"了 ≈10 倍(對於更大的 *k* 有更大的加速)。(由 Serhiy Storchaka 在 :issue:" +"`37295` 中貢獻。)" #: ../../whatsnew/3.11.rst:1314 msgid "" -"The :mod:`statistics` " -"functions :func:`~statistics.mean`, :func:`~statistics.variance` " -"and :func:`~statistics.stdev` now consume iterators in one pass rather than " -"converting them to a :class:`list` first. This is twice as fast and can save " -"substantial memory. (Contributed by Raymond Hettinger in :gh:`90415`.)" +"The :mod:`statistics` functions :func:`~statistics.mean`, :func:`~statistics." +"variance` and :func:`~statistics.stdev` now consume iterators in one pass " +"rather than converting them to a :class:`list` first. This is twice as fast " +"and can save substantial memory. (Contributed by Raymond Hettinger in :gh:" +"`90415`.)" msgstr "" -":mod:`statistics` 函" -"式 :func:`~statistics.mean`、:func:`~statistics.variance` " -"和 :func:`~statistics.stdev` 現在會一次性的消耗疊代器,而不是先將它們轉換" -"為 :class:`list`,這讓速度提升為兩倍並可以節省大量記憶體空間。(由 Raymond " -"Hettinger 在 :gh:`90415` 中貢獻。)" +":mod:`statistics` 函式 :func:`~statistics.mean`、:func:`~statistics." +"variance` 和 :func:`~statistics.stdev` 現在會一次性的消耗疊代器,而不是先將它" +"們轉換為 :class:`list`,這讓速度提升為兩倍並可以節省大量記憶體空間。(由 " +"Raymond Hettinger 在 :gh:`90415` 中貢獻。)" #: ../../whatsnew/3.11.rst:1320 msgid "" @@ -2297,9 +2303,9 @@ msgid "" "startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " "this project are listed separately under :ref:`whatsnew311-optimizations`." msgstr "" -"此計畫專注在 Python 的 :ref:`whatsnew311-faster-startup` " -"和 :ref:`whatsnew311-faster-runtime`。不在此專案內的最佳化被獨立列出" -"在 :ref:`whatsnew311-optimizations`。" +"此計畫專注在 Python 的 :ref:`whatsnew311-faster-startup` 和 :ref:" +"`whatsnew311-faster-runtime`。不在此專案內的最佳化被獨立列出在 :ref:" +"`whatsnew311-optimizations`。" #: ../../whatsnew/3.11.rst:1346 msgid "Faster Startup" @@ -2332,9 +2338,9 @@ msgid "" "statically allocated by the interpreter. This reduces the steps in module " "execution process to:" msgstr "" -"在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的" -"\\ :ref:`程式碼物件 `\\ (和位元組碼)是由直譯器靜態分配的。這將" -"模組執行過程中的步驟減少為:" +"在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的\\ :" +"ref:`程式碼物件 `\\ (和位元組碼)是由直譯器靜態分配的。這將模組" +"執行過程中的步驟減少為:" #: ../../whatsnew/3.11.rst:1367 msgid "Statically allocated code object -> Evaluate" @@ -2390,10 +2396,10 @@ msgstr "" #: ../../whatsnew/3.11.rst:1396 msgid "" "Old-style :ref:`frame objects ` are now created only when " -"requested by debuggers or by Python introspection functions such " -"as :func:`sys._getframe` and :func:`inspect.currentframe`. For most user " -"code, no frame objects are created at all. As a result, nearly all Python " -"functions calls have sped up significantly. We measured a 3-7% speedup in " +"requested by debuggers or by Python introspection functions such as :func:" +"`sys._getframe` and :func:`inspect.currentframe`. For most user code, no " +"frame objects are created at all. As a result, nearly all Python functions " +"calls have sped up significantly. We measured a 3-7% speedup in " "pyperformance." msgstr "" "舊式\\ :ref:`幀物件 `\\ 現在僅在除錯器或 Python 自我檢查函式" @@ -2433,14 +2439,13 @@ msgid "" "Most Python function calls now consume no C stack space, speeding them up. " "In simple recursive functions like fibonacci or factorial, we observed a " "1.7x speedup. This also means recursive functions can recurse significantly " -"deeper (if the user increases the recursion limit " -"with :func:`sys.setrecursionlimit`). We measured a 1-3% improvement in " -"pyperformance." +"deeper (if the user increases the recursion limit with :func:`sys." +"setrecursionlimit`). We measured a 1-3% improvement in pyperformance." msgstr "" "現在大多數 Python 函式的呼叫因為不會佔用 C 堆疊空間而被加速。在斐波那契 " "(fibonacci) 或階乘等簡單遞迴函式中,觀察到 1.7 倍的加速。這也意味著遞迴函式可" -"以遞迴得更深(如果使用者有增加\\ :func:`遞迴限制 " -"`\\ )。我們在 pyperformance 測得 1-3% 的改進。" +"以遞迴得更深(如果使用者有增加\\ :func:`遞迴限制 `\\ )。我們在 pyperformance 測得 1-3% 的改進。" #: ../../whatsnew/3.11.rst:1427 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" @@ -2468,8 +2473,8 @@ msgid "" "more specialized one. This specialized operation uses fast paths available " "only to those use cases/types, which generally outperform their generic " "counterparts. This also brings in another concept called *inline caching*, " -"where Python caches the results of expensive operations directly in " -"the :term:`bytecode`." +"where Python caches the results of expensive operations directly in the :" +"term:`bytecode`." msgstr "" "在執行環境,Python 將嘗試在執行中的程式碼內尋找常用模式和型別穩定,然後 " "Python 將用更特化的操作替換目前操作。這種特化操作運用了僅適用於那些用例/型別" @@ -2501,13 +2506,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:1457 msgid "" -"(PEP written by Mark Shannon, with ideas inspired by Stefan Brunthaler. " -"See :pep:`659` for more information. Implementation by Mark Shannon and " -"Brandt Bucher, with additional help from Irit Katriel and Dennis Sweeney.)" +"(PEP written by Mark Shannon, with ideas inspired by Stefan Brunthaler. See :" +"pep:`659` for more information. Implementation by Mark Shannon and Brandt " +"Bucher, with additional help from Irit Katriel and Dennis Sweeney.)" msgstr "" -"(PEP 由 Mark Shannon 撰寫、概念啟發自 Stefan Brunthaler。詳情請" -"見 :pep:`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis " -"Sweeney 亦提供了額外的幫助。)" +"(PEP 由 Mark Shannon 撰寫、概念啟發自 Stefan Brunthaler。詳情請見 :pep:" +"`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis Sweeney " +"亦提供了額外的幫助。)" #: ../../whatsnew/3.11.rst:1465 msgid "Operation" @@ -2547,9 +2552,9 @@ msgstr "``x * x``" #: ../../whatsnew/3.11.rst:1468 msgid "" -"Binary add, multiply and subtract for common types such " -"as :class:`int`, :class:`float` and :class:`str` take custom fast paths for " -"their underlying types." +"Binary add, multiply and subtract for common types such as :class:`int`, :" +"class:`float` and :class:`str` take custom fast paths for their underlying " +"types." msgstr "" "常見型別如 :class:`int`、:class:`float` 與 :class:`str` 的二元加法、乘法與減" "法,為底層型別採取了特製的快速路徑。" @@ -2572,16 +2577,16 @@ msgstr "``a[i]``" #: ../../whatsnew/3.11.rst:1474 msgid "" -"Subscripting container types such as :class:`list`, :class:`tuple` " -"and :class:`dict` directly index the underlying data structures." +"Subscripting container types such as :class:`list`, :class:`tuple` and :" +"class:`dict` directly index the underlying data structures." msgstr "" "下標容器型別如 :class:`list`、:class:`tuple` 和 :class:`dict` 直接索引底層的" "資料結構。" #: ../../whatsnew/3.11.rst:1478 msgid "" -"Subscripting custom :meth:`~object.__getitem__` is also inlined similar " -"to :ref:`inline-calls`." +"Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" +"ref:`inline-calls`." msgstr "" "下標自定義 :meth:`~object.__getitem__` 也是行內的,類似於 :ref:`inline-" "calls`。" @@ -2624,8 +2629,8 @@ msgstr "``C(arg)``" #: ../../whatsnew/3.11.rst:1484 msgid "" -"Calls to common builtin (C) functions and types such as :func:`len` " -"and :class:`str` directly call their underlying C version. This avoids going " +"Calls to common builtin (C) functions and types such as :func:`len` and :" +"class:`str` directly call their underlying C version. This avoids going " "through the internal calling convention." msgstr "" "常見內建 (C) 函式和型別的呼叫,例如 :func:`len` 和 :class:`str`,會直接呼叫它" @@ -2763,8 +2768,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:1513 msgid "" "A similar optimization already existed since Python 3.10. 3.11 specializes " -"for more forms. Furthermore, all attribute loads should be sped up " -"by :issue:`45947`." +"for more forms. Furthermore, all attribute loads should be sped up by :issue:" +"`45947`." msgstr "" "類似的最佳化自從 Python 3.10 就存在。3.11 特別處理了更多形式。此外,所有屬性" "載入也被 :issue:`45947` 所加速。" @@ -2780,17 +2785,17 @@ msgid "" "Mark Shannon in :issue:`45340` and :issue:`40116`.)" msgstr "" "物件現在因為使用了惰性建立的物件命名空間所以需要更少的記憶體。它們的命名空間" -"字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` " -"和 :issue:`40116` 貢獻。 )" +"字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` 和 :issue:" +"`40116` 貢獻。 )" #: ../../whatsnew/3.11.rst:1527 msgid "" -"\"Zero-cost\" exceptions are implemented, eliminating the cost " -"of :keyword:`try` statements when no exception is raised. (Contributed by " -"Mark Shannon in :issue:`40222`.)" +"\"Zero-cost\" exceptions are implemented, eliminating the cost of :keyword:" +"`try` statements when no exception is raised. (Contributed by Mark Shannon " +"in :issue:`40222`.)" msgstr "" -"實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時" -"的 :keyword:`try` 陳述式開銷。(由 Mark Shannon 於 :issue:`40222` 貢獻。)" +"實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時的 :keyword:" +"`try` 陳述式開銷。(由 Mark Shannon 於 :issue:`40222` 貢獻。)" #: ../../whatsnew/3.11.rst:1531 msgid "" @@ -2806,9 +2811,9 @@ msgid "" ":mod:`re`'s regular expression matching engine has been partially " "refactored, and now uses computed gotos (or \"threaded code\") on supported " "platforms. As a result, Python 3.11 executes the `pyperformance regular " -"expression benchmarks `_ up to 10% faster than Python 3.10. (Contributed " -"by Brandt Bucher in :gh:`91404`.)" +"expression benchmarks `_ up to 10% faster than Python 3.10. (Contributed by Brandt " +"Bucher in :gh:`91404`.)" msgstr "" ":mod:`re` 的正規表示式比對引擎部分被重構,且現在會有支援的平台上使用 " "computed gotos(或者「執行緒程式碼 (threaded code)」),因此 Python 3.11 在執" @@ -2943,9 +2948,9 @@ msgstr ":opcode:`MAKE_CELL` 被用於建立 :ref:`cell-objects`。" #: ../../whatsnew/3.11.rst:1632 msgid "" -":opcode:`CHECK_EG_MATCH` and :opcode:`!PREP_RERAISE_STAR`, to handle " -"the :ref:`new exception groups and except* ` added " -"in :pep:`654`." +":opcode:`CHECK_EG_MATCH` and :opcode:`!PREP_RERAISE_STAR`, to handle the :" +"ref:`new exception groups and except* ` added in :pep:" +"`654`." msgstr "" ":opcode:`CHECK_EG_MATCH` 和 :opcode:`!PREP_RERAISE_STAR`,處理 :pep:`654` 所" "加入的\\ :ref:`新增例外群組和 except* `。" @@ -3186,12 +3191,11 @@ msgstr "語言/內建" #: ../../whatsnew/3.11.rst:1720 msgid "" "Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`) is " -"now deprecated. It can no longer be used to wrap other descriptors such " -"as :class:`property`. The core design of this feature was flawed and caused " -"a number of downstream problems. To \"pass-through\" " -"a :class:`classmethod`, consider using the :attr:`!__wrapped__` attribute " -"that was added in Python 3.10. (Contributed by Raymond Hettinger " -"in :gh:`89519`.)" +"now deprecated. It can no longer be used to wrap other descriptors such as :" +"class:`property`. The core design of this feature was flawed and caused a " +"number of downstream problems. To \"pass-through\" a :class:`classmethod`, " +"consider using the :attr:`!__wrapped__` attribute that was added in Python " +"3.10. (Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" "鏈接 :class:`classmethod` 描述器(在 :issue:`19072` 中引入)現已棄用。它不能" "再用於包裝其他描述器,例如 :class:`property`。此功能的核心設計存在缺陷,並導" @@ -3203,26 +3207,26 @@ msgstr "" msgid "" "Octal escapes in string and bytes literals with values larger than ``0o377`` " "(255 in decimal) now produce a :exc:`DeprecationWarning`. In a future Python " -"version, they will raise a :exc:`SyntaxWarning` and eventually " -"a :exc:`SyntaxError`. (Contributed by Serhiy Storchaka in :gh:`81548`.)" +"version, they will raise a :exc:`SyntaxWarning` and eventually a :exc:" +"`SyntaxError`. (Contributed by Serhiy Storchaka in :gh:`81548`.)" msgstr "" "值大於 ``0o377``\\(十進位為 255)的字串和位元組文本值 (bytes literal) 中的八" "進位跳脫 (octal escape) 現在會產生 :exc:`DeprecationWarning`。在未來的 " -"Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一" -"個 :exc:`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" +"Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一個 :exc:" +"`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" #: ../../whatsnew/3.11.rst:1734 msgid "" "The delegation of :func:`int` to :meth:`~object.__trunc__` is now " "deprecated. Calling ``int(a)`` when ``type(a)`` implements :meth:`!" "__trunc__` but not :meth:`~object.__int__` or :meth:`~object.__index__` now " -"raises a :exc:`DeprecationWarning`. (Contributed by Zackery Spytz " -"in :issue:`44977`.)" +"raises a :exc:`DeprecationWarning`. (Contributed by Zackery Spytz in :issue:" +"`44977`.)" msgstr "" ":func:`int` 到 :meth:`~object.__trunc__` 的授權 (delegation) 現已棄用。當 " -"``type(a)`` 有實作 :meth:`!__trunc__` 但沒有 :meth:`~object.__int__` " -"或 :meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一" -"個 :exc:`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" +"``type(a)`` 有實作 :meth:`!__trunc__` 但沒有 :meth:`~object.__int__` 或 :" +"meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一個 :exc:" +"`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" #: ../../whatsnew/3.11.rst:1744 msgid "Modules" @@ -3312,8 +3316,8 @@ msgstr ":mod:`!sunau`" #: ../../whatsnew/3.11.rst:1761 msgid "" -"(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner " -"in :gh:`68966`.)" +"(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" +"`68966`.)" msgstr "" "(由 Brett Cannon 和 Victor Stinner 分別於 :issue:`47061` 與 :gh:`68966` 中所" "貢獻。)" @@ -3342,8 +3346,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:1774 msgid "" "Undocumented modules :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!" -"sre_parse` are now deprecated. (Contributed by Serhiy Storchaka " -"in :issue:`47152`.)" +"sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" +"`47152`.)" msgstr "" "未被記錄於文件中的 :mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!" "sre_parse` 模組現在已被棄用。(由 Serhiy Storchaka 在 :issue:`47152` 中貢" @@ -3383,16 +3387,15 @@ msgid "" ":class:`!configparser.LegacyInterpolation` has been deprecated in the " "docstring since Python 3.2, and is not listed in the :mod:`configparser` " "documentation. It now emits a :exc:`DeprecationWarning` and will be removed " -"in Python 3.13. Use :class:`configparser.BasicInterpolation` " -"or :class:`configparser.ExtendedInterpolation` instead. (Contributed by Hugo " -"van Kemenade in :issue:`46607`.)" +"in Python 3.13. Use :class:`configparser.BasicInterpolation` or :class:" +"`configparser.ExtendedInterpolation` instead. (Contributed by Hugo van " +"Kemenade in :issue:`46607`.)" msgstr "" ":class:`!configparser.LegacyInterpolation` 自 Python 3.2 起已在文件字串中棄" -"用,並且未在 :mod:`configparser` 文件中列出。它現在會發出一" -"個 :exc:`DeprecationWarning` 並將在 Python 3.13 中刪除。請改" -"用 :class:`configparser.BasicInterpolation` " -"或 :class:`configparser.ExtendedInterpolation`。(由 Hugo van Kemenade " -"在 :issue:`46607` 中貢獻。)" +"用,並且未在 :mod:`configparser` 文件中列出。它現在會發出一個 :exc:" +"`DeprecationWarning` 並將在 Python 3.13 中刪除。請改用 :class:`configparser." +"BasicInterpolation` 或 :class:`configparser.ExtendedInterpolation`。(由 " +"Hugo van Kemenade 在 :issue:`46607` 中貢獻。)" #: ../../whatsnew/3.11.rst:1801 msgid "" @@ -3436,10 +3439,9 @@ msgstr ":func:`!importlib.resources.path`" #: ../../whatsnew/3.11.rst:1814 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " -"removed in Python 3.15. " -"Use :func:`locale.setlocale`, :func:`locale.getpreferredencoding(False) " -"` and :func:`locale.getlocale` functions " -"instead. (Contributed by Victor Stinner in :gh:`90817`.)" +"removed in Python 3.15. Use :func:`locale.setlocale`, :func:`locale." +"getpreferredencoding(False) ` and :func:`locale." +"getlocale` functions instead. (Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" ":func:`locale.getdefaultlocale` 函式已被棄用且將於 Python 3.15 中移除。請改" "用 :func:`locale.setlocale`、:func:`locale.getpreferredencoding(False) " @@ -3453,18 +3455,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" ":func:`!locale.resetlocale` 函式已棄用並將於 Python 3.13 中移除,請改用 " -"``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner " -"於 :gh:`90817` 中所貢獻。)" +"``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner 於 :gh:" +"`90817` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1824 msgid "" "Stricter rules will now be applied for numerical group references and group " "names in :ref:`regular expressions `. Only sequences of ASCII " -"digits will now be accepted as a numerical reference, and the group name " -"in :class:`bytes` patterns and replacement strings can only contain ASCII " +"digits will now be accepted as a numerical reference, and the group name in :" +"class:`bytes` patterns and replacement strings can only contain ASCII " "letters, digits and underscores. For now, a deprecation warning is raised " -"for syntax violating these rules. (Contributed by Serhiy Storchaka " -"in :gh:`91760`.)" +"for syntax violating these rules. (Contributed by Serhiy Storchaka in :gh:" +"`91760`.)" msgstr "" "現在將對\\ :ref:`規則運算式 `\\ 中的數值群組參照 (numerical group " "references) 和群組名稱套用更嚴格的規則。現在只接受 ASCII 數字序列作為數值參" @@ -3482,21 +3484,21 @@ msgid "" msgstr "" "在 :mod:`re` 模組中,:func:`!re.template` 函式和相應的 :const:`!re.TEMPLATE` " "和 :const:`!re.T` 旗標被棄用,因為它們沒被記錄於文件中並且缺乏明顯的目的。它" -"們將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok " -"在 :gh:`92728` 中貢獻。)" +"們將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" +"`92728` 中貢獻。)" #: ../../whatsnew/3.11.rst:1838 msgid "" ":func:`!turtle.settiltangle` has been deprecated since Python 3.1; it now " -"emits a deprecation warning and will be removed in Python 3.13. " -"Use :func:`turtle.tiltangle` instead (it was earlier incorrectly marked as " -"deprecated, and its docstring is now corrected). (Contributed by Hugo van " -"Kemenade in :issue:`45837`.)" +"emits a deprecation warning and will be removed in Python 3.13. Use :func:" +"`turtle.tiltangle` instead (it was earlier incorrectly marked as deprecated, " +"and its docstring is now corrected). (Contributed by Hugo van Kemenade in :" +"issue:`45837`.)" msgstr "" ":func:`!turtle.settiltangle` 自 Python 3.1 以來已被棄用;它現在會發出棄用警" "告,並將在 Python 3.13 中刪除。請改用 :func:`turtle.tiltangle`\\ (它之前被錯" -"誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade " -"在 :issue:`45837` 中貢獻。)" +"誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade 在 :issue:" +"`45837` 中貢獻。)" #: ../../whatsnew/3.11.rst:1844 msgid "" @@ -3525,18 +3527,18 @@ msgid "" "itself. (Contributed by Donghee Na in :issue:`42255`.)" msgstr "" ":class:`!webbrowser.MacOSX` 已被棄用且將於 Python 3.13 中移除。它並沒有被測試" -"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Donghee Na " -"於 :issue:`42255`。)" +"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Donghee Na 於 :" +"issue:`42255`。)" #: ../../whatsnew/3.11.rst:1858 msgid "" -"The behavior of returning a value from a :class:`~unittest.TestCase` " -"and :class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " +"The behavior of returning a value from a :class:`~unittest.TestCase` and :" +"class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " "default ``None`` value) is now deprecated." msgstr "" -"回傳從 :class:`~unittest.TestCase` " -"和 :class:`~unittest.IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除" -"外)給定值的行為現已棄用。" +"回傳從 :class:`~unittest.TestCase` 和 :class:`~unittest." +"IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除外)給定值的行為現已棄" +"用。" #: ../../whatsnew/3.11.rst:1862 msgid "" @@ -3870,16 +3872,15 @@ msgstr "被移除的 C API 被\\ :ref:`獨立列出 ` #: ../../whatsnew/3.11.rst:1955 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " -"generator-based coroutines to be compatible " -"with :keyword:`async` / :keyword:`await` code. The function has been " -"deprecated since Python 3.8 and the removal was initially scheduled for " -"Python 3.10. Use :keyword:`async def` instead. (Contributed by Illia " -"Volochii in :issue:`43216`.)" +"generator-based coroutines to be compatible with :keyword:`async` / :keyword:" +"`await` code. The function has been deprecated since Python 3.8 and the " +"removal was initially scheduled for Python 3.10. Use :keyword:`async def` " +"instead. (Contributed by Illia Volochii in :issue:`43216`.)" msgstr "" "刪除了 :func:`!@asyncio.coroutine` :term:`decorator` 使遺留的基於生成器的協" "程 (generator-based coroutine) 與 :keyword:`async` / :keyword:`await` 程式碼" -"相容。該函式自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改" -"用 :keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" +"相容。該函式自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改用 :" +"keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" #: ../../whatsnew/3.11.rst:1962 msgid "" @@ -3887,30 +3888,29 @@ msgid "" "generator-based coroutine objects in the debug mode. (Contributed by Illia " "Volochii in :issue:`43216`.)" msgstr "" -"移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!" -"asyncio.coroutines.CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢" -"獻。)" +"移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!asyncio.coroutines." +"CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢獻。)" #: ../../whatsnew/3.11.rst:1966 msgid "" -"Due to significant security concerns, the *reuse_address* parameter " -"of :meth:`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is " -"now entirely removed. This is because of the behavior of the socket option " -"``SO_REUSEADDR`` in UDP. (Contributed by Hugo van Kemenade " -"in :issue:`45129`.)" +"Due to significant security concerns, the *reuse_address* parameter of :meth:" +"`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " +"entirely removed. This is because of the behavior of the socket option " +"``SO_REUSEADDR`` in UDP. (Contributed by Hugo van Kemenade in :issue:" +"`45129`.)" msgstr "" -"因為有重大的安全性考量,Python 3.9 中停用" -"的 :meth:`asyncio.loop.create_datagram_endpoint` 之 *reuse_address* 參數目前" -"已經移除。這是因為 UDP socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo " -"van Kemenade 於 :issue:`45129` 中貢獻。)" +"因為有重大的安全性考量,Python 3.9 中停用的 :meth:`asyncio.loop." +"create_datagram_endpoint` 之 *reuse_address* 參數目前已經移除。這是因為 UDP " +"socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo van Kemenade 於 :issue:" +"`45129` 中貢獻。)" #: ../../whatsnew/3.11.rst:1972 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" msgstr "" -"移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似" -"的 :mod:`binascii` 函式也一併被移除:" +"移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似的 :mod:" +"`binascii` 函式也一併被移除:" #: ../../whatsnew/3.11.rst:1975 msgid ":func:`!binascii.a2b_hqx`" @@ -3948,34 +3948,32 @@ msgstr "" #: ../../whatsnew/3.11.rst:1988 msgid "" -"Removed the :meth:`~object.__getitem__` methods " -"of :class:`xml.dom.pulldom.DOMEventStream`, :class:`wsgiref.util.FileWrapper` " -"and :class:`fileinput.FileInput`, deprecated since Python 3.9. (Contributed " -"by Hugo van Kemenade in :issue:`45132`.)" +"Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." +"DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." +"FileInput`, deprecated since Python 3.9. (Contributed by Hugo van Kemenade " +"in :issue:`45132`.)" msgstr "" -"將 :class:`xml.dom.pulldom.DOMEventStream`、:class:`wsgiref.util.FileWrapper` " -"和 :class:`fileinput.FileInput` 自 Python 3.9 中棄用" -"的 :meth:`~object.__getitem__` 方法移除。(由 Hugo van Kemenade " -"在 :issue:`45132` 中貢獻。)" +"將 :class:`xml.dom.pulldom.DOMEventStream`、:class:`wsgiref.util." +"FileWrapper` 和 :class:`fileinput.FileInput` 自 Python 3.9 中棄用的 :meth:" +"`~object.__getitem__` 方法移除。(由 Hugo van Kemenade 在 :issue:`45132` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:1993 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" -"ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed " -"the :func:`!bind_textdomain_codeset` function, the :meth:`!" -"NullTranslations.output_charset` and :meth:`!" -"NullTranslations.set_output_charset` methods, and the *codeset* parameter " -"of :func:`!translation` and :func:`!install`, since they are only used for " -"the :func:`!l*gettext` functions. (Contributed by Donghee Na and Serhiy " -"Storchaka in :issue:`44235`.)" -msgstr "" -"刪除了已棄用的 :mod:`gettext` 函式 :func:`!lgettext`、:func:`!" -"ldgettext`、:func:`!lngettext` 和 :func:`!ldngettext`,也刪除了 :func:`!" -"bind_textdomain_codeset` 函式、:meth:`!NullTranslations.output_charset` " -"和 :meth:`!NullTranslations.set_output_charset` 方法,以及 :func:`!" -"translation` 和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!" -"l*gettext` 函式。(由 Donghee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢" -"獻。)" +"ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" +"func:`!bind_textdomain_codeset` function, the :meth:`!NullTranslations." +"output_charset` and :meth:`!NullTranslations.set_output_charset` methods, " +"and the *codeset* parameter of :func:`!translation` and :func:`!install`, " +"since they are only used for the :func:`!l*gettext` functions. (Contributed " +"by Donghee Na and Serhiy Storchaka in :issue:`44235`.)" +msgstr "" +"刪除了已棄用的 :mod:`gettext` 函式 :func:`!lgettext`、:func:`!ldgettext`、:" +"func:`!lngettext` 和 :func:`!ldngettext`,也刪除了 :func:`!" +"bind_textdomain_codeset` 函式、:meth:`!NullTranslations.output_charset` 和 :" +"meth:`!NullTranslations.set_output_charset` 方法,以及 :func:`!translation` " +"和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" +"式。(由 Donghee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" #: ../../whatsnew/3.11.rst:2003 msgid "Removed from the :mod:`inspect` module:" @@ -3983,31 +3981,30 @@ msgstr "於 :mod:`inspect` 模組中移除:" #: ../../whatsnew/3.11.rst:2005 msgid "" -"The :func:`!getargspec` function, deprecated since Python 3.0; " -"use :func:`inspect.signature` or :func:`inspect.getfullargspec` instead." +"The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" +"`inspect.signature` or :func:`inspect.getfullargspec` instead." msgstr "" -"Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` " -"或 :func:`inspect.getfullargspec`。" +"Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` 或 :" +"func:`inspect.getfullargspec`。" #: ../../whatsnew/3.11.rst:2008 msgid "" -"The :func:`!formatargspec` function, deprecated since Python 3.5; use " -"the :func:`inspect.signature` function or the :class:`inspect.Signature` " -"object directly." +"The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" +"func:`inspect.signature` function or the :class:`inspect.Signature` object " +"directly." msgstr "" -"Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接" -"用 :func:`inspect.signature` 函式或 :class:`inspect.Signature` 物件。" +"Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接用 :func:`inspect." +"signature` 函式或 :class:`inspect.Signature` 物件。" #: ../../whatsnew/3.11.rst:2012 msgid "" -"The undocumented :meth:`!Signature.from_builtin` and :meth:`!" -"Signature.from_function` methods, deprecated since Python 3.5; use " -"the :meth:`Signature.from_callable() ` " -"method instead." +"The undocumented :meth:`!Signature.from_builtin` and :meth:`!Signature." +"from_function` methods, deprecated since Python 3.5; use the :meth:" +"`Signature.from_callable() ` method instead." msgstr "" -"Python 3.5 中停用且沒有被紀錄於文件上的 :meth:`!Signature.from_builtin` " -"和 :meth:`!Signature.from_function` 方法;改" -"用 :meth:`Signature.from_callable() ` 方法。" +"Python 3.5 中停用且沒有被紀錄於文件上的 :meth:`!Signature.from_builtin` 和 :" +"meth:`!Signature.from_function` 方法;改用 :meth:`Signature.from_callable() " +"` 方法。" #: ../../whatsnew/3.11.rst:2017 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" @@ -4015,9 +4012,9 @@ msgstr "(由 Hugo van Kemenade 於 :issue:`45320` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2019 msgid "" -"Removed the :meth:`~object.__class_getitem__` method " -"from :class:`pathlib.PurePath`, because it was not used and added by mistake " -"in previous versions. (Contributed by Nikita Sobolev in :issue:`46483`.)" +"Removed the :meth:`~object.__class_getitem__` method from :class:`pathlib." +"PurePath`, because it was not used and added by mistake in previous " +"versions. (Contributed by Nikita Sobolev in :issue:`46483`.)" msgstr "" "自 :class:`pathlib.PurePath` 中移除 :meth:`~object.__class_getitem__` 方法," "因為它是前一版本中誤加且沒被使用。(由 Nikita Sobolev 於 :issue:`46483` 中所" @@ -4034,8 +4031,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:2028 msgid "" -"Removed the deprecated :meth:`!split` method of :class:`!" -"_tkinter.TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" +"Removed the deprecated :meth:`!split` method of :class:`!_tkinter." +"TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" msgstr "" "移除 :class:`!_tkinter.TkappType` 已被棄用的 :meth:`!split` 方法。(由 " "Erlend E. Aasland 於 :issue:`38371` 貢獻。)" @@ -4068,8 +4065,8 @@ msgid "" "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " "been removed." msgstr "" -"移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應" -"的 :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" +"移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應的 :" +"c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" #: ../../whatsnew/3.11.rst:2045 msgid "" @@ -4101,31 +4098,31 @@ msgstr "C API 的移植被\\ :ref:`獨立列出 `。" #: ../../whatsnew/3.11.rst:2063 msgid "" -":func:`open`, :func:`io.open`, :func:`codecs.open` " -"and :class:`fileinput.FileInput` no longer accept ``'U'`` (\"universal " -"newline\") in the file mode. In Python 3, \"universal newline\" mode is used " -"by default whenever a file is opened in text mode, and the ``'U'`` flag has " -"been deprecated since Python 3.3. The :ref:`newline parameter ` to these functions controls how universal newlines work. " -"(Contributed by Victor Stinner in :issue:`37330`.)" -msgstr "" -":func:`open`、:func:`io.open`、:func:`codecs.open` " -"和 :class:`fileinput.FileInput` 不再接受 ``'U'``\\ (\"universal newline\"," -"通用換行符)文件模式。在 Python 3 中,每當以文本模式 (text mode) 打開檔案時," -"預設情況下會使用「通用換行符」模式,並且自 Python 3.3 以來就不推薦使用 " -"``'U'`` 旗標。這些函式的 :ref:`newline 參數 `\\ 控制" -"了通用換行符的作用方式。(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" +":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." +"FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " +"mode. In Python 3, \"universal newline\" mode is used by default whenever a " +"file is opened in text mode, and the ``'U'`` flag has been deprecated since " +"Python 3.3. The :ref:`newline parameter ` to these " +"functions controls how universal newlines work. (Contributed by Victor " +"Stinner in :issue:`37330`.)" +msgstr "" +":func:`open`、:func:`io.open`、:func:`codecs.open` 和 :class:`fileinput." +"FileInput` 不再接受 ``'U'``\\ (\"universal newline\",通用換行符)文件模式。" +"在 Python 3 中,每當以文本模式 (text mode) 打開檔案時,預設情況下會使用「通用" +"換行符」模式,並且自 Python 3.3 以來就不推薦使用 ``'U'`` 旗標。這些函式的 :" +"ref:`newline 參數 `\\ 控制了通用換行符的作用方式。" +"(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" #: ../../whatsnew/3.11.rst:2072 msgid "" -":class:`ast.AST` node positions are now validated when provided " -"to :func:`compile` and other related functions. If invalid positions are " -"detected, a :exc:`ValueError` will be raised. (Contributed by Pablo Galindo " -"in :gh:`93351`)" +":class:`ast.AST` node positions are now validated when provided to :func:" +"`compile` and other related functions. If invalid positions are detected, a :" +"exc:`ValueError` will be raised. (Contributed by Pablo Galindo in :gh:" +"`93351`)" msgstr "" ":class:`ast.AST` 節點位置現在會在提供給 :func:`compile` 和其他相關函式時被驗" -"證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo " -"在 :gh:`93351` 中貢獻)" +"證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo 在 :" +"gh:`93351` 中貢獻)" #: ../../whatsnew/3.11.rst:2076 msgid "" @@ -4133,23 +4130,21 @@ msgid "" "executors to :meth:`asyncio.loop.set_default_executor` following a " "deprecation in Python 3.8. (Contributed by Illia Volochii in :issue:`43234`.)" msgstr "" -"在 Python 3.8 中棄用後,禁止將" -"非 :class:`concurrent.futures.ThreadPoolExecutor` 執行器傳遞" -"給 :meth:`asyncio.loop.set_default_executor`。(由 Illia Volochii " -"在 :issue:`43234` 中貢獻。)" +"在 Python 3.8 中棄用後,禁止將非 :class:`concurrent.futures." +"ThreadPoolExecutor` 執行器傳遞給 :meth:`asyncio.loop.set_default_executor`。" +"(由 Illia Volochii 在 :issue:`43234` 中貢獻。)" #: ../../whatsnew/3.11.rst:2081 msgid "" -":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` " -"and :class:`calendar.LocaleHTMLCalendar` classes now " -"use :func:`locale.getlocale`, instead of " -"using :func:`locale.getdefaultlocale`, if no locale is specified. " +":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" +"`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " +"instead of using :func:`locale.getdefaultlocale`, if no locale is specified. " "(Contributed by Victor Stinner in :issue:`46659`.)" msgstr "" -":mod:`calendar`::class:`calendar.LocaleTextCalendar` " -"和 :class:`calendar.LocaleHTMLCalendar` 類別如果沒有指定語言環境,現在會使" -"用 :func:`locale.getlocale` 而非 :func:`locale.getdefaultlocale`。(由 " -"Victor Stinner 在 :issue:`46659` 中貢獻。)" +":mod:`calendar`::class:`calendar.LocaleTextCalendar` 和 :class:`calendar." +"LocaleHTMLCalendar` 類別如果沒有指定語言環境,現在會使用 :func:`locale." +"getlocale` 而非 :func:`locale.getdefaultlocale`。(由 Victor Stinner 在 :" +"issue:`46659` 中貢獻。)" #: ../../whatsnew/3.11.rst:2087 msgid "" @@ -4164,20 +4159,19 @@ msgstr "" msgid "" "The *population* parameter of :func:`random.sample` must be a sequence, and " "automatic conversion of :class:`set`\\s to :class:`list`\\s is no longer " -"supported. Also, if the sample size is larger than the population size, " -"a :exc:`ValueError` is raised. (Contributed by Raymond Hettinger " -"in :issue:`40465`.)" +"supported. Also, if the sample size is larger than the population size, a :" +"exc:`ValueError` is raised. (Contributed by Raymond Hettinger in :issue:" +"`40465`.)" msgstr "" -":func:`random.sample` 的 *population* 參數必須是一個序列,不再支" -"援 :class:`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小," -"則會引發 :exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢" -"獻。)" +":func:`random.sample` 的 *population* 參數必須是一個序列,不再支援 :class:" +"`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小,則會引發 :" +"exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢獻。)" #: ../../whatsnew/3.11.rst:2097 msgid "" "The *random* optional parameter of :func:`random.shuffle` was removed. It " -"was previously an arbitrary random function to use for the shuffle; " -"now, :func:`random.random` (its previous default) will always be used." +"was previously an arbitrary random function to use for the shuffle; now, :" +"func:`random.random` (its previous default) will always be used." msgstr "" "刪除了 :func:`random.shuffle` 的 *random* 可選參數。它以前是用於隨機排列 " "(shuffle) 的任意隨機函式;現在都會使用 :func:`random.random`\\ (這是它以前的" @@ -4187,8 +4181,8 @@ msgstr "" msgid "" "In :mod:`re` :ref:`re-syntax`, global inline flags (e.g. ``(?i)``) can now " "only be used at the start of regular expressions. Using them elsewhere has " -"been deprecated since Python 3.6. (Contributed by Serhiy Storchaka " -"in :issue:`47066`.)" +"been deprecated since Python 3.6. (Contributed by Serhiy Storchaka in :issue:" +"`47066`.)" msgstr "" "在 :mod:`re` :ref:`re-syntax` 中,全域行內旗標(例如 ``(?i)``)現在只能在規則" "運算式的開頭使用。自 Python 3.6 以來,在其他地方使用它們已被棄用。(由 " @@ -4220,8 +4214,8 @@ msgid "" "limited subset of POSIX APIs; Python standard libraries features and modules " "related to networking, processes, threading, signals, mmap, and users/groups " "are not available or don't work. (Emscripten contributed by Christian Heimes " -"and Ethan Smith in :gh:`84461` and WASI contributed by Christian Heimes " -"in :gh:`90473`; platforms promoted in :gh:`95085`)" +"and Ethan Smith in :gh:`84461` and WASI contributed by Christian Heimes in :" +"gh:`90473`; platforms promoted in :gh:`95085`)" msgstr "" "CPython 現在有 :pep:`11` :pep:`Tier 3 支援 <11#tier-3>` 以用於交叉編譯至 " "`WebAssembly `_ 平台 `Emscripten `_ compiler and standard library. " "`Optional C11 features `_ are not required. " -"(Contributed by Victor Stinner in :issue:`46656`, :issue:`45440` " -"and :issue:`46640`.)" +"(Contributed by Victor Stinner in :issue:`46656`, :issue:`45440` and :issue:" +"`46640`.)" msgstr "" "`C11 `_ 編譯器與標準函式庫。`可選的 C11 " "特性 `_ (when available). :mod:`tkinter` now requires a pkg-config " "command to detect development settings for `Tcl/Tk`_ headers and libraries. " -"(Contributed by Christian Heimes and Erlend Egeberg Aasland " -"in :issue:`45847`, :issue:`45747`, and :issue:`45763`.)" +"(Contributed by Christian Heimes and Erlend Egeberg Aasland in :issue:" +"`45847`, :issue:`45747`, and :issue:`45763`.)" msgstr "" "大多數 stdlib 擴充模組的依賴套件、編譯器旗標 (compiler flag) 和鏈接器旗標 " "(linker flags) 現在可以透過 :program:`configure` 檢測出來。(當可用時)\\ " "`pkg-config `_ 會檢測" "出 libffi、libnsl、libsqlite3、zlib、bzip2、liblzma、libcrypt、Tcl/Tk 和 " "uuid 旗標。:mod:`tkinter` 現在需要一個 pkg-config 命令來檢測 `Tcl/Tk`_ 標頭檔" -"和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland " -"在 :issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" +"和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland 在 :" +"issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" #: ../../whatsnew/3.11.rst:2162 msgid "" @@ -4305,20 +4299,20 @@ msgstr "" msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " -"``--with-lto=thin``. (Contributed by Donghee Na and Brett Holman " -"in :issue:`44340`.)" +"``--with-lto=thin``. (Contributed by Donghee Na and Brett Holman in :issue:" +"`44340`.)" msgstr "" "CPython 現在可以透過將 ``thin`` 傳遞給 :option:`--with-lto`\\ (也就是 ``--" -"with-lto=thin``\\ )來以 `ThinLTO `_ 選項建置。(由 Donghee Na 與 Brett Holman 於 :issue:`44340` " -"中所貢獻。)" +"with-lto=thin``\\ )來以 `ThinLTO `_ 選項建置。(由 Donghee Na 與 Brett Holman 於 :issue:`44340` 中所貢" +"獻。)" #: ../../whatsnew/3.11.rst:2170 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`--without-freelists` can be used to disable all freelists " -"except empty tuple singleton. (Contributed by Christian Heimes " -"in :issue:`45522`.)" +"except empty tuple singleton. (Contributed by Christian Heimes in :issue:" +"`45522`.)" msgstr "" #: ../../whatsnew/3.11.rst:2175 @@ -4326,14 +4320,13 @@ msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " "test modules can be linked statically into a main binary or library. " -"(Contributed by Brett Cannon and Christian Heimes " -"in :issue:`45548`, :issue:`45570`, :issue:`45571`, and :issue:`43974`.)" +"(Contributed by Brett Cannon and Christian Heimes in :issue:`45548`, :issue:" +"`45570`, :issue:`45571`, and :issue:`43974`.)" msgstr "" "``Modules/Setup`` 和 ``Modules/makesetup`` 已得到改進和綁定。現在可以通過 " "``makesetup`` 建置擴充模組。除了一些測試模組外,所有模組都可以靜態鏈接到主要" -"的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes " -"在 :issue:`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢" -"獻。)" +"的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes 在 :issue:" +"`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢獻。)" #: ../../whatsnew/3.11.rst:2182 msgid "" @@ -4354,20 +4347,20 @@ msgid "" "build Python with RHEL 7's and CentOS 7's Tcl/Tk and OpenSSL." msgstr "" "RHEL 7 和 CentOS 7 上的開發套件並無提供 ``tcl.pc`` 和 ``tk.pc``;要使用 " -"``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``。目錄 ``Misc/rhel7`` 包含 " -"``.pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的" -"指示。" +"``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``。目錄 ``Misc/rhel7`` 包含 ``." +"pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的指" +"示。" #: ../../whatsnew/3.11.rst:2193 msgid "" "CPython will now use 30-bit digits by default for the Python :class:`int` " "implementation. Previously, the default was to use 30-bit digits on " "platforms with ``SIZEOF_VOID_P >= 8``, and 15-bit digits otherwise. It's " -"still possible to explicitly request use of 15-bit digits via either " -"the :option:`--enable-big-digits` option to the configure script or (for " -"Windows) the ``PYLONG_BITS_IN_DIGIT`` variable in ``PC/pyconfig.h``, but " -"this option may be removed at some point in the future. (Contributed by Mark " -"Dickinson in :issue:`45569`.)" +"still possible to explicitly request use of 15-bit digits via either the :" +"option:`--enable-big-digits` option to the configure script or (for Windows) " +"the ``PYLONG_BITS_IN_DIGIT`` variable in ``PC/pyconfig.h``, but this option " +"may be removed at some point in the future. (Contributed by Mark Dickinson " +"in :issue:`45569`.)" msgstr "" "CPython 現在預設使用 30-bit 數字來實作 Python :class:`int`。以前,在 " "``SIZEOF_VOID_P >= 8`` 的平台上預設使用 30-bit 數字,否則使用 15-bit 數字,但" @@ -4385,8 +4378,8 @@ msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -"新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi " -"於 :issue:`42035` 中所貢獻。)" +"新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi 於 :issue:" +"`42035` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2216 msgid "" @@ -4398,20 +4391,20 @@ msgstr "" #: ../../whatsnew/3.11.rst:2219 msgid "" -"Add new :c:func:`PyThreadState_EnterTracing` " -"and :c:func:`PyThreadState_LeaveTracing` functions to the limited C API to " -"suspend and resume tracing and profiling. (Contributed by Victor Stinner " -"in :issue:`43760`.)" +"Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" +"`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " +"resume tracing and profiling. (Contributed by Victor Stinner in :issue:" +"`43760`.)" msgstr "" -"在受限 C API (limited C API) 中新增 :c:func:`PyThreadState_EnterTracing` " -"和 :c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能" -"分析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" +"在受限 C API (limited C API) 中新增 :c:func:`PyThreadState_EnterTracing` 和 :" +"c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能分" +"析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" #: ../../whatsnew/3.11.rst:2224 msgid "" -"Added the :c:data:`Py_Version` constant which bears the same value " -"as :c:macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta " -"in :issue:`43931`.)" +"Added the :c:data:`Py_Version` constant which bears the same value as :c:" +"macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta in :issue:" +"`43931`.)" msgstr "" "添加了 :c:data:`Py_Version` 常數,其值與 :c:macro:`PY_VERSION_HEX` 相同。" "(由 Gabriele N. Tornetta 在 :issue:`43931` 中貢獻。)" @@ -4472,11 +4465,11 @@ msgstr ":c:func:`PyMemoryView_FromBuffer`" #: ../../whatsnew/3.11.rst:2243 msgid "" -":c:member:`~PyBufferProcs.bf_getbuffer` " -"and :c:member:`~PyBufferProcs.bf_releasebuffer` type slots" +":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." +"bf_releasebuffer` type slots" msgstr "" -":c:member:`~PyBufferProcs.bf_getbuffer` " -"與 :c:member:`~PyBufferProcs.bf_releasebuffer` 型別插槽 (type slot)" +":c:member:`~PyBufferProcs.bf_getbuffer` 與 :c:member:`~PyBufferProcs." +"bf_releasebuffer` 型別插槽 (type slot)" #: ../../whatsnew/3.11.rst:2246 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" @@ -4495,38 +4488,39 @@ msgstr "" #: ../../whatsnew/3.11.rst:2253 msgid "" -"Add new functions to pack and unpack C double (serialize and " -"deserialize): :c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`, :c:func:`PyFloat_Unpack2`, :c:func:`PyFloat_Unpack4` " -"and :c:func:`PyFloat_Unpack8`. (Contributed by Victor Stinner " -"in :issue:`46906`.)" +"Add new functions to pack and unpack C double (serialize and deserialize): :" +"c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`, :c:" +"func:`PyFloat_Unpack2`, :c:func:`PyFloat_Unpack4` and :c:func:" +"`PyFloat_Unpack8`. (Contributed by Victor Stinner in :issue:`46906`.)" msgstr "" -"新增函式以打包 (pack) 和取出 (unpack) C double(序列化和反序列" -"化)::c:func:`PyFloat_Pack2`、:c:func:`PyFloat_Pack4`、:c:func:`PyFloat_Pack8`、:c:func:`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` " -"和 :c:func:`PyFloat_Unpack8`。(由 Victor Stinner 在 :issue:`46906` 中貢" -"獻。)" +"新增函式以打包 (pack) 和取出 (unpack) C double(序列化和反序列化)::c:func:" +"`PyFloat_Pack2`、:c:func:`PyFloat_Pack4`、:c:func:`PyFloat_Pack8`、:c:func:" +"`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` 和 :c:func:`PyFloat_Unpack8`。" +"(由 Victor Stinner 在 :issue:`46906` 中貢獻。)" #: ../../whatsnew/3.11.rst:2259 msgid "" -"Add new functions to get frame object " -"attributes: :c:func:`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:`PyFrame_GetGlobals`, :c:func:`PyFrame_GetLasti`." +"Add new functions to get frame object attributes: :c:func:" +"`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:" +"`PyFrame_GetGlobals`, :c:func:`PyFrame_GetLasti`." msgstr "" -"新增取得幀物件屬性的函" -"式::c:func:`PyFrame_GetBuiltins`、:c:func:`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:`PyFrame_GetLasti`。" +"新增取得幀物件屬性的函式::c:func:`PyFrame_GetBuiltins`、:c:func:" +"`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:" +"`PyFrame_GetLasti`。" #: ../../whatsnew/3.11.rst:2263 msgid "" -"Added two new functions to get and set the active exception " -"instance: :c:func:`PyErr_GetHandledException` " -"and :c:func:`PyErr_SetHandledException`. These are alternatives " -"to :c:func:`PyErr_SetExcInfo()` and :c:func:`PyErr_GetExcInfo()` which work " -"with the legacy 3-tuple representation of exceptions. (Contributed by Irit " -"Katriel in :issue:`46343`.)" +"Added two new functions to get and set the active exception instance: :c:" +"func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " +"These are alternatives to :c:func:`PyErr_SetExcInfo()` and :c:func:" +"`PyErr_GetExcInfo()` which work with the legacy 3-tuple representation of " +"exceptions. (Contributed by Irit Katriel in :issue:`46343`.)" msgstr "" -"添加了兩個新函式來獲得和設置仍在作用的例外實" -"例::c:func:`PyErr_GetHandledException` " -"和 :c:func:`PyErr_SetHandledException`。這些是 :c:func:`PyErr_SetExcInfo()` " -"和 :c:func:`PyErr_GetExcInfo()` 的替代品,它們與例外的遺留三元組表示法一起作" -"用。(由 Irit Katriel 在 :issue:`46343` 中貢獻。)" +"添加了兩個新函式來獲得和設置仍在作用的例外實例::c:func:" +"`PyErr_GetHandledException` 和 :c:func:`PyErr_SetHandledException`。這些是 :" +"c:func:`PyErr_SetExcInfo()` 和 :c:func:`PyErr_GetExcInfo()` 的替代品,它們與" +"例外的遺留三元組表示法一起作用。(由 Irit Katriel 在 :issue:`46343` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:2270 msgid "" @@ -4547,11 +4541,11 @@ msgid "" "expected types. See :pep:`670` for more details. (Contributed by Victor " "Stinner and Erlend E. Aasland in :gh:`89653`.)" msgstr "" -"一些巨集已轉換為行內靜態函式以避免\\ `巨集陷阱 (macro pitfalls) `_。這種變化對用戶來說應該是透" -"明的,因為替換函式會將它們的引數轉換為預期的型別,以避免由於靜態型別檢查而產" -"生的編譯器警告。但是,當受限 C API 設置為 >=3.11 時,這些轉換不會完成,使用者" -"需要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。(由 " +"一些巨集已轉換為行內靜態函式以避免\\ `巨集陷阱 (macro pitfalls) `_。這種變化對用戶來說應該是透明" +"的,因為替換函式會將它們的引數轉換為預期的型別,以避免由於靜態型別檢查而產生" +"的編譯器警告。但是,當受限 C API 設置為 >=3.11 時,這些轉換不會完成,使用者需" +"要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。(由 " "Victor Stinner 和 Erlend E. Aasland 在 :gh:`89653` 中貢獻。)" #: ../../whatsnew/3.11.rst:2292 @@ -4612,17 +4606,17 @@ msgstr "" #: ../../whatsnew/3.11.rst:2318 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " -"``co_cellvars`` and ``co_freevars`` fields. Instead, " -"use :c:func:`PyCode_GetCode`, :c:func:`PyCode_GetVarnames`, :c:func:`PyCode_GetCellvars` " +"``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" +"`PyCode_GetCode`, :c:func:`PyCode_GetVarnames`, :c:func:`PyCode_GetCellvars` " "and :c:func:`PyCode_GetFreevars` respectively to access them via the C API. " "(Contributed by Brandt Bucher in :issue:`46841` and Ken Jin in :gh:`92154` " "and :gh:`94936`.)" msgstr "" ":c:type:`PyCodeObject` 不再會有 ``co_code``、``co_varnames``、" -"``co_cellvars`` 和 ``co_freevars`` 欄位。分別被改為透過 C API " -"的 :c:func:`PyCode_GetCode`、:c:func:`PyCode_GetVarnames`、:c:func:`PyCode_GetCellvars` " -"和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher " -"在 :issue:`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" +"``co_cellvars`` 和 ``co_freevars`` 欄位。分別被改為透過 C API 的 :c:func:" +"`PyCode_GetCode`、:c:func:`PyCode_GetVarnames`、:c:func:`PyCode_GetCellvars` " +"和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher 在 :issue:" +"`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" #: ../../whatsnew/3.11.rst:2326 msgid "" @@ -4721,25 +4715,24 @@ msgstr "" msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :c:macro:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function " -"(:c:member:`PyTypeObject.tp_traverse`). (Contributed by Victor Stinner " -"in :issue:`44263`.)" +"(:c:member:`PyTypeObject.tp_traverse`). (Contributed by Victor Stinner in :" +"issue:`44263`.)" msgstr "" "如果一個型別是以 :c:macro:`Py_TPFLAGS_HAVE_GC` 旗標來定義,但卻沒有遍歷函式 " -"(traverse function) (:c:member:`PyTypeObject.tp_traverse`)," -"那 :c:func:`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner " -"於 :issue:`44263` 中貢獻。)" +"(traverse function) (:c:member:`PyTypeObject.tp_traverse`),那 :c:func:" +"`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner 於 :issue:`44263` " +"中貢獻。)" #: ../../whatsnew/3.11.rst:2372 msgid "" "Heap types with the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " -"the :pep:`590` vectorcall protocol. Previously, this was only possible " -"for :ref:`static types `. (Contributed by Erlend E. Aasland " -"in :issue:`43908`)" +"the :pep:`590` vectorcall protocol. Previously, this was only possible for :" +"ref:`static types `. (Contributed by Erlend E. Aasland in :" +"issue:`43908`)" msgstr "" -"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼" -"承 :pep:`590` 向量呼叫協定 (vectorcall protocol)。以前這僅適用" -"於 :ref:`static types `。(由 Erlend E. Aasland " -"在 :issue:`43908` 中貢獻)。" +"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼承 :pep:" +"`590` 向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " +"`。(由 Erlend E. Aasland 在 :issue:`43908` 中貢獻)。" #: ../../whatsnew/3.11.rst:2377 msgid "" @@ -4749,9 +4742,9 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" "由於 :c:func:`Py_TYPE()` 更改為行內靜態函式 (inline static function),因此 " -"``Py_TYPE(obj) = new_type`` 必須替換為 ``Py_SET_TYPE(obj, new_type)``:參" -"見 :c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使" -"用這個巨集:" +"``Py_TYPE(obj) = new_type`` 必須替換為 ``Py_SET_TYPE(obj, new_type)``:參見 :" +"c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這" +"個巨集:" #: ../../whatsnew/3.11.rst:2383 msgid "" @@ -4779,9 +4772,9 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" "由於 :c:func:`Py_SIZE()` 更改為行內靜態函式,因此 ``Py_SIZE(obj) = " -"new_size`` 必須替換為 ``Py_SET_SIZE(obj, new_size)``:參" -"見 :c:func:`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使" -"用這個巨集:" +"new_size`` 必須替換為 ``Py_SET_SIZE(obj, new_size)``:參見 :c:func:" +"`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這個巨" +"集:" #: ../../whatsnew/3.11.rst:2397 msgid "" @@ -4799,9 +4792,9 @@ msgstr "" #: ../../whatsnew/3.11.rst:2405 msgid "" -"```` no longer includes the header files ````, " -"````, ```` and ```` when the ``Py_LIMITED_API`` " -"macro is set to ``0x030b0000`` (Python 3.11) or higher. C extensions should " +"```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " +"set to ``0x030b0000`` (Python 3.11) or higher. C extensions should " "explicitly include the header files after ``#include ``. " "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" @@ -4835,8 +4828,8 @@ msgid "" "Victor Stinner in :issue:`46007`.)" msgstr "" ":c:func:`!PyUnicode_CHECK_INTERNED` 巨集已從受限 C API 中移出,它從來沒辦法被" -"使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner " -"於 :issue:`46007` 中所貢獻。)" +"使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner 於 :issue:" +"`46007` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2424 msgid "" @@ -4946,8 +4939,8 @@ msgid "" "it may be faster." msgstr "" "``f_lasti``:使用 :c:func:`PyFrame_GetLasti`。程式碼中 ``f_lasti`` 有與 " -"``PyCode_Addr2Line()`` 同時使用的部分應該改" -"用 :c:func:`PyFrame_GetLineNumber`;它可能會更快。" +"``PyCode_Addr2Line()`` 同時使用的部分應該改用 :c:func:" +"`PyFrame_GetLineNumber`;它可能會更快。" #: ../../whatsnew/3.11.rst:2464 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" @@ -4995,25 +4988,25 @@ msgstr "``f_valuestack``:已移除。" #: ../../whatsnew/3.11.rst:2474 msgid "" -"The Python frame object is now created lazily. A side effect is that " -"the :attr:`~frame.f_back` member must not be accessed directly, since its " -"value is now also computed lazily. The :c:func:`PyFrame_GetBack` function " -"must be called instead." +"The Python frame object is now created lazily. A side effect is that the :" +"attr:`~frame.f_back` member must not be accessed directly, since its value " +"is now also computed lazily. The :c:func:`PyFrame_GetBack` function must be " +"called instead." msgstr "" "Python 幀物件的建立現為惰性的 (lazily),一個副作用是 :attr:`~frame.f_back` 成" -"員不能被直接存取,因為其職的計算也是惰性的,要改呼" -"叫 :c:func:`PyFrame_GetBack`。" +"員不能被直接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:" +"`PyFrame_GetBack`。" #: ../../whatsnew/3.11.rst:2480 msgid "" -"Debuggers that accessed the :attr:`~frame.f_locals` directly *must* " -"call :c:func:`PyFrame_GetLocals` instead. They no longer need to " -"call :c:func:`!PyFrame_FastToLocalsWithError` or :c:func:`!" -"PyFrame_LocalsToFast`, in fact they should not call those functions. The " -"necessary updating of the frame is now managed by the virtual machine." +"Debuggers that accessed the :attr:`~frame.f_locals` directly *must* call :c:" +"func:`PyFrame_GetLocals` instead. They no longer need to call :c:func:`!" +"PyFrame_FastToLocalsWithError` or :c:func:`!PyFrame_LocalsToFast`, in fact " +"they should not call those functions. The necessary updating of the frame is " +"now managed by the virtual machine." msgstr "" -"直接存取 :attr:`~frame.f_locals` 的除錯器\\ *必須*\\ 改為呼" -"叫 :c:func:`PyFrame_GetLocals`。他們不再需要呼叫 :c:func:`!" +"直接存取 :attr:`~frame.f_locals` 的除錯器\\ *必須*\\ 改為呼叫 :c:func:" +"`PyFrame_GetLocals`。他們不再需要呼叫 :c:func:`!" "PyFrame_FastToLocalsWithError` 或 :c:func:`!PyFrame_LocalsToFast`,事實上他們" "不應該呼叫這些函式。框架的必要更新現在由虛擬機管理。" @@ -5085,13 +5078,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:2516 msgid "" -"``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` " -"and :c:func:`PyThreadState_LeaveTracing` (functions added to Python 3.11 " -"by :issue:`43760`)." +"``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" +"`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" +"`43760`)." msgstr "" -"``tracing``:已變更,改用 :c:func:`PyThreadState_EnterTracing` " -"和 :c:func:`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中" -"新增的函式)。" +"``tracing``:已變更,改用 :c:func:`PyThreadState_EnterTracing` 和 :c:func:" +"`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中新增的函" +"式)。" #: ../../whatsnew/3.11.rst:2519 msgid "" @@ -5206,23 +5199,22 @@ msgid "" "initialize :data:`sys.path`. Otherwise, initialization will recalculate the " "path and replace any values added to ``module_search_paths``." msgstr "" -"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始" -"化 :data:`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須" -"被設為 1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` " -"的值。" +"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始化 :data:" +"`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " +"1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" #: ../../whatsnew/3.11.rst:2571 msgid "" ":c:func:`PyConfig_Read` no longer calculates the initial search path, and " "will not fill any values into :c:member:`PyConfig.module_search_paths`. To " -"calculate default paths and then modify them, finish initialization and " -"use :c:func:`PySys_GetObject` to retrieve :data:`sys.path` as a Python list " +"calculate default paths and then modify them, finish initialization and use :" +"c:func:`PySys_GetObject` to retrieve :data:`sys.path` as a Python list " "object and modify it directly." msgstr "" -":c:func:`PyConfig_Read` 不再計算初始搜尋路徑,並且不會將任何值填充" -"到 :c:member:`PyConfig.module_search_paths` 中。若要計算預設路徑然後修改它" -"們,完成初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 " -"Python 列表物件並直接修改它。" +":c:func:`PyConfig_Read` 不再計算初始搜尋路徑,並且不會將任何值填充到 :c:" +"member:`PyConfig.module_search_paths` 中。若要計算預設路徑然後修改它們,完成" +"初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 Python 列" +"表物件並直接修改它。" #: ../../whatsnew/3.11.rst:2582 msgid "" @@ -5288,12 +5280,11 @@ msgstr "" #: ../../whatsnew/3.11.rst:2601 msgid "" -"Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. " -"Use :c:func:`PyObject_Hash` instead. (Contributed by Inada Naoki " -"in :issue:`46864`.)" +"Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" +"func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" msgstr "" -"棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改" -"用 :c:func:`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" +"棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改用 :c:func:" +"`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2610 msgid "" @@ -5423,8 +5414,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:2659 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " -"``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner " -"in :issue:`45440`.)" +"``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" +"`45440`.)" msgstr "" "移除 ``Py_FORCE_DOUBLE()`` 巨集。它先前被用於 ``Py_IS_INFINITY()`` 巨集。" "(由 Victor Stinner 於 :issue:`45440` 中所貢獻。)" @@ -5567,7 +5558,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:2719 msgid "Notable changes in 3.11.4" -msgstr "" +msgstr "Python 3.11.4 中顯著的變更" #: ../../whatsnew/3.11.rst:2722 msgid "tarfile" @@ -5586,7 +5577,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:2736 msgid "Notable changes in 3.11.5" -msgstr "" +msgstr "Python 3.11.5 中顯著的變更" #: ../../whatsnew/3.11.rst:2739 msgid "OpenSSL" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index fe25245c63..f4610820ad 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -3970,7 +3970,7 @@ msgstr "Python 3.5.4 中顯著的變更" #: ../../whatsnew/3.5.rst:2545 msgid "New ``make regen-all`` build target" -msgstr "" +msgstr "新增 ``make regen-all`` 建置目標" #: ../../whatsnew/3.5.rst:2547 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index d736d9a29a..ede4a80061 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -3730,7 +3730,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2347 msgid "Notable changes in 3.8.17" -msgstr "" +msgstr "Python 3.8.17 中顯著的變更" #: ../../whatsnew/3.8.rst:2352 msgid "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 2be2bb9af4..f584f4f1fd 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-07 10:49+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1847,7 +1847,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1141 msgid "" ":func:`codecs.lookup` now normalizes the encoding name the same way as :func:" -"`!encodings.normalize_encoding`, except that :func:`codecs.lookup` also " +"`encodings.normalize_encoding`, except that :func:`codecs.lookup` also " "converts the name to lower case. For example, ``\"latex+latin1\"`` encoding " "name is now normalized to ``\"latex_latin1\"``. (Contributed by Jordon Xu " "in :issue:`37751`.)" @@ -2584,7 +2584,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1600 msgid "Notable changes in 3.9.17" -msgstr "" +msgstr "Python 3.9.17 中顯著的變更" #: ../../whatsnew/3.9.rst:1603 msgid "tarfile" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy