From becfe0f67a46ddd2f86eeb506773321566972c39 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 26 Dec 2025 00:16:32 +0000 Subject: [PATCH 01/11] sync with cpython 723ed8c5 --- library/logging.po | 353 +++++++++++++++++++++++---------------------- 1 file changed, 182 insertions(+), 171 deletions(-) diff --git a/library/logging.po b/library/logging.po index 1f9b094f1a..008d633cb5 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2025-12-26 00:15+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1317,11 +1317,11 @@ msgstr "" msgid "Attribute name" msgstr "屬性名稱" -#: ../../library/logging.rst:995 ../../library/logging.rst:1370 +#: ../../library/logging.rst:995 ../../library/logging.rst:1375 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:995 ../../library/logging.rst:1370 +#: ../../library/logging.rst:995 ../../library/logging.rst:1375 msgid "Description" msgstr "描述" @@ -1330,7 +1330,8 @@ msgid "args" msgstr "args" #: ../../library/logging.rst:997 ../../library/logging.rst:1011 -#: ../../library/logging.rst:1039 ../../library/logging.rst:1057 +#: ../../library/logging.rst:1014 ../../library/logging.rst:1044 +#: ../../library/logging.rst:1062 msgid "You shouldn't need to format this yourself." msgstr "你不應該需要自己格式化它。" @@ -1381,250 +1382,260 @@ msgid "" msgstr "" #: ../../library/logging.rst:1014 +msgid "exc_text" +msgstr "" + +#: ../../library/logging.rst:1014 +msgid "" +"Exception information formatted as a string. This is set when :meth:" +"`Formatter.format` is invoked, or ``None`` if no exception has occurred." +msgstr "" + +#: ../../library/logging.rst:1019 msgid "filename" msgstr "filename" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1019 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1019 msgid "Filename portion of ``pathname``." msgstr "``pathname`` 的檔案名稱部分。" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1021 msgid "funcName" msgstr "funcName" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1021 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1021 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1023 msgid "levelname" msgstr "levelname" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1023 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1023 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1027 msgid "levelno" msgstr "levelno" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1027 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1027 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1032 msgid "lineno" msgstr "lineno" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1032 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1032 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:1030 +#: ../../library/logging.rst:1035 msgid "message" msgstr "message" -#: ../../library/logging.rst:1030 +#: ../../library/logging.rst:1035 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:1030 +#: ../../library/logging.rst:1035 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1039 msgid "module" msgstr "模組" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1039 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1039 msgid "Module (name portion of ``filename``)." msgstr "模組(``filename`` 的名稱部分)。" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1041 msgid "msecs" msgstr "msecs" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1041 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1041 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1039 +#: ../../library/logging.rst:0 ../../library/logging.rst:1044 msgid "msg" msgstr "msg" -#: ../../library/logging.rst:1039 +#: ../../library/logging.rst:1044 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1044 +#: ../../library/logging.rst:0 ../../library/logging.rst:1049 msgid "name" msgstr "name" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1049 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1049 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1051 msgid "pathname" msgstr "pathname" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1051 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1051 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1054 msgid "process" msgstr "process" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1054 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1054 msgid "Process ID (if available)." msgstr "行程 ID(如果可用)。" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1056 msgid "processName" msgstr "processName" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1056 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1056 msgid "Process name (if available)." msgstr "行程名稱(如果可用)。" -#: ../../library/logging.rst:1053 +#: ../../library/logging.rst:1058 msgid "relativeCreated" msgstr "relativeCreated" -#: ../../library/logging.rst:1053 +#: ../../library/logging.rst:1058 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:1053 +#: ../../library/logging.rst:1058 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:1057 +#: ../../library/logging.rst:1062 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:1057 +#: ../../library/logging.rst:1062 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1068 msgid "thread" msgstr "thread" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1068 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1068 msgid "Thread ID (if available)." msgstr "執行緒 ID(如果可用)。" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1070 msgid "threadName" msgstr "threadName" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1070 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1070 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1072 msgid "taskName" msgstr "taskName" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1072 msgid "``%(taskName)s``" msgstr "``%(taskName)s``" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1072 msgid ":class:`asyncio.Task` name (if available)." msgstr "" -#: ../../library/logging.rst:1070 +#: ../../library/logging.rst:1075 msgid "*processName* was added." msgstr "新增 *processName*。" -#: ../../library/logging.rst:1073 +#: ../../library/logging.rst:1078 msgid "*taskName* was added." msgstr "新增 *taskName*。" -#: ../../library/logging.rst:1079 +#: ../../library/logging.rst:1084 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:1081 +#: ../../library/logging.rst:1086 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:1087 +#: ../../library/logging.rst:1092 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance, an optional dict-like object (*extra*), " @@ -1635,7 +1646,7 @@ msgid "" "`LoggerAdapter` instance" msgstr "" -#: ../../library/logging.rst:1097 +#: ../../library/logging.rst:1102 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1644,15 +1655,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1105 +#: ../../library/logging.rst:1110 msgid "Delegates to the underlying :attr:`!manager` on *logger*." msgstr "" -#: ../../library/logging.rst:1109 +#: ../../library/logging.rst:1114 msgid "Delegates to the underlying :meth:`!_log` method on *logger*." msgstr "" -#: ../../library/logging.rst:1111 +#: ../../library/logging.rst:1116 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1664,32 +1675,32 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1122 +#: ../../library/logging.rst:1127 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:1128 +#: ../../library/logging.rst:1133 msgid "" "Attribute :attr:`!manager` and method :meth:`!_log` were added, which " "delegate to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:1133 +#: ../../library/logging.rst:1138 msgid "The *extra* argument is now optional." msgstr "*extra* 引數現在是可選的。" -#: ../../library/logging.rst:1137 +#: ../../library/logging.rst:1142 msgid "The *merge_extra* parameter was added." msgstr "新增 *merge_extra* 參數。" -#: ../../library/logging.rst:1141 +#: ../../library/logging.rst:1146 msgid "Thread Safety" msgstr "執行緒安全" -#: ../../library/logging.rst:1143 +#: ../../library/logging.rst:1148 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this through using threading " @@ -1698,7 +1709,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1148 +#: ../../library/logging.rst:1153 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1706,17 +1717,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1155 +#: ../../library/logging.rst:1160 msgid "Module-Level Functions" msgstr "模組層級函式" -#: ../../library/logging.rst:1157 +#: ../../library/logging.rst:1162 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1163 +#: ../../library/logging.rst:1168 msgid "" "Return a logger with the specified name or, if name is ``None``, return the " "root logger of the hierarchy. If specified, the name is typically a dot-" @@ -1726,14 +1737,14 @@ msgid "" "for not doing that, as mentioned in :ref:`logger`." msgstr "" -#: ../../library/logging.rst:1170 +#: ../../library/logging.rst:1175 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1177 +#: ../../library/logging.rst:1182 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1742,7 +1753,7 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1182 +#: ../../library/logging.rst:1187 msgid "" "class MyLogger(logging.getLoggerClass()):\n" " # ... override behaviour here" @@ -1750,37 +1761,37 @@ msgstr "" "class MyLogger(logging.getLoggerClass()):\n" " # ... 在這裡覆蓋其行為" -#: ../../library/logging.rst:1188 +#: ../../library/logging.rst:1193 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1190 +#: ../../library/logging.rst:1195 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1195 +#: ../../library/logging.rst:1200 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1200 +#: ../../library/logging.rst:1205 msgid "" "This is a convenience function that calls :meth:`Logger.debug`, on the root " "logger. The handling of the arguments is in every way identical to what is " "described in that method." msgstr "" -#: ../../library/logging.rst:1204 +#: ../../library/logging.rst:1209 msgid "" "The only difference is that if the root logger has no handlers, then :func:" "`basicConfig` is called, prior to calling ``debug`` on the root logger." msgstr "" -#: ../../library/logging.rst:1207 +#: ../../library/logging.rst:1212 msgid "" "For very short scripts or quick demonstrations of ``logging`` facilities, " "``debug`` and the other module-level functions may be convenient. However, " @@ -1790,38 +1801,38 @@ msgid "" "described at the beginning of this documentation." msgstr "" -#: ../../library/logging.rst:1217 +#: ../../library/logging.rst:1222 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1223 +#: ../../library/logging.rst:1228 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1226 +#: ../../library/logging.rst:1231 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1233 +#: ../../library/logging.rst:1238 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1239 +#: ../../library/logging.rst:1244 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1245 +#: ../../library/logging.rst:1250 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`. Exception info is " @@ -1829,13 +1840,13 @@ msgid "" "exception handler." msgstr "" -#: ../../library/logging.rst:1251 +#: ../../library/logging.rst:1256 msgid "" "Logs a message with level *level* on the root logger. The arguments and " "behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1256 +#: ../../library/logging.rst:1261 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1849,7 +1860,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1267 +#: ../../library/logging.rst:1272 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1857,13 +1868,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1272 +#: ../../library/logging.rst:1277 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1278 +#: ../../library/logging.rst:1283 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1873,24 +1884,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1285 +#: ../../library/logging.rst:1290 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1290 +#: ../../library/logging.rst:1295 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1298 +#: ../../library/logging.rst:1303 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1300 +#: ../../library/logging.rst:1305 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1900,20 +1911,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1312 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1311 +#: ../../library/logging.rst:1316 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1314 +#: ../../library/logging.rst:1319 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -1922,7 +1933,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1325 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1930,17 +1941,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1328 +#: ../../library/logging.rst:1333 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1335 +#: ../../library/logging.rst:1340 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1341 +#: ../../library/logging.rst:1346 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1948,7 +1959,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1354 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1957,13 +1968,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1355 +#: ../../library/logging.rst:1360 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1358 +#: ../../library/logging.rst:1363 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1972,54 +1983,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1365 +#: ../../library/logging.rst:1370 msgid "The following keyword arguments are supported." msgstr "支援以下的關鍵字引數。" -#: ../../library/logging.rst:1372 +#: ../../library/logging.rst:1377 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1372 +#: ../../library/logging.rst:1377 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1376 +#: ../../library/logging.rst:1381 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1376 +#: ../../library/logging.rst:1381 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1385 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1385 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1385 +#: ../../library/logging.rst:1390 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1385 +#: ../../library/logging.rst:1390 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1393 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1393 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1399 +#: ../../library/logging.rst:1404 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1399 +#: ../../library/logging.rst:1404 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1405 +#: ../../library/logging.rst:1410 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1405 +#: ../../library/logging.rst:1410 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -2059,33 +2070,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1414 +#: ../../library/logging.rst:1419 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1414 +#: ../../library/logging.rst:1419 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1425 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1425 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1425 +#: ../../library/logging.rst:1430 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1425 +#: ../../library/logging.rst:1430 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -2094,39 +2105,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1436 +#: ../../library/logging.rst:1441 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1439 +#: ../../library/logging.rst:1444 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1445 +#: ../../library/logging.rst:1450 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1448 +#: ../../library/logging.rst:1453 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1453 +#: ../../library/logging.rst:1458 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1457 +#: ../../library/logging.rst:1462 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1464 +#: ../../library/logging.rst:1469 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`!__init__` such that only a name " @@ -2138,32 +2149,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1475 +#: ../../library/logging.rst:1480 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1477 +#: ../../library/logging.rst:1482 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1479 +#: ../../library/logging.rst:1484 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1484 +#: ../../library/logging.rst:1489 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1491 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1488 +#: ../../library/logging.rst:1493 msgid "The logger name." msgstr "" @@ -2171,7 +2182,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1489 +#: ../../library/logging.rst:1494 msgid "The logging level (numeric)." msgstr "" @@ -2179,7 +2190,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1490 +#: ../../library/logging.rst:1495 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -2187,19 +2198,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1491 +#: ../../library/logging.rst:1496 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1492 +#: ../../library/logging.rst:1497 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1493 +#: ../../library/logging.rst:1498 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1494 +#: ../../library/logging.rst:1499 msgid "An exception tuple, or ``None``." msgstr "" @@ -2207,7 +2218,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1495 +#: ../../library/logging.rst:1500 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2215,7 +2226,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1497 +#: ../../library/logging.rst:1502 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2225,15 +2236,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1499 +#: ../../library/logging.rst:1504 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1503 +#: ../../library/logging.rst:1508 msgid "Module-Level Attributes" msgstr "模組層級屬性" -#: ../../library/logging.rst:1507 +#: ../../library/logging.rst:1512 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -2244,15 +2255,15 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1519 +#: ../../library/logging.rst:1524 msgid "Used to see if exceptions during handling should be propagated." msgstr "" -#: ../../library/logging.rst:1521 +#: ../../library/logging.rst:1526 msgid "Default: ``True``." msgstr "" -#: ../../library/logging.rst:1523 +#: ../../library/logging.rst:1528 msgid "" "If :data:`raiseExceptions` is ``False``, exceptions get silently ignored. " "This is what is mostly wanted for a logging system - most users will not " @@ -2260,22 +2271,22 @@ msgid "" "application errors." msgstr "" -#: ../../library/logging.rst:1530 +#: ../../library/logging.rst:1535 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1532 +#: ../../library/logging.rst:1537 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1537 +#: ../../library/logging.rst:1542 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1540 +#: ../../library/logging.rst:1545 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2284,46 +2295,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1545 +#: ../../library/logging.rst:1550 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1552 +#: ../../library/logging.rst:1557 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.rst:1553 +#: ../../library/logging.rst:1558 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1555 +#: ../../library/logging.rst:1560 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../library/logging.rst:1556 +#: ../../library/logging.rst:1561 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1558 +#: ../../library/logging.rst:1563 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1559 +#: ../../library/logging.rst:1564 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1562 +#: ../../library/logging.rst:1567 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1563 +#: ../../library/logging.rst:1568 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " From ce6e6f8ec242fa8c763f2d473daba0b7cb6977b8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 28 Dec 2025 00:18:22 +0000 Subject: [PATCH 02/11] sync with cpython fd9db61a --- library/linecache.po | 37 ++++++++++++++++++------------------- library/os.po | 6 +++--- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/library/linecache.po b/library/linecache.po index 8e7f152f09..79226acf26 100644 --- a/library/linecache.po +++ b/library/linecache.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-12-28 00:16+0000\n" "PO-Revision-Date: 2025-07-07 23:50+0800\n" "Last-Translator: Weilin Du <1372449351@qq.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,14 +31,13 @@ msgstr "**原始碼:**\\ :source:`Lib/linecache.py`" msgid "" "The :mod:`linecache` module allows one to get any line from a Python source " "file, while attempting to optimize internally, using a cache, the common " -"case where many lines are read from a single file. This is used by " -"the :mod:`traceback` module to retrieve source lines for inclusion in the " -"formatted traceback." +"case where many lines are read from a single file. This is used by the :mod:" +"`traceback` module to retrieve source lines for inclusion in the formatted " +"traceback." msgstr "" ":mod:`linecache` 模組允許從 Python 原始碼檔案中取得任何一行。當嘗試在程式內部" -"進行最佳化,會使用快取,這是從單一檔案讀取許多行的常見情況。 這" -"被 :mod:`traceback` 模組用來擷取來自原始碼檔案的行,以包含在格式化的 " -"traceback 中。" +"進行最佳化,會使用快取,這是從單一檔案讀取許多行的常見情況。 這被 :mod:" +"`traceback` 模組用來擷取來自原始碼檔案的行,以包含在格式化的 traceback 中。" #: ../../library/linecache.rst:18 msgid "" @@ -46,9 +45,9 @@ msgid "" "uses :func:`tokenize.detect_encoding` to get the encoding of the file; in " "the absence of an encoding token, the file encoding defaults to UTF-8." msgstr "" -":func:`tokenize.open` 函式用來開啟檔案。這個函式使" -"用 :func:`tokenize.detect_encoding` 來取得檔案的編碼;在沒有編碼標記的情況" -"下,檔案編碼預設為 UTF-8。" +":func:`tokenize.open` 函式用來開啟檔案。這個函式使用 :func:`tokenize." +"detect_encoding` 來取得檔案的編碼;在沒有編碼標記的情況下,檔案編碼預設為 " +"UTF-8。" #: ../../library/linecache.rst:22 msgid "The :mod:`linecache` module defines the following functions:" @@ -66,21 +65,21 @@ msgstr "" #: ../../library/linecache.rst:33 msgid "" "If *filename* indicates a frozen module (starting with ``'\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -6380,7 +6380,7 @@ msgstr "" #: ../../library/os.rst:5617 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " -"set, :func:`cpu_count` returns the overridden value *n*." +"set, :func:`cpu_count` returns the override value *n*." msgstr "" #: ../../library/os.rst:5624 @@ -6406,7 +6406,7 @@ msgstr "" #: ../../library/os.rst:5640 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " -"set, :func:`process_cpu_count` returns the overridden value *n*." +"set, :func:`process_cpu_count` returns the override value *n*." msgstr "" #: ../../library/os.rst:5643 From 06706551ed1c589c882de98f93871297f1c84987 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 29 Dec 2025 00:18:20 +0000 Subject: [PATCH 03/11] sync with cpython b097fa13 --- library/inspect.po | 599 +++++++++++++++++++++++--------------------- library/zoneinfo.po | 92 +++---- 2 files changed, 362 insertions(+), 329 deletions(-) diff --git a/library/inspect.po b/library/inspect.po index c20412236a..0b0c303c6a 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-18 00:15+0000\n" +"POT-Creation-Date: 2025-12-29 00:16+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -74,19 +74,19 @@ msgid "class" msgstr "" #: ../../library/inspect.rst:48 ../../library/inspect.rst:63 -#: ../../library/inspect.rst:81 ../../library/inspect.rst:295 +#: ../../library/inspect.rst:81 ../../library/inspect.rst:301 msgid "__doc__" msgstr "__doc__" #: ../../library/inspect.rst:48 ../../library/inspect.rst:63 -#: ../../library/inspect.rst:81 ../../library/inspect.rst:295 +#: ../../library/inspect.rst:81 ../../library/inspect.rst:301 msgid "documentation string" msgstr "" #: ../../library/inspect.rst:50 ../../library/inspect.rst:65 #: ../../library/inspect.rst:83 ../../library/inspect.rst:248 -#: ../../library/inspect.rst:265 ../../library/inspect.rst:278 -#: ../../library/inspect.rst:297 +#: ../../library/inspect.rst:265 ../../library/inspect.rst:281 +#: ../../library/inspect.rst:303 msgid "__name__" msgstr "__name__" @@ -96,15 +96,15 @@ msgstr "" #: ../../library/inspect.rst:53 ../../library/inspect.rst:68 #: ../../library/inspect.rst:86 ../../library/inspect.rst:250 -#: ../../library/inspect.rst:267 ../../library/inspect.rst:280 -#: ../../library/inspect.rst:300 +#: ../../library/inspect.rst:267 ../../library/inspect.rst:283 +#: ../../library/inspect.rst:306 msgid "__qualname__" msgstr "__qualname__" #: ../../library/inspect.rst:53 ../../library/inspect.rst:68 #: ../../library/inspect.rst:86 ../../library/inspect.rst:250 -#: ../../library/inspect.rst:267 ../../library/inspect.rst:280 -#: ../../library/inspect.rst:300 +#: ../../library/inspect.rst:267 ../../library/inspect.rst:283 +#: ../../library/inspect.rst:306 msgid "qualified name" msgstr "" @@ -143,7 +143,7 @@ msgstr "__func__" msgid "function object containing implementation of method" msgstr "" -#: ../../library/inspect.rst:74 ../../library/inspect.rst:302 +#: ../../library/inspect.rst:74 ../../library/inspect.rst:308 msgid "__self__" msgstr "__self__" @@ -260,7 +260,7 @@ msgid "next inner traceback object (called by this level)" msgstr "" #: ../../library/inspect.rst:132 ../../library/inspect.rst:252 -#: ../../library/inspect.rst:272 ../../library/inspect.rst:285 +#: ../../library/inspect.rst:272 ../../library/inspect.rst:288 msgid "frame" msgstr "" @@ -356,7 +356,7 @@ msgid "used to clear all references to local variables" msgstr "" #: ../../library/inspect.rst:175 ../../library/inspect.rst:259 -#: ../../library/inspect.rst:276 ../../library/inspect.rst:289 +#: ../../library/inspect.rst:279 ../../library/inspect.rst:295 msgid "code" msgstr "code(程式碼)" @@ -529,7 +529,7 @@ msgid "generator" msgstr "" #: ../../library/inspect.rst:248 ../../library/inspect.rst:265 -#: ../../library/inspect.rst:278 +#: ../../library/inspect.rst:281 msgid "name" msgstr "" @@ -549,7 +549,7 @@ msgstr "" msgid "gi_suspended" msgstr "" -#: ../../library/inspect.rst:256 +#: ../../library/inspect.rst:256 ../../library/inspect.rst:276 msgid "is the generator suspended?" msgstr "" @@ -573,7 +573,7 @@ msgstr "" msgid "ag_await" msgstr "ag_await" -#: ../../library/inspect.rst:269 ../../library/inspect.rst:282 +#: ../../library/inspect.rst:269 ../../library/inspect.rst:285 msgid "object being awaited on, or ``None``" msgstr "" @@ -586,76 +586,103 @@ msgid "ag_running" msgstr "ag_running" #: ../../library/inspect.rst:276 +msgid "ag_suspended" +msgstr "" + +#: ../../library/inspect.rst:279 msgid "ag_code" msgstr "ag_code" -#: ../../library/inspect.rst:278 +#: ../../library/inspect.rst:281 msgid "coroutine" msgstr "coroutine" -#: ../../library/inspect.rst:282 +#: ../../library/inspect.rst:285 msgid "cr_await" msgstr "cr_await" -#: ../../library/inspect.rst:285 +#: ../../library/inspect.rst:288 msgid "cr_frame" msgstr "cr_frame" -#: ../../library/inspect.rst:287 +#: ../../library/inspect.rst:290 msgid "cr_running" msgstr "cr_running" -#: ../../library/inspect.rst:287 +#: ../../library/inspect.rst:290 msgid "is the coroutine running?" msgstr "" -#: ../../library/inspect.rst:289 +#: ../../library/inspect.rst:292 +msgid "cr_suspended" +msgstr "" + +#: ../../library/inspect.rst:292 +msgid "is the coroutine suspended?" +msgstr "" + +#: ../../library/inspect.rst:295 msgid "cr_code" msgstr "cr_code" -#: ../../library/inspect.rst:291 +#: ../../library/inspect.rst:297 msgid "cr_origin" msgstr "cr_origin" -#: ../../library/inspect.rst:291 +#: ../../library/inspect.rst:297 msgid "where coroutine was created, or ``None``. See |coroutine-origin-link|" msgstr "" -#: ../../library/inspect.rst:295 +#: ../../library/inspect.rst:301 msgid "builtin" msgstr "" -#: ../../library/inspect.rst:297 +#: ../../library/inspect.rst:303 msgid "original name of this function or method" msgstr "" -#: ../../library/inspect.rst:302 +#: ../../library/inspect.rst:308 msgid "instance to which a method is bound, or ``None``" msgstr "" -#: ../../library/inspect.rst:309 +#: ../../library/inspect.rst:315 msgid "Add ``__qualname__`` and ``gi_yieldfrom`` attributes to generators." msgstr "將 ``__qualname__`` 和 ``gi_yieldfrom`` 屬性加到產生器。" -#: ../../library/inspect.rst:311 +#: ../../library/inspect.rst:317 msgid "" "The ``__name__`` attribute of generators is now set from the function name, " "instead of the code name, and it can now be modified." msgstr "" -#: ../../library/inspect.rst:316 +#: ../../library/inspect.rst:322 msgid "Add ``cr_origin`` attribute to coroutines." msgstr "新增協程的 ``cr_origin`` 屬性。" -#: ../../library/inspect.rst:320 +#: ../../library/inspect.rst:326 msgid "Add ``__builtins__`` attribute to functions." msgstr "新增函式的 ``__builtins__`` 屬性。" -#: ../../library/inspect.rst:324 +#: ../../library/inspect.rst:330 +#, fuzzy +msgid "Add ``gi_suspended`` attribute to generators." +msgstr "將 ``__qualname__`` 和 ``gi_yieldfrom`` 屬性加到產生器。" + +#: ../../library/inspect.rst:334 +#, fuzzy +msgid "Add ``cr_suspended`` attribute to coroutines." +msgstr "新增協程的 ``cr_origin`` 屬性。" + +#: ../../library/inspect.rst:338 +#, fuzzy +msgid "Add ``ag_suspended`` attribute to async generators." +msgstr "將 ``__qualname__`` 和 ``gi_yieldfrom`` 屬性加到產生器。" + +#: ../../library/inspect.rst:342 msgid "Add ``f_generator`` attribute to frames." msgstr "新增 ``f_generator`` 屬性到 frame。" -#: ../../library/inspect.rst:328 +#: ../../library/inspect.rst:346 msgid "" "Return all the members of an object in a list of ``(name, value)`` pairs " "sorted by name. If the optional *predicate* argument—which will be called " @@ -663,14 +690,14 @@ msgid "" "the predicate returns a true value are included." msgstr "" -#: ../../library/inspect.rst:335 +#: ../../library/inspect.rst:353 msgid "" ":func:`getmembers` will only return class attributes defined in the " "metaclass when the argument is a class and those attributes have been listed " "in the metaclass' custom :meth:`~object.__dir__`." msgstr "" -#: ../../library/inspect.rst:342 +#: ../../library/inspect.rst:360 msgid "" "Return all the members of an object in a list of ``(name, value)`` pairs " "sorted by name without triggering dynamic lookup via the descriptor " @@ -678,7 +705,7 @@ msgid "" "that satisfy a given predicate." msgstr "" -#: ../../library/inspect.rst:349 +#: ../../library/inspect.rst:367 msgid "" ":func:`getmembers_static` may not be able to retrieve all members that " "getmembers can fetch (like dynamically created attributes) and may find " @@ -687,7 +714,7 @@ msgid "" "cases." msgstr "" -#: ../../library/inspect.rst:360 +#: ../../library/inspect.rst:378 msgid "" "Return the name of the module named by the file *path*, without including " "the names of enclosing packages. The file extension is checked against all " @@ -696,62 +723,62 @@ msgid "" "``None`` is returned." msgstr "" -#: ../../library/inspect.rst:366 +#: ../../library/inspect.rst:384 msgid "" "Note that this function *only* returns a meaningful name for actual Python " "modules - paths that potentially refer to Python packages will still return " "``None``." msgstr "" -#: ../../library/inspect.rst:370 +#: ../../library/inspect.rst:388 msgid "The function is based directly on :mod:`importlib`." msgstr "此函式直接基於 :mod:`importlib`。" -#: ../../library/inspect.rst:376 +#: ../../library/inspect.rst:394 msgid "Return ``True`` if the object is a module." msgstr "如果物件是模組,則回傳 ``True``。" -#: ../../library/inspect.rst:381 +#: ../../library/inspect.rst:399 msgid "" "Return ``True`` if the object is a class, whether built-in or created in " "Python code." msgstr "" -#: ../../library/inspect.rst:387 +#: ../../library/inspect.rst:405 msgid "Return ``True`` if the object is a bound method written in Python." msgstr "" -#: ../../library/inspect.rst:392 +#: ../../library/inspect.rst:410 msgid "Return ``True`` if the object is a :term:`package`." msgstr "如果物件是 :term:`package`,則回傳 ``True``。" -#: ../../library/inspect.rst:399 +#: ../../library/inspect.rst:417 msgid "" "Return ``True`` if the object is a Python function, which includes functions " "created by a :term:`lambda` expression." msgstr "" -#: ../../library/inspect.rst:405 +#: ../../library/inspect.rst:423 msgid "Return ``True`` if the object is a Python generator function." msgstr "如果物件是 Python 產生器函式,則回傳 ``True``。" -#: ../../library/inspect.rst:407 +#: ../../library/inspect.rst:425 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a Python generator function." msgstr "" -#: ../../library/inspect.rst:411 +#: ../../library/inspect.rst:429 msgid "" "Functions wrapped in :func:`functools.partialmethod` now return ``True`` if " "the wrapped function is a Python generator function." msgstr "" -#: ../../library/inspect.rst:417 +#: ../../library/inspect.rst:435 msgid "Return ``True`` if the object is a generator." msgstr "如果物件是產生器,則回傳 ``True``。" -#: ../../library/inspect.rst:422 +#: ../../library/inspect.rst:440 msgid "" "Return ``True`` if the object is a :term:`coroutine function` (a function " "defined with an :keyword:`async def` syntax), a :func:`functools.partial` " @@ -759,60 +786,60 @@ msgid "" "`markcoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:429 +#: ../../library/inspect.rst:447 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a :term:`coroutine function`." msgstr "" -#: ../../library/inspect.rst:433 +#: ../../library/inspect.rst:451 msgid "" "Sync functions marked with :func:`markcoroutinefunction` now return ``True``." msgstr "" -#: ../../library/inspect.rst:437 ../../library/inspect.rst:507 +#: ../../library/inspect.rst:455 ../../library/inspect.rst:525 msgid "" "Functions wrapped in :func:`functools.partialmethod` now return ``True`` if " "the wrapped function is a :term:`coroutine function`." msgstr "" -#: ../../library/inspect.rst:444 +#: ../../library/inspect.rst:462 msgid "" "Decorator to mark a callable as a :term:`coroutine function` if it would not " "otherwise be detected by :func:`iscoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:447 +#: ../../library/inspect.rst:465 msgid "" "This may be of use for sync functions that return a :term:`coroutine`, if " "the function is passed to an API that requires :func:`iscoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:450 +#: ../../library/inspect.rst:468 msgid "" "When possible, using an :keyword:`async def` function is preferred. Also " "acceptable is calling the function and testing the return with :func:" "`iscoroutine`." msgstr "" -#: ../../library/inspect.rst:459 +#: ../../library/inspect.rst:477 msgid "" "Return ``True`` if the object is a :term:`coroutine` created by an :keyword:" "`async def` function." msgstr "" -#: ../../library/inspect.rst:467 +#: ../../library/inspect.rst:485 msgid "" "Return ``True`` if the object can be used in :keyword:`await` expression." msgstr "" -#: ../../library/inspect.rst:469 +#: ../../library/inspect.rst:487 msgid "" "Can also be used to distinguish generator-based coroutines from regular " "generators:" msgstr "" -#: ../../library/inspect.rst:472 +#: ../../library/inspect.rst:490 msgid "" "import types\n" "\n" @@ -836,13 +863,13 @@ msgstr "" "assert not isawaitable(gen())\n" "assert isawaitable(gen_coro())" -#: ../../library/inspect.rst:490 +#: ../../library/inspect.rst:508 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator` function, " "for example:" msgstr "" -#: ../../library/inspect.rst:493 +#: ../../library/inspect.rst:511 msgid "" ">>> async def agen():\n" "... yield 1\n" @@ -856,65 +883,65 @@ msgstr "" ">>> inspect.isasyncgenfunction(agen)\n" "True" -#: ../../library/inspect.rst:503 +#: ../../library/inspect.rst:521 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is an :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:513 +#: ../../library/inspect.rst:531 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator iterator` " "created by an :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:520 +#: ../../library/inspect.rst:538 msgid "Return ``True`` if the object is a traceback." msgstr "" -#: ../../library/inspect.rst:525 +#: ../../library/inspect.rst:543 msgid "Return ``True`` if the object is a frame." msgstr "" -#: ../../library/inspect.rst:530 +#: ../../library/inspect.rst:548 msgid "Return ``True`` if the object is a code." msgstr "如果物件是程式碼,則回傳 ``True``。" -#: ../../library/inspect.rst:535 +#: ../../library/inspect.rst:553 msgid "" "Return ``True`` if the object is a built-in function or a bound built-in " "method." msgstr "" -#: ../../library/inspect.rst:540 +#: ../../library/inspect.rst:558 msgid "" "Return ``True`` if the type of object is a :class:`~types.MethodWrapperType`." msgstr "" -#: ../../library/inspect.rst:542 +#: ../../library/inspect.rst:560 msgid "" "These are instances of :class:`~types.MethodWrapperType`, such as :meth:" "`~object.__str__`, :meth:`~object.__eq__` and :meth:`~object.__repr__`." msgstr "" -#: ../../library/inspect.rst:550 +#: ../../library/inspect.rst:568 msgid "" "Return ``True`` if the object is a user-defined or built-in function or " "method." msgstr "如果物件是使用者定義或內建的函式或方法,則回傳 ``True``。" -#: ../../library/inspect.rst:555 +#: ../../library/inspect.rst:573 msgid "Return ``True`` if the object is an abstract base class." msgstr "如果物件是抽象基底類別,則回傳 ``True``。" -#: ../../library/inspect.rst:560 +#: ../../library/inspect.rst:578 msgid "" "Return ``True`` if the object is a method descriptor, but not if :func:" "`ismethod`, :func:`isclass`, :func:`isfunction` or :func:`isbuiltin` are " "true." msgstr "" -#: ../../library/inspect.rst:564 +#: ../../library/inspect.rst:582 msgid "" "This, for example, is true of ``int.__add__``. An object passing this test " "has a :meth:`~object.__get__` method, but not a :meth:`~object.__set__` " @@ -923,7 +950,7 @@ msgid "" "sensible, and :attr:`~definition.__doc__` often is." msgstr "" -#: ../../library/inspect.rst:570 +#: ../../library/inspect.rst:588 msgid "" "Methods implemented via descriptors that also pass one of the other tests " "return ``False`` from the :func:`ismethoddescriptor` test, simply because " @@ -931,7 +958,7 @@ msgid "" "`~method.__func__` attribute (etc) when an object passes :func:`ismethod`." msgstr "" -#: ../../library/inspect.rst:576 +#: ../../library/inspect.rst:594 msgid "" "This function no longer incorrectly reports objects with :meth:`~object." "__get__` and :meth:`~object.__delete__`, but not :meth:`~object.__set__`, as " @@ -939,11 +966,11 @@ msgid "" "descriptors)." msgstr "" -#: ../../library/inspect.rst:584 +#: ../../library/inspect.rst:602 msgid "Return ``True`` if the object is a data descriptor." msgstr "如果物件是資料描述器,則回傳 ``True``。" -#: ../../library/inspect.rst:586 +#: ../../library/inspect.rst:604 msgid "" "Data descriptors have a :attr:`~object.__set__` or a :attr:`~object." "__delete__` method. Examples are properties (defined in Python), getsets, " @@ -954,33 +981,33 @@ msgid "" "and members have both of these attributes), but this is not guaranteed." msgstr "" -#: ../../library/inspect.rst:597 +#: ../../library/inspect.rst:615 msgid "Return ``True`` if the object is a getset descriptor." msgstr "" -#: ../../library/inspect.rst:601 +#: ../../library/inspect.rst:619 msgid "" "getsets are attributes defined in extension modules via :c:type:" "`PyGetSetDef` structures. For Python implementations without such types, " "this method will always return ``False``." msgstr "" -#: ../../library/inspect.rst:608 +#: ../../library/inspect.rst:626 msgid "Return ``True`` if the object is a member descriptor." msgstr "如果物件是成員描述器,則回傳 ``True``。" -#: ../../library/inspect.rst:612 +#: ../../library/inspect.rst:630 msgid "" "Member descriptors are attributes defined in extension modules via :c:type:" "`PyMemberDef` structures. For Python implementations without such types, " "this method will always return ``False``." msgstr "" -#: ../../library/inspect.rst:620 +#: ../../library/inspect.rst:638 msgid "Retrieving source code" msgstr "取得原始碼" -#: ../../library/inspect.rst:624 +#: ../../library/inspect.rst:642 msgid "" "Get the documentation string for an object, cleaned up with :func:" "`cleandoc`. If the documentation string for an object is not provided and " @@ -989,11 +1016,11 @@ msgid "" "documentation string is invalid or missing." msgstr "" -#: ../../library/inspect.rst:630 +#: ../../library/inspect.rst:648 msgid "Documentation strings are now inherited if not overridden." msgstr "" -#: ../../library/inspect.rst:636 +#: ../../library/inspect.rst:654 msgid "" "Return in a single string any lines of comments immediately preceding the " "object's source code (for a class, function, or method), or at the top of " @@ -1002,27 +1029,27 @@ msgid "" "been defined in C or the interactive shell." msgstr "" -#: ../../library/inspect.rst:645 +#: ../../library/inspect.rst:663 msgid "" "Return the name of the (text or binary) file in which an object was defined. " "This will fail with a :exc:`TypeError` if the object is a built-in module, " "class, or function." msgstr "" -#: ../../library/inspect.rst:652 +#: ../../library/inspect.rst:670 msgid "" "Try to guess which module an object was defined in. Return ``None`` if the " "module cannot be determined." msgstr "" -#: ../../library/inspect.rst:658 +#: ../../library/inspect.rst:676 msgid "" "Return the name of the Python source file in which an object was defined or " "``None`` if no way can be identified to get the source. This will fail with " "a :exc:`TypeError` if the object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:666 +#: ../../library/inspect.rst:684 msgid "" "Return a list of source lines and starting line number for an object. The " "argument may be a module, class, method, function, traceback, frame, or code " @@ -1033,13 +1060,13 @@ msgid "" "built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:675 ../../library/inspect.rst:689 +#: ../../library/inspect.rst:693 ../../library/inspect.rst:707 msgid "" ":exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the " "former." msgstr "" -#: ../../library/inspect.rst:682 +#: ../../library/inspect.rst:700 msgid "" "Return the text of the source code for an object. The argument may be a " "module, class, method, function, traceback, frame, or code object. The " @@ -1048,13 +1075,13 @@ msgid "" "object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:696 +#: ../../library/inspect.rst:714 msgid "" "Clean up indentation from docstrings that are indented to line up with " "blocks of code." msgstr "" -#: ../../library/inspect.rst:699 +#: ../../library/inspect.rst:717 msgid "" "All leading whitespace is removed from the first line. Any leading " "whitespace that can be uniformly removed from the second line onwards is " @@ -1062,22 +1089,22 @@ msgid "" "Also, all tabs are expanded to spaces." msgstr "" -#: ../../library/inspect.rst:708 +#: ../../library/inspect.rst:726 msgid "Introspecting callables with the Signature object" msgstr "" -#: ../../library/inspect.rst:712 +#: ../../library/inspect.rst:730 msgid "" "The :class:`Signature` object represents the call signature of a callable " "object and its return annotation. To retrieve a :class:`!Signature` object, " "use the :func:`!signature` function." msgstr "" -#: ../../library/inspect.rst:719 +#: ../../library/inspect.rst:737 msgid "Return a :class:`Signature` object for the given *callable*:" msgstr "" -#: ../../library/inspect.rst:721 +#: ../../library/inspect.rst:739 msgid "" ">>> from inspect import signature\n" ">>> def foo(a, *, b:int, **kwargs):\n" @@ -1109,13 +1136,13 @@ msgstr "" ">>> sig.parameters['b'].annotation\n" "" -#: ../../library/inspect.rst:738 +#: ../../library/inspect.rst:756 msgid "" "Accepts a wide range of Python callables, from plain functions and classes " "to :func:`functools.partial` objects." msgstr "" -#: ../../library/inspect.rst:741 +#: ../../library/inspect.rst:759 msgid "" "If some of the annotations are strings (e.g., because ``from __future__ " "import annotations`` was used), :func:`signature` will attempt to " @@ -1130,7 +1157,7 @@ msgid "" "STRING`` to return annotations in string format." msgstr "" -#: ../../library/inspect.rst:755 +#: ../../library/inspect.rst:773 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -1139,36 +1166,36 @@ msgid "" "get_annotations` could potentially raise any kind of exception." msgstr "" -#: ../../library/inspect.rst:761 +#: ../../library/inspect.rst:779 msgid "" "A slash (/) in the signature of a function denotes that the parameters prior " "to it are positional-only. For more info, see :ref:`the FAQ entry on " "positional-only parameters `." msgstr "" -#: ../../library/inspect.rst:765 +#: ../../library/inspect.rst:783 msgid "" "The *follow_wrapped* parameter was added. Pass ``False`` to get a signature " "of *callable* specifically (``callable.__wrapped__`` will not be used to " "unwrap decorated callables.)" msgstr "" -#: ../../library/inspect.rst:771 ../../library/inspect.rst:907 +#: ../../library/inspect.rst:789 ../../library/inspect.rst:925 msgid "The *globals*, *locals*, and *eval_str* parameters were added." msgstr "" -#: ../../library/inspect.rst:774 +#: ../../library/inspect.rst:792 msgid "The *annotation_format* parameter was added." msgstr "" -#: ../../library/inspect.rst:779 +#: ../../library/inspect.rst:797 msgid "" "Some callables may not be introspectable in certain implementations of " "Python. For example, in CPython, some built-in functions defined in C " "provide no metadata about their arguments." msgstr "" -#: ../../library/inspect.rst:785 +#: ../../library/inspect.rst:803 msgid "" "If the passed object has a :attr:`!__signature__` attribute, we may use it " "to create the signature. The exact semantics are an implementation detail " @@ -1176,14 +1203,14 @@ msgid "" "semantics." msgstr "" -#: ../../library/inspect.rst:793 +#: ../../library/inspect.rst:811 msgid "" "A :class:`!Signature` object represents the call signature of a function and " "its return annotation. For each parameter accepted by the function it " "stores a :class:`Parameter` object in its :attr:`parameters` collection." msgstr "" -#: ../../library/inspect.rst:798 +#: ../../library/inspect.rst:816 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -1192,54 +1219,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:804 +#: ../../library/inspect.rst:822 msgid "" "The optional *return_annotation* argument can be an arbitrary Python object. " "It represents the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:807 +#: ../../library/inspect.rst:825 msgid "" ":class:`!Signature` objects are *immutable*. Use :meth:`Signature.replace` " "or :func:`copy.replace` to make a modified copy." msgstr "" -#: ../../library/inspect.rst:810 +#: ../../library/inspect.rst:828 msgid ":class:`!Signature` objects are now picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:815 +#: ../../library/inspect.rst:833 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:819 +#: ../../library/inspect.rst:837 msgid "" "An ordered mapping of parameters' names to the corresponding :class:" "`Parameter` objects. Parameters appear in strict definition order, " "including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:823 ../../library/inspect.rst:1187 +#: ../../library/inspect.rst:841 ../../library/inspect.rst:1205 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " "had always been preserved in Python 3." msgstr "" -#: ../../library/inspect.rst:830 +#: ../../library/inspect.rst:848 msgid "" "The \"return\" annotation for the callable. If the callable has no " "\"return\" annotation, this attribute is set to :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:835 +#: ../../library/inspect.rst:853 msgid "" "Create a mapping from positional and keyword arguments to parameters. " "Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the " "signature, or raises a :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:841 +#: ../../library/inspect.rst:859 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -1247,7 +1274,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:848 +#: ../../library/inspect.rst:866 msgid "" "Create a new :class:`Signature` instance based on the instance :meth:" "`replace` was invoked on. It is possible to pass different *parameters* and/" @@ -1256,7 +1283,7 @@ msgid "" "Signature`, pass in :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:856 +#: ../../library/inspect.rst:874 msgid "" ">>> def test(a, b):\n" "... pass\n" @@ -1274,24 +1301,24 @@ msgstr "" ">>> str(new_sig)\n" "\"(a, b) -> 'new return anno'\"" -#: ../../library/inspect.rst:866 +#: ../../library/inspect.rst:884 msgid "" ":class:`Signature` objects are also supported by the generic function :func:" "`copy.replace`." msgstr "" -#: ../../library/inspect.rst:871 +#: ../../library/inspect.rst:889 msgid "Create a string representation of the :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:873 +#: ../../library/inspect.rst:891 msgid "" "If *max_width* is passed, the method will attempt to fit the signature into " "lines of at most *max_width* characters. If the signature is longer than " "*max_width*, all parameters will be on separate lines." msgstr "" -#: ../../library/inspect.rst:878 +#: ../../library/inspect.rst:896 msgid "" "If *quote_annotation_strings* is False, :term:`annotations ` in " "the signature are displayed without opening and closing quotation marks if " @@ -1300,21 +1327,21 @@ msgid "" "annotations`` was used." msgstr "" -#: ../../library/inspect.rst:886 +#: ../../library/inspect.rst:904 msgid "The *unquote_annotations* parameter was added." msgstr "" -#: ../../library/inspect.rst:891 +#: ../../library/inspect.rst:909 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "*obj*." msgstr "" -#: ../../library/inspect.rst:894 +#: ../../library/inspect.rst:912 msgid "This method simplifies subclassing of :class:`Signature`:" msgstr "" -#: ../../library/inspect.rst:896 +#: ../../library/inspect.rst:914 msgid "" "class MySignature(Signature):\n" " pass\n" @@ -1326,129 +1353,129 @@ msgstr "" "sig = MySignature.from_callable(sum)\n" "assert isinstance(sig, MySignature)" -#: ../../library/inspect.rst:903 +#: ../../library/inspect.rst:921 msgid "Its behavior is otherwise identical to that of :func:`signature`." msgstr "" -#: ../../library/inspect.rst:913 +#: ../../library/inspect.rst:931 msgid "" ":class:`!Parameter` objects are *immutable*. Instead of modifying a :class:`!" "Parameter` object, you can use :meth:`Parameter.replace` or :func:`copy." "replace` to create a modified copy." msgstr "" -#: ../../library/inspect.rst:917 +#: ../../library/inspect.rst:935 msgid "Parameter objects are now picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:922 +#: ../../library/inspect.rst:940 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:927 +#: ../../library/inspect.rst:945 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:932 +#: ../../library/inspect.rst:950 msgid "" "CPython generates implicit parameter names of the form ``.0`` on the code " "objects used to implement comprehensions and generator expressions." msgstr "" -#: ../../library/inspect.rst:936 +#: ../../library/inspect.rst:954 msgid "" "These parameter names are now exposed by this module as names like " "``implicit0``." msgstr "" -#: ../../library/inspect.rst:942 +#: ../../library/inspect.rst:960 msgid "" "The default value for the parameter. If the parameter has no default value, " "this attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:947 +#: ../../library/inspect.rst:965 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:952 +#: ../../library/inspect.rst:970 msgid "" "Describes how argument values are bound to the parameter. The possible " "values are accessible via :class:`Parameter` (like ``Parameter." "KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: ../../library/inspect.rst:959 +#: ../../library/inspect.rst:977 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:959 +#: ../../library/inspect.rst:977 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:961 +#: ../../library/inspect.rst:979 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:961 +#: ../../library/inspect.rst:979 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: ../../library/inspect.rst:966 +#: ../../library/inspect.rst:984 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:966 +#: ../../library/inspect.rst:984 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: ../../library/inspect.rst:971 +#: ../../library/inspect.rst:989 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:971 +#: ../../library/inspect.rst:989 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:976 +#: ../../library/inspect.rst:994 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:976 +#: ../../library/inspect.rst:994 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: ../../library/inspect.rst:981 +#: ../../library/inspect.rst:999 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:981 +#: ../../library/inspect.rst:999 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:987 +#: ../../library/inspect.rst:1005 msgid "Example: print all keyword-only arguments without default values:" msgstr "" -#: ../../library/inspect.rst:989 +#: ../../library/inspect.rst:1007 msgid "" ">>> def foo(a, b, *, c, d=10):\n" "... pass\n" @@ -1470,15 +1497,15 @@ msgstr "" "... print('Parameter:', param)\n" "Parameter: c" -#: ../../library/inspect.rst:1003 +#: ../../library/inspect.rst:1021 msgid "Describes an enum value of :attr:`Parameter.kind`." msgstr "" -#: ../../library/inspect.rst:1007 +#: ../../library/inspect.rst:1025 msgid "Example: print all descriptions of arguments:" msgstr "範例:列印所有引數的描述:" -#: ../../library/inspect.rst:1009 +#: ../../library/inspect.rst:1027 msgid "" ">>> def foo(a, b, *, c, d=10):\n" "... pass\n" @@ -1502,7 +1529,7 @@ msgstr "" "keyword-only\n" "keyword-only" -#: ../../library/inspect.rst:1024 +#: ../../library/inspect.rst:1042 msgid "" "Create a new :class:`Parameter` instance based on the instance replaced was " "invoked on. To override a :class:`!Parameter` attribute, pass the " @@ -1510,7 +1537,7 @@ msgid "" "a :class:`!Parameter`, pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:1029 +#: ../../library/inspect.rst:1047 msgid "" ">>> from inspect import Parameter\n" ">>> param = Parameter('foo', Parameter.KEYWORD_ONLY, default=42)\n" @@ -1534,83 +1561,83 @@ msgstr "" ">>> str(param.replace(default=Parameter.empty, annotation='spam'))\n" "\"foo: 'spam'\"" -#: ../../library/inspect.rst:1042 +#: ../../library/inspect.rst:1060 msgid "" ":class:`Parameter` objects are also supported by the generic function :func:" "`copy.replace`." msgstr "" -#: ../../library/inspect.rst:1045 +#: ../../library/inspect.rst:1063 msgid "" "In Python 3.3 :class:`Parameter` objects were allowed to have ``name`` set " "to ``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no " "longer permitted." msgstr "" -#: ../../library/inspect.rst:1052 +#: ../../library/inspect.rst:1070 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: ../../library/inspect.rst:1057 +#: ../../library/inspect.rst:1075 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " "explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" "attr:`args` and :attr:`kwargs`." msgstr "" -#: ../../library/inspect.rst:1061 +#: ../../library/inspect.rst:1079 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:1066 +#: ../../library/inspect.rst:1084 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " "relied on a default value are skipped. However, if needed, use :meth:" "`BoundArguments.apply_defaults` to add them." msgstr "" -#: ../../library/inspect.rst:1071 +#: ../../library/inspect.rst:1089 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:1077 +#: ../../library/inspect.rst:1095 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:1082 +#: ../../library/inspect.rst:1100 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute. Arguments that can be passed positionally are " "included in :attr:`args` instead." msgstr "" -#: ../../library/inspect.rst:1088 +#: ../../library/inspect.rst:1106 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:1092 +#: ../../library/inspect.rst:1110 msgid "Set default values for missing arguments." msgstr "為遺漏的引數設定預設值。" -#: ../../library/inspect.rst:1094 +#: ../../library/inspect.rst:1112 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:1097 +#: ../../library/inspect.rst:1115 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:1100 +#: ../../library/inspect.rst:1118 msgid "" ">>> def foo(a, b='ham', *args): pass\n" ">>> ba = inspect.signature(foo).bind('spam')\n" @@ -1624,13 +1651,13 @@ msgstr "" ">>> ba.arguments\n" "{'a': 'spam', 'b': 'ham', 'args': ()}" -#: ../../library/inspect.rst:1110 +#: ../../library/inspect.rst:1128 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions:" msgstr "" -#: ../../library/inspect.rst:1113 +#: ../../library/inspect.rst:1131 msgid "" "def test(a, *, b):\n" " ...\n" @@ -1646,19 +1673,19 @@ msgstr "" "ba = sig.bind(10, b=20)\n" "test(*ba.args, **ba.kwargs)" -#: ../../library/inspect.rst:1125 +#: ../../library/inspect.rst:1143 msgid ":pep:`362` - Function Signature Object." msgstr ":pep:`362` - 函式簽名物件。" -#: ../../library/inspect.rst:1126 +#: ../../library/inspect.rst:1144 msgid "The detailed specification, implementation details and examples." msgstr "詳細的規格、實作細節和範例。" -#: ../../library/inspect.rst:1132 +#: ../../library/inspect.rst:1150 msgid "Classes and functions" msgstr "類別與函式" -#: ../../library/inspect.rst:1136 +#: ../../library/inspect.rst:1154 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1669,13 +1696,13 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:1147 +#: ../../library/inspect.rst:1165 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:1150 +#: ../../library/inspect.rst:1168 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" @@ -1683,7 +1710,7 @@ msgstr "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" -#: ../../library/inspect.rst:1153 +#: ../../library/inspect.rst:1171 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1698,7 +1725,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:1168 +#: ../../library/inspect.rst:1186 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1708,14 +1735,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1175 +#: ../../library/inspect.rst:1193 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: ../../library/inspect.rst:1180 +#: ../../library/inspect.rst:1198 msgid "" "This method was previously documented as deprecated in favour of :func:" "`signature` in Python 3.5, but that decision has been reversed in order to " @@ -1723,7 +1750,7 @@ msgid "" "code migrating away from the legacy :func:`!getargspec` API." msgstr "" -#: ../../library/inspect.rst:1195 +#: ../../library/inspect.rst:1213 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1732,18 +1759,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1202 ../../library/inspect.rst:1212 +#: ../../library/inspect.rst:1220 ../../library/inspect.rst:1230 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1207 +#: ../../library/inspect.rst:1225 msgid "" "Format a pretty argument spec from the four values returned by :func:" "`getargvalues`. The format\\* arguments are the corresponding optional " "formatting functions that are called to turn names and values into strings." msgstr "" -#: ../../library/inspect.rst:1217 +#: ../../library/inspect.rst:1235 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1751,7 +1778,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1225 +#: ../../library/inspect.rst:1243 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1764,7 +1791,7 @@ msgid "" "example:" msgstr "" -#: ../../library/inspect.rst:1234 +#: ../../library/inspect.rst:1252 msgid "" ">>> from inspect import getcallargs\n" ">>> def f(a, b=1, *pos, **named):\n" @@ -1794,11 +1821,11 @@ msgstr "" "...\n" "TypeError: f() missing 1 required positional argument: 'a'" -#: ../../library/inspect.rst:1251 +#: ../../library/inspect.rst:1269 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "請改用 :meth:`Signature.bind` 與 :meth:`Signature.bind_partial`。" -#: ../../library/inspect.rst:1257 +#: ../../library/inspect.rst:1275 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1810,18 +1837,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1266 +#: ../../library/inspect.rst:1284 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "如果 *func* 不是 Python 函式或方法,則引發 :exc:`TypeError`。" -#: ../../library/inspect.rst:1273 +#: ../../library/inspect.rst:1291 msgid "" "Get the object wrapped by *func*. It follows the chain of :attr:" "`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: ../../library/inspect.rst:1276 +#: ../../library/inspect.rst:1294 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " @@ -1831,37 +1858,37 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1283 +#: ../../library/inspect.rst:1301 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "如果遇到循環,則引發 :exc:`ValueError`。" -#: ../../library/inspect.rst:1290 +#: ../../library/inspect.rst:1308 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1292 +#: ../../library/inspect.rst:1310 msgid "" "This is an alias for :func:`annotationlib.get_annotations`; see the " "documentation of that function for more information." msgstr "" -#: ../../library/inspect.rst:1297 +#: ../../library/inspect.rst:1315 msgid "" "This function may execute arbitrary code contained in annotations. See :ref:" "`annotationlib-security` for more information." msgstr "" -#: ../../library/inspect.rst:1302 +#: ../../library/inspect.rst:1320 msgid "" "This function is now an alias for :func:`annotationlib.get_annotations`. " "Calling it as ``inspect.get_annotations`` will continue to work." msgstr "" -#: ../../library/inspect.rst:1310 +#: ../../library/inspect.rst:1328 msgid "The interpreter stack" msgstr "直譯器堆疊" -#: ../../library/inspect.rst:1312 +#: ../../library/inspect.rst:1330 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1869,95 +1896,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1321 +#: ../../library/inspect.rst:1339 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1325 +#: ../../library/inspect.rst:1343 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1330 +#: ../../library/inspect.rst:1348 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1335 +#: ../../library/inspect.rst:1353 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1339 +#: ../../library/inspect.rst:1357 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1344 ../../library/inspect.rst:1383 +#: ../../library/inspect.rst:1362 ../../library/inspect.rst:1401 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1348 +#: ../../library/inspect.rst:1366 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1352 +#: ../../library/inspect.rst:1370 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1355 +#: ../../library/inspect.rst:1373 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1364 +#: ../../library/inspect.rst:1382 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1369 +#: ../../library/inspect.rst:1387 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1374 +#: ../../library/inspect.rst:1392 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1378 +#: ../../library/inspect.rst:1396 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1387 +#: ../../library/inspect.rst:1405 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1392 +#: ../../library/inspect.rst:1410 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1399 +#: ../../library/inspect.rst:1417 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1969,7 +1996,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1407 +#: ../../library/inspect.rst:1425 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " "local variables) can be made deterministic by removing the cycle in a :" @@ -1977,7 +2004,7 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1412 +#: ../../library/inspect.rst:1430 msgid "" "def handle_stackframe_without_leak():\n" " frame = inspect.currentframe()\n" @@ -1987,31 +2014,31 @@ msgid "" " del frame" msgstr "" -#: ../../library/inspect.rst:1419 +#: ../../library/inspect.rst:1437 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: ../../library/inspect.rst:1423 +#: ../../library/inspect.rst:1441 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: ../../library/inspect.rst:1430 +#: ../../library/inspect.rst:1448 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1433 +#: ../../library/inspect.rst:1451 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1438 +#: ../../library/inspect.rst:1456 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -2019,19 +2046,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1443 ../../library/inspect.rst:1458 -#: ../../library/inspect.rst:1484 ../../library/inspect.rst:1499 +#: ../../library/inspect.rst:1461 ../../library/inspect.rst:1476 +#: ../../library/inspect.rst:1502 ../../library/inspect.rst:1517 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1448 ../../library/inspect.rst:1463 -#: ../../library/inspect.rst:1489 ../../library/inspect.rst:1504 +#: ../../library/inspect.rst:1466 ../../library/inspect.rst:1481 +#: ../../library/inspect.rst:1507 ../../library/inspect.rst:1522 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "回傳一個 :class:`FrameInfo` 物件串列。" -#: ../../library/inspect.rst:1453 +#: ../../library/inspect.rst:1471 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -2039,11 +2066,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1468 +#: ../../library/inspect.rst:1486 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1472 +#: ../../library/inspect.rst:1490 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -2051,14 +2078,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1480 +#: ../../library/inspect.rst:1498 msgid "" "Return a list of :class:`FrameInfo` objects for the caller's stack. The " "first entry in the returned list represents the caller; the last entry " "represents the outermost call on the stack." msgstr "" -#: ../../library/inspect.rst:1494 +#: ../../library/inspect.rst:1512 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -2066,11 +2093,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1508 +#: ../../library/inspect.rst:1526 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1510 +#: ../../library/inspect.rst:1528 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -2078,20 +2105,20 @@ msgid "" "`~object.__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1516 +#: ../../library/inspect.rst:1534 msgid "" "For cases where you want passive introspection, like documentation tools, " "this can be inconvenient. :func:`getattr_static` has the same signature as :" "func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: ../../library/inspect.rst:1522 +#: ../../library/inspect.rst:1540 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`~object.__getattr__` or :meth:`~object.__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1526 +#: ../../library/inspect.rst:1544 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -2099,27 +2126,27 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1532 +#: ../../library/inspect.rst:1550 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: ../../library/inspect.rst:1538 +#: ../../library/inspect.rst:1556 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: ../../library/inspect.rst:1542 +#: ../../library/inspect.rst:1560 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: ../../library/inspect.rst:1546 +#: ../../library/inspect.rst:1564 msgid "" "# example code for resolving the builtin descriptor types\n" "class _foo:\n" @@ -2142,11 +2169,11 @@ msgid "" " pass" msgstr "" -#: ../../library/inspect.rst:1568 +#: ../../library/inspect.rst:1586 msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: ../../library/inspect.rst:1570 +#: ../../library/inspect.rst:1588 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -2155,32 +2182,32 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1578 +#: ../../library/inspect.rst:1596 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1580 ../../library/inspect.rst:1596 -#: ../../library/inspect.rst:1613 +#: ../../library/inspect.rst:1598 ../../library/inspect.rst:1614 +#: ../../library/inspect.rst:1631 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1582 +#: ../../library/inspect.rst:1600 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1583 +#: ../../library/inspect.rst:1601 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1584 +#: ../../library/inspect.rst:1602 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1585 +#: ../../library/inspect.rst:1603 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1591 +#: ../../library/inspect.rst:1609 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -2188,23 +2215,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1598 +#: ../../library/inspect.rst:1616 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1599 +#: ../../library/inspect.rst:1617 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1600 +#: ../../library/inspect.rst:1618 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1601 +#: ../../library/inspect.rst:1619 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1607 +#: ../../library/inspect.rst:1625 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -2213,30 +2240,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1615 +#: ../../library/inspect.rst:1633 msgid "AGEN_CREATED: Waiting to start execution." msgstr "AGEN_CREATED: 等待開始執行。" -#: ../../library/inspect.rst:1616 +#: ../../library/inspect.rst:1634 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "AGEN_RUNNING: 目前正在被直譯器執行。" -#: ../../library/inspect.rst:1617 +#: ../../library/inspect.rst:1635 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "AGEN_SUSPENDED: 目前於 yield 運算式暫停。" -#: ../../library/inspect.rst:1618 +#: ../../library/inspect.rst:1636 msgid "AGEN_CLOSED: Execution has completed." msgstr "AGEN_CLOSED: 執行已完成。" -#: ../../library/inspect.rst:1622 +#: ../../library/inspect.rst:1640 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: ../../library/inspect.rst:1628 +#: ../../library/inspect.rst:1646 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -2244,14 +2271,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1633 +#: ../../library/inspect.rst:1651 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: ../../library/inspect.rst:1639 +#: ../../library/inspect.rst:1657 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -2259,90 +2286,90 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1648 +#: ../../library/inspect.rst:1666 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1655 +#: ../../library/inspect.rst:1673 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for asynchronous generator objects created by :keyword:`async def` functions " "which use the :keyword:`yield` statement." msgstr "" -#: ../../library/inspect.rst:1665 +#: ../../library/inspect.rst:1683 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1667 +#: ../../library/inspect.rst:1685 msgid "" "Python code objects have a :attr:`~codeobject.co_flags` attribute, which is " "a bitmap of the following flags:" msgstr "" -#: ../../library/inspect.rst:1672 +#: ../../library/inspect.rst:1690 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1676 +#: ../../library/inspect.rst:1694 msgid "" "If set, a new dict will be created for the frame's :attr:`~frame.f_locals` " "when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1681 +#: ../../library/inspect.rst:1699 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1685 +#: ../../library/inspect.rst:1703 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1689 +#: ../../library/inspect.rst:1707 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1693 +#: ../../library/inspect.rst:1711 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1698 +#: ../../library/inspect.rst:1716 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: ../../library/inspect.rst:1706 +#: ../../library/inspect.rst:1724 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: ../../library/inspect.rst:1715 +#: ../../library/inspect.rst:1733 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: ../../library/inspect.rst:1723 +#: ../../library/inspect.rst:1741 msgid "" "The flag is set when there is a docstring for the code object in the source " "code. If set, it will be the first item in :attr:`~codeobject.co_consts`." msgstr "" -#: ../../library/inspect.rst:1731 +#: ../../library/inspect.rst:1749 msgid "" "The flag is set when the code object is a function defined in class scope." msgstr "" -#: ../../library/inspect.rst:1737 +#: ../../library/inspect.rst:1755 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -2350,39 +2377,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1745 +#: ../../library/inspect.rst:1763 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1749 +#: ../../library/inspect.rst:1767 msgid "" "This is an :class:`enum.IntFlag` that represents the flags that can be " "passed to the :meth:`~object.__buffer__` method of objects implementing the :" "ref:`buffer protocol `." msgstr "" -#: ../../library/inspect.rst:1753 +#: ../../library/inspect.rst:1771 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1780 +#: ../../library/inspect.rst:1798 msgid "Command-line interface" msgstr "命令列介面" -#: ../../library/inspect.rst:1782 +#: ../../library/inspect.rst:1800 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1787 +#: ../../library/inspect.rst:1805 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: ../../library/inspect.rst:1793 +#: ../../library/inspect.rst:1811 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 0badcc92a7..e9f6f15c1c 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2025-12-29 00:16+0000\n" "PO-Revision-Date: 2025-06-21 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -413,7 +413,13 @@ msgid "" "Objects created via this constructor cannot be pickled (see `pickling`_)." msgstr "透過此建構函式建立的物件無法被封裝(參閱 `pickling`_)。" -#: ../../library/zoneinfo.rst:211 +#: ../../library/zoneinfo.rst:209 +msgid "" +":exc:`ValueError` is raised if the data read from *file_obj* is not a valid " +"TZif file." +msgstr "" + +#: ../../library/zoneinfo.rst:214 msgid "" "An alternate constructor that bypasses the constructor's cache. It is " "identical to the primary constructor, but returns a new object on each call. " @@ -425,13 +431,13 @@ msgstr "" "一個新物件。這對於測試或示範目的最可能有用,但它也可以用來建立一個具有不同快" "取失效策略的系統。" -#: ../../library/zoneinfo.rst:217 +#: ../../library/zoneinfo.rst:220 msgid "" "Objects created via this constructor will also bypass the cache of a " "deserializing process when unpickled." msgstr "透過此建構函式建立的物件,在拆封時也會繞過去序列化過程的快取。" -#: ../../library/zoneinfo.rst:224 +#: ../../library/zoneinfo.rst:227 msgid "" "Using this constructor may change the semantics of your datetimes in " "surprising ways, only use it if you know that you need to." @@ -439,11 +445,11 @@ msgstr "" "使用此建構函式可能會以意想不到的方式改變你的 datetime 物件的語意,只有在你確" "定需要時才使用它。" -#: ../../library/zoneinfo.rst:227 +#: ../../library/zoneinfo.rst:230 msgid "The following class methods are also available:" msgstr "以下類別方法也可用:" -#: ../../library/zoneinfo.rst:231 +#: ../../library/zoneinfo.rst:234 msgid "" "A method for invalidating the cache on the ``ZoneInfo`` class. If no " "arguments are passed, all caches are invalidated and the next call to the " @@ -452,7 +458,7 @@ msgstr "" "一個用於使 ``ZoneInfo`` 類別上的快取失效的方法。如果沒有傳入引數,所有快取都" "會失效,且下一次對每個鍵的主要建構函式呼叫都將回傳一個新的實例。" -#: ../../library/zoneinfo.rst:235 +#: ../../library/zoneinfo.rst:238 msgid "" "If an iterable of key names is passed to the ``only_keys`` parameter, only " "the specified keys will be removed from the cache. Keys passed to " @@ -461,7 +467,7 @@ msgstr "" "如果將一個包含鍵名的可疊代物件傳遞給 ``only_keys`` 參數,則只有指定的鍵會從快" "取中移除。傳遞給 ``only_keys`` 但在快取中找不到的鍵會被忽略。" -#: ../../library/zoneinfo.rst:243 +#: ../../library/zoneinfo.rst:246 msgid "" "Invoking this function may change the semantics of datetimes using " "``ZoneInfo`` in surprising ways; this modifies module state and thus may " @@ -470,11 +476,11 @@ msgstr "" "呼叫此函式可能會以意想不到的方式改變使用 ``ZoneInfo`` 的 datetime 物件的語" "意;這會修改模組狀態,因此可能產生廣泛的影響。只有在你確定需要時才使用它。" -#: ../../library/zoneinfo.rst:248 +#: ../../library/zoneinfo.rst:251 msgid "The class has one attribute:" msgstr "該類別有一個屬性:" -#: ../../library/zoneinfo.rst:252 +#: ../../library/zoneinfo.rst:255 msgid "" "This is a read-only :term:`attribute` that returns the value of ``key`` " "passed to the constructor, which should be a lookup key in the IANA time " @@ -485,13 +491,13 @@ msgstr "" "值應為 IANA 時區資料庫中的查詢鍵(例如 ``America/New_York``、``Europe/" "Paris`` 或 ``Asia/Tokyo``)。" -#: ../../library/zoneinfo.rst:257 +#: ../../library/zoneinfo.rst:260 msgid "" "For zones constructed from file without specifying a ``key`` parameter, this " "will be set to ``None``." msgstr "對於從檔案建構且未指定 ``key`` 參數的時區,此屬性將被設定為 ``None``。" -#: ../../library/zoneinfo.rst:262 +#: ../../library/zoneinfo.rst:265 msgid "" "Although it is a somewhat common practice to expose these to end users, " "these values are designed to be primary keys for representing the relevant " @@ -503,11 +509,11 @@ msgstr "" "區的主鍵,而不一定是面向使用者的元素。像 CLDR(Unicode 通用地區資料儲存庫)這" "樣的專案可以用來從這些鍵中取得更友善的使用者字串。" -#: ../../library/zoneinfo.rst:269 +#: ../../library/zoneinfo.rst:272 msgid "String representations" msgstr "字串表示" -#: ../../library/zoneinfo.rst:271 +#: ../../library/zoneinfo.rst:274 msgid "" "The string representation returned when calling :py:class:`str` on a :class:" "`ZoneInfo` object defaults to using the :attr:`ZoneInfo.key` attribute (see " @@ -516,7 +522,7 @@ msgstr "" "在 :class:`ZoneInfo` 物件上呼叫 :py:class:`str` 時回傳的字串表示,預設使用 :" "attr:`ZoneInfo.key` 屬性(參閱屬性文件中的使用說明): ::" -#: ../../library/zoneinfo.rst:275 +#: ../../library/zoneinfo.rst:278 msgid "" ">>> zone = ZoneInfo(\"Pacific/Kwajalein\")\n" ">>> str(zone)\n" @@ -534,7 +540,7 @@ msgstr "" ">>> f\"{dt.isoformat()} [{dt.tzinfo}]\"\n" "'2020-04-01T03:15:00+12:00 [Pacific/Kwajalein]'" -#: ../../library/zoneinfo.rst:283 +#: ../../library/zoneinfo.rst:286 msgid "" "For objects constructed from a file without specifying a ``key`` parameter, " "``str`` falls back to calling :func:`repr`. ``ZoneInfo``'s ``repr`` is " @@ -545,11 +551,11 @@ msgstr "" "``ZoneInfo`` 的 ``repr`` 是實作定義的,且不保證在不同版本之間保持穩定,但保證" "它不會是一個有效的 ``ZoneInfo`` 鍵。" -#: ../../library/zoneinfo.rst:291 +#: ../../library/zoneinfo.rst:294 msgid "Pickle serialization" msgstr "封裝(Pickle)序列化" -#: ../../library/zoneinfo.rst:293 +#: ../../library/zoneinfo.rst:296 msgid "" "Rather than serializing all transition data, ``ZoneInfo`` objects are " "serialized by key, and ``ZoneInfo`` objects constructed from files (even " @@ -558,11 +564,11 @@ msgstr "" "``ZoneInfo`` 物件不是序列化所有轉換資料,而是按鍵進行序列化,而從檔案建構的 " "``ZoneInfo`` 物件(即使是那些指定了 ``key`` 值的物件)也無法被封裝。" -#: ../../library/zoneinfo.rst:297 +#: ../../library/zoneinfo.rst:300 msgid "The behavior of a ``ZoneInfo`` file depends on how it was constructed:" msgstr "``ZoneInfo`` 檔案的行為取決於它的建構方式:" -#: ../../library/zoneinfo.rst:299 +#: ../../library/zoneinfo.rst:302 msgid "" "``ZoneInfo(key)``: When constructed with the primary constructor, a " "``ZoneInfo`` object is serialized by key, and when deserialized, the " @@ -572,11 +578,11 @@ msgid "" "``ZoneInfo(\"Europe/Berlin\")``, one would expect the following behavior:" msgstr "" "``ZoneInfo(key)``:當使用主要建構函式建構時,``ZoneInfo`` 物件會按鍵序列化," -"而在去序列化時,去序列化過程會使用主要建構函式,因此這些物件會與指向相同" -"時區的其他參照是同一個物件。例如,如果 ``europe_berlin_pkl`` 是一個包含從 " +"而在去序列化時,去序列化過程會使用主要建構函式,因此這些物件會與指向相同時區" +"的其他參照是同一個物件。例如,如果 ``europe_berlin_pkl`` 是一個包含從 " "``ZoneInfo(\"Europe/Berlin\")`` 建構並封裝的字串,會預期以下行為:" -#: ../../library/zoneinfo.rst:307 +#: ../../library/zoneinfo.rst:310 msgid "" ">>> a = ZoneInfo(\"Europe/Berlin\")\n" ">>> b = pickle.loads(europe_berlin_pkl)\n" @@ -588,7 +594,7 @@ msgstr "" ">>> a is b\n" "True" -#: ../../library/zoneinfo.rst:314 +#: ../../library/zoneinfo.rst:317 msgid "" "``ZoneInfo.no_cache(key)``: When constructed from the cache-bypassing " "constructor, the ``ZoneInfo`` object is also serialized by key, but when " @@ -602,7 +608,7 @@ msgstr "" "``europe_berlin_pkl_nc`` 是一個包含從 ``ZoneInfo.no_cache(\"Europe/" "Berlin\")`` 建構並封裝的字串,會預期以下行為:" -#: ../../library/zoneinfo.rst:321 +#: ../../library/zoneinfo.rst:324 msgid "" ">>> a = ZoneInfo(\"Europe/Berlin\")\n" ">>> b = pickle.loads(europe_berlin_pkl_nc)\n" @@ -614,7 +620,7 @@ msgstr "" ">>> a is b\n" "False" -#: ../../library/zoneinfo.rst:328 +#: ../../library/zoneinfo.rst:331 msgid "" "``ZoneInfo.from_file(file_obj, /, key=None)``: When constructed from a file, " "the ``ZoneInfo`` object raises an exception on pickling. If an end user " @@ -628,7 +634,7 @@ msgstr "" "建議他們使用包裝器型別或自訂序列化函式:可以按鍵序列化,或儲存檔案物件的內容" "並將其序列化。" -#: ../../library/zoneinfo.rst:334 +#: ../../library/zoneinfo.rst:337 msgid "" "This method of serialization requires that the time zone data for the " "required key be available on both the serializing and deserializing side, " @@ -642,11 +648,11 @@ msgstr "" "函式的參照預期存在於序列化和去序列化環境中的方式相似。這也意味著,當在具有不" "同版本時區資料的環境中拆封一個封裝的 ``ZoneInfo`` 時,不保證結果的一致性。" -#: ../../library/zoneinfo.rst:342 +#: ../../library/zoneinfo.rst:345 msgid "Functions" msgstr "函式" -#: ../../library/zoneinfo.rst:346 +#: ../../library/zoneinfo.rst:349 msgid "" "Get a set containing all the valid keys for IANA time zones available " "anywhere on the time zone path. This is recalculated on every call to the " @@ -655,7 +661,7 @@ msgstr "" "取得一個集合,其中包含時區路徑上任何地方可用的所有 IANA 時區的有效鍵。這會在" "每次呼叫函式時重新計算。" -#: ../../library/zoneinfo.rst:350 +#: ../../library/zoneinfo.rst:353 msgid "" "This function only includes canonical zone names and does not include " "\"special\" zones such as those under the ``posix/`` and ``right/`` " @@ -664,7 +670,7 @@ msgstr "" "此函式僅包含規範的時區名稱,不包含「特殊」時區,例如 ``posix/`` 和 ``right/" "`` 目錄下的時區,或 ``posixrules`` 時區。" -#: ../../library/zoneinfo.rst:356 +#: ../../library/zoneinfo.rst:359 msgid "" "This function may open a large number of files, as the best way to determine " "if a file on the time zone path is a valid time zone is to read the \"magic " @@ -673,7 +679,7 @@ msgstr "" "此函式可能會開啟大量檔案,因為確定時區路徑上的檔案是否為有效時區的最佳方法是" "讀取開頭的「魔術字串」。" -#: ../../library/zoneinfo.rst:362 +#: ../../library/zoneinfo.rst:365 msgid "" "These values are not designed to be exposed to end-users; for user facing " "elements, applications should use something like CLDR (the Unicode Common " @@ -684,7 +690,7 @@ msgstr "" "(Unicode 通用地區資料儲存庫)這樣的工具來取得更友善的使用者字串。另請參閱關" "於 :attr:`ZoneInfo.key` 的警示說明。" -#: ../../library/zoneinfo.rst:369 +#: ../../library/zoneinfo.rst:372 msgid "" "Sets or resets the time zone search path (:data:`TZPATH`) for the module. " "When called with no arguments, :data:`TZPATH` is set to the default value." @@ -692,7 +698,7 @@ msgstr "" "為模組設定或重設時區搜尋路徑(:data:`TZPATH`)。當不帶引數呼叫時,:data:" "`TZPATH` 會被設定為預設值。" -#: ../../library/zoneinfo.rst:372 +#: ../../library/zoneinfo.rst:375 msgid "" "Calling ``reset_tzpath`` will not invalidate the :class:`ZoneInfo` cache, " "and so calls to the primary ``ZoneInfo`` constructor will only use the new " @@ -701,7 +707,7 @@ msgstr "" "呼叫 ``reset_tzpath`` 不會使 :class:`ZoneInfo` 快取失效,因此對主要 " "``ZoneInfo`` 建構函式的呼叫只會在快取未命中時才使用新的 ``TZPATH``。" -#: ../../library/zoneinfo.rst:376 +#: ../../library/zoneinfo.rst:379 msgid "" "The ``to`` parameter must be a :term:`sequence` of strings or :class:`os." "PathLike` and not a string, all of which must be absolute paths. :exc:" @@ -712,11 +718,11 @@ msgstr "" "`,而不是一個字串,其中所有元素都必須是絕對路徑。如果傳入的不是絕對" "路徑,將會引發 :exc:`ValueError` 例外。" -#: ../../library/zoneinfo.rst:382 +#: ../../library/zoneinfo.rst:385 msgid "Globals" msgstr "全域變數" -#: ../../library/zoneinfo.rst:386 +#: ../../library/zoneinfo.rst:389 msgid "" "A read-only sequence representing the time zone search path -- when " "constructing a ``ZoneInfo`` from a key, the key is joined to each entry in " @@ -725,13 +731,13 @@ msgstr "" "一個表示時區搜尋路徑的唯讀序列 —— 當從一個鍵建構 ``ZoneInfo`` 時,該鍵會與 " "``TZPATH`` 中的每個條目結合,並使用找到的第一個檔案。" -#: ../../library/zoneinfo.rst:390 +#: ../../library/zoneinfo.rst:393 msgid "" "``TZPATH`` may contain only absolute paths, never relative paths, regardless " "of how it is configured." msgstr "``TZPATH`` 只能包含絕對路徑,絕不能包含相對路徑,無論如何設定。" -#: ../../library/zoneinfo.rst:393 +#: ../../library/zoneinfo.rst:396 msgid "" "The object that ``zoneinfo.TZPATH`` points to may change in response to a " "call to :func:`reset_tzpath`, so it is recommended to use ``zoneinfo." @@ -742,18 +748,18 @@ msgstr "" "變,因此建議使用 ``zoneinfo.TZPATH``,而不是從 ``zoneinfo`` 引入 ``TZPATH`` " "或將一個長生命週期的變數賦值給 ``zoneinfo.TZPATH``。" -#: ../../library/zoneinfo.rst:398 +#: ../../library/zoneinfo.rst:401 msgid "" "For more information on configuring the time zone search path, see :ref:" "`zoneinfo_data_configuration`." msgstr "" "有關設定時區搜尋路徑的更多資訊,請參閱 :ref:`zoneinfo_data_configuration`。" -#: ../../library/zoneinfo.rst:402 +#: ../../library/zoneinfo.rst:405 msgid "Exceptions and warnings" msgstr "例外與警告" -#: ../../library/zoneinfo.rst:406 +#: ../../library/zoneinfo.rst:409 msgid "" "Raised when construction of a :class:`ZoneInfo` object fails because the " "specified key could not be found on the system. This is a subclass of :exc:" @@ -762,7 +768,7 @@ msgstr "" "當建構 :class:`ZoneInfo` 物件因在系統上找不到指定的鍵而失敗時引發。這是 :exc:" "`KeyError` 的一個子類別。" -#: ../../library/zoneinfo.rst:412 +#: ../../library/zoneinfo.rst:415 msgid "" "Raised when :envvar:`PYTHONTZPATH` contains an invalid component that will " "be filtered out, such as a relative path." From 348e49d6d7b9261a3630a9c967de2a8d3b7d3b49 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 00:16:42 +0000 Subject: [PATCH 04/11] sync with cpython 7ff87fa8 --- library/ast.po | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/library/ast.po b/library/ast.po index 6100aef028..606599a2e3 100644 --- a/library/ast.po +++ b/library/ast.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-19 00:15+0000\n" +"POT-Creation-Date: 2025-12-30 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -188,7 +188,7 @@ msgid "" "int? end_col_offset)\n" "\n" " arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,\n" -" expr* kw_defaults, arg? kwarg, expr* defaults)\n" +" expr?* kw_defaults, arg? kwarg, expr* defaults)\n" "\n" " arg = (identifier arg, expr? annotation, string? type_comment)\n" " attributes (int lineno, int col_offset, int? end_lineno, int? " @@ -413,9 +413,10 @@ msgid "" "removed in Python 3.14, and their functionality has been replaced with :" "class:`ast.Constant`." msgstr "" -"過去的 Python 版本提供了 AST 類別 :class:`!ast.Num`、:class:`!ast.Str`、:class:`!ast.Bytes`" -"、:class:`!ast.NameConstant` 和 :class:`!ast.Ellipsis`,這些類別在 Python 3.8 中已被棄用。" -"這些類別在 Python 3.14 中被移除,其功能已被 :class:`ast.Constant` 取代。" +"過去的 Python 版本提供了 AST 類別 :class:`!ast.Num`、:class:`!ast.Str`、:" +"class:`!ast.Bytes`、:class:`!ast.NameConstant` 和 :class:`!ast.Ellipsis`,這" +"些類別在 Python 3.8 中已被棄用。這些類別在 Python 3.14 中被移除,其功能已被 :" +"class:`ast.Constant` 取代。" #: ../../library/ast.rst:152 msgid "" @@ -4270,8 +4271,8 @@ msgid "" "constant nodes." msgstr "" ":meth:`!visit_Num`、:meth:`!visit_Str`、:meth:`!visit_Bytes`、:meth:`!" -"visit_NameConstant` 和 :meth:`!visit_Ellipsis` 方法在 Python 3.14+ 中將不會被呼叫。" -"請改為新增 :meth:`visit_Constant` 方法來處理所有常數節點。" +"visit_NameConstant` 和 :meth:`!visit_Ellipsis` 方法在 Python 3.14+ 中將不會被" +"呼叫。請改為新增 :meth:`visit_Constant` 方法來處理所有常數節點。" #: ../../library/ast.rst:2447 msgid "" From 1bcd75c1bf31de0d1e79132e4e9681155dfcdd30 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 31 Dec 2025 00:17:38 +0000 Subject: [PATCH 05/11] sync with cpython 38f23604 --- library/concurrent.futures.po | 133 +++---- library/textwrap.po | 87 ++--- reference/import.po | 576 +++++++++++++++--------------- whatsnew/3.14.po | 644 +++++++++++++++++----------------- 4 files changed, 727 insertions(+), 713 deletions(-) diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 27a025e3b4..d481555ccf 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-26 00:15+0000\n" +"POT-Creation-Date: 2025-12-31 00:16+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -371,7 +371,7 @@ msgstr "" "thread) 的 :class:`threading.Thread` 名稱,以便於除錯。" #: ../../library/concurrent.futures.rst:188 -#: ../../library/concurrent.futures.rst:393 +#: ../../library/concurrent.futures.rst:398 msgid "Added the *initializer* and *initargs* arguments." msgstr "新增 *initializer* 與 *initargs* 引數。" @@ -650,7 +650,14 @@ msgstr "" "數的情況下,將預設使用 \"spawn\" 做為 multiprocessing 啟動方法。此功能與 " "\"fork\" 啟動方法不相容。" -#: ../../library/concurrent.futures.rst:382 +#: ../../library/concurrent.futures.rst:383 +msgid "" +"Bugs have been reported when using the *max_tasks_per_child* feature that " +"can result in the :class:`ProcessPoolExecutor` hanging in some " +"circumstances. Follow its eventual resolution in :gh:`115634`." +msgstr "" + +#: ../../library/concurrent.futures.rst:387 msgid "" "When one of the worker processes terminates abruptly, a :exc:`~concurrent." "futures.process.BrokenProcessPool` error is now raised. Previously, " @@ -661,21 +668,21 @@ msgstr "" "BrokenProcessPool` 錯誤。在過去,此行為是未定義的 (undefined),但對 executor " "或其 future 的操作經常會發生凍結或死鎖。" -#: ../../library/concurrent.futures.rst:389 +#: ../../library/concurrent.futures.rst:394 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" "新增了 *mp_context* 引數以允許使用者控制由池所建立的工作行程的 start_method。" -#: ../../library/concurrent.futures.rst:395 +#: ../../library/concurrent.futures.rst:400 msgid "" "The *max_tasks_per_child* argument was added to allow users to control the " "lifetime of workers in the pool." msgstr "" "新增了 *max_tasks_per_child* 引數以允許使用者控制池中 worker 的生命週期。" -#: ../../library/concurrent.futures.rst:399 +#: ../../library/concurrent.futures.rst:404 msgid "" "On POSIX systems, if your application has multiple threads and the :mod:" "`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." @@ -688,13 +695,13 @@ msgstr "" "能會引發 :exc:`DeprecationWarning`。傳遞一個 *mp_context* 以配置為使用不同的" "啟動方法。更多說明請參閱 :func:`os.fork` 文件。" -#: ../../library/concurrent.futures.rst:407 +#: ../../library/concurrent.futures.rst:412 msgid "" "*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:" "`os.cpu_count`." msgstr "" -#: ../../library/concurrent.futures.rst:411 +#: ../../library/concurrent.futures.rst:416 msgid "" "The default process start method (see :ref:`multiprocessing-start-methods`) " "changed away from *fork*. If you require the *fork* start method for :class:" @@ -702,7 +709,7 @@ msgid "" "get_context(\"fork\")``." msgstr "" -#: ../../library/concurrent.futures.rst:419 +#: ../../library/concurrent.futures.rst:424 msgid "" "Attempt to terminate all living worker processes immediately by calling :" "meth:`Process.terminate ` on each of " @@ -710,14 +717,14 @@ msgid "" "all other resources associated with the executor are freed." msgstr "" -#: ../../library/concurrent.futures.rst:424 -#: ../../library/concurrent.futures.rst:436 +#: ../../library/concurrent.futures.rst:429 +#: ../../library/concurrent.futures.rst:441 msgid "" "After calling this method the caller should no longer submit tasks to the " "executor." msgstr "" -#: ../../library/concurrent.futures.rst:431 +#: ../../library/concurrent.futures.rst:436 msgid "" "Attempt to kill all living worker processes immediately by calling :meth:" "`Process.kill ` on each of them. Internally, " @@ -725,11 +732,11 @@ msgid "" "resources associated with the executor are freed." msgstr "" -#: ../../library/concurrent.futures.rst:444 +#: ../../library/concurrent.futures.rst:449 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:447 +#: ../../library/concurrent.futures.rst:452 msgid "" "import concurrent.futures\n" "import math\n" @@ -797,11 +804,11 @@ msgstr "" "if __name__ == '__main__':\n" " main()" -#: ../../library/concurrent.futures.rst:482 +#: ../../library/concurrent.futures.rst:487 msgid "Future Objects" msgstr "Future 物件" -#: ../../library/concurrent.futures.rst:484 +#: ../../library/concurrent.futures.rst:489 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." @@ -809,7 +816,7 @@ msgstr "" ":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例由 :" "meth:`Executor.submit` 建立。" -#: ../../library/concurrent.futures.rst:489 +#: ../../library/concurrent.futures.rst:494 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " @@ -818,7 +825,7 @@ msgstr "" "封裝可呼叫物件的非同步執行。:class:`Future` 實例由 :meth:`Executor.submit` 建" "立,且除測試外不應直接建立。" -#: ../../library/concurrent.futures.rst:495 +#: ../../library/concurrent.futures.rst:500 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -828,22 +835,22 @@ msgstr "" "嘗試取消呼叫。如果呼叫目前正在執行或已完成運行且無法取消,則該方法將回傳 " "``False``,否則呼叫將被取消並且該方法將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:502 +#: ../../library/concurrent.futures.rst:507 msgid "Return ``True`` if the call was successfully cancelled." msgstr "如果該呼叫成功被取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:506 +#: ../../library/concurrent.futures.rst:511 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "如果呼叫正在執行且無法取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:511 +#: ../../library/concurrent.futures.rst:516 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "如果呼叫成功被取消或結束運行,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:516 +#: ../../library/concurrent.futures.rst:521 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -855,19 +862,19 @@ msgstr "" "叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。*timeout* 可以是整數" "或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:523 -#: ../../library/concurrent.futures.rst:537 +#: ../../library/concurrent.futures.rst:528 +#: ../../library/concurrent.futures.rst:542 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "如果 future 在完成之前被取消,那麼 :exc:`.CancelledError` 將被引發。" -#: ../../library/concurrent.futures.rst:526 +#: ../../library/concurrent.futures.rst:531 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "如果該呼叫引發了例外,此方法將引發相同的例外。" -#: ../../library/concurrent.futures.rst:530 +#: ../../library/concurrent.futures.rst:535 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -879,11 +886,11 @@ msgstr "" "呼叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。 *timeout* 可以是" "整數或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:540 +#: ../../library/concurrent.futures.rst:545 msgid "If the call completed without raising, ``None`` is returned." msgstr "如果呼叫在沒有引發的情況下完成,則回傳 ``None``。" -#: ../../library/concurrent.futures.rst:544 +#: ../../library/concurrent.futures.rst:549 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " @@ -892,7 +899,7 @@ msgstr "" "將可呼叫的 *fn* 附加到 future 上。當 future 被取消或完成運行時,*fn* 將被以 " "future 作為其唯一引數來呼叫。" -#: ../../library/concurrent.futures.rst:548 +#: ../../library/concurrent.futures.rst:553 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -904,19 +911,19 @@ msgstr "" "如果可呼叫物件引發 :exc:`Exception` 子類別,它將被記錄 (log) 並忽略。如果可呼" "叫物件引發 :exc:`BaseException` 子類別,該行為未定義。" -#: ../../library/concurrent.futures.rst:554 +#: ../../library/concurrent.futures.rst:559 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "如果 future 已經完成或被取消,*fn* 將立即被呼叫。" -#: ../../library/concurrent.futures.rst:557 +#: ../../library/concurrent.futures.rst:562 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." msgstr "以下 :class:`Future` 方法旨在用於單元測試和 :class:`Executor` 實作。" -#: ../../library/concurrent.futures.rst:562 +#: ../../library/concurrent.futures.rst:567 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " @@ -925,7 +932,7 @@ msgstr "" "此方法只能在與 :class:`Future` 關聯的工作被執行之前於 :class:`Executor` 實作" "中呼叫,或者在單元測試中呼叫。" -#: ../../library/concurrent.futures.rst:566 +#: ../../library/concurrent.futures.rst:571 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned ``True``. Any threads " @@ -936,7 +943,7 @@ msgstr "" "cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成的執行緒(即透" "過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" -#: ../../library/concurrent.futures.rst:571 +#: ../../library/concurrent.futures.rst:576 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " @@ -945,7 +952,7 @@ msgstr "" "如果該方法回傳 ``True`` 則代表 :class:`Future` 未被取消並已進入運行狀態,意即" "呼叫 :meth:`Future.running` 將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:575 +#: ../../library/concurrent.futures.rst:580 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." @@ -953,20 +960,20 @@ msgstr "" "此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` 或 :meth:`Future." "set_exception` 之後呼叫。" -#: ../../library/concurrent.futures.rst:581 +#: ../../library/concurrent.futures.rst:586 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "將與 :class:`Future` 關聯的工作結果設定為 *result*。" -#: ../../library/concurrent.futures.rst:584 -#: ../../library/concurrent.futures.rst:597 +#: ../../library/concurrent.futures.rst:589 +#: ../../library/concurrent.futures.rst:602 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "此方法只能在 :class:`Executor` 實作中和單元測試中使用。" -#: ../../library/concurrent.futures.rst:587 -#: ../../library/concurrent.futures.rst:600 +#: ../../library/concurrent.futures.rst:592 +#: ../../library/concurrent.futures.rst:605 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." @@ -974,18 +981,18 @@ msgstr "" "如果 :class:`Future` 已經完成,此方法會引發 :exc:`concurrent.futures." "InvalidStateError`。" -#: ../../library/concurrent.futures.rst:594 +#: ../../library/concurrent.futures.rst:599 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" "將與 :class:`Future` 關聯的工作結果設定為 :class:`Exception` *exception*。" -#: ../../library/concurrent.futures.rst:606 +#: ../../library/concurrent.futures.rst:611 msgid "Module Functions" msgstr "模組函式" -#: ../../library/concurrent.futures.rst:610 +#: ../../library/concurrent.futures.rst:615 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -1001,7 +1008,7 @@ msgstr "" "完成的 future(已完成或被取消的 future)。第二組名為 ``not_done``,包含未完成" "的 future(未定或運行中的 future)。" -#: ../../library/concurrent.futures.rst:618 +#: ../../library/concurrent.futures.rst:623 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " @@ -1010,25 +1017,25 @@ msgstr "" "*timeout* 可用於控制回傳前等待的最大秒數。*timeout* 可以是整數或浮點數。如果" "未指定 *timeout* 或為 ``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:622 +#: ../../library/concurrent.futures.rst:627 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "*return_when* 表示此函式應回傳的時間。它必須是以下常數之一:" -#: ../../library/concurrent.futures.rst:628 +#: ../../library/concurrent.futures.rst:633 msgid "Constant" msgstr "常數" -#: ../../library/concurrent.futures.rst:629 +#: ../../library/concurrent.futures.rst:634 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:632 +#: ../../library/concurrent.futures.rst:637 msgid "The function will return when any future finishes or is cancelled." msgstr "當任何 future 完成或被取消時,該函式就會回傳。" -#: ../../library/concurrent.futures.rst:635 +#: ../../library/concurrent.futures.rst:640 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" @@ -1037,11 +1044,11 @@ msgstr "" "該函式會在任何 future 透過引發例外而完結時回傳。如果 future 沒有引發例外,那" "麼它等同於 :const:`ALL_COMPLETED`。" -#: ../../library/concurrent.futures.rst:640 +#: ../../library/concurrent.futures.rst:645 msgid "The function will return when all futures finish or are cancelled." msgstr "當所有 future 都完成或被取消時,該函式才會回傳。" -#: ../../library/concurrent.futures.rst:644 +#: ../../library/concurrent.futures.rst:649 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -1061,36 +1068,36 @@ msgstr "" "`TimeoutError`。*timeout* 可以是整數或浮點數。如果未指定 *timeout* 或為 " "``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:657 +#: ../../library/concurrent.futures.rst:662 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr ":pep:`3148` -- futures - 非同步地執行運算" -#: ../../library/concurrent.futures.rst:658 +#: ../../library/concurrent.futures.rst:663 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "描述此功能並提出被包含於 Python 標準函式庫中的提案。" -#: ../../library/concurrent.futures.rst:663 +#: ../../library/concurrent.futures.rst:668 msgid "Exception classes" msgstr "例外類別" -#: ../../library/concurrent.futures.rst:669 +#: ../../library/concurrent.futures.rst:674 msgid "Raised when a future is cancelled." msgstr "當 future 被取消時引發。" -#: ../../library/concurrent.futures.rst:673 +#: ../../library/concurrent.futures.rst:678 msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when a future operation " "exceeds the given timeout." msgstr "" ":exc:`TimeoutError` 的棄用別名,在 future 操作超過給定超時 (timeout) 時引發。" -#: ../../library/concurrent.futures.rst:678 +#: ../../library/concurrent.futures.rst:683 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "這個類別是 :exc:`TimeoutError` 的別名。" -#: ../../library/concurrent.futures.rst:683 +#: ../../library/concurrent.futures.rst:688 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " @@ -1099,13 +1106,13 @@ msgstr "" "衍生自 :exc:`RuntimeError`,當執行器因某種原因損壞時會引發此例外類別,並且不" "能用於提交或執行新任務。" -#: ../../library/concurrent.futures.rst:691 +#: ../../library/concurrent.futures.rst:696 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "目前狀態下不允許的 future 操作被執行時而引發。" -#: ../../library/concurrent.futures.rst:700 +#: ../../library/concurrent.futures.rst:705 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`~concurrent.futures." @@ -1114,7 +1121,7 @@ msgstr "" "衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:`~concurrent." "futures.ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" -#: ../../library/concurrent.futures.rst:711 +#: ../../library/concurrent.futures.rst:716 msgid "" "Derived from :exc:`~concurrent.futures.thread.BrokenThreadPool`, this " "exception class is raised when one of the workers of a :class:`~concurrent." @@ -1124,14 +1131,14 @@ msgstr "" "`~concurrent.futures.InterpreterPoolExecutor` 的其中一個 worker 初始化失敗時" "會引發此例外類別。" -#: ../../library/concurrent.futures.rst:720 +#: ../../library/concurrent.futures.rst:725 msgid "" "Raised from :class:`~concurrent.futures.InterpreterPoolExecutor` when the " "given initializer fails or from :meth:`~concurrent.futures.Executor.submit` " "when there's an uncaught exception from the submitted task." msgstr "" -#: ../../library/concurrent.futures.rst:731 +#: ../../library/concurrent.futures.rst:736 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " diff --git a/library/textwrap.po b/library/textwrap.po index a6055637cb..e4d55aa166 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-12-31 00:16+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -129,7 +129,7 @@ msgid "" "a single newline character in the output." msgstr "" -#: ../../library/textwrap.rst:94 ../../library/textwrap.rst:115 +#: ../../library/textwrap.rst:94 ../../library/textwrap.rst:119 msgid "For example::" msgstr "舉例來說: ::" @@ -145,21 +145,28 @@ msgid "" " print(repr(dedent(s))) # prints 'hello\\n world\\n'" msgstr "" -#: ../../library/textwrap.rst:108 +#: ../../library/textwrap.rst:105 +msgid "" +"The :func:`!dedent` function now correctly normalizes blank lines containing " +"only whitespace characters. Previously, the implementation only normalized " +"blank lines containing tabs and spaces." +msgstr "" + +#: ../../library/textwrap.rst:112 msgid "Add *prefix* to the beginning of selected lines in *text*." msgstr "" -#: ../../library/textwrap.rst:110 +#: ../../library/textwrap.rst:114 msgid "Lines are separated by calling ``text.splitlines(True)``." msgstr "" -#: ../../library/textwrap.rst:112 +#: ../../library/textwrap.rst:116 msgid "" "By default, *prefix* is added to all lines that do not consist solely of " "whitespace (including any line endings)." msgstr "" -#: ../../library/textwrap.rst:117 +#: ../../library/textwrap.rst:121 msgid "" ">>> s = 'hello\\n\\n \\nworld'\n" ">>> indent(s, ' ')\n" @@ -169,14 +176,14 @@ msgstr "" ">>> indent(s, ' ')\n" "' hello\\n\\n \\n world'" -#: ../../library/textwrap.rst:121 +#: ../../library/textwrap.rst:125 msgid "" "The optional *predicate* argument can be used to control which lines are " "indented. For example, it is easy to add *prefix* to even empty and " "whitespace-only lines::" msgstr "" -#: ../../library/textwrap.rst:125 +#: ../../library/textwrap.rst:129 msgid "" ">>> print(indent(s, '+ ', lambda line: True))\n" "+ hello\n" @@ -190,7 +197,7 @@ msgstr "" "+\n" "+ world" -#: ../../library/textwrap.rst:134 +#: ../../library/textwrap.rst:138 msgid "" ":func:`wrap`, :func:`fill` and :func:`shorten` work by creating a :class:" "`TextWrapper` instance and calling a single method on it. That instance is " @@ -199,29 +206,29 @@ msgid "" "class:`TextWrapper` object." msgstr "" -#: ../../library/textwrap.rst:140 +#: ../../library/textwrap.rst:144 msgid "" "Text is preferably wrapped on whitespaces and right after the hyphens in " "hyphenated words; only then will long words be broken if necessary, unless :" "attr:`TextWrapper.break_long_words` is set to false." msgstr "" -#: ../../library/textwrap.rst:146 +#: ../../library/textwrap.rst:150 msgid "" "The :class:`TextWrapper` constructor accepts a number of optional keyword " "arguments. Each keyword argument corresponds to an instance attribute, so " "for example ::" msgstr "" -#: ../../library/textwrap.rst:150 +#: ../../library/textwrap.rst:154 msgid "wrapper = TextWrapper(initial_indent=\"* \")" msgstr "wrapper = TextWrapper(initial_indent=\"* \")" -#: ../../library/textwrap.rst:152 +#: ../../library/textwrap.rst:156 msgid "is the same as ::" msgstr "" -#: ../../library/textwrap.rst:154 +#: ../../library/textwrap.rst:158 msgid "" "wrapper = TextWrapper()\n" "wrapper.initial_indent = \"* \"" @@ -229,20 +236,20 @@ msgstr "" "wrapper = TextWrapper()\n" "wrapper.initial_indent = \"* \"" -#: ../../library/textwrap.rst:157 +#: ../../library/textwrap.rst:161 msgid "" "You can reuse the same :class:`TextWrapper` object many times, and you can " "change any of its options through direct assignment to instance attributes " "between uses." msgstr "" -#: ../../library/textwrap.rst:161 +#: ../../library/textwrap.rst:165 msgid "" "The :class:`TextWrapper` instance attributes (and keyword arguments to the " "constructor) are as follows:" msgstr "" -#: ../../library/textwrap.rst:167 +#: ../../library/textwrap.rst:171 msgid "" "(default: ``70``) The maximum length of wrapped lines. As long as there are " "no individual words in the input text longer than :attr:`width`, :class:" @@ -250,20 +257,20 @@ msgid "" "`width` characters." msgstr "" -#: ../../library/textwrap.rst:175 +#: ../../library/textwrap.rst:179 msgid "" "(default: ``True``) If true, then all tab characters in *text* will be " "expanded to spaces using the :meth:`~str.expandtabs` method of *text*." msgstr "" -#: ../../library/textwrap.rst:181 +#: ../../library/textwrap.rst:185 msgid "" "(default: ``8``) If :attr:`expand_tabs` is true, then all tab characters in " "*text* will be expanded to zero or more spaces, depending on the current " "column and the given tab size." msgstr "" -#: ../../library/textwrap.rst:190 +#: ../../library/textwrap.rst:194 msgid "" "(default: ``True``) If true, after tab expansion but before wrapping, the :" "meth:`wrap` method will replace each whitespace character with a single " @@ -271,14 +278,14 @@ msgid "" "vertical tab, formfeed, and carriage return (``'\\t\\n\\v\\f\\r'``)." msgstr "" -#: ../../library/textwrap.rst:198 +#: ../../library/textwrap.rst:202 msgid "" "If :attr:`expand_tabs` is false and :attr:`replace_whitespace` is true, each " "tab character will be replaced by a single space, which is *not* the same as " "tab expansion." msgstr "" -#: ../../library/textwrap.rst:204 +#: ../../library/textwrap.rst:208 msgid "" "If :attr:`replace_whitespace` is false, newlines may appear in the middle of " "a line and cause strange output. For this reason, text should be split into " @@ -286,7 +293,7 @@ msgid "" "separately." msgstr "" -#: ../../library/textwrap.rst:212 +#: ../../library/textwrap.rst:216 msgid "" "(default: ``True``) If true, whitespace at the beginning and ending of every " "line (after wrapping but before indenting) is dropped. Whitespace at the " @@ -295,21 +302,21 @@ msgid "" "line is dropped." msgstr "" -#: ../../library/textwrap.rst:221 +#: ../../library/textwrap.rst:225 msgid "" "(default: ``''``) String that will be prepended to the first line of wrapped " "output. Counts towards the length of the first line. The empty string is " "not indented." msgstr "" -#: ../../library/textwrap.rst:228 +#: ../../library/textwrap.rst:232 msgid "" "(default: ``''``) String that will be prepended to all lines of wrapped " "output except the first. Counts towards the length of each line except the " "first." msgstr "" -#: ../../library/textwrap.rst:235 +#: ../../library/textwrap.rst:239 msgid "" "(default: ``False``) If true, :class:`TextWrapper` attempts to detect " "sentence endings and ensure that sentences are always separated by exactly " @@ -321,23 +328,23 @@ msgid "" "to detect the difference between \"Dr.\" in ::" msgstr "" -#: ../../library/textwrap.rst:244 +#: ../../library/textwrap.rst:248 msgid "[...] Dr. Frankenstein's monster [...]" msgstr "[...] Dr. Frankenstein's monster [...]" -#: ../../library/textwrap.rst:246 +#: ../../library/textwrap.rst:250 msgid "and \"Spot.\" in ::" msgstr "" -#: ../../library/textwrap.rst:248 +#: ../../library/textwrap.rst:252 msgid "[...] See Spot. See Spot run [...]" msgstr "[...] See Spot. See Spot run [...]" -#: ../../library/textwrap.rst:250 +#: ../../library/textwrap.rst:254 msgid ":attr:`fix_sentence_endings` is false by default." msgstr "" -#: ../../library/textwrap.rst:252 +#: ../../library/textwrap.rst:256 msgid "" "Since the sentence detection algorithm relies on ``string.lowercase`` for " "the definition of \"lowercase letter\", and a convention of using two spaces " @@ -345,7 +352,7 @@ msgid "" "English-language texts." msgstr "" -#: ../../library/textwrap.rst:260 +#: ../../library/textwrap.rst:264 msgid "" "(default: ``True``) If true, then words longer than :attr:`width` will be " "broken in order to ensure that no lines are longer than :attr:`width`. If " @@ -354,7 +361,7 @@ msgid "" "order to minimize the amount by which :attr:`width` is exceeded.)" msgstr "" -#: ../../library/textwrap.rst:269 +#: ../../library/textwrap.rst:273 msgid "" "(default: ``True``) If true, wrapping will occur preferably on whitespaces " "and right after hyphens in compound words, as it is customary in English. If " @@ -364,25 +371,25 @@ msgid "" "always allow breaking hyphenated words." msgstr "" -#: ../../library/textwrap.rst:279 +#: ../../library/textwrap.rst:283 msgid "" "(default: ``None``) If not ``None``, then the output will contain at most " "*max_lines* lines, with *placeholder* appearing at the end of the output." msgstr "" -#: ../../library/textwrap.rst:289 +#: ../../library/textwrap.rst:293 msgid "" "(default: ``' [...]'``) String that will appear at the end of the output " "text if it has been truncated." msgstr "" -#: ../../library/textwrap.rst:295 +#: ../../library/textwrap.rst:299 msgid "" ":class:`TextWrapper` also provides some public methods, analogous to the " "module-level convenience functions:" msgstr "" -#: ../../library/textwrap.rst:300 +#: ../../library/textwrap.rst:304 msgid "" "Wraps the single paragraph in *text* (a string) so every line is at most :" "attr:`width` characters long. All wrapping options are taken from instance " @@ -391,16 +398,16 @@ msgid "" "returned list is empty." msgstr "" -#: ../../library/textwrap.rst:309 +#: ../../library/textwrap.rst:313 msgid "" "Wraps the single paragraph in *text*, and returns a single string containing " "the wrapped paragraph." msgstr "" -#: ../../library/textwrap.rst:285 +#: ../../library/textwrap.rst:289 msgid "..." msgstr "..." -#: ../../library/textwrap.rst:285 +#: ../../library/textwrap.rst:289 msgid "placeholder" msgstr "placeholder(佔位符號)" diff --git a/reference/import.po b/reference/import.po index f8d7af23e3..2f459da707 100644 --- a/reference/import.po +++ b/reference/import.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-12-31 00:16+0000\n" "PO-Revision-Date: 2024-11-06 14:55+0800\n" "Last-Translator: Ken Cheng \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,13 +27,13 @@ msgid "" "Python code in one :term:`module` gains access to the code in another module " "by the process of :term:`importing` it. The :keyword:`import` statement is " "the most common way of invoking the import machinery, but it is not the only " -"way. Functions such as :func:`importlib.import_module` and built-" -"in :func:`__import__` can also be used to invoke the import machinery." +"way. Functions such as :func:`importlib.import_module` and built-in :func:" +"`__import__` can also be used to invoke the import machinery." msgstr "" "一個 :term:`module` 中的 Python 程式碼透過 :term:`importing` 的過程來存取另一" "個模組中的程式碼。:keyword:`import` 陳述式是叫用 (invoke) 引入機制最常見的方" -"法,但這不是唯一的方法。函式如 :func:`importlib.import_module` 以及內建函" -"式 :func:`__import__` 也可以用來叫用引入機制。" +"法,但這不是唯一的方法。函式如 :func:`importlib.import_module` 以及內建函式 :" +"func:`__import__` 也可以用來叫用引入機制。" #: ../../reference/import.rst:16 msgid "" @@ -42,8 +42,8 @@ msgid "" "local scope. The search operation of the :keyword:`!import` statement is " "defined as a call to the :func:`__import__` function, with the appropriate " "arguments. The return value of :func:`__import__` is used to perform the " -"name binding operation of the :keyword:`!import` statement. See " -"the :keyword:`!import` statement for the exact details of that name binding " +"name binding operation of the :keyword:`!import` statement. See the :" +"keyword:`!import` statement for the exact details of that name binding " "operation." msgstr "" ":keyword:`import` 陳述式結合了兩個操作:首先搜尋指定的模組,然後將搜尋結果繫" @@ -67,15 +67,14 @@ msgstr "" #: ../../reference/import.rst:31 msgid "" -"When an :keyword:`import` statement is executed, the standard " -"builtin :func:`__import__` function is called. Other mechanisms for invoking " -"the import system (such as :func:`importlib.import_module`) may choose to " -"bypass :func:`__import__` and use their own solutions to implement import " -"semantics." +"When an :keyword:`import` statement is executed, the standard builtin :func:" +"`__import__` function is called. Other mechanisms for invoking the import " +"system (such as :func:`importlib.import_module`) may choose to bypass :func:" +"`__import__` and use their own solutions to implement import semantics." msgstr "" "當執行 :keyword:`import` 陳述式時,會呼叫內建的 :func:`__import__` 函式。其他" -"叫用引入系統的機制(如 :func:`importlib.import_module`)可以選擇略" -"過 :func:`__import__`,並使用它們自己的解決方案來實作引入語意。" +"叫用引入系統的機制(如 :func:`importlib.import_module`)可以選擇略過 :func:" +"`__import__`,並使用它們自己的解決方案來實作引入語意。" #: ../../reference/import.rst:36 msgid "" @@ -87,15 +86,14 @@ msgid "" "using various hooks described in the sections below." msgstr "" "當模組首次被引入時,Python 會搜尋該模組,若找到則會建立一個模組物件 " -"[#fnmo]_,並對其進行初始化。如果找不到指定的模組,則會引" -"發 :exc:`ModuleNotFoundError`。當引入機制被叫用時,Python 會實作各種策略來搜" -"尋指定的模組。這些策略可以透過使用以下章節描述的各種 hook(掛鉤)來修改和擴" -"展。" +"[#fnmo]_,並對其進行初始化。如果找不到指定的模組,則會引發 :exc:" +"`ModuleNotFoundError`。當引入機制被叫用時,Python 會實作各種策略來搜尋指定的" +"模組。這些策略可以透過使用以下章節描述的各種 hook(掛鉤)來修改和擴展。" #: ../../reference/import.rst:43 msgid "" -"The import system has been updated to fully implement the second phase " -"of :pep:`302`. There is no longer any implicit import machinery - the full " +"The import system has been updated to fully implement the second phase of :" +"pep:`302`. There is no longer any implicit import machinery - the full " "import system is exposed through :data:`sys.meta_path`. In addition, native " "namespace package support has been implemented (see :pep:`420`)." msgstr "" @@ -115,10 +113,9 @@ msgid "" "import machinery. Refer to the :mod:`importlib` library documentation for " "additional detail." msgstr "" -":mod:`importlib` 模組提供了豐富的 API 來與引入系統互動。例" -"如,:func:`importlib.import_module` 提供了一個比內建的 :func:`__import__` 更" -"推薦且更簡單的 API 來叫用引入機制。更多詳細資訊請參閱 :mod:`importlib` 函式庫" -"文件。" +":mod:`importlib` 模組提供了豐富的 API 來與引入系統互動。例如,:func:" +"`importlib.import_module` 提供了一個比內建的 :func:`__import__` 更推薦且更簡" +"單的 API 來叫用引入機制。更多詳細資訊請參閱 :mod:`importlib` 函式庫文件。" #: ../../reference/import.rst:62 msgid "Packages" @@ -170,8 +167,8 @@ msgid "" msgstr "" "所有模組都有一個名稱。子套件的名稱與其父套件名稱之間用一個點來分隔,類似於 " "Python 的標準屬性存取語法。因此,你可能會有一個名為 :mod:`email` 的套件,該套" -"件又有一個名為 :mod:`email.mime` 的子套件,並且該子套件中有一個名" -"為 :mod:`email.mime.text` 的模組。" +"件又有一個名為 :mod:`email.mime` 的子套件,並且該子套件中有一個名為 :mod:" +"`email.mime.text` 的模組。" #: ../../reference/import.rst:93 msgid "Regular packages" @@ -183,18 +180,18 @@ msgid "" "package>` and :term:`namespace packages `. Regular " "packages are traditional packages as they existed in Python 3.2 and earlier. " "A regular package is typically implemented as a directory containing an " -"``__init__.py`` file. When a regular package is imported, this " -"``__init__.py`` file is implicitly executed, and the objects it defines are " -"bound to names in the package's namespace. The ``__init__.py`` file can " -"contain the same Python code that any other module can contain, and Python " -"will add some additional attributes to the module when it is imported." -msgstr "" -"Python 定義了兩種類型的套件,:term:`一般套件 `\\ 和" -"\\ :term:`命名空間套件 `。一般套件是 Python 3.2 及更早版本" -"中存在的傳統套件。一般套件通常實作成一個包含 ``__init__.py`` 檔案的目錄。當引" -"入一般套件時,該 ``__init__.py`` 檔案會被隱式執行,其定義的物件會繫結到該套件" -"的命名空間中的名稱。``__init__.py`` 檔案可以包含與任何其他模組相同的 Python " -"程式碼,並且 Python 會在引入時為該模組增加一些額外的屬性。" +"``__init__.py`` file. When a regular package is imported, this ``__init__." +"py`` file is implicitly executed, and the objects it defines are bound to " +"names in the package's namespace. The ``__init__.py`` file can contain the " +"same Python code that any other module can contain, and Python will add some " +"additional attributes to the module when it is imported." +msgstr "" +"Python 定義了兩種類型的套件,:term:`一般套件 `\\ 和\\ :term:" +"`命名空間套件 `。一般套件是 Python 3.2 及更早版本中存在的" +"傳統套件。一般套件通常實作成一個包含 ``__init__.py`` 檔案的目錄。當引入一般套" +"件時,該 ``__init__.py`` 檔案會被隱式執行,其定義的物件會繫結到該套件的命名空" +"間中的名稱。``__init__.py`` 檔案可以包含與任何其他模組相同的 Python 程式碼," +"並且 Python 會在引入時為該模組增加一些額外的屬性。" #: ../../reference/import.rst:108 msgid "" @@ -300,21 +297,21 @@ msgid "" msgstr "" "在開始搜尋之前,Python 需要被引入模組(或套件,但在本討論中,兩者的區別無關緊" "要)的完整\\ :term:`限定名稱 (qualified name) `。此名稱可能來" -"自 :keyword:`import` 陳述式的各種引數,或來" -"自 :func:`importlib.import_module` 或 :func:`__import__` 函式的參數。" +"自 :keyword:`import` 陳述式的各種引數,或來自 :func:`importlib." +"import_module` 或 :func:`__import__` 函式的參數。" #: ../../reference/import.rst:168 msgid "" "This name will be used in various phases of the import search, and it may be " "the dotted path to a submodule, e.g. ``foo.bar.baz``. In this case, Python " -"first tries to import ``foo``, then ``foo.bar``, and finally " -"``foo.bar.baz``. If any of the intermediate imports fail, " -"a :exc:`ModuleNotFoundError` is raised." +"first tries to import ``foo``, then ``foo.bar``, and finally ``foo.bar." +"baz``. If any of the intermediate imports fail, a :exc:`ModuleNotFoundError` " +"is raised." msgstr "" "此名稱將在引入搜尋的各個階段中使用,並且它可能是指向子模組的點分隔路徑,例如 " -"``foo.bar.baz``。在這種情況下,Python 會首先嘗試引入 ``foo``,然後是 " -"``foo.bar``,最後是 ``foo.bar.baz``。如果任何中間引入失敗,則會引" -"發 :exc:`ModuleNotFoundError`。" +"``foo.bar.baz``。在這種情況下,Python 會首先嘗試引入 ``foo``,然後是 ``foo." +"bar``,最後是 ``foo.bar.baz``。如果任何中間引入失敗,則會引發 :exc:" +"`ModuleNotFoundError`。" #: ../../reference/import.rst:175 msgid "The module cache" @@ -330,21 +327,21 @@ msgid "" "module object." msgstr "" "在引入搜尋過程中首先檢查的地方是 :data:`sys.modules`。此對映用作所有先前引入" -"過的模組的快取,包括中間路徑。因此,如果 ``foo.bar.baz`` 之前已被引" -"入,:data:`sys.modules` 將包含 ``foo``、``foo.bar`` 和 ``foo.bar.baz`` 的條" -"目。每個鍵的值都是相應的模組物件。" +"過的模組的快取,包括中間路徑。因此,如果 ``foo.bar.baz`` 之前已被引入,:data:" +"`sys.modules` 將包含 ``foo``、``foo.bar`` 和 ``foo.bar.baz`` 的條目。每個鍵的" +"值都是相應的模組物件。" #: ../../reference/import.rst:187 msgid "" "During import, the module name is looked up in :data:`sys.modules` and if " "present, the associated value is the module satisfying the import, and the " -"process completes. However, if the value is ``None``, then " -"a :exc:`ModuleNotFoundError` is raised. If the module name is missing, " -"Python will continue searching for the module." +"process completes. However, if the value is ``None``, then a :exc:" +"`ModuleNotFoundError` is raised. If the module name is missing, Python will " +"continue searching for the module." msgstr "" "在引入過程中,會在 :data:`sys.modules` 中查找模組名稱,如果存在,則相關的值為" -"滿足此引入的模組,此引入過程即完成。然而,如果值是 ``None``,則會引" -"發 :exc:`ModuleNotFoundError`。如果模組名稱不存在,Python 會繼續搜尋該模組。" +"滿足此引入的模組,此引入過程即完成。然而,如果值是 ``None``,則會引發 :exc:" +"`ModuleNotFoundError`。如果模組名稱不存在,Python 會繼續搜尋該模組。" #: ../../reference/import.rst:193 msgid "" @@ -352,8 +349,8 @@ msgid "" "associated module (as other modules may hold references to it), but it will " "invalidate the cache entry for the named module, causing Python to search " "anew for the named module upon its next import. The key can also be assigned " -"to ``None``, forcing the next import of the module to result in " -"a :exc:`ModuleNotFoundError`." +"to ``None``, forcing the next import of the module to result in a :exc:" +"`ModuleNotFoundError`." msgstr "" ":data:`sys.modules` 是可寫入的。刪除一個鍵可能不會銷毀相關聯的模組(因為其他" "模組可能持有對它的參照),但會使指定的模組的快取條目失效,導致 Python 在下一" @@ -364,14 +361,14 @@ msgstr "" msgid "" "Beware though, as if you keep a reference to the module object, invalidate " "its cache entry in :data:`sys.modules`, and then re-import the named module, " -"the two module objects will *not* be the same. By " -"contrast, :func:`importlib.reload` will reuse the *same* module object, and " -"simply reinitialise the module contents by rerunning the module's code." +"the two module objects will *not* be the same. By contrast, :func:`importlib." +"reload` will reuse the *same* module object, and simply reinitialise the " +"module contents by rerunning the module's code." msgstr "" "但請注意,如果你保留了對模組物件的參照,並在 :data:`sys.modules` 中使其快取條" -"目失效,然後重新引入指定的模組,這兩個模組物件將\\ *不會*\\ 相同。相比之" -"下,:func:`importlib.reload` 會重用\\ *相同的*\\ 模組物件,並透過重新執行模組" -"的程式碼來簡單地重新初始化模組內容。" +"目失效,然後重新引入指定的模組,這兩個模組物件將\\ *不會*\\ 相同。相比之下,:" +"func:`importlib.reload` 會重用\\ *相同的*\\ 模組物件,並透過重新執行模組的程" +"式碼來簡單地重新初始化模組內容。" #: ../../reference/import.rst:210 msgid "Finders and loaders" @@ -381,18 +378,18 @@ msgstr "尋檢器 (Finder) 與載入器 (Loader)" msgid "" "If the named module is not found in :data:`sys.modules`, then Python's " "import protocol is invoked to find and load the module. This protocol " -"consists of two conceptual objects, :term:`finders ` " -"and :term:`loaders `. A finder's job is to determine whether it can " -"find the named module using whatever strategy it knows about. Objects that " -"implement both of these interfaces are referred to as :term:`importers " -"` - they return themselves when they find that they can load the " -"requested module." +"consists of two conceptual objects, :term:`finders ` and :term:" +"`loaders `. A finder's job is to determine whether it can find the " +"named module using whatever strategy it knows about. Objects that implement " +"both of these interfaces are referred to as :term:`importers ` - " +"they return themselves when they find that they can load the requested " +"module." msgstr "" "如果在 :data:`sys.modules` 中找不到指定的模組,則會叫用 Python 的引入協定來尋" -"找並載入該模組。這個協定由兩個概念性物件組成,:term:`尋檢器 ` 和" -"\\ :term:`載入器 `。尋檢器的任務是使用其已知的策略來確定是否能找到命" -"名模組。實作這兩個介面的物件稱為\\ :term:`引入器 (importer) ` ——當" -"它們發現可以載入所請求的模組時,會回傳它們自己。" +"找並載入該模組。這個協定由兩個概念性物件組成,:term:`尋檢器 ` 和\\ :" +"term:`載入器 `。尋檢器的任務是使用其已知的策略來確定是否能找到命名模" +"組。實作這兩個介面的物件稱為\\ :term:`引入器 (importer) ` ——當它們" +"發現可以載入所請求的模組時,會回傳它們自己。" #: ../../reference/import.rst:225 msgid "" @@ -473,10 +470,10 @@ msgstr "" #: ../../reference/import.rst:269 msgid "" -"Import path hooks are called as part of :data:`sys.path` (or " -"``package.__path__``) processing, at the point where their associated path " -"item is encountered. Import path hooks are registered by adding new " -"callables to :data:`sys.path_hooks` as described below." +"Import path hooks are called as part of :data:`sys.path` (or ``package." +"__path__``) processing, at the point where their associated path item is " +"encountered. Import path hooks are registered by adding new callables to :" +"data:`sys.path_hooks` as described below." msgstr "" "引入路徑掛鉤被視為 :data:`sys.path`\\ (或 ``package.__path__``)處理過程的一" "部分來呼叫,當遇到與其相關聯的路徑項目時就會被觸發。引入路徑掛鉤透過將新的可" @@ -491,18 +488,17 @@ msgid "" "When the named module is not found in :data:`sys.modules`, Python next " "searches :data:`sys.meta_path`, which contains a list of meta path finder " "objects. These finders are queried in order to see if they know how to " -"handle the named module. Meta path finders must implement a method " -"called :meth:`~importlib.abc.MetaPathFinder.find_spec` which takes three " -"arguments: a name, an import path, and (optionally) a target module. The " -"meta path finder can use any strategy it wants to determine whether it can " -"handle the named module or not." -msgstr "" -"當在 :data:`sys.modules` 中找不到命名模組時,Python 接下來會搜" -"尋 :data:`sys.meta_path`,其中包含一個元路徑尋檢器物件串列。這些尋檢器會依次" -"被查詢,看它們是否知道如何處理命名模組。元路徑尋檢器必須實作一個名" -"為 :meth:`~importlib.abc.MetaPathFinder.find_spec` 的方法,該方法接收三個引" -"數:名稱、引入路徑和(可選的)目標模組。元路徑尋檢器可以使用任何策略來確定它" -"是否能處理命名模組。" +"handle the named module. Meta path finders must implement a method called :" +"meth:`~importlib.abc.MetaPathFinder.find_spec` which takes three arguments: " +"a name, an import path, and (optionally) a target module. The meta path " +"finder can use any strategy it wants to determine whether it can handle the " +"named module or not." +msgstr "" +"當在 :data:`sys.modules` 中找不到命名模組時,Python 接下來會搜尋 :data:`sys." +"meta_path`,其中包含一個元路徑尋檢器物件串列。這些尋檢器會依次被查詢,看它們" +"是否知道如何處理命名模組。元路徑尋檢器必須實作一個名為 :meth:`~importlib.abc." +"MetaPathFinder.find_spec` 的方法,該方法接收三個引數:名稱、引入路徑和(可選" +"的)目標模組。元路徑尋檢器可以使用任何策略來確定它是否能處理命名模組。" #: ../../reference/import.rst:291 msgid "" @@ -544,17 +540,16 @@ msgid "" "importing ``foo.bar.baz`` will first perform a top level import, calling " "``mpf.find_spec(\"foo\", None, None)`` on each meta path finder (``mpf``). " "After ``foo`` has been imported, ``foo.bar`` will be imported by traversing " -"the meta path a second time, calling ``mpf.find_spec(\"foo.bar\", " -"foo.__path__, None)``. Once ``foo.bar`` has been imported, the final " -"traversal will call ``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, " -"None)``." +"the meta path a second time, calling ``mpf.find_spec(\"foo.bar\", foo." +"__path__, None)``. Once ``foo.bar`` has been imported, the final traversal " +"will call ``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, None)``." msgstr "" "對於一個引入請求,元路徑可能會被遍歷多次。例如,假設參與的模組都沒有被快取," "則引入 ``foo.bar.baz`` 將首先執行頂層引入,對每個元路徑尋檢器(``mpf``)呼叫 " "``mpf.find_spec(\"foo\", None, None)``。當 ``foo`` 被引入後,將再次藉由遍歷元" "路徑引入 ``foo.bar``,並呼叫 ``mpf.find_spec(\"foo.bar\", foo.__path__, " -"None)``。當 ``foo.bar`` 被引入後,最後一次遍歷會呼叫 " -"``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, None)``。" +"None)``。當 ``foo.bar`` 被引入後,最後一次遍歷會呼叫 ``mpf.find_spec(\"foo." +"bar.baz\", foo.bar.__path__, None)``。" #: ../../reference/import.rst:318 msgid "" @@ -581,27 +576,26 @@ msgid "" "The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path " "finders replaced :meth:`!find_module`, which is now deprecated. While it " "will continue to work without change, the import machinery will try it only " -"if the finder does not " -"implement :meth:`~importlib.abc.MetaPathFinder.find_spec`." +"if the finder does not implement :meth:`~importlib.abc.MetaPathFinder." +"find_spec`." msgstr "" -"元路徑尋檢器的 :meth:`~importlib.abc.MetaPathFinder.find_spec` 方法取代" -"了 :meth:`!find_module`,後者現在已被棄用。雖然它將繼續正常工作,但引入機制僅" -"在尋檢器未實作 :meth:`~importlib.abc.MetaPathFinder.find_spec` 時才會嘗試使用" -"它。" +"元路徑尋檢器的 :meth:`~importlib.abc.MetaPathFinder.find_spec` 方法取代了 :" +"meth:`!find_module`,後者現在已被棄用。雖然它將繼續正常工作,但引入機制僅在尋" +"檢器未實作 :meth:`~importlib.abc.MetaPathFinder.find_spec` 時才會嘗試使用它。" #: ../../reference/import.rst:334 msgid "" -"Use of :meth:`!find_module` by the import system now " -"raises :exc:`ImportWarning`." +"Use of :meth:`!find_module` by the import system now raises :exc:" +"`ImportWarning`." msgstr "引入系統現在使用 :meth:`!find_module` 時將引發 :exc:`ImportWarning`。" #: ../../reference/import.rst:338 msgid "" -":meth:`!find_module` has been removed. " -"Use :meth:`~importlib.abc.MetaPathFinder.find_spec` instead." +":meth:`!find_module` has been removed. Use :meth:`~importlib.abc." +"MetaPathFinder.find_spec` instead." msgstr "" -":meth:`!find_module` 已被移除。請改" -"用 :meth:`~importlib.abc.MetaPathFinder.find_spec`。" +":meth:`!find_module` 已被移除。請改用 :meth:`~importlib.abc.MetaPathFinder." +"find_spec`。" #: ../../reference/import.rst:344 msgid "Loading" @@ -682,8 +676,8 @@ msgstr "請注意下列細節:" #: ../../reference/import.rst:381 msgid "" -"If there is an existing module object with the given name " -"in :data:`sys.modules`, import will have already returned it." +"If there is an existing module object with the given name in :data:`sys." +"modules`, import will have already returned it." msgstr "" "如果 :data:`sys.modules` 中已存在具有給定名稱的模組物件,引入會已回傳該物件。" @@ -696,16 +690,16 @@ msgid "" "best." msgstr "" "在載入器執行模組程式碼之前,模組將已存在於 :data:`sys.modules` 中。這一點至關" -"重要,因為模組程式碼可能會(直接或間接)引入自己;事先將其增加" -"到 :data:`sys.modules` 可以預防類似無限遞迴以及多次重覆載入等情形。" +"重要,因為模組程式碼可能會(直接或間接)引入自己;事先將其增加到 :data:`sys." +"modules` 可以預防類似無限遞迴以及多次重覆載入等情形。" #: ../../reference/import.rst:390 msgid "" "If loading fails, the failing module -- and only the failing module -- gets " -"removed from :data:`sys.modules`. Any module already in " -"the :data:`sys.modules` cache, and any module that was successfully loaded " -"as a side-effect, must remain in the cache. This contrasts with reloading " -"where even the failing module is left in :data:`sys.modules`." +"removed from :data:`sys.modules`. Any module already in the :data:`sys." +"modules` cache, and any module that was successfully loaded as a side-" +"effect, must remain in the cache. This contrasts with reloading where even " +"the failing module is left in :data:`sys.modules`." msgstr "" "如果載入失敗,只有載入失敗的模組會從 :data:`sys.modules` 中刪除。任何已存在" "於 :data:`sys.modules` 快取中的模組,以及任何在載入失敗前成功載入的模組,都必" @@ -743,11 +737,11 @@ msgstr "" #: ../../reference/import.rst:408 msgid "" "The import system has taken over the boilerplate responsibilities of " -"loaders. These were previously performed by " -"the :meth:`importlib.abc.Loader.load_module` method." +"loaders. These were previously performed by the :meth:`importlib.abc.Loader." +"load_module` method." msgstr "" -"引入系統已接管載入器的模板 (boilerplate) 責任。之前是" -"由 :meth:`importlib.abc.Loader.load_module` 方法執行的。" +"引入系統已接管載入器的模板 (boilerplate) 責任。之前是由 :meth:`importlib.abc." +"Loader.load_module` 方法執行的。" #: ../../reference/import.rst:414 msgid "Loaders" @@ -761,8 +755,8 @@ msgid "" "returned from :meth:`~importlib.abc.Loader.exec_module` is ignored." msgstr "" "模組載入器提供了載入的關鍵功能:模組執行。引入機制會以單一引數(即要執行的模" -"組物件)呼叫 :meth:`importlib.abc.Loader.exec_module` 方法。任何" -"從 :meth:`~importlib.abc.Loader.exec_module` 回傳的值都會被忽略。" +"組物件)呼叫 :meth:`importlib.abc.Loader.exec_module` 方法。任何從 :meth:" +"`~importlib.abc.Loader.exec_module` 回傳的值都會被忽略。" #: ../../reference/import.rst:421 msgid "Loaders must satisfy the following requirements:" @@ -779,12 +773,12 @@ msgstr "" #: ../../reference/import.rst:427 msgid "" -"If the loader cannot execute the module, it should raise " -"an :exc:`ImportError`, although any other exception raised " -"during :meth:`~importlib.abc.Loader.exec_module` will be propagated." +"If the loader cannot execute the module, it should raise an :exc:" +"`ImportError`, although any other exception raised during :meth:`~importlib." +"abc.Loader.exec_module` will be propagated." msgstr "" -"如果載入器無法執行該模組,應引發 :exc:`ImportError`。不過," -"在 :meth:`~importlib.abc.Loader.exec_module` 中引發的任何其他例外也會被傳播。" +"如果載入器無法執行該模組,應引發 :exc:`ImportError`。不過,在 :meth:" +"`~importlib.abc.Loader.exec_module` 中引發的任何其他例外也會被傳播。" #: ../../reference/import.rst:431 msgid "" @@ -792,9 +786,9 @@ msgid "" "the :meth:`~importlib.abc.MetaPathFinder.find_spec` method would just return " "a spec with the loader set to ``self``." msgstr "" -"在許多情況下,尋檢器和載入器可以是同一個物件;在這種情況" -"下,:meth:`~importlib.abc.MetaPathFinder.find_spec` 方法只需回傳一個載入器設" -"為 ``self`` 的規格即可。" +"在許多情況下,尋檢器和載入器可以是同一個物件;在這種情況下,:meth:" +"`~importlib.abc.MetaPathFinder.find_spec` 方法只需回傳一個載入器設為 " +"``self`` 的規格即可。" #: ../../reference/import.rst:435 msgid "" @@ -816,13 +810,12 @@ msgstr "載入器的 :meth:`~importlib.abc.Loader.create_module` 方法。" #: ../../reference/import.rst:445 msgid "" -"The :meth:`~importlib.abc.Loader.load_module` method was replaced " -"by :meth:`~importlib.abc.Loader.exec_module` and the import machinery " -"assumed all the boilerplate responsibilities of loading." +"The :meth:`~importlib.abc.Loader.load_module` method was replaced by :meth:" +"`~importlib.abc.Loader.exec_module` and the import machinery assumed all the " +"boilerplate responsibilities of loading." msgstr "" -":meth:`~importlib.abc.Loader.load_module` 方法已" -"被 :meth:`~importlib.abc.Loader.exec_module` 取代,引入機制已承擔所有載入的模" -"板責任。" +":meth:`~importlib.abc.Loader.load_module` 方法已被 :meth:`~importlib.abc." +"Loader.exec_module` 取代,引入機制已承擔所有載入的模板責任。" #: ../../reference/import.rst:450 msgid "" @@ -846,16 +839,16 @@ msgstr "" #: ../../reference/import.rst:459 msgid "" -"If there is an existing module object with the given name " -"in :data:`sys.modules`, the loader must use that existing module. " -"(Otherwise, :func:`importlib.reload` will not work correctly.) If the named " -"module does not exist in :data:`sys.modules`, the loader must create a new " -"module object and add it to :data:`sys.modules`." +"If there is an existing module object with the given name in :data:`sys." +"modules`, the loader must use that existing module. (Otherwise, :func:" +"`importlib.reload` will not work correctly.) If the named module does not " +"exist in :data:`sys.modules`, the loader must create a new module object and " +"add it to :data:`sys.modules`." msgstr "" "如果 :data:`sys.modules` 中已存在具有給定名稱的模組物件,載入器必須使用該模組" -"(否則 :func:`importlib.reload` 將無法正常運作)。如果命名模組不存在" -"於 :data:`sys.modules` 中,載入器必須建立一個新的模組物件並將其新增" -"至 :data:`sys.modules`。" +"(否則 :func:`importlib.reload` 將無法正常運作)。如果命名模組不存在於 :data:" +"`sys.modules` 中,載入器必須建立一個新的模組物件並將其新增至 :data:`sys." +"modules`。" #: ../../reference/import.rst:465 msgid "" @@ -867,9 +860,9 @@ msgstr "" #: ../../reference/import.rst:469 msgid "" -"If loading fails, the loader must remove any modules it has inserted " -"into :data:`sys.modules`, but it must remove **only** the failing module(s), " -"and only if the loader itself has loaded the module(s) explicitly." +"If loading fails, the loader must remove any modules it has inserted into :" +"data:`sys.modules`, but it must remove **only** the failing module(s), and " +"only if the loader itself has loaded the module(s) explicitly." msgstr "" "如果載入失敗,載入器必須移除已經插入到 :data:`sys.modules` 中的任何模組,但" "\\ **只能**\\ 移除失敗的模組(們),且僅在載入器本身明確載入這些模組時才需移" @@ -880,16 +873,16 @@ msgid "" "A :exc:`DeprecationWarning` is raised when ``exec_module()`` is defined but " "``create_module()`` is not." msgstr "" -"當 ``exec_module()`` 已定義但未定義 ``create_module()`` 時,將引" -"發 :exc:`DeprecationWarning`。" +"當 ``exec_module()`` 已定義但未定義 ``create_module()`` 時,將引發 :exc:" +"`DeprecationWarning`。" #: ../../reference/import.rst:478 msgid "" "An :exc:`ImportError` is raised when ``exec_module()`` is defined but " "``create_module()`` is not." msgstr "" -"當 ``exec_module()`` 已定義但未定義 ``create_module()`` 時,將引" -"發 :exc:`ImportError`。" +"當 ``exec_module()`` 已定義但未定義 ``create_module()`` 時,將引發 :exc:" +"`ImportError`。" #: ../../reference/import.rst:482 msgid "Use of ``load_module()`` will raise :exc:`ImportWarning`." @@ -910,9 +903,9 @@ msgid "" msgstr "" "當使用任何機制(例如 ``importlib`` APIs、``import`` 或 ``import-from`` 陳述" "式,或內建的 ``__import__()``\\ )載入子模組時,會將子模組物件繫結到父模組的" -"命名空間中。例如,如果套件 ``spam`` 有一個子模組 ``foo``,則在引入 " -"``spam.foo`` 之後,``spam`` 將擁有一個名為 ``foo`` 的屬性,該屬性繫結到子模" -"組。我們假設你有以下的目錄結構: ::" +"命名空間中。例如,如果套件 ``spam`` 有一個子模組 ``foo``,則在引入 ``spam." +"foo`` 之後,``spam`` 將擁有一個名為 ``foo`` 的屬性,該屬性繫結到子模組。我們" +"假設你有以下的目錄結構: ::" #: ../../reference/import.rst:495 msgid "" @@ -957,13 +950,13 @@ msgstr "" msgid "" "Given Python's familiar name binding rules this might seem surprising, but " "it's actually a fundamental feature of the import system. The invariant " -"holding is that if you have ``sys.modules['spam']`` and " -"``sys.modules['spam.foo']`` (as you would after the above import), the " -"latter must appear as the ``foo`` attribute of the former." +"holding is that if you have ``sys.modules['spam']`` and ``sys.modules['spam." +"foo']`` (as you would after the above import), the latter must appear as the " +"``foo`` attribute of the former." msgstr "" "鑑於 Python 相似的名稱繫結規則,這可能看起來有些出人意料,但這實際上是引入系" -"統的一個基本特性。不變的是如果你擁有 ``sys.modules['spam']`` 和 " -"``sys.modules['spam.foo']``\\ (就像上述引入後那樣),那麼後者必須作為前者的 " +"統的一個基本特性。不變的是如果你擁有 ``sys.modules['spam']`` 和 ``sys." +"modules['spam.foo']``\\ (就像上述引入後那樣),那麼後者必須作為前者的 " "``foo`` 屬性出現。" #: ../../reference/import.rst:521 @@ -997,8 +990,8 @@ msgstr "" msgid "" "The module's spec is exposed as :attr:`module.__spec__`. Setting :attr:`!" "__spec__` appropriately applies equally to :ref:`modules initialized during " -"interpreter startup `. The one exception is ``__main__``, " -"where :attr:`!__spec__` is :ref:`set to None in some cases `." +"interpreter startup `. The one exception is ``__main__``, where :" +"attr:`!__spec__` is :ref:`set to None in some cases `." msgstr "" "模組的規格以 :attr:`module.__spec__` 的形式公開。適當地設定 :attr:`!" "__spec__` 同樣適用於\\ :ref:`在直譯器啟動期間初始化的模組 `。唯一的" @@ -1018,19 +1011,19 @@ msgstr "" #: ../../reference/import.rst:550 msgid "" -"The :attr:`~module.__path__` attribute should be a (possibly " -"empty) :term:`sequence` of strings enumerating the locations where the " -"package's submodules will be found. By definition, if a module has a :attr:`!" -"__path__` attribute, it is a :term:`package`." +"The :attr:`~module.__path__` attribute should be a (possibly empty) :term:" +"`sequence` of strings enumerating the locations where the package's " +"submodules will be found. By definition, if a module has a :attr:`!__path__` " +"attribute, it is a :term:`package`." msgstr "" #: ../../reference/import.rst:555 msgid "" "A package's :attr:`~module.__path__` attribute is used during imports of its " -"subpackages. Within the import machinery, it functions much the same " -"as :data:`sys.path`, i.e. providing a list of locations to search for " -"modules during import. However, :attr:`!__path__` is typically much more " -"constrained than :data:`!sys.path`." +"subpackages. Within the import machinery, it functions much the same as :" +"data:`sys.path`, i.e. providing a list of locations to search for modules " +"during import. However, :attr:`!__path__` is typically much more constrained " +"than :data:`!sys.path`." msgstr "" #: ../../reference/import.rst:562 @@ -1042,13 +1035,12 @@ msgstr "" #: ../../reference/import.rst:566 msgid "" -"A package's ``__init__.py`` file may set or alter the " -"package's :attr:`~module.__path__` attribute, and this was typically the way " -"namespace packages were implemented prior to :pep:`420`. With the adoption " -"of :pep:`420`, namespace packages no longer need to supply ``__init__.py`` " -"files containing only :attr:`!__path__` manipulation code; the import " -"machinery automatically sets :attr:`!__path__` correctly for the namespace " -"package." +"A package's ``__init__.py`` file may set or alter the package's :attr:" +"`~module.__path__` attribute, and this was typically the way namespace " +"packages were implemented prior to :pep:`420`. With the adoption of :pep:" +"`420`, namespace packages no longer need to supply ``__init__.py`` files " +"containing only :attr:`!__path__` manipulation code; the import machinery " +"automatically sets :attr:`!__path__` correctly for the namespace package." msgstr "" #: ../../reference/import.rst:575 @@ -1067,9 +1059,9 @@ msgid "" "If the module has a spec (``__spec__``), the import machinery will try to " "generate a repr from it. If that fails or there is no spec, the import " "system will craft a default repr using whatever information is available on " -"the module. It will try to use the ``module.__name__``, " -"``module.__file__``, and ``module.__loader__`` as input into the repr, with " -"defaults for whatever information is missing." +"the module. It will try to use the ``module.__name__``, ``module." +"__file__``, and ``module.__loader__`` as input into the repr, with defaults " +"for whatever information is missing." msgstr "" #: ../../reference/import.rst:588 @@ -1124,14 +1116,14 @@ msgstr "" msgid "" "Python also supports \"hash-based\" cache files, which store a hash of the " "source file's contents rather than its metadata. There are two variants of " -"hash-based ``.pyc`` files: checked and unchecked. For checked hash-based " -"``.pyc`` files, Python validates the cache file by hashing the source file " -"and comparing the resulting hash with the hash in the cache file. If a " -"checked hash-based cache file is found to be invalid, Python regenerates it " -"and writes a new checked hash-based cache file. For unchecked hash-based " -"``.pyc`` files, Python simply assumes the cache file is valid if it exists. " -"Hash-based ``.pyc`` files validation behavior may be overridden with " -"the :option:`--check-hash-based-pycs` flag." +"hash-based ``.pyc`` files: checked and unchecked. For checked hash-based ``." +"pyc`` files, Python validates the cache file by hashing the source file and " +"comparing the resulting hash with the hash in the cache file. If a checked " +"hash-based cache file is found to be invalid, Python regenerates it and " +"writes a new checked hash-based cache file. For unchecked hash-based ``." +"pyc`` files, Python simply assumes the cache file is valid if it exists. " +"Hash-based ``.pyc`` files validation behavior may be overridden with the :" +"option:`--check-hash-based-pycs` flag." msgstr "" #: ../../reference/import.rst:630 @@ -1147,10 +1139,10 @@ msgstr "" #: ../../reference/import.rst:641 msgid "" "As mentioned previously, Python comes with several default meta path " -"finders. One of these, called the :term:`path based finder` " -"(:class:`~importlib.machinery.PathFinder`), searches an :term:`import path`, " -"which contains a list of :term:`path entries `. Each path entry " -"names a location to search for modules." +"finders. One of these, called the :term:`path based finder` (:class:" +"`~importlib.machinery.PathFinder`), searches an :term:`import path`, which " +"contains a list of :term:`path entries `. Each path entry names " +"a location to search for modules." msgstr "" #: ../../reference/import.rst:647 @@ -1165,10 +1157,10 @@ msgid "" "The default set of path entry finders implement all the semantics for " "finding modules on the file system, handling special file types such as " "Python source code (``.py`` files), Python byte code (``.pyc`` files) and " -"shared libraries (e.g. ``.so`` files). When supported by " -"the :mod:`zipimport` module in the standard library, the default path entry " -"finders also handle loading all of these file types (other than shared " -"libraries) from zipfiles." +"shared libraries (e.g. ``.so`` files). When supported by the :mod:" +"`zipimport` module in the standard library, the default path entry finders " +"also handle loading all of these file types (other than shared libraries) " +"from zipfiles." msgstr "" #: ../../reference/import.rst:658 @@ -1192,8 +1184,8 @@ msgstr "" #: ../../reference/import.rst:670 msgid "" "A word of warning: this section and the previous both use the term *finder*, " -"distinguishing between them by using the terms :term:`meta path finder` " -"and :term:`path entry finder`. These two types of finders are very similar, " +"distinguishing between them by using the terms :term:`meta path finder` and :" +"term:`path entry finder`. These two types of finders are very similar, " "support similar protocols, and function in similar ways during the import " "process, but it's important to keep in mind that they are subtly different. " "In particular, meta path finders operate at the beginning of the import " @@ -1222,19 +1214,18 @@ msgstr "" #: ../../reference/import.rst:698 msgid "" -"As a meta path finder, the :term:`path based finder` implements " -"the :meth:`~importlib.abc.MetaPathFinder.find_spec` protocol previously " -"described, however it exposes additional hooks that can be used to customize " -"how modules are found and loaded from the :term:`import path`." +"As a meta path finder, the :term:`path based finder` implements the :meth:" +"`~importlib.abc.MetaPathFinder.find_spec` protocol previously described, " +"however it exposes additional hooks that can be used to customize how " +"modules are found and loaded from the :term:`import path`." msgstr "" #: ../../reference/import.rst:703 msgid "" -"Three variables are used by the :term:`path based " -"finder`, :data:`sys.path`, :data:`sys.path_hooks` " -"and :data:`sys.path_importer_cache`. The ``__path__`` attributes on package " -"objects are also used. These provide additional ways that the import " -"machinery can be customized." +"Three variables are used by the :term:`path based finder`, :data:`sys." +"path`, :data:`sys.path_hooks` and :data:`sys.path_importer_cache`. The " +"``__path__`` attributes on package objects are also used. These provide " +"additional ways that the import machinery can be customized." msgstr "" #: ../../reference/import.rst:708 @@ -1243,10 +1234,10 @@ msgid "" "modules and packages. It is initialized from the :envvar:`PYTHONPATH` " "environment variable and various other installation- and implementation-" "specific defaults. Entries in :data:`sys.path` can name directories on the " -"file system, zip files, and potentially other \"locations\" (see " -"the :mod:`site` module) that should be searched for modules, such as URLs, " -"or database queries. Only strings should be present on :data:`sys.path`; " -"all other data types are ignored." +"file system, zip files, and potentially other \"locations\" (see the :mod:" +"`site` module) that should be searched for modules, such as URLs, or " +"database queries. Only strings should be present on :data:`sys.path`; all " +"other data types are ignored." msgstr "" #: ../../reference/import.rst:717 @@ -1254,39 +1245,39 @@ msgid "" "The :term:`path based finder` is a :term:`meta path finder`, so the import " "machinery begins the :term:`import path` search by calling the path based " "finder's :meth:`~importlib.machinery.PathFinder.find_spec` method as " -"described previously. When the ``path`` argument " -"to :meth:`~importlib.machinery.PathFinder.find_spec` is given, it will be a " -"list of string paths to traverse - typically a package's ``__path__`` " -"attribute for an import within that package. If the ``path`` argument is " -"``None``, this indicates a top level import and :data:`sys.path` is used." +"described previously. When the ``path`` argument to :meth:`~importlib." +"machinery.PathFinder.find_spec` is given, it will be a list of string paths " +"to traverse - typically a package's ``__path__`` attribute for an import " +"within that package. If the ``path`` argument is ``None``, this indicates a " +"top level import and :data:`sys.path` is used." msgstr "" #: ../../reference/import.rst:726 msgid "" "The path based finder iterates over every entry in the search path, and for " -"each of these, looks for an appropriate :term:`path entry finder` " -"(:class:`~importlib.abc.PathEntryFinder`) for the path entry. Because this " -"can be an expensive operation (e.g. there may be ``stat()`` call overheads " -"for this search), the path based finder maintains a cache mapping path " -"entries to path entry finders. This cache is maintained " -"in :data:`sys.path_importer_cache` (despite the name, this cache actually " -"stores finder objects rather than being limited to :term:`importer` " -"objects). In this way, the expensive search for a particular :term:`path " -"entry` location's :term:`path entry finder` need only be done once. User " -"code is free to remove cache entries from :data:`sys.path_importer_cache` " -"forcing the path based finder to perform the path entry search again." +"each of these, looks for an appropriate :term:`path entry finder` (:class:" +"`~importlib.abc.PathEntryFinder`) for the path entry. Because this can be " +"an expensive operation (e.g. there may be ``stat()`` call overheads for this " +"search), the path based finder maintains a cache mapping path entries to " +"path entry finders. This cache is maintained in :data:`sys." +"path_importer_cache` (despite the name, this cache actually stores finder " +"objects rather than being limited to :term:`importer` objects). In this way, " +"the expensive search for a particular :term:`path entry` location's :term:" +"`path entry finder` need only be done once. User code is free to remove " +"cache entries from :data:`sys.path_importer_cache` forcing the path based " +"finder to perform the path entry search again." msgstr "" #: ../../reference/import.rst:739 msgid "" "If the path entry is not present in the cache, the path based finder " -"iterates over every callable in :data:`sys.path_hooks`. Each of " -"the :term:`path entry hooks ` in this list is called with a " -"single argument, the path entry to be searched. This callable may either " -"return a :term:`path entry finder` that can handle the path entry, or it may " -"raise :exc:`ImportError`. An :exc:`ImportError` is used by the path based " -"finder to signal that the hook cannot find a :term:`path entry finder` for " -"that :term:`path entry`. The exception is ignored and :term:`import path` " +"iterates over every callable in :data:`sys.path_hooks`. Each of the :term:" +"`path entry hooks ` in this list is called with a single " +"argument, the path entry to be searched. This callable may either return a :" +"term:`path entry finder` that can handle the path entry, or it may raise :" +"exc:`ImportError`. An :exc:`ImportError` is used by the path based finder " +"to signal that the hook cannot find a :term:`path entry finder` for that :" +"term:`path entry`. The exception is ignored and :term:`import path` " "iteration continues. The hook should expect either a string or bytes " "object; the encoding of bytes objects is up to the hook (e.g. it may be a " "file system encoding, UTF-8, or something else), and if the hook cannot " @@ -1296,11 +1287,11 @@ msgstr "" #: ../../reference/import.rst:753 msgid "" "If :data:`sys.path_hooks` iteration ends with no :term:`path entry finder` " -"being returned, then the path based " -"finder's :meth:`~importlib.machinery.PathFinder.find_spec` method will store " -"``None`` in :data:`sys.path_importer_cache` (to indicate that there is no " -"finder for this path entry) and return ``None``, indicating that " -"this :term:`meta path finder` could not find the module." +"being returned, then the path based finder's :meth:`~importlib.machinery." +"PathFinder.find_spec` method will store ``None`` in :data:`sys." +"path_importer_cache` (to indicate that there is no finder for this path " +"entry) and return ``None``, indicating that this :term:`meta path finder` " +"could not find the module." msgstr "" #: ../../reference/import.rst:760 @@ -1318,9 +1309,9 @@ msgid "" "current working directory cannot be determined or is found not to exist, no " "value is stored in :data:`sys.path_importer_cache`. Second, the value for " "the current working directory is looked up fresh for each module lookup. " -"Third, the path used for :data:`sys.path_importer_cache` and returned " -"by :meth:`importlib.machinery.PathFinder.find_spec` will be the actual " -"current working directory and not the empty string." +"Third, the path used for :data:`sys.path_importer_cache` and returned by :" +"meth:`importlib.machinery.PathFinder.find_spec` will be the actual current " +"working directory and not the empty string." msgstr "" #: ../../reference/import.rst:775 @@ -1344,9 +1335,9 @@ msgstr "" #: ../../reference/import.rst:786 msgid "" -"To indicate to the import machinery that the spec represents a " -"namespace :term:`portion`, the path entry finder sets " -"``submodule_search_locations`` to a list containing the portion." +"To indicate to the import machinery that the spec represents a namespace :" +"term:`portion`, the path entry finder sets ``submodule_search_locations`` to " +"a list containing the portion." msgstr "" #: ../../reference/import.rst:790 @@ -1415,26 +1406,24 @@ msgstr "" msgid "" "If it is acceptable to only alter the behaviour of import statements without " "affecting other APIs that access the import system, then replacing the " -"builtin :func:`__import__` function may be sufficient. This technique may " -"also be employed at the module level to only alter the behaviour of import " -"statements within that module." +"builtin :func:`__import__` function may be sufficient." msgstr "" -#: ../../reference/import.rst:841 +#: ../../reference/import.rst:839 msgid "" "To selectively prevent the import of some modules from a hook early on the " "meta path (rather than disabling the standard import system entirely), it is " -"sufficient to raise :exc:`ModuleNotFoundError` directly " -"from :meth:`~importlib.abc.MetaPathFinder.find_spec` instead of returning " -"``None``. The latter indicates that the meta path search should continue, " -"while raising an exception terminates it immediately." +"sufficient to raise :exc:`ModuleNotFoundError` directly from :meth:" +"`~importlib.abc.MetaPathFinder.find_spec` instead of returning ``None``. The " +"latter indicates that the meta path search should continue, while raising an " +"exception terminates it immediately." msgstr "" -#: ../../reference/import.rst:851 +#: ../../reference/import.rst:849 msgid "Package Relative Imports" msgstr "" -#: ../../reference/import.rst:853 +#: ../../reference/import.rst:851 msgid "" "Relative imports use leading dots. A single leading dot indicates a relative " "import, starting with the current package. Two or more leading dots indicate " @@ -1442,7 +1431,7 @@ msgid "" "after the first. For example, given the following package layout::" msgstr "" -#: ../../reference/import.rst:858 +#: ../../reference/import.rst:856 msgid "" "package/\n" " __init__.py\n" @@ -1466,13 +1455,13 @@ msgstr "" " moduleZ.py\n" " moduleA.py" -#: ../../reference/import.rst:869 +#: ../../reference/import.rst:867 msgid "" "In either ``subpackage1/moduleX.py`` or ``subpackage1/__init__.py``, the " "following are valid relative imports::" msgstr "" -#: ../../reference/import.rst:872 +#: ../../reference/import.rst:870 msgid "" "from .moduleY import spam\n" "from .moduleY import spam as ham\n" @@ -1488,49 +1477,49 @@ msgstr "" "from ..subpackage2.moduleZ import eggs\n" "from ..moduleA import foo" -#: ../../reference/import.rst:879 +#: ../../reference/import.rst:877 msgid "" "Absolute imports may use either the ``import <>`` or ``from <> import <>`` " "syntax, but relative imports may only use the second form; the reason for " "this is that::" msgstr "" -#: ../../reference/import.rst:883 +#: ../../reference/import.rst:881 msgid "import XXX.YYY.ZZZ" msgstr "import XXX.YYY.ZZZ" -#: ../../reference/import.rst:885 +#: ../../reference/import.rst:883 msgid "" "should expose ``XXX.YYY.ZZZ`` as a usable expression, but .moduleY is not a " "valid expression." msgstr "" -#: ../../reference/import.rst:892 +#: ../../reference/import.rst:890 msgid "Special considerations for __main__" msgstr "" -#: ../../reference/import.rst:894 +#: ../../reference/import.rst:892 msgid "" "The :mod:`__main__` module is a special case relative to Python's import " "system. As noted :ref:`elsewhere `, the ``__main__`` module is " -"directly initialized at interpreter startup, much like :mod:`sys` " -"and :mod:`builtins`. However, unlike those two, it doesn't strictly qualify " -"as a built-in module. This is because the manner in which ``__main__`` is " +"directly initialized at interpreter startup, much like :mod:`sys` and :mod:" +"`builtins`. However, unlike those two, it doesn't strictly qualify as a " +"built-in module. This is because the manner in which ``__main__`` is " "initialized depends on the flags and other options with which the " "interpreter is invoked." msgstr "" -#: ../../reference/import.rst:905 +#: ../../reference/import.rst:903 msgid "__main__.__spec__" msgstr "__main__.__spec__" -#: ../../reference/import.rst:907 +#: ../../reference/import.rst:905 msgid "" "Depending on how :mod:`__main__` is initialized, ``__main__.__spec__`` gets " "set appropriately or to ``None``." msgstr "" -#: ../../reference/import.rst:910 +#: ../../reference/import.rst:908 msgid "" "When Python is started with the :option:`-m` option, ``__spec__`` is set to " "the module spec of the corresponding module or package. ``__spec__`` is also " @@ -1538,38 +1527,38 @@ msgid "" "directory, zipfile or other :data:`sys.path` entry." msgstr "" -#: ../../reference/import.rst:915 +#: ../../reference/import.rst:913 msgid "" -"In :ref:`the remaining cases ` " -"``__main__.__spec__`` is set to ``None``, as the code used to populate " -"the :mod:`__main__` does not correspond directly with an importable module:" +"In :ref:`the remaining cases ` ``__main__." +"__spec__`` is set to ``None``, as the code used to populate the :mod:" +"`__main__` does not correspond directly with an importable module:" msgstr "" -#: ../../reference/import.rst:919 +#: ../../reference/import.rst:917 msgid "interactive prompt" msgstr "" -#: ../../reference/import.rst:920 +#: ../../reference/import.rst:918 msgid ":option:`-c` option" msgstr ":option:`-c` 選項" -#: ../../reference/import.rst:921 +#: ../../reference/import.rst:919 msgid "running from stdin" msgstr "" -#: ../../reference/import.rst:922 +#: ../../reference/import.rst:920 msgid "running directly from a source or bytecode file" msgstr "" -#: ../../reference/import.rst:924 +#: ../../reference/import.rst:922 msgid "" "Note that ``__main__.__spec__`` is always ``None`` in the last case, *even " "if* the file could technically be imported directly as a module instead. Use " -"the :option:`-m` switch if valid module metadata is desired " -"in :mod:`__main__`." +"the :option:`-m` switch if valid module metadata is desired in :mod:" +"`__main__`." msgstr "" -#: ../../reference/import.rst:929 +#: ../../reference/import.rst:927 msgid "" "Note also that even when ``__main__`` corresponds with an importable module " "and ``__main__.__spec__`` is set accordingly, they're still considered " @@ -1578,11 +1567,11 @@ msgid "" "populate the ``__main__`` namespace, and not during normal import." msgstr "" -#: ../../reference/import.rst:937 +#: ../../reference/import.rst:935 msgid "References" msgstr "" -#: ../../reference/import.rst:939 +#: ../../reference/import.rst:937 msgid "" "The import machinery has evolved considerably since Python's early days. " "The original `specification for packages ` for " "Python 3.3. :pep:`420` also introduced the :meth:`!find_loader` protocol as " "an alternative to :meth:`!find_module`." msgstr "" -#: ../../reference/import.rst:951 +#: ../../reference/import.rst:949 msgid "" ":pep:`366` describes the addition of the ``__package__`` attribute for " "explicit relative imports in main modules." msgstr "" -#: ../../reference/import.rst:954 +#: ../../reference/import.rst:952 msgid "" ":pep:`328` introduced absolute and explicit relative imports and initially " "proposed ``__name__`` for semantics :pep:`366` would eventually specify for " "``__package__``." msgstr "" -#: ../../reference/import.rst:958 +#: ../../reference/import.rst:956 msgid ":pep:`338` defines executing modules as scripts." msgstr "" -#: ../../reference/import.rst:960 +#: ../../reference/import.rst:958 msgid "" ":pep:`451` adds the encapsulation of per-module import state in spec " "objects. It also off-loads most of the boilerplate responsibilities of " @@ -1629,22 +1618,21 @@ msgid "" "finders and loaders." msgstr "" -#: ../../reference/import.rst:967 +#: ../../reference/import.rst:965 msgid "Footnotes" msgstr "註解" -#: ../../reference/import.rst:968 +#: ../../reference/import.rst:966 msgid "See :class:`types.ModuleType`." msgstr "參閱 :class:`types.ModuleType`。" -#: ../../reference/import.rst:970 +#: ../../reference/import.rst:968 msgid "" "The importlib implementation avoids using the return value directly. " -"Instead, it gets the module object by looking the module name up " -"in :data:`sys.modules`. The indirect effect of this is that an imported " -"module may replace itself in :data:`sys.modules`. This is implementation-" -"specific behavior that is not guaranteed to work in other Python " -"implementations." +"Instead, it gets the module object by looking the module name up in :data:" +"`sys.modules`. The indirect effect of this is that an imported module may " +"replace itself in :data:`sys.modules`. This is implementation-specific " +"behavior that is not guaranteed to work in other Python implementations." msgstr "" #: ../../reference/import.rst:8 diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index f460273f04..57f2aefc3d 100644 --- a/whatsnew/3.14.po +++ b/whatsnew/3.14.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-26 00:14+0000\n" +"POT-Creation-Date: 2025-12-31 00:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1438,13 +1438,13 @@ msgstr "" msgid "The behavior of :func:`!gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.14.rst:974 ../../whatsnew/3.14.rst:3267 +#: ../../whatsnew/3.14.rst:974 ../../whatsnew/3.14.rst:3276 msgid "" "``gc.collect(1)``: Performs an increment of garbage collection, rather than " "collecting generation 1." msgstr "" -#: ../../whatsnew/3.14.rst:976 ../../whatsnew/3.14.rst:3269 +#: ../../whatsnew/3.14.rst:976 ../../whatsnew/3.14.rst:3278 msgid "Other calls to :func:`!gc.collect` are unchanged." msgstr "" @@ -1528,7 +1528,7 @@ msgstr "" msgid "Improved modules" msgstr "" -#: ../../whatsnew/3.14.rst:1041 ../../whatsnew/3.14.rst:2301 +#: ../../whatsnew/3.14.rst:1041 ../../whatsnew/3.14.rst:2310 msgid "argparse" msgstr "argparse" @@ -1556,7 +1556,7 @@ msgid "" "by Hugo van Kemenade in :gh:`130645`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1061 ../../whatsnew/3.14.rst:2320 +#: ../../whatsnew/3.14.rst:1061 ../../whatsnew/3.14.rst:2329 msgid "ast" msgstr "ast" @@ -1600,7 +1600,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.14.rst:1087 ../../whatsnew/3.14.rst:2162 -#: ../../whatsnew/3.14.rst:2351 +#: ../../whatsnew/3.14.rst:2360 msgid "asyncio" msgstr "asyncio" @@ -2527,7 +2527,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.14.rst:1677 ../../whatsnew/3.14.rst:2249 -#: ../../whatsnew/3.14.rst:2501 +#: ../../whatsnew/3.14.rst:2510 msgid "pathlib" msgstr "pathlib" @@ -3115,7 +3115,7 @@ msgstr "" msgid "(Contributed by Serhiy Storchaka in :gh:`71339`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`71339` 貢獻。)" -#: ../../whatsnew/3.14.rst:2064 ../../whatsnew/3.14.rst:2547 +#: ../../whatsnew/3.14.rst:2064 ../../whatsnew/3.14.rst:2556 msgid "urllib" msgstr "urllib" @@ -3187,7 +3187,7 @@ msgstr "" msgid "(Contributed by Barney Gale in :gh:`125866`.)" msgstr "(由 Barney Gale 於 :gh:`125866` 貢獻。)" -#: ../../whatsnew/3.14.rst:2098 ../../whatsnew/3.14.rst:2269 +#: ../../whatsnew/3.14.rst:2098 ../../whatsnew/3.14.rst:2278 msgid "uuid" msgstr "uuid" @@ -3393,24 +3393,36 @@ msgid "" "Tian Gao in :gh:`124533`.)" msgstr "" +#: ../../whatsnew/3.14.rst:2269 +msgid "textwrap" +msgstr "" + #: ../../whatsnew/3.14.rst:2271 msgid "" +"Optimize the :func:`~textwrap.dedent` function, improving performance by an " +"average of 2.4x, with larger improvements for bigger inputs, and fix a bug " +"with incomplete normalization of blank lines with whitespace characters " +"other than space and tab." +msgstr "" + +#: ../../whatsnew/3.14.rst:2280 +msgid "" ":func:`~uuid.uuid3` and :func:`~uuid.uuid5` are now both roughly 40% faster " "for 16-byte names and 20% faster for 1024-byte names. Performance for longer " "names remains unchanged. (Contributed by Bénédikt Tran in :gh:`128150`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2276 +#: ../../whatsnew/3.14.rst:2285 msgid "" ":func:`~uuid.uuid4` is now c. 30% faster. (Contributed by Bénédikt Tran in :" "gh:`128150`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2281 +#: ../../whatsnew/3.14.rst:2290 msgid "zlib" msgstr "zlib" -#: ../../whatsnew/3.14.rst:2283 +#: ../../whatsnew/3.14.rst:2292 msgid "" "On Windows, `zlib-ng `__ is now used as " "the implementation of the :mod:`zlib` module in the default binaries. There " @@ -3419,29 +3431,29 @@ msgid "" "compression levels." msgstr "" -#: ../../whatsnew/3.14.rst:2290 +#: ../../whatsnew/3.14.rst:2299 msgid "" "It is worth noting that ``zlib.Z_BEST_SPEED`` (``1``) may result in " "significantly less compression than the previous implementation, whilst also " "significantly reducing the time taken to compress." msgstr "" -#: ../../whatsnew/3.14.rst:2294 +#: ../../whatsnew/3.14.rst:2303 msgid "(Contributed by Steve Dower in :gh:`91349`.)" msgstr "(由 Steve Dower 於 :gh:`91349` 貢獻。)" -#: ../../whatsnew/3.14.rst:2298 +#: ../../whatsnew/3.14.rst:2307 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.14.rst:2303 +#: ../../whatsnew/3.14.rst:2312 msgid "" "Remove the *type*, *choices*, and *metavar* parameters of :class:`!" "BooleanOptionalAction`. These have been deprecated since Python 3.12. " "(Contributed by Nikita Sobolev in :gh:`118805`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2308 +#: ../../whatsnew/3.14.rst:2317 msgid "" "Calling :meth:`~argparse.ArgumentParser.add_argument_group` on an argument " "group now raises a :exc:`ValueError`. Similarly, :meth:`~argparse." @@ -3453,34 +3465,34 @@ msgid "" "Savannah Ostrowski in :gh:`127186`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2322 +#: ../../whatsnew/3.14.rst:2331 msgid "" "Remove the following classes, which have been deprecated aliases of :class:" "`~ast.Constant` since Python 3.8 and have emitted deprecation warnings since " "Python 3.12:" msgstr "" -#: ../../whatsnew/3.14.rst:2326 +#: ../../whatsnew/3.14.rst:2335 msgid ":class:`!Bytes`" msgstr ":class:`!Bytes`" -#: ../../whatsnew/3.14.rst:2327 +#: ../../whatsnew/3.14.rst:2336 msgid ":class:`!Ellipsis`" msgstr ":class:`!Ellipsis`" -#: ../../whatsnew/3.14.rst:2328 +#: ../../whatsnew/3.14.rst:2337 msgid ":class:`!NameConstant`" msgstr ":class:`!NameConstant`" -#: ../../whatsnew/3.14.rst:2329 +#: ../../whatsnew/3.14.rst:2338 msgid ":class:`!Num`" msgstr ":class:`!Num`" -#: ../../whatsnew/3.14.rst:2330 +#: ../../whatsnew/3.14.rst:2339 msgid ":class:`!Str`" msgstr ":class:`!Str`" -#: ../../whatsnew/3.14.rst:2332 +#: ../../whatsnew/3.14.rst:2341 msgid "" "As a consequence of these removals, user-defined ``visit_Num``, " "``visit_Str``, ``visit_Bytes``, ``visit_NameConstant`` and " @@ -3489,91 +3501,91 @@ msgid "" "an AST. Define a ``visit_Constant`` method instead." msgstr "" -#: ../../whatsnew/3.14.rst:2338 +#: ../../whatsnew/3.14.rst:2347 msgid "(Contributed by Alex Waygood in :gh:`119562`.)" msgstr "(由 Alex Waygood 於 :gh:`119562` 貢獻。)" -#: ../../whatsnew/3.14.rst:2340 +#: ../../whatsnew/3.14.rst:2349 msgid "" "Remove the following deprecated properties on :class:`ast.Constant`, which " "were present for compatibility with the now-removed AST classes:" msgstr "" -#: ../../whatsnew/3.14.rst:2343 +#: ../../whatsnew/3.14.rst:2352 msgid ":attr:`!Constant.n`" msgstr ":attr:`!Constant.n`" -#: ../../whatsnew/3.14.rst:2344 +#: ../../whatsnew/3.14.rst:2353 msgid ":attr:`!Constant.s`" msgstr ":attr:`!Constant.s`" -#: ../../whatsnew/3.14.rst:2346 +#: ../../whatsnew/3.14.rst:2355 msgid "" "Use :attr:`!Constant.value` instead. (Contributed by Alex Waygood in :gh:" "`119562`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2353 +#: ../../whatsnew/3.14.rst:2362 msgid "" "Remove the following classes, methods, and functions, which have been " "deprecated since Python 3.12:" msgstr "" -#: ../../whatsnew/3.14.rst:2356 +#: ../../whatsnew/3.14.rst:2365 msgid ":class:`!AbstractChildWatcher`" msgstr ":class:`!AbstractChildWatcher`" -#: ../../whatsnew/3.14.rst:2357 +#: ../../whatsnew/3.14.rst:2366 msgid ":class:`!FastChildWatcher`" msgstr ":class:`!FastChildWatcher`" -#: ../../whatsnew/3.14.rst:2358 +#: ../../whatsnew/3.14.rst:2367 msgid ":class:`!MultiLoopChildWatcher`" msgstr ":class:`!MultiLoopChildWatcher`" -#: ../../whatsnew/3.14.rst:2359 +#: ../../whatsnew/3.14.rst:2368 msgid ":class:`!PidfdChildWatcher`" msgstr ":class:`!PidfdChildWatcher`" -#: ../../whatsnew/3.14.rst:2360 +#: ../../whatsnew/3.14.rst:2369 msgid ":class:`!SafeChildWatcher`" msgstr ":class:`!SafeChildWatcher`" -#: ../../whatsnew/3.14.rst:2361 +#: ../../whatsnew/3.14.rst:2370 msgid ":class:`!ThreadedChildWatcher`" msgstr ":class:`!ThreadedChildWatcher`" -#: ../../whatsnew/3.14.rst:2362 +#: ../../whatsnew/3.14.rst:2371 msgid ":meth:`!AbstractEventLoopPolicy.get_child_watcher`" msgstr ":meth:`!AbstractEventLoopPolicy.get_child_watcher`" -#: ../../whatsnew/3.14.rst:2363 +#: ../../whatsnew/3.14.rst:2372 msgid ":meth:`!AbstractEventLoopPolicy.set_child_watcher`" msgstr ":meth:`!AbstractEventLoopPolicy.set_child_watcher`" -#: ../../whatsnew/3.14.rst:2364 +#: ../../whatsnew/3.14.rst:2373 msgid ":func:`!get_child_watcher`" msgstr ":func:`!get_child_watcher`" -#: ../../whatsnew/3.14.rst:2365 +#: ../../whatsnew/3.14.rst:2374 msgid ":func:`!set_child_watcher`" msgstr ":func:`!set_child_watcher`" -#: ../../whatsnew/3.14.rst:2367 +#: ../../whatsnew/3.14.rst:2376 msgid "(Contributed by Kumar Aditya in :gh:`120804`.)" msgstr "(由 Kumar Aditya 於 :gh:`120804` 貢獻。)" -#: ../../whatsnew/3.14.rst:2369 +#: ../../whatsnew/3.14.rst:2378 msgid "" ":func:`asyncio.get_event_loop` now raises a :exc:`RuntimeError` if there is " "no current event loop, and no longer implicitly creates an event loop." msgstr "" -#: ../../whatsnew/3.14.rst:2373 +#: ../../whatsnew/3.14.rst:2382 msgid "(Contributed by Kumar Aditya in :gh:`126353`.)" msgstr "(由 Kumar Aditya 於 :gh:`126353` 貢獻。)" -#: ../../whatsnew/3.14.rst:2378 +#: ../../whatsnew/3.14.rst:2387 msgid "" "There's a few patterns that use :func:`asyncio.get_event_loop`, most of them " "can be replaced with :func:`asyncio.run`." @@ -3581,16 +3593,16 @@ msgstr "" "有一些使用 :func:`asyncio.get_event_loop` 的模式,其中大多數可以用 :func:" "`asyncio.run` 取代。" -#: ../../whatsnew/3.14.rst:2381 +#: ../../whatsnew/3.14.rst:2390 msgid "If you're running an async function, simply use :func:`asyncio.run`." msgstr "如果你正在運行非同步函式,只需使用 :func:`asyncio.run`。" -#: ../../whatsnew/3.14.rst:2383 ../../whatsnew/3.14.rst:2410 -#: ../../whatsnew/3.14.rst:2438 +#: ../../whatsnew/3.14.rst:2392 ../../whatsnew/3.14.rst:2419 +#: ../../whatsnew/3.14.rst:2447 msgid "Before:" msgstr "之前是:" -#: ../../whatsnew/3.14.rst:2385 +#: ../../whatsnew/3.14.rst:2394 msgid "" "async def main():\n" " ...\n" @@ -3612,12 +3624,12 @@ msgstr "" "finally:\n" " loop.close()" -#: ../../whatsnew/3.14.rst:2397 ../../whatsnew/3.14.rst:2423 -#: ../../whatsnew/3.14.rst:2454 +#: ../../whatsnew/3.14.rst:2406 ../../whatsnew/3.14.rst:2432 +#: ../../whatsnew/3.14.rst:2463 msgid "After:" msgstr "之後是:" -#: ../../whatsnew/3.14.rst:2399 +#: ../../whatsnew/3.14.rst:2408 msgid "" "async def main():\n" " ...\n" @@ -3629,7 +3641,7 @@ msgstr "" "\n" "asyncio.run(main())" -#: ../../whatsnew/3.14.rst:2406 +#: ../../whatsnew/3.14.rst:2415 msgid "" "If you need to start something, for example, a server listening on a socket " "and then run forever, use :func:`asyncio.run` and an :class:`asyncio.Event`." @@ -3637,7 +3649,7 @@ msgstr "" "如果你需要啟動某些東西然後永遠運行,像是監聽 socket 的伺服器,請使用 :func:" "`asyncio.run` 和 :class:`asyncio.Event`。" -#: ../../whatsnew/3.14.rst:2412 +#: ../../whatsnew/3.14.rst:2421 msgid "" "def start_server(loop): ...\n" "\n" @@ -3657,7 +3669,7 @@ msgstr "" "finally:\n" " loop.close()" -#: ../../whatsnew/3.14.rst:2425 +#: ../../whatsnew/3.14.rst:2434 msgid "" "def start_server(loop): ...\n" "\n" @@ -3675,7 +3687,7 @@ msgstr "" "\n" "asyncio.run(main())" -#: ../../whatsnew/3.14.rst:2435 +#: ../../whatsnew/3.14.rst:2444 msgid "" "If you need to run something in an event loop, then run some blocking code " "around it, use :class:`asyncio.Runner`." @@ -3683,7 +3695,7 @@ msgstr "" "如果你需要在事件迴圈中運行某些東西,然後在其周圍運行一些阻塞程式碼,請使用 :" "class:`asyncio.Runner`。" -#: ../../whatsnew/3.14.rst:2440 +#: ../../whatsnew/3.14.rst:2449 msgid "" "async def operation_one(): ...\n" "def blocking_code(): ...\n" @@ -3709,7 +3721,7 @@ msgstr "" "finally:\n" " loop.close()" -#: ../../whatsnew/3.14.rst:2456 +#: ../../whatsnew/3.14.rst:2465 msgid "" "async def operation_one(): ...\n" "def blocking_code(): ...\n" @@ -3729,65 +3741,65 @@ msgstr "" " blocking_code()\n" " runner.run(operation_two())" -#: ../../whatsnew/3.14.rst:2469 +#: ../../whatsnew/3.14.rst:2478 msgid "email" msgstr "email" -#: ../../whatsnew/3.14.rst:2471 +#: ../../whatsnew/3.14.rst:2480 msgid "" "Remove :func:`email.utils.localtime`'s *isdst* parameter, which was " "deprecated in and has been ignored since Python 3.12. (Contributed by Hugo " "van Kemenade in :gh:`118798`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2477 +#: ../../whatsnew/3.14.rst:2486 msgid "importlib.abc" msgstr "importlib.abc" -#: ../../whatsnew/3.14.rst:2479 +#: ../../whatsnew/3.14.rst:2488 msgid "Remove deprecated :mod:`importlib.abc` classes:" msgstr "移除已棄用的 :mod:`importlib.abc` 類別:" -#: ../../whatsnew/3.14.rst:2481 +#: ../../whatsnew/3.14.rst:2490 msgid "" ":class:`!ResourceReader` (use :class:`~importlib.resources.abc." "TraversableResources`)" msgstr "" -#: ../../whatsnew/3.14.rst:2483 +#: ../../whatsnew/3.14.rst:2492 msgid "" ":class:`!Traversable` (use :class:`~importlib.resources.abc.Traversable`)" msgstr "" -#: ../../whatsnew/3.14.rst:2485 +#: ../../whatsnew/3.14.rst:2494 msgid "" ":class:`!TraversableResources` (use :class:`~importlib.resources.abc." "TraversableResources`)" msgstr "" -#: ../../whatsnew/3.14.rst:2488 +#: ../../whatsnew/3.14.rst:2497 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../whatsnew/3.14.rst:2492 +#: ../../whatsnew/3.14.rst:2501 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.14.rst:2494 +#: ../../whatsnew/3.14.rst:2503 msgid "" "Remove support for copy, deepcopy, and pickle operations from :mod:" "`itertools` iterators. These have emitted a :exc:`DeprecationWarning` since " "Python 3.12. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2503 +#: ../../whatsnew/3.14.rst:2512 msgid "" "Remove support for passing additional keyword arguments to :class:`~pathlib." "Path`. In previous versions, any such arguments are ignored. (Contributed by " "Barney Gale in :gh:`74033`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2508 +#: ../../whatsnew/3.14.rst:2517 msgid "" "Remove support for passing additional positional arguments to :meth:`." "PurePath.relative_to` and :meth:`~pathlib.PurePath.is_relative_to`. In " @@ -3795,33 +3807,33 @@ msgid "" "by Barney Gale in :gh:`78707`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2515 +#: ../../whatsnew/3.14.rst:2524 msgid "pkgutil" msgstr "pkgutil" -#: ../../whatsnew/3.14.rst:2517 +#: ../../whatsnew/3.14.rst:2526 msgid "" "Remove the :func:`!get_loader` and :func:`!find_loader` functions, which " "have been deprecated since Python 3.12. (Contributed by Bénédikt Tran in :gh:" "`97850`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2523 +#: ../../whatsnew/3.14.rst:2532 msgid "pty" msgstr "pty" -#: ../../whatsnew/3.14.rst:2525 +#: ../../whatsnew/3.14.rst:2534 msgid "" "Remove the :func:`!master_open` and :func:`!slave_open` functions, which " "have been deprecated since Python 3.12. Use :func:`pty.openpty` instead. " "(Contributed by Nikita Sobolev in :gh:`118824`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2532 +#: ../../whatsnew/3.14.rst:2541 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.14.rst:2534 +#: ../../whatsnew/3.14.rst:2543 msgid "" "Remove :data:`!version` and :data:`!version_info` from the :mod:`sqlite3` " "module; use :data:`~sqlite3.sqlite_version` and :data:`~sqlite3." @@ -3829,27 +3841,27 @@ msgid "" "library. (Contributed by Hugo van Kemenade in :gh:`118924`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2540 +#: ../../whatsnew/3.14.rst:2549 msgid "" "Using a sequence of parameters with named placeholders now raises a :exc:" "`~sqlite3.ProgrammingError`, having been deprecated since Python 3.12. " "(Contributed by Erlend E. Aasland in :gh:`118928` and :gh:`101693`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2549 +#: ../../whatsnew/3.14.rst:2558 msgid "" "Remove the :class:`!Quoter` class from :mod:`urllib.parse`, which has been " "deprecated since Python 3.11. (Contributed by Nikita Sobolev in :gh:" "`118827`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2553 +#: ../../whatsnew/3.14.rst:2562 msgid "" "Remove the :class:`!URLopener` and :class:`!FancyURLopener` classes from :" "mod:`urllib.request`, which have been deprecated since Python 3.3." msgstr "" -#: ../../whatsnew/3.14.rst:2557 +#: ../../whatsnew/3.14.rst:2566 msgid "" "``myopener.open()`` can be replaced with :func:`~urllib.request.urlopen`. " "``myopener.retrieve()`` can be replaced with :func:`~urllib.request." @@ -3858,15 +3870,15 @@ msgid "" "(Contributed by Barney Gale in :gh:`84850`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2566 +#: ../../whatsnew/3.14.rst:2575 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.14.rst:2569 +#: ../../whatsnew/3.14.rst:2578 msgid "New deprecations" msgstr "" -#: ../../whatsnew/3.14.rst:2571 +#: ../../whatsnew/3.14.rst:2580 msgid "" "Passing a complex number as the *real* or *imag* argument in the :func:" "`complex` constructor is now deprecated; complex numbers should only be " @@ -3877,12 +3889,12 @@ msgstr "" "用;複數應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢" "獻。)" -#: ../../whatsnew/3.14.rst:2576 +#: ../../whatsnew/3.14.rst:2585 #: ../../deprecations/pending-removal-in-future.rst:7 msgid ":mod:`argparse`:" msgstr ":mod:`argparse`:" -#: ../../whatsnew/3.14.rst:2578 +#: ../../whatsnew/3.14.rst:2587 msgid "" "Passing the undocumented keyword argument *prefix_chars* to the :meth:" "`~argparse.ArgumentParser.add_argument_group` method is now deprecated. " @@ -3892,19 +3904,19 @@ msgstr "" "ArgumentParser.add_argument_group` 的做法現在已被棄用。(由 Savannah " "Ostrowski 於 :gh:`125563` 貢獻。)" -#: ../../whatsnew/3.14.rst:2582 +#: ../../whatsnew/3.14.rst:2591 msgid "" "Deprecated the :class:`argparse.FileType` type converter. Anything relating " "to resource management should be handled downstream, after the arguments " "have been parsed. (Contributed by Serhiy Storchaka in :gh:`58032`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2587 +#: ../../whatsnew/3.14.rst:2596 #: ../../deprecations/pending-removal-in-3.16.rst:19 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../whatsnew/3.14.rst:2589 +#: ../../whatsnew/3.14.rst:2598 msgid "" "The :func:`!asyncio.iscoroutinefunction` is now deprecated and will be " "removed in Python 3.16; use :func:`inspect.iscoroutinefunction` instead. " @@ -3914,7 +3926,7 @@ msgstr "" "用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" "gh:`122875` 貢獻。)" -#: ../../whatsnew/3.14.rst:2594 +#: ../../whatsnew/3.14.rst:2603 msgid "" "The :mod:`asyncio` policy system is deprecated and will be removed in Python " "3.16. In particular, the following classes and functions are deprecated:" @@ -3922,37 +3934,37 @@ msgstr "" ":mod:`asyncio` 策略系統已被棄用並將在 Python 3.16 中移除。特別是以下類別和函" "式已被棄用:" -#: ../../whatsnew/3.14.rst:2598 +#: ../../whatsnew/3.14.rst:2607 #: ../../deprecations/pending-removal-in-3.16.rst:29 msgid ":class:`asyncio.AbstractEventLoopPolicy`" msgstr ":class:`asyncio.AbstractEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2599 +#: ../../whatsnew/3.14.rst:2608 #: ../../deprecations/pending-removal-in-3.16.rst:30 msgid ":class:`asyncio.DefaultEventLoopPolicy`" msgstr ":class:`asyncio.DefaultEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2600 +#: ../../whatsnew/3.14.rst:2609 #: ../../deprecations/pending-removal-in-3.16.rst:31 msgid ":class:`asyncio.WindowsSelectorEventLoopPolicy`" msgstr ":class:`asyncio.WindowsSelectorEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2601 +#: ../../whatsnew/3.14.rst:2610 #: ../../deprecations/pending-removal-in-3.16.rst:32 msgid ":class:`asyncio.WindowsProactorEventLoopPolicy`" msgstr ":class:`asyncio.WindowsProactorEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2602 +#: ../../whatsnew/3.14.rst:2611 #: ../../deprecations/pending-removal-in-3.16.rst:33 msgid ":func:`asyncio.get_event_loop_policy`" msgstr ":func:`asyncio.get_event_loop_policy`" -#: ../../whatsnew/3.14.rst:2603 +#: ../../whatsnew/3.14.rst:2612 #: ../../deprecations/pending-removal-in-3.16.rst:34 msgid ":func:`asyncio.set_event_loop_policy`" msgstr ":func:`asyncio.set_event_loop_policy`" -#: ../../whatsnew/3.14.rst:2605 +#: ../../whatsnew/3.14.rst:2614 msgid "" "Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with the " "*loop_factory* argument to use the desired event loop implementation." @@ -3960,11 +3972,11 @@ msgstr "" "使用者應該使用 :func:`asyncio.run` 或 :class:`asyncio.Runner` 搭配 " "*loop_factory* 引數來使用所需的事件迴圈實作。" -#: ../../whatsnew/3.14.rst:2608 +#: ../../whatsnew/3.14.rst:2617 msgid "For example, to use :class:`asyncio.SelectorEventLoop` on Windows:" msgstr "例如在 Windows 上使用 :class:`asyncio.SelectorEventLoop`:" -#: ../../whatsnew/3.14.rst:2610 +#: ../../whatsnew/3.14.rst:2619 #: ../../deprecations/pending-removal-in-3.16.rst:41 msgid "" "import asyncio\n" @@ -3981,12 +3993,12 @@ msgstr "" "\n" "asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)" -#: ../../whatsnew/3.14.rst:2619 +#: ../../whatsnew/3.14.rst:2628 #: ../../deprecations/pending-removal-in-3.16.rst:48 msgid "(Contributed by Kumar Aditya in :gh:`127949`.)" msgstr "(由 Kumar Aditya 於 :gh:`127949` 貢獻。)" -#: ../../whatsnew/3.14.rst:2621 +#: ../../whatsnew/3.14.rst:2630 msgid "" ":mod:`codecs`: The :func:`codecs.open` function is now deprecated, and will " "be removed in a future version of Python. Use :func:`open` instead. " @@ -3995,13 +4007,13 @@ msgstr "" ":mod:`codecs`: :func:`codecs.open` 函式已被棄用,並將在未來的 Python 版本中移" "除。請改用 :func:`open`。(由 Inada Naoki 於 :gh:`133036` 貢獻。)" -#: ../../whatsnew/3.14.rst:2627 +#: ../../whatsnew/3.14.rst:2636 #: ../../deprecations/pending-removal-in-3.15.rst:16 #: ../../deprecations/pending-removal-in-3.19.rst:4 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" -#: ../../whatsnew/3.14.rst:2629 +#: ../../whatsnew/3.14.rst:2638 msgid "" "On non-Windows platforms, setting :attr:`.Structure._pack_` to use a MSVC-" "compatible default memory layout is now deprecated in favor of setting :attr:" @@ -4009,7 +4021,7 @@ msgid "" "(Contributed by Petr Viktorin in :gh:`131747`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2634 +#: ../../whatsnew/3.14.rst:2643 msgid "" "Calling :func:`ctypes.POINTER` on a string is now deprecated. Use :ref:" "`incomplete types ` for self-referential " @@ -4018,7 +4030,7 @@ msgid "" "by Sergey Myrianov in :gh:`100926`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2641 +#: ../../whatsnew/3.14.rst:2650 msgid "" ":mod:`functools`: Calling the Python implementation of :func:`functools." "reduce` with *function* or *sequence* as keyword arguments is now " @@ -4029,7 +4041,7 @@ msgstr "" "`functools.reduce` 的 Python 實作已被棄用;這些參數將在 Python 3.16 中變為僅" "限位置引數。(由 Kirill Podoprigora 於 :gh:`121676` 貢獻。)" -#: ../../whatsnew/3.14.rst:2647 +#: ../../whatsnew/3.14.rst:2656 msgid "" ":mod:`logging`: Support for custom logging handlers with the *strm* argument " "is now deprecated and scheduled for removal in Python 3.16. Define handlers " @@ -4040,7 +4052,7 @@ msgstr "" "劃在 Python 3.16 中移除。請改為使用 *stream* 引數來定義處理函式。(由 " "Mariusz Felisiak 於 :gh:`115032` 貢獻。)" -#: ../../whatsnew/3.14.rst:2653 +#: ../../whatsnew/3.14.rst:2662 msgid "" ":mod:`mimetypes`: Valid extensions are either empty or must start with '.' " "for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated " @@ -4051,14 +4063,14 @@ msgstr "" "add_type` 以 '.' 開頭。未加點的副檔名已被棄用,並將在 Python 3.16 中引發 :" "exc:`ValueError`。(由 Hugo van Kemenade 於 :gh:`75223` 貢獻。)" -#: ../../whatsnew/3.14.rst:2660 +#: ../../whatsnew/3.14.rst:2669 msgid "" ":mod:`!nturl2path`: This module is now deprecated. Call :func:`urllib." "request.url2pathname` and :func:`~urllib.request.pathname2url` instead. " "(Contributed by Barney Gale in :gh:`125866`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2665 +#: ../../whatsnew/3.14.rst:2674 msgid "" ":mod:`os`: The :func:`os.popen` and :func:`os.spawn* ` functions " "are now :term:`soft deprecated`. They should no longer be used to write new " @@ -4066,14 +4078,14 @@ msgid "" "Victor Stinner in :gh:`120743`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2672 +#: ../../whatsnew/3.14.rst:2681 msgid "" ":mod:`pathlib`: :meth:`!pathlib.PurePath.as_uri` is now deprecated and " "scheduled for removal in Python 3.19. Use :meth:`pathlib.Path.as_uri` " "instead. (Contributed by Barney Gale in :gh:`123599`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2678 +#: ../../whatsnew/3.14.rst:2687 msgid "" ":mod:`pdb`: The undocumented ``pdb.Pdb.curframe_locals`` attribute is now a " "deprecated read-only property, which will be removed in a future version of " @@ -4084,14 +4096,14 @@ msgid "" "(Contributed by Tian Gao in :gh:`124369` and :gh:`125951`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2687 +#: ../../whatsnew/3.14.rst:2696 msgid "" ":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " "lack of interest, scheduled for removal in Python 3.16. (Contributed by " "Bénédikt Tran in :gh:`119698`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2692 +#: ../../whatsnew/3.14.rst:2701 msgid "" ":mod:`tkinter`: The :class:`!tkinter.Variable` methods :meth:`!" "trace_variable`, :meth:`!trace_vdelete` and :meth:`!trace_vinfo` are now " @@ -4099,7 +4111,7 @@ msgid "" "trace_info` instead. (Contributed by Serhiy Storchaka in :gh:`120220`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2698 +#: ../../whatsnew/3.14.rst:2707 msgid "" ":mod:`urllib.parse`: Accepting objects with false values (like ``0`` and " "``[]``) except empty strings, bytes-like objects and ``None`` in :func:" @@ -5009,18 +5021,18 @@ msgstr "" ":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." "_clear_internal_caches`。" -#: ../../whatsnew/3.14.rst:2718 +#: ../../whatsnew/3.14.rst:2727 msgid "CPython bytecode changes" msgstr "CPython 位元組碼變更" -#: ../../whatsnew/3.14.rst:2720 +#: ../../whatsnew/3.14.rst:2729 msgid "" "Replaced the opcode :opcode:`!BINARY_SUBSCR` by the :opcode:`BINARY_OP` " "opcode with the ``NB_SUBSCR`` oparg. (Contributed by Irit Katriel in :gh:" "`100239`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2724 +#: ../../whatsnew/3.14.rst:2733 msgid "" "Add the :opcode:`BUILD_INTERPOLATION` and :opcode:`BUILD_TEMPLATE` opcodes " "to construct new :class:`~string.templatelib.Interpolation` and :class:" @@ -5029,20 +5041,20 @@ msgid "" "Template strings `)." msgstr "" -#: ../../whatsnew/3.14.rst:2730 +#: ../../whatsnew/3.14.rst:2739 msgid "" "Remove the :opcode:`!BUILD_CONST_KEY_MAP` opcode. Use :opcode:`BUILD_MAP` " "instead. (Contributed by Mark Shannon in :gh:`122160`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2734 +#: ../../whatsnew/3.14.rst:2743 msgid "" "Replace the :opcode:`!LOAD_ASSERTION_ERROR` opcode with :opcode:" "`LOAD_COMMON_CONSTANT` and add support for loading :exc:" "`NotImplementedError`." msgstr "" -#: ../../whatsnew/3.14.rst:2738 +#: ../../whatsnew/3.14.rst:2747 msgid "" "Add the :opcode:`LOAD_FAST_BORROW` and :opcode:" "`LOAD_FAST_BORROW_LOAD_FAST_BORROW` opcodes to reduce reference counting " @@ -5051,14 +5063,14 @@ msgid "" "gh:`130704`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2743 +#: ../../whatsnew/3.14.rst:2752 msgid "" "Add the :opcode:`LOAD_SMALL_INT` opcode, which pushes a small integer equal " "to the ``oparg`` to the stack. The :opcode:`!RETURN_CONST` opcode is removed " "as it is no longer used. (Contributed by Mark Shannon in :gh:`125837`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2748 +#: ../../whatsnew/3.14.rst:2757 msgid "" "Add the new :opcode:`LOAD_SPECIAL` instruction. Generate code for :keyword:" "`with` and :keyword:`async with` statements using the new instruction. " @@ -5066,17 +5078,17 @@ msgid "" "instructions. (Contributed by Mark Shannon in :gh:`120507`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2754 +#: ../../whatsnew/3.14.rst:2763 msgid "" "Add the :opcode:`POP_ITER` opcode to support 'virtual' iterators. " "(Contributed by Mark Shannon in :gh:`132554`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2759 +#: ../../whatsnew/3.14.rst:2768 msgid "Pseudo-instructions" msgstr "" -#: ../../whatsnew/3.14.rst:2761 +#: ../../whatsnew/3.14.rst:2770 msgid "" "Add the :opcode:`!ANNOTATIONS_PLACEHOLDER` pseudo instruction to support " "partially executed module-level annotations with :ref:`deferred evaluation " @@ -5084,14 +5096,14 @@ msgid "" "Zijlstra in :gh:`130907`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2766 +#: ../../whatsnew/3.14.rst:2775 msgid "" "Add the :opcode:`!BINARY_OP_EXTEND` pseudo instruction, which executes a " "pair of functions (guard and specialization functions) accessed from the " "inline cache. (Contributed by Irit Katriel in :gh:`100239`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2771 +#: ../../whatsnew/3.14.rst:2780 msgid "" "Add three specializations for :opcode:`CALL_KW`; :opcode:`!CALL_KW_PY` for " "calls to Python functions, :opcode:`!CALL_KW_BOUND_METHOD` for calls to " @@ -5099,7 +5111,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`118093`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2777 +#: ../../whatsnew/3.14.rst:2786 msgid "" "Add the :opcode:`JUMP_IF_TRUE` and :opcode:`JUMP_IF_FALSE` pseudo " "instructions, conditional jumps which do not impact the stack. Replaced by " @@ -5107,55 +5119,55 @@ msgid "" "(Contributed by Irit Katriel in :gh:`124285`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2782 +#: ../../whatsnew/3.14.rst:2791 msgid "" "Add the :opcode:`!LOAD_CONST_MORTAL` pseudo instruction. (Contributed by " "Mark Shannon in :gh:`128685`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2785 +#: ../../whatsnew/3.14.rst:2794 msgid "" "Add the :opcode:`LOAD_CONST_IMMORTAL` pseudo instruction, which does the " "same as :opcode:`!LOAD_CONST`, but is more efficient for immortal objects. " "(Contributed by Mark Shannon in :gh:`125837`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2790 +#: ../../whatsnew/3.14.rst:2799 msgid "" "Add the :opcode:`NOT_TAKEN` pseudo instruction, used by :mod:`sys." "monitoring` to record branch events (such as :monitoring-event:" "`BRANCH_LEFT`). (Contributed by Mark Shannon in :gh:`122548`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2796 +#: ../../whatsnew/3.14.rst:2805 msgid "C API changes" msgstr "C API 變更" -#: ../../whatsnew/3.14.rst:2801 +#: ../../whatsnew/3.14.rst:2810 msgid "Python configuration C API" msgstr "" -#: ../../whatsnew/3.14.rst:2803 +#: ../../whatsnew/3.14.rst:2812 msgid "" "Add a :ref:`PyInitConfig C API ` to configure the Python " "initialization without relying on C structures and the ability to make ABI-" "compatible changes in the future." msgstr "" -#: ../../whatsnew/3.14.rst:2807 +#: ../../whatsnew/3.14.rst:2816 msgid "" "Complete the :pep:`587` :ref:`PyConfig C API ` by adding :c:" "func:`PyInitConfig_AddModule` which can be used to add a built-in extension " "module; a feature previously referred to as the \"inittab\"." msgstr "" -#: ../../whatsnew/3.14.rst:2811 +#: ../../whatsnew/3.14.rst:2820 msgid "" "Add :c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions to get and " "set the current runtime configuration." msgstr "" -#: ../../whatsnew/3.14.rst:2814 +#: ../../whatsnew/3.14.rst:2823 msgid "" ":pep:`587` 'Python Initialization Configuration' unified all the ways to " "configure Python's initialization. This PEP also unifies the configuration " @@ -5164,7 +5176,7 @@ msgid "" "two 'Python' and 'Isolated' choices (PEP 587), to further simplify the API." msgstr "" -#: ../../whatsnew/3.14.rst:2821 +#: ../../whatsnew/3.14.rst:2830 msgid "" "The lower level PEP 587 PyConfig API remains available for use cases with an " "intentionally higher level of coupling to CPython implementation details " @@ -5172,20 +5184,20 @@ msgid "" "configuration mechanisms)." msgstr "" -#: ../../whatsnew/3.14.rst:2826 ../../whatsnew/3.14.rst:2853 -#: ../../whatsnew/3.14.rst:2873 +#: ../../whatsnew/3.14.rst:2835 ../../whatsnew/3.14.rst:2862 +#: ../../whatsnew/3.14.rst:2882 msgid "(Contributed by Victor Stinner in :gh:`107954`.)" msgstr "(由 Victor Stinner 於 :gh:`107954` 貢獻。)" -#: ../../whatsnew/3.14.rst:2828 +#: ../../whatsnew/3.14.rst:2837 msgid ":pep:`741` and :pep:`587`" msgstr ":pep:`741` 和 :pep:`587`" -#: ../../whatsnew/3.14.rst:2832 +#: ../../whatsnew/3.14.rst:2841 msgid "New features in the C API" msgstr "C API 中的新功能" -#: ../../whatsnew/3.14.rst:2834 +#: ../../whatsnew/3.14.rst:2843 msgid "" "Add :c:func:`Py_PACK_VERSION` and :c:func:`Py_PACK_FULL_VERSION`, two new " "macros for bit-packing Python version numbers. This is useful for " @@ -5193,14 +5205,14 @@ msgid "" "(Contributed by Petr Viktorin in :gh:`128629`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2840 +#: ../../whatsnew/3.14.rst:2849 msgid "" "Add :c:func:`PyBytes_Join(sep, iterable) ` function, similar " "to ``sep.join(iterable)`` in Python. (Contributed by Victor Stinner in :gh:" "`121645`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2844 +#: ../../whatsnew/3.14.rst:2853 msgid "" "Add functions to manipulate the configuration of the current runtime Python " "interpreter (:ref:`PEP 741: Python configuration C API `):" -#: ../../whatsnew/3.14.rst:2848 +#: ../../whatsnew/3.14.rst:2857 msgid ":c:func:`PyConfig_Get`" msgstr ":c:func:`PyConfig_Get`" -#: ../../whatsnew/3.14.rst:2849 +#: ../../whatsnew/3.14.rst:2858 msgid ":c:func:`PyConfig_GetInt`" msgstr ":c:func:`PyConfig_GetInt`" -#: ../../whatsnew/3.14.rst:2850 +#: ../../whatsnew/3.14.rst:2859 msgid ":c:func:`PyConfig_Set`" msgstr ":c:func:`PyConfig_Set`" -#: ../../whatsnew/3.14.rst:2851 +#: ../../whatsnew/3.14.rst:2860 msgid ":c:func:`PyConfig_Names`" msgstr ":c:func:`PyConfig_Names`" -#: ../../whatsnew/3.14.rst:2855 +#: ../../whatsnew/3.14.rst:2864 msgid "" "Add functions to configure Python initialization (:ref:`PEP 741: Python " "configuration C API `):" @@ -5233,63 +5245,63 @@ msgstr "" "新增用於配置 Python 初始化的函式(:ref:`PEP 741:Python 配置 C API " "`):" -#: ../../whatsnew/3.14.rst:2858 +#: ../../whatsnew/3.14.rst:2867 msgid ":c:func:`Py_InitializeFromInitConfig`" msgstr ":c:func:`Py_InitializeFromInitConfig`" -#: ../../whatsnew/3.14.rst:2859 +#: ../../whatsnew/3.14.rst:2868 msgid ":c:func:`PyInitConfig_AddModule`" msgstr ":c:func:`PyInitConfig_AddModule`" -#: ../../whatsnew/3.14.rst:2860 +#: ../../whatsnew/3.14.rst:2869 msgid ":c:func:`PyInitConfig_Create`" msgstr ":c:func:`PyInitConfig_Create`" -#: ../../whatsnew/3.14.rst:2861 +#: ../../whatsnew/3.14.rst:2870 msgid ":c:func:`PyInitConfig_Free`" msgstr ":c:func:`PyInitConfig_Free`" -#: ../../whatsnew/3.14.rst:2862 +#: ../../whatsnew/3.14.rst:2871 msgid ":c:func:`PyInitConfig_FreeStrList`" msgstr ":c:func:`PyInitConfig_FreeStrList`" -#: ../../whatsnew/3.14.rst:2863 +#: ../../whatsnew/3.14.rst:2872 msgid ":c:func:`PyInitConfig_GetError`" msgstr ":c:func:`PyInitConfig_GetError`" -#: ../../whatsnew/3.14.rst:2864 +#: ../../whatsnew/3.14.rst:2873 msgid ":c:func:`PyInitConfig_GetExitCode`" msgstr ":c:func:`PyInitConfig_GetExitCode`" -#: ../../whatsnew/3.14.rst:2865 +#: ../../whatsnew/3.14.rst:2874 msgid ":c:func:`PyInitConfig_GetInt`" msgstr ":c:func:`PyInitConfig_GetInt`" -#: ../../whatsnew/3.14.rst:2866 +#: ../../whatsnew/3.14.rst:2875 msgid ":c:func:`PyInitConfig_GetStr`" msgstr ":c:func:`PyInitConfig_GetStr`" -#: ../../whatsnew/3.14.rst:2867 +#: ../../whatsnew/3.14.rst:2876 msgid ":c:func:`PyInitConfig_GetStrList`" msgstr ":c:func:`PyInitConfig_GetStrList`" -#: ../../whatsnew/3.14.rst:2868 +#: ../../whatsnew/3.14.rst:2877 msgid ":c:func:`PyInitConfig_HasOption`" msgstr ":c:func:`PyInitConfig_HasOption`" -#: ../../whatsnew/3.14.rst:2869 +#: ../../whatsnew/3.14.rst:2878 msgid ":c:func:`PyInitConfig_SetInt`" msgstr ":c:func:`PyInitConfig_SetInt`" -#: ../../whatsnew/3.14.rst:2870 +#: ../../whatsnew/3.14.rst:2879 msgid ":c:func:`PyInitConfig_SetStr`" msgstr ":c:func:`PyInitConfig_SetStr`" -#: ../../whatsnew/3.14.rst:2871 +#: ../../whatsnew/3.14.rst:2880 msgid ":c:func:`PyInitConfig_SetStrList`" msgstr ":c:func:`PyInitConfig_SetStrList`" -#: ../../whatsnew/3.14.rst:2875 +#: ../../whatsnew/3.14.rst:2884 msgid "" "Add :c:func:`Py_fopen` function to open a file. This works similarly to the " "standard C :c:func:`!fopen` function, instead accepting a Python object for " @@ -5298,13 +5310,13 @@ msgid "" "(Contributed by Victor Stinner in :gh:`127350`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2883 +#: ../../whatsnew/3.14.rst:2892 msgid "" "Add :c:func:`Py_HashBuffer` to compute and return the hash value of a " "buffer. (Contributed by Antoine Pitrou and Victor Stinner in :gh:`122854`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2886 +#: ../../whatsnew/3.14.rst:2895 msgid "" "Add :c:func:`PyImport_ImportModuleAttr` and :c:func:" "`PyImport_ImportModuleAttrString` helper functions to import a module and " @@ -5312,20 +5324,20 @@ msgid "" "`128911`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2891 +#: ../../whatsnew/3.14.rst:2900 msgid "" "Add :c:func:`PyIter_NextItem` to replace :c:func:`PyIter_Next`, which has an " "ambiguous return value. (Contributed by Irit Katriel and Erlend Aasland in :" "gh:`105201`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2895 +#: ../../whatsnew/3.14.rst:2904 msgid "" "Add :c:func:`PyLong_GetSign` function to get the sign of :class:`int` " "objects. (Contributed by Sergey B Kirpichev in :gh:`116560`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2898 +#: ../../whatsnew/3.14.rst:2907 msgid "" "Add :c:func:`PyLong_IsPositive`, :c:func:`PyLong_IsNegative` and :c:func:" "`PyLong_IsZero` for checking if :c:type:`PyLongObject` is positive, " @@ -5333,82 +5345,82 @@ msgid "" "Kirpichev in :gh:`126061`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2903 +#: ../../whatsnew/3.14.rst:2912 msgid "" "Add new functions to convert C ```` numbers to/from Python :class:" "`int` objects:" msgstr "" -#: ../../whatsnew/3.14.rst:2906 +#: ../../whatsnew/3.14.rst:2915 msgid ":c:func:`PyLong_AsInt32`" msgstr ":c:func:`PyLong_AsInt32`" -#: ../../whatsnew/3.14.rst:2907 +#: ../../whatsnew/3.14.rst:2916 msgid ":c:func:`PyLong_AsInt64`" msgstr ":c:func:`PyLong_AsInt64`" -#: ../../whatsnew/3.14.rst:2908 +#: ../../whatsnew/3.14.rst:2917 msgid ":c:func:`PyLong_AsUInt32`" msgstr ":c:func:`PyLong_AsUInt32`" -#: ../../whatsnew/3.14.rst:2909 +#: ../../whatsnew/3.14.rst:2918 msgid ":c:func:`PyLong_AsUInt64`" msgstr ":c:func:`PyLong_AsUInt64`" -#: ../../whatsnew/3.14.rst:2910 +#: ../../whatsnew/3.14.rst:2919 msgid ":c:func:`PyLong_FromInt32`" msgstr ":c:func:`PyLong_FromInt32`" -#: ../../whatsnew/3.14.rst:2911 +#: ../../whatsnew/3.14.rst:2920 msgid ":c:func:`PyLong_FromInt64`" msgstr ":c:func:`PyLong_FromInt64`" -#: ../../whatsnew/3.14.rst:2912 +#: ../../whatsnew/3.14.rst:2921 msgid ":c:func:`PyLong_FromUInt32`" msgstr ":c:func:`PyLong_FromUInt32`" -#: ../../whatsnew/3.14.rst:2913 +#: ../../whatsnew/3.14.rst:2922 msgid ":c:func:`PyLong_FromUInt64`" msgstr ":c:func:`PyLong_FromUInt64`" -#: ../../whatsnew/3.14.rst:2915 +#: ../../whatsnew/3.14.rst:2924 msgid "(Contributed by Victor Stinner in :gh:`120389`.)" msgstr "(由 Victor Stinner 於 :gh:`120389` 貢獻。)" -#: ../../whatsnew/3.14.rst:2917 +#: ../../whatsnew/3.14.rst:2926 msgid "" "Add a new import and export API for Python :class:`int` objects (:pep:`757`):" msgstr "" -#: ../../whatsnew/3.14.rst:2920 +#: ../../whatsnew/3.14.rst:2929 msgid ":c:func:`PyLong_GetNativeLayout`" msgstr ":c:func:`PyLong_GetNativeLayout`" -#: ../../whatsnew/3.14.rst:2921 +#: ../../whatsnew/3.14.rst:2930 msgid ":c:func:`PyLong_Export`" msgstr ":c:func:`PyLong_Export`" -#: ../../whatsnew/3.14.rst:2922 +#: ../../whatsnew/3.14.rst:2931 msgid ":c:func:`PyLong_FreeExport`" msgstr ":c:func:`PyLong_FreeExport`" -#: ../../whatsnew/3.14.rst:2923 +#: ../../whatsnew/3.14.rst:2932 msgid ":c:func:`PyLongWriter_Create`" msgstr ":c:func:`PyLongWriter_Create`" -#: ../../whatsnew/3.14.rst:2924 +#: ../../whatsnew/3.14.rst:2933 msgid ":c:func:`PyLongWriter_Finish`" msgstr ":c:func:`PyLongWriter_Finish`" -#: ../../whatsnew/3.14.rst:2925 +#: ../../whatsnew/3.14.rst:2934 msgid ":c:func:`PyLongWriter_Discard`" msgstr ":c:func:`PyLongWriter_Discard`" -#: ../../whatsnew/3.14.rst:2927 +#: ../../whatsnew/3.14.rst:2936 msgid "(Contributed by Sergey B Kirpichev and Victor Stinner in :gh:`102471`.)" msgstr "(由 Sergey B Kirpichev 和 Victor Stinner 於 :gh:`102471` 貢獻。)" -#: ../../whatsnew/3.14.rst:2929 +#: ../../whatsnew/3.14.rst:2938 msgid "" "Add :c:func:`PyMonitoring_FireBranchLeftEvent` and :c:func:" "`PyMonitoring_FireBranchRightEvent` for generating :monitoring-event:" @@ -5416,13 +5428,13 @@ msgid "" "(Contributed by Mark Shannon in :gh:`122548`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2935 +#: ../../whatsnew/3.14.rst:2944 msgid "" "Add :c:func:`PyType_Freeze` function to make a type immutable. (Contributed " "by Victor Stinner in :gh:`121654`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2938 +#: ../../whatsnew/3.14.rst:2947 msgid "" "Add :c:func:`PyType_GetBaseByToken` and :c:data:`Py_tp_token` slot for " "easier superclass identification, which attempts to resolve the type " @@ -5430,110 +5442,110 @@ msgid "" "in :gh:`124153`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2943 +#: ../../whatsnew/3.14.rst:2952 msgid "" "Add a new :c:func:`PyUnicode_Equal` function to test if two strings are " "equal. The function is also added to the Limited C API. (Contributed by " "Victor Stinner in :gh:`124502`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2948 +#: ../../whatsnew/3.14.rst:2957 msgid "" "Add a new :c:type:`PyUnicodeWriter` API to create a Python :class:`str` " "object, with the following functions:" msgstr "" -#: ../../whatsnew/3.14.rst:2951 +#: ../../whatsnew/3.14.rst:2960 msgid ":c:func:`PyUnicodeWriter_Create`" msgstr ":c:func:`PyUnicodeWriter_Create`" -#: ../../whatsnew/3.14.rst:2952 +#: ../../whatsnew/3.14.rst:2961 msgid ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" msgstr ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" -#: ../../whatsnew/3.14.rst:2953 +#: ../../whatsnew/3.14.rst:2962 msgid ":c:func:`PyUnicodeWriter_Discard`" msgstr ":c:func:`PyUnicodeWriter_Discard`" -#: ../../whatsnew/3.14.rst:2954 +#: ../../whatsnew/3.14.rst:2963 msgid ":c:func:`PyUnicodeWriter_Finish`" msgstr ":c:func:`PyUnicodeWriter_Finish`" -#: ../../whatsnew/3.14.rst:2955 +#: ../../whatsnew/3.14.rst:2964 msgid ":c:func:`PyUnicodeWriter_Format`" msgstr ":c:func:`PyUnicodeWriter_Format`" -#: ../../whatsnew/3.14.rst:2956 +#: ../../whatsnew/3.14.rst:2965 msgid ":c:func:`PyUnicodeWriter_WriteASCII`" msgstr ":c:func:`PyUnicodeWriter_WriteASCII`" -#: ../../whatsnew/3.14.rst:2957 +#: ../../whatsnew/3.14.rst:2966 msgid ":c:func:`PyUnicodeWriter_WriteChar`" msgstr ":c:func:`PyUnicodeWriter_WriteChar`" -#: ../../whatsnew/3.14.rst:2958 +#: ../../whatsnew/3.14.rst:2967 msgid ":c:func:`PyUnicodeWriter_WriteRepr`" msgstr ":c:func:`PyUnicodeWriter_WriteRepr`" -#: ../../whatsnew/3.14.rst:2959 +#: ../../whatsnew/3.14.rst:2968 msgid ":c:func:`PyUnicodeWriter_WriteStr`" msgstr ":c:func:`PyUnicodeWriter_WriteStr`" -#: ../../whatsnew/3.14.rst:2960 +#: ../../whatsnew/3.14.rst:2969 msgid ":c:func:`PyUnicodeWriter_WriteSubstring`" msgstr ":c:func:`PyUnicodeWriter_WriteSubstring`" -#: ../../whatsnew/3.14.rst:2961 +#: ../../whatsnew/3.14.rst:2970 msgid ":c:func:`PyUnicodeWriter_WriteUCS4`" msgstr ":c:func:`PyUnicodeWriter_WriteUCS4`" -#: ../../whatsnew/3.14.rst:2962 +#: ../../whatsnew/3.14.rst:2971 msgid ":c:func:`PyUnicodeWriter_WriteUTF8`" msgstr ":c:func:`PyUnicodeWriter_WriteUTF8`" -#: ../../whatsnew/3.14.rst:2963 +#: ../../whatsnew/3.14.rst:2972 msgid ":c:func:`PyUnicodeWriter_WriteWideChar`" msgstr ":c:func:`PyUnicodeWriter_WriteWideChar`" -#: ../../whatsnew/3.14.rst:2965 +#: ../../whatsnew/3.14.rst:2974 msgid "(Contributed by Victor Stinner in :gh:`119182`.)" msgstr "(由 Victor Stinner 於 :gh:`119182` 貢獻。)" -#: ../../whatsnew/3.14.rst:2967 +#: ../../whatsnew/3.14.rst:2976 msgid "" "The ``k`` and ``K`` formats in :c:func:`PyArg_ParseTuple` and similar " "functions now use :meth:`~object.__index__` if available, like all other " "integer formats. (Contributed by Serhiy Storchaka in :gh:`112068`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2972 +#: ../../whatsnew/3.14.rst:2981 msgid "" "Add support for a new ``p`` format unit in :c:func:`Py_BuildValue` that " "produces a Python :class:`bool` object from a C integer. (Contributed by " "Pablo Galindo in :issue:`45325`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2976 +#: ../../whatsnew/3.14.rst:2985 msgid "" "Add :c:func:`PyUnstable_IsImmortal` for determining if an object is :term:" "`immortal`, for debugging purposes. (Contributed by Peter Bierma in :gh:" "`128509`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2980 +#: ../../whatsnew/3.14.rst:2989 msgid "" "Add :c:func:`PyUnstable_Object_EnableDeferredRefcount` for enabling deferred " "reference counting, as outlined in :pep:`703`." msgstr "" -#: ../../whatsnew/3.14.rst:2983 +#: ../../whatsnew/3.14.rst:2992 msgid "" "Add :c:func:`PyUnstable_Object_IsUniquelyReferenced` as a replacement for " "``Py_REFCNT(op) == 1`` on :term:`free threaded ` builds. " "(Contributed by Peter Bierma in :gh:`133140`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2988 +#: ../../whatsnew/3.14.rst:2997 msgid "" "Add :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` to determine if " "an object is a unique temporary object on the interpreter's operand stack. " @@ -5542,11 +5554,11 @@ msgid "" "functions. (Contributed by Sam Gross in :gh:`133164`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2998 +#: ../../whatsnew/3.14.rst:3007 msgid "Limited C API changes" msgstr "" -#: ../../whatsnew/3.14.rst:3000 +#: ../../whatsnew/3.14.rst:3009 msgid "" "In the limited C API version 3.14 and newer, :c:func:`Py_TYPE` and :c:func:" "`Py_REFCNT` are now implemented as an opaque function call to hide " @@ -5554,7 +5566,7 @@ msgid "" "gh:`124127`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3005 +#: ../../whatsnew/3.14.rst:3014 msgid "" "Remove the :c:macro:`PySequence_Fast_GET_SIZE`, :c:macro:" "`PySequence_Fast_GET_ITEM`, and :c:macro:`PySequence_Fast_ITEMS` macros from " @@ -5562,32 +5574,32 @@ msgid "" "(Contributed by Victor Stinner in :gh:`91417`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3016 +#: ../../whatsnew/3.14.rst:3025 msgid "Removed C APIs" msgstr "被移除的 C API" -#: ../../whatsnew/3.14.rst:3018 +#: ../../whatsnew/3.14.rst:3027 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases was deprecated in Python 3.12, and now raises a :exc:`TypeError`. " "(Contributed by Nikita Sobolev in :gh:`119775`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3023 +#: ../../whatsnew/3.14.rst:3032 msgid "" "Remove ``PyDictObject.ma_version_tag`` member, which was deprecated in " "Python 3.12. Use the :c:func:`PyDict_AddWatcher` API instead. (Contributed " "by Sam Gross in :gh:`124296`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3028 +#: ../../whatsnew/3.14.rst:3037 msgid "" "Remove the private ``_Py_InitializeMain()`` function. It was a :term:" "`provisional API` added to Python 3.8 by :pep:`587`. (Contributed by Victor " "Stinner in :gh:`129033`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3032 +#: ../../whatsnew/3.14.rst:3041 msgid "" "Remove the undocumented APIs :c:macro:`!Py_C_RECURSION_LIMIT` and :c:member:" "`!PyThreadState.c_recursion_remaining`. These were added in 3.13 and have " @@ -5596,18 +5608,18 @@ msgid "" "`133079`, see also :gh:`130396`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3043 +#: ../../whatsnew/3.14.rst:3052 msgid "Deprecated C APIs" msgstr "已棄用的 C API" -#: ../../whatsnew/3.14.rst:3045 +#: ../../whatsnew/3.14.rst:3054 msgid "" "The :c:macro:`!Py_HUGE_VAL` macro is now :term:`soft deprecated`. Use :c:" "macro:`!Py_INFINITY` instead. (Contributed by Sergey B Kirpichev in :gh:" "`120026`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3049 +#: ../../whatsnew/3.14.rst:3058 msgid "" "The :c:macro:`!Py_IS_NAN`, :c:macro:`!Py_IS_INFINITY`, and :c:macro:`!" "Py_IS_FINITE` macros are now :term:`soft deprecated`. Use :c:macro:`!" @@ -5615,7 +5627,7 @@ msgid "" "file:`math.h` since C99. (Contributed by Sergey B Kirpichev in :gh:`119613`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3055 +#: ../../whatsnew/3.14.rst:3064 msgid "" "Non-tuple sequences are now deprecated as argument for the ``(items)`` " "format unit in :c:func:`PyArg_ParseTuple` and other :ref:`argument parsing " @@ -5624,14 +5636,14 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`50333`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3062 +#: ../../whatsnew/3.14.rst:3071 msgid "" "The ``_PyMonitoring_FireBranchEvent`` function is now deprecated and should " "be replaced with calls to :c:func:`PyMonitoring_FireBranchLeftEvent` and :c:" "func:`PyMonitoring_FireBranchRightEvent`." msgstr "" -#: ../../whatsnew/3.14.rst:3067 +#: ../../whatsnew/3.14.rst:3076 msgid "" "The previously undocumented function :c:func:`PySequence_In` is now :term:" "`soft deprecated`. Use :c:func:`PySequence_Contains` instead. (Contributed " @@ -6259,11 +6271,11 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.14.rst:3086 +#: ../../whatsnew/3.14.rst:3095 msgid "Build changes" msgstr "建置變更" -#: ../../whatsnew/3.14.rst:3088 +#: ../../whatsnew/3.14.rst:3097 msgid "" ":pep:`776`: Emscripten is now an officially supported platform at :pep:`tier " "3 <11#tier-3>`. As a part of this effort, more than 25 bugs in `Emscripten " @@ -6273,31 +6285,31 @@ msgid "" "Chatham in :gh:`127146`, :gh:`127683`, and :gh:`136931`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3098 +#: ../../whatsnew/3.14.rst:3107 msgid "Official Android binary releases are now provided on python.org__." msgstr "" -#: ../../whatsnew/3.14.rst:3102 +#: ../../whatsnew/3.14.rst:3111 msgid "" "GNU Autoconf 2.72 is now required to generate :file:`configure`. " "(Contributed by Erlend Aasland in :gh:`115765`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3105 +#: ../../whatsnew/3.14.rst:3114 msgid "" "``wasm32-unknown-emscripten`` is now a :pep:`11` tier 3 platform. " "(Contributed by R. Hood Chatham in :gh:`127146`, :gh:`127683`, and :gh:" "`136931`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3108 +#: ../../whatsnew/3.14.rst:3117 msgid "" "``#pragma``-based linking with ``python3*.lib`` can now be switched off " "with :c:expr:`Py_NO_LINK_LIB`. (Contributed by Jean-Christophe Fillion-Robin " "in :gh:`82909`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3112 +#: ../../whatsnew/3.14.rst:3121 msgid "" "CPython now enables a set of recommended compiler options by default for " "improved security. Use the :option:`--disable-safety` :file:`configure` " @@ -6305,45 +6317,45 @@ msgid "" "larger set of compiler options, albeit with a performance cost." msgstr "" -#: ../../whatsnew/3.14.rst:3118 +#: ../../whatsnew/3.14.rst:3127 msgid "" "The ``WITH_FREELISTS`` macro and ``--without-freelists`` :file:`configure` " "option have been removed." msgstr "" -#: ../../whatsnew/3.14.rst:3121 +#: ../../whatsnew/3.14.rst:3130 msgid "" "The new :file:`configure` option :option:`--with-tail-call-interp` may be " "used to enable the experimental tail call interpreter. See :ref:`whatsnew314-" "tail-call-interpreter` for further details." msgstr "" -#: ../../whatsnew/3.14.rst:3125 +#: ../../whatsnew/3.14.rst:3134 msgid "" "To disable the new remote debugging support, use the :option:`--without-" "remote-debug` :file:`configure` option. This may be useful for security " "reasons." msgstr "" -#: ../../whatsnew/3.14.rst:3129 +#: ../../whatsnew/3.14.rst:3138 msgid "" "iOS and macOS apps can now be configured to redirect ``stdout`` and " "``stderr`` content to the system log. (Contributed by Russell Keith-Magee " "in :gh:`127592`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3133 +#: ../../whatsnew/3.14.rst:3142 msgid "" "The iOS testbed is now able to stream test output while the test is running. " "The testbed can also be used to run the test suite of projects other than " "CPython itself. (Contributed by Russell Keith-Magee in :gh:`127592`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3142 +#: ../../whatsnew/3.14.rst:3151 msgid ":file:`build-details.json`" msgstr ":file:`build-details.json`" -#: ../../whatsnew/3.14.rst:3144 +#: ../../whatsnew/3.14.rst:3153 msgid "" "Installations of Python now contain a new file, :file:`build-details.json`. " "This is a static JSON document containing build details for CPython, to " @@ -6351,7 +6363,7 @@ msgid "" "cases such as Python launchers, cross-compilation, and so on." msgstr "" -#: ../../whatsnew/3.14.rst:3150 +#: ../../whatsnew/3.14.rst:3159 msgid "" ":file:`build-details.json` must be installed in the platform-independent " "standard library directory. This corresponds to the :ref:`'stdlib' " @@ -6359,17 +6371,17 @@ msgid "" "by running ``sysconfig.get_path('stdlib')``." msgstr "" -#: ../../whatsnew/3.14.rst:3156 +#: ../../whatsnew/3.14.rst:3165 msgid "" ":pep:`739` -- ``build-details.json`` 1.0 -- a static description file for " "Python build details" msgstr "" -#: ../../whatsnew/3.14.rst:3163 +#: ../../whatsnew/3.14.rst:3172 msgid "Discontinuation of PGP signatures" msgstr "" -#: ../../whatsnew/3.14.rst:3165 +#: ../../whatsnew/3.14.rst:3174 msgid "" "PGP (Pretty Good Privacy) signatures will not be provided for releases of " "Python 3.14 or future versions. To verify CPython artifacts, users must use " @@ -6377,15 +6389,15 @@ msgid "" "sigstore/>`__. Releases have been signed using Sigstore_ since Python 3.11." msgstr "" -#: ../../whatsnew/3.14.rst:3171 +#: ../../whatsnew/3.14.rst:3180 msgid "This change in release process was specified in :pep:`761`." msgstr "" -#: ../../whatsnew/3.14.rst:3179 +#: ../../whatsnew/3.14.rst:3188 msgid "Free-threaded Python is officially supported" msgstr "" -#: ../../whatsnew/3.14.rst:3181 +#: ../../whatsnew/3.14.rst:3190 msgid "" "The free-threaded build of Python is now supported and no longer " "experimental. This is the start of `phase II `__, with free-threading as the default or sole build of Python is " @@ -6416,19 +6428,19 @@ msgid "" "and the community. This decision is for the future." msgstr "" -#: ../../whatsnew/3.14.rst:3201 +#: ../../whatsnew/3.14.rst:3210 msgid ":pep:`779`" msgstr ":pep:`779`" -#: ../../whatsnew/3.14.rst:3203 +#: ../../whatsnew/3.14.rst:3212 msgid "`PEP 779's acceptance `__" msgstr "`PEP 779 的接受 `__" -#: ../../whatsnew/3.14.rst:3209 +#: ../../whatsnew/3.14.rst:3218 msgid "Binary releases for the experimental just-in-time compiler" msgstr "" -#: ../../whatsnew/3.14.rst:3211 +#: ../../whatsnew/3.14.rst:3220 msgid "" "The official macOS and Windows release binaries now include an " "*experimental* just-in-time (JIT) compiler. Although it is **not** " @@ -6438,7 +6450,7 @@ msgid "" "off` configuration option for similar behavior." msgstr "" -#: ../../whatsnew/3.14.rst:3218 +#: ../../whatsnew/3.14.rst:3227 msgid "" "The JIT is at an early stage and still in active development. As such, the " "typical performance impact of enabling it can range from 10% slower to 20% " @@ -6450,7 +6462,7 @@ msgid "" "current process." msgstr "" -#: ../../whatsnew/3.14.rst:3226 +#: ../../whatsnew/3.14.rst:3235 msgid "" "Currently, the most significant missing functionality is that native " "debuggers and profilers like ``gdb`` and ``perf`` are unable to unwind " @@ -6459,83 +6471,83 @@ msgid "" "not support JIT compilation." msgstr "" -#: ../../whatsnew/3.14.rst:3231 +#: ../../whatsnew/3.14.rst:3240 msgid "" "Please report any bugs or major performance regressions that you encounter!" msgstr "" -#: ../../whatsnew/3.14.rst:3233 +#: ../../whatsnew/3.14.rst:3242 msgid ":pep:`744`" msgstr ":pep:`744`" -#: ../../whatsnew/3.14.rst:3237 +#: ../../whatsnew/3.14.rst:3246 msgid "Porting to Python 3.14" msgstr "移植至 Python 3.14" -#: ../../whatsnew/3.14.rst:3239 +#: ../../whatsnew/3.14.rst:3248 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.14.rst:3244 +#: ../../whatsnew/3.14.rst:3253 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.14.rst:3246 +#: ../../whatsnew/3.14.rst:3255 msgid "" "On Unix platforms other than macOS, *forkserver* is now the default :ref:" "`start method ` for :mod:`multiprocessing` " "and :class:`~concurrent.futures.ProcessPoolExecutor`, instead of *fork*." msgstr "" -#: ../../whatsnew/3.14.rst:3250 +#: ../../whatsnew/3.14.rst:3259 msgid "" "See :ref:`(1) ` and :ref:`(2) " "` for details." msgstr "" -#: ../../whatsnew/3.14.rst:3253 +#: ../../whatsnew/3.14.rst:3262 msgid "" "If you encounter :exc:`NameError`\\s or pickling errors coming out of :mod:" "`multiprocessing` or :mod:`concurrent.futures`, see the :ref:`forkserver " "restrictions `." msgstr "" -#: ../../whatsnew/3.14.rst:3257 +#: ../../whatsnew/3.14.rst:3266 msgid "" "This change does not affect Windows or macOS, where :ref:`'spawn' " "` remains the default start method." msgstr "" -#: ../../whatsnew/3.14.rst:3260 +#: ../../whatsnew/3.14.rst:3269 msgid "" ":class:`functools.partial` is now a method descriptor. Wrap it in :func:" "`staticmethod` if you want to preserve the old behavior. (Contributed by " "Serhiy Storchaka and Dominykas Grigonis in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3264 +#: ../../whatsnew/3.14.rst:3273 msgid "" "The :ref:`garbage collector is now incremental `, which means that the behavior of :func:`gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.14.rst:3271 +#: ../../whatsnew/3.14.rst:3280 msgid "" "The :func:`locale.nl_langinfo` function now temporarily sets the " "``LC_CTYPE`` locale in some cases. This temporary change affects other " "threads. (Contributed by Serhiy Storchaka in :gh:`69998`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3276 +#: ../../whatsnew/3.14.rst:3285 msgid "" ":class:`types.UnionType` is now an alias for :class:`typing.Union`, causing " "changes in some behaviors. See :ref:`above ` for " "more details. (Contributed by Jelle Zijlstra in :gh:`105499`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3281 +#: ../../whatsnew/3.14.rst:3290 msgid "" "The runtime behavior of annotations has changed in various ways; see :ref:" "`above ` for details. While most code that " @@ -6543,29 +6555,29 @@ msgid "" "details may behave differently." msgstr "" -#: ../../whatsnew/3.14.rst:3286 +#: ../../whatsnew/3.14.rst:3295 msgid "" "As part of making the :mod:`mimetypes` CLI public, it now exits with ``1`` " "on failure instead of ``0`` and ``2`` on incorrect command-line parameters " "instead of ``1``. Error messages are now printed to stderr." msgstr "" -#: ../../whatsnew/3.14.rst:3291 +#: ../../whatsnew/3.14.rst:3300 msgid "" "The ``\\B`` pattern in regular expression now matches the empty string when " "given as the entire pattern, which may cause behavioural changes." msgstr "" -#: ../../whatsnew/3.14.rst:3294 +#: ../../whatsnew/3.14.rst:3303 msgid "" "On FreeBSD, :data:`sys.platform` no longer contains the major version number." msgstr "" -#: ../../whatsnew/3.14.rst:3300 +#: ../../whatsnew/3.14.rst:3309 msgid "Changes in annotations (:pep:`649` and :pep:`749`)" msgstr "" -#: ../../whatsnew/3.14.rst:3302 +#: ../../whatsnew/3.14.rst:3311 msgid "" "This section contains guidance on changes that may be needed to annotations " "or Python code that interacts with or introspects annotations, due to the " @@ -6573,24 +6585,24 @@ msgid "" "deferred-annotations>`." msgstr "" -#: ../../whatsnew/3.14.rst:3307 +#: ../../whatsnew/3.14.rst:3316 msgid "" "In the majority of cases, working code from older versions of Python will " "not require any changes." msgstr "" -#: ../../whatsnew/3.14.rst:3312 +#: ../../whatsnew/3.14.rst:3321 msgid "Implications for annotated code" msgstr "" -#: ../../whatsnew/3.14.rst:3314 +#: ../../whatsnew/3.14.rst:3323 msgid "" "If you define annotations in your code (for example, for use with a static " "type checker), then this change probably does not affect you: you can keep " "writing annotations the same way you did with previous versions of Python." msgstr "" -#: ../../whatsnew/3.14.rst:3318 +#: ../../whatsnew/3.14.rst:3327 msgid "" "You will likely be able to remove quoted strings in annotations, which are " "frequently used for forward references. Similarly, if you use ``from " @@ -6601,11 +6613,11 @@ msgid "" "annotations before they work as expected." msgstr "" -#: ../../whatsnew/3.14.rst:3328 +#: ../../whatsnew/3.14.rst:3337 msgid "Implications for readers of ``__annotations__``" msgstr "" -#: ../../whatsnew/3.14.rst:3330 +#: ../../whatsnew/3.14.rst:3339 msgid "" "If your code reads the :attr:`~object.__annotations__` attribute on objects, " "you may want to make changes in order to support code that relies on " @@ -6614,7 +6626,7 @@ msgid "" "FORWARDREF` format, as the :mod:`dataclasses` module now does." msgstr "" -#: ../../whatsnew/3.14.rst:3337 +#: ../../whatsnew/3.14.rst:3346 msgid "" "The external :pypi:`typing_extensions` package provides partial backports of " "some of the functionality of the :mod:`annotationlib` module, such as the :" @@ -6623,11 +6635,11 @@ msgid "" "that takes advantage of the new behavior in Python 3.14." msgstr "" -#: ../../whatsnew/3.14.rst:3346 +#: ../../whatsnew/3.14.rst:3355 msgid "Related changes" msgstr "" -#: ../../whatsnew/3.14.rst:3348 +#: ../../whatsnew/3.14.rst:3357 msgid "" "The changes in Python 3.14 are designed to rework how :attr:`!" "__annotations__` works at runtime while minimizing breakage to code that " @@ -6639,7 +6651,7 @@ msgid "" "the :mod:`annotationlib` module." msgstr "" -#: ../../whatsnew/3.14.rst:3357 +#: ../../whatsnew/3.14.rst:3366 msgid "" "In particular, do not read annotations directly from the namespace " "dictionary attribute of type objects. Use :func:`annotationlib." @@ -6647,25 +6659,25 @@ msgid "" "`annotationlib.get_annotations` afterwards." msgstr "" -#: ../../whatsnew/3.14.rst:3362 +#: ../../whatsnew/3.14.rst:3371 msgid "" "In previous releases, it was sometimes possible to access class annotations " "from an instance of an annotated class. This behavior was undocumented and " "accidental, and will no longer work in Python 3.14." msgstr "" -#: ../../whatsnew/3.14.rst:3368 +#: ../../whatsnew/3.14.rst:3377 msgid "``from __future__ import annotations``" msgstr "``from __future__ import annotations``" -#: ../../whatsnew/3.14.rst:3370 +#: ../../whatsnew/3.14.rst:3379 msgid "" "In Python 3.7, :pep:`563` introduced the ``from __future__ import " "annotations`` :ref:`future statement `, which turns all annotations " "into strings." msgstr "" -#: ../../whatsnew/3.14.rst:3373 +#: ../../whatsnew/3.14.rst:3382 msgid "" "However, this statement is now deprecated and it is expected to be removed " "in a future version of Python. This removal will not happen until after " @@ -6673,17 +6685,17 @@ msgid "" "Python without support for deferred evaluation of annotations." msgstr "" -#: ../../whatsnew/3.14.rst:3379 +#: ../../whatsnew/3.14.rst:3388 msgid "" "In Python 3.14, the behavior of code using ``from __future__ import " "annotations`` is unchanged." msgstr "" -#: ../../whatsnew/3.14.rst:3384 +#: ../../whatsnew/3.14.rst:3393 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.14.rst:3386 +#: ../../whatsnew/3.14.rst:3395 msgid "" ":c:func:`Py_Finalize` now deletes all interned strings. This is backwards " "incompatible to any C extension that holds onto an interned string after a " @@ -6696,14 +6708,14 @@ msgid "" "`113601`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3396 +#: ../../whatsnew/3.14.rst:3405 msgid "" "The :ref:`Unicode Exception Objects ` C API now raises a :" "exc:`TypeError` if its exception argument is not a :exc:`UnicodeError` " "object. (Contributed by Bénédikt Tran in :gh:`127691`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3403 +#: ../../whatsnew/3.14.rst:3412 msgid "" "The interpreter internally avoids some reference count modifications when " "loading objects onto the operands stack by :term:`borrowing Date: Thu, 1 Jan 2026 00:18:43 +0000 Subject: [PATCH 06/11] sync with cpython 8680b18f --- library/concurrent.futures.po | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index d481555ccf..6a57552148 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-31 00:16+0000\n" +"POT-Creation-Date: 2026-01-01 00:17+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -526,7 +526,7 @@ msgstr "" #: ../../library/concurrent.futures.rst:310 msgid "" "The executor may replace uncaught exceptions from *initializer* with :class:" -"`~concurrent.futures.interpreter.ExecutionFailed`." +"`~concurrent.interpreters.ExecutionFailed`." msgstr "" #: ../../library/concurrent.futures.rst:313 @@ -545,11 +545,11 @@ msgstr "" msgid "" "When a worker's current task raises an uncaught exception, the worker always " "tries to preserve the exception as-is. If that is successful then it also " -"sets the ``__cause__`` to a corresponding :class:`~concurrent.futures." -"interpreter.ExecutionFailed` instance, which contains a summary of the " -"original exception. In the uncommon case that the worker is not able to " -"preserve the original as-is then it directly preserves the corresponding :" -"class:`~concurrent.futures.interpreter.ExecutionFailed` instance instead." +"sets the ``__cause__`` to a corresponding :class:`~concurrent.interpreters." +"ExecutionFailed` instance, which contains a summary of the original " +"exception. In the uncommon case that the worker is not able to preserve the " +"original as-is then it directly preserves the corresponding :class:" +"`~concurrent.interpreters.ExecutionFailed` instance instead." msgstr "" #: ../../library/concurrent.futures.rst:332 @@ -1131,14 +1131,7 @@ msgstr "" "`~concurrent.futures.InterpreterPoolExecutor` 的其中一個 worker 初始化失敗時" "會引發此例外類別。" -#: ../../library/concurrent.futures.rst:725 -msgid "" -"Raised from :class:`~concurrent.futures.InterpreterPoolExecutor` when the " -"given initializer fails or from :meth:`~concurrent.futures.Executor.submit` " -"when there's an uncaught exception from the submitted task." -msgstr "" - -#: ../../library/concurrent.futures.rst:736 +#: ../../library/concurrent.futures.rst:727 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " From 1253c0f4f40c7a6914d949bccc3032e06dd863d6 Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Thu, 1 Jan 2026 11:40:58 +0800 Subject: [PATCH 07/11] fix: resolve fuzzy entries --- howto/enum.po | 2 +- library/functions.po | 4 +- library/imaplib.po | 2 +- library/inspect.po | 15 +++--- library/locale.po | 2 +- library/multiprocessing.po | 2 +- library/smtplib.po | 2 +- library/socket.po | 2 +- library/subprocess.po | 2 +- library/traceback.po | 2 +- library/tracemalloc.po | 2 +- library/urllib.request.po | 2 +- whatsnew/3.12.po | 15 ++++++ whatsnew/3.14.po | 101 +++++++++++++++++++++++++++++++++---- whatsnew/3.5.po | 2 + 15 files changed, 125 insertions(+), 32 deletions(-) diff --git a/howto/enum.po b/howto/enum.po index cbddd1538c..b4df357415 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -1268,7 +1268,7 @@ msgstr "" #: ../../howto/enum.rst:657 msgid "The *start* parameter was added." -msgstr "" +msgstr "新增 *start* 參數。" #: ../../howto/enum.rst:662 msgid "Derived Enumerations" diff --git a/library/functions.po b/library/functions.po index 35df0fe612..880b4c3cf1 100644 --- a/library/functions.po +++ b/library/functions.po @@ -2694,11 +2694,11 @@ msgstr "``mode`` 和 ``flags`` 引數可能會被原始的呼叫所修改或推 #: ../../library/functions.rst:1536 msgid "The *opener* parameter was added." -msgstr "增加了 *opener* 參數。" +msgstr "新增 *opener* 參數。" #: ../../library/functions.rst:1537 msgid "The ``'x'`` mode was added." -msgstr "增加了 ``'x'`` 模式。" +msgstr "新增 ``'x'`` 模式。" #: ../../library/functions.rst:1538 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." diff --git a/library/imaplib.po b/library/imaplib.po index 48f89ff653..d1d70d69c3 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -86,7 +86,7 @@ msgstr "" #: ../../library/imaplib.rst:55 msgid "Support for the :keyword:`with` statement was added." -msgstr "" +msgstr "新增對 :keyword:`with` 陳述式的支援。" #: ../../library/imaplib.rst:58 ../../library/imaplib.rst:112 msgid "The optional *timeout* parameter was added." diff --git a/library/inspect.po b/library/inspect.po index 0b0c303c6a..c120b003c3 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -647,7 +647,7 @@ msgstr "" #: ../../library/inspect.rst:315 msgid "Add ``__qualname__`` and ``gi_yieldfrom`` attributes to generators." -msgstr "將 ``__qualname__`` 和 ``gi_yieldfrom`` 屬性加到產生器。" +msgstr "新增產生器的 ``__qualname__`` 和 ``gi_yieldfrom`` 屬性。" #: ../../library/inspect.rst:317 msgid "" @@ -664,19 +664,16 @@ msgid "Add ``__builtins__`` attribute to functions." msgstr "新增函式的 ``__builtins__`` 屬性。" #: ../../library/inspect.rst:330 -#, fuzzy msgid "Add ``gi_suspended`` attribute to generators." -msgstr "將 ``__qualname__`` 和 ``gi_yieldfrom`` 屬性加到產生器。" +msgstr "新增產生器的 ``gi_suspended`` 屬性。" #: ../../library/inspect.rst:334 -#, fuzzy msgid "Add ``cr_suspended`` attribute to coroutines." -msgstr "新增協程的 ``cr_origin`` 屬性。" +msgstr "新增協程的 ``cr_suspended`` 屬性。" #: ../../library/inspect.rst:338 -#, fuzzy msgid "Add ``ag_suspended`` attribute to async generators." -msgstr "將 ``__qualname__`` 和 ``gi_yieldfrom`` 屬性加到產生器。" +msgstr "新增非同步產生器的 ``ag_suspended`` 屬性。" #: ../../library/inspect.rst:342 msgid "Add ``f_generator`` attribute to frames." @@ -1186,7 +1183,7 @@ msgstr "" #: ../../library/inspect.rst:792 msgid "The *annotation_format* parameter was added." -msgstr "" +msgstr "新增了 *annotation_format* 參數。" #: ../../library/inspect.rst:797 msgid "" @@ -1329,7 +1326,7 @@ msgstr "" #: ../../library/inspect.rst:904 msgid "The *unquote_annotations* parameter was added." -msgstr "" +msgstr "新增了 *unquote_annotations* 參數。" #: ../../library/inspect.rst:909 msgid "" diff --git a/library/locale.po b/library/locale.po index afea00ad24..b104cbda19 100644 --- a/library/locale.po +++ b/library/locale.po @@ -666,7 +666,7 @@ msgstr "" #: ../../library/locale.rst:469 msgid "The *monetary* keyword parameter was added." -msgstr "" +msgstr "新增了 *monetary* 關鍵字參數。" #: ../../library/locale.rst:475 msgid "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 5b8b2c983c..7e4a51de27 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -2187,7 +2187,7 @@ msgstr "" #: ../../library/multiprocessing.rst:1471 #: ../../library/multiprocessing.rst:2063 msgid "The :meth:`~threading.Condition.wait_for` method was added." -msgstr "" +msgstr "新增 :meth:`~threading.Condition.wait_for` 方法。" #: ../../library/multiprocessing.rst:1476 msgid "A clone of :class:`threading.Event`." diff --git a/library/smtplib.po b/library/smtplib.po index 544bbad52e..16f15c1198 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -105,7 +105,7 @@ msgstr "" #: ../../library/smtplib.rst:65 msgid "Support for the :keyword:`with` statement was added." -msgstr "" +msgstr "新增對 :keyword:`with` 陳述式的支援。" #: ../../library/smtplib.rst:68 msgid "*source_address* argument was added." diff --git a/library/socket.po b/library/socket.po index c7c44fa904..c534e66220 100644 --- a/library/socket.po +++ b/library/socket.po @@ -735,7 +735,7 @@ msgstr "" #: ../../library/socket.rst:498 msgid "NetBSD support was added." -msgstr "" +msgstr "新增對 NetBSD 的支援。" #: ../../library/socket.rst:501 msgid "Restored missing ``CAN_RAW_ERR_FILTER`` on Linux." diff --git a/library/subprocess.po b/library/subprocess.po index 23c4b21b71..f7e6879fde 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -1023,7 +1023,7 @@ msgstr "" #: ../../library/subprocess.rst:749 msgid "The :exc:`SubprocessError` base class was added." -msgstr "" +msgstr "新增 :exc:`SubprocessError` 基底類別。" #: ../../library/subprocess.rst:755 msgid "Security Considerations" diff --git a/library/traceback.po b/library/traceback.po index 82709ec956..3ebe988c64 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -258,7 +258,7 @@ msgstr "" #: ../../library/traceback.rst:207 msgid "*show_group* parameter was added." -msgstr "" +msgstr "新增 *show_group* 參數。" #: ../../library/traceback.rst:213 msgid "" diff --git a/library/tracemalloc.po b/library/tracemalloc.po index 08f0203255..dfdd9cbab8 100644 --- a/library/tracemalloc.po +++ b/library/tracemalloc.po @@ -1082,7 +1082,7 @@ msgstr "" #: ../../library/tracemalloc.rst:738 msgid "The :attr:`Traceback.total_nframe` attribute was added." -msgstr "" +msgstr "新增 :attr:`Traceback.total_nframe` 屬性。" #: ../../library/tracemalloc.rst:743 msgid "" diff --git a/library/urllib.request.po b/library/urllib.request.po index 7f794ed457..e244fbd198 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -327,7 +327,7 @@ msgstr "" #: ../../library/urllib.request.rst:174 msgid "The *add_scheme* parameter was added." -msgstr "" +msgstr "新增 *add_scheme* 參數。" #: ../../library/urllib.request.rst:180 msgid "" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index a53b130d61..f492b83d45 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -782,6 +782,21 @@ msgid "" " def get_colour(self) -> str:\n" " return \"red\"" msgstr "" +"from typing import override\n" +"\n" +"class Base:\n" +" def get_color(self) -> str:\n" +" return \"blue\"\n" +"\n" +"class GoodChild(Base):\n" +" @override # ok:覆寫 Base.get_color\n" +" def get_color(self) -> str:\n" +" return \"yellow\"\n" +"\n" +"class BadChild(Base):\n" +" @override # 型別檢查錯誤:未覆寫 Base.get_color\n" +" def get_colour(self) -> str:\n" +" return \"red\"" #: ../../whatsnew/3.12.rst:538 msgid "See :pep:`698` for more details." diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index 57f2aefc3d..bc0fab5078 100644 --- a/whatsnew/3.14.po +++ b/whatsnew/3.14.po @@ -34,6 +34,8 @@ msgid "" "Python 3.14 was released on 7 October 2025. For full details, see the :ref:" "`changelog `." msgstr "" +"本文介紹了 Python 3.14 與 3.13 相比多了哪些新功能。Python 3.14 已於 2025 年 " +"10 月 7 日發布。完整詳情請見 :ref:`changelog `。" #: ../../whatsnew/3.14.rst:54 msgid ":pep:`745` -- Python 3.14 release schedule" @@ -41,7 +43,7 @@ msgstr ":pep:`745` - Python 3.14 發佈時程" #: ../../whatsnew/3.14.rst:58 msgid "Summary -- Release highlights" -msgstr "" +msgstr "發布重點摘要" #: ../../whatsnew/3.14.rst:63 msgid "" @@ -53,6 +55,10 @@ msgid "" "`subinterpreters ` in the standard " "library." msgstr "" +"Python 3.14 是 Python 程式語言的最新穩定版本,包含了語言、實作和標準函式庫的各種變更。" +"最大的變更包括\\ :ref:`模板字串字面值 `、" +":ref:`延遲型別註解的求值 `,以及標準函式庫中對\\ " +":ref:`子直譯器 `\\ 的支援。" #: ../../whatsnew/3.14.rst:72 msgid "" @@ -78,7 +84,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:95 msgid "Interpreter improvements:" -msgstr "" +msgstr "直譯器的改進:" #: ../../whatsnew/3.14.rst:97 msgid "" @@ -134,7 +140,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:113 msgid "Significant improvements in the standard library:" -msgstr "" +msgstr "標準函式庫中的顯著改進" #: ../../whatsnew/3.14.rst:115 msgid "" @@ -204,7 +210,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:144 msgid "New features" -msgstr "" +msgstr "新增功能" #: ../../whatsnew/3.14.rst:149 msgid ":pep:`649` & :pep:`749`: Deferred evaluation of annotations" @@ -1139,6 +1145,34 @@ msgid "" "play TaskGroup._aexit -> TaskGroup." "__aexit__ -> album TMBTE 0x7fc93173fa50" msgstr "" +"python -m asyncio ps 12345\n" +"\n" +"tid task id task name coroutine " +"stack awaiter " +"chain awaiter name awaiter id\n" +"------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n" +"1935500 0x7fc930c18050 Task-1 TaskGroup._aexit -> " +"TaskGroup.__aexit__ -> " +"main " +"0x0\n" +"1935500 0x7fc930c18230 Sundowning TaskGroup._aexit -> " +"TaskGroup.__aexit__ -> album TaskGroup._aexit -> TaskGroup.__aexit__ -> " +"main Task-1 0x7fc930c18050\n" +"1935500 0x7fc93173fa50 TMBTE TaskGroup._aexit -> " +"TaskGroup.__aexit__ -> album TaskGroup._aexit -> TaskGroup.__aexit__ -> " +"main Task-1 0x7fc930c18050\n" +"1935500 0x7fc93173fdf0 TNDNBTG sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album Sundowning 0x7fc930c18230\n" +"1935500 0x7fc930d32510 Levitate sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album Sundowning 0x7fc930c18230\n" +"1935500 0x7fc930d32890 DYWTYLM sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album TMBTE 0x7fc93173fa50\n" +"1935500 0x7fc93161ec30 Aqua Regia sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album TMBTE 0x7fc93173fa50" #: ../../whatsnew/3.14.rst:754 msgid "or a tree like this:" @@ -1177,6 +1211,36 @@ msgid "" " └── play example.py:4\n" " └── sleep Lib/asyncio/tasks.py:702" msgstr "" +"python -m asyncio pstree 12345\n" +"\n" +"└── (T) Task-1\n" +" └── main example.py:13\n" +" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups.py:72\n" +" └── TaskGroup._aexit Lib/asyncio/taskgroups.py:121\n" +" ├── (T) Sundowning\n" +" │ └── album example.py:8\n" +" │ └── TaskGroup.__aexit__ Lib/asyncio/taskgroups." +"py:72\n" +" │ └── TaskGroup._aexit Lib/asyncio/taskgroups." +"py:121\n" +" │ ├── (T) TNDNBTG\n" +" │ │ └── play example.py:4\n" +" │ │ └── sleep Lib/asyncio/tasks.py:702\n" +" │ └── (T) Levitate\n" +" │ └── play example.py:4\n" +" │ └── sleep Lib/asyncio/tasks.py:702\n" +" └── (T) TMBTE\n" +" └── album example.py:8\n" +" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups." +"py:72\n" +" └── TaskGroup._aexit Lib/asyncio/taskgroups." +"py:121\n" +" ├── (T) DYWTYLM\n" +" │ └── play example.py:4\n" +" │ └── sleep Lib/asyncio/tasks.py:702\n" +" └── (T) Aqua Regia\n" +" └── play example.py:4\n" +" └── sleep Lib/asyncio/tasks.py:702" #: ../../whatsnew/3.14.rst:785 msgid "" @@ -1193,6 +1257,11 @@ msgid "" "\n" "cycle: Task-2 → Task-3 → Task-2" msgstr "" +"python -m asyncio pstree 12345\n" +"\n" +"ERROR: await-graph contains cycles - cannot print a tree!\n" +"\n" +"cycle: Task-2 → Task-3 → Task-2" #: ../../whatsnew/3.14.rst:797 msgid "" @@ -1221,7 +1290,7 @@ msgstr "(由 Neil Schemenauer 和 Kumar Aditya 於 :gh:`130010` 貢獻。)" #: ../../whatsnew/3.14.rst:818 msgid "Other language changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.14.rst:820 msgid "" @@ -1324,7 +1393,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:888 msgid "Command line and environment" -msgstr "" +msgstr "命令列與環境" #: ../../whatsnew/3.14.rst:890 msgid "" @@ -1374,6 +1443,10 @@ msgid "" "except TimeoutError, ConnectionRefusedError:\n" " print('The network has ceased to be!')" msgstr "" +"try:\n" +" connect_to_server()\n" +"except TimeoutError, ConnectionRefusedError:\n" +" print('The network has ceased to be!')" #: ../../whatsnew/3.14.rst:928 msgid "" @@ -1490,7 +1563,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:1010 msgid "New modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.14.rst:1012 msgid "" @@ -1526,7 +1599,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:1038 msgid "Improved modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.14.rst:1041 ../../whatsnew/3.14.rst:2310 msgid "argparse" @@ -3395,7 +3468,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:2269 msgid "textwrap" -msgstr "" +msgstr "textwrap" #: ../../whatsnew/3.14.rst:2271 msgid "" @@ -3524,6 +3597,7 @@ msgid "" "Use :attr:`!Constant.value` instead. (Contributed by Alex Waygood in :gh:" "`119562`.)" msgstr "" +"改用 :attr:`!Constant.value`。(由 Alex Waygood 於 :gh:`119562` 貢獻。)" #: ../../whatsnew/3.14.rst:2362 msgid "" @@ -3765,17 +3839,22 @@ msgid "" ":class:`!ResourceReader` (use :class:`~importlib.resources.abc." "TraversableResources`)" msgstr "" +":class:`!ResourceReader`\\ (請改用 :class:`~importlib.resources.abc." +"TraversableResources`)" #: ../../whatsnew/3.14.rst:2492 msgid "" ":class:`!Traversable` (use :class:`~importlib.resources.abc.Traversable`)" msgstr "" +":class:`!Traversable`\\ (請改用 :class:`~importlib.resources.abc.Traversable`)" #: ../../whatsnew/3.14.rst:2494 msgid "" ":class:`!TraversableResources` (use :class:`~importlib.resources.abc." "TraversableResources`)" msgstr "" +":class:`!TraversableResources`\\ (請改用 :class:`~importlib.resources.abc." +"TraversableResources`)" #: ../../whatsnew/3.14.rst:2497 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" @@ -5145,7 +5224,7 @@ msgstr "C API 變更" #: ../../whatsnew/3.14.rst:2810 msgid "Python configuration C API" -msgstr "" +msgstr "Python 配置 C API" #: ../../whatsnew/3.14.rst:2812 msgid "" @@ -6822,7 +6901,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:3450 msgid "Notable changes in 3.14.1" -msgstr "" +msgstr "Python 3.14.1 中顯著的變更" #: ../../whatsnew/3.14.rst:3452 msgid "" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 12dfa8ea03..32165a4816 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -3965,6 +3965,8 @@ msgid "" "The :c:type:`!PyMemAllocator` structure was renamed to :c:type:" "`PyMemAllocatorEx` and a new ``calloc`` field was added." msgstr "" +":c:type:`!PyMemAllocator` 結構已重命名為 :c:type:`PyMemAllocatorEx`,並新增了 " +"``calloc`` 欄位。" #: ../../whatsnew/3.5.rst:2524 msgid "" From 6ff076f5ad7c95f74d2c6f8349543c9ddf93381f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 2 Jan 2026 00:17:08 +0000 Subject: [PATCH 08/11] sync with cpython f6f3ddb4 --- tutorial/appendix.po | 81 ++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/tutorial/appendix.po b/tutorial/appendix.po index df5cb68338..af4daa21bb 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-15 00:17+0000\n" +"POT-Creation-Date: 2026-01-02 00:15+0000\n" "PO-Revision-Date: 2025-07-13 14:05+0800\n" "Last-Translator: Weilin Du <1372449351@qq.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,25 +38,26 @@ msgstr "" "限度的行控制能力(line control capabilities)。" #: ../../tutorial/appendix.rst:17 +#, fuzzy msgid "" -"On Windows, or Unix-like systems with :mod:`curses` support, a new " -"interactive shell is used by default since Python 3.13. This one supports " -"color, multiline editing, history browsing, and paste mode. To disable " -"color, see :ref:`using-on-controlling-color` for details. Function keys " -"provide some additional functionality. :kbd:`F1` enters the interactive help " -"browser :mod:`pydoc`. :kbd:`F2` allows for browsing command-line history " -"with neither output nor the :term:`>>>` and :term:`...` prompts. :kbd:`F3` " -"enters \"paste mode\", which makes pasting larger blocks of code easier. " -"Press :kbd:`F3` to return to the regular prompt." +"Since Python 3.13, a new interactive shell is used by default. This one " +"supports color, multiline editing, history browsing, and paste mode. To " +"disable color, see :ref:`using-on-controlling-color` for details. Function " +"keys provide some additional functionality. :kbd:`F1` enters the interactive " +"help browser :mod:`pydoc`. :kbd:`F2` allows for browsing command-line " +"history with neither output nor the :term:`>>>` and :term:`...` prompts. :" +"kbd:`F3` enters \"paste mode\", which makes pasting larger blocks of code " +"easier. Press :kbd:`F3` to return to the regular prompt." msgstr "" -"在 Windows 或支援 :mod:`curses` 的類似 Unix 系統上,自 Python 3.13 起預設會使用新的互動式 " -"shell。這個 shell 支援顏色、多行編輯、歷史瀏覽和貼上模式。要停用顏色,請參" -"閱 :ref:`using-on-controlling-color` 取得詳細資訊。功能鍵提供了一些額外的功" -"能。:kbd:`F1` 進入互動式幫助瀏覽器 :mod:`pydoc`。:kbd:`F2` 允許瀏覽命令列歷" -"史,既沒有輸出,也沒有 :term:`>>>` 和 :term:`...` 的提示。:kbd:`F3` 進入 「貼" -"上模式」,這使得貼上較大的程式碼區塊更容易。按 :kbd:`F3` 可以返回正常提示。" +"在 Windows 或支援 :mod:`curses` 的類似 Unix 系統上,自 Python 3.13 起預設會使" +"用新的互動式 shell。這個 shell 支援顏色、多行編輯、歷史瀏覽和貼上模式。要停用" +"顏色,請參閱 :ref:`using-on-controlling-color` 取得詳細資訊。功能鍵提供了一些" +"額外的功能。:kbd:`F1` 進入互動式幫助瀏覽器 :mod:`pydoc`。:kbd:`F2` 允許瀏覽命" +"令列歷史,既沒有輸出,也沒有 :term:`>>>` 和 :term:`...` 的提示。:kbd:`F3` 進" +"入 「貼上模式」,這使得貼上較大的程式碼區塊更容易。按 :kbd:`F3` 可以返回正常" +"提示。" -#: ../../tutorial/appendix.rst:28 +#: ../../tutorial/appendix.rst:27 msgid "" "When using the new interactive shell, exit the shell by typing :kbd:`exit` " "or :kbd:`quit`. Adding call parentheses after those commands is not required." @@ -64,7 +65,7 @@ msgstr "" "使用新的互動 shell 時, 請輸入 :kbd:`exit` 或 :kbd:`quit` 來離開 shell。不需" "要在這些指令後面加上呼叫括號。" -#: ../../tutorial/appendix.rst:32 +#: ../../tutorial/appendix.rst:31 msgid "" "If the new interactive shell is not desired, it can be disabled via the :" "envvar:`PYTHON_BASIC_REPL` environment variable." @@ -72,11 +73,11 @@ msgstr "" "如果不需要新的互動式 shell, 可以透過 :envvar:`PYTHON_BASIC_REPL` 環境變數來" "停用它。" -#: ../../tutorial/appendix.rst:38 +#: ../../tutorial/appendix.rst:37 msgid "Error Handling" msgstr "錯誤處理" -#: ../../tutorial/appendix.rst:40 +#: ../../tutorial/appendix.rst:39 msgid "" "When an error occurs, the interpreter prints an error message and a stack " "trace. In interactive mode, it then returns to the primary prompt; when " @@ -95,7 +96,7 @@ msgstr "" "內部不一致和一些記憶體耗盡的情況。所有的錯誤訊息都被寫入標準錯誤輸出;被執行" "指令的正常輸出被寫入標準輸出。" -#: ../../tutorial/appendix.rst:50 +#: ../../tutorial/appendix.rst:49 msgid "" "Typing the interrupt character (usually :kbd:`Control-C` or :kbd:`Delete`) " "to the primary or secondary prompt cancels the input and returns to the " @@ -108,11 +109,11 @@ msgstr "" "會引發 :exc:`KeyboardInterrupt` 例外,但可以通過 :keyword:`try` 陳述式來處" "理。" -#: ../../tutorial/appendix.rst:60 +#: ../../tutorial/appendix.rst:59 msgid "Executable Python Scripts" msgstr "可執行的 Python 腳本" -#: ../../tutorial/appendix.rst:62 +#: ../../tutorial/appendix.rst:61 msgid "" "On BSD'ish Unix systems, Python scripts can be made directly executable, " "like shell scripts, by putting the line ::" @@ -120,11 +121,11 @@ msgstr "" "在類 BSD 的 Unix 系統上,Python 腳本可以直接執行,就像 shell 腳本一樣,通過放" "置以下這行: ::" -#: ../../tutorial/appendix.rst:65 +#: ../../tutorial/appendix.rst:64 msgid "#!/usr/bin/env python3" msgstr "#!/usr/bin/env python3" -#: ../../tutorial/appendix.rst:67 +#: ../../tutorial/appendix.rst:66 msgid "" "(assuming that the interpreter is on the user's :envvar:`PATH`) at the " "beginning of the script and giving the file an executable mode. The ``#!`` " @@ -138,17 +139,17 @@ msgstr "" "(``'\\n'``) 結尾,而不是 Windows (``'\\r\\n'``) 換行。請注意,井號 ``'#'`` 用" "於在 Python 中開始註解。" -#: ../../tutorial/appendix.rst:74 +#: ../../tutorial/appendix.rst:73 msgid "" "The script can be given an executable mode, or permission, using the :" "program:`chmod` command." msgstr "可以使用 :program:`chmod` 指令為腳本賦予可執行模式或權限。" -#: ../../tutorial/appendix.rst:77 +#: ../../tutorial/appendix.rst:76 msgid "$ chmod +x myscript.py" msgstr "$ chmod +x myscript.py" -#: ../../tutorial/appendix.rst:81 +#: ../../tutorial/appendix.rst:80 msgid "" "On Windows systems, there is no notion of an \"executable mode\". The " "Python installer automatically associates ``.py`` files with ``python.exe`` " @@ -160,11 +161,11 @@ msgstr "" "檔案與 ``python.exe`` 聯繫起來,這樣雙擊 Python 檔案就會作為腳本運行。副檔名" "也可以是 ``.pyw``,在這種情況下,通常會出現的控制台視窗會被隱藏。" -#: ../../tutorial/appendix.rst:91 +#: ../../tutorial/appendix.rst:90 msgid "The Interactive Startup File" msgstr "互動式啟動檔案" -#: ../../tutorial/appendix.rst:93 +#: ../../tutorial/appendix.rst:92 msgid "" "When you use Python interactively, it is frequently handy to have some " "standard commands executed every time the interpreter is started. You can " @@ -176,7 +177,7 @@ msgstr "" "可以通過設置一個名為 :envvar:`PYTHONSTARTUP` 的環境變數來實現,該變數是一個包" "含啟動指令的檔案名。它的功能類似 Unix shell 的 :file:`.profile` 。" -#: ../../tutorial/appendix.rst:99 +#: ../../tutorial/appendix.rst:98 msgid "" "This file is only read in interactive sessions, not when Python reads " "commands from a script, and not when :file:`/dev/tty` is given as the " @@ -192,7 +193,7 @@ msgstr "" "動模式中不加限定地使用。你也可以在這個檔案中改變 ``sys.ps1`` 和 ``sys.ps2`` " "等提示字元。" -#: ../../tutorial/appendix.rst:107 +#: ../../tutorial/appendix.rst:106 msgid "" "If you want to read an additional start-up file from the current directory, " "you can program this in the global start-up file using code like ``if os." @@ -205,7 +206,7 @@ msgstr "" "式碼設定這個行為。如果你想在一個腳本中使用啟動檔案,你必須在腳本中明確地這樣" "做: ::" -#: ../../tutorial/appendix.rst:113 +#: ../../tutorial/appendix.rst:112 msgid "" "import os\n" "filename = os.environ.get('PYTHONSTARTUP')\n" @@ -221,11 +222,11 @@ msgstr "" " startup_file = fobj.read()\n" " exec(startup_file)" -#: ../../tutorial/appendix.rst:124 +#: ../../tutorial/appendix.rst:123 msgid "The Customization Modules" msgstr "客製化模組" -#: ../../tutorial/appendix.rst:126 +#: ../../tutorial/appendix.rst:125 msgid "" "Python provides two hooks to let you customize it: :index:`sitecustomize` " "and :index:`usercustomize`. To see how it works, you need first to find the " @@ -236,7 +237,7 @@ msgstr "" "index:`usercustomize` 。要看它是如何運作的,你首先需要找到你的 site-packages " "的位置。啟動 Python 並運行這段程式碼: ::" -#: ../../tutorial/appendix.rst:130 +#: ../../tutorial/appendix.rst:129 msgid "" ">>> import site\n" ">>> site.getusersitepackages()\n" @@ -246,7 +247,7 @@ msgstr "" ">>> site.getusersitepackages()\n" "'/home/user/.local/lib/python3.x/site-packages'" -#: ../../tutorial/appendix.rst:134 +#: ../../tutorial/appendix.rst:133 msgid "" "Now you can create a file named :file:`usercustomize.py` in that directory " "and put anything you want in it. It will affect every invocation of Python, " @@ -257,7 +258,7 @@ msgstr "" "要的任何內容放入其中。它會影響 Python 的每次呼叫,除非它以 :option:`-s` 選項" "啟動以禁用自動 import 。" -#: ../../tutorial/appendix.rst:138 +#: ../../tutorial/appendix.rst:137 msgid "" ":index:`sitecustomize` works in the same way, but is typically created by an " "administrator of the computer in the global site-packages directory, and is " @@ -268,10 +269,10 @@ msgstr "" "packages 目錄下建立,並在 :index:`usercustomize` 之前 import 。更多細節請參" "閱 :mod:`site` 模組的文件。" -#: ../../tutorial/appendix.rst:145 +#: ../../tutorial/appendix.rst:144 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/appendix.rst:146 +#: ../../tutorial/appendix.rst:145 msgid "A problem with the GNU Readline package may prevent this." msgstr "GNU Readline 套件的一個問題可能會阻止這一點。" From 9db346f29b9d69faaa6cad5d7980915157b805a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 3 Jan 2026 00:16:21 +0000 Subject: [PATCH 09/11] sync with cpython 98bb48e5 --- library/multiprocessing.po | 659 +++++++++++++++++++------------------ 1 file changed, 331 insertions(+), 328 deletions(-) diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 7e4a51de27..5f1290c071 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-16 00:15+0000\n" +"POT-Creation-Date: 2026-01-03 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2185,7 +2185,7 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:1471 -#: ../../library/multiprocessing.rst:2063 +#: ../../library/multiprocessing.rst:2066 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "新增 :meth:`~threading.Condition.wait_for` 方法。" @@ -2376,7 +2376,7 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:1665 -#: ../../library/multiprocessing.rst:1752 +#: ../../library/multiprocessing.rst:1755 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" @@ -2431,14 +2431,17 @@ msgstr "" #: ../../library/multiprocessing.rst:1695 msgid "" "*typecode_or_type* determines the type of the elements of the returned " -"array: it is either a ctypes type or a one character typecode of the kind " -"used by the :mod:`array` module. If *size_or_initializer* is an integer, " -"then it determines the length of the array, and the array will be initially " -"zeroed. Otherwise, *size_or_initializer* is a sequence which is used to " -"initialize the array and whose length determines the length of the array." +"array: it is either a :ref:`ctypes type ` or " +"a one character typecode of the kind used by the :mod:`array` module with " +"the exception of ``'w'``, which is not supported. In addition, the ``'c'`` " +"typecode is an alias for :class:`ctypes.c_char`. If *size_or_initializer* " +"is an integer, then it determines the length of the array, and the array " +"will be initially zeroed. Otherwise, *size_or_initializer* is a sequence " +"which is used to initialize the array and whose length determines the length " +"of the array." msgstr "" -#: ../../library/multiprocessing.rst:1702 +#: ../../library/multiprocessing.rst:1705 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -2448,28 +2451,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1709 +#: ../../library/multiprocessing.rst:1712 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1711 +#: ../../library/multiprocessing.rst:1714 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1716 +#: ../../library/multiprocessing.rst:1719 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr ":mod:`multiprocessing.sharedctypes` 模組" -#: ../../library/multiprocessing.rst:1721 +#: ../../library/multiprocessing.rst:1724 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1727 +#: ../../library/multiprocessing.rst:1730 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -2478,11 +2481,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1735 +#: ../../library/multiprocessing.rst:1738 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1737 +#: ../../library/multiprocessing.rst:1740 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -2492,40 +2495,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1744 +#: ../../library/multiprocessing.rst:1747 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1750 +#: ../../library/multiprocessing.rst:1753 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1756 +#: ../../library/multiprocessing.rst:1759 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1760 +#: ../../library/multiprocessing.rst:1763 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1766 +#: ../../library/multiprocessing.rst:1769 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1770 -#: ../../library/multiprocessing.rst:1790 +#: ../../library/multiprocessing.rst:1773 +#: ../../library/multiprocessing.rst:1793 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -2535,128 +2538,128 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1778 -#: ../../library/multiprocessing.rst:1797 -#: ../../library/multiprocessing.rst:1814 -#: ../../library/multiprocessing.rst:1935 +#: ../../library/multiprocessing.rst:1781 +#: ../../library/multiprocessing.rst:1800 +#: ../../library/multiprocessing.rst:1817 +#: ../../library/multiprocessing.rst:1938 msgid "" "*ctx* is a context object, or ``None`` (use the current context). If " "``None``, calling this may set the global start method. See :ref:`global-" "start-method` for more details." msgstr "" -#: ../../library/multiprocessing.rst:1782 -#: ../../library/multiprocessing.rst:1801 +#: ../../library/multiprocessing.rst:1785 +#: ../../library/multiprocessing.rst:1804 msgid "Note that *lock* and *ctx* are keyword-only parameters." msgstr "" -#: ../../library/multiprocessing.rst:1786 +#: ../../library/multiprocessing.rst:1789 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1805 +#: ../../library/multiprocessing.rst:1808 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1810 +#: ../../library/multiprocessing.rst:1813 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1818 +#: ../../library/multiprocessing.rst:1821 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1822 +#: ../../library/multiprocessing.rst:1825 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1825 +#: ../../library/multiprocessing.rst:1828 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1829 +#: ../../library/multiprocessing.rst:1832 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1837 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1837 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1837 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1836 +#: ../../library/multiprocessing.rst:1839 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1836 +#: ../../library/multiprocessing.rst:1839 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1836 +#: ../../library/multiprocessing.rst:1839 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1837 +#: ../../library/multiprocessing.rst:1840 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1837 +#: ../../library/multiprocessing.rst:1840 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1838 +#: ../../library/multiprocessing.rst:1841 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1838 +#: ../../library/multiprocessing.rst:1841 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1838 +#: ../../library/multiprocessing.rst:1841 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1842 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1842 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1842 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1843 +#: ../../library/multiprocessing.rst:1846 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1846 +#: ../../library/multiprocessing.rst:1849 msgid "" "from multiprocessing import Process, Lock\n" "from multiprocessing.sharedctypes import Value, Array\n" @@ -2722,11 +2725,11 @@ msgstr "" " print(s.value)\n" " print([(a.x, a.y) for a in A])" -#: ../../library/multiprocessing.rst:1881 +#: ../../library/multiprocessing.rst:1884 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1883 +#: ../../library/multiprocessing.rst:1886 msgid "" "49\n" "0.1111111111111111\n" @@ -2738,11 +2741,11 @@ msgstr "" "HELLO WORLD\n" "[(3.515625, 39.0625), (33.0625, 4.0), (5.640625, 90.25)]" -#: ../../library/multiprocessing.rst:1894 +#: ../../library/multiprocessing.rst:1897 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1896 +#: ../../library/multiprocessing.rst:1899 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -2751,7 +2754,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1905 +#: ../../library/multiprocessing.rst:1908 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -2759,31 +2762,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1913 +#: ../../library/multiprocessing.rst:1916 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1919 +#: ../../library/multiprocessing.rst:1922 msgid "Create a BaseManager object." msgstr "建立一個 BaseManager 物件。" -#: ../../library/multiprocessing.rst:1921 +#: ../../library/multiprocessing.rst:1924 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1924 +#: ../../library/multiprocessing.rst:1927 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1927 +#: ../../library/multiprocessing.rst:1930 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -2791,13 +2794,13 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1932 +#: ../../library/multiprocessing.rst:1935 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1939 +#: ../../library/multiprocessing.rst:1942 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -2805,24 +2808,24 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1944 +#: ../../library/multiprocessing.rst:1947 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1949 +#: ../../library/multiprocessing.rst:1952 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1954 +#: ../../library/multiprocessing.rst:1957 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1958 +#: ../../library/multiprocessing.rst:1961 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> manager = BaseManager(address=('', 50000), authkey=b'abc')\n" @@ -2834,15 +2837,15 @@ msgstr "" ">>> server = manager.get_server()\n" ">>> server.serve_forever()" -#: ../../library/multiprocessing.rst:1963 +#: ../../library/multiprocessing.rst:1966 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1967 +#: ../../library/multiprocessing.rst:1970 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1969 +#: ../../library/multiprocessing.rst:1972 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> m = BaseManager(address=('127.0.0.1', 50000), authkey=b'abc')\n" @@ -2852,29 +2855,29 @@ msgstr "" ">>> m = BaseManager(address=('127.0.0.1', 50000), authkey=b'abc')\n" ">>> m.connect()" -#: ../../library/multiprocessing.rst:1975 +#: ../../library/multiprocessing.rst:1978 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1978 +#: ../../library/multiprocessing.rst:1981 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1982 +#: ../../library/multiprocessing.rst:1985 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1985 +#: ../../library/multiprocessing.rst:1988 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1988 +#: ../../library/multiprocessing.rst:1991 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -2882,14 +2885,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1994 +#: ../../library/multiprocessing.rst:1997 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1998 +#: ../../library/multiprocessing.rst:2001 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2900,7 +2903,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:2007 +#: ../../library/multiprocessing.rst:2010 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -2910,22 +2913,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:2014 +#: ../../library/multiprocessing.rst:2017 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:2018 +#: ../../library/multiprocessing.rst:2021 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:2022 +#: ../../library/multiprocessing.rst:2025 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:2024 +#: ../../library/multiprocessing.rst:2027 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2933,129 +2936,129 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:2030 +#: ../../library/multiprocessing.rst:2033 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:2035 +#: ../../library/multiprocessing.rst:2038 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:2039 +#: ../../library/multiprocessing.rst:2042 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:2045 +#: ../../library/multiprocessing.rst:2048 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2052 +#: ../../library/multiprocessing.rst:2055 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2057 +#: ../../library/multiprocessing.rst:2060 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:2060 +#: ../../library/multiprocessing.rst:2063 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:2068 +#: ../../library/multiprocessing.rst:2071 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2072 +#: ../../library/multiprocessing.rst:2075 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2076 +#: ../../library/multiprocessing.rst:2079 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2080 +#: ../../library/multiprocessing.rst:2083 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2084 +#: ../../library/multiprocessing.rst:2087 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2088 +#: ../../library/multiprocessing.rst:2091 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:2093 +#: ../../library/multiprocessing.rst:2096 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2097 +#: ../../library/multiprocessing.rst:2100 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:2104 +#: ../../library/multiprocessing.rst:2107 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2109 +#: ../../library/multiprocessing.rst:2112 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2115 +#: ../../library/multiprocessing.rst:2118 msgid "Create a shared :class:`set` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2117 +#: ../../library/multiprocessing.rst:2120 msgid ":class:`set` support was added." msgstr "已新增對 :class:`set` 的支援。" -#: ../../library/multiprocessing.rst:2120 +#: ../../library/multiprocessing.rst:2123 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:2127 +#: ../../library/multiprocessing.rst:2130 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:2129 +#: ../../library/multiprocessing.rst:2132 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:2132 +#: ../../library/multiprocessing.rst:2135 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:2136 +#: ../../library/multiprocessing.rst:2139 msgid "" ">>> mp_context = multiprocessing.get_context('spawn')\n" ">>> manager = mp_context.Manager()\n" @@ -3067,18 +3070,18 @@ msgid "" "Namespace(x=10, y='hello')" msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2152 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:2151 +#: ../../library/multiprocessing.rst:2154 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2155 +#: ../../library/multiprocessing.rst:2158 msgid "" "from multiprocessing.managers import BaseManager\n" "\n" @@ -3118,23 +3121,23 @@ msgstr "" " print(maths.add(4, 3)) # 印出 7\n" " print(maths.mul(7, 8)) # 印出 56" -#: ../../library/multiprocessing.rst:2176 +#: ../../library/multiprocessing.rst:2179 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2181 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:2181 +#: ../../library/multiprocessing.rst:2184 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:2184 +#: ../../library/multiprocessing.rst:2187 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> from queue import Queue\n" @@ -3154,11 +3157,11 @@ msgstr "" ">>> s = m.get_server()\n" ">>> s.serve_forever()" -#: ../../library/multiprocessing.rst:2193 +#: ../../library/multiprocessing.rst:2196 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2195 +#: ../../library/multiprocessing.rst:2198 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> class QueueManager(BaseManager): pass\n" @@ -3178,11 +3181,11 @@ msgstr "" ">>> queue = m.get_queue()\n" ">>> queue.put('hello')" -#: ../../library/multiprocessing.rst:2203 +#: ../../library/multiprocessing.rst:2206 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:2205 +#: ../../library/multiprocessing.rst:2208 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> class QueueManager(BaseManager): pass\n" @@ -3204,13 +3207,13 @@ msgstr "" ">>> queue.get()\n" "'hello'" -#: ../../library/multiprocessing.rst:2214 +#: ../../library/multiprocessing.rst:2217 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2217 +#: ../../library/multiprocessing.rst:2220 msgid "" ">>> from multiprocessing import Process, Queue\n" ">>> from multiprocessing.managers import BaseManager\n" @@ -3250,18 +3253,18 @@ msgstr "" ">>> s = m.get_server()\n" ">>> s.serve_forever()" -#: ../../library/multiprocessing.rst:2239 +#: ../../library/multiprocessing.rst:2242 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2241 +#: ../../library/multiprocessing.rst:2244 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:2245 +#: ../../library/multiprocessing.rst:2248 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -3269,7 +3272,7 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2249 +#: ../../library/multiprocessing.rst:2252 msgid "" ">>> mp_context = multiprocessing.get_context('spawn')\n" ">>> manager = mp_context.Manager()\n" @@ -3295,14 +3298,14 @@ msgstr "" ">>> l[2:5]\n" "[4, 9, 16]" -#: ../../library/multiprocessing.rst:2263 +#: ../../library/multiprocessing.rst:2266 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:2267 +#: ../../library/multiprocessing.rst:2270 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -3310,7 +3313,7 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2272 +#: ../../library/multiprocessing.rst:2275 msgid "" ">>> a = manager.list()\n" ">>> b = manager.list()\n" @@ -3322,11 +3325,11 @@ msgid "" "['hello'] ['hello']" msgstr "" -#: ../../library/multiprocessing.rst:2283 +#: ../../library/multiprocessing.rst:2286 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2285 +#: ../../library/multiprocessing.rst:2288 msgid "" ">>> l_outer = manager.list([ manager.dict() for i in range(2) ])\n" ">>> d_first_inner = l_outer[0]\n" @@ -3350,7 +3353,7 @@ msgstr "" ">>> print(l_outer[1])\n" "{'c': 3, 'z': 26}" -#: ../../library/multiprocessing.rst:2296 +#: ../../library/multiprocessing.rst:2299 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -3361,7 +3364,7 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2304 +#: ../../library/multiprocessing.rst:2307 msgid "" "# create a list proxy and append a mutable object (a dictionary)\n" "lproxy = manager.list()\n" @@ -3375,20 +3378,20 @@ msgid "" "lproxy[0] = d" msgstr "" -#: ../../library/multiprocessing.rst:2315 +#: ../../library/multiprocessing.rst:2318 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2321 +#: ../../library/multiprocessing.rst:2324 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2324 +#: ../../library/multiprocessing.rst:2327 msgid "" ">>> manager.list([1,2,3]) == [1,2,3]\n" "False" @@ -3396,48 +3399,48 @@ msgstr "" ">>> manager.list([1,2,3]) == [1,2,3]\n" "False" -#: ../../library/multiprocessing.rst:2329 +#: ../../library/multiprocessing.rst:2332 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2333 +#: ../../library/multiprocessing.rst:2336 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2337 +#: ../../library/multiprocessing.rst:2340 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2339 +#: ../../library/multiprocessing.rst:2342 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2341 +#: ../../library/multiprocessing.rst:2344 msgid "proxy._callmethod(methodname, args, kwds)" msgstr "proxy._callmethod(methodname, args, kwds)" -#: ../../library/multiprocessing.rst:2343 +#: ../../library/multiprocessing.rst:2346 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2345 +#: ../../library/multiprocessing.rst:2348 msgid "getattr(obj, methodname)(*args, **kwds)" msgstr "getattr(obj, methodname)(*args, **kwds)" -#: ../../library/multiprocessing.rst:2347 +#: ../../library/multiprocessing.rst:2350 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2349 +#: ../../library/multiprocessing.rst:2352 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2353 +#: ../../library/multiprocessing.rst:2356 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -3445,17 +3448,17 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2358 +#: ../../library/multiprocessing.rst:2361 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2361 +#: ../../library/multiprocessing.rst:2364 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2363 +#: ../../library/multiprocessing.rst:2366 msgid "" ">>> l = manager.list(range(10))\n" ">>> l._callmethod('__len__')\n" @@ -3477,69 +3480,69 @@ msgstr "" "...\n" "IndexError: list index out of range" -#: ../../library/multiprocessing.rst:2377 +#: ../../library/multiprocessing.rst:2380 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2379 +#: ../../library/multiprocessing.rst:2382 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2383 +#: ../../library/multiprocessing.rst:2386 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2387 +#: ../../library/multiprocessing.rst:2390 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2391 +#: ../../library/multiprocessing.rst:2394 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2393 +#: ../../library/multiprocessing.rst:2396 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2396 +#: ../../library/multiprocessing.rst:2399 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2401 +#: ../../library/multiprocessing.rst:2404 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2406 +#: ../../library/multiprocessing.rst:2409 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2411 +#: ../../library/multiprocessing.rst:2414 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2415 +#: ../../library/multiprocessing.rst:2418 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.process_cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2418 -#: ../../library/multiprocessing.rst:2984 +#: ../../library/multiprocessing.rst:2421 +#: ../../library/multiprocessing.rst:2987 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2421 +#: ../../library/multiprocessing.rst:2424 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -3547,7 +3550,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2426 +#: ../../library/multiprocessing.rst:2429 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -3557,13 +3560,13 @@ msgid "" "method if it has not been set already. See the :func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:2434 +#: ../../library/multiprocessing.rst:2437 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2438 +#: ../../library/multiprocessing.rst:2441 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -3571,28 +3574,28 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2443 +#: ../../library/multiprocessing.rst:2446 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2447 +#: ../../library/multiprocessing.rst:2450 msgid "Added the *maxtasksperchild* parameter." msgstr "新增 *maxtasksperchild* 參數。" -#: ../../library/multiprocessing.rst:2450 +#: ../../library/multiprocessing.rst:2453 msgid "Added the *context* parameter." msgstr "新增 *context* 參數。" -#: ../../library/multiprocessing.rst:2453 +#: ../../library/multiprocessing.rst:2456 msgid "" "*processes* uses :func:`os.process_cpu_count` by default, instead of :func:" "`os.cpu_count`." msgstr "" -#: ../../library/multiprocessing.rst:2459 +#: ../../library/multiprocessing.rst:2462 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -3603,7 +3606,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2469 +#: ../../library/multiprocessing.rst:2472 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -3611,14 +3614,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2476 +#: ../../library/multiprocessing.rst:2479 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2479 -#: ../../library/multiprocessing.rst:2510 +#: ../../library/multiprocessing.rst:2482 +#: ../../library/multiprocessing.rst:2513 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -3626,60 +3629,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2484 -#: ../../library/multiprocessing.rst:2515 +#: ../../library/multiprocessing.rst:2487 +#: ../../library/multiprocessing.rst:2518 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2488 -#: ../../library/multiprocessing.rst:2519 +#: ../../library/multiprocessing.rst:2491 +#: ../../library/multiprocessing.rst:2522 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2493 +#: ../../library/multiprocessing.rst:2496 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2497 +#: ../../library/multiprocessing.rst:2500 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2501 +#: ../../library/multiprocessing.rst:2504 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2507 +#: ../../library/multiprocessing.rst:2510 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2524 +#: ../../library/multiprocessing.rst:2527 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2526 +#: ../../library/multiprocessing.rst:2529 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2531 +#: ../../library/multiprocessing.rst:2534 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -3687,65 +3690,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2538 +#: ../../library/multiprocessing.rst:2541 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2544 +#: ../../library/multiprocessing.rst:2547 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2548 +#: ../../library/multiprocessing.rst:2551 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2555 +#: ../../library/multiprocessing.rst:2558 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2563 +#: ../../library/multiprocessing.rst:2566 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2568 +#: ../../library/multiprocessing.rst:2571 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2574 +#: ../../library/multiprocessing.rst:2577 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2577 +#: ../../library/multiprocessing.rst:2580 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2585 +#: ../../library/multiprocessing.rst:2588 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2590 +#: ../../library/multiprocessing.rst:2593 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -3753,31 +3756,31 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2597 +#: ../../library/multiprocessing.rst:2600 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2601 +#: ../../library/multiprocessing.rst:2604 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2605 +#: ../../library/multiprocessing.rst:2608 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2608 +#: ../../library/multiprocessing.rst:2611 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2612 +#: ../../library/multiprocessing.rst:2615 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2614 +#: ../../library/multiprocessing.rst:2617 msgid "" "from multiprocessing import Pool\n" "import time\n" @@ -3805,17 +3808,17 @@ msgid "" "TimeoutError" msgstr "" -#: ../../library/multiprocessing.rst:2639 +#: ../../library/multiprocessing.rst:2642 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2644 +#: ../../library/multiprocessing.rst:2647 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2648 +#: ../../library/multiprocessing.rst:2651 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -3824,46 +3827,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2657 +#: ../../library/multiprocessing.rst:2660 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2660 +#: ../../library/multiprocessing.rst:2663 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2666 +#: ../../library/multiprocessing.rst:2669 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2669 +#: ../../library/multiprocessing.rst:2672 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2674 +#: ../../library/multiprocessing.rst:2677 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2677 +#: ../../library/multiprocessing.rst:2680 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2681 -#: ../../library/multiprocessing.rst:2716 +#: ../../library/multiprocessing.rst:2684 +#: ../../library/multiprocessing.rst:2719 msgid "" "If *authkey* is given and not ``None``, it should be a byte string and will " "be used as the secret key for an HMAC-based authentication challenge. No " @@ -3872,26 +3875,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2689 +#: ../../library/multiprocessing.rst:2692 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2692 +#: ../../library/multiprocessing.rst:2695 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2697 +#: ../../library/multiprocessing.rst:2700 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2701 +#: ../../library/multiprocessing.rst:2704 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -3905,49 +3908,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2712 +#: ../../library/multiprocessing.rst:2715 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2724 +#: ../../library/multiprocessing.rst:2727 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2731 +#: ../../library/multiprocessing.rst:2734 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2735 +#: ../../library/multiprocessing.rst:2738 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2739 +#: ../../library/multiprocessing.rst:2742 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2743 +#: ../../library/multiprocessing.rst:2746 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2746 +#: ../../library/multiprocessing.rst:2749 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2753 +#: ../../library/multiprocessing.rst:2756 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -3956,32 +3959,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2759 +#: ../../library/multiprocessing.rst:2762 msgid "" "For both POSIX and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2762 +#: ../../library/multiprocessing.rst:2765 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2763 +#: ../../library/multiprocessing.rst:2766 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2764 +#: ../../library/multiprocessing.rst:2767 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2767 +#: ../../library/multiprocessing.rst:2770 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2770 +#: ../../library/multiprocessing.rst:2773 msgid "" "**POSIX**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -3989,7 +3992,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2776 +#: ../../library/multiprocessing.rst:2779 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -3999,18 +4002,18 @@ msgid "" "handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2786 +#: ../../library/multiprocessing.rst:2789 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2788 +#: ../../library/multiprocessing.rst:2791 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2792 +#: ../../library/multiprocessing.rst:2795 msgid "" "from multiprocessing.connection import Listener\n" "from array import array\n" @@ -4028,13 +4031,13 @@ msgid "" " conn.send_bytes(array('i', [42, 1729]))" msgstr "" -#: ../../library/multiprocessing.rst:2807 +#: ../../library/multiprocessing.rst:2810 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2810 +#: ../../library/multiprocessing.rst:2813 msgid "" "from multiprocessing.connection import Client\n" "from array import array\n" @@ -4064,13 +4067,13 @@ msgstr "" " print(conn.recv_bytes_into(arr)) # => 8\n" " print(arr) # => array('i', [42, 1729, 0, 0, 0])" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2827 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2827 +#: ../../library/multiprocessing.rst:2830 msgid "" "from multiprocessing import Process, Pipe, current_process\n" "from multiprocessing.connection import wait\n" @@ -4104,23 +4107,23 @@ msgid "" " print(msg)" msgstr "" -#: ../../library/multiprocessing.rst:2862 +#: ../../library/multiprocessing.rst:2865 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2864 +#: ../../library/multiprocessing.rst:2867 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2867 +#: ../../library/multiprocessing.rst:2870 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2870 +#: ../../library/multiprocessing.rst:2873 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -4129,17 +4132,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2875 +#: ../../library/multiprocessing.rst:2878 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2882 +#: ../../library/multiprocessing.rst:2885 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2884 +#: ../../library/multiprocessing.rst:2887 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -4147,7 +4150,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2890 +#: ../../library/multiprocessing.rst:2893 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -4155,7 +4158,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2896 +#: ../../library/multiprocessing.rst:2899 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -4166,17 +4169,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2904 +#: ../../library/multiprocessing.rst:2907 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2908 +#: ../../library/multiprocessing.rst:2911 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2910 +#: ../../library/multiprocessing.rst:2913 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -4184,27 +4187,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2917 +#: ../../library/multiprocessing.rst:2920 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2920 +#: ../../library/multiprocessing.rst:2923 msgid "" "When first created the logger has level :const:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2924 +#: ../../library/multiprocessing.rst:2927 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2931 +#: ../../library/multiprocessing.rst:2934 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -4213,11 +4216,11 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2937 +#: ../../library/multiprocessing.rst:2940 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2939 +#: ../../library/multiprocessing.rst:2942 msgid "" ">>> import multiprocessing, logging\n" ">>> logger = multiprocessing.log_to_stderr()\n" @@ -4245,21 +4248,21 @@ msgstr "" "[INFO/MainProcess] sending shutdown message to manager\n" "[INFO/SyncManager-...] manager exiting with exitcode 0" -#: ../../library/multiprocessing.rst:2952 +#: ../../library/multiprocessing.rst:2955 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2956 +#: ../../library/multiprocessing.rst:2959 msgid "The :mod:`multiprocessing.dummy` module" msgstr ":mod:`multiprocessing.dummy` 模組" -#: ../../library/multiprocessing.rst:2961 +#: ../../library/multiprocessing.rst:2964 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2966 +#: ../../library/multiprocessing.rst:2969 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -4267,7 +4270,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2974 +#: ../../library/multiprocessing.rst:2977 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -4277,18 +4280,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2981 +#: ../../library/multiprocessing.rst:2984 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.process_cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2987 +#: ../../library/multiprocessing.rst:2990 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2991 +#: ../../library/multiprocessing.rst:2994 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -4298,7 +4301,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2998 +#: ../../library/multiprocessing.rst:3001 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -4307,69 +4310,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:3008 +#: ../../library/multiprocessing.rst:3011 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:3010 +#: ../../library/multiprocessing.rst:3013 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:3015 +#: ../../library/multiprocessing.rst:3018 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:3017 +#: ../../library/multiprocessing.rst:3020 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:3019 +#: ../../library/multiprocessing.rst:3022 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:3021 +#: ../../library/multiprocessing.rst:3024 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:3024 +#: ../../library/multiprocessing.rst:3027 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:3028 +#: ../../library/multiprocessing.rst:3031 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:3030 +#: ../../library/multiprocessing.rst:3033 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:3032 +#: ../../library/multiprocessing.rst:3035 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:3034 +#: ../../library/multiprocessing.rst:3037 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:3037 +#: ../../library/multiprocessing.rst:3040 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:3039 +#: ../../library/multiprocessing.rst:3042 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:3041 +#: ../../library/multiprocessing.rst:3044 msgid "" "On POSIX when a process finishes but has not been joined it becomes a " "zombie. There should never be very many because each time a new process " @@ -4380,11 +4383,11 @@ msgid "" "explicitly join all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:3049 +#: ../../library/multiprocessing.rst:3052 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:3051 +#: ../../library/multiprocessing.rst:3054 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -4394,11 +4397,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:3059 +#: ../../library/multiprocessing.rst:3062 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:3061 +#: ../../library/multiprocessing.rst:3064 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -4406,18 +4409,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:3067 +#: ../../library/multiprocessing.rst:3070 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:3071 +#: ../../library/multiprocessing.rst:3074 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:3073 +#: ../../library/multiprocessing.rst:3076 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -4426,7 +4429,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:3079 +#: ../../library/multiprocessing.rst:3082 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -4435,11 +4438,11 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:3085 +#: ../../library/multiprocessing.rst:3088 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:3087 +#: ../../library/multiprocessing.rst:3090 msgid "" "from multiprocessing import Process, Queue\n" "\n" @@ -4454,17 +4457,17 @@ msgid "" " obj = queue.get()" msgstr "" -#: ../../library/multiprocessing.rst:3099 +#: ../../library/multiprocessing.rst:3102 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:3102 +#: ../../library/multiprocessing.rst:3105 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:3104 +#: ../../library/multiprocessing.rst:3107 msgid "" "On POSIX using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -4472,7 +4475,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:3109 +#: ../../library/multiprocessing.rst:3112 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -4481,11 +4484,11 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:3116 +#: ../../library/multiprocessing.rst:3119 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:3118 +#: ../../library/multiprocessing.rst:3121 msgid "" "from multiprocessing import Process, Lock\n" "\n" @@ -4507,11 +4510,11 @@ msgstr "" " for i in range(10):\n" " Process(target=f).start()" -#: ../../library/multiprocessing.rst:3128 +#: ../../library/multiprocessing.rst:3131 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:3130 +#: ../../library/multiprocessing.rst:3133 msgid "" "from multiprocessing import Process, Lock\n" "\n" @@ -4533,25 +4536,25 @@ msgstr "" " for i in range(10):\n" " Process(target=f, args=(lock,)).start()" -#: ../../library/multiprocessing.rst:3140 +#: ../../library/multiprocessing.rst:3143 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:3142 +#: ../../library/multiprocessing.rst:3145 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:3144 +#: ../../library/multiprocessing.rst:3147 msgid "os.close(sys.stdin.fileno())" msgstr "os.close(sys.stdin.fileno())" -#: ../../library/multiprocessing.rst:3146 +#: ../../library/multiprocessing.rst:3149 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:3149 +#: ../../library/multiprocessing.rst:3152 msgid "" "sys.stdin.close()\n" "sys.stdin = open(os.open(os.devnull, os.O_RDONLY), closefd=False)" @@ -4559,7 +4562,7 @@ msgstr "" "sys.stdin.close()\n" "sys.stdin = open(os.open(os.devnull, os.O_RDONLY), closefd=False)" -#: ../../library/multiprocessing.rst:3152 +#: ../../library/multiprocessing.rst:3155 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -4569,14 +4572,14 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:3159 +#: ../../library/multiprocessing.rst:3162 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:3163 +#: ../../library/multiprocessing.rst:3166 msgid "" "@property\n" "def cache(self):\n" @@ -4594,26 +4597,26 @@ msgstr "" " self._cache = []\n" " return self._cache" -#: ../../library/multiprocessing.rst:3171 +#: ../../library/multiprocessing.rst:3174 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:3177 +#: ../../library/multiprocessing.rst:3180 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:3179 +#: ../../library/multiprocessing.rst:3182 msgid "" "There are a few extra restrictions which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:3182 +#: ../../library/multiprocessing.rst:3185 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:3184 +#: ../../library/multiprocessing.rst:3187 msgid "" "Ensure that all arguments to :class:`~multiprocessing.Process` are " "picklable. Also, if you subclass ``Process.__init__``, you must make sure " @@ -4621,11 +4624,11 @@ msgid "" "` method is called." msgstr "" -#: ../../library/multiprocessing.rst:3189 +#: ../../library/multiprocessing.rst:3192 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:3191 +#: ../../library/multiprocessing.rst:3194 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -4633,30 +4636,30 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:3196 +#: ../../library/multiprocessing.rst:3199 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:3201 +#: ../../library/multiprocessing.rst:3204 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:3203 +#: ../../library/multiprocessing.rst:3206 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:3207 +#: ../../library/multiprocessing.rst:3210 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:3211 +#: ../../library/multiprocessing.rst:3214 msgid "" "from multiprocessing import Process\n" "\n" @@ -4674,13 +4677,13 @@ msgstr "" "p = Process(target=foo)\n" "p.start()" -#: ../../library/multiprocessing.rst:3219 +#: ../../library/multiprocessing.rst:3222 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:3222 +#: ../../library/multiprocessing.rst:3225 msgid "" "from multiprocessing import Process, freeze_support, set_start_method\n" "\n" @@ -4704,33 +4707,33 @@ msgstr "" " p = Process(target=foo)\n" " p.start()" -#: ../../library/multiprocessing.rst:3233 +#: ../../library/multiprocessing.rst:3236 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:3236 +#: ../../library/multiprocessing.rst:3239 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:3239 +#: ../../library/multiprocessing.rst:3242 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3246 +#: ../../library/multiprocessing.rst:3249 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3248 +#: ../../library/multiprocessing.rst:3251 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3250 +#: ../../library/multiprocessing.rst:3253 msgid "" "from multiprocessing import freeze_support\n" "from multiprocessing.managers import BaseManager, BaseProxy\n" @@ -4824,11 +4827,11 @@ msgid "" " test()\n" msgstr "" -#: ../../library/multiprocessing.rst:3254 +#: ../../library/multiprocessing.rst:3257 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "使用 :class:`~multiprocessing.pool.Pool`:" -#: ../../library/multiprocessing.rst:3256 +#: ../../library/multiprocessing.rst:3259 msgid "" "import multiprocessing\n" "import time\n" @@ -4988,13 +4991,13 @@ msgid "" " test()\n" msgstr "" -#: ../../library/multiprocessing.rst:3260 +#: ../../library/multiprocessing.rst:3263 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" msgstr "" -#: ../../library/multiprocessing.rst:3263 +#: ../../library/multiprocessing.rst:3266 msgid "" "import time\n" "import random\n" From 77a2d81d05ac66dc8e04f92f73bbdc4edacef89d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Jan 2026 00:21:16 +0000 Subject: [PATCH 10/11] sync with cpython c889ff6b --- library/compression.zstd.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/compression.zstd.po b/library/compression.zstd.po index 5025aec25c..9e42a61c1c 100644 --- a/library/compression.zstd.po +++ b/library/compression.zstd.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2026-01-06 00:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -127,7 +127,7 @@ msgstr "" #: ../../library/compression.zstd.rst:75 msgid "" "When writing, the *options* argument can be a dictionary providing advanced " -"decompression parameters; see :class:`CompressionParameter` for detailed " +"compression parameters; see :class:`CompressionParameter` for detailed " "information about supported parameters. The *level* argument is the " "compression level to use when writing compressed data. Only one of *level* " "or *options* may be non-None. The *zstd_dict* argument is a :class:" @@ -179,7 +179,7 @@ msgstr "" #: ../../library/compression.zstd.rst:119 msgid "" "When writing, the *options* argument can be a dictionary providing advanced " -"decompression parameters; see :class:`CompressionParameter` for detailed " +"compression parameters; see :class:`CompressionParameter` for detailed " "information about supported parameters. The *level* argument is the " "compression level to use when writing compressed data. Only one of *level* " "or *options* may be passed. The *zstd_dict* argument is a :class:`ZstdDict` " From 5f68e0ccd8e89e597c7cd4b2084d0aa2304d7415 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 7 Jan 2026 00:15:42 +0000 Subject: [PATCH 11/11] sync with cpython 951bb2ab --- deprecations/index.po | 49 +- deprecations/pending-removal-in-3.18.po | 34 + library/argparse.po | 5 +- library/email.message.po | 13 +- library/email.policy.po | 11 +- library/os.po | 1648 +++++++++---------- library/stdtypes.po | 1985 ++++++++++++----------- library/tempfile.po | 223 +-- whatsnew/3.13.po | 565 ++++--- whatsnew/3.14.po | 448 ++--- 10 files changed, 2562 insertions(+), 2419 deletions(-) create mode 100644 deprecations/pending-removal-in-3.18.po diff --git a/deprecations/index.po b/deprecations/index.po index f670deffde..7f7b0a04f0 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-06 00:15+0000\n" +"POT-Creation-Date: 2026-01-07 00:14+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-" @@ -494,10 +494,10 @@ msgid "" "that explicitly specifies the types your code supports (e.g., ``bytes | " "bytearray | memoryview``)." msgstr "" -"使用 ``isinstance(obj, collections.abc.Buffer)`` 來測試 ``obj`` 是否在 runtime " -"實作了\\ :ref:`緩衝區協定 `。在型別註解的使用中,請用 :class:`~" -"collections.abc.Buffer` 或明確指定你的程式碼所支援型別的聯集(例如 " -"``bytes | bytearray | memoryview``)。" +"使用 ``isinstance(obj, collections.abc.Buffer)`` 來測試 ``obj`` 是否在 " +"runtime 實作了\\ :ref:`緩衝區協定 `。在型別註解的使用中,請" +"用 :class:`~collections.abc.Buffer` 或明確指定你的程式碼所支援型別的聯集(例" +"如 ``bytes | bytearray | memoryview``)。" #: ../../deprecations/pending-removal-in-3.17.rst:14 #: ../../deprecations/pending-removal-in-3.17.rst:42 @@ -510,10 +510,11 @@ msgid "" "also never understood as subtypes of :class:`!ByteString` (either at runtime " "or by static type checkers)." msgstr "" -":class:`!ByteString` 最初被設計為一個抽象類別,以作為 :class:`bytes` 和 :class:`bytearray` " -"的超型別 (supertype)。然而由於 ABC 從未擁有任何方法,知道一個物件是 :class:`!ByteString` 的" -"實例從未真正告訴你任何關於該物件的有用資訊。其他常見的緩衝區型別如 :class:`memoryview` " -"也從未被理解為 :class:`!ByteString` 的子型別(無論是在 runtime 還是由靜態型別檢查器)。" +":class:`!ByteString` 最初被設計為一個抽象類別,以作為 :class:`bytes` 和 :" +"class:`bytearray` 的超型別 (supertype)。然而由於 ABC 從未擁有任何方法,知道一" +"個物件是 :class:`!ByteString` 的實例從未真正告訴你任何關於該物件的有用資訊。" +"其他常見的緩衝區型別如 :class:`memoryview` 也從未被理解為 :class:`!" +"ByteString` 的子型別(無論是在 runtime 還是由靜態型別檢查器)。" #: ../../deprecations/pending-removal-in-3.17.rst:22 #: ../../deprecations/pending-removal-in-3.17.rst:50 @@ -521,7 +522,8 @@ msgid "" "See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by " "Shantanu Jain in :gh:`91896`.)" msgstr "" -"更多細節請見 :pep:`PEP 688 <688#current-options>`。(由 Shantanu Jain 於 :gh:`91896` 貢獻。)" +"更多細節請見 :pep:`PEP 688 <688#current-options>`。(由 Shantanu Jain 於 :gh:" +"`91896` 貢獻。)" #: ../../deprecations/pending-removal-in-3.17.rst:28 msgid "" @@ -542,7 +544,26 @@ msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " "removal in Python 3.17." msgstr "" -":class:`typing.ByteString` 自 Python 3.9 起已被棄用,預計在 Python 3.17 中移除。" +":class:`typing.ByteString` 自 Python 3.9 起已被棄用,預計在 Python 3.17 中移" +"除。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:2 +#: ../../deprecations/pending-removal-in-3.18.rst:2 +msgid "Pending removal in Python 3.18" +msgstr "Python 3.18 中待移除的項目" + +#: ../../deprecations/pending-removal-in-3.18.rst:4 +#, fuzzy +msgid ":mod:`decimal`:" +msgstr ":mod:`datetime`:" + +#: ../../deprecations/pending-removal-in-3.18.rst:6 +msgid "" +"The non-standard and undocumented :class:`~decimal.Decimal` format specifier " +"``'N'``, which is only supported in the :mod:`!decimal` module's C " +"implementation, has been deprecated since Python 3.13. (Contributed by " +"Serhiy Storchaka in :gh:`89902`.)" +msgstr "" #: ../../deprecations/pending-removal-in-3.19.rst:2 msgid "Pending removal in Python 3.19" @@ -974,7 +995,7 @@ msgstr "" ":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." "_clear_internal_caches`。" -#: ../../deprecations/index.rst:15 +#: ../../deprecations/index.rst:17 msgid "C API deprecations" msgstr "C API 的棄用項目" @@ -1337,10 +1358,6 @@ msgstr "" "應改用帶有 :c:type:`PyConfig` 的 :c:func:`Py_InitializeFromConfig` API 來設定" "這些選項。或者也可以使用 :c:func:`PyConfig_Get` 在執行時取得這些選項。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:2 -msgid "Pending removal in Python 3.18" -msgstr "Python 3.18 中待移除的項目" - #: ../../deprecations/c-api-pending-removal-in-3.18.rst:4 msgid "" "The following private functions are deprecated and planned for removal in " diff --git a/deprecations/pending-removal-in-3.18.po b/deprecations/pending-removal-in-3.18.po new file mode 100644 index 0000000000..3d4d73e436 --- /dev/null +++ b/deprecations/pending-removal-in-3.18.po @@ -0,0 +1,34 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001 Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.14\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-01-07 00:14+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../deprecations/pending-removal-in-3.18.rst:2 +msgid "Pending removal in Python 3.18" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.18.rst:4 +msgid ":mod:`decimal`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.18.rst:6 +msgid "" +"The non-standard and undocumented :class:`~decimal.Decimal` format specifier " +"``'N'``, which is only supported in the :mod:`!decimal` module's C " +"implementation, has been deprecated since Python 3.13. (Contributed by " +"Serhiy Storchaka in :gh:`89902`.)" +msgstr "" diff --git a/library/argparse.po b/library/argparse.po index 0715abc4f5..b0563a0100 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-12 00:15+0000\n" +"POT-Creation-Date: 2026-01-07 00:14+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-" @@ -1283,10 +1283,11 @@ msgid "" msgstr "" #: ../../library/argparse.rst:741 +#, fuzzy msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo-bar')\n" -">>> parser.parse_args(['--foo-bar', 'FOO-BAR']\n" +">>> parser.parse_args(['--foo-bar', 'FOO-BAR'])\n" "Namespace(foo_bar='FOO-BAR')\n" ">>> parser.print_help()\n" "usage: [-h] [--foo-bar FOO-BAR]\n" diff --git a/library/email.message.po b/library/email.message.po index 776855ae1d..7e1526c920 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2026-01-07 00:14+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -88,7 +88,7 @@ msgid "" "`~email.policy.default` policy, which follows the rules of the email RFCs " "except for line endings (instead of the RFC mandated ``\\r\\n``, it uses the " "Python standard ``\\n`` line endings). For more information see the :mod:" -"`~email.policy` documentation." +"`~email.policy` documentation. [2]_" msgstr "" #: ../../library/email.message.rst:64 @@ -911,3 +911,12 @@ msgid "" "Originally added in 3.4 as a :term:`provisional module `. Docs for legacy message class moved to :ref:`compat32_message`." msgstr "" + +#: ../../library/email.message.rst:753 +msgid "" +"The :class:`EmailMessage` class requires a policy that provides a " +"``content_manager`` attribute for content management methods like " +"``set_content()`` and ``get_content()`` to work. The legacy :const:`~email." +"policy.compat32` policy does not support these methods and should not be " +"used with :class:`EmailMessage`." +msgstr "" diff --git a/library/email.policy.po b/library/email.policy.po index 1f7507a877..4925c06796 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-01-06 00:14+0000\n" +"POT-Creation-Date: 2026-01-07 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -814,10 +814,17 @@ msgid "" msgstr "" #: ../../library/email.policy.rst:667 +msgid "" +"The :const:`compat32` policy should not be used as a policy for :class:" +"`~email.message.EmailMessage` objects, and should only be used to serialize " +"messages that were created using the :const:`compat32` policy." +msgstr "" + +#: ../../library/email.policy.rst:674 msgid "Footnotes" msgstr "註解" -#: ../../library/email.policy.rst:668 +#: ../../library/email.policy.rst:675 msgid "" "Originally added in 3.3 as a :term:`provisional feature `." diff --git a/library/os.po b/library/os.po index 6806bd7e25..f942707b81 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-28 00:16+0000\n" +"POT-Creation-Date: 2026-01-07 00:14+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -343,59 +343,59 @@ msgstr "" #: ../../library/os.rst:1845 ../../library/os.rst:1853 #: ../../library/os.rst:1862 ../../library/os.rst:1873 #: ../../library/os.rst:1910 ../../library/os.rst:1937 -#: ../../library/os.rst:1988 ../../library/os.rst:1994 -#: ../../library/os.rst:2160 ../../library/os.rst:2237 -#: ../../library/os.rst:2254 ../../library/os.rst:2268 -#: ../../library/os.rst:2294 ../../library/os.rst:2312 -#: ../../library/os.rst:2328 ../../library/os.rst:2345 -#: ../../library/os.rst:2408 ../../library/os.rst:2432 -#: ../../library/os.rst:2452 ../../library/os.rst:2588 -#: ../../library/os.rst:2610 ../../library/os.rst:2654 -#: ../../library/os.rst:2666 ../../library/os.rst:2688 -#: ../../library/os.rst:3396 ../../library/os.rst:3533 -#: ../../library/os.rst:3556 ../../library/os.rst:3570 -#: ../../library/os.rst:3790 ../../library/os.rst:3815 -#: ../../library/os.rst:3840 ../../library/os.rst:3894 -#: ../../library/os.rst:3903 ../../library/os.rst:3912 -#: ../../library/os.rst:3920 ../../library/os.rst:3929 -#: ../../library/os.rst:3938 ../../library/os.rst:4010 -#: ../../library/os.rst:4073 ../../library/os.rst:4083 -#: ../../library/os.rst:4101 ../../library/os.rst:4110 -#: ../../library/os.rst:4120 ../../library/os.rst:4130 -#: ../../library/os.rst:4140 ../../library/os.rst:4151 -#: ../../library/os.rst:4296 ../../library/os.rst:4365 -#: ../../library/os.rst:4400 ../../library/os.rst:4408 -#: ../../library/os.rst:4415 ../../library/os.rst:4422 -#: ../../library/os.rst:4429 ../../library/os.rst:4436 -#: ../../library/os.rst:4443 ../../library/os.rst:4450 -#: ../../library/os.rst:4458 ../../library/os.rst:4466 -#: ../../library/os.rst:4473 ../../library/os.rst:4480 -#: ../../library/os.rst:4489 ../../library/os.rst:4497 -#: ../../library/os.rst:4505 ../../library/os.rst:4512 -#: ../../library/os.rst:4519 ../../library/os.rst:4568 -#: ../../library/os.rst:4595 ../../library/os.rst:4618 -#: ../../library/os.rst:4634 ../../library/os.rst:4641 -#: ../../library/os.rst:4652 ../../library/os.rst:4662 -#: ../../library/os.rst:4671 ../../library/os.rst:4703 -#: ../../library/os.rst:4815 ../../library/os.rst:4831 -#: ../../library/os.rst:4864 ../../library/os.rst:4933 -#: ../../library/os.rst:4956 ../../library/os.rst:4967 -#: ../../library/os.rst:4979 ../../library/os.rst:5024 -#: ../../library/os.rst:5061 ../../library/os.rst:5084 -#: ../../library/os.rst:5105 ../../library/os.rst:5139 -#: ../../library/os.rst:5180 ../../library/os.rst:5200 -#: ../../library/os.rst:5214 ../../library/os.rst:5231 -#: ../../library/os.rst:5246 ../../library/os.rst:5257 -#: ../../library/os.rst:5269 ../../library/os.rst:5282 -#: ../../library/os.rst:5291 ../../library/os.rst:5301 -#: ../../library/os.rst:5314 ../../library/os.rst:5349 -#: ../../library/os.rst:5365 ../../library/os.rst:5376 -#: ../../library/os.rst:5388 ../../library/os.rst:5395 -#: ../../library/os.rst:5404 ../../library/os.rst:5413 -#: ../../library/os.rst:5422 ../../library/os.rst:5431 -#: ../../library/os.rst:5595 ../../library/os.rst:5604 -#: ../../library/os.rst:5628 ../../library/os.rst:5655 -#: ../../library/os.rst:5664 ../../library/os.rst:5787 +#: ../../library/os.rst:1989 ../../library/os.rst:1995 +#: ../../library/os.rst:2161 ../../library/os.rst:2238 +#: ../../library/os.rst:2255 ../../library/os.rst:2269 +#: ../../library/os.rst:2295 ../../library/os.rst:2313 +#: ../../library/os.rst:2329 ../../library/os.rst:2346 +#: ../../library/os.rst:2409 ../../library/os.rst:2433 +#: ../../library/os.rst:2453 ../../library/os.rst:2589 +#: ../../library/os.rst:2611 ../../library/os.rst:2655 +#: ../../library/os.rst:2667 ../../library/os.rst:2689 +#: ../../library/os.rst:3397 ../../library/os.rst:3534 +#: ../../library/os.rst:3557 ../../library/os.rst:3571 +#: ../../library/os.rst:3791 ../../library/os.rst:3816 +#: ../../library/os.rst:3841 ../../library/os.rst:3895 +#: ../../library/os.rst:3904 ../../library/os.rst:3913 +#: ../../library/os.rst:3921 ../../library/os.rst:3930 +#: ../../library/os.rst:3939 ../../library/os.rst:4011 +#: ../../library/os.rst:4074 ../../library/os.rst:4084 +#: ../../library/os.rst:4102 ../../library/os.rst:4111 +#: ../../library/os.rst:4121 ../../library/os.rst:4131 +#: ../../library/os.rst:4141 ../../library/os.rst:4152 +#: ../../library/os.rst:4297 ../../library/os.rst:4366 +#: ../../library/os.rst:4401 ../../library/os.rst:4409 +#: ../../library/os.rst:4416 ../../library/os.rst:4423 +#: ../../library/os.rst:4430 ../../library/os.rst:4437 +#: ../../library/os.rst:4444 ../../library/os.rst:4451 +#: ../../library/os.rst:4459 ../../library/os.rst:4467 +#: ../../library/os.rst:4474 ../../library/os.rst:4481 +#: ../../library/os.rst:4490 ../../library/os.rst:4498 +#: ../../library/os.rst:4506 ../../library/os.rst:4513 +#: ../../library/os.rst:4520 ../../library/os.rst:4569 +#: ../../library/os.rst:4596 ../../library/os.rst:4619 +#: ../../library/os.rst:4635 ../../library/os.rst:4642 +#: ../../library/os.rst:4653 ../../library/os.rst:4663 +#: ../../library/os.rst:4672 ../../library/os.rst:4704 +#: ../../library/os.rst:4816 ../../library/os.rst:4832 +#: ../../library/os.rst:4865 ../../library/os.rst:4934 +#: ../../library/os.rst:4957 ../../library/os.rst:4968 +#: ../../library/os.rst:4980 ../../library/os.rst:5025 +#: ../../library/os.rst:5062 ../../library/os.rst:5085 +#: ../../library/os.rst:5106 ../../library/os.rst:5140 +#: ../../library/os.rst:5181 ../../library/os.rst:5201 +#: ../../library/os.rst:5215 ../../library/os.rst:5232 +#: ../../library/os.rst:5247 ../../library/os.rst:5258 +#: ../../library/os.rst:5270 ../../library/os.rst:5283 +#: ../../library/os.rst:5292 ../../library/os.rst:5302 +#: ../../library/os.rst:5315 ../../library/os.rst:5350 +#: ../../library/os.rst:5366 ../../library/os.rst:5377 +#: ../../library/os.rst:5389 ../../library/os.rst:5396 +#: ../../library/os.rst:5405 ../../library/os.rst:5414 +#: ../../library/os.rst:5423 ../../library/os.rst:5432 +#: ../../library/os.rst:5596 ../../library/os.rst:5605 +#: ../../library/os.rst:5629 ../../library/os.rst:5656 +#: ../../library/os.rst:5665 ../../library/os.rst:5788 msgid "Availability" msgstr "可用性" @@ -964,7 +964,7 @@ msgid "" "on iOS and Android." msgstr "" -#: ../../library/os.rst:819 ../../library/os.rst:5086 +#: ../../library/os.rst:819 ../../library/os.rst:5087 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1195,8 +1195,8 @@ msgid "" "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:1034 ../../library/os.rst:2209 -#: ../../library/os.rst:2310 +#: ../../library/os.rst:1034 ../../library/os.rst:2210 +#: ../../library/os.rst:2311 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -1206,14 +1206,14 @@ msgstr "" #: ../../library/os.rst:1038 ../../library/os.rst:1056 #: ../../library/os.rst:1147 ../../library/os.rst:1759 -#: ../../library/os.rst:2206 ../../library/os.rst:2239 -#: ../../library/os.rst:3535 +#: ../../library/os.rst:2207 ../../library/os.rst:2240 +#: ../../library/os.rst:3536 msgid "" "The function is limited on WASI, see :ref:`wasm-availability` for more " "information." msgstr "" -#: ../../library/os.rst:1041 ../../library/os.rst:2317 +#: ../../library/os.rst:1041 ../../library/os.rst:2318 msgid "Added support on Windows." msgstr "新增對 Windows 的支援。" @@ -1224,8 +1224,8 @@ msgid "" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:1052 ../../library/os.rst:2235 -#: ../../library/os.rst:2326 +#: ../../library/os.rst:1052 ../../library/os.rst:2236 +#: ../../library/os.rst:2327 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -1254,7 +1254,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:1081 ../../library/os.rst:2646 +#: ../../library/os.rst:1081 ../../library/os.rst:2647 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -1276,7 +1276,7 @@ msgstr "" msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:1100 ../../library/os.rst:2474 +#: ../../library/os.rst:1100 ../../library/os.rst:2475 msgid "The :func:`.stat` function." msgstr "" @@ -1316,7 +1316,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:1134 ../../library/os.rst:3574 +#: ../../library/os.rst:1134 ../../library/os.rst:3575 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" @@ -1521,37 +1521,37 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1303 ../../library/os.rst:2479 -#: ../../library/os.rst:2519 ../../library/os.rst:2590 -#: ../../library/os.rst:2612 ../../library/os.rst:2693 -#: ../../library/os.rst:2723 ../../library/os.rst:2830 -#: ../../library/os.rst:3590 +#: ../../library/os.rst:1303 ../../library/os.rst:2480 +#: ../../library/os.rst:2520 ../../library/os.rst:2591 +#: ../../library/os.rst:2613 ../../library/os.rst:2694 +#: ../../library/os.rst:2724 ../../library/os.rst:2831 +#: ../../library/os.rst:3591 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" #: ../../library/os.rst:1306 ../../library/os.rst:1657 -#: ../../library/os.rst:1892 ../../library/os.rst:5182 +#: ../../library/os.rst:1892 ../../library/os.rst:5183 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" "exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/os.rst:1311 ../../library/os.rst:2102 -#: ../../library/os.rst:2134 ../../library/os.rst:2165 -#: ../../library/os.rst:2215 ../../library/os.rst:2256 -#: ../../library/os.rst:2296 ../../library/os.rst:2314 -#: ../../library/os.rst:2330 ../../library/os.rst:2390 -#: ../../library/os.rst:2482 ../../library/os.rst:2522 -#: ../../library/os.rst:2566 ../../library/os.rst:2593 -#: ../../library/os.rst:2615 ../../library/os.rst:2656 -#: ../../library/os.rst:2726 ../../library/os.rst:2745 -#: ../../library/os.rst:2833 ../../library/os.rst:3123 -#: ../../library/os.rst:3410 ../../library/os.rst:3577 -#: ../../library/os.rst:3593 ../../library/os.rst:3633 -#: ../../library/os.rst:3733 ../../library/os.rst:3794 -#: ../../library/os.rst:4191 ../../library/os.rst:4371 -#: ../../library/os.rst:4940 +#: ../../library/os.rst:1311 ../../library/os.rst:2103 +#: ../../library/os.rst:2135 ../../library/os.rst:2166 +#: ../../library/os.rst:2216 ../../library/os.rst:2257 +#: ../../library/os.rst:2297 ../../library/os.rst:2315 +#: ../../library/os.rst:2331 ../../library/os.rst:2391 +#: ../../library/os.rst:2483 ../../library/os.rst:2523 +#: ../../library/os.rst:2567 ../../library/os.rst:2594 +#: ../../library/os.rst:2616 ../../library/os.rst:2657 +#: ../../library/os.rst:2727 ../../library/os.rst:2746 +#: ../../library/os.rst:2834 ../../library/os.rst:3124 +#: ../../library/os.rst:3411 ../../library/os.rst:3578 +#: ../../library/os.rst:3594 ../../library/os.rst:3634 +#: ../../library/os.rst:3734 ../../library/os.rst:3795 +#: ../../library/os.rst:4192 ../../library/os.rst:4372 +#: ../../library/os.rst:4941 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -2132,10 +2132,12 @@ msgstr "" #: ../../library/os.rst:1963 msgid "" "On UNIX, non-inheritable file descriptors are closed in child processes at " -"the execution of a new program, other file descriptors are inherited." +"the execution of a new program, other file descriptors are inherited. Note " +"that non-inheritable file descriptors are still *inherited* by child " +"processes on :func:`os.fork`." msgstr "" -#: ../../library/os.rst:1966 +#: ../../library/os.rst:1967 msgid "" "On Windows, non-inheritable handles and file descriptors are closed in child " "processes, except for standard streams (file descriptors 0, 1 and 2: stdin, " @@ -2146,38 +2148,38 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1974 +#: ../../library/os.rst:1975 msgid "On WebAssembly platforms, the file descriptor cannot be modified." msgstr "" -#: ../../library/os.rst:1978 +#: ../../library/os.rst:1979 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1982 +#: ../../library/os.rst:1983 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1986 +#: ../../library/os.rst:1987 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1992 +#: ../../library/os.rst:1993 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:2000 +#: ../../library/os.rst:2001 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:2002 +#: ../../library/os.rst:2003 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:2007 +#: ../../library/os.rst:2008 msgid "" "**specifying a file descriptor:** Normally the *path* argument provided to " "functions in the :mod:`os` module must be a string specifying a file path. " @@ -2187,7 +2189,7 @@ msgid "" "function prefixed with ``f`` (e.g. call ``fchdir`` instead of ``chdir``)." msgstr "" -#: ../../library/os.rst:2015 +#: ../../library/os.rst:2016 msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " @@ -2195,13 +2197,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:2020 +#: ../../library/os.rst:2021 msgid "" "If the function also supports *dir_fd* or *follow_symlinks* arguments, it's " "an error to specify one of those when supplying *path* as a file descriptor." msgstr "" -#: ../../library/os.rst:2025 +#: ../../library/os.rst:2026 msgid "" "**paths relative to directory descriptors:** If *dir_fd* is not ``None``, it " "should be a file descriptor referring to a directory, and the path to " @@ -2212,14 +2214,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:2032 +#: ../../library/os.rst:2033 msgid "" "You can check whether or not *dir_fd* is supported for a particular function " "on your platform using :data:`os.supports_dir_fd`. If it's unavailable, " "using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:2038 +#: ../../library/os.rst:2039 msgid "" "**not following symlinks:** If *follow_symlinks* is ``False``, and the last " "element of the path to operate on is a symbolic link, the function will " @@ -2228,14 +2230,14 @@ msgid "" "function." msgstr "" -#: ../../library/os.rst:2044 +#: ../../library/os.rst:2045 msgid "" "You can check whether or not *follow_symlinks* is supported for a particular " "function on your platform using :data:`os.supports_follow_symlinks`. If it's " "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:2052 +#: ../../library/os.rst:2053 msgid "" "Use the real uid/gid to test for access to *path*. Note that most " "operations will use the effective uid/gid, therefore this routine can be " @@ -2247,13 +2249,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:2061 +#: ../../library/os.rst:2062 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2064 +#: ../../library/os.rst:2065 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -2262,7 +2264,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:2072 +#: ../../library/os.rst:2073 msgid "" "Using :func:`access` to check if a user is authorized to e.g. open a file " "before actually doing so using :func:`open` creates a security hole, because " @@ -2271,7 +2273,7 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:2078 +#: ../../library/os.rst:2079 msgid "" "if os.access(\"myfile\", os.R_OK):\n" " with open(\"myfile\") as fp:\n" @@ -2283,11 +2285,11 @@ msgstr "" " return fp.read()\n" "return \"some default data\"" -#: ../../library/os.rst:2083 +#: ../../library/os.rst:2084 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:2085 +#: ../../library/os.rst:2086 msgid "" "try:\n" " fp = open(\"myfile\")\n" @@ -2305,113 +2307,113 @@ msgstr "" " with fp:\n" " return fp.read()" -#: ../../library/os.rst:2095 +#: ../../library/os.rst:2096 msgid "" "I/O operations may fail even when :func:`access` indicates that they would " "succeed, particularly for operations on network filesystems which may have " "permissions semantics beyond the usual POSIX permission-bit model." msgstr "" -#: ../../library/os.rst:2099 +#: ../../library/os.rst:2100 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*、*effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:2111 +#: ../../library/os.rst:2112 msgid "" "Values to pass as the *mode* parameter of :func:`access` to test the " "existence, readability, writability and executability of *path*, " "respectively." msgstr "" -#: ../../library/os.rst:2120 +#: ../../library/os.rst:2121 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:2122 +#: ../../library/os.rst:2123 msgid "" "This function can support :ref:`specifying a file descriptor `. " "The descriptor must refer to an opened directory, not an open file." msgstr "" -#: ../../library/os.rst:2125 +#: ../../library/os.rst:2126 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:2128 ../../library/os.rst:2266 +#: ../../library/os.rst:2129 ../../library/os.rst:2267 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.chdir``。" -#: ../../library/os.rst:2130 +#: ../../library/os.rst:2131 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:2140 +#: ../../library/os.rst:2141 msgid "" "Set the flags of *path* to the numeric *flags*. *flags* may take a " "combination (bitwise OR) of the following values (as defined in the :mod:" "`stat` module):" msgstr "" -#: ../../library/os.rst:2143 +#: ../../library/os.rst:2144 msgid ":const:`stat.UF_NODUMP`" msgstr ":const:`stat.UF_NODUMP`" -#: ../../library/os.rst:2144 +#: ../../library/os.rst:2145 msgid ":const:`stat.UF_IMMUTABLE`" msgstr ":const:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:2145 +#: ../../library/os.rst:2146 msgid ":const:`stat.UF_APPEND`" msgstr ":const:`stat.UF_APPEND`" -#: ../../library/os.rst:2146 +#: ../../library/os.rst:2147 msgid ":const:`stat.UF_OPAQUE`" msgstr ":const:`stat.UF_OPAQUE`" -#: ../../library/os.rst:2147 +#: ../../library/os.rst:2148 msgid ":const:`stat.UF_NOUNLINK`" msgstr ":const:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:2148 +#: ../../library/os.rst:2149 msgid ":const:`stat.UF_COMPRESSED`" msgstr ":const:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:2149 +#: ../../library/os.rst:2150 msgid ":const:`stat.UF_HIDDEN`" msgstr ":const:`stat.UF_HIDDEN`" -#: ../../library/os.rst:2150 +#: ../../library/os.rst:2151 msgid ":const:`stat.SF_ARCHIVED`" msgstr ":const:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:2151 +#: ../../library/os.rst:2152 msgid ":const:`stat.SF_IMMUTABLE`" msgstr ":const:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:2152 +#: ../../library/os.rst:2153 msgid ":const:`stat.SF_APPEND`" msgstr ":const:`stat.SF_APPEND`" -#: ../../library/os.rst:2153 +#: ../../library/os.rst:2154 msgid ":const:`stat.SF_NOUNLINK`" msgstr ":const:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:2154 +#: ../../library/os.rst:2155 msgid ":const:`stat.SF_SNAPSHOT`" msgstr ":const:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:2156 +#: ../../library/os.rst:2157 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2158 ../../library/os.rst:2292 +#: ../../library/os.rst:2159 ../../library/os.rst:2293 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -2419,102 +2421,102 @@ msgstr "" "引發一個附帶引數 ``path``、``flags`` 的\\ :ref:`稽核事件 ` ``os." "chflags``。" -#: ../../library/os.rst:2162 +#: ../../library/os.rst:2163 msgid "Added the *follow_symlinks* parameter." msgstr "新增 *follow_symlinks* 參數。" -#: ../../library/os.rst:2171 +#: ../../library/os.rst:2172 msgid "" "Change the mode of *path* to the numeric *mode*. *mode* may take one of the " "following values (as defined in the :mod:`stat` module) or bitwise ORed " "combinations of them:" msgstr "" -#: ../../library/os.rst:2175 +#: ../../library/os.rst:2176 msgid ":const:`stat.S_ISUID`" msgstr ":const:`stat.S_ISUID`" -#: ../../library/os.rst:2176 +#: ../../library/os.rst:2177 msgid ":const:`stat.S_ISGID`" msgstr ":const:`stat.S_ISGID`" -#: ../../library/os.rst:2177 +#: ../../library/os.rst:2178 msgid ":const:`stat.S_ENFMT`" msgstr ":const:`stat.S_ENFMT`" -#: ../../library/os.rst:2178 +#: ../../library/os.rst:2179 msgid ":const:`stat.S_ISVTX`" msgstr ":const:`stat.S_ISVTX`" -#: ../../library/os.rst:2179 +#: ../../library/os.rst:2180 msgid ":const:`stat.S_IREAD`" msgstr ":const:`stat.S_IREAD`" -#: ../../library/os.rst:2180 +#: ../../library/os.rst:2181 msgid ":const:`stat.S_IWRITE`" msgstr ":const:`stat.S_IWRITE`" -#: ../../library/os.rst:2181 +#: ../../library/os.rst:2182 msgid ":const:`stat.S_IEXEC`" msgstr ":const:`stat.S_IEXEC`" -#: ../../library/os.rst:2182 +#: ../../library/os.rst:2183 msgid ":const:`stat.S_IRWXU`" msgstr ":const:`stat.S_IRWXU`" -#: ../../library/os.rst:2183 +#: ../../library/os.rst:2184 msgid ":const:`stat.S_IRUSR`" msgstr ":const:`stat.S_IRUSR`" -#: ../../library/os.rst:2184 +#: ../../library/os.rst:2185 msgid ":const:`stat.S_IWUSR`" msgstr ":const:`stat.S_IWUSR`" -#: ../../library/os.rst:2185 +#: ../../library/os.rst:2186 msgid ":const:`stat.S_IXUSR`" msgstr ":const:`stat.S_IXUSR`" -#: ../../library/os.rst:2186 +#: ../../library/os.rst:2187 msgid ":const:`stat.S_IRWXG`" msgstr ":const:`stat.S_IRWXG`" -#: ../../library/os.rst:2187 +#: ../../library/os.rst:2188 msgid ":const:`stat.S_IRGRP`" msgstr ":const:`stat.S_IRGRP`" -#: ../../library/os.rst:2188 +#: ../../library/os.rst:2189 msgid ":const:`stat.S_IWGRP`" msgstr ":const:`stat.S_IWGRP`" -#: ../../library/os.rst:2189 +#: ../../library/os.rst:2190 msgid ":const:`stat.S_IXGRP`" msgstr ":const:`stat.S_IXGRP`" -#: ../../library/os.rst:2190 +#: ../../library/os.rst:2191 msgid ":const:`stat.S_IRWXO`" msgstr ":const:`stat.S_IRWXO`" -#: ../../library/os.rst:2191 +#: ../../library/os.rst:2192 msgid ":const:`stat.S_IROTH`" msgstr ":const:`stat.S_IROTH`" -#: ../../library/os.rst:2192 +#: ../../library/os.rst:2193 msgid ":const:`stat.S_IWOTH`" msgstr ":const:`stat.S_IWOTH`" -#: ../../library/os.rst:2193 +#: ../../library/os.rst:2194 msgid ":const:`stat.S_IXOTH`" msgstr ":const:`stat.S_IXOTH`" -#: ../../library/os.rst:2195 ../../library/os.rst:2228 -#: ../../library/os.rst:3623 +#: ../../library/os.rst:2196 ../../library/os.rst:2229 +#: ../../library/os.rst:3624 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " "following symlinks `." msgstr "" -#: ../../library/os.rst:2201 +#: ../../library/os.rst:2202 msgid "" "Although Windows supports :func:`chmod`, you can only set the file's read-" "only flag with it (via the ``stat.S_IWRITE`` and ``stat.S_IREAD`` constants " @@ -2522,68 +2524,68 @@ msgid "" "value of *follow_symlinks* is ``False`` on Windows." msgstr "" -#: ../../library/os.rst:2211 ../../library/os.rst:2242 +#: ../../library/os.rst:2212 ../../library/os.rst:2243 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:2218 +#: ../../library/os.rst:2219 msgid "" "Added support for a file descriptor and the *follow_symlinks* argument on " "Windows." msgstr "" -#: ../../library/os.rst:2225 +#: ../../library/os.rst:2226 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. To " "leave one of the ids unchanged, set it to -1." msgstr "" -#: ../../library/os.rst:2232 +#: ../../library/os.rst:2233 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:2246 +#: ../../library/os.rst:2247 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2252 +#: ../../library/os.rst:2253 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:2262 +#: ../../library/os.rst:2263 msgid "" "Change the current working directory to the directory represented by the " "file descriptor *fd*. The descriptor must refer to an opened directory, not " "an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``." msgstr "" -#: ../../library/os.rst:2273 +#: ../../library/os.rst:2274 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:2278 +#: ../../library/os.rst:2279 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:2280 +#: ../../library/os.rst:2281 msgid "" "The function now uses the UTF-8 encoding on Windows, rather than the ANSI " "code page: see :pep:`529` for the rationale. The function is no longer " "deprecated on Windows." msgstr "" -#: ../../library/os.rst:2288 +#: ../../library/os.rst:2289 msgid "" "Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do " "not follow symbolic links. As of Python 3.3, this is equivalent to ``os." "chflags(path, flags, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2302 +#: ../../library/os.rst:2303 msgid "" "Change the mode of *path* to the numeric *mode*. If path is a symlink, this " "affects the symlink rather than the target. See the docs for :func:`chmod` " @@ -2591,24 +2593,24 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2307 +#: ../../library/os.rst:2308 msgid "" "``lchmod()`` is not part of POSIX, but Unix implementations may have it if " "changing the mode of symbolic links is supported." msgstr "" -#: ../../library/os.rst:2322 +#: ../../library/os.rst:2323 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " "This function will not follow symbolic links. As of Python 3.3, this is " "equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2336 +#: ../../library/os.rst:2337 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2338 +#: ../../library/os.rst:2339 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `, and :ref:" @@ -2616,7 +2618,7 @@ msgid "" "*follow_symlinks* is ``False`` on Windows." msgstr "" -#: ../../library/os.rst:2343 +#: ../../library/os.rst:2344 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2624,20 +2626,20 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.link``。" -#: ../../library/os.rst:2347 ../../library/os.rst:4620 +#: ../../library/os.rst:2348 ../../library/os.rst:4621 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:2350 +#: ../../library/os.rst:2351 msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* parameters." msgstr "新增 *src_dir_fd*、*dst_dir_fd* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:2353 ../../library/os.rst:2777 -#: ../../library/os.rst:2814 ../../library/os.rst:3545 +#: ../../library/os.rst:2354 ../../library/os.rst:2778 +#: ../../library/os.rst:2815 ../../library/os.rst:3546 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:2359 +#: ../../library/os.rst:2360 msgid "" "Return a list containing the names of the entries in the directory given by " "*path*. The list is in arbitrary order, and does not include the special " @@ -2646,7 +2648,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:2365 +#: ../../library/os.rst:2366 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2654,42 +2656,42 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2370 ../../library/os.rst:2862 +#: ../../library/os.rst:2371 ../../library/os.rst:2863 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:2373 +#: ../../library/os.rst:2374 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listdir``。" -#: ../../library/os.rst:2376 +#: ../../library/os.rst:2377 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:2380 +#: ../../library/os.rst:2381 msgid "" "The :func:`scandir` function returns directory entries along with file " "attribute information, giving better performance for many common use cases." msgstr "" -#: ../../library/os.rst:2384 +#: ../../library/os.rst:2385 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2387 ../../library/os.rst:3401 +#: ../../library/os.rst:2388 ../../library/os.rst:3402 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2396 +#: ../../library/os.rst:2397 msgid "Return a list containing the names of drives on a Windows system." msgstr "" -#: ../../library/os.rst:2398 +#: ../../library/os.rst:2399 msgid "" "A drive name typically looks like ``'C:\\\\'``. Not every drive name will be " "associated with a volume, and some may be inaccessible for a variety of " @@ -2697,22 +2699,22 @@ msgid "" "function does not test for access." msgstr "" -#: ../../library/os.rst:2403 +#: ../../library/os.rst:2404 msgid "May raise :exc:`OSError` if an error occurs collecting the drive names." msgstr "" -#: ../../library/os.rst:2406 +#: ../../library/os.rst:2407 msgid "" "Raises an :ref:`auditing event ` ``os.listdrives`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listdrives``。" -#: ../../library/os.rst:2415 +#: ../../library/os.rst:2416 msgid "" "Return a list containing the mount points for a volume on a Windows system." msgstr "" -#: ../../library/os.rst:2418 +#: ../../library/os.rst:2419 msgid "" "*volume* must be represented as a GUID path, like those returned by :func:" "`os.listvolumes`. Volumes may be mounted in multiple locations or not at " @@ -2720,19 +2722,19 @@ msgid "" "associated with a volume will not be returned by this function." msgstr "" -#: ../../library/os.rst:2424 +#: ../../library/os.rst:2425 msgid "" "The mount points return by this function will be absolute paths, and may be " "longer than the drive name." msgstr "" -#: ../../library/os.rst:2427 +#: ../../library/os.rst:2428 msgid "" "Raises :exc:`OSError` if the volume is not recognized or if an error occurs " "collecting the paths." msgstr "" -#: ../../library/os.rst:2430 +#: ../../library/os.rst:2431 msgid "" "Raises an :ref:`auditing event ` ``os.listmounts`` with argument " "``volume``." @@ -2740,11 +2742,11 @@ msgstr "" "引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` ``os." "listmounts``。" -#: ../../library/os.rst:2439 +#: ../../library/os.rst:2440 msgid "Return a list containing the volumes in the system." msgstr "" -#: ../../library/os.rst:2441 +#: ../../library/os.rst:2442 msgid "" "Volumes are typically represented as a GUID path that looks like ``\\\\?" "\\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\\``. Files can usually be " @@ -2753,49 +2755,49 @@ msgid "" "function is to retrieve mount points using :func:`os.listmounts`." msgstr "" -#: ../../library/os.rst:2448 +#: ../../library/os.rst:2449 msgid "May raise :exc:`OSError` if an error occurs collecting the volumes." msgstr "" -#: ../../library/os.rst:2450 +#: ../../library/os.rst:2451 msgid "" "Raises an :ref:`auditing event ` ``os.listvolumes`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listvolumes``。" -#: ../../library/os.rst:2459 +#: ../../library/os.rst:2460 msgid "" "Perform the equivalent of an :c:func:`!lstat` system call on the given path. " "Similar to :func:`~os.stat`, but does not follow symbolic links. Return a :" "class:`stat_result` object." msgstr "" -#: ../../library/os.rst:2463 +#: ../../library/os.rst:2464 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2466 +#: ../../library/os.rst:2467 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2469 ../../library/os.rst:2511 -#: ../../library/os.rst:2579 ../../library/os.rst:2607 -#: ../../library/os.rst:2681 +#: ../../library/os.rst:2470 ../../library/os.rst:2512 +#: ../../library/os.rst:2580 ../../library/os.rst:2608 +#: ../../library/os.rst:2682 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2476 ../../library/os.rst:2690 -#: ../../library/os.rst:3538 +#: ../../library/os.rst:2477 ../../library/os.rst:2691 +#: ../../library/os.rst:3539 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2485 +#: ../../library/os.rst:2486 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2803,18 +2805,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2494 +#: ../../library/os.rst:2495 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2496 +#: ../../library/os.rst:2497 msgid "" "If the directory already exists, :exc:`FileExistsError` is raised. If a " "parent directory in the path does not exist, :exc:`FileNotFoundError` is " "raised." msgstr "" -#: ../../library/os.rst:2501 +#: ../../library/os.rst:2502 msgid "" "On some systems, *mode* is ignored. Where it is used, the current umask " "value is first masked out. If bits other than the last 9 (i.e. the last 3 " @@ -2823,20 +2825,20 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2507 +#: ../../library/os.rst:2508 msgid "" "On Windows, a *mode* of ``0o700`` is specifically handled to apply access " "control to the new directory such that only the current user and " "administrators have access. Other values of *mode* are ignored." msgstr "" -#: ../../library/os.rst:2514 +#: ../../library/os.rst:2515 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:2517 ../../library/os.rst:2554 +#: ../../library/os.rst:2518 ../../library/os.rst:2555 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -2844,17 +2846,17 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.mkdir``。" -#: ../../library/os.rst:2525 +#: ../../library/os.rst:2526 msgid "Windows now handles a *mode* of ``0o700``." msgstr "" -#: ../../library/os.rst:2535 +#: ../../library/os.rst:2536 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2538 +#: ../../library/os.rst:2539 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2863,27 +2865,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2544 +#: ../../library/os.rst:2545 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: ../../library/os.rst:2549 +#: ../../library/os.rst:2550 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2552 +#: ../../library/os.rst:2553 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2556 +#: ../../library/os.rst:2557 msgid "Added the *exist_ok* parameter." msgstr "新增 *exist_ok* 參數。" -#: ../../library/os.rst:2561 +#: ../../library/os.rst:2562 msgid "" "Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed, :" "func:`makedirs` would still raise an error if *mode* did not match the mode " @@ -2891,19 +2893,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2569 +#: ../../library/os.rst:2570 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2576 +#: ../../library/os.rst:2577 msgid "" "Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The " "current umask value is first masked out from the mode." msgstr "" -#: ../../library/os.rst:2582 +#: ../../library/os.rst:2583 msgid "" "FIFOs are pipes that can be accessed like regular files. FIFOs exist until " "they are deleted (for example with :func:`os.unlink`). Generally, FIFOs are " @@ -2913,7 +2915,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2599 +#: ../../library/os.rst:2600 msgid "" "Create a filesystem node (file, device special file or named pipe) named " "*path*. *mode* specifies both the permissions to use and the type of node to " @@ -2924,23 +2926,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2621 +#: ../../library/os.rst:2622 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2627 +#: ../../library/os.rst:2628 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2633 +#: ../../library/os.rst:2634 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2638 +#: ../../library/os.rst:2639 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2951,20 +2953,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2651 ../../library/os.rst:3394 -#: ../../library/os.rst:3566 +#: ../../library/os.rst:2652 ../../library/os.rst:3395 +#: ../../library/os.rst:3567 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2662 +#: ../../library/os.rst:2663 msgid "" "Dictionary mapping names accepted by :func:`pathconf` and :func:`fpathconf` " "to the integer values defined for those names by the host operating system. " "This can be used to determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:2671 +#: ../../library/os.rst:2672 msgid "" "Return a string representing the path to which the symbolic link points. " "The result may be either an absolute or relative pathname; if it is " @@ -2972,7 +2974,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2676 +#: ../../library/os.rst:2677 msgid "" "If the *path* is a string object (directly or indirectly through a :class:" "`PathLike` interface), the result will also be a string object, and the call " @@ -2980,42 +2982,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2684 +#: ../../library/os.rst:2685 msgid "" "When trying to resolve a path that may contain links, use :func:`~os.path." "realpath` to properly handle recursion and platform differences." msgstr "" -#: ../../library/os.rst:2696 +#: ../../library/os.rst:2697 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2699 +#: ../../library/os.rst:2700 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2702 +#: ../../library/os.rst:2703 msgid "" "Added support for directory junctions, and changed to return the " "substitution path (which typically includes ``\\\\?\\`` prefix) rather than " "the optional \"print name\" field that was previously returned." msgstr "" -#: ../../library/os.rst:2708 +#: ../../library/os.rst:2709 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2712 ../../library/os.rst:2825 -#: ../../library/os.rst:3517 +#: ../../library/os.rst:2713 ../../library/os.rst:2826 +#: ../../library/os.rst:3518 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2715 +#: ../../library/os.rst:2716 msgid "" "On Windows, attempting to remove a file that is in use causes an exception " "to be raised; on Unix, the directory entry is removed but the storage " @@ -3023,12 +3025,12 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2719 +#: ../../library/os.rst:2720 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2721 ../../library/os.rst:2743 -#: ../../library/os.rst:3588 +#: ../../library/os.rst:2722 ../../library/os.rst:2744 +#: ../../library/os.rst:3589 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -3036,7 +3038,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "remove``。" -#: ../../library/os.rst:2734 +#: ../../library/os.rst:2735 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -3048,20 +3050,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2751 +#: ../../library/os.rst:2752 msgid "" "Rename the file or directory *src* to *dst*. If *dst* exists, the operation " "will fail with an :exc:`OSError` subclass in a number of cases:" msgstr "" -#: ../../library/os.rst:2754 +#: ../../library/os.rst:2755 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: ../../library/os.rst:2758 +#: ../../library/os.rst:2759 msgid "" "On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " @@ -3073,20 +3075,20 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2767 ../../library/os.rst:2807 +#: ../../library/os.rst:2768 ../../library/os.rst:2808 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -#: ../../library/os.rst:2770 +#: ../../library/os.rst:2771 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2772 ../../library/os.rst:2793 -#: ../../library/os.rst:2810 +#: ../../library/os.rst:2773 ../../library/os.rst:2794 +#: ../../library/os.rst:2811 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -3094,11 +3096,11 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.rename``。" -#: ../../library/os.rst:2774 +#: ../../library/os.rst:2775 msgid "Added the *src_dir_fd* and *dst_dir_fd* parameters." msgstr "新增 *src_dir_fd* 與 *dst_dir_fd* 參數。" -#: ../../library/os.rst:2783 +#: ../../library/os.rst:2784 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -3107,17 +3109,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2790 +#: ../../library/os.rst:2791 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -#: ../../library/os.rst:2795 +#: ../../library/os.rst:2796 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2801 +#: ../../library/os.rst:2802 msgid "" "Rename the file or directory *src* to *dst*. If *dst* is a non-empty " "directory, :exc:`OSError` will be raised. If *dst* exists and is a file, it " @@ -3126,7 +3128,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2820 +#: ../../library/os.rst:2821 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -3134,7 +3136,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2828 +#: ../../library/os.rst:2829 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -3142,7 +3144,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "rmdir``。" -#: ../../library/os.rst:2839 +#: ../../library/os.rst:2840 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -3152,7 +3154,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2846 +#: ../../library/os.rst:2847 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -3164,7 +3166,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2856 +#: ../../library/os.rst:2857 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the type " @@ -3173,32 +3175,32 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2865 +#: ../../library/os.rst:2866 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.scandir``。" -#: ../../library/os.rst:2867 +#: ../../library/os.rst:2868 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" ":func:`scandir` 疊代器支援 :term:`context manager` 協定,並具有以下方法:" -#: ../../library/os.rst:2872 +#: ../../library/os.rst:2873 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2874 +#: ../../library/os.rst:2875 msgid "" "This is called automatically when the iterator is exhausted or garbage " "collected, or when an error happens during iterating. However it is " "advisable to call it explicitly or use the :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:2881 +#: ../../library/os.rst:2882 msgid "" "The following example shows a simple use of :func:`scandir` to display all " "the files (excluding directories) in the given *path* that don't start with " @@ -3206,7 +3208,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2886 +#: ../../library/os.rst:2887 msgid "" "with os.scandir(path) as it:\n" " for entry in it:\n" @@ -3218,7 +3220,7 @@ msgstr "" " if not entry.name.startswith('.') and entry.is_file():\n" " print(entry.name)" -#: ../../library/os.rst:2893 +#: ../../library/os.rst:2894 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -3229,7 +3231,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2905 +#: ../../library/os.rst:2906 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close` method. If a :func:`scandir` iterator is neither exhausted " @@ -3237,28 +3239,28 @@ msgid "" "destructor." msgstr "" -#: ../../library/os.rst:2911 +#: ../../library/os.rst:2912 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2913 +#: ../../library/os.rst:2914 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "新增對 Unix 上的\\ :ref:`檔案描述器 `\\ 的支援。" -#: ../../library/os.rst:2919 +#: ../../library/os.rst:2920 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2922 +#: ../../library/os.rst:2923 msgid "" ":func:`scandir` will provide as much of this information as possible without " "making additional system calls. When a ``stat()`` or ``lstat()`` system call " "is made, the ``os.DirEntry`` object will cache the result." msgstr "" -#: ../../library/os.rst:2926 +#: ../../library/os.rst:2927 msgid "" "``os.DirEntry`` instances are not intended to be stored in long-lived data " "structures; if you know the file metadata has changed or if a long time has " @@ -3266,7 +3268,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2931 +#: ../../library/os.rst:2932 msgid "" "Because the ``os.DirEntry`` methods can make operating system calls, they " "may also raise :exc:`OSError`. If you need very fine-grained control over " @@ -3274,29 +3276,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2936 +#: ../../library/os.rst:2937 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2939 +#: ../../library/os.rst:2940 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2943 +#: ../../library/os.rst:2944 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2946 +#: ../../library/os.rst:2947 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2952 +#: ../../library/os.rst:2953 msgid "" "The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." "name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " @@ -3306,51 +3308,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2959 +#: ../../library/os.rst:2960 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2965 +#: ../../library/os.rst:2966 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2967 +#: ../../library/os.rst:2968 msgid "" "The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." "path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2971 +#: ../../library/os.rst:2972 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2976 +#: ../../library/os.rst:2977 msgid "" "Return ``True`` if this entry is a directory or a symbolic link pointing to " "a directory; return ``False`` if the entry is or points to any other kind of " "file, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2980 +#: ../../library/os.rst:2981 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "directory (without following symlinks); return ``False`` if the entry is any " "other kind of file or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2984 +#: ../../library/os.rst:2985 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2988 +#: ../../library/os.rst:2989 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, for non-symlinks, neither Windows or Unix require a system " @@ -3360,46 +3362,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2995 ../../library/os.rst:3025 +#: ../../library/os.rst:2996 ../../library/os.rst:3026 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:3000 +#: ../../library/os.rst:3001 msgid "" "Return ``True`` if this entry is a file or a symbolic link pointing to a " "file; return ``False`` if the entry is or points to a directory or other non-" "file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:3004 +#: ../../library/os.rst:3005 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "file (without following symlinks); return ``False`` if the entry is a " "directory or other non-file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:3008 +#: ../../library/os.rst:3009 msgid "" "The result is cached on the ``os.DirEntry`` object. Caching, system calls " "made, and exceptions raised are as per :func:`~os.DirEntry.is_dir`." msgstr "" -#: ../../library/os.rst:3013 +#: ../../library/os.rst:3014 msgid "" "Return ``True`` if this entry is a symbolic link (even if broken); return " "``False`` if the entry points to a directory or any kind of file, or if it " "doesn't exist anymore." msgstr "" -#: ../../library/os.rst:3017 +#: ../../library/os.rst:3018 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "islink` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:3020 +#: ../../library/os.rst:3021 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, neither Windows or Unix require a system call, except on " @@ -3407,48 +3409,48 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:3030 +#: ../../library/os.rst:3031 msgid "" "Return ``True`` if this entry is a junction (even if broken); return " "``False`` if the entry points to a regular directory, any kind of file, a " "symlink, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:3034 +#: ../../library/os.rst:3035 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "isjunction` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:3041 +#: ../../library/os.rst:3042 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -#: ../../library/os.rst:3045 +#: ../../library/os.rst:3046 msgid "" "On Unix, this method always requires a system call. On Windows, it only " "requires a system call if *follow_symlinks* is ``True`` and the entry is a " "reparse point (for example, a symbolic link or directory junction)." msgstr "" -#: ../../library/os.rst:3050 +#: ../../library/os.rst:3051 msgid "" "On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" "class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" -#: ../../library/os.rst:3054 +#: ../../library/os.rst:3055 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -#: ../../library/os.rst:3058 +#: ../../library/os.rst:3059 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -3456,13 +3458,13 @@ msgid "" "``is_file()``, ``is_symlink()``, ``is_junction()``, and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:3066 +#: ../../library/os.rst:3067 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:3070 +#: ../../library/os.rst:3071 msgid "" "The ``st_ctime`` attribute of a stat result is deprecated on Windows. The " "file creation time is properly available as ``st_birthtime``, and in the " @@ -3470,7 +3472,7 @@ msgid "" "time, if available." msgstr "" -#: ../../library/os.rst:3079 +#: ../../library/os.rst:3080 msgid "" "Get the status of a file or a file descriptor. Perform the equivalent of a :" "c:func:`stat` system call on the given path. *path* may be specified as " @@ -3479,21 +3481,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:3085 +#: ../../library/os.rst:3086 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:3088 ../../library/os.rst:4170 -#: ../../library/os.rst:4186 ../../library/os.rst:4202 -#: ../../library/os.rst:4222 +#: ../../library/os.rst:3089 ../../library/os.rst:4171 +#: ../../library/os.rst:4187 ../../library/os.rst:4203 +#: ../../library/os.rst:4223 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:3091 +#: ../../library/os.rst:3092 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -3507,11 +3509,11 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:3104 ../../library/os.rst:3877 +#: ../../library/os.rst:3105 ../../library/os.rst:3878 msgid "Example::" msgstr "範例: ::" -#: ../../library/os.rst:3106 +#: ../../library/os.rst:3107 msgid "" ">>> import os\n" ">>> statinfo = os.stat('somefile.txt')\n" @@ -3531,17 +3533,17 @@ msgstr "" ">>> statinfo.st_size\n" "264" -#: ../../library/os.rst:3117 +#: ../../library/os.rst:3118 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:3119 +#: ../../library/os.rst:3120 msgid "" "Added the *dir_fd* and *follow_symlinks* parameters, specifying a file " "descriptor instead of a path." msgstr "新增 *dir_fd* 與 *follow_symlinks* 參數,指定一個檔案描述器而非路徑。" -#: ../../library/os.rst:3126 +#: ../../library/os.rst:3127 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -3551,122 +3553,122 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:3137 +#: ../../library/os.rst:3138 msgid "" "Object whose attributes correspond roughly to the members of the :c:struct:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:3141 +#: ../../library/os.rst:3142 msgid "Attributes:" msgstr "屬性:" -#: ../../library/os.rst:3145 +#: ../../library/os.rst:3146 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:3149 +#: ../../library/os.rst:3150 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:3152 +#: ../../library/os.rst:3153 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:3153 +#: ../../library/os.rst:3154 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:3159 +#: ../../library/os.rst:3160 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:3163 +#: ../../library/os.rst:3164 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:3167 +#: ../../library/os.rst:3168 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:3171 +#: ../../library/os.rst:3172 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:3175 +#: ../../library/os.rst:3176 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" -#: ../../library/os.rst:3179 +#: ../../library/os.rst:3180 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:3183 +#: ../../library/os.rst:3184 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:3187 +#: ../../library/os.rst:3188 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:3191 +#: ../../library/os.rst:3192 msgid "Time of most recent metadata change expressed in seconds." msgstr "" -#: ../../library/os.rst:3193 +#: ../../library/os.rst:3194 msgid "" "``st_ctime`` is deprecated on Windows. Use ``st_birthtime`` for the file " "creation time. In the future, ``st_ctime`` will contain the time of the most " "recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3200 +#: ../../library/os.rst:3201 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3206 +#: ../../library/os.rst:3207 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:3213 +#: ../../library/os.rst:3214 msgid "" "Time of most recent metadata change expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3218 +#: ../../library/os.rst:3219 msgid "" "``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " "file creation time. In the future, ``st_ctime`` will contain the time of the " "most recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3225 +#: ../../library/os.rst:3226 msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3228 +#: ../../library/os.rst:3229 msgid "``st_birthtime`` is now available on Windows." msgstr "``st_birthtime`` 現在在 Windows 上可用。" -#: ../../library/os.rst:3233 +#: ../../library/os.rst:3234 msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3241 +#: ../../library/os.rst:3242 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" "attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " @@ -3676,7 +3678,7 @@ msgid "" "details." msgstr "" -#: ../../library/os.rst:3248 +#: ../../library/os.rst:3249 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" "`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " @@ -3689,74 +3691,74 @@ msgid "" "`st_birthtime_ns`." msgstr "" -#: ../../library/os.rst:3258 +#: ../../library/os.rst:3259 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:3263 +#: ../../library/os.rst:3264 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: ../../library/os.rst:3268 +#: ../../library/os.rst:3269 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: ../../library/os.rst:3273 +#: ../../library/os.rst:3274 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:3277 +#: ../../library/os.rst:3278 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:3279 +#: ../../library/os.rst:3280 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: ../../library/os.rst:3284 +#: ../../library/os.rst:3285 msgid "File generation number." msgstr "" -#: ../../library/os.rst:3286 +#: ../../library/os.rst:3287 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3291 +#: ../../library/os.rst:3292 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:3294 +#: ../../library/os.rst:3295 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3298 +#: ../../library/os.rst:3299 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:3302 +#: ../../library/os.rst:3303 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:3306 +#: ../../library/os.rst:3307 msgid "File type." msgstr "" -#: ../../library/os.rst:3308 +#: ../../library/os.rst:3309 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:3312 +#: ../../library/os.rst:3313 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" @@ -3764,7 +3766,7 @@ msgid "" "FILE_ATTRIBUTE_ARCHIVE>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3322 +#: ../../library/os.rst:3323 msgid "" "When :attr:`st_file_attributes` has the :const:`~stat." "FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " @@ -3772,14 +3774,14 @@ msgid "" "IO_REPARSE_TAG_SYMLINK>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3327 +#: ../../library/os.rst:3328 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:3331 +#: ../../library/os.rst:3332 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -3791,49 +3793,49 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:3340 +#: ../../library/os.rst:3341 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:3344 +#: ../../library/os.rst:3345 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:3347 +#: ../../library/os.rst:3348 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "在 Windows 上新增 :attr:`st_reparse_tag` 成員。" -#: ../../library/os.rst:3350 +#: ../../library/os.rst:3351 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: ../../library/os.rst:3355 +#: ../../library/os.rst:3356 msgid "" "On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " "last metadata change time, for consistency with other platforms, but for now " "still contains creation time. Use :attr:`st_birthtime` for the creation time." msgstr "" -#: ../../library/os.rst:3361 +#: ../../library/os.rst:3362 msgid "" "On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " "system. Previously it would not be above 64 bits, and larger file " "identifiers would be arbitrarily packed." msgstr "" -#: ../../library/os.rst:3365 +#: ../../library/os.rst:3366 msgid "" "On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " "contain the same as :attr:`st_dev`, which was incorrect." msgstr "" -#: ../../library/os.rst:3368 +#: ../../library/os.rst:3369 msgid "Added the :attr:`st_birthtime` member on Windows." msgstr "在 Windows 上新增 :attr:`st_birthtime` 成員。" -#: ../../library/os.rst:3373 +#: ../../library/os.rst:3374 msgid "" "Perform a :c:func:`!statvfs` system call on the given path. The return " "value is an object whose attributes describe the filesystem on the given " @@ -3843,7 +3845,7 @@ msgid "" "`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:3380 +#: ../../library/os.rst:3381 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -3851,7 +3853,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:3385 +#: ../../library/os.rst:3386 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3864,11 +3866,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:3398 +#: ../../library/os.rst:3399 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:3404 +#: ../../library/os.rst:3405 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3876,11 +3878,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:3413 +#: ../../library/os.rst:3414 msgid "Added the :attr:`f_fsid` attribute." msgstr "新增 :attr:`f_fsid` 屬性。" -#: ../../library/os.rst:3419 +#: ../../library/os.rst:3420 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3892,7 +3894,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:3429 +#: ../../library/os.rst:3430 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3900,17 +3902,17 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3434 +#: ../../library/os.rst:3435 msgid "os.stat in os.supports_dir_fd" msgstr "os.stat in os.supports_dir_fd" -#: ../../library/os.rst:3436 +#: ../../library/os.rst:3437 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3444 +#: ../../library/os.rst:3445 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3919,23 +3921,23 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3450 +#: ../../library/os.rst:3451 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3453 +#: ../../library/os.rst:3454 msgid "os.access in os.supports_effective_ids" msgstr "os.access in os.supports_effective_ids" -#: ../../library/os.rst:3455 +#: ../../library/os.rst:3456 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3463 +#: ../../library/os.rst:3464 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3944,7 +3946,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3470 +#: ../../library/os.rst:3471 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3953,11 +3955,11 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3476 +#: ../../library/os.rst:3477 msgid "os.chdir in os.supports_fd" msgstr "os.chdir in os.supports_fd" -#: ../../library/os.rst:3483 +#: ../../library/os.rst:3484 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3970,7 +3972,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3493 +#: ../../library/os.rst:3494 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3979,21 +3981,21 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3499 +#: ../../library/os.rst:3500 msgid "os.stat in os.supports_follow_symlinks" msgstr "os.stat in os.supports_follow_symlinks" -#: ../../library/os.rst:3506 +#: ../../library/os.rst:3507 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3508 +#: ../../library/os.rst:3509 msgid "" "The *src* parameter refers to the target of the link (the file or directory " "being linked to), and *dst* is the name of the link being created." msgstr "" -#: ../../library/os.rst:3511 +#: ../../library/os.rst:3512 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -4003,7 +4005,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3522 +#: ../../library/os.rst:3523 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -4011,12 +4013,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3528 +#: ../../library/os.rst:3529 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3531 +#: ../../library/os.rst:3532 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -4024,27 +4026,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.symlink``。" -#: ../../library/os.rst:3541 +#: ../../library/os.rst:3542 msgid "" "Added the *dir_fd* parameter, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3548 +#: ../../library/os.rst:3549 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3554 +#: ../../library/os.rst:3555 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3563 +#: ../../library/os.rst:3564 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3568 +#: ../../library/os.rst:3569 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -4052,46 +4054,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:3583 +#: ../../library/os.rst:3584 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: ../../library/os.rst:3599 +#: ../../library/os.rst:3600 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3601 +#: ../../library/os.rst:3602 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: ../../library/os.rst:3604 +#: ../../library/os.rst:3605 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: ../../library/os.rst:3607 +#: ../../library/os.rst:3608 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: ../../library/os.rst:3610 +#: ../../library/os.rst:3611 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: ../../library/os.rst:3614 +#: ../../library/os.rst:3615 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3616 +#: ../../library/os.rst:3617 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -4101,7 +4103,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3627 +#: ../../library/os.rst:3628 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -4109,13 +4111,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.utime``。" -#: ../../library/os.rst:3629 +#: ../../library/os.rst:3630 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3643 +#: ../../library/os.rst:3644 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -4123,7 +4125,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3648 +#: ../../library/os.rst:3649 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -4137,7 +4139,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3659 +#: ../../library/os.rst:3660 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -4148,7 +4150,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3667 +#: ../../library/os.rst:3668 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -4161,7 +4163,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3676 +#: ../../library/os.rst:3677 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -4171,35 +4173,35 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3682 +#: ../../library/os.rst:3683 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3688 +#: ../../library/os.rst:3689 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3694 +#: ../../library/os.rst:3695 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3698 ../../library/os.rst:3760 +#: ../../library/os.rst:3699 ../../library/os.rst:3761 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any ``__pycache__`` subdirectory::" msgstr "" -#: ../../library/os.rst:3702 +#: ../../library/os.rst:3703 msgid "" "import os\n" "from os.path import join, getsize\n" @@ -4219,14 +4221,14 @@ msgstr "" " if '__pycache__' in dirs:\n" " dirs.remove('__pycache__') # don't visit __pycache__ directories" -#: ../../library/os.rst:3711 +#: ../../library/os.rst:3712 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3715 +#: ../../library/os.rst:3716 msgid "" "# Delete everything reachable from the directory named in \"top\",\n" "# assuming there are no symbolic links.\n" @@ -4241,7 +4243,7 @@ msgid "" "os.rmdir(top)" msgstr "" -#: ../../library/os.rst:3727 +#: ../../library/os.rst:3728 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -4249,25 +4251,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3729 +#: ../../library/os.rst:3730 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3743 +#: ../../library/os.rst:3744 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3746 +#: ../../library/os.rst:3747 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3749 +#: ../../library/os.rst:3750 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -4275,14 +4277,14 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3756 +#: ../../library/os.rst:3757 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3764 +#: ../../library/os.rst:3765 msgid "" "import os\n" "for root, dirs, files, rootfd in os.fwalk('python/Lib/xml'):\n" @@ -4294,13 +4296,13 @@ msgid "" " dirs.remove('__pycache__') # don't visit __pycache__ directories" msgstr "" -#: ../../library/os.rst:3773 +#: ../../library/os.rst:3774 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3777 +#: ../../library/os.rst:3778 msgid "" "# Delete everything reachable from the directory named in \"top\",\n" "# assuming there are no symbolic links.\n" @@ -4314,7 +4316,7 @@ msgid "" " os.rmdir(name, dir_fd=rootfd)" msgstr "" -#: ../../library/os.rst:3788 +#: ../../library/os.rst:3789 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -4322,11 +4324,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3797 +#: ../../library/os.rst:3798 msgid "Added support for :class:`bytes` paths." msgstr "新增對 :class:`bytes` 路徑的支援。" -#: ../../library/os.rst:3803 +#: ../../library/os.rst:3804 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -4334,7 +4336,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3808 +#: ../../library/os.rst:3809 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -4344,15 +4346,15 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3838 +#: ../../library/os.rst:3839 msgid "These flags can be passed to :func:`memfd_create`." msgstr "這些旗標可以傳給 :func:`memfd_create`。" -#: ../../library/os.rst:3842 +#: ../../library/os.rst:3843 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "``MFD_HUGE*`` 旗標僅在 Linux 4.14 以上可用。" -#: ../../library/os.rst:3849 +#: ../../library/os.rst:3850 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -4361,7 +4363,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3855 +#: ../../library/os.rst:3856 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be a 32 bit unsigned integer. Please note that the initial value is limited " @@ -4369,39 +4371,39 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3860 +#: ../../library/os.rst:3861 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3863 +#: ../../library/os.rst:3864 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3866 +#: ../../library/os.rst:3867 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3870 +#: ../../library/os.rst:3871 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3873 +#: ../../library/os.rst:3874 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3879 +#: ../../library/os.rst:3880 msgid "" "import os\n" "\n" @@ -4419,64 +4421,64 @@ msgid "" " os.close(fd)" msgstr "" -#: ../../library/os.rst:3900 +#: ../../library/os.rst:3901 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3909 +#: ../../library/os.rst:3910 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3918 +#: ../../library/os.rst:3919 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3926 +#: ../../library/os.rst:3927 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "設定新的 :func:`eventfd` 檔案描述器的 :const:`O_NONBLOCK` 狀態旗標。" -#: ../../library/os.rst:3935 +#: ../../library/os.rst:3936 msgid "" "Provide semaphore-like semantics for reads from an :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3946 +#: ../../library/os.rst:3947 msgid "Timer File Descriptors" msgstr "計時器檔案描述器" -#: ../../library/os.rst:3950 +#: ../../library/os.rst:3951 msgid "" "These functions provide support for Linux's *timer file descriptor* API. " "Naturally, they are all only available on Linux." msgstr "" -#: ../../library/os.rst:3955 +#: ../../library/os.rst:3956 msgid "Create and return a timer file descriptor (*timerfd*)." msgstr "" -#: ../../library/os.rst:3957 +#: ../../library/os.rst:3958 msgid "The file descriptor returned by :func:`timerfd_create` supports:" msgstr "" -#: ../../library/os.rst:3959 +#: ../../library/os.rst:3960 msgid ":func:`read`" msgstr ":func:`read`" -#: ../../library/os.rst:3960 +#: ../../library/os.rst:3961 msgid ":func:`~select.select`" msgstr ":func:`~select.select`" -#: ../../library/os.rst:3961 +#: ../../library/os.rst:3962 msgid ":func:`~select.poll`" msgstr ":func:`~select.poll`" -#: ../../library/os.rst:3963 +#: ../../library/os.rst:3964 msgid "" "The file descriptor's :func:`read` method can be called with a buffer size " "of 8. If the timer has already expired one or more times, :func:`read` " @@ -4485,31 +4487,31 @@ msgid "" "byteorder)``." msgstr "" -#: ../../library/os.rst:3968 +#: ../../library/os.rst:3969 msgid "" ":func:`~select.select` and :func:`~select.poll` can be used to wait until " "timer expires and the file descriptor is readable." msgstr "" -#: ../../library/os.rst:3971 +#: ../../library/os.rst:3972 msgid "" "*clockid* must be a valid :ref:`clock ID `, as " "defined in the :py:mod:`time` module:" msgstr "" -#: ../../library/os.rst:3974 +#: ../../library/os.rst:3975 msgid ":const:`time.CLOCK_REALTIME`" msgstr ":const:`time.CLOCK_REALTIME`" -#: ../../library/os.rst:3975 +#: ../../library/os.rst:3976 msgid ":const:`time.CLOCK_MONOTONIC`" msgstr ":const:`time.CLOCK_MONOTONIC`" -#: ../../library/os.rst:3976 +#: ../../library/os.rst:3977 msgid ":const:`time.CLOCK_BOOTTIME` (Since Linux 3.15 for timerfd_create)" msgstr "" -#: ../../library/os.rst:3978 +#: ../../library/os.rst:3979 msgid "" "If *clockid* is :const:`time.CLOCK_REALTIME`, a settable system-wide real-" "time clock is used. If system clock is changed, timer setting need to be " @@ -4517,35 +4519,35 @@ msgid "" "`TFD_TIMER_CANCEL_ON_SET`." msgstr "" -#: ../../library/os.rst:3983 +#: ../../library/os.rst:3984 msgid "" "If *clockid* is :const:`time.CLOCK_MONOTONIC`, a non-settable monotonically " "increasing clock is used. Even if the system clock is changed, the timer " "setting will not be affected." msgstr "" -#: ../../library/os.rst:3987 +#: ../../library/os.rst:3988 msgid "" "If *clockid* is :const:`time.CLOCK_BOOTTIME`, same as :const:`time." "CLOCK_MONOTONIC` except it includes any time that the system is suspended." msgstr "" -#: ../../library/os.rst:3990 +#: ../../library/os.rst:3991 msgid "" "The file descriptor's behaviour can be modified by specifying a *flags* " "value. Any of the following variables may used, combined using bitwise OR " "(the ``|`` operator):" msgstr "" -#: ../../library/os.rst:3994 +#: ../../library/os.rst:3995 msgid ":const:`TFD_NONBLOCK`" msgstr ":const:`TFD_NONBLOCK`" -#: ../../library/os.rst:3995 +#: ../../library/os.rst:3996 msgid ":const:`TFD_CLOEXEC`" msgstr ":const:`TFD_CLOEXEC`" -#: ../../library/os.rst:3997 +#: ../../library/os.rst:3998 msgid "" "If :const:`TFD_NONBLOCK` is not set as a flag, :func:`read` blocks until the " "timer expires. If it is set as a flag, :func:`read` doesn't block, but If " @@ -4553,46 +4555,46 @@ msgid "" "raises :class:`OSError` with ``errno`` is set to :const:`errno.EAGAIN`." msgstr "" -#: ../../library/os.rst:4003 +#: ../../library/os.rst:4004 msgid ":const:`TFD_CLOEXEC` is always set by Python automatically." msgstr ":const:`TFD_CLOEXEC` 總是由 Python 自動設定。" -#: ../../library/os.rst:4005 +#: ../../library/os.rst:4006 msgid "" "The file descriptor must be closed with :func:`os.close` when it is no " "longer needed, or else the file descriptor will be leaked." msgstr "" -#: ../../library/os.rst:4008 +#: ../../library/os.rst:4009 msgid "The :manpage:`timerfd_create(2)` man page." msgstr ":manpage:`timerfd_create(2)` 使用手冊。" -#: ../../library/os.rst:4017 +#: ../../library/os.rst:4018 msgid "" "Alter a timer file descriptor's internal timer. This function operates the " "same interval timer as :func:`timerfd_settime_ns`." msgstr "" -#: ../../library/os.rst:4020 +#: ../../library/os.rst:4021 msgid "*fd* must be a valid timer file descriptor." msgstr "*fd* 必須是有效的計時器檔案描述器。" -#: ../../library/os.rst:4022 +#: ../../library/os.rst:4023 msgid "" "The timer's behaviour can be modified by specifying a *flags* value. Any of " "the following variables may used, combined using bitwise OR (the ``|`` " "operator):" msgstr "" -#: ../../library/os.rst:4026 +#: ../../library/os.rst:4027 msgid ":const:`TFD_TIMER_ABSTIME`" msgstr ":const:`TFD_TIMER_ABSTIME`" -#: ../../library/os.rst:4027 +#: ../../library/os.rst:4028 msgid ":const:`TFD_TIMER_CANCEL_ON_SET`" msgstr ":const:`TFD_TIMER_CANCEL_ON_SET`" -#: ../../library/os.rst:4029 +#: ../../library/os.rst:4030 msgid "" "The timer is disabled by setting *initial* to zero (``0``). If *initial* is " "equal to or greater than zero, the timer is enabled. If *initial* is less " @@ -4600,20 +4602,20 @@ msgid "" "const:`errno.EINVAL`" msgstr "" -#: ../../library/os.rst:4034 +#: ../../library/os.rst:4035 msgid "" "By default the timer will fire when *initial* seconds have elapsed. (If " "*initial* is zero, timer will fire immediately.)" msgstr "" -#: ../../library/os.rst:4037 +#: ../../library/os.rst:4038 msgid "" "However, if the :const:`TFD_TIMER_ABSTIME` flag is set, the timer will fire " "when the timer's clock (set by *clockid* in :func:`timerfd_create`) reaches " "*initial* seconds." msgstr "" -#: ../../library/os.rst:4041 +#: ../../library/os.rst:4042 msgid "" "The timer's interval is set by the *interval* :py:class:`float`. If " "*interval* is zero, the timer only fires once, on the initial expiration. If " @@ -4623,7 +4625,7 @@ msgid "" "EINVAL`" msgstr "" -#: ../../library/os.rst:4048 +#: ../../library/os.rst:4049 msgid "" "If the :const:`TFD_TIMER_CANCEL_ON_SET` flag is set along with :const:" "`TFD_TIMER_ABSTIME` and the clock for this timer is :const:`time." @@ -4632,86 +4634,86 @@ msgid "" "ECANCELED." msgstr "" -#: ../../library/os.rst:4054 +#: ../../library/os.rst:4055 msgid "" "Linux manages system clock as UTC. A daylight-savings time transition is " "done by changing time offset only and doesn't cause discontinuous system " "clock change." msgstr "" -#: ../../library/os.rst:4058 +#: ../../library/os.rst:4059 msgid "" "Discontinuous system clock change will be caused by the following events:" msgstr "" -#: ../../library/os.rst:4060 +#: ../../library/os.rst:4061 msgid "``settimeofday``" msgstr "``settimeofday``" -#: ../../library/os.rst:4061 +#: ../../library/os.rst:4062 msgid "``clock_settime``" msgstr "``clock_settime``" -#: ../../library/os.rst:4062 +#: ../../library/os.rst:4063 msgid "set the system date and time by ``date`` command" msgstr "" -#: ../../library/os.rst:4064 +#: ../../library/os.rst:4065 msgid "" "Return a two-item tuple of (``next_expiration``, ``interval``) from the " "previous timer state, before this function executed." msgstr "" -#: ../../library/os.rst:4069 +#: ../../library/os.rst:4070 msgid "" ":manpage:`timerfd_create(2)`, :manpage:`timerfd_settime(2)`, :manpage:" "`settimeofday(2)`, :manpage:`clock_settime(2)`, and :manpage:`date(1)`." msgstr "" -#: ../../library/os.rst:4080 +#: ../../library/os.rst:4081 msgid "" "Similar to :func:`timerfd_settime`, but use time as nanoseconds. This " "function operates the same interval timer as :func:`timerfd_settime`." msgstr "" -#: ../../library/os.rst:4090 +#: ../../library/os.rst:4091 msgid "Return a two-item tuple of floats (``next_expiration``, ``interval``)." msgstr "" -#: ../../library/os.rst:4092 +#: ../../library/os.rst:4093 msgid "" "``next_expiration`` denotes the relative time until next the timer next " "fires, regardless of if the :const:`TFD_TIMER_ABSTIME` flag is set." msgstr "" -#: ../../library/os.rst:4095 +#: ../../library/os.rst:4096 msgid "" "``interval`` denotes the timer's interval. If zero, the timer will only fire " "once, after ``next_expiration`` seconds have elapsed." msgstr "" -#: ../../library/os.rst:4099 +#: ../../library/os.rst:4100 msgid ":manpage:`timerfd_gettime(2)`" msgstr ":manpage:`timerfd_gettime(2)`" -#: ../../library/os.rst:4108 +#: ../../library/os.rst:4109 msgid "Similar to :func:`timerfd_gettime`, but return time as nanoseconds." msgstr "" -#: ../../library/os.rst:4116 +#: ../../library/os.rst:4117 msgid "" "A flag for the :func:`timerfd_create` function, which sets the :const:" "`O_NONBLOCK` status flag for the new timer file descriptor. If :const:" "`TFD_NONBLOCK` is not set as a flag, :func:`read` blocks." msgstr "" -#: ../../library/os.rst:4126 +#: ../../library/os.rst:4127 msgid "" "A flag for the :func:`timerfd_create` function, If :const:`TFD_CLOEXEC` is " "set as a flag, set close-on-exec flag for new file descriptor." msgstr "" -#: ../../library/os.rst:4136 +#: ../../library/os.rst:4137 msgid "" "A flag for the :func:`timerfd_settime` and :func:`timerfd_settime_ns` " "functions. If this flag is set, *initial* is interpreted as an absolute " @@ -4719,22 +4721,22 @@ msgid "" "Epoch)." msgstr "" -#: ../../library/os.rst:4146 +#: ../../library/os.rst:4147 msgid "" "A flag for the :func:`timerfd_settime` and :func:`timerfd_settime_ns` " "functions along with :const:`TFD_TIMER_ABSTIME`. The timer is cancelled when " "the time of the underlying clock changes discontinuously." msgstr "" -#: ../../library/os.rst:4157 +#: ../../library/os.rst:4158 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:4161 +#: ../../library/os.rst:4162 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:4165 +#: ../../library/os.rst:4166 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4742,7 +4744,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:4173 +#: ../../library/os.rst:4174 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4750,12 +4752,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:4175 ../../library/os.rst:4207 -#: ../../library/os.rst:4232 +#: ../../library/os.rst:4176 ../../library/os.rst:4208 +#: ../../library/os.rst:4233 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:4181 +#: ../../library/os.rst:4182 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4763,14 +4765,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:4189 +#: ../../library/os.rst:4190 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:4197 +#: ../../library/os.rst:4198 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4778,7 +4780,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:4205 +#: ../../library/os.rst:4206 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4786,7 +4788,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:4213 +#: ../../library/os.rst:4214 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4798,13 +4800,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:4227 +#: ../../library/os.rst:4228 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:4230 +#: ../../library/os.rst:4231 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4812,33 +4814,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:4238 +#: ../../library/os.rst:4239 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:4244 +#: ../../library/os.rst:4245 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:4250 +#: ../../library/os.rst:4251 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:4257 +#: ../../library/os.rst:4258 msgid "Process Management" msgstr "行程管理" -#: ../../library/os.rst:4259 +#: ../../library/os.rst:4260 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:4261 +#: ../../library/os.rst:4262 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -4849,7 +4851,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:4272 +#: ../../library/os.rst:4273 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -4858,31 +4860,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:4281 +#: ../../library/os.rst:4282 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:4283 +#: ../../library/os.rst:4284 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: ../../library/os.rst:4287 +#: ../../library/os.rst:4288 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:4290 +#: ../../library/os.rst:4291 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:4294 +#: ../../library/os.rst:4295 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -4890,7 +4892,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:4298 +#: ../../library/os.rst:4299 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4898,14 +4900,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:4305 +#: ../../library/os.rst:4306 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:4320 +#: ../../library/os.rst:4321 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -4913,7 +4915,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:4325 +#: ../../library/os.rst:4326 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -4921,7 +4923,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:4331 +#: ../../library/os.rst:4332 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4934,7 +4936,7 @@ msgid "" "is not enforced." msgstr "" -#: ../../library/os.rst:4340 +#: ../../library/os.rst:4341 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4948,7 +4950,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:4351 +#: ../../library/os.rst:4352 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4958,7 +4960,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:4358 +#: ../../library/os.rst:4359 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -4967,7 +4969,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:4363 +#: ../../library/os.rst:4364 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4975,25 +4977,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:4367 +#: ../../library/os.rst:4368 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4376 +#: ../../library/os.rst:4377 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:4381 +#: ../../library/os.rst:4382 msgid "" "The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:4384 +#: ../../library/os.rst:4385 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -5001,139 +5003,139 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:4390 +#: ../../library/os.rst:4391 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:4397 +#: ../../library/os.rst:4398 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:4405 +#: ../../library/os.rst:4406 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:4413 +#: ../../library/os.rst:4414 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4420 +#: ../../library/os.rst:4421 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4427 +#: ../../library/os.rst:4428 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4434 +#: ../../library/os.rst:4435 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4441 +#: ../../library/os.rst:4442 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4448 +#: ../../library/os.rst:4449 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4455 +#: ../../library/os.rst:4456 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:4463 +#: ../../library/os.rst:4464 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:4471 +#: ../../library/os.rst:4472 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4478 +#: ../../library/os.rst:4479 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4485 +#: ../../library/os.rst:4486 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:4494 +#: ../../library/os.rst:4495 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4502 +#: ../../library/os.rst:4503 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:4510 +#: ../../library/os.rst:4511 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4517 +#: ../../library/os.rst:4518 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4524 +#: ../../library/os.rst:4525 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4527 +#: ../../library/os.rst:4528 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4530 +#: ../../library/os.rst:4531 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4534 +#: ../../library/os.rst:4535 msgid "" "If you use TLS sockets in an application calling ``fork()``, see the warning " "in the :mod:`ssl` documentation." msgstr "" -#: ../../library/os.rst:4539 ../../library/os.rst:4583 +#: ../../library/os.rst:4540 ../../library/os.rst:4584 msgid "" "On macOS the use of this function is unsafe when mixed with using higher-" "level system APIs, and that includes using :mod:`urllib.request`." msgstr "" -#: ../../library/os.rst:4542 +#: ../../library/os.rst:4543 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4546 +#: ../../library/os.rst:4547 msgid "" "If Python is able to detect that your process has multiple threads, :func:" "`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" -#: ../../library/os.rst:4550 +#: ../../library/os.rst:4551 msgid "" "We chose to surface this as a warning, when detectable, to better inform " "developers of a design problem that the POSIX platform specifically notes as " @@ -5144,21 +5146,21 @@ msgid "" "``free``)." msgstr "" -#: ../../library/os.rst:4559 +#: ../../library/os.rst:4560 msgid "" "Users of macOS or users of libc or malloc implementations other than those " "typically found in glibc to date are among those already more likely to " "experience deadlocks running such code." msgstr "" -#: ../../library/os.rst:4563 +#: ../../library/os.rst:4564 msgid "" "See `this discussion on fork being incompatible with threads `_ for technical details of why we're surfacing " "this longstanding platform compatibility problem to developers." msgstr "" -#: ../../library/os.rst:4573 +#: ../../library/os.rst:4574 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -5167,31 +5169,31 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4579 +#: ../../library/os.rst:4580 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4586 +#: ../../library/os.rst:4587 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4590 +#: ../../library/os.rst:4591 msgid "" "If Python is able to detect that your process has multiple threads, this now " "raises a :exc:`DeprecationWarning`. See the longer explanation on :func:`os." "fork`." msgstr "" -#: ../../library/os.rst:4604 +#: ../../library/os.rst:4605 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:4607 +#: ../../library/os.rst:4608 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -5201,11 +5203,11 @@ msgid "" "be set to *sig*." msgstr "" -#: ../../library/os.rst:4614 +#: ../../library/os.rst:4615 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`。" -#: ../../library/os.rst:4616 +#: ../../library/os.rst:4617 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -5213,11 +5215,11 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4630 +#: ../../library/os.rst:4631 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4632 +#: ../../library/os.rst:4633 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -5225,23 +5227,23 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4639 +#: ../../library/os.rst:4640 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4646 +#: ../../library/os.rst:4647 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4650 +#: ../../library/os.rst:4651 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 使用手冊。" -#: ../../library/os.rst:4657 +#: ../../library/os.rst:4658 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -5249,13 +5251,13 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4668 +#: ../../library/os.rst:4669 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4676 +#: ../../library/os.rst:4677 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -5265,7 +5267,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4684 +#: ../../library/os.rst:4685 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -5277,63 +5279,63 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4694 +#: ../../library/os.rst:4695 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:4699 +#: ../../library/os.rst:4700 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:4706 +#: ../../library/os.rst:4707 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4709 +#: ../../library/os.rst:4710 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4713 +#: ../../library/os.rst:4714 msgid "" "The function is :term:`soft deprecated` and should no longer be used to " "write new code. The :mod:`subprocess` module is recommended instead." msgstr "" -#: ../../library/os.rst:4722 +#: ../../library/os.rst:4723 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4724 +#: ../../library/os.rst:4725 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4726 +#: ../../library/os.rst:4727 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`. *env* is allowed to be ``None``, in which case current process' " "environment is used." msgstr "" -#: ../../library/os.rst:4730 +#: ../../library/os.rst:4731 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:4734 +#: ../../library/os.rst:4735 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -5342,39 +5344,39 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4742 +#: ../../library/os.rst:4743 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4744 +#: ../../library/os.rst:4745 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4748 +#: ../../library/os.rst:4749 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4750 +#: ../../library/os.rst:4751 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4754 +#: ../../library/os.rst:4755 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4756 +#: ../../library/os.rst:4757 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4760 +#: ../../library/os.rst:4761 msgid "(``os.POSIX_SPAWN_CLOSEFROM``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSEFROM``, *fd*)" -#: ../../library/os.rst:4762 +#: ../../library/os.rst:4763 msgid "Performs ``os.closerange(fd, INF)``." msgstr "" -#: ../../library/os.rst:4764 +#: ../../library/os.rst:4765 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -5384,7 +5386,7 @@ msgid "" "c:func:`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4771 +#: ../../library/os.rst:4772 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -5393,7 +5395,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4777 +#: ../../library/os.rst:4778 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -5404,7 +5406,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4785 +#: ../../library/os.rst:4786 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -5412,7 +5414,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4790 +#: ../../library/os.rst:4791 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -5420,14 +5422,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4795 +#: ../../library/os.rst:4796 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4799 +#: ../../library/os.rst:4800 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -5437,7 +5439,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4806 ../../library/os.rst:4827 +#: ../../library/os.rst:4807 ../../library/os.rst:4828 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -5445,79 +5447,79 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4810 +#: ../../library/os.rst:4811 msgid "" "*env* parameter accepts ``None``. ``os.POSIX_SPAWN_CLOSEFROM`` is available " "on platforms where :c:func:`!posix_spawn_file_actions_addclosefrom_np` " "exists." msgstr "" -#: ../../library/os.rst:4821 +#: ../../library/os.rst:4822 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4823 +#: ../../library/os.rst:4824 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4833 +#: ../../library/os.rst:4834 msgid "See :func:`posix_spawn` documentation." msgstr "見 :func:`posix_spawn` 文件。" -#: ../../library/os.rst:4839 +#: ../../library/os.rst:4840 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4844 +#: ../../library/os.rst:4845 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4845 +#: ../../library/os.rst:4846 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4847 +#: ../../library/os.rst:4848 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4849 +#: ../../library/os.rst:4850 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4853 +#: ../../library/os.rst:4854 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4858 +#: ../../library/os.rst:4859 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4862 +#: ../../library/os.rst:4863 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4878 +#: ../../library/os.rst:4879 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4880 +#: ../../library/os.rst:4881 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -5525,7 +5527,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4885 +#: ../../library/os.rst:4886 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -5534,13 +5536,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4891 +#: ../../library/os.rst:4892 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4894 +#: ../../library/os.rst:4895 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -5552,7 +5554,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4903 +#: ../../library/os.rst:4904 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -5565,7 +5567,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4913 +#: ../../library/os.rst:4914 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -5577,13 +5579,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4922 +#: ../../library/os.rst:4923 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4925 +#: ../../library/os.rst:4926 msgid "" "import os\n" "os.spawnlp(os.P_WAIT, 'cp', 'cp', 'index.html', '/dev/null')\n" @@ -5597,7 +5599,7 @@ msgstr "" "L = ['cp', 'index.html', '/dev/null']\n" "os.spawnvpe(os.P_WAIT, 'cp', L, os.environ)" -#: ../../library/os.rst:4931 +#: ../../library/os.rst:4932 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -5605,7 +5607,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4935 +#: ../../library/os.rst:4936 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -5613,13 +5615,13 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4943 +#: ../../library/os.rst:4944 msgid "" "These functions are :term:`soft deprecated` and should no longer be used to " "write new code. The :mod:`subprocess` module is recommended instead." msgstr "" -#: ../../library/os.rst:4951 +#: ../../library/os.rst:4952 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -5627,7 +5629,7 @@ msgid "" "been created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4961 +#: ../../library/os.rst:4962 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\* " @@ -5636,7 +5638,7 @@ msgid "" "successful, or ``-signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4973 +#: ../../library/os.rst:4974 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -5646,11 +5648,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4984 +#: ../../library/os.rst:4985 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4986 +#: ../../library/os.rst:4987 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -5658,7 +5660,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4991 +#: ../../library/os.rst:4992 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -5666,28 +5668,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4996 +#: ../../library/os.rst:4997 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:5000 +#: ../../library/os.rst:5001 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:5004 +#: ../../library/os.rst:5005 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`!ShellExecute` function." msgstr "" -#: ../../library/os.rst:5008 +#: ../../library/os.rst:5009 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -5698,14 +5700,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:5016 +#: ../../library/os.rst:5017 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:5020 +#: ../../library/os.rst:5021 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5713,7 +5715,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:5022 +#: ../../library/os.rst:5023 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5721,13 +5723,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:5026 +#: ../../library/os.rst:5027 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:5033 +#: ../../library/os.rst:5034 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -5738,13 +5740,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:5041 +#: ../../library/os.rst:5042 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:5044 +#: ../../library/os.rst:5045 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -5753,7 +5755,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:5050 +#: ../../library/os.rst:5051 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is recommended " @@ -5761,54 +5763,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:5055 +#: ../../library/os.rst:5056 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:5059 +#: ../../library/os.rst:5060 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:5066 +#: ../../library/os.rst:5067 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:5069 +#: ../../library/os.rst:5070 msgid ":attr:`!user` - user time" msgstr ":attr:`!user` - 使用者時間" -#: ../../library/os.rst:5070 +#: ../../library/os.rst:5071 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:5071 +#: ../../library/os.rst:5072 msgid ":attr:`!children_user` - user time of all child processes" msgstr ":attr:`!children_user` - 所有子行程的使用者時間" -#: ../../library/os.rst:5072 +#: ../../library/os.rst:5073 msgid ":attr:`!children_system` - system time of all child processes" msgstr ":attr:`!children_system` - 所有子行程的系統時間" -#: ../../library/os.rst:5073 +#: ../../library/os.rst:5074 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:5075 +#: ../../library/os.rst:5076 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:5079 +#: ../../library/os.rst:5080 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5818,7 +5820,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:5093 +#: ../../library/os.rst:5094 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5827,87 +5829,87 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:5099 +#: ../../library/os.rst:5100 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:5102 ../../library/os.rst:5177 +#: ../../library/os.rst:5103 ../../library/os.rst:5178 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:5109 +#: ../../library/os.rst:5110 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:5116 +#: ../../library/os.rst:5117 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:5118 +#: ../../library/os.rst:5119 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:5121 +#: ../../library/os.rst:5122 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:5125 +#: ../../library/os.rst:5126 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:5128 +#: ../../library/os.rst:5129 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:5129 +#: ../../library/os.rst:5130 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:5130 +#: ../../library/os.rst:5131 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:5131 +#: ../../library/os.rst:5132 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:5132 +#: ../../library/os.rst:5133 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:5134 +#: ../../library/os.rst:5135 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:5143 +#: ../../library/os.rst:5144 msgid "This function is now available on macOS as well." msgstr "" -#: ../../library/os.rst:5149 +#: ../../library/os.rst:5150 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:5151 +#: ../../library/os.rst:5152 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -5916,7 +5918,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:5156 +#: ../../library/os.rst:5157 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -5926,7 +5928,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:5163 +#: ../../library/os.rst:5164 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5935,7 +5937,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:5169 +#: ../../library/os.rst:5170 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -5947,7 +5949,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:5190 +#: ../../library/os.rst:5191 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -5956,13 +5958,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:5197 ../../library/os.rst:5211 +#: ../../library/os.rst:5198 ../../library/os.rst:5212 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:5205 +#: ../../library/os.rst:5206 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5971,118 +5973,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:5222 +#: ../../library/os.rst:5223 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:5225 +#: ../../library/os.rst:5226 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:5226 +#: ../../library/os.rst:5227 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:5227 +#: ../../library/os.rst:5228 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:5228 +#: ../../library/os.rst:5229 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:5233 +#: ../../library/os.rst:5234 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:5236 +#: ../../library/os.rst:5237 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:5242 +#: ../../library/os.rst:5243 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:5251 +#: ../../library/os.rst:5252 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:5254 +#: ../../library/os.rst:5255 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:5264 +#: ../../library/os.rst:5265 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:5267 ../../library/os.rst:5299 +#: ../../library/os.rst:5268 ../../library/os.rst:5300 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:5276 +#: ../../library/os.rst:5277 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:5280 +#: ../../library/os.rst:5281 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:5287 +#: ../../library/os.rst:5288 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:5296 +#: ../../library/os.rst:5297 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:5311 +#: ../../library/os.rst:5312 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:5318 +#: ../../library/os.rst:5319 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "新增 :data:`CLD_KILLED` 和 :data:`CLD_STOPPED` 值。" -#: ../../library/os.rst:5324 +#: ../../library/os.rst:5325 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:5326 +#: ../../library/os.rst:5327 msgid "On Unix:" msgstr "在 Unix 上:" -#: ../../library/os.rst:5328 +#: ../../library/os.rst:5329 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:5331 +#: ../../library/os.rst:5332 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -6090,15 +6092,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:5335 +#: ../../library/os.rst:5336 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "否則,引發 :exc:`ValueError`。" -#: ../../library/os.rst:5337 +#: ../../library/os.rst:5338 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:5339 +#: ../../library/os.rst:5340 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -6106,234 +6108,234 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:5346 +#: ../../library/os.rst:5347 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:5354 +#: ../../library/os.rst:5355 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:5360 +#: ../../library/os.rst:5361 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:5363 ../../library/os.rst:5429 +#: ../../library/os.rst:5364 ../../library/os.rst:5430 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:5370 +#: ../../library/os.rst:5371 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:5374 +#: ../../library/os.rst:5375 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:5381 +#: ../../library/os.rst:5382 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:5384 +#: ../../library/os.rst:5385 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:5392 +#: ../../library/os.rst:5393 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:5400 +#: ../../library/os.rst:5401 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:5409 +#: ../../library/os.rst:5410 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:5411 +#: ../../library/os.rst:5412 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:5418 +#: ../../library/os.rst:5419 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:5420 +#: ../../library/os.rst:5421 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:5427 +#: ../../library/os.rst:5428 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5435 +#: ../../library/os.rst:5436 msgid "Interface to the scheduler" msgstr "排程器介面" -#: ../../library/os.rst:5437 +#: ../../library/os.rst:5438 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:5443 +#: ../../library/os.rst:5444 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5450 +#: ../../library/os.rst:5451 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5454 +#: ../../library/os.rst:5455 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5459 +#: ../../library/os.rst:5460 msgid "Scheduling policy for tasks with deadline constraints." msgstr "" -#: ../../library/os.rst:5465 +#: ../../library/os.rst:5466 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5469 +#: ../../library/os.rst:5470 msgid "Alias for :data:`SCHED_OTHER`." msgstr "" -#: ../../library/os.rst:5475 +#: ../../library/os.rst:5476 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5479 +#: ../../library/os.rst:5480 msgid "A First In First Out scheduling policy." msgstr "先進先出排程策略。" -#: ../../library/os.rst:5483 +#: ../../library/os.rst:5484 msgid "A round-robin scheduling policy." msgstr "輪轉排程策略。" -#: ../../library/os.rst:5487 +#: ../../library/os.rst:5488 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:5494 +#: ../../library/os.rst:5495 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:5498 +#: ../../library/os.rst:5499 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5502 +#: ../../library/os.rst:5503 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5507 +#: ../../library/os.rst:5508 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5513 +#: ../../library/os.rst:5514 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5519 +#: ../../library/os.rst:5520 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5526 +#: ../../library/os.rst:5527 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:5533 +#: ../../library/os.rst:5534 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5539 +#: ../../library/os.rst:5540 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5545 +#: ../../library/os.rst:5546 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5551 +#: ../../library/os.rst:5552 msgid "" "Voluntarily relinquish the CPU. See :manpage:`sched_yield(2)` for details." msgstr "" -#: ../../library/os.rst:5556 +#: ../../library/os.rst:5557 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:5563 +#: ../../library/os.rst:5564 msgid "Return the set of CPUs the process with PID *pid* is restricted to." msgstr "" -#: ../../library/os.rst:5565 +#: ../../library/os.rst:5566 msgid "" "If *pid* is zero, return the set of CPUs the calling thread of the current " "process is restricted to." msgstr "" -#: ../../library/os.rst:5568 +#: ../../library/os.rst:5569 msgid "See also the :func:`process_cpu_count` function." msgstr "也請見 :func:`process_cpu_count` 函式。" -#: ../../library/os.rst:5574 +#: ../../library/os.rst:5575 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5579 +#: ../../library/os.rst:5580 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -6344,13 +6346,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5587 +#: ../../library/os.rst:5588 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5590 +#: ../../library/os.rst:5591 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -6358,62 +6360,62 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5600 +#: ../../library/os.rst:5601 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5609 +#: ../../library/os.rst:5610 msgid "" "Return the number of logical CPUs in the **system**. Returns ``None`` if " "undetermined." msgstr "" -#: ../../library/os.rst:5612 +#: ../../library/os.rst:5613 msgid "" "The :func:`process_cpu_count` function can be used to get the number of " "logical CPUs usable by the calling thread of the **current process**." msgstr "" -#: ../../library/os.rst:5617 +#: ../../library/os.rst:5618 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " "set, :func:`cpu_count` returns the override value *n*." msgstr "" -#: ../../library/os.rst:5624 +#: ../../library/os.rst:5625 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:5633 +#: ../../library/os.rst:5634 msgid "" "Get the number of logical CPUs usable by the calling thread of the **current " "process**. Returns ``None`` if undetermined. It can be less than :func:" "`cpu_count` depending on the CPU affinity." msgstr "" -#: ../../library/os.rst:5637 +#: ../../library/os.rst:5638 msgid "" "The :func:`cpu_count` function can be used to get the number of logical CPUs " "in the **system**." msgstr "" -#: ../../library/os.rst:5640 +#: ../../library/os.rst:5641 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " "set, :func:`process_cpu_count` returns the override value *n*." msgstr "" -#: ../../library/os.rst:5643 +#: ../../library/os.rst:5644 msgid "See also the :func:`sched_getaffinity` function." msgstr "也請見 :func:`sched_getaffinity` 函式。" -#: ../../library/os.rst:5650 +#: ../../library/os.rst:5651 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -6422,44 +6424,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5660 +#: ../../library/os.rst:5661 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5666 +#: ../../library/os.rst:5667 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5669 +#: ../../library/os.rst:5670 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5672 +#: ../../library/os.rst:5673 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5678 +#: ../../library/os.rst:5679 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5686 +#: ../../library/os.rst:5687 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5695 +#: ../../library/os.rst:5696 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -6468,7 +6470,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5705 +#: ../../library/os.rst:5706 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -6476,27 +6478,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5714 +#: ../../library/os.rst:5715 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5722 +#: ../../library/os.rst:5723 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5729 +#: ../../library/os.rst:5730 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5736 +#: ../../library/os.rst:5737 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -6505,36 +6507,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5745 +#: ../../library/os.rst:5746 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5756 +#: ../../library/os.rst:5757 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:5764 +#: ../../library/os.rst:5765 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5769 +#: ../../library/os.rst:5770 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5772 +#: ../../library/os.rst:5773 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5775 +#: ../../library/os.rst:5776 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -6542,32 +6544,32 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5780 +#: ../../library/os.rst:5781 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5784 +#: ../../library/os.rst:5785 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5793 +#: ../../library/os.rst:5794 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5795 +#: ../../library/os.rst:5796 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:5799 +#: ../../library/os.rst:5800 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -6577,63 +6579,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5806 +#: ../../library/os.rst:5807 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:5810 +#: ../../library/os.rst:5811 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5813 +#: ../../library/os.rst:5814 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:5817 +#: ../../library/os.rst:5818 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:5823 +#: ../../library/os.rst:5824 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:5827 +#: ../../library/os.rst:5828 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5831 +#: ../../library/os.rst:5832 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5837 +#: ../../library/os.rst:5838 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:5841 +#: ../../library/os.rst:5842 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:5848 +#: ../../library/os.rst:5849 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -6649,7 +6651,7 @@ msgstr "" #: ../../library/os.rst:395 ../../library/os.rst:461 ../../library/os.rst:470 #: ../../library/os.rst:479 ../../library/os.rst:493 ../../library/os.rst:691 -#: ../../library/os.rst:4600 ../../library/os.rst:4626 +#: ../../library/os.rst:4601 ../../library/os.rst:4627 msgid "process" msgstr "process" @@ -6689,11 +6691,11 @@ msgstr "gethostname()(於 socket 模組)" msgid "gethostbyaddr() (in module socket)" msgstr "gethostbyaddr()(於 socket 模組)" -#: ../../library/os.rst:826 ../../library/os.rst:2732 +#: ../../library/os.rst:826 ../../library/os.rst:2733 msgid "deleting" msgstr "deleting(刪除)" -#: ../../library/os.rst:1387 ../../library/os.rst:3102 +#: ../../library/os.rst:1387 ../../library/os.rst:3103 msgid "module" msgstr "module(模組)" @@ -6701,82 +6703,82 @@ msgstr "module(模組)" msgid "pty" msgstr "pty" -#: ../../library/os.rst:2118 ../../library/os.rst:2531 -#: ../../library/os.rst:2732 ../../library/os.rst:3639 -#: ../../library/os.rst:3739 +#: ../../library/os.rst:2119 ../../library/os.rst:2532 +#: ../../library/os.rst:2733 ../../library/os.rst:3640 +#: ../../library/os.rst:3740 msgid "directory" msgstr "directory(目錄)" -#: ../../library/os.rst:2118 +#: ../../library/os.rst:2119 msgid "changing" msgstr "changing(改變)" -#: ../../library/os.rst:2531 +#: ../../library/os.rst:2532 msgid "creating" msgstr "creating(建立)" -#: ../../library/os.rst:2531 +#: ../../library/os.rst:2532 msgid "UNC paths" msgstr "UNC paths(UNC 路徑)" -#: ../../library/os.rst:2531 +#: ../../library/os.rst:2532 msgid "and os.makedirs()" msgstr "以及 os.makedirs()" -#: ../../library/os.rst:3102 +#: ../../library/os.rst:3103 msgid "stat" msgstr "stat" -#: ../../library/os.rst:3639 ../../library/os.rst:3739 +#: ../../library/os.rst:3640 ../../library/os.rst:3740 msgid "walking" msgstr "" -#: ../../library/os.rst:3639 ../../library/os.rst:3739 +#: ../../library/os.rst:3640 ../../library/os.rst:3740 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4600 ../../library/os.rst:4626 +#: ../../library/os.rst:4601 ../../library/os.rst:4627 msgid "killing" msgstr "" -#: ../../library/os.rst:4600 ../../library/os.rst:4626 +#: ../../library/os.rst:4601 ../../library/os.rst:4627 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5675 ../../library/os.rst:5711 +#: ../../library/os.rst:5676 ../../library/os.rst:5712 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5675 ../../library/os.rst:5683 -#: ../../library/os.rst:5691 ../../library/os.rst:5702 -#: ../../library/os.rst:5711 +#: ../../library/os.rst:5676 ../../library/os.rst:5684 +#: ../../library/os.rst:5692 ../../library/os.rst:5703 +#: ../../library/os.rst:5712 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5683 +#: ../../library/os.rst:5684 msgid ".." msgstr ".." -#: ../../library/os.rst:5691 ../../library/os.rst:5702 +#: ../../library/os.rst:5692 ../../library/os.rst:5703 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5692 +#: ../../library/os.rst:5693 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5692 +#: ../../library/os.rst:5693 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5718 +#: ../../library/os.rst:5719 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5718 +#: ../../library/os.rst:5719 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5718 +#: ../../library/os.rst:5719 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/stdtypes.po b/library/stdtypes.po index 214aa360c8..da57fc16a6 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-23 00:15+0000\n" +"POT-Creation-Date: 2026-01-07 00:14+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-" @@ -82,8 +82,9 @@ msgid "" msgstr "" "預設情況下,一個物件會被視為真值,除非它的 class 定義了會回傳 ``False`` 的 :" "meth:`~object.__bool__` method 或是定義了會回傳零的 :meth:`~object.__len__` " -"method。[1]_ 如果其中一個 method 在被呼叫時引發例外,該例外將會被傳播,且該物件" -"不具有真值(例如 :data:`NotImplemented`)。以下列出了大部分會被視為 false 的內建物件:" +"method。[1]_ 如果其中一個 method 在被呼叫時引發例外,該例外將會被傳播,且該物" +"件不具有真值(例如 :data:`NotImplemented`)。以下列出了大部分會被視為 false " +"的內建物件:" #: ../../library/stdtypes.rst:58 msgid "constants defined to be false: ``None`` and ``False``" @@ -138,8 +139,8 @@ msgstr "結果" #: ../../library/stdtypes.rst:88 ../../library/stdtypes.rst:284 #: ../../library/stdtypes.rst:424 ../../library/stdtypes.rst:1007 -#: ../../library/stdtypes.rst:1226 ../../library/stdtypes.rst:2957 -#: ../../library/stdtypes.rst:4217 +#: ../../library/stdtypes.rst:1226 ../../library/stdtypes.rst:2977 +#: ../../library/stdtypes.rst:4237 msgid "Notes" msgstr "註解" @@ -153,7 +154,7 @@ msgstr "假如 *x* 為真,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:1009 #: ../../library/stdtypes.rst:1012 ../../library/stdtypes.rst:1241 -#: ../../library/stdtypes.rst:2963 ../../library/stdtypes.rst:4223 +#: ../../library/stdtypes.rst:2983 ../../library/stdtypes.rst:4243 msgid "\\(1)" msgstr "\\(1)" @@ -167,8 +168,8 @@ msgstr "假如 *x* 為假,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:297 #: ../../library/stdtypes.rst:317 ../../library/stdtypes.rst:1252 -#: ../../library/stdtypes.rst:2967 ../../library/stdtypes.rst:2969 -#: ../../library/stdtypes.rst:4227 ../../library/stdtypes.rst:4229 +#: ../../library/stdtypes.rst:2987 ../../library/stdtypes.rst:2989 +#: ../../library/stdtypes.rst:4247 ../../library/stdtypes.rst:4249 msgid "\\(2)" msgstr "\\(2)" @@ -180,18 +181,18 @@ msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" msgstr "假如 *x* 為假,則 ``True``,否則 ``False``" -#: ../../library/stdtypes.rst:96 ../../library/stdtypes.rst:2971 -#: ../../library/stdtypes.rst:2973 ../../library/stdtypes.rst:2975 -#: ../../library/stdtypes.rst:2977 ../../library/stdtypes.rst:4231 -#: ../../library/stdtypes.rst:4233 ../../library/stdtypes.rst:4235 -#: ../../library/stdtypes.rst:4237 +#: ../../library/stdtypes.rst:96 ../../library/stdtypes.rst:2991 +#: ../../library/stdtypes.rst:2993 ../../library/stdtypes.rst:2995 +#: ../../library/stdtypes.rst:2997 ../../library/stdtypes.rst:4251 +#: ../../library/stdtypes.rst:4253 ../../library/stdtypes.rst:4255 +#: ../../library/stdtypes.rst:4257 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:105 ../../library/stdtypes.rst:328 #: ../../library/stdtypes.rst:442 ../../library/stdtypes.rst:1051 -#: ../../library/stdtypes.rst:1256 ../../library/stdtypes.rst:3003 -#: ../../library/stdtypes.rst:4267 +#: ../../library/stdtypes.rst:1256 ../../library/stdtypes.rst:3023 +#: ../../library/stdtypes.rst:4287 msgid "Notes:" msgstr "註解:" @@ -238,9 +239,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "這個表格統整所有比較運算:" -#: ../../library/stdtypes.rst:146 ../../library/stdtypes.rst:2934 -#: ../../library/stdtypes.rst:2957 ../../library/stdtypes.rst:4194 -#: ../../library/stdtypes.rst:4217 +#: ../../library/stdtypes.rst:146 ../../library/stdtypes.rst:2954 +#: ../../library/stdtypes.rst:2977 ../../library/stdtypes.rst:4214 +#: ../../library/stdtypes.rst:4237 msgid "Meaning" msgstr "含義" @@ -573,8 +574,8 @@ msgid "" "zero." msgstr "一個複數,其實部為 *re*,虛部為 *im*。*im* 預設為零。" -#: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:2965 -#: ../../library/stdtypes.rst:4254 +#: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:2985 +#: ../../library/stdtypes.rst:4274 msgid "\\(6)" msgstr "\\(6)" @@ -611,9 +612,9 @@ msgid "*x* to the power *y*" msgstr "*x* 的 *y* 次方" #: ../../library/stdtypes.rst:319 ../../library/stdtypes.rst:321 -#: ../../library/stdtypes.rst:2990 ../../library/stdtypes.rst:2993 -#: ../../library/stdtypes.rst:2996 ../../library/stdtypes.rst:4250 -#: ../../library/stdtypes.rst:4257 +#: ../../library/stdtypes.rst:3010 ../../library/stdtypes.rst:3013 +#: ../../library/stdtypes.rst:3016 ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:4277 msgid "\\(5)" msgstr "\\(5)" @@ -771,9 +772,9 @@ msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "*x* 及 *y* 的位元 :dfn:`或`" #: ../../library/stdtypes.rst:426 ../../library/stdtypes.rst:429 -#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:2979 -#: ../../library/stdtypes.rst:2983 ../../library/stdtypes.rst:4239 -#: ../../library/stdtypes.rst:4243 +#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:2999 +#: ../../library/stdtypes.rst:3003 ../../library/stdtypes.rst:4259 +#: ../../library/stdtypes.rst:4263 msgid "\\(4)" msgstr "\\(4)" @@ -3088,7 +3089,7 @@ msgstr "" msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1893 ../../library/stdtypes.rst:3393 +#: ../../library/stdtypes.rst:1893 ../../library/stdtypes.rst:3413 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." @@ -3124,11 +3125,11 @@ msgstr "" ">>> encoded_str_to_bytes\n" "b'Python'" -#: ../../library/stdtypes.rst:1916 ../../library/stdtypes.rst:3412 +#: ../../library/stdtypes.rst:1916 ../../library/stdtypes.rst:3432 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1919 ../../library/stdtypes.rst:3415 +#: ../../library/stdtypes.rst:1919 ../../library/stdtypes.rst:3435 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." @@ -3293,10 +3294,25 @@ msgstr "" #: ../../library/stdtypes.rst:2047 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " -"not found." +"not found. For example:" +msgstr "" + +#: ../../library/stdtypes.rst:2050 +msgid "" +">>> 'spam, spam, spam'.index('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.index('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" msgstr "" -#: ../../library/stdtypes.rst:2053 +#: ../../library/stdtypes.rst:2059 +#, fuzzy +msgid "See also :meth:`rindex`." +msgstr "另請參閱 :meth:`join`。" + +#: ../../library/stdtypes.rst:2064 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -3304,7 +3320,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:2061 +#: ../../library/stdtypes.rst:2072 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -3316,7 +3332,7 @@ msgid "" "spec/chapter-4/#G91002>`_. For example:" msgstr "" -#: ../../library/stdtypes.rst:2070 +#: ../../library/stdtypes.rst:2081 msgid "" ">>> 'Letters and spaces'.isalpha()\n" "False\n" @@ -3327,18 +3343,18 @@ msgid "" "True" msgstr "" -#: ../../library/stdtypes.rst:2079 +#: ../../library/stdtypes.rst:2090 msgid "See :ref:`unicode-properties`." msgstr "" -#: ../../library/stdtypes.rst:2084 +#: ../../library/stdtypes.rst:2095 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. For example:" msgstr "" -#: ../../library/stdtypes.rst:2088 +#: ../../library/stdtypes.rst:2099 msgid "" ">>> 'ASCII characters'.isascii()\n" "True\n" @@ -3350,7 +3366,7 @@ msgstr "" ">>> 'µ'.isascii()\n" "False" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2111 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -3359,7 +3375,7 @@ msgid "" "Unicode General Category \"Nd\". For example:" msgstr "" -#: ../../library/stdtypes.rst:2107 +#: ../../library/stdtypes.rst:2118 msgid "" ">>> '0123456789'.isdecimal()\n" "True\n" @@ -3369,7 +3385,7 @@ msgid "" "False" msgstr "" -#: ../../library/stdtypes.rst:2119 +#: ../../library/stdtypes.rst:2130 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -3379,23 +3395,23 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:2129 +#: ../../library/stdtypes.rst:2140 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:2132 +#: ../../library/stdtypes.rst:2143 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:2135 +#: ../../library/stdtypes.rst:2146 msgid "Example: ::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:2138 +#: ../../library/stdtypes.rst:2149 msgid "" ">>> from keyword import iskeyword\n" "\n" @@ -3411,13 +3427,13 @@ msgstr "" ">>> 'def'.isidentifier(), iskeyword('def')\n" "(True, True)" -#: ../../library/stdtypes.rst:2148 +#: ../../library/stdtypes.rst:2159 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:2154 +#: ../../library/stdtypes.rst:2165 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -3427,7 +3443,7 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric. For example:" msgstr "" -#: ../../library/stdtypes.rst:2162 +#: ../../library/stdtypes.rst:2173 msgid "" ">>> '0123456789'.isnumeric()\n" "True\n" @@ -3439,19 +3455,19 @@ msgid "" "(False, True, True)" msgstr "" -#: ../../library/stdtypes.rst:2173 +#: ../../library/stdtypes.rst:2184 msgid "" "See also :meth:`isdecimal` and :meth:`isdigit`. Numeric characters are a " "superset of decimal numbers." msgstr "" -#: ../../library/stdtypes.rst:2179 +#: ../../library/stdtypes.rst:2190 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:2182 +#: ../../library/stdtypes.rst:2193 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 " @@ -3459,7 +3475,7 @@ msgid "" "written to :data:`sys.stdout` or :data:`sys.stderr`." msgstr "" -#: ../../library/stdtypes.rst:2187 +#: ../../library/stdtypes.rst:2198 msgid "" "The printable characters are those which in the Unicode character database " "(see :mod:`unicodedata`) have a general category in group Letter, Mark, " @@ -3468,20 +3484,33 @@ msgid "" "C), except the ASCII space." msgstr "" -#: ../../library/stdtypes.rst:2196 +#: ../../library/stdtypes.rst:2204 ../../library/stdtypes.rst:2231 +#: ../../library/stdtypes.rst:2286 +msgid "For example:" +msgstr "舉例來說:" + +#: ../../library/stdtypes.rst:2206 +msgid "" +">>> ''.isprintable(), ' '.isprintable()\n" +"(True, True)\n" +">>> '\\t'.isprintable(), '\\n'.isprintable()\n" +"(False, False)" +msgstr "" + +#: ../../library/stdtypes.rst:2216 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:2199 +#: ../../library/stdtypes.rst:2219 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:2207 +#: ../../library/stdtypes.rst:2227 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 " @@ -3489,11 +3518,7 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:2211 ../../library/stdtypes.rst:2266 -msgid "For example:" -msgstr "舉例來說:" - -#: ../../library/stdtypes.rst:2213 +#: ../../library/stdtypes.rst:2233 msgid "" ">>> 'Spam, Spam, Spam'.istitle()\n" "True\n" @@ -3509,17 +3534,17 @@ msgstr "" ">>> 'SPAM, SPAM, SPAM'.istitle()\n" "False" -#: ../../library/stdtypes.rst:2222 +#: ../../library/stdtypes.rst:2242 msgid "See also :meth:`title`." msgstr "另請參閱 :meth:`title`。" -#: ../../library/stdtypes.rst:2227 +#: ../../library/stdtypes.rst:2247 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:2245 +#: ../../library/stdtypes.rst:2265 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 " @@ -3527,7 +3552,7 @@ msgid "" "elements is the string providing this method. For example:" msgstr "" -#: ../../library/stdtypes.rst:2250 +#: ../../library/stdtypes.rst:2270 msgid "" ">>> ', '.join(['spam', 'spam', 'spam'])\n" "'spam, spam, spam'\n" @@ -3535,18 +3560,18 @@ msgid "" "'P-y-t-h-o-n'" msgstr "" -#: ../../library/stdtypes.rst:2257 +#: ../../library/stdtypes.rst:2277 msgid "See also :meth:`split`." msgstr "另請參閱 :meth:`split`。" -#: ../../library/stdtypes.rst:2262 +#: ../../library/stdtypes.rst:2282 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:2268 +#: ../../library/stdtypes.rst:2288 msgid "" ">>> 'Python'.ljust(10)\n" "'Python '\n" @@ -3562,24 +3587,24 @@ msgstr "" ">>> 'Monty Python'.ljust(10, '.')\n" "'Monty Python'" -#: ../../library/stdtypes.rst:2277 +#: ../../library/stdtypes.rst:2297 msgid "See also :meth:`rjust`." msgstr "另請參閱 :meth:`rjust`。" -#: ../../library/stdtypes.rst:2282 +#: ../../library/stdtypes.rst:2302 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:2285 +#: ../../library/stdtypes.rst:2305 msgid "" "The lowercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2292 +#: ../../library/stdtypes.rst:2312 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 " @@ -3588,7 +3613,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2297 +#: ../../library/stdtypes.rst:2317 msgid "" ">>> ' spacious '.lstrip()\n" "'spacious '\n" @@ -3600,13 +3625,13 @@ msgstr "" ">>> 'www.example.com'.lstrip('cmowz.')\n" "'example.com'" -#: ../../library/stdtypes.rst:2302 +#: ../../library/stdtypes.rst:2322 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:2305 +#: ../../library/stdtypes.rst:2325 msgid "" ">>> 'Arthur: three!'.lstrip('Arthur: ')\n" "'ee!'\n" @@ -3618,13 +3643,13 @@ msgstr "" ">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" "'three!'" -#: ../../library/stdtypes.rst:2314 +#: ../../library/stdtypes.rst:2334 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:2316 +#: ../../library/stdtypes.rst:2336 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, " @@ -3632,7 +3657,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:2321 +#: ../../library/stdtypes.rst:2341 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in *from* will be mapped to the " @@ -3640,7 +3665,7 @@ msgid "" "must be a string, whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:2329 +#: ../../library/stdtypes.rst:2349 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 " @@ -3648,13 +3673,13 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:2337 +#: ../../library/stdtypes.rst:2357 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:2341 +#: ../../library/stdtypes.rst:2361 msgid "" ">>> 'TestHook'.removeprefix('Test')\n" "'Hook'\n" @@ -3666,14 +3691,14 @@ msgstr "" ">>> 'BaseTestCase'.removeprefix('Test')\n" "'BaseTestCase'" -#: ../../library/stdtypes.rst:2351 +#: ../../library/stdtypes.rst:2371 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:2355 +#: ../../library/stdtypes.rst:2375 msgid "" ">>> 'MiscTests'.removesuffix('Tests')\n" "'Misc'\n" @@ -3685,7 +3710,7 @@ msgstr "" ">>> 'TmpDirMixin'.removesuffix('Tests')\n" "'TmpDirMixin'" -#: ../../library/stdtypes.rst:2365 +#: ../../library/stdtypes.rst:2385 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 " @@ -3693,31 +3718,31 @@ msgid "" "replaced." msgstr "" -#: ../../library/stdtypes.rst:2369 +#: ../../library/stdtypes.rst:2389 msgid "*count* is now supported as a keyword argument." msgstr "*count* 現在作為關鍵字引數被支援。" -#: ../../library/stdtypes.rst:2375 +#: ../../library/stdtypes.rst:2395 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:2382 +#: ../../library/stdtypes.rst:2402 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:2388 +#: ../../library/stdtypes.rst:2408 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:2395 +#: ../../library/stdtypes.rst:2415 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 " @@ -3725,7 +3750,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2403 +#: ../../library/stdtypes.rst:2423 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 " @@ -3734,7 +3759,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2412 +#: ../../library/stdtypes.rst:2432 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 " @@ -3743,7 +3768,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2417 +#: ../../library/stdtypes.rst:2437 msgid "" ">>> ' spacious '.rstrip()\n" "' spacious'\n" @@ -3755,13 +3780,13 @@ msgstr "" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" -#: ../../library/stdtypes.rst:2422 +#: ../../library/stdtypes.rst:2442 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:2425 +#: ../../library/stdtypes.rst:2445 msgid "" ">>> 'Monty Python'.rstrip(' Python')\n" "'M'\n" @@ -3773,7 +3798,7 @@ msgstr "" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" -#: ../../library/stdtypes.rst:2432 +#: ../../library/stdtypes.rst:2452 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, " @@ -3782,7 +3807,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2438 +#: ../../library/stdtypes.rst:2458 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -3792,21 +3817,21 @@ msgid "" "``['']``." msgstr "" -#: ../../library/stdtypes.rst:2445 ../../library/stdtypes.rst:2463 -#: ../../library/stdtypes.rst:2475 ../../library/stdtypes.rst:2529 -#: ../../library/stdtypes.rst:2597 ../../library/stdtypes.rst:2667 -#: ../../library/stdtypes.rst:2762 ../../library/stdtypes.rst:3728 -#: ../../library/stdtypes.rst:3746 ../../library/stdtypes.rst:3836 -#: ../../library/stdtypes.rst:3852 ../../library/stdtypes.rst:3877 -#: ../../library/stdtypes.rst:3891 ../../library/stdtypes.rst:3919 -#: ../../library/stdtypes.rst:3933 ../../library/stdtypes.rst:3951 -#: ../../library/stdtypes.rst:3978 ../../library/stdtypes.rst:4001 -#: ../../library/stdtypes.rst:4028 ../../library/stdtypes.rst:4070 -#: ../../library/stdtypes.rst:4094 +#: ../../library/stdtypes.rst:2465 ../../library/stdtypes.rst:2483 +#: ../../library/stdtypes.rst:2495 ../../library/stdtypes.rst:2549 +#: ../../library/stdtypes.rst:2617 ../../library/stdtypes.rst:2687 +#: ../../library/stdtypes.rst:2782 ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:3766 ../../library/stdtypes.rst:3856 +#: ../../library/stdtypes.rst:3872 ../../library/stdtypes.rst:3897 +#: ../../library/stdtypes.rst:3911 ../../library/stdtypes.rst:3939 +#: ../../library/stdtypes.rst:3953 ../../library/stdtypes.rst:3971 +#: ../../library/stdtypes.rst:3998 ../../library/stdtypes.rst:4021 +#: ../../library/stdtypes.rst:4048 ../../library/stdtypes.rst:4090 +#: ../../library/stdtypes.rst:4114 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/stdtypes.rst:2447 +#: ../../library/stdtypes.rst:2467 msgid "" ">>> '1,2,3'.split(',')\n" "['1', '2', '3']\n" @@ -3826,7 +3851,7 @@ msgstr "" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" -#: ../../library/stdtypes.rst:2456 +#: ../../library/stdtypes.rst:2476 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, " @@ -3836,7 +3861,7 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2465 +#: ../../library/stdtypes.rst:2485 msgid "" ">>> '1 2 3'.split()\n" "['1', '2', '3']\n" @@ -3852,13 +3877,13 @@ msgstr "" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" -#: ../../library/stdtypes.rst:2472 +#: ../../library/stdtypes.rst:2492 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:2477 +#: ../../library/stdtypes.rst:2497 msgid "" ">>> \"\".split(None, 0)\n" "[]\n" @@ -3874,124 +3899,124 @@ msgstr "" ">>> \" foo \".split(maxsplit=0)\n" "['foo ']" -#: ../../library/stdtypes.rst:2484 +#: ../../library/stdtypes.rst:2504 msgid "See also :meth:`join`." msgstr "另請參閱 :meth:`join`。" -#: ../../library/stdtypes.rst:2492 +#: ../../library/stdtypes.rst:2512 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:2496 +#: ../../library/stdtypes.rst:2516 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2500 +#: ../../library/stdtypes.rst:2520 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2500 +#: ../../library/stdtypes.rst:2520 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2502 +#: ../../library/stdtypes.rst:2522 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2502 +#: ../../library/stdtypes.rst:2522 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2504 +#: ../../library/stdtypes.rst:2524 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2504 +#: ../../library/stdtypes.rst:2524 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2506 +#: ../../library/stdtypes.rst:2526 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2506 +#: ../../library/stdtypes.rst:2526 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2508 +#: ../../library/stdtypes.rst:2528 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2508 +#: ../../library/stdtypes.rst:2528 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2510 +#: ../../library/stdtypes.rst:2530 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2510 +#: ../../library/stdtypes.rst:2530 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2512 +#: ../../library/stdtypes.rst:2532 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2512 +#: ../../library/stdtypes.rst:2532 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2514 +#: ../../library/stdtypes.rst:2534 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2514 +#: ../../library/stdtypes.rst:2534 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2516 +#: ../../library/stdtypes.rst:2536 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2516 +#: ../../library/stdtypes.rst:2536 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2518 +#: ../../library/stdtypes.rst:2538 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2518 +#: ../../library/stdtypes.rst:2538 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2520 +#: ../../library/stdtypes.rst:2540 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2520 +#: ../../library/stdtypes.rst:2540 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2522 +#: ../../library/stdtypes.rst:2542 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2522 +#: ../../library/stdtypes.rst:2542 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2527 +#: ../../library/stdtypes.rst:2547 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2531 +#: ../../library/stdtypes.rst:2551 msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "['ab c', '', 'de fg', 'kl']\n" @@ -4003,14 +4028,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:2536 +#: ../../library/stdtypes.rst:2556 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:2540 +#: ../../library/stdtypes.rst:2560 msgid "" ">>> \"\".splitlines()\n" "[]\n" @@ -4022,11 +4047,11 @@ msgstr "" ">>> \"One line\\n\".splitlines()\n" "['One line']" -#: ../../library/stdtypes.rst:2545 +#: ../../library/stdtypes.rst:2565 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2547 +#: ../../library/stdtypes.rst:2567 msgid "" ">>> ''.split('\\n')\n" "['']\n" @@ -4038,7 +4063,7 @@ msgstr "" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" -#: ../../library/stdtypes.rst:2555 +#: ../../library/stdtypes.rst:2575 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -4046,7 +4071,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2563 +#: ../../library/stdtypes.rst:2583 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 " @@ -4055,7 +4080,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2569 +#: ../../library/stdtypes.rst:2589 msgid "" ">>> ' spacious '.strip()\n" "'spacious'\n" @@ -4067,7 +4092,7 @@ msgstr "" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" -#: ../../library/stdtypes.rst:2574 +#: ../../library/stdtypes.rst:2594 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -4075,7 +4100,7 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2580 +#: ../../library/stdtypes.rst:2600 msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" @@ -4085,20 +4110,20 @@ msgstr "" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" -#: ../../library/stdtypes.rst:2587 +#: ../../library/stdtypes.rst:2607 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:2594 +#: ../../library/stdtypes.rst:2614 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:2599 +#: ../../library/stdtypes.rst:2619 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" @@ -4106,7 +4131,7 @@ msgstr "" ">>> 'Hello world'.title()\n" "'Hello World'" -#: ../../library/stdtypes.rst:2602 ../../library/stdtypes.rst:4038 +#: ../../library/stdtypes.rst:2622 ../../library/stdtypes.rst:4058 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 " @@ -4114,7 +4139,7 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2607 +#: ../../library/stdtypes.rst:2627 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" @@ -4122,19 +4147,19 @@ msgstr "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:2610 +#: ../../library/stdtypes.rst:2630 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2613 +#: ../../library/stdtypes.rst:2633 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2616 +#: ../../library/stdtypes.rst:2636 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -4154,11 +4179,11 @@ msgstr "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:2625 +#: ../../library/stdtypes.rst:2645 msgid "See also :meth:`istitle`." msgstr "另請參閱 :meth:`istitle`。" -#: ../../library/stdtypes.rst:2630 +#: ../../library/stdtypes.rst:2650 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 " @@ -4170,19 +4195,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2639 +#: ../../library/stdtypes.rst:2659 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2642 +#: ../../library/stdtypes.rst:2662 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2648 +#: ../../library/stdtypes.rst:2668 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`` " @@ -4191,14 +4216,14 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2654 +#: ../../library/stdtypes.rst:2674 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2661 +#: ../../library/stdtypes.rst:2681 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 " @@ -4206,7 +4231,7 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2669 +#: ../../library/stdtypes.rst:2689 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" @@ -4218,27 +4243,27 @@ msgstr "" ">>> \"-42\".zfill(5)\n" "'-0042'" -#: ../../library/stdtypes.rst:2692 +#: ../../library/stdtypes.rst:2712 msgid "Formatted String Literals (f-strings)" msgstr "" -#: ../../library/stdtypes.rst:2695 +#: ../../library/stdtypes.rst:2715 msgid "" "The :keyword:`await` and :keyword:`async for` can be used in expressions " "within f-strings." msgstr "" -#: ../../library/stdtypes.rst:2698 +#: ../../library/stdtypes.rst:2718 msgid "Added the debug specifier (``=``)" msgstr "" -#: ../../library/stdtypes.rst:2700 +#: ../../library/stdtypes.rst:2720 msgid "" "Many restrictions on expressions within f-strings have been removed. " "Notably, nested strings, comments, and backslashes are now permitted." msgstr "" -#: ../../library/stdtypes.rst:2704 +#: ../../library/stdtypes.rst:2724 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 " @@ -4247,29 +4272,29 @@ msgid "" "replacement field must contain an expression, optionally followed by:" msgstr "" -#: ../../library/stdtypes.rst:2711 +#: ../../library/stdtypes.rst:2731 msgid "a *debug specifier* -- an equal sign (``=``);" msgstr "" -#: ../../library/stdtypes.rst:2712 +#: ../../library/stdtypes.rst:2732 msgid "a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or" msgstr "" -#: ../../library/stdtypes.rst:2713 +#: ../../library/stdtypes.rst:2733 msgid "a *format specifier* prefixed with a colon (``:``)." msgstr "" -#: ../../library/stdtypes.rst:2715 +#: ../../library/stdtypes.rst:2735 msgid "" "See the :ref:`Lexical Analysis section on f-strings ` for details " "on the syntax of these fields." msgstr "" -#: ../../library/stdtypes.rst:2719 +#: ../../library/stdtypes.rst:2739 msgid "Debug specifier" msgstr "" -#: ../../library/stdtypes.rst:2723 +#: ../../library/stdtypes.rst:2743 msgid "" "If a debug specifier -- an equal sign (``=``) -- appears after the " "replacement field expression, the resulting f-string will contain the " @@ -4277,36 +4302,36 @@ msgid "" "is often useful for debugging::" msgstr "" -#: ../../library/stdtypes.rst:2728 +#: ../../library/stdtypes.rst:2748 msgid "" ">>> number = 14.3\n" ">>> f'{number=}'\n" "'number=14.3'" msgstr "" -#: ../../library/stdtypes.rst:2732 +#: ../../library/stdtypes.rst:2752 msgid "" "Whitespace before, inside and after the expression, as well as whitespace " "after the equal sign, is significant --- it is retained in the result::" msgstr "" -#: ../../library/stdtypes.rst:2735 +#: ../../library/stdtypes.rst:2755 msgid "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" msgstr "" -#: ../../library/stdtypes.rst:2740 +#: ../../library/stdtypes.rst:2760 msgid "Conversion specifier" msgstr "" -#: ../../library/stdtypes.rst:2742 +#: ../../library/stdtypes.rst:2762 msgid "" "By default, the value of a replacement field expression is converted to a " "string using :func:`str`::" msgstr "" -#: ../../library/stdtypes.rst:2745 +#: ../../library/stdtypes.rst:2765 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4318,36 +4343,36 @@ msgstr "" ">>> f'{one_third}'\n" "'1/3'" -#: ../../library/stdtypes.rst:2750 +#: ../../library/stdtypes.rst:2770 msgid "" "When a debug specifier but no format specifier is used, the default " "conversion instead uses :func:`repr`::" msgstr "" -#: ../../library/stdtypes.rst:2753 +#: ../../library/stdtypes.rst:2773 msgid "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" msgstr "" -#: ../../library/stdtypes.rst:2756 +#: ../../library/stdtypes.rst:2776 msgid "" "The conversion can be specified explicitly using one of these specifiers:" msgstr "" -#: ../../library/stdtypes.rst:2758 +#: ../../library/stdtypes.rst:2778 msgid "``!s`` for :func:`str`" msgstr "``!s`` 用於 :func:`str`" -#: ../../library/stdtypes.rst:2759 +#: ../../library/stdtypes.rst:2779 msgid "``!r`` for :func:`repr`" msgstr "``!r`` 用於 :func:`repr`" -#: ../../library/stdtypes.rst:2760 +#: ../../library/stdtypes.rst:2780 msgid "``!a`` for :func:`ascii`" msgstr "``!a`` 用於 :func:`ascii`" -#: ../../library/stdtypes.rst:2764 +#: ../../library/stdtypes.rst:2784 msgid "" ">>> str(one_third)\n" "'1/3'\n" @@ -4365,11 +4390,11 @@ msgid "" "\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" msgstr "" -#: ../../library/stdtypes.rst:2781 +#: ../../library/stdtypes.rst:2801 msgid "Format specifier" msgstr "" -#: ../../library/stdtypes.rst:2783 +#: ../../library/stdtypes.rst:2803 msgid "" "After the expression has been evaluated, and possibly converted using an " "explicit conversion specifier, it is formatted using the :func:`format` " @@ -4379,7 +4404,7 @@ msgid "" "the replacement field. For example::" msgstr "" -#: ../../library/stdtypes.rst:2790 +#: ../../library/stdtypes.rst:2810 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4403,29 +4428,29 @@ msgstr "" ">>> f'{one_third = :~>10}~'\n" "'one_third = ~~~~~~~1/3~'" -#: ../../library/stdtypes.rst:2804 +#: ../../library/stdtypes.rst:2824 msgid "Template String Literals (t-strings)" msgstr "模板字串字面值 (t-strings)" -#: ../../library/stdtypes.rst:2806 +#: ../../library/stdtypes.rst:2826 msgid "" "An :dfn:`t-string` (formally a :dfn:`template string literal`) is a string " "literal that is prefixed with ``t`` or ``T``." msgstr "" -#: ../../library/stdtypes.rst:2809 +#: ../../library/stdtypes.rst:2829 msgid "" "These strings follow the same syntax and evaluation rules as :ref:`formatted " "string literals `, with for the following differences:" msgstr "" -#: ../../library/stdtypes.rst:2813 +#: ../../library/stdtypes.rst:2833 msgid "" "Rather than evaluating to a ``str`` object, template string literals " "evaluate to a :class:`string.templatelib.Template` object." msgstr "" -#: ../../library/stdtypes.rst:2816 +#: ../../library/stdtypes.rst:2836 msgid "" "The :func:`format` protocol is not used. Instead, the format specifier and " "conversions (if any) are passed to a new :class:`~string.templatelib." @@ -4434,7 +4459,7 @@ msgid "" "Template` object to decide how to handle format specifiers and conversions." msgstr "" -#: ../../library/stdtypes.rst:2823 +#: ../../library/stdtypes.rst:2843 msgid "" "Format specifiers containing nested replacement fields are evaluated " "eagerly, prior to being passed to the :class:`~string.templatelib." @@ -4444,7 +4469,7 @@ msgid "" "to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" -#: ../../library/stdtypes.rst:2831 +#: ../../library/stdtypes.rst:2851 msgid "" "When the equals sign ``'='`` is provided in an interpolation expression, the " "text of the expression is appended to the literal string that precedes the " @@ -4456,18 +4481,18 @@ msgid "" "behaviour." msgstr "" -#: ../../library/stdtypes.rst:2845 +#: ../../library/stdtypes.rst:2865 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2858 +#: ../../library/stdtypes.rst:2878 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 " "dictionaries correctly)." msgstr "" -#: ../../library/stdtypes.rst:2862 +#: ../../library/stdtypes.rst:2882 msgid "" "Using :ref:`formatted string literals `, the :meth:`str.format` " "interface, or :class:`string.Template` may help avoid these errors. Each of " @@ -4475,7 +4500,7 @@ msgid "" "flexibility, and/or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2867 +#: ../../library/stdtypes.rst:2887 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -4485,7 +4510,7 @@ msgid "" "function in the C language. For example:" msgstr "" -#: ../../library/stdtypes.rst:2874 +#: ../../library/stdtypes.rst:2894 msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." @@ -4493,7 +4518,7 @@ msgstr "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." -#: ../../library/stdtypes.rst:2879 +#: ../../library/stdtypes.rst:2899 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 " @@ -4501,36 +4526,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2889 ../../library/stdtypes.rst:4149 +#: ../../library/stdtypes.rst:2909 ../../library/stdtypes.rst:4169 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2892 ../../library/stdtypes.rst:4152 +#: ../../library/stdtypes.rst:2912 ../../library/stdtypes.rst:4172 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2894 ../../library/stdtypes.rst:4154 +#: ../../library/stdtypes.rst:2914 ../../library/stdtypes.rst:4174 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2897 ../../library/stdtypes.rst:4157 +#: ../../library/stdtypes.rst:2917 ../../library/stdtypes.rst:4177 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2900 ../../library/stdtypes.rst:4160 +#: ../../library/stdtypes.rst:2920 ../../library/stdtypes.rst:4180 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:2904 ../../library/stdtypes.rst:4164 +#: ../../library/stdtypes.rst:2924 ../../library/stdtypes.rst:4184 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -4538,15 +4563,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2909 ../../library/stdtypes.rst:4169 +#: ../../library/stdtypes.rst:2929 ../../library/stdtypes.rst:4189 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2911 ../../library/stdtypes.rst:4171 +#: ../../library/stdtypes.rst:2931 ../../library/stdtypes.rst:4191 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2913 +#: ../../library/stdtypes.rst:2933 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 " @@ -4554,279 +4579,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2922 ../../library/stdtypes.rst:4182 +#: ../../library/stdtypes.rst:2942 ../../library/stdtypes.rst:4202 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2925 ../../library/stdtypes.rst:4185 +#: ../../library/stdtypes.rst:2945 ../../library/stdtypes.rst:4205 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2934 ../../library/stdtypes.rst:4194 +#: ../../library/stdtypes.rst:2954 ../../library/stdtypes.rst:4214 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2936 ../../library/stdtypes.rst:4196 +#: ../../library/stdtypes.rst:2956 ../../library/stdtypes.rst:4216 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2936 ../../library/stdtypes.rst:4196 +#: ../../library/stdtypes.rst:2956 ../../library/stdtypes.rst:4216 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2939 ../../library/stdtypes.rst:4199 +#: ../../library/stdtypes.rst:2959 ../../library/stdtypes.rst:4219 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2939 ../../library/stdtypes.rst:4199 +#: ../../library/stdtypes.rst:2959 ../../library/stdtypes.rst:4219 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2941 ../../library/stdtypes.rst:4201 +#: ../../library/stdtypes.rst:2961 ../../library/stdtypes.rst:4221 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2941 ../../library/stdtypes.rst:4201 +#: ../../library/stdtypes.rst:2961 ../../library/stdtypes.rst:4221 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2944 ../../library/stdtypes.rst:4204 +#: ../../library/stdtypes.rst:2964 ../../library/stdtypes.rst:4224 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2944 ../../library/stdtypes.rst:4204 +#: ../../library/stdtypes.rst:2964 ../../library/stdtypes.rst:4224 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2947 ../../library/stdtypes.rst:4207 +#: ../../library/stdtypes.rst:2967 ../../library/stdtypes.rst:4227 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2947 ../../library/stdtypes.rst:4207 +#: ../../library/stdtypes.rst:2967 ../../library/stdtypes.rst:4227 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2951 ../../library/stdtypes.rst:4211 +#: ../../library/stdtypes.rst:2971 ../../library/stdtypes.rst:4231 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:2954 ../../library/stdtypes.rst:4214 +#: ../../library/stdtypes.rst:2974 ../../library/stdtypes.rst:4234 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2957 ../../library/stdtypes.rst:4217 +#: ../../library/stdtypes.rst:2977 ../../library/stdtypes.rst:4237 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2959 ../../library/stdtypes.rst:4219 +#: ../../library/stdtypes.rst:2979 ../../library/stdtypes.rst:4239 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2959 ../../library/stdtypes.rst:2961 -#: ../../library/stdtypes.rst:4219 ../../library/stdtypes.rst:4221 +#: ../../library/stdtypes.rst:2979 ../../library/stdtypes.rst:2981 +#: ../../library/stdtypes.rst:4239 ../../library/stdtypes.rst:4241 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2961 ../../library/stdtypes.rst:4221 +#: ../../library/stdtypes.rst:2981 ../../library/stdtypes.rst:4241 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2963 ../../library/stdtypes.rst:4223 +#: ../../library/stdtypes.rst:2983 ../../library/stdtypes.rst:4243 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2963 ../../library/stdtypes.rst:4223 +#: ../../library/stdtypes.rst:2983 ../../library/stdtypes.rst:4243 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2965 ../../library/stdtypes.rst:4225 +#: ../../library/stdtypes.rst:2985 ../../library/stdtypes.rst:4245 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2965 ../../library/stdtypes.rst:4225 +#: ../../library/stdtypes.rst:2985 ../../library/stdtypes.rst:4245 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2967 ../../library/stdtypes.rst:4227 +#: ../../library/stdtypes.rst:2987 ../../library/stdtypes.rst:4247 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2967 ../../library/stdtypes.rst:4227 +#: ../../library/stdtypes.rst:2987 ../../library/stdtypes.rst:4247 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2969 ../../library/stdtypes.rst:4229 +#: ../../library/stdtypes.rst:2989 ../../library/stdtypes.rst:4249 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2969 ../../library/stdtypes.rst:4229 +#: ../../library/stdtypes.rst:2989 ../../library/stdtypes.rst:4249 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2971 ../../library/stdtypes.rst:4231 +#: ../../library/stdtypes.rst:2991 ../../library/stdtypes.rst:4251 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2971 ../../library/stdtypes.rst:4231 +#: ../../library/stdtypes.rst:2991 ../../library/stdtypes.rst:4251 msgid "Floating-point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2973 ../../library/stdtypes.rst:4233 +#: ../../library/stdtypes.rst:2993 ../../library/stdtypes.rst:4253 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2973 ../../library/stdtypes.rst:4233 +#: ../../library/stdtypes.rst:2993 ../../library/stdtypes.rst:4253 msgid "Floating-point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2975 ../../library/stdtypes.rst:4235 +#: ../../library/stdtypes.rst:2995 ../../library/stdtypes.rst:4255 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2975 ../../library/stdtypes.rst:2977 -#: ../../library/stdtypes.rst:4235 ../../library/stdtypes.rst:4237 +#: ../../library/stdtypes.rst:2995 ../../library/stdtypes.rst:2997 +#: ../../library/stdtypes.rst:4255 ../../library/stdtypes.rst:4257 msgid "Floating-point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2977 ../../library/stdtypes.rst:4237 +#: ../../library/stdtypes.rst:2997 ../../library/stdtypes.rst:4257 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2979 ../../library/stdtypes.rst:4239 +#: ../../library/stdtypes.rst:2999 ../../library/stdtypes.rst:4259 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2979 ../../library/stdtypes.rst:4239 +#: ../../library/stdtypes.rst:2999 ../../library/stdtypes.rst:4259 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:2983 ../../library/stdtypes.rst:4243 +#: ../../library/stdtypes.rst:3003 ../../library/stdtypes.rst:4263 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2983 ../../library/stdtypes.rst:4243 +#: ../../library/stdtypes.rst:3003 ../../library/stdtypes.rst:4263 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:2987 ../../library/stdtypes.rst:4247 +#: ../../library/stdtypes.rst:3007 ../../library/stdtypes.rst:4267 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2987 +#: ../../library/stdtypes.rst:3007 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2990 ../../library/stdtypes.rst:4260 +#: ../../library/stdtypes.rst:3010 ../../library/stdtypes.rst:4280 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2990 +#: ../../library/stdtypes.rst:3010 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2993 ../../library/stdtypes.rst:4254 +#: ../../library/stdtypes.rst:3013 ../../library/stdtypes.rst:4274 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2993 +#: ../../library/stdtypes.rst:3013 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2996 ../../library/stdtypes.rst:4257 +#: ../../library/stdtypes.rst:3016 ../../library/stdtypes.rst:4277 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2996 +#: ../../library/stdtypes.rst:3016 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2999 ../../library/stdtypes.rst:4263 +#: ../../library/stdtypes.rst:3019 ../../library/stdtypes.rst:4283 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2999 ../../library/stdtypes.rst:4263 +#: ../../library/stdtypes.rst:3019 ../../library/stdtypes.rst:4283 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:3006 ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:3026 ../../library/stdtypes.rst:4290 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:3010 ../../library/stdtypes.rst:4274 +#: ../../library/stdtypes.rst:3030 ../../library/stdtypes.rst:4294 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:3014 ../../library/stdtypes.rst:4278 +#: ../../library/stdtypes.rst:3034 ../../library/stdtypes.rst:4298 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:3017 ../../library/stdtypes.rst:4281 +#: ../../library/stdtypes.rst:3037 ../../library/stdtypes.rst:4301 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:3021 ../../library/stdtypes.rst:4285 +#: ../../library/stdtypes.rst:3041 ../../library/stdtypes.rst:4305 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:3024 ../../library/stdtypes.rst:4288 +#: ../../library/stdtypes.rst:3044 ../../library/stdtypes.rst:4308 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:3028 ../../library/stdtypes.rst:4292 +#: ../../library/stdtypes.rst:3048 ../../library/stdtypes.rst:4312 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:3031 ../../library/stdtypes.rst:4301 +#: ../../library/stdtypes.rst:3051 ../../library/stdtypes.rst:4321 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`。" -#: ../../library/stdtypes.rst:3033 +#: ../../library/stdtypes.rst:3053 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:3038 +#: ../../library/stdtypes.rst:3058 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:3049 +#: ../../library/stdtypes.rst:3069 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:3057 +#: ../../library/stdtypes.rst:3077 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 :" @@ -4834,17 +4859,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:3062 +#: ../../library/stdtypes.rst:3082 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:3068 +#: ../../library/stdtypes.rst:3088 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:3072 +#: ../../library/stdtypes.rst:3092 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -4852,40 +4877,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:3080 +#: ../../library/stdtypes.rst:3100 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:3083 +#: ../../library/stdtypes.rst:3103 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:3084 +#: ../../library/stdtypes.rst:3104 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:3085 +#: ../../library/stdtypes.rst:3105 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:3087 +#: ../../library/stdtypes.rst:3107 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:3091 +#: ../../library/stdtypes.rst:3111 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:3095 +#: ../../library/stdtypes.rst:3115 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -4898,29 +4923,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:3105 +#: ../../library/stdtypes.rst:3125 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:3108 +#: ../../library/stdtypes.rst:3128 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:3109 +#: ../../library/stdtypes.rst:3129 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3110 +#: ../../library/stdtypes.rst:3130 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:3112 +#: ../../library/stdtypes.rst:3132 msgid "Also see the :ref:`bytes ` built-in." msgstr "另見內建的 :ref:`bytes `。" -#: ../../library/stdtypes.rst:3114 +#: ../../library/stdtypes.rst:3134 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -4928,38 +4953,38 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:3120 +#: ../../library/stdtypes.rst:3140 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:3127 +#: ../../library/stdtypes.rst:3147 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:3131 +#: ../../library/stdtypes.rst:3151 msgid "" ":meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like " "objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3135 +#: ../../library/stdtypes.rst:3155 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:3232 +#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:3252 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:3147 +#: ../../library/stdtypes.rst:3167 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, " @@ -4968,13 +4993,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:3164 +#: ../../library/stdtypes.rst:3184 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:3168 +#: ../../library/stdtypes.rst:3188 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 " @@ -4982,58 +5007,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3173 +#: ../../library/stdtypes.rst:3193 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:3181 +#: ../../library/stdtypes.rst:3201 msgid "Bytearray Objects" msgstr "Bytearray 物件" -#: ../../library/stdtypes.rst:3185 +#: ../../library/stdtypes.rst:3205 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:3191 +#: ../../library/stdtypes.rst:3211 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:3194 +#: ../../library/stdtypes.rst:3214 msgid "Creating an empty instance: ``bytearray()``" msgstr "建立一個空的實例:``bytearray()``" -#: ../../library/stdtypes.rst:3195 +#: ../../library/stdtypes.rst:3215 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:3196 +#: ../../library/stdtypes.rst:3216 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3197 +#: ../../library/stdtypes.rst:3217 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:3199 +#: ../../library/stdtypes.rst:3219 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:3203 +#: ../../library/stdtypes.rst:3223 msgid "Also see the :ref:`bytearray ` built-in." msgstr "另見內建的 :ref:`bytearray `。" -#: ../../library/stdtypes.rst:3205 +#: ../../library/stdtypes.rst:3225 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -5041,64 +5066,64 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:3211 +#: ../../library/stdtypes.rst:3231 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:3218 +#: ../../library/stdtypes.rst:3238 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:3222 +#: ../../library/stdtypes.rst:3242 msgid "" ":meth:`bytearray.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-" "like objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3226 +#: ../../library/stdtypes.rst:3246 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3240 +#: ../../library/stdtypes.rst:3260 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:3247 +#: ../../library/stdtypes.rst:3267 msgid "" "Resize the :class:`bytearray` to contain *size* bytes. *size* must be " "greater than or equal to 0." msgstr "" -#: ../../library/stdtypes.rst:3250 +#: ../../library/stdtypes.rst:3270 msgid "" "If the :class:`bytearray` needs to shrink, bytes beyond *size* are truncated." msgstr "" -#: ../../library/stdtypes.rst:3252 +#: ../../library/stdtypes.rst:3272 msgid "" "If the :class:`bytearray` needs to grow, all new bytes, those beyond *size*, " "will be set to null bytes." msgstr "" -#: ../../library/stdtypes.rst:3256 +#: ../../library/stdtypes.rst:3276 msgid "This is equivalent to:" msgstr "等同於:" -#: ../../library/stdtypes.rst:3264 +#: ../../library/stdtypes.rst:3284 msgid "Examples:" msgstr "範例:" -#: ../../library/stdtypes.rst:3277 +#: ../../library/stdtypes.rst:3297 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 " @@ -5106,7 +5131,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3282 +#: ../../library/stdtypes.rst:3302 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -5114,11 +5139,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:3291 +#: ../../library/stdtypes.rst:3311 msgid "Bytes and Bytearray Operations" msgstr "Bytes 和 Bytearray 的操作" -#: ../../library/stdtypes.rst:3296 +#: ../../library/stdtypes.rst:3316 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -5127,14 +5152,14 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:3304 +#: ../../library/stdtypes.rst:3324 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:3308 +#: ../../library/stdtypes.rst:3328 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" @@ -5142,11 +5167,11 @@ msgstr "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" -#: ../../library/stdtypes.rst:3311 +#: ../../library/stdtypes.rst:3331 msgid "and::" msgstr "和: ::" -#: ../../library/stdtypes.rst:3313 +#: ../../library/stdtypes.rst:3333 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" @@ -5154,60 +5179,60 @@ msgstr "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" -#: ../../library/stdtypes.rst:3316 +#: ../../library/stdtypes.rst:3336 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:3321 +#: ../../library/stdtypes.rst:3341 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:3324 +#: ../../library/stdtypes.rst:3344 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:3330 +#: ../../library/stdtypes.rst:3350 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:3334 ../../library/stdtypes.rst:3439 -#: ../../library/stdtypes.rst:3461 ../../library/stdtypes.rst:3527 -#: ../../library/stdtypes.rst:3540 +#: ../../library/stdtypes.rst:3354 ../../library/stdtypes.rst:3459 +#: ../../library/stdtypes.rst:3481 ../../library/stdtypes.rst:3547 +#: ../../library/stdtypes.rst:3560 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:3337 +#: ../../library/stdtypes.rst:3357 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:3340 ../../library/stdtypes.rst:3451 -#: ../../library/stdtypes.rst:3464 ../../library/stdtypes.rst:3530 -#: ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:3360 ../../library/stdtypes.rst:3471 +#: ../../library/stdtypes.rst:3484 ../../library/stdtypes.rst:3550 +#: ../../library/stdtypes.rst:3563 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:3347 +#: ../../library/stdtypes.rst:3367 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:3351 +#: ../../library/stdtypes.rst:3371 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" @@ -5219,32 +5244,32 @@ msgstr "" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" -#: ../../library/stdtypes.rst:3356 +#: ../../library/stdtypes.rst:3376 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "*prefix* 可以是任何的 :term:`bytes-like object`。" -#: ../../library/stdtypes.rst:3360 ../../library/stdtypes.rst:3382 -#: ../../library/stdtypes.rst:3515 ../../library/stdtypes.rst:3608 -#: ../../library/stdtypes.rst:3622 ../../library/stdtypes.rst:3652 -#: ../../library/stdtypes.rst:3666 ../../library/stdtypes.rst:3707 -#: ../../library/stdtypes.rst:3777 ../../library/stdtypes.rst:3795 -#: ../../library/stdtypes.rst:3823 ../../library/stdtypes.rst:3962 -#: ../../library/stdtypes.rst:4017 ../../library/stdtypes.rst:4060 -#: ../../library/stdtypes.rst:4081 ../../library/stdtypes.rst:4103 -#: ../../library/stdtypes.rst:4305 +#: ../../library/stdtypes.rst:3380 ../../library/stdtypes.rst:3402 +#: ../../library/stdtypes.rst:3535 ../../library/stdtypes.rst:3628 +#: ../../library/stdtypes.rst:3642 ../../library/stdtypes.rst:3672 +#: ../../library/stdtypes.rst:3686 ../../library/stdtypes.rst:3727 +#: ../../library/stdtypes.rst:3797 ../../library/stdtypes.rst:3815 +#: ../../library/stdtypes.rst:3843 ../../library/stdtypes.rst:3982 +#: ../../library/stdtypes.rst:4037 ../../library/stdtypes.rst:4080 +#: ../../library/stdtypes.rst:4101 ../../library/stdtypes.rst:4123 +#: ../../library/stdtypes.rst:4325 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:3369 +#: ../../library/stdtypes.rst:3389 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:3373 +#: ../../library/stdtypes.rst:3393 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" @@ -5256,15 +5281,15 @@ msgstr "" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" -#: ../../library/stdtypes.rst:3378 +#: ../../library/stdtypes.rst:3398 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3391 +#: ../../library/stdtypes.rst:3411 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:3396 +#: ../../library/stdtypes.rst:3416 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -5272,21 +5297,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:3402 +#: ../../library/stdtypes.rst:3422 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:3408 +#: ../../library/stdtypes.rst:3428 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:3423 +#: ../../library/stdtypes.rst:3443 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -5294,11 +5319,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3428 +#: ../../library/stdtypes.rst:3448 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3434 +#: ../../library/stdtypes.rst:3454 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 " @@ -5306,14 +5331,14 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3444 +#: ../../library/stdtypes.rst:3464 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:3448 +#: ../../library/stdtypes.rst:3468 msgid "" ">>> b'Py' in b'Python'\n" "True" @@ -5321,13 +5346,13 @@ msgstr "" ">>> b'Py' in b'Python'\n" "True" -#: ../../library/stdtypes.rst:3458 +#: ../../library/stdtypes.rst:3478 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:3471 +#: ../../library/stdtypes.rst:3491 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 " @@ -5337,7 +5362,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:3482 +#: ../../library/stdtypes.rst:3502 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 " @@ -5345,7 +5370,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:3493 +#: ../../library/stdtypes.rst:3513 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 " @@ -5354,24 +5379,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:3500 ../../library/stdtypes.rst:3557 +#: ../../library/stdtypes.rst:3520 ../../library/stdtypes.rst:3577 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3506 +#: ../../library/stdtypes.rst:3526 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:3510 +#: ../../library/stdtypes.rst:3530 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3522 +#: ../../library/stdtypes.rst:3542 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -5379,13 +5404,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:3537 +#: ../../library/stdtypes.rst:3557 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3550 +#: ../../library/stdtypes.rst:3570 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 " @@ -5394,7 +5419,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:3563 +#: ../../library/stdtypes.rst:3583 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -5402,11 +5427,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:3588 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3574 +#: ../../library/stdtypes.rst:3594 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 " @@ -5414,18 +5439,18 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:3599 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:3582 +#: ../../library/stdtypes.rst:3602 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:3585 +#: ../../library/stdtypes.rst:3605 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" @@ -5433,11 +5458,11 @@ msgstr "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" -#: ../../library/stdtypes.rst:3588 +#: ../../library/stdtypes.rst:3608 msgid "*delete* is now supported as a keyword argument." msgstr "支援 *delete* 關鍵字引數。" -#: ../../library/stdtypes.rst:3592 +#: ../../library/stdtypes.rst:3612 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 " @@ -5446,7 +5471,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:3621 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). " @@ -5454,7 +5479,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3615 +#: ../../library/stdtypes.rst:3635 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). " @@ -5462,7 +5487,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3629 +#: ../../library/stdtypes.rst:3649 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -5471,7 +5496,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3635 +#: ../../library/stdtypes.rst:3655 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" @@ -5483,14 +5508,14 @@ msgstr "" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" -#: ../../library/stdtypes.rst:3640 +#: ../../library/stdtypes.rst:3660 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:3645 +#: ../../library/stdtypes.rst:3665 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" @@ -5502,7 +5527,7 @@ msgstr "" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" -#: ../../library/stdtypes.rst:3659 +#: ../../library/stdtypes.rst:3679 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). " @@ -5510,7 +5535,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3673 +#: ../../library/stdtypes.rst:3693 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 " @@ -5520,7 +5545,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3684 +#: ../../library/stdtypes.rst:3704 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -5529,7 +5554,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3690 +#: ../../library/stdtypes.rst:3710 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" @@ -5541,14 +5566,14 @@ msgstr "" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" -#: ../../library/stdtypes.rst:3695 +#: ../../library/stdtypes.rst:3715 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:3700 +#: ../../library/stdtypes.rst:3720 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" @@ -5560,7 +5585,7 @@ msgstr "" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" -#: ../../library/stdtypes.rst:3714 +#: ../../library/stdtypes.rst:3734 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 " @@ -5569,7 +5594,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3720 +#: ../../library/stdtypes.rst:3740 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',')`` " @@ -5580,7 +5605,7 @@ msgid "" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3730 +#: ../../library/stdtypes.rst:3750 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -5600,7 +5625,7 @@ msgstr "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" -#: ../../library/stdtypes.rst:3739 +#: ../../library/stdtypes.rst:3759 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 " @@ -5610,7 +5635,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3749 +#: ../../library/stdtypes.rst:3769 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -5626,7 +5651,7 @@ msgstr "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" -#: ../../library/stdtypes.rst:3760 +#: ../../library/stdtypes.rst:3780 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *bytes* argument is a binary sequence specifying the set of " @@ -5635,7 +5660,7 @@ msgid "" "or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3767 +#: ../../library/stdtypes.rst:3787 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" @@ -5647,13 +5672,13 @@ msgstr "" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" -#: ../../library/stdtypes.rst:3772 +#: ../../library/stdtypes.rst:3792 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3781 +#: ../../library/stdtypes.rst:3801 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 " @@ -5661,14 +5686,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3789 +#: ../../library/stdtypes.rst:3809 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:3802 +#: ../../library/stdtypes.rst:3822 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 " @@ -5684,7 +5709,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3816 +#: ../../library/stdtypes.rst:3836 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" @@ -5696,7 +5721,7 @@ msgstr "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" -#: ../../library/stdtypes.rst:3830 +#: ../../library/stdtypes.rst:3850 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -5705,7 +5730,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3838 +#: ../../library/stdtypes.rst:3858 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" @@ -5717,7 +5742,7 @@ msgstr "" ">>> b'ABC abc1'.isalnum()\n" "False" -#: ../../library/stdtypes.rst:3847 +#: ../../library/stdtypes.rst:3867 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -5725,7 +5750,7 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3854 +#: ../../library/stdtypes.rst:3874 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" @@ -5737,20 +5762,20 @@ msgstr "" ">>> b'ABCabc1'.isalpha()\n" "False" -#: ../../library/stdtypes.rst:3863 +#: ../../library/stdtypes.rst:3883 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:3873 +#: ../../library/stdtypes.rst:3893 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:3879 +#: ../../library/stdtypes.rst:3899 msgid "" ">>> b'1234'.isdigit()\n" "True\n" @@ -5762,13 +5787,13 @@ msgstr "" ">>> b'1.23'.isdigit()\n" "False" -#: ../../library/stdtypes.rst:3888 +#: ../../library/stdtypes.rst:3908 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:3893 +#: ../../library/stdtypes.rst:3913 msgid "" ">>> b'hello world'.islower()\n" "True\n" @@ -5780,16 +5805,16 @@ msgstr "" ">>> b'Hello world'.islower()\n" "False" -#: ../../library/stdtypes.rst:3898 ../../library/stdtypes.rst:3940 -#: ../../library/stdtypes.rst:3956 ../../library/stdtypes.rst:4006 -#: ../../library/stdtypes.rst:4075 +#: ../../library/stdtypes.rst:3918 ../../library/stdtypes.rst:3960 +#: ../../library/stdtypes.rst:3976 ../../library/stdtypes.rst:4026 +#: ../../library/stdtypes.rst:4095 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:3906 +#: ../../library/stdtypes.rst:3926 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -5797,14 +5822,14 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3915 +#: ../../library/stdtypes.rst:3935 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:3921 +#: ../../library/stdtypes.rst:3941 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" @@ -5816,14 +5841,14 @@ msgstr "" ">>> b'Hello world'.istitle()\n" "False" -#: ../../library/stdtypes.rst:3930 +#: ../../library/stdtypes.rst:3950 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:3935 +#: ../../library/stdtypes.rst:3955 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" @@ -5835,13 +5860,13 @@ msgstr "" ">>> b'Hello world'.isupper()\n" "False" -#: ../../library/stdtypes.rst:3948 +#: ../../library/stdtypes.rst:3968 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3953 +#: ../../library/stdtypes.rst:3973 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" @@ -5849,7 +5874,7 @@ msgstr "" ">>> b'Hello World'.lower()\n" "b'hello world'" -#: ../../library/stdtypes.rst:3973 +#: ../../library/stdtypes.rst:3993 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 " @@ -5857,7 +5882,7 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3980 +#: ../../library/stdtypes.rst:4000 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" @@ -5869,14 +5894,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:3985 +#: ../../library/stdtypes.rst:4005 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:3989 +#: ../../library/stdtypes.rst:4009 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" @@ -5888,13 +5913,13 @@ msgstr "" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" -#: ../../library/stdtypes.rst:3998 +#: ../../library/stdtypes.rst:4018 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:4003 +#: ../../library/stdtypes.rst:4023 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" @@ -5902,7 +5927,7 @@ msgstr "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" -#: ../../library/stdtypes.rst:4010 +#: ../../library/stdtypes.rst:4030 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -5910,14 +5935,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:4024 +#: ../../library/stdtypes.rst:4044 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:4030 +#: ../../library/stdtypes.rst:4050 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" @@ -5925,7 +5950,7 @@ msgstr "" ">>> b'Hello world'.title()\n" "b'Hello World'" -#: ../../library/stdtypes.rst:4033 +#: ../../library/stdtypes.rst:4053 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -5933,7 +5958,7 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:4043 +#: ../../library/stdtypes.rst:4063 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" @@ -5941,12 +5966,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:4046 +#: ../../library/stdtypes.rst:4066 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:4048 +#: ../../library/stdtypes.rst:4068 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -5968,13 +5993,13 @@ msgstr "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:4067 +#: ../../library/stdtypes.rst:4087 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:4072 +#: ../../library/stdtypes.rst:4092 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" @@ -5982,7 +6007,7 @@ msgstr "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" -#: ../../library/stdtypes.rst:4088 +#: ../../library/stdtypes.rst:4108 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 " @@ -5991,7 +6016,7 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:4096 +#: ../../library/stdtypes.rst:4116 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" @@ -6003,11 +6028,11 @@ msgstr "" ">>> b\"-42\".zfill(5)\n" "b'-0042'" -#: ../../library/stdtypes.rst:4110 +#: ../../library/stdtypes.rst:4130 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:4127 +#: ../../library/stdtypes.rst:4147 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 " @@ -6015,7 +6040,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:4132 +#: ../../library/stdtypes.rst:4152 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -6025,7 +6050,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:4139 +#: ../../library/stdtypes.rst:4159 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 " @@ -6033,7 +6058,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:4173 +#: ../../library/stdtypes.rst:4193 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 " @@ -6041,77 +6066,77 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:4225 +#: ../../library/stdtypes.rst:4245 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:4247 +#: ../../library/stdtypes.rst:4267 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:4250 +#: ../../library/stdtypes.rst:4270 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:4250 +#: ../../library/stdtypes.rst:4270 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`~object.__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:4254 +#: ../../library/stdtypes.rst:4274 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4257 +#: ../../library/stdtypes.rst:4277 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:4260 +#: ../../library/stdtypes.rst:4280 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4260 +#: ../../library/stdtypes.rst:4280 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:4295 +#: ../../library/stdtypes.rst:4315 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%s'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4298 +#: ../../library/stdtypes.rst:4318 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%r'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4310 +#: ../../library/stdtypes.rst:4330 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:4317 +#: ../../library/stdtypes.rst:4337 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:4319 +#: ../../library/stdtypes.rst:4339 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:4325 +#: ../../library/stdtypes.rst:4345 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:4329 +#: ../../library/stdtypes.rst:4349 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 " @@ -6119,32 +6144,32 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:4334 +#: ../../library/stdtypes.rst:4354 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:4338 +#: ../../library/stdtypes.rst:4358 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -#: ../../library/stdtypes.rst:4341 +#: ../../library/stdtypes.rst:4361 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:4344 +#: ../../library/stdtypes.rst:4364 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:4347 +#: ../../library/stdtypes.rst:4367 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -6166,7 +6191,7 @@ msgstr "" ">>> bytes(v[1:4])\n" "b'bce'" -#: ../../library/stdtypes.rst:4357 +#: ../../library/stdtypes.rst:4377 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 " @@ -6177,11 +6202,11 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:4366 +#: ../../library/stdtypes.rst:4386 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:4368 +#: ../../library/stdtypes.rst:4388 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -6203,13 +6228,13 @@ msgstr "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" -#: ../../library/stdtypes.rst:4378 +#: ../../library/stdtypes.rst:4398 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:4381 +#: ../../library/stdtypes.rst:4401 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -6249,14 +6274,14 @@ msgstr "" ">>> data\n" "bytearray(b'z1spam')" -#: ../../library/stdtypes.rst:4399 +#: ../../library/stdtypes.rst:4419 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:4403 +#: ../../library/stdtypes.rst:4423 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -6274,44 +6299,44 @@ msgstr "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" -#: ../../library/stdtypes.rst:4411 +#: ../../library/stdtypes.rst:4431 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:4415 +#: ../../library/stdtypes.rst:4435 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:4419 +#: ../../library/stdtypes.rst:4439 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:4422 +#: ../../library/stdtypes.rst:4442 msgid "memoryview is now a :term:`generic type`." msgstr "" -#: ../../library/stdtypes.rst:4425 +#: ../../library/stdtypes.rst:4445 msgid ":class:`memoryview` has several methods:" msgstr ":class:`memoryview` 有幾個方法:" -#: ../../library/stdtypes.rst:4429 +#: ../../library/stdtypes.rst:4449 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:4433 +#: ../../library/stdtypes.rst:4453 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:4436 +#: ../../library/stdtypes.rst:4456 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -6345,14 +6370,14 @@ msgstr "" ">>> z.tolist() == c.tolist()\n" "True" -#: ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:4472 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:4456 +#: ../../library/stdtypes.rst:4476 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -6378,25 +6403,25 @@ msgstr "" ">>> a == b\n" "False" -#: ../../library/stdtypes.rst:4468 +#: ../../library/stdtypes.rst:4488 msgid "" "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:4471 +#: ../../library/stdtypes.rst:4491 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:4477 +#: ../../library/stdtypes.rst:4497 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:4480 +#: ../../library/stdtypes.rst:4500 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -6410,7 +6435,7 @@ msgstr "" ">>> bytes(m)\n" "b'abc'" -#: ../../library/stdtypes.rst:4486 +#: ../../library/stdtypes.rst:4506 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -6418,7 +6443,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:4491 +#: ../../library/stdtypes.rst:4511 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' " @@ -6427,13 +6452,13 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:4501 +#: ../../library/stdtypes.rst:4521 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:4504 +#: ../../library/stdtypes.rst:4524 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" @@ -6443,18 +6468,18 @@ msgstr "" ">>> m.hex()\n" "'616263'" -#: ../../library/stdtypes.rst:4510 +#: ../../library/stdtypes.rst:4530 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:4517 +#: ../../library/stdtypes.rst:4537 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:4519 +#: ../../library/stdtypes.rst:4539 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -6472,19 +6497,19 @@ msgstr "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" -#: ../../library/stdtypes.rst:4527 +#: ../../library/stdtypes.rst:4547 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:4534 +#: ../../library/stdtypes.rst:4554 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:4537 +#: ../../library/stdtypes.rst:4557 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -6510,7 +6535,7 @@ msgstr "" ">>> mm.tolist()\n" "[43, 98, 99]" -#: ../../library/stdtypes.rst:4553 +#: ../../library/stdtypes.rst:4573 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 :" @@ -6519,14 +6544,14 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:4559 +#: ../../library/stdtypes.rst:4579 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:4563 +#: ../../library/stdtypes.rst:4583 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -6542,13 +6567,13 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4570 +#: ../../library/stdtypes.rst:4590 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:4573 +#: ../../library/stdtypes.rst:4593 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -6568,7 +6593,7 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4587 +#: ../../library/stdtypes.rst:4607 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 " @@ -6577,7 +6602,7 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:4593 +#: ../../library/stdtypes.rst:4613 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 " @@ -6585,11 +6610,11 @@ msgid "" "Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:4599 +#: ../../library/stdtypes.rst:4619 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:4601 +#: ../../library/stdtypes.rst:4621 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -6633,11 +6658,11 @@ msgstr "" ">>> y.nbytes\n" "24" -#: ../../library/stdtypes.rst:4622 +#: ../../library/stdtypes.rst:4642 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4624 +#: ../../library/stdtypes.rst:4644 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -6661,11 +6686,11 @@ msgstr "" ">>> b\n" "bytearray(b'ayz')" -#: ../../library/stdtypes.rst:4635 +#: ../../library/stdtypes.rst:4655 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4637 +#: ../../library/stdtypes.rst:4657 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -6715,11 +6740,11 @@ msgstr "" ">>> z.nbytes\n" "48" -#: ../../library/stdtypes.rst:4661 +#: ../../library/stdtypes.rst:4681 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4663 +#: ../../library/stdtypes.rst:4683 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -6741,33 +6766,33 @@ msgstr "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" -#: ../../library/stdtypes.rst:4675 +#: ../../library/stdtypes.rst:4695 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4680 +#: ../../library/stdtypes.rst:4700 msgid "Count the number of occurrences of *value*." msgstr "計算 *value* 的出現次數" -#: ../../library/stdtypes.rst:4686 +#: ../../library/stdtypes.rst:4706 msgid "" "Return the index of the first occurrence of *value* (at or after index " "*start* and before index *stop*)." msgstr "" -#: ../../library/stdtypes.rst:4689 +#: ../../library/stdtypes.rst:4709 msgid "Raises a :exc:`ValueError` if *value* cannot be found." msgstr "在找不到 *value* 時引發 :exc:`ValueError`。" -#: ../../library/stdtypes.rst:4693 +#: ../../library/stdtypes.rst:4713 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4697 +#: ../../library/stdtypes.rst:4717 msgid "The underlying object of the memoryview::" msgstr "memoryview 的底層物件: ::" -#: ../../library/stdtypes.rst:4699 +#: ../../library/stdtypes.rst:4719 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" @@ -6779,14 +6804,14 @@ msgstr "" ">>> m.obj is b\n" "True" -#: ../../library/stdtypes.rst:4708 +#: ../../library/stdtypes.rst:4728 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:4712 +#: ../../library/stdtypes.rst:4732 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -6818,11 +6843,11 @@ msgstr "" ">>> len(y.tobytes())\n" "12" -#: ../../library/stdtypes.rst:4727 +#: ../../library/stdtypes.rst:4747 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4729 +#: ../../library/stdtypes.rst:4749 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" @@ -6846,11 +6871,11 @@ msgstr "" ">>> y.nbytes\n" "96" -#: ../../library/stdtypes.rst:4744 +#: ../../library/stdtypes.rst:4764 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4748 +#: ../../library/stdtypes.rst:4768 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 " @@ -6858,17 +6883,17 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4773 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:4759 +#: ../../library/stdtypes.rst:4779 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4761 +#: ../../library/stdtypes.rst:4781 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -6888,49 +6913,49 @@ msgstr "" ">>> struct.calcsize('H') == m.itemsize\n" "True" -#: ../../library/stdtypes.rst:4772 +#: ../../library/stdtypes.rst:4792 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4777 +#: ../../library/stdtypes.rst:4797 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:4780 ../../library/stdtypes.rst:4788 +#: ../../library/stdtypes.rst:4800 ../../library/stdtypes.rst:4808 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4785 +#: ../../library/stdtypes.rst:4805 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:4793 +#: ../../library/stdtypes.rst:4813 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4797 +#: ../../library/stdtypes.rst:4817 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4803 +#: ../../library/stdtypes.rst:4823 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4809 +#: ../../library/stdtypes.rst:4829 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4817 +#: ../../library/stdtypes.rst:4837 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4821 +#: ../../library/stdtypes.rst:4841 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -6940,7 +6965,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:4848 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 " @@ -6948,7 +6973,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4833 +#: ../../library/stdtypes.rst:4853 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -6960,18 +6985,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4842 +#: ../../library/stdtypes.rst:4862 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:4846 +#: ../../library/stdtypes.rst:4866 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4851 +#: ../../library/stdtypes.rst:4871 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 " @@ -6979,92 +7004,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4857 +#: ../../library/stdtypes.rst:4877 msgid "Sets can be created by several means:" msgstr "集合可以以多種方式建立:" -#: ../../library/stdtypes.rst:4859 +#: ../../library/stdtypes.rst:4879 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4860 +#: ../../library/stdtypes.rst:4880 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4861 +#: ../../library/stdtypes.rst:4881 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4863 +#: ../../library/stdtypes.rst:4883 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4868 +#: ../../library/stdtypes.rst:4888 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4872 +#: ../../library/stdtypes.rst:4892 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4876 +#: ../../library/stdtypes.rst:4896 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4881 +#: ../../library/stdtypes.rst:4901 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:4888 +#: ../../library/stdtypes.rst:4908 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4892 +#: ../../library/stdtypes.rst:4912 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4899 +#: ../../library/stdtypes.rst:4919 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4903 +#: ../../library/stdtypes.rst:4923 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4910 +#: ../../library/stdtypes.rst:4930 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4916 +#: ../../library/stdtypes.rst:4936 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4922 +#: ../../library/stdtypes.rst:4942 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4928 +#: ../../library/stdtypes.rst:4948 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4933 +#: ../../library/stdtypes.rst:4953 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4936 +#: ../../library/stdtypes.rst:4956 msgid "" "Note, the non-operator versions of :meth:`~frozenset.union`, :meth:" "`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset." @@ -7075,7 +7100,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4943 +#: ../../library/stdtypes.rst:4963 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 " @@ -7085,14 +7110,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4950 +#: ../../library/stdtypes.rst:4970 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:4954 +#: ../../library/stdtypes.rst:4974 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 " @@ -7100,78 +7125,78 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4959 +#: ../../library/stdtypes.rst:4979 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:4962 +#: ../../library/stdtypes.rst:4982 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4964 +#: ../../library/stdtypes.rst:4984 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:4968 +#: ../../library/stdtypes.rst:4988 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4994 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4999 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:5004 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:5009 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:5013 msgid "Add element *elem* to the set." msgstr "將元素 *elem* 加入集合。" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:5017 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5022 msgid "Remove element *elem* from the set if it is present." msgstr "如果 *elem* 存在於集合中則將其移除。" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5026 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5031 msgid "Remove all elements from the set." msgstr "從集合中移除所有元素。" -#: ../../library/stdtypes.rst:5014 +#: ../../library/stdtypes.rst:5034 msgid "" "Note, the non-operator versions of the :meth:`~set.update`, :meth:`~set." "intersection_update`, :meth:`~set.difference_update`, and :meth:`~set." "symmetric_difference_update` methods will accept any iterable as an argument." msgstr "" -#: ../../library/stdtypes.rst:5019 +#: ../../library/stdtypes.rst:5039 msgid "" "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:`~set." "remove`, and :meth:`~set.discard` methods may be a set. To support " @@ -7179,11 +7204,11 @@ msgid "" "*elem*." msgstr "" -#: ../../library/stdtypes.rst:5028 +#: ../../library/stdtypes.rst:5048 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:5038 +#: ../../library/stdtypes.rst:5058 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -7192,7 +7217,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:5044 +#: ../../library/stdtypes.rst:5064 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -7201,33 +7226,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:5055 +#: ../../library/stdtypes.rst:5075 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:5058 +#: ../../library/stdtypes.rst:5078 msgid "Dictionaries can be created by several means:" msgstr "字典可以用數種方式建立:" -#: ../../library/stdtypes.rst:5060 +#: ../../library/stdtypes.rst:5080 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:5062 +#: ../../library/stdtypes.rst:5082 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:5063 +#: ../../library/stdtypes.rst:5083 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:5066 +#: ../../library/stdtypes.rst:5086 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 " @@ -7240,7 +7265,7 @@ msgid "" "that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:5076 +#: ../../library/stdtypes.rst:5096 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 " @@ -7248,7 +7273,7 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:5101 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -7257,7 +7282,7 @@ msgid "" "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:5087 +#: ../../library/stdtypes.rst:5107 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -7277,19 +7302,19 @@ msgstr "" ">>> a == b == c == d == e == f\n" "True" -#: ../../library/stdtypes.rst:5096 +#: ../../library/stdtypes.rst:5116 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:5099 +#: ../../library/stdtypes.rst:5119 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:5102 +#: ../../library/stdtypes.rst:5122 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7321,33 +7346,33 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:5117 +#: ../../library/stdtypes.rst:5137 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:5121 +#: ../../library/stdtypes.rst:5141 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:5126 +#: ../../library/stdtypes.rst:5146 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5130 +#: ../../library/stdtypes.rst:5150 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5134 +#: ../../library/stdtypes.rst:5154 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:5139 +#: ../../library/stdtypes.rst:5159 msgid "" "If a subclass of dict defines a method :meth:`~object.__missing__` and *key* " "is not present, the ``d[key]`` operation calls that method with the key " @@ -7358,7 +7383,7 @@ msgid "" "__missing__` must be a method; it cannot be an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:5147 +#: ../../library/stdtypes.rst:5167 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -7382,51 +7407,51 @@ msgstr "" ">>> c['red']\n" "1" -#: ../../library/stdtypes.rst:5158 +#: ../../library/stdtypes.rst:5178 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different :meth:`!__missing__` method is used by :class:" "`collections.defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:5165 +#: ../../library/stdtypes.rst:5185 msgid "Set ``d[key]`` to *value*." msgstr "將 ``d[key]`` 設為 *value*。" -#: ../../library/stdtypes.rst:5169 +#: ../../library/stdtypes.rst:5189 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:5174 +#: ../../library/stdtypes.rst:5194 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "若 *d* 有鍵 *key* 則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/stdtypes.rst:5178 +#: ../../library/stdtypes.rst:5198 msgid "Equivalent to ``not key in d``." msgstr "等價於 ``not key in d``。" -#: ../../library/stdtypes.rst:5182 +#: ../../library/stdtypes.rst:5202 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5187 +#: ../../library/stdtypes.rst:5207 msgid "Remove all items from the dictionary." msgstr "從字典中移除所有項目。" -#: ../../library/stdtypes.rst:5191 +#: ../../library/stdtypes.rst:5211 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5195 +#: ../../library/stdtypes.rst:5215 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:5197 +#: ../../library/stdtypes.rst:5217 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 " @@ -7435,70 +7460,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:5205 +#: ../../library/stdtypes.rst:5225 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:5211 +#: ../../library/stdtypes.rst:5231 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5216 +#: ../../library/stdtypes.rst:5236 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:5222 +#: ../../library/stdtypes.rst:5242 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:5228 +#: ../../library/stdtypes.rst:5248 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:5231 +#: ../../library/stdtypes.rst:5251 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:5235 +#: ../../library/stdtypes.rst:5255 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:5241 +#: ../../library/stdtypes.rst:5261 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5248 +#: ../../library/stdtypes.rst:5268 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:5256 +#: ../../library/stdtypes.rst:5276 msgid "" "Update the dictionary with the key/value pairs from *mapping* or *iterable* " "and *kwargs*, overwriting existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5279 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -7507,20 +7532,20 @@ msgid "" "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:5267 +#: ../../library/stdtypes.rst:5287 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5270 +#: ../../library/stdtypes.rst:5290 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:5274 +#: ../../library/stdtypes.rst:5294 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -7530,25 +7555,25 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:5280 +#: ../../library/stdtypes.rst:5300 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:5288 +#: ../../library/stdtypes.rst:5308 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:5294 +#: ../../library/stdtypes.rst:5314 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:5296 +#: ../../library/stdtypes.rst:5316 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7570,21 +7595,21 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:5306 +#: ../../library/stdtypes.rst:5326 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5311 +#: ../../library/stdtypes.rst:5331 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:5318 +#: ../../library/stdtypes.rst:5338 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:5320 +#: ../../library/stdtypes.rst:5340 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 " @@ -7592,23 +7617,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:5325 +#: ../../library/stdtypes.rst:5345 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:5330 +#: ../../library/stdtypes.rst:5350 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:5354 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5337 +#: ../../library/stdtypes.rst:5357 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -7616,39 +7641,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:5342 +#: ../../library/stdtypes.rst:5362 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:5345 +#: ../../library/stdtypes.rst:5365 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:5350 +#: ../../library/stdtypes.rst:5370 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:5355 +#: ../../library/stdtypes.rst:5375 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:5358 +#: ../../library/stdtypes.rst:5378 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5363 +#: ../../library/stdtypes.rst:5383 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:5368 +#: ../../library/stdtypes.rst:5388 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 " @@ -7662,11 +7687,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:5380 +#: ../../library/stdtypes.rst:5400 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5402 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -7707,11 +7732,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:5424 +#: ../../library/stdtypes.rst:5444 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:5431 +#: ../../library/stdtypes.rst:5451 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 " @@ -7722,7 +7747,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:5439 +#: ../../library/stdtypes.rst:5459 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 " @@ -7733,7 +7758,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:5444 +#: ../../library/stdtypes.rst:5464 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -7742,7 +7767,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5468 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 " @@ -7756,7 +7781,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的目前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:5458 +#: ../../library/stdtypes.rst:5478 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -7768,7 +7793,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:5463 +#: ../../library/stdtypes.rst:5483 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -7779,14 +7804,14 @@ msgstr "" "keyword:`!with` 陳述式之後的陳述式。否則,該例外將在該方法執行完畢後繼續傳播 " "(propagate)。" -#: ../../library/stdtypes.rst:5468 +#: ../../library/stdtypes.rst:5488 msgid "" "If this method raises an exception while handling an earlier exception from " "the :keyword:`with` block, the new exception is raised, and the original " "exception is stored in its :attr:`~BaseException.__context__` attribute." msgstr "" -#: ../../library/stdtypes.rst:5472 +#: ../../library/stdtypes.rst:5492 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -7798,7 +7823,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`~object.__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:5478 +#: ../../library/stdtypes.rst:5498 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -7810,7 +7835,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:5484 +#: ../../library/stdtypes.rst:5504 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -7825,7 +7850,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:5491 +#: ../../library/stdtypes.rst:5511 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 " @@ -7837,7 +7862,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:5499 +#: ../../library/stdtypes.rst:5519 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -7845,7 +7870,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" "ref:`聯合 (Union) `" -#: ../../library/stdtypes.rst:5504 +#: ../../library/stdtypes.rst:5524 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -7853,11 +7878,11 @@ msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" -#: ../../library/stdtypes.rst:5511 +#: ../../library/stdtypes.rst:5531 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:5517 +#: ../../library/stdtypes.rst:5537 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -7873,7 +7898,7 @@ msgstr "" "立的。``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使" "用。" -#: ../../library/stdtypes.rst:5527 +#: ../../library/stdtypes.rst:5547 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -7881,7 +7906,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:5530 +#: ../../library/stdtypes.rst:5550 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -7889,7 +7914,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:5533 +#: ../../library/stdtypes.rst:5553 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 " @@ -7901,7 +7926,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:5539 +#: ../../library/stdtypes.rst:5559 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 " @@ -7913,7 +7938,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 `\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:5545 +#: ../../library/stdtypes.rst:5565 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 " @@ -7925,7 +7950,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5571 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." @@ -7938,7 +7963,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match ` 物件。" -#: ../../library/stdtypes.rst:5557 +#: ../../library/stdtypes.rst:5577 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -7947,7 +7972,7 @@ msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" -#: ../../library/stdtypes.rst:5563 +#: ../../library/stdtypes.rst:5583 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -7957,7 +7982,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:5568 +#: ../../library/stdtypes.rst:5588 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -7965,7 +7990,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:5571 +#: ../../library/stdtypes.rst:5591 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 " @@ -7976,7 +8001,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5596 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -7984,7 +8009,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:5579 +#: ../../library/stdtypes.rst:5599 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -7992,7 +8017,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5602 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -8004,7 +8029,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:5587 +#: ../../library/stdtypes.rst:5607 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -8016,7 +8041,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5613 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -8026,13 +8051,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:5597 +#: ../../library/stdtypes.rst:5617 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5600 +#: ../../library/stdtypes.rst:5620 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -8050,13 +8075,13 @@ msgstr "" ">>> type(l)\n" "" -#: ../../library/stdtypes.rst:5608 +#: ../../library/stdtypes.rst:5628 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5610 +#: ../../library/stdtypes.rst:5630 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -8070,7 +8095,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5616 +#: ../../library/stdtypes.rst:5636 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -8078,7 +8103,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5619 +#: ../../library/stdtypes.rst:5639 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -8090,7 +8115,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5624 +#: ../../library/stdtypes.rst:5644 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -8100,7 +8125,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5628 +#: ../../library/stdtypes.rst:5648 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -8112,253 +8137,253 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5635 +#: ../../library/stdtypes.rst:5655 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5637 +#: ../../library/stdtypes.rst:5657 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5640 +#: ../../library/stdtypes.rst:5660 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5641 +#: ../../library/stdtypes.rst:5661 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5642 +#: ../../library/stdtypes.rst:5662 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5643 +#: ../../library/stdtypes.rst:5663 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5644 +#: ../../library/stdtypes.rst:5664 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5645 +#: ../../library/stdtypes.rst:5665 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5646 +#: ../../library/stdtypes.rst:5666 msgid ":class:`asyncio.Future`" msgstr ":class:`asyncio.Future`" -#: ../../library/stdtypes.rst:5647 +#: ../../library/stdtypes.rst:5667 msgid ":class:`asyncio.Task`" msgstr ":class:`asyncio.Task`" -#: ../../library/stdtypes.rst:5648 +#: ../../library/stdtypes.rst:5668 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5649 +#: ../../library/stdtypes.rst:5669 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5650 +#: ../../library/stdtypes.rst:5670 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5651 +#: ../../library/stdtypes.rst:5671 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5652 +#: ../../library/stdtypes.rst:5672 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5653 +#: ../../library/stdtypes.rst:5673 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5654 +#: ../../library/stdtypes.rst:5674 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5655 +#: ../../library/stdtypes.rst:5675 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5656 +#: ../../library/stdtypes.rst:5676 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5657 +#: ../../library/stdtypes.rst:5677 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5658 +#: ../../library/stdtypes.rst:5678 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5659 +#: ../../library/stdtypes.rst:5679 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5660 +#: ../../library/stdtypes.rst:5680 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5661 +#: ../../library/stdtypes.rst:5681 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5662 +#: ../../library/stdtypes.rst:5682 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5663 +#: ../../library/stdtypes.rst:5683 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5664 +#: ../../library/stdtypes.rst:5684 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5665 +#: ../../library/stdtypes.rst:5685 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5666 +#: ../../library/stdtypes.rst:5686 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5667 +#: ../../library/stdtypes.rst:5687 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5668 +#: ../../library/stdtypes.rst:5688 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5669 +#: ../../library/stdtypes.rst:5689 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5670 +#: ../../library/stdtypes.rst:5690 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5671 +#: ../../library/stdtypes.rst:5691 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5672 +#: ../../library/stdtypes.rst:5692 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5673 +#: ../../library/stdtypes.rst:5693 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5674 +#: ../../library/stdtypes.rst:5694 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5675 +#: ../../library/stdtypes.rst:5695 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5676 +#: ../../library/stdtypes.rst:5696 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5677 +#: ../../library/stdtypes.rst:5697 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5678 +#: ../../library/stdtypes.rst:5698 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5679 +#: ../../library/stdtypes.rst:5699 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5680 +#: ../../library/stdtypes.rst:5700 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5681 +#: ../../library/stdtypes.rst:5701 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5682 +#: ../../library/stdtypes.rst:5702 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5683 +#: ../../library/stdtypes.rst:5703 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5684 +#: ../../library/stdtypes.rst:5704 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5685 +#: ../../library/stdtypes.rst:5705 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5686 +#: ../../library/stdtypes.rst:5706 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5687 +#: ../../library/stdtypes.rst:5707 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5688 +#: ../../library/stdtypes.rst:5708 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5689 +#: ../../library/stdtypes.rst:5709 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5690 +#: ../../library/stdtypes.rst:5710 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5691 +#: ../../library/stdtypes.rst:5711 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5692 +#: ../../library/stdtypes.rst:5712 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5693 +#: ../../library/stdtypes.rst:5713 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5694 +#: ../../library/stdtypes.rst:5714 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5695 +#: ../../library/stdtypes.rst:5715 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5700 +#: ../../library/stdtypes.rst:5720 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5702 +#: ../../library/stdtypes.rst:5722 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5706 +#: ../../library/stdtypes.rst:5726 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5708 +#: ../../library/stdtypes.rst:5728 msgid "" ">>> list[int].__origin__\n" "" @@ -8366,7 +8391,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5714 +#: ../../library/stdtypes.rst:5734 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 " @@ -8375,7 +8400,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5718 +#: ../../library/stdtypes.rst:5738 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -8383,7 +8408,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5724 +#: ../../library/stdtypes.rst:5744 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -8391,7 +8416,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5727 +#: ../../library/stdtypes.rst:5747 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -8405,7 +8430,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5735 +#: ../../library/stdtypes.rst:5755 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -8415,7 +8440,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5742 +#: ../../library/stdtypes.rst:5762 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -8423,19 +8448,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5750 +#: ../../library/stdtypes.rst:5770 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5751 +#: ../../library/stdtypes.rst:5771 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5753 +#: ../../library/stdtypes.rst:5773 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5754 +#: ../../library/stdtypes.rst:5774 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -8444,7 +8469,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5758 +#: ../../library/stdtypes.rst:5778 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -8452,18 +8477,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:5759 +#: ../../library/stdtypes.rst:5779 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:5768 +#: ../../library/stdtypes.rst:5788 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5774 +#: ../../library/stdtypes.rst:5794 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -8476,7 +8501,7 @@ msgstr "" "釋 (type annotation) `。與下標 :data:`typing.Union` 相比,聯合型" "別運算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5781 +#: ../../library/stdtypes.rst:5801 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 " @@ -8487,7 +8512,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5786 +#: ../../library/stdtypes.rst:5806 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -8495,7 +8520,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:5791 +#: ../../library/stdtypes.rst:5811 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 " @@ -8508,40 +8533,40 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:5799 +#: ../../library/stdtypes.rst:5819 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:5801 +#: ../../library/stdtypes.rst:5821 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:5803 +#: ../../library/stdtypes.rst:5823 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:5805 +#: ../../library/stdtypes.rst:5825 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:5807 +#: ../../library/stdtypes.rst:5827 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:5809 +#: ../../library/stdtypes.rst:5829 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:5811 +#: ../../library/stdtypes.rst:5831 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:5813 +#: ../../library/stdtypes.rst:5833 msgid "It creates instances of :class:`typing.Union`::" msgstr "它會建立 :class:`typing.Union` 的實例: ::" -#: ../../library/stdtypes.rst:5815 +#: ../../library/stdtypes.rst:5835 msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" @@ -8549,21 +8574,21 @@ msgstr "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" -#: ../../library/stdtypes.rst:5818 +#: ../../library/stdtypes.rst:5838 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:5820 +#: ../../library/stdtypes.rst:5840 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:5825 +#: ../../library/stdtypes.rst:5845 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:5828 +#: ../../library/stdtypes.rst:5848 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -8571,14 +8596,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:5831 +#: ../../library/stdtypes.rst:5851 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:5834 +#: ../../library/stdtypes.rst:5854 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -8588,7 +8613,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:5841 +#: ../../library/stdtypes.rst:5861 msgid "" "The user-exposed type for the union object can be accessed from :class:" "`typing.Union` and used for :func:`isinstance` checks::" @@ -8596,7 +8621,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`typing." "Union` 存取並用於 :func:`isinstance` 檢查: ::" -#: ../../library/stdtypes.rst:5844 +#: ../../library/stdtypes.rst:5864 msgid "" ">>> import typing\n" ">>> isinstance(int | str, typing.Union)\n" @@ -8614,7 +8639,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" -#: ../../library/stdtypes.rst:5853 +#: ../../library/stdtypes.rst:5873 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 " @@ -8623,7 +8648,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:5857 +#: ../../library/stdtypes.rst:5877 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -8649,32 +8674,32 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:5873 +#: ../../library/stdtypes.rst:5893 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:5879 +#: ../../library/stdtypes.rst:5899 msgid "" "Union objects are now instances of :class:`typing.Union`. Previously, they " "were instances of :class:`types.UnionType`, which remains an alias for :" "class:`typing.Union`." msgstr "" -#: ../../library/stdtypes.rst:5886 +#: ../../library/stdtypes.rst:5906 msgid "Other Built-in Types" msgstr "其他內建型別" -#: ../../library/stdtypes.rst:5888 +#: ../../library/stdtypes.rst:5908 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5895 +#: ../../library/stdtypes.rst:5915 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5897 +#: ../../library/stdtypes.rst:5917 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 " @@ -8685,7 +8710,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5904 +#: ../../library/stdtypes.rst:5924 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -8696,32 +8721,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5912 +#: ../../library/stdtypes.rst:5932 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5920 +#: ../../library/stdtypes.rst:5940 msgid "Classes and Class Instances" msgstr "類別與類別實例" -#: ../../library/stdtypes.rst:5922 +#: ../../library/stdtypes.rst:5942 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "請見 :ref:`objects` 和 :ref:`class`。" -#: ../../library/stdtypes.rst:5928 +#: ../../library/stdtypes.rst:5948 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5930 +#: ../../library/stdtypes.rst:5950 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:5933 +#: ../../library/stdtypes.rst:5953 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -8729,15 +8754,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5937 +#: ../../library/stdtypes.rst:5957 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:5943 +#: ../../library/stdtypes.rst:5963 msgid "Methods" msgstr "方法" -#: ../../library/stdtypes.rst:5947 +#: ../../library/stdtypes.rst:5967 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -8745,7 +8770,7 @@ msgid "" "methods>`. Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:5953 +#: ../../library/stdtypes.rst:5973 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:" @@ -8758,7 +8783,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5964 +#: ../../library/stdtypes.rst:5984 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -8769,7 +8794,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:5972 +#: ../../library/stdtypes.rst:5992 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -8797,15 +8822,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:5987 +#: ../../library/stdtypes.rst:6007 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:5995 +#: ../../library/stdtypes.rst:6015 msgid "Code Objects" msgstr "程式碼物件" -#: ../../library/stdtypes.rst:6001 +#: ../../library/stdtypes.rst:6021 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -8815,7 +8840,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:6008 +#: ../../library/stdtypes.rst:6028 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -8824,21 +8849,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:6015 +#: ../../library/stdtypes.rst:6035 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:6018 +#: ../../library/stdtypes.rst:6038 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:6024 +#: ../../library/stdtypes.rst:6044 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:6030 +#: ../../library/stdtypes.rst:6050 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 " @@ -8846,30 +8871,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:6035 +#: ../../library/stdtypes.rst:6055 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:6041 +#: ../../library/stdtypes.rst:6061 msgid "The Null Object" msgstr "Null 物件" -#: ../../library/stdtypes.rst:6043 +#: ../../library/stdtypes.rst:6063 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:6047 +#: ../../library/stdtypes.rst:6067 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:6054 +#: ../../library/stdtypes.rst:6074 msgid "The Ellipsis Object" msgstr "Ellipsis 物件" -#: ../../library/stdtypes.rst:6056 +#: ../../library/stdtypes.rst:6076 msgid "" "This object is commonly used to indicate that something is omitted. It " "supports no special operations. There is exactly one ellipsis object, " @@ -8877,63 +8902,63 @@ msgid "" "the :const:`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:6061 +#: ../../library/stdtypes.rst:6081 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:6063 +#: ../../library/stdtypes.rst:6083 msgid "" "In typical use, ``...`` as the ``Ellipsis`` object appears in a few " "different places, for instance:" msgstr "" -#: ../../library/stdtypes.rst:6066 +#: ../../library/stdtypes.rst:6086 msgid "" "In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." msgstr "" -#: ../../library/stdtypes.rst:6069 +#: ../../library/stdtypes.rst:6089 msgid "" "As the body of a function instead of a :ref:`pass statement `." msgstr "" -#: ../../library/stdtypes.rst:6071 +#: ../../library/stdtypes.rst:6091 msgid "" "In third-party libraries, such as `Numpy's slicing and striding `_." msgstr "" -#: ../../library/stdtypes.rst:6074 +#: ../../library/stdtypes.rst:6094 msgid "" "Python also uses three dots in ways that are not ``Ellipsis`` objects, for " "instance:" msgstr "" -#: ../../library/stdtypes.rst:6076 +#: ../../library/stdtypes.rst:6096 msgid "" "Doctest's :const:`ELLIPSIS `, as a pattern for missing " "content." msgstr "" -#: ../../library/stdtypes.rst:6078 +#: ../../library/stdtypes.rst:6098 msgid "" "The default Python prompt of the :term:`interactive` shell when partial " "input is incomplete." msgstr "" -#: ../../library/stdtypes.rst:6080 +#: ../../library/stdtypes.rst:6100 msgid "" "Lastly, the Python documentation often uses three dots in conventional " "English usage to mean omitted content, even in code examples that also use " "them as the ``Ellipsis``." msgstr "" -#: ../../library/stdtypes.rst:6088 +#: ../../library/stdtypes.rst:6108 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:6090 +#: ../../library/stdtypes.rst:6110 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 " @@ -8941,64 +8966,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:6095 +#: ../../library/stdtypes.rst:6115 msgid "It is written as :code:`NotImplemented`." msgstr "它被寫為 :code:`NotImplemented`。" -#: ../../library/stdtypes.rst:6101 +#: ../../library/stdtypes.rst:6121 msgid "Internal Objects" msgstr "內部物件" -#: ../../library/stdtypes.rst:6103 +#: ../../library/stdtypes.rst:6123 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:6111 +#: ../../library/stdtypes.rst:6131 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:6113 +#: ../../library/stdtypes.rst:6133 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:6120 +#: ../../library/stdtypes.rst:6140 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:6126 +#: ../../library/stdtypes.rst:6146 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:6134 +#: ../../library/stdtypes.rst:6154 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:6139 +#: ../../library/stdtypes.rst:6159 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:6144 +#: ../../library/stdtypes.rst:6164 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:6154 +#: ../../library/stdtypes.rst:6174 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:6156 +#: ../../library/stdtypes.rst:6176 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 " @@ -9006,7 +9031,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:6161 +#: ../../library/stdtypes.rst:6181 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 " @@ -9016,24 +9041,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:6168 +#: ../../library/stdtypes.rst:6188 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:6170 +#: ../../library/stdtypes.rst:6190 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:6174 +#: ../../library/stdtypes.rst:6194 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:6176 +#: ../../library/stdtypes.rst:6196 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -9057,7 +9082,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:6196 +#: ../../library/stdtypes.rst:6216 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -9065,11 +9090,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:6201 +#: ../../library/stdtypes.rst:6221 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:6203 +#: ../../library/stdtypes.rst:6223 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -9087,84 +9112,84 @@ msgstr "" "... '571186405732').to_bytes(53, 'big')\n" "..." -#: ../../library/stdtypes.rst:6216 +#: ../../library/stdtypes.rst:6236 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:6218 +#: ../../library/stdtypes.rst:6238 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:6221 +#: ../../library/stdtypes.rst:6241 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:6222 +#: ../../library/stdtypes.rst:6242 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:6223 +#: ../../library/stdtypes.rst:6243 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:6224 +#: ../../library/stdtypes.rst:6244 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:6225 +#: ../../library/stdtypes.rst:6245 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:6228 +#: ../../library/stdtypes.rst:6248 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:6230 +#: ../../library/stdtypes.rst:6250 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:6231 +#: ../../library/stdtypes.rst:6251 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:6232 +#: ../../library/stdtypes.rst:6252 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:6233 +#: ../../library/stdtypes.rst:6253 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:6234 +#: ../../library/stdtypes.rst:6254 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:6235 +#: ../../library/stdtypes.rst:6255 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:6238 +#: ../../library/stdtypes.rst:6258 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:6240 +#: ../../library/stdtypes.rst:6260 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:6243 +#: ../../library/stdtypes.rst:6263 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:6246 +#: ../../library/stdtypes.rst:6266 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -9172,7 +9197,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:6248 +#: ../../library/stdtypes.rst:6268 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 " @@ -9181,38 +9206,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:6254 +#: ../../library/stdtypes.rst:6274 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:6257 +#: ../../library/stdtypes.rst:6277 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:6261 +#: ../../library/stdtypes.rst:6281 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:6263 +#: ../../library/stdtypes.rst:6283 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:6265 +#: ../../library/stdtypes.rst:6285 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:6272 +#: ../../library/stdtypes.rst:6292 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 " @@ -9224,7 +9249,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:6281 +#: ../../library/stdtypes.rst:6301 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 " @@ -9232,11 +9257,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:6287 +#: ../../library/stdtypes.rst:6307 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:6289 +#: ../../library/stdtypes.rst:6309 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 " @@ -9244,11 +9269,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:6294 +#: ../../library/stdtypes.rst:6314 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:6296 +#: ../../library/stdtypes.rst:6316 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -9270,38 +9295,38 @@ msgstr "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" -#: ../../library/stdtypes.rst:6306 +#: ../../library/stdtypes.rst:6326 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:6310 +#: ../../library/stdtypes.rst:6330 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:6311 +#: ../../library/stdtypes.rst:6331 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:6314 +#: ../../library/stdtypes.rst:6334 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:6317 +#: ../../library/stdtypes.rst:6337 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:6319 +#: ../../library/stdtypes.rst:6339 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:6322 +#: ../../library/stdtypes.rst:6342 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -9314,13 +9339,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:324 #: ../../library/stdtypes.rst:401 ../../library/stdtypes.rst:994 #: ../../library/stdtypes.rst:1181 ../../library/stdtypes.rst:1203 -#: ../../library/stdtypes.rst:1218 ../../library/stdtypes.rst:5030 -#: ../../library/stdtypes.rst:6026 +#: ../../library/stdtypes.rst:1218 ../../library/stdtypes.rst:5050 +#: ../../library/stdtypes.rst:6046 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1218 -#: ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:5050 msgid "statement" msgstr "statement(陳述式)" @@ -9442,11 +9467,11 @@ msgstr "is not" #: ../../library/stdtypes.rst:1203 ../../library/stdtypes.rst:1368 #: ../../library/stdtypes.rst:1447 ../../library/stdtypes.rst:1491 #: ../../library/stdtypes.rst:1612 ../../library/stdtypes.rst:1742 -#: ../../library/stdtypes.rst:3051 ../../library/stdtypes.rst:3070 -#: ../../library/stdtypes.rst:3183 ../../library/stdtypes.rst:4819 -#: ../../library/stdtypes.rst:5030 ../../library/stdtypes.rst:5513 -#: ../../library/stdtypes.rst:5770 ../../library/stdtypes.rst:5945 -#: ../../library/stdtypes.rst:5990 +#: ../../library/stdtypes.rst:3071 ../../library/stdtypes.rst:3090 +#: ../../library/stdtypes.rst:3203 ../../library/stdtypes.rst:4839 +#: ../../library/stdtypes.rst:5050 ../../library/stdtypes.rst:5533 +#: ../../library/stdtypes.rst:5790 ../../library/stdtypes.rst:5965 +#: ../../library/stdtypes.rst:6010 msgid "object" msgstr "object(物件)" @@ -9538,9 +9563,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:994 -#: ../../library/stdtypes.rst:1181 ../../library/stdtypes.rst:5030 -#: ../../library/stdtypes.rst:5997 ../../library/stdtypes.rst:6011 -#: ../../library/stdtypes.rst:6026 +#: ../../library/stdtypes.rst:1181 ../../library/stdtypes.rst:5050 +#: ../../library/stdtypes.rst:6017 ../../library/stdtypes.rst:6031 +#: ../../library/stdtypes.rst:6046 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -9556,8 +9581,8 @@ msgstr "float" msgid "complex" msgstr "complex(複數)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:2927 -#: ../../library/stdtypes.rst:4187 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:2947 +#: ../../library/stdtypes.rst:4207 msgid "+ (plus)" msgstr "+ (加號)" @@ -9569,13 +9594,13 @@ msgstr "unary operator(一元運算子)" msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:2927 -#: ../../library/stdtypes.rst:4187 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:2947 +#: ../../library/stdtypes.rst:4207 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:2884 -#: ../../library/stdtypes.rst:4144 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:2904 +#: ../../library/stdtypes.rst:4164 msgid "* (asterisk)" msgstr "* (星號)" @@ -9587,8 +9612,8 @@ msgstr "/ (斜線)" msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:2847 -#: ../../library/stdtypes.rst:4112 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:2867 +#: ../../library/stdtypes.rst:4132 msgid "% (percent)" msgstr "% (百分號)" @@ -9598,7 +9623,7 @@ msgstr "**" #: ../../library/stdtypes.rst:324 ../../library/stdtypes.rst:401 #: ../../library/stdtypes.rst:994 ../../library/stdtypes.rst:1218 -#: ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:5050 msgid "operations on" msgstr "operations on(操作於)" @@ -9607,7 +9632,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:343 ../../library/stdtypes.rst:1810 -#: ../../library/stdtypes.rst:3051 ../../library/stdtypes.rst:6026 +#: ../../library/stdtypes.rst:3071 ../../library/stdtypes.rst:6046 msgid "module" msgstr "模組" @@ -9675,7 +9700,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:891 ../../library/stdtypes.rst:5426 +#: ../../library/stdtypes.rst:891 ../../library/stdtypes.rst:5446 msgid "protocol" msgstr "protocol(協定)" @@ -9701,7 +9726,7 @@ msgstr "container(容器)" msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:994 ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:994 ../../library/stdtypes.rst:5050 msgid "len" msgstr "len" @@ -9770,14 +9795,14 @@ msgstr "mutable(可變)" msgid "list" msgstr "list(串列)" -#: ../../library/stdtypes.rst:1203 ../../library/stdtypes.rst:3051 -#: ../../library/stdtypes.rst:3183 ../../library/stdtypes.rst:3293 -#: ../../library/stdtypes.rst:4112 +#: ../../library/stdtypes.rst:1203 ../../library/stdtypes.rst:3071 +#: ../../library/stdtypes.rst:3203 ../../library/stdtypes.rst:3313 +#: ../../library/stdtypes.rst:4132 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1218 ../../library/stdtypes.rst:5030 -#: ../../library/stdtypes.rst:5770 ../../library/stdtypes.rst:6026 +#: ../../library/stdtypes.rst:1218 ../../library/stdtypes.rst:5050 +#: ../../library/stdtypes.rst:5790 ../../library/stdtypes.rst:6046 msgid "type" msgstr "type(型別)" @@ -9785,7 +9810,7 @@ msgstr "type(型別)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1218 ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:1218 ../../library/stdtypes.rst:5050 msgid "del" msgstr "del" @@ -9794,8 +9819,8 @@ msgid "range" msgstr "range" #: ../../library/stdtypes.rst:1612 ../../library/stdtypes.rst:1755 -#: ../../library/stdtypes.rst:1802 ../../library/stdtypes.rst:2675 -#: ../../library/stdtypes.rst:2847 +#: ../../library/stdtypes.rst:1802 ../../library/stdtypes.rst:2695 +#: ../../library/stdtypes.rst:2867 msgid "string" msgstr "string(字串)" @@ -9816,17 +9841,17 @@ msgstr "(亦請見 string)" msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1775 ../../library/stdtypes.rst:3043 +#: ../../library/stdtypes.rst:1775 ../../library/stdtypes.rst:3063 msgid "buffer protocol" msgstr "buffer protocol(緩衝區協定)" -#: ../../library/stdtypes.rst:1775 ../../library/stdtypes.rst:3051 -#: ../../library/stdtypes.rst:3070 ../../library/stdtypes.rst:3293 -#: ../../library/stdtypes.rst:4112 +#: ../../library/stdtypes.rst:1775 ../../library/stdtypes.rst:3071 +#: ../../library/stdtypes.rst:3090 ../../library/stdtypes.rst:3313 +#: ../../library/stdtypes.rst:4132 msgid "bytes" msgstr "bytes(位元組)" -#: ../../library/stdtypes.rst:1802 ../../library/stdtypes.rst:3293 +#: ../../library/stdtypes.rst:1802 ../../library/stdtypes.rst:3313 msgid "methods" msgstr "methods(方法)" @@ -9834,240 +9859,240 @@ msgstr "methods(方法)" msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2487 ../../library/stdtypes.rst:3966 +#: ../../library/stdtypes.rst:2507 ../../library/stdtypes.rst:3986 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/stdtypes.rst:2487 +#: ../../library/stdtypes.rst:2507 msgid "str.splitlines method" msgstr "str.splitlines 方法" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "! formatted string literal" msgstr "! formatted string literals(! 格式化字串常數)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "formatted string literals" msgstr "formatted string literals(格式化字串常數)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "! f-string" msgstr "! f-string(! f 字串)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "! (exclamation mark)" msgstr "! (驚嘆號)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "= (equals)" msgstr "= (等號)" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2695 msgid "for help in debugging using string literals" msgstr "" -#: ../../library/stdtypes.rst:2847 +#: ../../library/stdtypes.rst:2867 msgid "formatting, string (%)" msgstr "formatting(格式化)、字串 (%)" -#: ../../library/stdtypes.rst:2847 +#: ../../library/stdtypes.rst:2867 msgid "interpolation, string (%)" msgstr "interpolation(插值)、字串 (%)" -#: ../../library/stdtypes.rst:2847 +#: ../../library/stdtypes.rst:2867 msgid "formatting, printf" msgstr "formatting(格式化)、printf" -#: ../../library/stdtypes.rst:2847 +#: ../../library/stdtypes.rst:2867 msgid "interpolation, printf" msgstr "interpolation(插值)、printf" -#: ../../library/stdtypes.rst:2847 ../../library/stdtypes.rst:4112 +#: ../../library/stdtypes.rst:2867 ../../library/stdtypes.rst:4132 msgid "printf-style formatting" msgstr "printf 風格格式化" -#: ../../library/stdtypes.rst:2847 ../../library/stdtypes.rst:4112 +#: ../../library/stdtypes.rst:2867 ../../library/stdtypes.rst:4132 msgid "sprintf-style formatting" msgstr "sprintf 風格格式化" -#: ../../library/stdtypes.rst:2884 ../../library/stdtypes.rst:4144 +#: ../../library/stdtypes.rst:2904 ../../library/stdtypes.rst:4164 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/stdtypes.rst:2884 ../../library/stdtypes.rst:2927 -#: ../../library/stdtypes.rst:4144 ../../library/stdtypes.rst:4187 +#: ../../library/stdtypes.rst:2904 ../../library/stdtypes.rst:2947 +#: ../../library/stdtypes.rst:4164 ../../library/stdtypes.rst:4207 msgid "in printf-style formatting" msgstr "於 printf 風格格式化" -#: ../../library/stdtypes.rst:2884 ../../library/stdtypes.rst:4144 +#: ../../library/stdtypes.rst:2904 ../../library/stdtypes.rst:4164 msgid ". (dot)" msgstr ". (點)" -#: ../../library/stdtypes.rst:2927 ../../library/stdtypes.rst:4187 +#: ../../library/stdtypes.rst:2947 ../../library/stdtypes.rst:4207 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/stdtypes.rst:2927 ../../library/stdtypes.rst:4187 +#: ../../library/stdtypes.rst:2947 ../../library/stdtypes.rst:4207 msgid "space" msgstr "space(空白)" -#: ../../library/stdtypes.rst:3043 +#: ../../library/stdtypes.rst:3063 msgid "binary sequence types" msgstr "binary sequence types(二進位序列型別)" -#: ../../library/stdtypes.rst:3051 +#: ../../library/stdtypes.rst:3071 msgid "memoryview" msgstr "memoryview(記憶體視圖)" -#: ../../library/stdtypes.rst:3051 +#: ../../library/stdtypes.rst:3071 msgid "array" msgstr "array(陣列)" -#: ../../library/stdtypes.rst:3966 +#: ../../library/stdtypes.rst:3986 msgid "bytes.splitlines method" msgstr "bytes.splitlines 方法" -#: ../../library/stdtypes.rst:3966 +#: ../../library/stdtypes.rst:3986 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines 方法" -#: ../../library/stdtypes.rst:4112 +#: ../../library/stdtypes.rst:4132 msgid "formatting" msgstr "formatting(格式化)" -#: ../../library/stdtypes.rst:4112 +#: ../../library/stdtypes.rst:4132 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:4112 +#: ../../library/stdtypes.rst:4132 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:4112 +#: ../../library/stdtypes.rst:4132 msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:4819 +#: ../../library/stdtypes.rst:4839 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:5050 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:5050 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:5137 +#: ../../library/stdtypes.rst:5157 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:5426 +#: ../../library/stdtypes.rst:5446 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:5426 +#: ../../library/stdtypes.rst:5446 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:5426 +#: ../../library/stdtypes.rst:5446 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:5501 +#: ../../library/stdtypes.rst:5521 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:5501 +#: ../../library/stdtypes.rst:5521 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:5513 +#: ../../library/stdtypes.rst:5533 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:5513 +#: ../../library/stdtypes.rst:5533 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:5513 +#: ../../library/stdtypes.rst:5533 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5770 +#: ../../library/stdtypes.rst:5790 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5770 +#: ../../library/stdtypes.rst:5790 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5945 +#: ../../library/stdtypes.rst:5965 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5990 +#: ../../library/stdtypes.rst:6010 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5990 +#: ../../library/stdtypes.rst:6010 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5997 +#: ../../library/stdtypes.rst:6017 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5997 +#: ../../library/stdtypes.rst:6017 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:6011 +#: ../../library/stdtypes.rst:6031 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:6011 +#: ../../library/stdtypes.rst:6031 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:6050 +#: ../../library/stdtypes.rst:6070 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:6050 +#: ../../library/stdtypes.rst:6070 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號字面值)" diff --git a/library/tempfile.po b/library/tempfile.po index 1901125786..430476b61b 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2026-01-07 00:14+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,18 +31,17 @@ msgstr "**原始碼:**\\ :source:`Lib/tempfile.py`" #: ../../library/tempfile.rst:17 msgid "" "This module creates temporary files and directories. It works on all " -"supported " -"platforms. :class:`TemporaryFile`, :class:`NamedTemporaryFile`, :class:`TemporaryDirectory`, " -"and :class:`SpooledTemporaryFile` are high-level interfaces which provide " -"automatic cleanup and can be used as :term:`context managers `. :func:`mkstemp` and :func:`mkdtemp` are lower-level functions " -"which require manual cleanup." -msgstr "" -"該 module(模組)用於建立臨時檔案和目錄,它可以在所有有支援的平臺上使" -"用。:class:`TemporaryFile`、:class:`NamedTemporaryFile`、:class:`TemporaryDirectory` " -"和 :class:`SpooledTemporaryFile` 是有自動清除功能的高階介面,可作為\\ :term:`" -"情境管理器 (context manager) ` 使用。:func:`mkstemp` " -"和 :func:`mkdtemp` 是低階函式,使用完畢後需手動清理。" +"supported platforms. :class:`TemporaryFile`, :class:`NamedTemporaryFile`, :" +"class:`TemporaryDirectory`, and :class:`SpooledTemporaryFile` are high-level " +"interfaces which provide automatic cleanup and can be used as :term:`context " +"managers `. :func:`mkstemp` and :func:`mkdtemp` are lower-" +"level functions which require manual cleanup." +msgstr "" +"該 module(模組)用於建立臨時檔案和目錄,它可以在所有有支援的平臺上使用。:" +"class:`TemporaryFile`、:class:`NamedTemporaryFile`、:class:" +"`TemporaryDirectory` 和 :class:`SpooledTemporaryFile` 是有自動清除功能的高階" +"介面,可作為\\ :term:`情境管理器 (context manager) ` 使用。:" +"func:`mkstemp` 和 :func:`mkdtemp` 是低階函式,使用完畢後需手動清理。" #: ../../library/tempfile.rst:24 msgid "" @@ -83,13 +82,13 @@ msgstr "" #: ../../library/tempfile.rst:44 msgid "" -"The resulting object can be used as a :term:`context manager` " -"(see :ref:`tempfile-examples`). On completion of the context or destruction " -"of the file object the temporary file will be removed from the filesystem." +"The resulting object can be used as a :term:`context manager` (see :ref:" +"`tempfile-examples`). On completion of the context or destruction of the " +"file object the temporary file will be removed from the filesystem." msgstr "" -"生成的物件可以作為\\ :term:`情境管理器 `\\ 使用(參" -"見 :ref:`tempfile-examples`)。完成情境或銷毀臨時檔案物件後,臨時檔案將從檔案" -"系統中刪除。" +"生成的物件可以作為\\ :term:`情境管理器 `\\ 使用(參見 :ref:" +"`tempfile-examples`)。完成情境或銷毀臨時檔案物件後,臨時檔案將從檔案系統中刪" +"除。" #: ../../library/tempfile.rst:49 msgid "" @@ -137,7 +136,7 @@ msgstr "" "在不是 Posix 或 Cygwin 的平臺上,TemporaryFile 是 NamedTemporaryFile 的別名。" #: ../../library/tempfile.rst:68 ../../library/tempfile.rst:137 -#: ../../library/tempfile.rst:264 +#: ../../library/tempfile.rst:265 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkstemp`` with " "argument ``fullpath``." @@ -172,8 +171,8 @@ msgid "" "with *delete* and *delete_on_close* parameters that determine whether and " "how the named file should be automatically deleted." msgstr "" -"為了管理指定檔案,它使用 *delete* 和 *delete_on_close* 參數擴" -"充 :func:`TemporaryFile` 來指定是否以及如何自動刪除指定檔案。" +"為了管理指定檔案,它使用 *delete* 和 *delete_on_close* 參數擴充 :func:" +"`TemporaryFile` 來指定是否以及如何自動刪除指定檔案。" #: ../../library/tempfile.rst:89 msgid "" @@ -203,8 +202,8 @@ msgstr "" "如果 *delete* 為 true(預設值)並且 *delete_on_close* 為 true(預設值),則檔" "案在關閉後會立即被刪除。如果 *delete* 為 true 並且 *delete_on_close* 為 " "false,則僅在情境管理器退出時刪除檔案,或者在\\ :term:`類檔案物件 `\\ 完結時刪除檔案。在這種情況下,並不總是保證能成功刪除(請參" -"閱 :meth:`object.__del__`\\ )。如果 *delete* 為 false,則會忽略 " +"object>`\\ 完結時刪除檔案。在這種情況下,並不總是保證能成功刪除(請參閱 :" +"meth:`object.__del__`\\ )。如果 *delete* 為 false,則會忽略 " "*delete_on_close* 的值。" #: ../../library/tempfile.rst:104 @@ -246,21 +245,21 @@ msgid "" "additional open shares delete access (e.g. by calling :func:`os.open` with " "the flag ``O_TEMPORARY``)" msgstr "" -"額外的 open 會共享刪除存取權限(例如,通過使用旗標 ``O_TEMPORARY`` 來呼" -"叫 :func:`os.open`\\ )" +"額外的 open 會共享刪除存取權限(例如,通過使用旗標 ``O_TEMPORARY`` 來呼叫 :" +"func:`os.open`\\ )" #: ../../library/tempfile.rst:121 msgid "" "*delete* is true but *delete_on_close* is false. Note, that in this case the " -"additional opens that do not share delete access (e.g. created via " -"builtin :func:`open`) must be closed before exiting the context manager, " -"else the :func:`os.unlink` call on context manager exit will fail with " -"a :exc:`PermissionError`." +"additional opens that do not share delete access (e.g. created via builtin :" +"func:`open`) must be closed before exiting the context manager, else the :" +"func:`os.unlink` call on context manager exit will fail with a :exc:" +"`PermissionError`." msgstr "" "*delete* 為 true 但 *delete_on_close* 為 false。請注意,在這種情況下不共享刪" "除存取權限的其他 open(例如透過內建的 :func:`open` 建立)必須在退出情境管理器" -"之前關閉,否則情境管理器上的 :func:`os.unlink` 呼叫退出將失敗並出" -"現 :exc:`PermissionError`。" +"之前關閉,否則情境管理器上的 :func:`os.unlink` 呼叫退出將失敗並出現 :exc:" +"`PermissionError`。" #: ../../library/tempfile.rst:127 msgid "" @@ -293,8 +292,8 @@ msgid "" "This class operates exactly as :func:`TemporaryFile` does, except that data " "is spooled in memory until the file size exceeds *max_size*, or until the " "file's :func:`~io.IOBase.fileno` method is called, at which point the " -"contents are written to disk and operation proceeds as " -"with :func:`TemporaryFile`." +"contents are written to disk and operation proceeds as with :func:" +"`TemporaryFile`." msgstr "" "此類別執行的操作與 :func:`TemporaryFile` 完全相同,但會將資料排存 (spool) 於" "在記憶體中,直到檔案大小超過 *max_size*,或檔案的 :func:`~io.IOBase.fileno` " @@ -317,10 +316,10 @@ msgid "" "depending on whether :meth:`rollover` has been called. This file-like " "object can be used in a :keyword:`with` statement, just like a normal file." msgstr "" -"回傳的物件是 file-like object,它的 :attr:`!_file` 屬性" -"是 :class:`io.BytesIO` 或 :class:`io.TextIOWrapper` 物件(取決於指定的是二進" -"位制模式還是文字模式)或真實的檔案物件(取決於是否已呼叫 :meth:`rollover`)。" -"file-like object 可以像普通檔案一樣在 :keyword:`with` 陳述式中使用。" +"回傳的物件是 file-like object,它的 :attr:`!_file` 屬性是 :class:`io." +"BytesIO` 或 :class:`io.TextIOWrapper` 物件(取決於指定的是二進位制模式還是文" +"字模式)或真實的檔案物件(取決於是否已呼叫 :meth:`rollover`)。file-like " +"object 可以像普通檔案一樣在 :keyword:`with` 陳述式中使用。" #: ../../library/tempfile.rst:166 msgid "the truncate method now accepts a *size* argument." @@ -337,8 +336,8 @@ msgstr "" #: ../../library/tempfile.rst:180 msgid "" -"This class securely creates a temporary directory using the same rules " -"as :func:`mkdtemp`. The resulting object can be used as a :term:`context " +"This class securely creates a temporary directory using the same rules as :" +"func:`mkdtemp`. The resulting object can be used as a :term:`context " "manager` (see :ref:`tempfile-examples`). On completion of the context or " "destruction of the temporary directory object, the newly created temporary " "directory and all its contents are removed from the filesystem." @@ -355,9 +354,9 @@ msgid "" "manager`, the :attr:`!name` will be assigned to the target of the :keyword:`!" "as` clause in the :keyword:`with` statement, if there is one." msgstr "" -"可以從回傳物件的 :attr:`!name` 屬性中找到的臨時目錄名稱。當回傳的物件用作" -"\\ :term:`情境管理器 `\\ 時,這個 :attr:`!name` 會作" -"為 :keyword:`with` 陳述句中 :keyword:`!as` 子句的目標(如果有 as 的話)。" +"可以從回傳物件的 :attr:`!name` 屬性中找到的臨時目錄名稱。當回傳的物件用作\\ :" +"term:`情境管理器 `\\ 時,這個 :attr:`!name` 會作為 :keyword:" +"`with` 陳述句中 :keyword:`!as` 子句的目標(如果有 as 的話)。" #: ../../library/tempfile.rst:195 msgid "" @@ -389,7 +388,7 @@ msgstr "" "時所採取的操作似乎不常見,但它在除錯期間或當你需要基於其他邏輯的清理行為時會" "非常有用。" -#: ../../library/tempfile.rst:210 ../../library/tempfile.rst:290 +#: ../../library/tempfile.rst:210 ../../library/tempfile.rst:291 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkdtemp`` with " "argument ``fullpath``." @@ -406,21 +405,27 @@ msgid "Added the *delete* parameter." msgstr "新增 *delete* 參數。" #: ../../library/tempfile.rst:223 +#, fuzzy msgid "" "Creates a temporary file in the most secure manner possible. There are no " "race conditions in the file's creation, assuming that the platform properly " "implements the :const:`os.O_EXCL` flag for :func:`os.open`. The file is " "readable and writable only by the creating user ID. If the platform uses " "permission bits to indicate whether a file is executable, the file is " -"executable by no one. The file descriptor is not inherited by child " -"processes." +"executable by no one." msgstr "" "盡可能以最安全的方式建立一個臨時檔案。假設所在平臺正確實作了 :func:`os.open` " "的 :const:`os.O_EXCL` 旗標,則建立檔案時不會有 race condition(競爭條件)的情" "況。該檔案只能由建立者讀寫,如果所在平臺用 permission bit(許可權位元)來表示" "檔案是否可執行,則沒有人有執行權。檔案描述器不會被子行程繼承。" -#: ../../library/tempfile.rst:231 +#: ../../library/tempfile.rst:230 +msgid "" +"The file descriptor is :ref:`not inherited by child processes " +"`." +msgstr "" + +#: ../../library/tempfile.rst:232 msgid "" "Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible for " "deleting the temporary file when done with it." @@ -428,28 +433,28 @@ msgstr "" "與 :func:`TemporaryFile` 不同,:func:`mkstemp` 使用者用完臨時檔案後需要自行將" "其刪除。" -#: ../../library/tempfile.rst:234 +#: ../../library/tempfile.rst:235 msgid "" "If *suffix* is not ``None``, the file name will end with that suffix, " "otherwise there will be no suffix. :func:`mkstemp` does not put a dot " "between the file name and the suffix; if you need one, put it at the " "beginning of *suffix*." msgstr "" -"如果 *suffix* 不是 ``None`` 則檔名將以該後綴結尾,若為 ``None`` 則沒有後" -"綴。:func:`mkstemp` 不會在檔名和後綴之間加點 (dot),如果需要加一個點號,請將" -"其放在 *suffix* 的開頭。" +"如果 *suffix* 不是 ``None`` 則檔名將以該後綴結尾,若為 ``None`` 則沒有後綴。:" +"func:`mkstemp` 不會在檔名和後綴之間加點 (dot),如果需要加一個點號,請將其放" +"在 *suffix* 的開頭。" -#: ../../library/tempfile.rst:239 +#: ../../library/tempfile.rst:240 msgid "" "If *prefix* is not ``None``, the file name will begin with that prefix; " -"otherwise, a default prefix is used. The default is the return value " -"of :func:`gettempprefix` or :func:`gettempprefixb`, as appropriate." +"otherwise, a default prefix is used. The default is the return value of :" +"func:`gettempprefix` or :func:`gettempprefixb`, as appropriate." msgstr "" "如果 *prefix* 不是 ``None`` 則檔名將以該字首開頭,若為 ``None`` 則使用預設前" "綴。預設前綴是 :func:`gettempprefix` 或 :func:`gettempprefixb` 函式的回傳值" "(自動呼叫合適的函式)。" -#: ../../library/tempfile.rst:243 +#: ../../library/tempfile.rst:244 msgid "" "If *dir* is not ``None``, the file will be created in that directory; " "otherwise, a default directory is used. The default directory is chosen " @@ -465,7 +470,7 @@ msgstr "" "檔案路徑是使用者友善的,比如透過 ``os.popen()`` 將路徑傳遞給外部命令時仍需要" "加引號 (quoting)。" -#: ../../library/tempfile.rst:251 +#: ../../library/tempfile.rst:252 msgid "" "If any of *suffix*, *prefix*, and *dir* are not ``None``, they must be the " "same type. If they are bytes, the returned name will be bytes instead of " @@ -476,7 +481,7 @@ msgstr "" "型別相同。如果它們是位元組串,則回傳名稱的型別就是位元組串而非字串。如果不想" "遵循預設行為但又想要回傳值是位元組串型別,請傳入 ``suffix=b''``。" -#: ../../library/tempfile.rst:257 +#: ../../library/tempfile.rst:258 msgid "" "If *text* is specified and true, the file is opened in text mode. Otherwise, " "(the default) the file is opened in binary mode." @@ -484,7 +489,7 @@ msgstr "" "如果指定了 *text* 且為真值,檔案會以文字模式開啟。否則,檔案(預設)以二進位" "制模式開啟。" -#: ../../library/tempfile.rst:260 +#: ../../library/tempfile.rst:261 msgid "" ":func:`mkstemp` returns a tuple containing an OS-level handle to an open " "file (as would be returned by :func:`os.open`) and the absolute pathname of " @@ -494,7 +499,7 @@ msgstr "" "level) 控制代碼,指向一個開啟的檔案(如同 :func:`os.open` 的回傳值),第二元" "素是該檔案的絕對路徑。" -#: ../../library/tempfile.rst:266 ../../library/tempfile.rst:292 +#: ../../library/tempfile.rst:267 ../../library/tempfile.rst:293 msgid "" "*suffix*, *prefix*, and *dir* may now be supplied in bytes in order to " "obtain a bytes return value. Prior to this, only str was allowed. *suffix* " @@ -505,11 +510,11 @@ msgstr "" "串型別的回傳值。在之前只允許使用字串。*suffix* 和 *prefix* 現在可以接受 " "``None``,並且預設為 ``None`` 以使用合適的預設值。" -#: ../../library/tempfile.rst:272 ../../library/tempfile.rst:298 +#: ../../library/tempfile.rst:273 ../../library/tempfile.rst:299 msgid "The *dir* parameter now accepts a :term:`path-like object`." msgstr "*dir* 參數現在可接受一個類路徑物件 (:term:`path-like object`)。" -#: ../../library/tempfile.rst:278 +#: ../../library/tempfile.rst:279 msgid "" "Creates a temporary directory in the most secure manner possible. There are " "no race conditions in the directory's creation. The directory is readable, " @@ -518,60 +523,60 @@ msgstr "" "盡可能以最安全的方式建立一個臨時目錄,建立該目錄時不會有 race condition 的情" "況,該目錄只能由建立者讀取、寫入和搜尋。" -#: ../../library/tempfile.rst:282 +#: ../../library/tempfile.rst:283 msgid "" "The user of :func:`mkdtemp` is responsible for deleting the temporary " "directory and its contents when done with it." msgstr ":func:`mkdtemp` 的使用者用完臨時目錄後需要自行將其刪除。" -#: ../../library/tempfile.rst:285 +#: ../../library/tempfile.rst:286 msgid "" -"The *prefix*, *suffix*, and *dir* arguments are the same as " -"for :func:`mkstemp`." +"The *prefix*, *suffix*, and *dir* arguments are the same as for :func:" +"`mkstemp`." msgstr "" "引數 *prefix*、*suffix* 和 *dir* 的含義與它們在 :func:`mkstemp` 中相同。" -#: ../../library/tempfile.rst:288 +#: ../../library/tempfile.rst:289 msgid ":func:`mkdtemp` returns the absolute pathname of the new directory." msgstr ":func:`mkdtemp` 回傳新目錄的絕對路徑名稱。" -#: ../../library/tempfile.rst:301 +#: ../../library/tempfile.rst:302 msgid "" ":func:`mkdtemp` now always returns an absolute path, even if *dir* is " "relative." msgstr ":func:`mkdtemp` 現在都會回傳絕對路徑,即使 *dir* 是相對路徑。" -#: ../../library/tempfile.rst:307 +#: ../../library/tempfile.rst:308 msgid "" "Return the name of the directory used for temporary files. This defines the " "default value for the *dir* argument to all functions in this module." msgstr "" "回傳儲存臨時檔案的目錄名稱。這設定了此 module 所有函式 *dir* 引數的預設值。" -#: ../../library/tempfile.rst:311 +#: ../../library/tempfile.rst:312 msgid "" "Python searches a standard list of directories to find one which the calling " "user can create files in. The list is:" msgstr "" "Python 搜尋標準目錄列表來找到呼叫者可以在其中建立檔案的目錄。這個列表是:" -#: ../../library/tempfile.rst:314 +#: ../../library/tempfile.rst:315 msgid "The directory named by the :envvar:`TMPDIR` environment variable." msgstr ":envvar:`TMPDIR` 環境變數指向的目錄。" -#: ../../library/tempfile.rst:316 +#: ../../library/tempfile.rst:317 msgid "The directory named by the :envvar:`TEMP` environment variable." msgstr ":envvar:`TEMP` 環境變數指向的目錄。" -#: ../../library/tempfile.rst:318 +#: ../../library/tempfile.rst:319 msgid "The directory named by the :envvar:`TMP` environment variable." msgstr ":envvar:`TMP` 環境變數指向的目錄。" -#: ../../library/tempfile.rst:320 +#: ../../library/tempfile.rst:321 msgid "A platform-specific location:" msgstr "與平臺相關的位置:" -#: ../../library/tempfile.rst:322 +#: ../../library/tempfile.rst:323 msgid "" "On Windows, the directories :file:`C:\\\\TEMP`, :file:`C:\\\\TMP`, :file:`\\" "\\TEMP`, and :file:`\\\\TMP`, in that order." @@ -579,25 +584,25 @@ msgstr "" "在 Windows 上,目錄依次為 :file:`C:\\\\TEMP`、:file:`C:\\\\TMP`、:file:`\\" "\\TEMP` 和 :file:`\\\\TMP`。" -#: ../../library/tempfile.rst:325 +#: ../../library/tempfile.rst:326 msgid "" -"On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, " -"and :file:`/usr/tmp`, in that order." +"On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, and :" +"file:`/usr/tmp`, in that order." msgstr "" "在所有其他平臺上,目錄依次為 :file:`/tmp`、:file:`/var/tmp` 和 :file:`/usr/" "tmp`。" -#: ../../library/tempfile.rst:328 +#: ../../library/tempfile.rst:329 msgid "As a last resort, the current working directory." msgstr "不得已時,使用目前工作目錄。" -#: ../../library/tempfile.rst:330 +#: ../../library/tempfile.rst:331 msgid "" "The result of this search is cached, see the description of :data:`tempdir` " "below." msgstr "搜尋的結果會被 cache(快取)起來,請見下面 :data:`tempdir` 的描述。" -#: ../../library/tempfile.rst:335 +#: ../../library/tempfile.rst:336 msgid "" "Always returns a str. Previously it would return any :data:`tempdir` value " "regardless of type so long as it was not ``None``." @@ -605,21 +610,21 @@ msgstr "" "回傳一個字串。在之前的版本中它會回傳任意 :data:`tempdir` 的值而不考慮它的型" "別,只要它不為 ``None``。" -#: ../../library/tempfile.rst:340 +#: ../../library/tempfile.rst:341 msgid "Same as :func:`gettempdir` but the return value is in bytes." msgstr "與 :func:`gettempdir` 相同,但回傳值為位元組串型別。" -#: ../../library/tempfile.rst:346 +#: ../../library/tempfile.rst:347 msgid "" "Return the filename prefix used to create temporary files. This does not " "contain the directory component." msgstr "回傳用於建立臨時檔案的檔名前綴,它不包含目錄部分。" -#: ../../library/tempfile.rst:351 +#: ../../library/tempfile.rst:352 msgid "Same as :func:`gettempprefix` but the return value is in bytes." msgstr "與 :func:`gettempprefix` 相同,但回傳值為位元組串型別。" -#: ../../library/tempfile.rst:355 +#: ../../library/tempfile.rst:356 msgid "" "The module uses a global variable to store the name of the directory used " "for temporary files returned by :func:`gettempdir`. It can be set directly " @@ -633,7 +638,7 @@ msgstr "" "式都接受一個 *dir* 引數,它可被用於指定目錄。這是個推薦的做法,它不會透過改變" "全域性 API 行為而對其他不預期此行為的程式造成影響。" -#: ../../library/tempfile.rst:364 +#: ../../library/tempfile.rst:365 msgid "" "When set to a value other than ``None``, this variable defines the default " "value for the *dir* argument to the functions defined in this module, " @@ -643,7 +648,7 @@ msgstr "" "預設值,包括確定其型別為位元組串還是字串。它不可以為 :term:`path-like " "object`。" -#: ../../library/tempfile.rst:369 +#: ../../library/tempfile.rst:370 msgid "" "If ``tempdir`` is ``None`` (the default) at any call to any of the above " "functions except :func:`gettempprefix` it is initialized following the " @@ -652,29 +657,29 @@ msgstr "" "如果在呼叫除 :func:`gettempprefix` 外的上述任何函式時 ``tempdir`` 為 " "``None`` (預設值) 則它會按照 :func:`gettempdir` 中所描述的演算法來初始化。" -#: ../../library/tempfile.rst:375 +#: ../../library/tempfile.rst:376 msgid "" "Beware that if you set ``tempdir`` to a bytes value, there is a nasty side " -"effect: The global default return type of :func:`mkstemp` " -"and :func:`mkdtemp` changes to bytes when no explicit ``prefix``, " -"``suffix``, or ``dir`` arguments of type str are supplied. Please do not " -"write code expecting or depending on this. This awkward behavior is " -"maintained for compatibility with the historical implementation." -msgstr "" -"請注意如果你將 ``tempdir`` 設為位元組串值,會有一個麻煩的副作" -"用::func:`mkstemp` 和 :func:`mkdtemp` 的全域性預設回傳型別會在沒有提供明顯字" -"串型別的 ``prefix``、``suffix`` 或 ``dir`` 時被改為位元組串。請不要編寫預期此" -"行為或依賴於此行為的程式。這個奇怪的行為是為了維持與以往實作版本的相容性。" - -#: ../../library/tempfile.rst:386 +"effect: The global default return type of :func:`mkstemp` and :func:" +"`mkdtemp` changes to bytes when no explicit ``prefix``, ``suffix``, or " +"``dir`` arguments of type str are supplied. Please do not write code " +"expecting or depending on this. This awkward behavior is maintained for " +"compatibility with the historical implementation." +msgstr "" +"請注意如果你將 ``tempdir`` 設為位元組串值,會有一個麻煩的副作用::func:" +"`mkstemp` 和 :func:`mkdtemp` 的全域性預設回傳型別會在沒有提供明顯字串型別的 " +"``prefix``、``suffix`` 或 ``dir`` 時被改為位元組串。請不要編寫預期此行為或依" +"賴於此行為的程式。這個奇怪的行為是為了維持與以往實作版本的相容性。" + +#: ../../library/tempfile.rst:387 msgid "Examples" msgstr "範例" -#: ../../library/tempfile.rst:388 +#: ../../library/tempfile.rst:389 msgid "Here are some examples of typical usage of the :mod:`tempfile` module::" msgstr "以下是 :mod:`tempfile` module 的一些常見用法範例: ::" -#: ../../library/tempfile.rst:390 +#: ../../library/tempfile.rst:391 msgid "" ">>> import tempfile\n" "\n" @@ -756,11 +761,11 @@ msgstr "" ">>>\n" "# 目錄及其內容已被刪除" -#: ../../library/tempfile.rst:433 +#: ../../library/tempfile.rst:434 msgid "Deprecated functions and variables" msgstr "已棄用的函式和變數" -#: ../../library/tempfile.rst:435 +#: ../../library/tempfile.rst:436 msgid "" "A historical way to create temporary files was to first generate a file name " "with the :func:`mktemp` function and then create a file using this name. " @@ -775,11 +780,11 @@ msgstr "" "之間的時間裡,其他程式可能會使用該名稱建立檔案。解決方案是將兩個步驟結合起" "來,並立即建立檔案。這個方案目前被 :func:`mkstemp` 和上述其他函式所採用。" -#: ../../library/tempfile.rst:446 +#: ../../library/tempfile.rst:447 msgid "Use :func:`mkstemp` instead." msgstr "使用 :func:`mkstemp` 代替。" -#: ../../library/tempfile.rst:449 +#: ../../library/tempfile.rst:450 msgid "" "Return an absolute pathname of a file that did not exist at the time the " "call is made. The *prefix*, *suffix*, and *dir* arguments are similar to " @@ -790,7 +795,7 @@ msgstr "" "與 :func:`mkstemp` 中所用的類似,除了在於不支援位元組串型別的檔名且不支援 " "``suffix=None`` 和 ``prefix=None``。" -#: ../../library/tempfile.rst:456 +#: ../../library/tempfile.rst:457 msgid "" "Use of this function may introduce a security hole in your program. By the " "time you get around to doing anything with the file name it returns, someone " @@ -802,7 +807,7 @@ msgstr "" "作時,可能有人已經捷足先登了。:func:`mktemp` 的功能可以很輕鬆地用帶有 " "``delete=False`` 參數的 :func:`NamedTemporaryFile` 代替: ::" -#: ../../library/tempfile.rst:462 +#: ../../library/tempfile.rst:463 msgid "" ">>> f = NamedTemporaryFile(delete=False)\n" ">>> f.name\n" @@ -855,5 +860,5 @@ msgstr "file(檔案)" #~ "允許用檔名第二次開啟檔案,在各個平臺上是不同的(在 Unix 上可以;在 " #~ "Windows NT 版本以上不行)。如果 *delete* 為 true(預設值),則檔案會在關閉" #~ "後立即被刪除。該函式回傳的物件始終是 file-like object,它的 :attr:`!file` " -#~ "屬性是底層的真實檔案物件。file-like object 可以像普通檔案一樣" -#~ "在 :keyword:`with` 陳述句中使用。" +#~ "屬性是底層的真實檔案物件。file-like object 可以像普通檔案一樣在 :keyword:" +#~ "`with` 陳述句中使用。" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 2c948273fa..20eaf18a30 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-10 00:15+0000\n" +"POT-Creation-Date: 2026-01-07 00:14+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-" @@ -345,7 +345,7 @@ msgid "" "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:2044 +#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:2049 msgid "New Features" msgstr "新增功能" @@ -2783,6 +2783,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:1849 #: ../../deprecations/pending-removal-in-3.15.rst:16 +#: ../../deprecations/pending-removal-in-3.19.rst:4 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" @@ -2800,6 +2801,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:1859 +#: ../../deprecations/pending-removal-in-3.18.rst:4 msgid ":mod:`decimal`:" msgstr ":mod:`decimal`:" @@ -2807,35 +2809,36 @@ msgstr ":mod:`decimal`:" msgid "" "Deprecate the non-standard and undocumented :class:`~decimal.Decimal` format " "specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C " -"implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" +"implementation. Scheduled to be removed in Python 3.18. (Contributed by " +"Serhiy Storchaka in :gh:`89902`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1866 +#: ../../whatsnew/3.13.rst:1867 msgid ":mod:`dis`:" msgstr ":mod:`dis`:" -#: ../../whatsnew/3.13.rst:1868 +#: ../../whatsnew/3.13.rst:1869 msgid "" "Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" "`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1872 +#: ../../whatsnew/3.13.rst:1873 msgid ":mod:`gettext`:" msgstr ":mod:`gettext`:" -#: ../../whatsnew/3.13.rst:1874 +#: ../../whatsnew/3.13.rst:1875 msgid "" "Deprecate non-integer numbers as arguments to functions and methods that " "consider plural forms in the :mod:`!gettext` module, even if no translation " "was found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1879 +#: ../../whatsnew/3.13.rst:1880 msgid ":mod:`glob`:" msgstr ":mod:`glob`:" -#: ../../whatsnew/3.13.rst:1881 +#: ../../whatsnew/3.13.rst:1882 msgid "" "Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" "func:`~glob.glob` and pass a :term:`path-like object` specifying the root " @@ -2843,12 +2846,12 @@ msgid "" "in :gh:`117337`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1886 +#: ../../whatsnew/3.13.rst:1887 #: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr ":mod:`http.server`:" -#: ../../whatsnew/3.13.rst:1888 +#: ../../whatsnew/3.13.rst:1889 msgid "" "Deprecate :class:`~http.server.CGIHTTPRequestHandler`, to be removed in " "Python 3.15. Process-based CGI HTTP servers have been out of favor for a " @@ -2857,30 +2860,30 @@ msgid "" "by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1895 +#: ../../whatsnew/3.13.rst:1896 msgid "" "Deprecate the :option:`!--cgi` flag to the :program:`python -m http.server` " "command-line interface, to be removed in Python 3.15. (Contributed by " "Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1900 +#: ../../whatsnew/3.13.rst:1901 #: ../../deprecations/pending-removal-in-3.16.rst:70 msgid ":mod:`mimetypes`:" msgstr ":mod:`mimetypes`:" -#: ../../whatsnew/3.13.rst:1902 +#: ../../whatsnew/3.13.rst:1903 msgid "" ":term:`Soft-deprecate ` file path arguments to :func:" "`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " "(Contributed by Serhiy Storchaka in :gh:`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1907 +#: ../../whatsnew/3.13.rst:1908 msgid ":mod:`re`:" msgstr ":mod:`re`:" -#: ../../whatsnew/3.13.rst:1909 +#: ../../whatsnew/3.13.rst:1910 msgid "" "Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " "positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " @@ -2889,46 +2892,46 @@ msgid "" "by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1916 +#: ../../whatsnew/3.13.rst:1917 #: ../../deprecations/pending-removal-in-3.15.rst:46 msgid ":mod:`pathlib`:" msgstr ":mod:`pathlib`:" -#: ../../whatsnew/3.13.rst:1918 +#: ../../whatsnew/3.13.rst:1919 msgid "" "Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " "by Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1923 +#: ../../whatsnew/3.13.rst:1924 #: ../../deprecations/pending-removal-in-3.15.rst:52 msgid ":mod:`platform`:" msgstr ":mod:`platform`:" -#: ../../whatsnew/3.13.rst:1925 +#: ../../whatsnew/3.13.rst:1926 msgid "" "Deprecate :func:`~platform.java_ver`, to be removed in Python 3.15. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested. (Contributed by Nikita Sobolev in :gh:`116349`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1931 +#: ../../whatsnew/3.13.rst:1932 msgid ":mod:`pydoc`:" msgstr ":mod:`pydoc`:" -#: ../../whatsnew/3.13.rst:1933 +#: ../../whatsnew/3.13.rst:1934 msgid "" "Deprecate the undocumented :func:`!ispackage` function. (Contributed by " "Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1936 +#: ../../whatsnew/3.13.rst:1937 #: ../../deprecations/pending-removal-in-3.14.rst:85 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.13.rst:1938 +#: ../../whatsnew/3.13.rst:1939 msgid "" "Deprecate passing more than one positional argument to the :func:`~sqlite3." "connect` function and the :class:`~sqlite3.Connection` constructor. The " @@ -2936,7 +2939,7 @@ msgid "" "by Erlend E. Aasland in :gh:`107948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1944 +#: ../../whatsnew/3.13.rst:1945 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " "arguments for :meth:`.Connection.create_function` and :meth:`.Connection." @@ -2944,7 +2947,7 @@ msgid "" "3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1950 +#: ../../whatsnew/3.13.rst:1951 msgid "" "Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." "Connection.set_authorizer`, :meth:`~sqlite3.Connection." @@ -2954,47 +2957,47 @@ msgid "" "`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1958 +#: ../../whatsnew/3.13.rst:1959 #: ../../deprecations/pending-removal-in-3.16.rst:90 msgid ":mod:`sys`:" msgstr ":mod:`sys`:" -#: ../../whatsnew/3.13.rst:1960 +#: ../../whatsnew/3.13.rst:1961 msgid "" "Deprecate the :func:`~sys._enablelegacywindowsfsencoding` function, to be " "removed in Python 3.16. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead. (Contributed by Inada Naoki in :gh:`73427`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1965 +#: ../../whatsnew/3.13.rst:1966 #: ../../deprecations/pending-removal-in-3.16.rst:102 msgid ":mod:`tarfile`:" msgstr ":mod:`tarfile`:" -#: ../../whatsnew/3.13.rst:1967 +#: ../../whatsnew/3.13.rst:1968 msgid "" "Deprecate the undocumented and unused :attr:`!TarFile.tarfile` attribute, to " "be removed in Python 3.16. (Contributed in :gh:`115256`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1971 +#: ../../whatsnew/3.13.rst:1972 msgid ":mod:`traceback`:" msgstr ":mod:`traceback`:" -#: ../../whatsnew/3.13.rst:1973 +#: ../../whatsnew/3.13.rst:1974 msgid "" "Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." "TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" "gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1977 +#: ../../whatsnew/3.13.rst:1978 #: ../../deprecations/pending-removal-in-3.15.rst:80 #: ../../deprecations/pending-removal-in-3.17.rst:26 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../whatsnew/3.13.rst:1979 +#: ../../whatsnew/3.13.rst:1980 msgid "" "Deprecate the undocumented keyword argument syntax for creating :class:" "`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " @@ -3002,7 +3005,7 @@ msgid "" "functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1986 +#: ../../whatsnew/3.13.rst:1987 msgid "" "Deprecate omitting the *fields* parameter when creating a :class:`~typing." "NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " @@ -3014,7 +3017,7 @@ msgid "" "Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1996 +#: ../../whatsnew/3.13.rst:1997 msgid "" "Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " "be removed in Python 3.15. After eight years in the :mod:`typing` module, it " @@ -3025,7 +3028,7 @@ msgstr "" "除。在 :mod:`typing` 模組中經過八年後,它至今仍未被任何主要的型別檢查器所支" "援。(由 Alex Waygood 在 :gh:`106309` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2002 +#: ../../whatsnew/3.13.rst:2003 msgid "" "Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " "``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " @@ -3034,12 +3037,12 @@ msgid "" "(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2010 +#: ../../whatsnew/3.13.rst:2011 #: ../../deprecations/pending-removal-in-3.15.rst:100 msgid ":mod:`wave`:" msgstr ":mod:`wave`:" -#: ../../whatsnew/3.13.rst:2012 +#: ../../whatsnew/3.13.rst:2013 msgid "" "Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" "`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" @@ -3689,10 +3692,10 @@ msgid "" "that explicitly specifies the types your code supports (e.g., ``bytes | " "bytearray | memoryview``)." msgstr "" -"使用 ``isinstance(obj, collections.abc.Buffer)`` 來測試 ``obj`` 是否在 runtime " -"實作了\\ :ref:`緩衝區協定 `。在型別註解的使用中,請用 :class:`~" -"collections.abc.Buffer` 或明確指定你的程式碼所支援型別的聯集(例如 " -"``bytes | bytearray | memoryview``)。" +"使用 ``isinstance(obj, collections.abc.Buffer)`` 來測試 ``obj`` 是否在 " +"runtime 實作了\\ :ref:`緩衝區協定 `。在型別註解的使用中,請" +"用 :class:`~collections.abc.Buffer` 或明確指定你的程式碼所支援型別的聯集(例" +"如 ``bytes | bytearray | memoryview``)。" #: ../../deprecations/pending-removal-in-3.17.rst:14 #: ../../deprecations/pending-removal-in-3.17.rst:42 @@ -3705,10 +3708,11 @@ msgid "" "also never understood as subtypes of :class:`!ByteString` (either at runtime " "or by static type checkers)." msgstr "" -":class:`!ByteString` 最初被設計為一個抽象類別,以作為 :class:`bytes` 和 :class:`bytearray` " -"的超型別 (supertype)。然而由於 ABC 從未擁有任何方法,知道一個物件是 :class:`!ByteString` 的" -"實例從未真正告訴你任何關於該物件的有用資訊。其他常見的緩衝區型別如 :class:`memoryview` " -"也從未被理解為 :class:`!ByteString` 的子型別(無論是在 runtime 還是由靜態型別檢查器)。" +":class:`!ByteString` 最初被設計為一個抽象類別,以作為 :class:`bytes` 和 :" +"class:`bytearray` 的超型別 (supertype)。然而由於 ABC 從未擁有任何方法,知道一" +"個物件是 :class:`!ByteString` 的實例從未真正告訴你任何關於該物件的有用資訊。" +"其他常見的緩衝區型別如 :class:`memoryview` 也從未被理解為 :class:`!" +"ByteString` 的子型別(無論是在 runtime 還是由靜態型別檢查器)。" #: ../../deprecations/pending-removal-in-3.17.rst:22 #: ../../deprecations/pending-removal-in-3.17.rst:50 @@ -3716,7 +3720,8 @@ msgid "" "See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by " "Shantanu Jain in :gh:`91896`.)" msgstr "" -"更多細節請見 :pep:`PEP 688 <688#current-options>`。(由 Shantanu Jain 於 :gh:`91896` 貢獻。)" +"更多細節請見 :pep:`PEP 688 <688#current-options>`。(由 Shantanu Jain 於 :gh:" +"`91896` 貢獻。)" #: ../../deprecations/pending-removal-in-3.17.rst:28 msgid "" @@ -3737,7 +3742,33 @@ msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " "removal in Python 3.17." msgstr "" -":class:`typing.ByteString` 自 Python 3.9 起已被棄用,預計在 Python 3.17 中移除。" +":class:`typing.ByteString` 自 Python 3.9 起已被棄用,預計在 Python 3.17 中移" +"除。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:2 +#: ../../deprecations/pending-removal-in-3.18.rst:2 +msgid "Pending removal in Python 3.18" +msgstr "Python 3.18 中待移除的項目" + +#: ../../deprecations/pending-removal-in-3.18.rst:6 +msgid "" +"The non-standard and undocumented :class:`~decimal.Decimal` format specifier " +"``'N'``, which is only supported in the :mod:`!decimal` module's C " +"implementation, has been deprecated since Python 3.13. (Contributed by " +"Serhiy Storchaka in :gh:`89902`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.19.rst:2 +#, fuzzy +msgid "Pending removal in Python 3.19" +msgstr "Python 3.14 中待移除的項目" + +#: ../../deprecations/pending-removal-in-3.19.rst:6 +msgid "" +"Implicitly switching to the MSVC-compatible struct layout by setting :attr:" +"`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_` on non-" +"Windows platforms." +msgstr "" #: ../../deprecations/c-api-pending-removal-in-future.rst:2 #: ../../deprecations/pending-removal-in-future.rst:2 @@ -4156,11 +4187,11 @@ msgstr "" ":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." "_clear_internal_caches`。" -#: ../../whatsnew/3.13.rst:2031 +#: ../../whatsnew/3.13.rst:2036 msgid "CPython Bytecode Changes" msgstr "CPython 位元組碼變更" -#: ../../whatsnew/3.13.rst:2033 +#: ../../whatsnew/3.13.rst:2038 msgid "" "The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " "yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " @@ -4169,97 +4200,97 @@ msgid "" "`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2041 +#: ../../whatsnew/3.13.rst:2046 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.13.rst:2046 +#: ../../whatsnew/3.13.rst:2051 msgid "" "Add the :ref:`PyMonitoring C API ` for generating :pep:" "`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:2049 +#: ../../whatsnew/3.13.rst:2054 msgid ":c:type:`PyMonitoringState`" msgstr ":c:type:`PyMonitoringState`" -#: ../../whatsnew/3.13.rst:2050 +#: ../../whatsnew/3.13.rst:2055 msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr ":c:func:`PyMonitoring_FirePyStartEvent`" -#: ../../whatsnew/3.13.rst:2051 +#: ../../whatsnew/3.13.rst:2056 msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr ":c:func:`PyMonitoring_FirePyResumeEvent`" -#: ../../whatsnew/3.13.rst:2052 +#: ../../whatsnew/3.13.rst:2057 msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr ":c:func:`PyMonitoring_FirePyReturnEvent`" -#: ../../whatsnew/3.13.rst:2053 +#: ../../whatsnew/3.13.rst:2058 msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr ":c:func:`PyMonitoring_FirePyYieldEvent`" -#: ../../whatsnew/3.13.rst:2054 +#: ../../whatsnew/3.13.rst:2059 msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr ":c:func:`PyMonitoring_FireCallEvent`" -#: ../../whatsnew/3.13.rst:2055 +#: ../../whatsnew/3.13.rst:2060 msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr ":c:func:`PyMonitoring_FireLineEvent`" -#: ../../whatsnew/3.13.rst:2056 +#: ../../whatsnew/3.13.rst:2061 msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr ":c:func:`PyMonitoring_FireJumpEvent`" -#: ../../whatsnew/3.13.rst:2057 +#: ../../whatsnew/3.13.rst:2062 msgid "``PyMonitoring_FireBranchEvent``" msgstr "``PyMonitoring_FireBranchEvent``" -#: ../../whatsnew/3.13.rst:2058 +#: ../../whatsnew/3.13.rst:2063 msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr ":c:func:`PyMonitoring_FireCReturnEvent`" -#: ../../whatsnew/3.13.rst:2059 +#: ../../whatsnew/3.13.rst:2064 msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr ":c:func:`PyMonitoring_FirePyThrowEvent`" -#: ../../whatsnew/3.13.rst:2060 +#: ../../whatsnew/3.13.rst:2065 msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr ":c:func:`PyMonitoring_FireRaiseEvent`" -#: ../../whatsnew/3.13.rst:2061 +#: ../../whatsnew/3.13.rst:2066 msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr ":c:func:`PyMonitoring_FireCRaiseEvent`" -#: ../../whatsnew/3.13.rst:2062 +#: ../../whatsnew/3.13.rst:2067 msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr ":c:func:`PyMonitoring_FireReraiseEvent`" -#: ../../whatsnew/3.13.rst:2063 +#: ../../whatsnew/3.13.rst:2068 msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" msgstr ":c:func:`PyMonitoring_FireExceptionHandledEvent`" -#: ../../whatsnew/3.13.rst:2064 +#: ../../whatsnew/3.13.rst:2069 msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" msgstr ":c:func:`PyMonitoring_FirePyUnwindEvent`" -#: ../../whatsnew/3.13.rst:2065 +#: ../../whatsnew/3.13.rst:2070 msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr ":c:func:`PyMonitoring_FireStopIterationEvent`" -#: ../../whatsnew/3.13.rst:2066 +#: ../../whatsnew/3.13.rst:2071 msgid ":c:func:`PyMonitoring_EnterScope`" msgstr ":c:func:`PyMonitoring_EnterScope`" -#: ../../whatsnew/3.13.rst:2067 +#: ../../whatsnew/3.13.rst:2072 msgid ":c:func:`PyMonitoring_ExitScope`" msgstr ":c:func:`PyMonitoring_ExitScope`" -#: ../../whatsnew/3.13.rst:2069 +#: ../../whatsnew/3.13.rst:2074 msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "(由 Irit Katriel 在 :gh:`111997` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2071 +#: ../../whatsnew/3.13.rst:2076 msgid "" "Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " "the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" @@ -4267,52 +4298,52 @@ msgid "" "operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2077 +#: ../../whatsnew/3.13.rst:2082 msgid "" "Add the :ref:`PyTime C API ` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:2079 +#: ../../whatsnew/3.13.rst:2084 msgid ":c:type:`PyTime_t`." msgstr ":c:type:`PyTime_t`。" -#: ../../whatsnew/3.13.rst:2080 +#: ../../whatsnew/3.13.rst:2085 msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr ":c:var:`PyTime_MIN` 和 :c:var:`PyTime_MAX`。" -#: ../../whatsnew/3.13.rst:2081 +#: ../../whatsnew/3.13.rst:2086 msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr ":c:func:`PyTime_AsSecondsDouble`。" -#: ../../whatsnew/3.13.rst:2082 +#: ../../whatsnew/3.13.rst:2087 msgid ":c:func:`PyTime_Monotonic`." msgstr ":c:func:`PyTime_Monotonic`。" -#: ../../whatsnew/3.13.rst:2083 +#: ../../whatsnew/3.13.rst:2088 msgid ":c:func:`PyTime_MonotonicRaw`." msgstr ":c:func:`PyTime_MonotonicRaw`。" -#: ../../whatsnew/3.13.rst:2084 +#: ../../whatsnew/3.13.rst:2089 msgid ":c:func:`PyTime_PerfCounter`." msgstr ":c:func:`PyTime_PerfCounter`。" -#: ../../whatsnew/3.13.rst:2085 +#: ../../whatsnew/3.13.rst:2090 msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr ":c:func:`PyTime_PerfCounterRaw`。" -#: ../../whatsnew/3.13.rst:2086 +#: ../../whatsnew/3.13.rst:2091 msgid ":c:func:`PyTime_Time`." msgstr ":c:func:`PyTime_Time`。" -#: ../../whatsnew/3.13.rst:2087 +#: ../../whatsnew/3.13.rst:2092 msgid ":c:func:`PyTime_TimeRaw`." msgstr ":c:func:`PyTime_TimeRaw`。" -#: ../../whatsnew/3.13.rst:2089 +#: ../../whatsnew/3.13.rst:2094 msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" msgstr "(由 Victor Stinner 和 Petr Viktorin 在 :gh:`110850` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2091 +#: ../../whatsnew/3.13.rst:2096 msgid "" "Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" "c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " @@ -4320,7 +4351,7 @@ msgid "" "by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2097 +#: ../../whatsnew/3.13.rst:2102 msgid "" "Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " @@ -4330,7 +4361,7 @@ msgid "" "`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2105 +#: ../../whatsnew/3.13.rst:2110 msgid "" "Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" "c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " @@ -4339,7 +4370,7 @@ msgid "" "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2113 +#: ../../whatsnew/3.13.rst:2118 msgid "" "Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " "remove a key from a dictionary and optionally return the removed value. This " @@ -4348,7 +4379,7 @@ msgid "" "Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2120 +#: ../../whatsnew/3.13.rst:2125 msgid "" "Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" "`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" @@ -4359,7 +4390,7 @@ msgid "" "gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2130 +#: ../../whatsnew/3.13.rst:2135 msgid "" "Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" "`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" @@ -4370,37 +4401,37 @@ msgid "" "Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2140 +#: ../../whatsnew/3.13.rst:2145 msgid "" "Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" "`PyErr_WriteUnraisable` that allows customizing the warning message. " "(Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2145 +#: ../../whatsnew/3.13.rst:2150 msgid "" "Add new functions that return a :term:`strong reference` instead of a :term:" "`borrowed reference` for frame locals, globals, and builtins, as part of :" "ref:`PEP 667 `:" msgstr "" -#: ../../whatsnew/3.13.rst:2149 +#: ../../whatsnew/3.13.rst:2154 msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" msgstr ":c:func:`PyEval_GetFrameBuiltins` 取代 :c:func:`PyEval_GetBuiltins`" -#: ../../whatsnew/3.13.rst:2150 +#: ../../whatsnew/3.13.rst:2155 msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" msgstr ":c:func:`PyEval_GetFrameGlobals` 取代 :c:func:`PyEval_GetGlobals`" -#: ../../whatsnew/3.13.rst:2151 +#: ../../whatsnew/3.13.rst:2156 msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" msgstr ":c:func:`PyEval_GetFrameLocals` 取代 :c:func:`PyEval_GetLocals`" -#: ../../whatsnew/3.13.rst:2153 +#: ../../whatsnew/3.13.rst:2158 msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" msgstr "(由 Mark Shannon 和 Tian Gao 在 :gh:`74929` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2155 +#: ../../whatsnew/3.13.rst:2160 msgid "" "Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " "functions to get :term:`strong ` or :term:`borrowed " @@ -4409,7 +4440,7 @@ msgid "" "constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2162 +#: ../../whatsnew/3.13.rst:2167 msgid "" "Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" "func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " @@ -4417,35 +4448,35 @@ msgid "" "`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2167 +#: ../../whatsnew/3.13.rst:2172 msgid "" "Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " "interpreter is :term:`shutting down `. (Contributed by " "Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2172 +#: ../../whatsnew/3.13.rst:2177 msgid "" "Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" "`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" "`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2177 +#: ../../whatsnew/3.13.rst:2182 msgid "" "Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, " "mirroring the Python :meth:`list.extend` and :meth:`list.clear` methods. " "(Contributed by Victor Stinner in :gh:`111138`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2181 +#: ../../whatsnew/3.13.rst:2186 msgid "" "Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" "`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" "c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2186 +#: ../../whatsnew/3.13.rst:2191 msgid "" "Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " "and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " @@ -4453,27 +4484,27 @@ msgid "" "(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2192 +#: ../../whatsnew/3.13.rst:2197 msgid "" "Add :c:func:`PyModule_Add` function, which is similar to :c:func:" "`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " "a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2197 +#: ../../whatsnew/3.13.rst:2202 msgid "" "Add the :c:func:`PyObject_GenericHash` function that implements the default " "hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" "`113024`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2201 +#: ../../whatsnew/3.13.rst:2206 msgid "" "Add the :c:func:`Py_HashPointer` function to hash a raw pointer. " "(Contributed by Victor Stinner in :gh:`111545`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2204 +#: ../../whatsnew/3.13.rst:2209 msgid "" "Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" "`PyObject_ClearManagedDict` functions. which must be called by the traverse " @@ -4482,7 +4513,7 @@ msgid "" "with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2212 +#: ../../whatsnew/3.13.rst:2217 msgid "" "Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " "functions, which enable tracking object creation and destruction in the same " @@ -4490,14 +4521,14 @@ msgid "" "in :gh:`93502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2218 +#: ../../whatsnew/3.13.rst:2223 msgid "" "Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" "`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2223 +#: ../../whatsnew/3.13.rst:2228 msgid "" "Add the :c:func:`PyThreadState_GetUnchecked()` function as an alternative " "to :c:func:`PyThreadState_Get()` that doesn't kill the process with a fatal " @@ -4505,7 +4536,7 @@ msgid "" "result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2229 +#: ../../whatsnew/3.13.rst:2234 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " "fully qualified name. The module name is prepended if :attr:`type." @@ -4513,14 +4544,14 @@ msgid "" "``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2235 +#: ../../whatsnew/3.13.rst:2240 msgid "" "Add the :c:func:`PyType_GetModuleName` function to get the type's module " "name. This is equivalent to getting the :attr:`type.__module__` attribute. " "(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2240 +#: ../../whatsnew/3.13.rst:2245 msgid "" "Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" "`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" @@ -4529,7 +4560,7 @@ msgid "" "Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2247 +#: ../../whatsnew/3.13.rst:2252 msgid "" "Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" "`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " @@ -4537,16 +4568,16 @@ msgid "" "`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2253 +#: ../../whatsnew/3.13.rst:2258 msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2255 +#: ../../whatsnew/3.13.rst:2260 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr ":c:func:`PyObject_HasAttrWithError` 取代 :c:func:`PyObject_HasAttr`。" -#: ../../whatsnew/3.13.rst:2256 +#: ../../whatsnew/3.13.rst:2261 msgid "" ":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" "`PyObject_HasAttrString`." @@ -4554,12 +4585,12 @@ msgstr "" ":c:func:`PyObject_HasAttrStringWithError` 取代 :c:func:" "`PyObject_HasAttrString`。" -#: ../../whatsnew/3.13.rst:2258 +#: ../../whatsnew/3.13.rst:2263 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr ":c:func:`PyMapping_HasKeyWithError` 取代 :c:func:`PyMapping_HasKey`。" -#: ../../whatsnew/3.13.rst:2259 +#: ../../whatsnew/3.13.rst:2264 msgid "" ":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" "`PyMapping_HasKeyString`." @@ -4567,21 +4598,21 @@ msgstr "" ":c:func:`PyMapping_HasKeyStringWithError` 取代 :c:func:" "`PyMapping_HasKeyString`。" -#: ../../whatsnew/3.13.rst:2262 +#: ../../whatsnew/3.13.rst:2267 msgid "" "The new functions return ``-1`` for errors and the standard ``1`` for true " "and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2265 +#: ../../whatsnew/3.13.rst:2270 msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" msgstr "(由 Serhiy Storchaka 在 :gh:`108511` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2269 +#: ../../whatsnew/3.13.rst:2274 msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2271 +#: ../../whatsnew/3.13.rst:2276 msgid "" "The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" "func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " @@ -4594,20 +4625,20 @@ msgid "" "`65210`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2283 +#: ../../whatsnew/3.13.rst:2288 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " "parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2287 +#: ../../whatsnew/3.13.rst:2292 msgid "" "The :c:func:`!PyCode_GetFirstFree` function is now unstable API and is now " "named :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan " "Romanyuk in :gh:`115781`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2291 +#: ../../whatsnew/3.13.rst:2296 msgid "" "The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" "`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" @@ -4618,35 +4649,35 @@ msgid "" "documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2300 +#: ../../whatsnew/3.13.rst:2305 msgid "" "Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" "`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2303 +#: ../../whatsnew/3.13.rst:2308 msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2304 +#: ../../whatsnew/3.13.rst:2309 msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2305 +#: ../../whatsnew/3.13.rst:2310 msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2306 +#: ../../whatsnew/3.13.rst:2311 msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2308 +#: ../../whatsnew/3.13.rst:2313 msgid "" "See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" "`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2311 +#: ../../whatsnew/3.13.rst:2316 msgid "" "You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " "including :file:`Python.h` when using ``#`` formats in :ref:`format codes " @@ -4655,7 +4686,7 @@ msgid "" "`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2317 +#: ../../whatsnew/3.13.rst:2322 msgid "" "If Python is built in :ref:`debug mode ` or :option:`with " "assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" @@ -4663,61 +4694,61 @@ msgid "" "(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2325 +#: ../../whatsnew/3.13.rst:2330 msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2327 +#: ../../whatsnew/3.13.rst:2332 msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2329 +#: ../../whatsnew/3.13.rst:2334 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../whatsnew/3.13.rst:2330 +#: ../../whatsnew/3.13.rst:2335 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../whatsnew/3.13.rst:2331 +#: ../../whatsnew/3.13.rst:2336 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../whatsnew/3.13.rst:2332 +#: ../../whatsnew/3.13.rst:2337 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../whatsnew/3.13.rst:2333 +#: ../../whatsnew/3.13.rst:2338 msgid ":c:func:`PySys_Audit`" msgstr ":c:func:`PySys_Audit`" -#: ../../whatsnew/3.13.rst:2334 +#: ../../whatsnew/3.13.rst:2339 msgid ":c:func:`PySys_AuditTuple`" msgstr ":c:func:`PySys_AuditTuple`" -#: ../../whatsnew/3.13.rst:2335 +#: ../../whatsnew/3.13.rst:2340 msgid ":c:func:`PyType_GetModuleByDef`" msgstr ":c:func:`PyType_GetModuleByDef`" -#: ../../whatsnew/3.13.rst:2337 +#: ../../whatsnew/3.13.rst:2342 msgid "" "(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" "`116936`.)" msgstr "" "(由 Victor Stinner 貢獻於 :gh:`85283`、:gh:`85283` 和 :gh:`116936`。)" -#: ../../whatsnew/3.13.rst:2339 +#: ../../whatsnew/3.13.rst:2344 msgid "" "Python built with :option:`--with-trace-refs` (tracing references) now " "supports the :ref:`Limited API `. (Contributed by Victor " "Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2345 +#: ../../whatsnew/3.13.rst:2350 msgid "Removed C APIs" msgstr "移除的 C API" -#: ../../whatsnew/3.13.rst:2347 +#: ../../whatsnew/3.13.rst:2352 msgid "" "Remove several functions, macros, variables, etc with names prefixed by " "``_Py`` or ``_PY`` (which are considered private). If your project is " @@ -4727,13 +4758,13 @@ msgid "" "Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2355 +#: ../../whatsnew/3.13.rst:2360 msgid "" "Remove old buffer protocols deprecated in Python 3.0. Use :ref:" "`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2358 +#: ../../whatsnew/3.13.rst:2363 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " "test whether the object supports the buffer protocol. Note that :c:func:" @@ -4742,7 +4773,7 @@ msgid "" "example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2366 +#: ../../whatsnew/3.13.rst:2371 msgid "" ":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" "func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" @@ -4750,7 +4781,7 @@ msgstr "" ":c:func:`!PyObject_AsCharBuffer`、:c:func:`!PyObject_AsReadBuffer`:請改用 :" "c:func:`PyObject_GetBuffer` 和 :c:func:`PyBuffer_Release`。" -#: ../../whatsnew/3.13.rst:2369 +#: ../../whatsnew/3.13.rst:2374 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4761,7 +4792,7 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2379 +#: ../../whatsnew/3.13.rst:2384 msgid "" ":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" "func:`PyBuffer_Release` instead:" @@ -4769,7 +4800,7 @@ msgstr "" ":c:func:`!PyObject_AsWriteBuffer`:請改用 :c:func:`PyObject_GetBuffer` 和 :c:" "func:`PyBuffer_Release`。" -#: ../../whatsnew/3.13.rst:2382 +#: ../../whatsnew/3.13.rst:2387 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4779,15 +4810,15 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2391 +#: ../../whatsnew/3.13.rst:2396 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" msgstr "(由 Inada Naoki 貢獻於 :gh:`85275`。)" -#: ../../whatsnew/3.13.rst:2393 +#: ../../whatsnew/3.13.rst:2398 msgid "Remove various functions deprecated in Python 3.9:" msgstr "" -#: ../../whatsnew/3.13.rst:2395 +#: ../../whatsnew/3.13.rst:2400 msgid "" ":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" "c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." @@ -4795,7 +4826,7 @@ msgstr "" ":c:func:`!PyEval_CallObject`、:c:func:`!PyEval_CallObjectWithKeywords`:請改" "用 :c:func:`PyObject_CallNoArgs` 或 :c:func:`PyObject_Call`。" -#: ../../whatsnew/3.13.rst:2400 +#: ../../whatsnew/3.13.rst:2405 msgid "" "In :c:func:`PyObject_Call`, positional arguments must be a :class:`tuple` " "and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " @@ -4806,33 +4837,33 @@ msgid "" "`PyTuple_New(0) `." msgstr "" -#: ../../whatsnew/3.13.rst:2410 +#: ../../whatsnew/3.13.rst:2415 msgid "" ":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." msgstr "" ":c:func:`!PyEval_CallFunction`:請改用 :c:func:`PyObject_CallFunction`。" -#: ../../whatsnew/3.13.rst:2412 +#: ../../whatsnew/3.13.rst:2417 msgid "" ":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." msgstr ":c:func:`!PyEval_CallMethod`:請改用 :c:func:`PyObject_CallMethod`。" -#: ../../whatsnew/3.13.rst:2414 +#: ../../whatsnew/3.13.rst:2419 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." msgstr ":c:func:`!PyCFunction_Call`:請改用 :c:func:`PyObject_Call`。" -#: ../../whatsnew/3.13.rst:2417 +#: ../../whatsnew/3.13.rst:2422 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" msgstr "(由 Victor Stinner 貢獻於 :gh:`105107`。)" -#: ../../whatsnew/3.13.rst:2419 +#: ../../whatsnew/3.13.rst:2424 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" "移除以下設定 Python 初始化的舊函式,這些函式在 Python 3.11 中已被棄用:" -#: ../../whatsnew/3.13.rst:2422 +#: ../../whatsnew/3.13.rst:2427 msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." @@ -4840,36 +4871,36 @@ msgstr "" ":c:func:`!PySys_AddWarnOptionUnicode`:請改用 :c:member:`PyConfig." "warnoptions`。" -#: ../../whatsnew/3.13.rst:2424 +#: ../../whatsnew/3.13.rst:2429 msgid "" ":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" ":c:func:`!PySys_AddWarnOption`:請改用 :c:member:`PyConfig.warnoptions`。" -#: ../../whatsnew/3.13.rst:2426 +#: ../../whatsnew/3.13.rst:2431 msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." msgstr ":c:func:`!PySys_AddXOption`:請改用 :c:member:`PyConfig.xoptions`。" -#: ../../whatsnew/3.13.rst:2428 +#: ../../whatsnew/3.13.rst:2433 msgid "" ":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" ":c:func:`!PySys_HasWarnOptions`:請改用 :c:member:`PyConfig.xoptions`。" -#: ../../whatsnew/3.13.rst:2430 +#: ../../whatsnew/3.13.rst:2435 msgid "" ":c:func:`!PySys_SetPath`: Set :c:member:`PyConfig.module_search_paths` " "instead." msgstr "" ":c:func:`!PySys_SetPath`:請改用 :c:member:`PyConfig.module_search_paths`。" -#: ../../whatsnew/3.13.rst:2432 +#: ../../whatsnew/3.13.rst:2437 msgid "" ":c:func:`!Py_SetPath`: Set :c:member:`PyConfig.module_search_paths` instead." msgstr "" ":c:func:`!Py_SetPath`:請改用 :c:member:`PyConfig.module_search_paths`。" -#: ../../whatsnew/3.13.rst:2434 +#: ../../whatsnew/3.13.rst:2439 msgid "" ":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." "stdio_encoding` instead, and set also maybe :c:member:`PyConfig." @@ -4879,14 +4910,14 @@ msgstr "" "stdio_encoding` 並設定可能的 :c:member:`PyConfig.legacy_windows_stdio`\\ " "(在 Windows 上)。" -#: ../../whatsnew/3.13.rst:2437 +#: ../../whatsnew/3.13.rst:2442 msgid "" ":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " "instead." msgstr "" ":c:func:`!_Py_SetProgramFullPath`:請改用 :c:member:`PyConfig.executable`。" -#: ../../whatsnew/3.13.rst:2440 +#: ../../whatsnew/3.13.rst:2445 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`), added to Python 3.8. " @@ -4896,7 +4927,7 @@ msgstr "" "(:pep:`587`),這是在 Python 3.8 中新增的。(由 Victor Stinner 於 :gh:" "`105145` 貢獻。)" -#: ../../whatsnew/3.13.rst:2444 +#: ../../whatsnew/3.13.rst:2449 msgid "" "Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " "functions, deprecated in Python 3.2. They didn't update the current thread " @@ -4906,25 +4937,25 @@ msgstr "" "些函式在 Python 3.2 中已被廢棄。它們不會更新目前的執行緒狀態。可以用以下函式" "取代:" -#: ../../whatsnew/3.13.rst:2449 +#: ../../whatsnew/3.13.rst:2454 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr ":c:func:`PyEval_SaveThread` 和 :c:func:`PyEval_RestoreThread`;" -#: ../../whatsnew/3.13.rst:2450 +#: ../../whatsnew/3.13.rst:2455 msgid "" "low-level :c:func:`PyEval_AcquireThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" "低階的 :c:func:`PyEval_AcquireThread` 和 :c:func:`PyEval_RestoreThread`;" -#: ../../whatsnew/3.13.rst:2451 +#: ../../whatsnew/3.13.rst:2456 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." msgstr "或 :c:func:`PyGILState_Ensure` 與 :c:func:`PyGILState_Release`。" -#: ../../whatsnew/3.13.rst:2453 +#: ../../whatsnew/3.13.rst:2458 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" msgstr "(由 Victor Stinner 貢獻於 :gh:`105182`。)" -#: ../../whatsnew/3.13.rst:2455 +#: ../../whatsnew/3.13.rst:2460 msgid "" "Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " "Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " @@ -4937,7 +4968,7 @@ msgstr "" "PyEval_InitThreads` 不會有任何作用,而 :c:func:`!PyEval_ThreadsInitialized` " "總是會回傳非零值。(由 Victor Stinner 於 :gh:`105182` 貢獻。)" -#: ../../whatsnew/3.13.rst:2462 +#: ../../whatsnew/3.13.rst:2467 msgid "" "Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" "`PyInterpreterState_Get()` which was kept for backward compatibility with " @@ -4951,7 +4982,7 @@ msgstr "" "得 :c:func:`PyInterpreterState_Get()`。(由 Victor Stinner 於 :gh:`106320` 貢" "獻。)" -#: ../../whatsnew/3.13.rst:2469 +#: ../../whatsnew/3.13.rst:2474 msgid "" "Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " @@ -4961,7 +4992,7 @@ msgstr "" "c:func:`!PyObject_Vectorcall` 函式(:pep:`590`)。(由 Victor Stinner 於 :gh:" "`106023` 貢獻。)" -#: ../../whatsnew/3.13.rst:2474 +#: ../../whatsnew/3.13.rst:2479 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" @@ -4969,13 +5000,13 @@ msgstr "" "移除只包含私有函式的 ``cpython/pytime.h`` 標頭檔。(由 Victor Stinner 於 :gh:" "`106316` 貢獻。)" -#: ../../whatsnew/3.13.rst:2478 +#: ../../whatsnew/3.13.rst:2483 msgid "" "Remove the undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " "(Contributed by Victor Stinner in :gh:`110014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2481 +#: ../../whatsnew/3.13.rst:2486 msgid "" "Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " @@ -4986,15 +5017,15 @@ msgstr "" "將兩者都替換為新的巨集 ``Py_TRASHCAN_BEGIN`` 和 ``Py_TRASHCAN_END``。(由 " "Irit Katriel 在 :gh:`105111` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2488 +#: ../../whatsnew/3.13.rst:2493 msgid "Deprecated C APIs" msgstr "器用的 C API" -#: ../../whatsnew/3.13.rst:2490 +#: ../../whatsnew/3.13.rst:2495 msgid "Deprecate old Python initialization functions:" msgstr "棄用舊的 Python 初始化函式:" -#: ../../whatsnew/3.13.rst:2492 +#: ../../whatsnew/3.13.rst:2497 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:62 msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" @@ -5003,27 +5034,27 @@ msgstr "" ":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" "data:`!warnings.filters`。" -#: ../../whatsnew/3.13.rst:2494 +#: ../../whatsnew/3.13.rst:2499 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" -#: ../../whatsnew/3.13.rst:2496 +#: ../../whatsnew/3.13.rst:2501 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" -#: ../../whatsnew/3.13.rst:2498 +#: ../../whatsnew/3.13.rst:2503 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" -#: ../../whatsnew/3.13.rst:2500 +#: ../../whatsnew/3.13.rst:2505 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramFullPath`:請改用 :data:`sys.executable`。" -#: ../../whatsnew/3.13.rst:2502 +#: ../../whatsnew/3.13.rst:2507 msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" -#: ../../whatsnew/3.13.rst:2504 +#: ../../whatsnew/3.13.rst:2509 msgid "" ":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." @@ -5031,11 +5062,11 @@ msgstr "" ":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" "`PYTHONHOME` 環境變數。" -#: ../../whatsnew/3.13.rst:2508 +#: ../../whatsnew/3.13.rst:2513 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "(由 Victor Stinner 在 :gh:`105145` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2510 +#: ../../whatsnew/3.13.rst:2515 msgid "" ":term:`Soft deprecate ` the :c:func:`PyEval_GetBuiltins`, :" "c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " @@ -5046,7 +5077,7 @@ msgstr "" "\\ :term:`借用參照 `。(作為 :pep:`667` 一部分的軟性棄" "用。)" -#: ../../whatsnew/3.13.rst:2516 +#: ../../whatsnew/3.13.rst:2521 msgid "" "Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " @@ -5056,7 +5087,7 @@ msgstr "" "c:func:`PyImport_ImportModule` 的別名。(由 Victor Stinner 在 :gh:`105396` 中" "貢獻。)" -#: ../../whatsnew/3.13.rst:2520 +#: ../../whatsnew/3.13.rst:2525 msgid "" ":term:`Soft deprecate ` the :c:func:`PyModule_AddObject` " "function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" @@ -5066,7 +5097,7 @@ msgstr "" "用 :c:func:`PyModule_Add` 或 :c:func:`PyModule_AddObjectRef`。(由 Serhiy " "Storchaka 在 :gh:`86493` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2526 +#: ../../whatsnew/3.13.rst:2531 msgid "" "Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" "macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " @@ -5079,7 +5110,7 @@ msgstr "" "``Py_UNICODE`` 和 ``PY_UNICODE_TYPE`` 只是 :c:type:`!wchar_t` 的別名。(由 " "Victor Stinner 在 :gh:`105156` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2533 +#: ../../whatsnew/3.13.rst:2538 msgid "" "Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" "`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " @@ -5466,10 +5497,6 @@ msgstr "" msgid "The bundled copy of ``libmpdec``." msgstr "``libmpdecimal`` 的打包副本 (bundled copy)。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:2 -msgid "Pending removal in Python 3.18" -msgstr "Python 3.18 中待移除的項目" - #: ../../deprecations/c-api-pending-removal-in-3.18.rst:4 msgid "" "The following private functions are deprecated and planned for removal in " @@ -5724,31 +5751,31 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.13.rst:2557 +#: ../../whatsnew/3.13.rst:2562 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.13.rst:2559 +#: ../../whatsnew/3.13.rst:2564 msgid "" "``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " "tier 3 platforms. (:ref:`PEP 730 ` written and " "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2564 +#: ../../whatsnew/3.13.rst:2569 msgid "" "``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" "`11` tier 3 platforms. (:ref:`PEP 738 ` " "written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2569 +#: ../../whatsnew/3.13.rst:2574 msgid "" "``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " "Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2572 +#: ../../whatsnew/3.13.rst:2577 msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" @@ -5756,26 +5783,26 @@ msgstr "" "``wasm32-emscripten`` 不再是 :pep:`11` 支援的平台。(由 Brett Cannon 在 :gh:" "`115192` 貢獻。)" -#: ../../whatsnew/3.13.rst:2575 +#: ../../whatsnew/3.13.rst:2580 msgid "" "Building CPython now requires a compiler with support for the C11 atomic " "library, GCC built-in atomic functions, or MSVC interlocked intrinsics." msgstr "" -#: ../../whatsnew/3.13.rst:2578 +#: ../../whatsnew/3.13.rst:2583 msgid "" "Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate the :file:" "`configure` script. (Contributed by Christian Heimes in :gh:`89886` and by " "Victor Stinner in :gh:`112090`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2582 +#: ../../whatsnew/3.13.rst:2587 msgid "" "SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " "module. (Contributed by Erlend Aasland in :gh:`105875`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2586 +#: ../../whatsnew/3.13.rst:2591 msgid "" "CPython now bundles the `mimalloc library`_ by default. It is licensed under " "the MIT license; see :ref:`mimalloc license `. The bundled " @@ -5783,27 +5810,27 @@ msgid "" "Dino Viehland in :gh:`109914`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2594 +#: ../../whatsnew/3.13.rst:2599 msgid "" "The :file:`configure` option :option:`--with-system-libmpdec` now defaults " "to ``yes``. The bundled copy of ``libmpdec`` will be removed in Python 3.16." msgstr "" -#: ../../whatsnew/3.13.rst:2598 +#: ../../whatsnew/3.13.rst:2603 msgid "" "Python built with :file:`configure` :option:`--with-trace-refs` (tracing " "references) is now ABI compatible with the Python release build and :ref:" "`debug build `. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2603 +#: ../../whatsnew/3.13.rst:2608 msgid "" "On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " "flags. For example, the free-threaded build generates ``python-3.13t.pc`` " "and the debug build generates ``python-3.13d.pc``." msgstr "" -#: ../../whatsnew/3.13.rst:2607 +#: ../../whatsnew/3.13.rst:2612 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " "``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." @@ -5813,27 +5840,27 @@ msgid "" "`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2616 +#: ../../whatsnew/3.13.rst:2621 msgid "Porting to Python 3.13" msgstr "移植至 Python 3.13" -#: ../../whatsnew/3.13.rst:2618 +#: ../../whatsnew/3.13.rst:2623 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.13.rst:2622 +#: ../../whatsnew/3.13.rst:2627 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.13.rst:2626 +#: ../../whatsnew/3.13.rst:2631 msgid "" ":ref:`PEP 667 ` introduces several changes to " "the semantics of :func:`locals` and :attr:`f_locals `:" msgstr "" -#: ../../whatsnew/3.13.rst:2629 +#: ../../whatsnew/3.13.rst:2634 msgid "" "Calling :func:`locals` in an :term:`optimized scope` now produces an " "independent snapshot on each call, and hence no longer implicitly updates " @@ -5845,7 +5872,7 @@ msgid "" "scope. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2638 +#: ../../whatsnew/3.13.rst:2643 msgid "" "Calling :func:`locals` from a comprehension at module or class scope " "(including via ``exec`` or ``eval``) once more behaves as if the " @@ -5855,7 +5882,7 @@ msgid "" "implementing :pep:`709`. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2645 +#: ../../whatsnew/3.13.rst:2650 msgid "" "Accessing :attr:`FrameType.f_locals ` in an :term:`optimized " "scope` now returns a write-through proxy rather than a snapshot that gets " @@ -5864,7 +5891,7 @@ msgid "" "of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2651 +#: ../../whatsnew/3.13.rst:2656 msgid "" ":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " "method. The behavior will change in future Python versions. Wrap it in :func:" @@ -5872,14 +5899,14 @@ msgid "" "Serhiy Storchaka in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2657 +#: ../../whatsnew/3.13.rst:2662 msgid "" "An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " "to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " "or :exc:`KeyError` on Unix platforms where the password database is empty." msgstr "" -#: ../../whatsnew/3.13.rst:2662 +#: ../../whatsnew/3.13.rst:2667 msgid "" "The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` is now a " "string (``'rb'`` or ``'wb'``) instead of an integer (``1`` or ``2``). The " @@ -5888,7 +5915,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2668 +#: ../../whatsnew/3.13.rst:2673 msgid "" ":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " "(Contributed by Zackery Spytz in :gh:`65559`.)" @@ -5896,7 +5923,7 @@ msgstr "" ":class:`mailbox.Maildir` 現在會忽略以點號 (``.``) 開頭的檔案。 (由 Zackery " "Spytz 在 :gh:`65559` 貢獻。)" -#: ../../whatsnew/3.13.rst:2671 +#: ../../whatsnew/3.13.rst:2676 msgid "" ":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " "files and directories if a pattern that ends with \"``**``\" is given, " @@ -5904,25 +5931,25 @@ msgid "" "behavior and only match directories." msgstr "" -#: ../../whatsnew/3.13.rst:2676 +#: ../../whatsnew/3.13.rst:2681 msgid "" "The :mod:`threading` module now expects the :mod:`!_thread` module to have " "an :func:`!_is_main_interpreter` function. This function takes no arguments " "and returns ``True`` if the current interpreter is the main interpreter." msgstr "" -#: ../../whatsnew/3.13.rst:2681 +#: ../../whatsnew/3.13.rst:2686 msgid "" "Any library or application that provides a custom :mod:`!_thread` module " "must provide :func:`!_is_main_interpreter`, just like the module's other " "\"private\" attributes. (:gh:`112826`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2688 +#: ../../whatsnew/3.13.rst:2693 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.13.rst:2690 +#: ../../whatsnew/3.13.rst:2695 msgid "" "``Python.h`` no longer includes the ```` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " @@ -5931,7 +5958,7 @@ msgid "" "`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2696 +#: ../../whatsnew/3.13.rst:2701 msgid "" "``Python.h`` no longer includes these standard header files: ````, " "```` and ````. If needed, they should now be " @@ -5942,7 +5969,7 @@ msgid "" "Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2704 +#: ../../whatsnew/3.13.rst:2709 msgid "" "On Windows, ``Python.h`` no longer includes the ```` standard " "header file. If needed, it should now be included explicitly. For example, " @@ -5952,7 +5979,7 @@ msgid "" "(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2711 +#: ../../whatsnew/3.13.rst:2716 msgid "" "If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" "Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" @@ -5960,18 +5987,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2716 +#: ../../whatsnew/3.13.rst:2721 msgid "" "The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " "macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.13.rst:2720 +#: ../../whatsnew/3.13.rst:2725 msgid "A ``tp_dealloc`` function that has the old macros, such as::" msgstr "有舊巨集的 ``tp_dealloc`` 函式,例如: ::" -#: ../../whatsnew/3.13.rst:2722 +#: ../../whatsnew/3.13.rst:2727 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5991,11 +6018,11 @@ msgstr "" " Py_TRASHCAN_SAFE_END\n" "}" -#: ../../whatsnew/3.13.rst:2731 +#: ../../whatsnew/3.13.rst:2736 msgid "should migrate to the new macros as follows::" msgstr "應該改為使用新的巨集,如下所示: ::" -#: ../../whatsnew/3.13.rst:2733 +#: ../../whatsnew/3.13.rst:2738 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -6015,7 +6042,7 @@ msgstr "" " Py_TRASHCAN_END\n" "}" -#: ../../whatsnew/3.13.rst:2742 +#: ../../whatsnew/3.13.rst:2747 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in. The new macros were added in Python 3.8 and " @@ -6023,13 +6050,13 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2749 +#: ../../whatsnew/3.13.rst:2754 msgid "" ":ref:`PEP 667 ` introduces several changes to " "frame-related functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2752 +#: ../../whatsnew/3.13.rst:2757 msgid "" "The effects of mutating the dictionary returned from :c:func:" "`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " @@ -6043,7 +6070,7 @@ msgid "" "being used, so refer to the deprecation notice on the function for details." msgstr "" -#: ../../whatsnew/3.13.rst:2765 +#: ../../whatsnew/3.13.rst:2770 msgid "" "Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " "returns a write-through proxy rather than a snapshot that gets updated at " @@ -6052,40 +6079,40 @@ msgid "" "`PyEval_GetFrameLocals` API." msgstr "" -#: ../../whatsnew/3.13.rst:2772 +#: ../../whatsnew/3.13.rst:2777 msgid "" ":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " "no longer have any effect. Calling these functions has been redundant since " "Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced." msgstr "" -#: ../../whatsnew/3.13.rst:2777 +#: ../../whatsnew/3.13.rst:2782 msgid "" ":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " "function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" "through proxy for :term:`optimized scopes `." msgstr "" -#: ../../whatsnew/3.13.rst:2781 +#: ../../whatsnew/3.13.rst:2786 msgid "" "Python 3.13 removed many private functions. Some of them can be replaced " "using these alternatives:" msgstr "" -#: ../../whatsnew/3.13.rst:2784 +#: ../../whatsnew/3.13.rst:2789 msgid "``_PyDict_Pop()``: :c:func:`PyDict_Pop` or :c:func:`PyDict_PopString`;" msgstr "" "``_PyDict_Pop()``::c:func:`PyDict_Pop` 或 :c:func:`PyDict_PopString`;" -#: ../../whatsnew/3.13.rst:2785 +#: ../../whatsnew/3.13.rst:2790 msgid "``_PyDict_GetItemWithError()``: :c:func:`PyDict_GetItemRef`;" msgstr "``_PyDict_GetItemWithError()``::c:func:`PyDict_GetItemRef`;" -#: ../../whatsnew/3.13.rst:2786 +#: ../../whatsnew/3.13.rst:2791 msgid "``_PyErr_WriteUnraisableMsg()``: :c:func:`PyErr_FormatUnraisable`;" msgstr "``_PyErr_WriteUnraisableMsg()``::c:func:`PyErr_FormatUnraisable`;" -#: ../../whatsnew/3.13.rst:2787 +#: ../../whatsnew/3.13.rst:2792 msgid "" "``_PyEval_SetTrace()``: :c:func:`PyEval_SetTrace` or :c:func:" "`PyEval_SetTraceAllThreads`;" @@ -6093,43 +6120,43 @@ msgstr "" "``_PyEval_SetTrace()``::c:func:`PyEval_SetTrace` 或 :c:func:" "`PyEval_SetTraceAllThreads`;" -#: ../../whatsnew/3.13.rst:2788 +#: ../../whatsnew/3.13.rst:2793 msgid "``_PyList_Extend()``: :c:func:`PyList_Extend`;" msgstr "``_PyList_Extend()``::c:func:`PyList_Extend`;" -#: ../../whatsnew/3.13.rst:2789 +#: ../../whatsnew/3.13.rst:2794 msgid "``_PyLong_AsInt()``: :c:func:`PyLong_AsInt`;" msgstr "``_PyLong_AsInt()``::c:func:`PyLong_AsInt`;" -#: ../../whatsnew/3.13.rst:2790 +#: ../../whatsnew/3.13.rst:2795 msgid "``_PyMem_RawStrdup()``: ``strdup()``;" msgstr "``_PyMem_RawStrdup()``:``strdup()``;" -#: ../../whatsnew/3.13.rst:2791 +#: ../../whatsnew/3.13.rst:2796 msgid "``_PyMem_Strdup()``: ``strdup()``;" msgstr "``_PyMem_Strdup()``:``strdup()``;" -#: ../../whatsnew/3.13.rst:2792 +#: ../../whatsnew/3.13.rst:2797 msgid "``_PyObject_ClearManagedDict()``: :c:func:`PyObject_ClearManagedDict`;" msgstr "" "``_PyObject_ClearManagedDict()``::c:func:`PyObject_ClearManagedDict`;" -#: ../../whatsnew/3.13.rst:2793 +#: ../../whatsnew/3.13.rst:2798 msgid "``_PyObject_VisitManagedDict()``: :c:func:`PyObject_VisitManagedDict`;" msgstr "" "``_PyObject_VisitManagedDict()``::c:func:`PyObject_VisitManagedDict`;" -#: ../../whatsnew/3.13.rst:2794 +#: ../../whatsnew/3.13.rst:2799 msgid "" "``_PyThreadState_UncheckedGet()``: :c:func:`PyThreadState_GetUnchecked()`;" msgstr "" "``_PyThreadState_UncheckedGet()``::c:func:`PyThreadState_GetUnchecked()`;" -#: ../../whatsnew/3.13.rst:2795 +#: ../../whatsnew/3.13.rst:2800 msgid "``_PyTime_AsSecondsDouble()``: :c:func:`PyTime_AsSecondsDouble`;" msgstr "``_PyTime_AsSecondsDouble()``::c:func:`PyTime_AsSecondsDouble`;" -#: ../../whatsnew/3.13.rst:2796 +#: ../../whatsnew/3.13.rst:2801 msgid "" "``_PyTime_GetMonotonicClock()``: :c:func:`PyTime_Monotonic` or :c:func:" "`PyTime_MonotonicRaw`;" @@ -6137,7 +6164,7 @@ msgstr "" "``_PyTime_GetMonotonicClock()``::c:func:`PyTime_Monotonic` 或 :c:func:" "`PyTime_MonotonicRaw`;" -#: ../../whatsnew/3.13.rst:2797 +#: ../../whatsnew/3.13.rst:2802 msgid "" "``_PyTime_GetPerfCounter()``: :c:func:`PyTime_PerfCounter` or :c:func:" "`PyTime_PerfCounterRaw`;" @@ -6145,7 +6172,7 @@ msgstr "" "``_PyTime_GetPerfCounter()``::c:func:`PyTime_PerfCounter` 或 :c:func:" "`PyTime_PerfCounterRaw`;" -#: ../../whatsnew/3.13.rst:2798 +#: ../../whatsnew/3.13.rst:2803 msgid "" "``_PyTime_GetSystemClock()``: :c:func:`PyTime_Time` or :c:func:" "`PyTime_TimeRaw`;" @@ -6153,27 +6180,27 @@ msgstr "" "``_PyTime_GetSystemClock()``::c:func:`PyTime_Time` 或 :c:func:" "`PyTime_TimeRaw`;" -#: ../../whatsnew/3.13.rst:2799 +#: ../../whatsnew/3.13.rst:2804 msgid "``_PyTime_MAX``: :c:var:`PyTime_MAX`;" msgstr "``_PyTime_MAX``::c:var:`PyTime_MAX`;" -#: ../../whatsnew/3.13.rst:2800 +#: ../../whatsnew/3.13.rst:2805 msgid "``_PyTime_MIN``: :c:var:`PyTime_MIN`;" msgstr "``_PyTime_MIN``::c:var:`PyTime_MIN`;" -#: ../../whatsnew/3.13.rst:2801 +#: ../../whatsnew/3.13.rst:2806 msgid "``_PyTime_t``: :c:type:`PyTime_t`;" msgstr "``_PyTime_t``::c:type:`PyTime_t`;" -#: ../../whatsnew/3.13.rst:2802 +#: ../../whatsnew/3.13.rst:2807 msgid "``_Py_HashPointer()``: :c:func:`Py_HashPointer`;" msgstr "``_Py_HashPointer()``::c:func:`Py_HashPointer`;" -#: ../../whatsnew/3.13.rst:2803 +#: ../../whatsnew/3.13.rst:2808 msgid "``_Py_IsFinalizing()``: :c:func:`Py_IsFinalizing`." msgstr "``_Py_IsFinalizing()``::c:func:`Py_IsFinalizing`。" -#: ../../whatsnew/3.13.rst:2805 +#: ../../whatsnew/3.13.rst:2810 msgid "" "The `pythoncapi-compat project`_ can be used to get most of these new " "functions on Python 3.12 and older." @@ -6181,11 +6208,11 @@ msgstr "" "可以使用 `pythoncapi-compat 專案`_\\ 來在 Python 3.12 及更舊的版本中取用大部" "分的這些新函式。" -#: ../../whatsnew/3.13.rst:2809 +#: ../../whatsnew/3.13.rst:2814 msgid "Regression Test Changes" msgstr "迴歸測試的變更" -#: ../../whatsnew/3.13.rst:2811 +#: ../../whatsnew/3.13.rst:2816 msgid "" "Python built with :file:`configure` :option:`--with-pydebug` now supports a :" "option:`-X presite=package.module <-X>` command-line option. If used, it " diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index bc0fab5078..de554c6332 100644 --- a/whatsnew/3.14.po +++ b/whatsnew/3.14.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-31 00:16+0000\n" +"POT-Creation-Date: 2026-01-07 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -55,10 +55,11 @@ msgid "" "`subinterpreters ` in the standard " "library." msgstr "" -"Python 3.14 是 Python 程式語言的最新穩定版本,包含了語言、實作和標準函式庫的各種變更。" -"最大的變更包括\\ :ref:`模板字串字面值 `、" -":ref:`延遲型別註解的求值 `,以及標準函式庫中對\\ " -":ref:`子直譯器 `\\ 的支援。" +"Python 3.14 是 Python 程式語言的最新穩定版本,包含了語言、實作和標準函式庫的" +"各種變更。最大的變更包括\\ :ref:`模板字串字面值 `、:ref:`延遲型別註解的求值 `,以" +"及標準函式庫中對\\ :ref:`子直譯器 `\\ 的支" +"援。" #: ../../whatsnew/3.14.rst:72 msgid "" @@ -1511,13 +1512,13 @@ msgstr "" msgid "The behavior of :func:`!gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.14.rst:974 ../../whatsnew/3.14.rst:3276 +#: ../../whatsnew/3.14.rst:974 ../../whatsnew/3.14.rst:3278 msgid "" "``gc.collect(1)``: Performs an increment of garbage collection, rather than " "collecting generation 1." msgstr "" -#: ../../whatsnew/3.14.rst:976 ../../whatsnew/3.14.rst:3278 +#: ../../whatsnew/3.14.rst:976 ../../whatsnew/3.14.rst:3280 msgid "Other calls to :func:`!gc.collect` are unchanged." msgstr "" @@ -3846,7 +3847,8 @@ msgstr "" msgid "" ":class:`!Traversable` (use :class:`~importlib.resources.abc.Traversable`)" msgstr "" -":class:`!Traversable`\\ (請改用 :class:`~importlib.resources.abc.Traversable`)" +":class:`!Traversable`\\ (請改用 :class:`~importlib.resources.abc." +"Traversable`)" #: ../../whatsnew/3.14.rst:2494 msgid "" @@ -4674,6 +4676,24 @@ msgstr "" ":class:`typing.ByteString` 自 Python 3.9 起已被棄用,預計在 Python 3.17 中移" "除。" +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:2 +#: ../../deprecations/pending-removal-in-3.18.rst:2 +msgid "Pending removal in Python 3.18" +msgstr "Python 3.18 中待移除的項目" + +#: ../../deprecations/pending-removal-in-3.18.rst:4 +#, fuzzy +msgid ":mod:`decimal`:" +msgstr ":mod:`datetime`:" + +#: ../../deprecations/pending-removal-in-3.18.rst:6 +msgid "" +"The non-standard and undocumented :class:`~decimal.Decimal` format specifier " +"``'N'``, which is only supported in the :mod:`!decimal` module's C " +"implementation, has been deprecated since Python 3.13. (Contributed by " +"Serhiy Storchaka in :gh:`89902`.)" +msgstr "" + #: ../../deprecations/pending-removal-in-3.19.rst:2 msgid "Pending removal in Python 3.19" msgstr "Python 3.19 中待移除的項目" @@ -5100,18 +5120,18 @@ msgstr "" ":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." "_clear_internal_caches`。" -#: ../../whatsnew/3.14.rst:2727 +#: ../../whatsnew/3.14.rst:2729 msgid "CPython bytecode changes" msgstr "CPython 位元組碼變更" -#: ../../whatsnew/3.14.rst:2729 +#: ../../whatsnew/3.14.rst:2731 msgid "" "Replaced the opcode :opcode:`!BINARY_SUBSCR` by the :opcode:`BINARY_OP` " "opcode with the ``NB_SUBSCR`` oparg. (Contributed by Irit Katriel in :gh:" "`100239`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2733 +#: ../../whatsnew/3.14.rst:2735 msgid "" "Add the :opcode:`BUILD_INTERPOLATION` and :opcode:`BUILD_TEMPLATE` opcodes " "to construct new :class:`~string.templatelib.Interpolation` and :class:" @@ -5120,20 +5140,20 @@ msgid "" "Template strings `)." msgstr "" -#: ../../whatsnew/3.14.rst:2739 +#: ../../whatsnew/3.14.rst:2741 msgid "" "Remove the :opcode:`!BUILD_CONST_KEY_MAP` opcode. Use :opcode:`BUILD_MAP` " "instead. (Contributed by Mark Shannon in :gh:`122160`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2743 +#: ../../whatsnew/3.14.rst:2745 msgid "" "Replace the :opcode:`!LOAD_ASSERTION_ERROR` opcode with :opcode:" "`LOAD_COMMON_CONSTANT` and add support for loading :exc:" "`NotImplementedError`." msgstr "" -#: ../../whatsnew/3.14.rst:2747 +#: ../../whatsnew/3.14.rst:2749 msgid "" "Add the :opcode:`LOAD_FAST_BORROW` and :opcode:" "`LOAD_FAST_BORROW_LOAD_FAST_BORROW` opcodes to reduce reference counting " @@ -5142,14 +5162,14 @@ msgid "" "gh:`130704`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2752 +#: ../../whatsnew/3.14.rst:2754 msgid "" "Add the :opcode:`LOAD_SMALL_INT` opcode, which pushes a small integer equal " "to the ``oparg`` to the stack. The :opcode:`!RETURN_CONST` opcode is removed " "as it is no longer used. (Contributed by Mark Shannon in :gh:`125837`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2757 +#: ../../whatsnew/3.14.rst:2759 msgid "" "Add the new :opcode:`LOAD_SPECIAL` instruction. Generate code for :keyword:" "`with` and :keyword:`async with` statements using the new instruction. " @@ -5157,17 +5177,17 @@ msgid "" "instructions. (Contributed by Mark Shannon in :gh:`120507`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2763 +#: ../../whatsnew/3.14.rst:2765 msgid "" "Add the :opcode:`POP_ITER` opcode to support 'virtual' iterators. " "(Contributed by Mark Shannon in :gh:`132554`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2768 +#: ../../whatsnew/3.14.rst:2770 msgid "Pseudo-instructions" msgstr "" -#: ../../whatsnew/3.14.rst:2770 +#: ../../whatsnew/3.14.rst:2772 msgid "" "Add the :opcode:`!ANNOTATIONS_PLACEHOLDER` pseudo instruction to support " "partially executed module-level annotations with :ref:`deferred evaluation " @@ -5175,14 +5195,14 @@ msgid "" "Zijlstra in :gh:`130907`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2775 +#: ../../whatsnew/3.14.rst:2777 msgid "" "Add the :opcode:`!BINARY_OP_EXTEND` pseudo instruction, which executes a " "pair of functions (guard and specialization functions) accessed from the " "inline cache. (Contributed by Irit Katriel in :gh:`100239`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2780 +#: ../../whatsnew/3.14.rst:2782 msgid "" "Add three specializations for :opcode:`CALL_KW`; :opcode:`!CALL_KW_PY` for " "calls to Python functions, :opcode:`!CALL_KW_BOUND_METHOD` for calls to " @@ -5190,7 +5210,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`118093`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2786 +#: ../../whatsnew/3.14.rst:2788 msgid "" "Add the :opcode:`JUMP_IF_TRUE` and :opcode:`JUMP_IF_FALSE` pseudo " "instructions, conditional jumps which do not impact the stack. Replaced by " @@ -5198,55 +5218,55 @@ msgid "" "(Contributed by Irit Katriel in :gh:`124285`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2791 +#: ../../whatsnew/3.14.rst:2793 msgid "" "Add the :opcode:`!LOAD_CONST_MORTAL` pseudo instruction. (Contributed by " "Mark Shannon in :gh:`128685`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2794 +#: ../../whatsnew/3.14.rst:2796 msgid "" "Add the :opcode:`LOAD_CONST_IMMORTAL` pseudo instruction, which does the " "same as :opcode:`!LOAD_CONST`, but is more efficient for immortal objects. " "(Contributed by Mark Shannon in :gh:`125837`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2799 +#: ../../whatsnew/3.14.rst:2801 msgid "" "Add the :opcode:`NOT_TAKEN` pseudo instruction, used by :mod:`sys." "monitoring` to record branch events (such as :monitoring-event:" "`BRANCH_LEFT`). (Contributed by Mark Shannon in :gh:`122548`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2805 +#: ../../whatsnew/3.14.rst:2807 msgid "C API changes" msgstr "C API 變更" -#: ../../whatsnew/3.14.rst:2810 +#: ../../whatsnew/3.14.rst:2812 msgid "Python configuration C API" msgstr "Python 配置 C API" -#: ../../whatsnew/3.14.rst:2812 +#: ../../whatsnew/3.14.rst:2814 msgid "" "Add a :ref:`PyInitConfig C API ` to configure the Python " "initialization without relying on C structures and the ability to make ABI-" "compatible changes in the future." msgstr "" -#: ../../whatsnew/3.14.rst:2816 +#: ../../whatsnew/3.14.rst:2818 msgid "" "Complete the :pep:`587` :ref:`PyConfig C API ` by adding :c:" "func:`PyInitConfig_AddModule` which can be used to add a built-in extension " "module; a feature previously referred to as the \"inittab\"." msgstr "" -#: ../../whatsnew/3.14.rst:2820 +#: ../../whatsnew/3.14.rst:2822 msgid "" "Add :c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions to get and " "set the current runtime configuration." msgstr "" -#: ../../whatsnew/3.14.rst:2823 +#: ../../whatsnew/3.14.rst:2825 msgid "" ":pep:`587` 'Python Initialization Configuration' unified all the ways to " "configure Python's initialization. This PEP also unifies the configuration " @@ -5255,7 +5275,7 @@ msgid "" "two 'Python' and 'Isolated' choices (PEP 587), to further simplify the API." msgstr "" -#: ../../whatsnew/3.14.rst:2830 +#: ../../whatsnew/3.14.rst:2832 msgid "" "The lower level PEP 587 PyConfig API remains available for use cases with an " "intentionally higher level of coupling to CPython implementation details " @@ -5263,20 +5283,20 @@ msgid "" "configuration mechanisms)." msgstr "" -#: ../../whatsnew/3.14.rst:2835 ../../whatsnew/3.14.rst:2862 -#: ../../whatsnew/3.14.rst:2882 +#: ../../whatsnew/3.14.rst:2837 ../../whatsnew/3.14.rst:2864 +#: ../../whatsnew/3.14.rst:2884 msgid "(Contributed by Victor Stinner in :gh:`107954`.)" msgstr "(由 Victor Stinner 於 :gh:`107954` 貢獻。)" -#: ../../whatsnew/3.14.rst:2837 +#: ../../whatsnew/3.14.rst:2839 msgid ":pep:`741` and :pep:`587`" msgstr ":pep:`741` 和 :pep:`587`" -#: ../../whatsnew/3.14.rst:2841 +#: ../../whatsnew/3.14.rst:2843 msgid "New features in the C API" msgstr "C API 中的新功能" -#: ../../whatsnew/3.14.rst:2843 +#: ../../whatsnew/3.14.rst:2845 msgid "" "Add :c:func:`Py_PACK_VERSION` and :c:func:`Py_PACK_FULL_VERSION`, two new " "macros for bit-packing Python version numbers. This is useful for " @@ -5284,14 +5304,14 @@ msgid "" "(Contributed by Petr Viktorin in :gh:`128629`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2849 +#: ../../whatsnew/3.14.rst:2851 msgid "" "Add :c:func:`PyBytes_Join(sep, iterable) ` function, similar " "to ``sep.join(iterable)`` in Python. (Contributed by Victor Stinner in :gh:" "`121645`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2853 +#: ../../whatsnew/3.14.rst:2855 msgid "" "Add functions to manipulate the configuration of the current runtime Python " "interpreter (:ref:`PEP 741: Python configuration C API `):" -#: ../../whatsnew/3.14.rst:2857 +#: ../../whatsnew/3.14.rst:2859 msgid ":c:func:`PyConfig_Get`" msgstr ":c:func:`PyConfig_Get`" -#: ../../whatsnew/3.14.rst:2858 +#: ../../whatsnew/3.14.rst:2860 msgid ":c:func:`PyConfig_GetInt`" msgstr ":c:func:`PyConfig_GetInt`" -#: ../../whatsnew/3.14.rst:2859 +#: ../../whatsnew/3.14.rst:2861 msgid ":c:func:`PyConfig_Set`" msgstr ":c:func:`PyConfig_Set`" -#: ../../whatsnew/3.14.rst:2860 +#: ../../whatsnew/3.14.rst:2862 msgid ":c:func:`PyConfig_Names`" msgstr ":c:func:`PyConfig_Names`" -#: ../../whatsnew/3.14.rst:2864 +#: ../../whatsnew/3.14.rst:2866 msgid "" "Add functions to configure Python initialization (:ref:`PEP 741: Python " "configuration C API `):" @@ -5324,63 +5344,63 @@ msgstr "" "新增用於配置 Python 初始化的函式(:ref:`PEP 741:Python 配置 C API " "`):" -#: ../../whatsnew/3.14.rst:2867 +#: ../../whatsnew/3.14.rst:2869 msgid ":c:func:`Py_InitializeFromInitConfig`" msgstr ":c:func:`Py_InitializeFromInitConfig`" -#: ../../whatsnew/3.14.rst:2868 +#: ../../whatsnew/3.14.rst:2870 msgid ":c:func:`PyInitConfig_AddModule`" msgstr ":c:func:`PyInitConfig_AddModule`" -#: ../../whatsnew/3.14.rst:2869 +#: ../../whatsnew/3.14.rst:2871 msgid ":c:func:`PyInitConfig_Create`" msgstr ":c:func:`PyInitConfig_Create`" -#: ../../whatsnew/3.14.rst:2870 +#: ../../whatsnew/3.14.rst:2872 msgid ":c:func:`PyInitConfig_Free`" msgstr ":c:func:`PyInitConfig_Free`" -#: ../../whatsnew/3.14.rst:2871 +#: ../../whatsnew/3.14.rst:2873 msgid ":c:func:`PyInitConfig_FreeStrList`" msgstr ":c:func:`PyInitConfig_FreeStrList`" -#: ../../whatsnew/3.14.rst:2872 +#: ../../whatsnew/3.14.rst:2874 msgid ":c:func:`PyInitConfig_GetError`" msgstr ":c:func:`PyInitConfig_GetError`" -#: ../../whatsnew/3.14.rst:2873 +#: ../../whatsnew/3.14.rst:2875 msgid ":c:func:`PyInitConfig_GetExitCode`" msgstr ":c:func:`PyInitConfig_GetExitCode`" -#: ../../whatsnew/3.14.rst:2874 +#: ../../whatsnew/3.14.rst:2876 msgid ":c:func:`PyInitConfig_GetInt`" msgstr ":c:func:`PyInitConfig_GetInt`" -#: ../../whatsnew/3.14.rst:2875 +#: ../../whatsnew/3.14.rst:2877 msgid ":c:func:`PyInitConfig_GetStr`" msgstr ":c:func:`PyInitConfig_GetStr`" -#: ../../whatsnew/3.14.rst:2876 +#: ../../whatsnew/3.14.rst:2878 msgid ":c:func:`PyInitConfig_GetStrList`" msgstr ":c:func:`PyInitConfig_GetStrList`" -#: ../../whatsnew/3.14.rst:2877 +#: ../../whatsnew/3.14.rst:2879 msgid ":c:func:`PyInitConfig_HasOption`" msgstr ":c:func:`PyInitConfig_HasOption`" -#: ../../whatsnew/3.14.rst:2878 +#: ../../whatsnew/3.14.rst:2880 msgid ":c:func:`PyInitConfig_SetInt`" msgstr ":c:func:`PyInitConfig_SetInt`" -#: ../../whatsnew/3.14.rst:2879 +#: ../../whatsnew/3.14.rst:2881 msgid ":c:func:`PyInitConfig_SetStr`" msgstr ":c:func:`PyInitConfig_SetStr`" -#: ../../whatsnew/3.14.rst:2880 +#: ../../whatsnew/3.14.rst:2882 msgid ":c:func:`PyInitConfig_SetStrList`" msgstr ":c:func:`PyInitConfig_SetStrList`" -#: ../../whatsnew/3.14.rst:2884 +#: ../../whatsnew/3.14.rst:2886 msgid "" "Add :c:func:`Py_fopen` function to open a file. This works similarly to the " "standard C :c:func:`!fopen` function, instead accepting a Python object for " @@ -5389,13 +5409,13 @@ msgid "" "(Contributed by Victor Stinner in :gh:`127350`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2892 +#: ../../whatsnew/3.14.rst:2894 msgid "" "Add :c:func:`Py_HashBuffer` to compute and return the hash value of a " "buffer. (Contributed by Antoine Pitrou and Victor Stinner in :gh:`122854`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2895 +#: ../../whatsnew/3.14.rst:2897 msgid "" "Add :c:func:`PyImport_ImportModuleAttr` and :c:func:" "`PyImport_ImportModuleAttrString` helper functions to import a module and " @@ -5403,20 +5423,20 @@ msgid "" "`128911`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2900 +#: ../../whatsnew/3.14.rst:2902 msgid "" "Add :c:func:`PyIter_NextItem` to replace :c:func:`PyIter_Next`, which has an " "ambiguous return value. (Contributed by Irit Katriel and Erlend Aasland in :" "gh:`105201`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2904 +#: ../../whatsnew/3.14.rst:2906 msgid "" "Add :c:func:`PyLong_GetSign` function to get the sign of :class:`int` " "objects. (Contributed by Sergey B Kirpichev in :gh:`116560`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2907 +#: ../../whatsnew/3.14.rst:2909 msgid "" "Add :c:func:`PyLong_IsPositive`, :c:func:`PyLong_IsNegative` and :c:func:" "`PyLong_IsZero` for checking if :c:type:`PyLongObject` is positive, " @@ -5424,82 +5444,82 @@ msgid "" "Kirpichev in :gh:`126061`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2912 +#: ../../whatsnew/3.14.rst:2914 msgid "" "Add new functions to convert C ```` numbers to/from Python :class:" "`int` objects:" msgstr "" -#: ../../whatsnew/3.14.rst:2915 +#: ../../whatsnew/3.14.rst:2917 msgid ":c:func:`PyLong_AsInt32`" msgstr ":c:func:`PyLong_AsInt32`" -#: ../../whatsnew/3.14.rst:2916 +#: ../../whatsnew/3.14.rst:2918 msgid ":c:func:`PyLong_AsInt64`" msgstr ":c:func:`PyLong_AsInt64`" -#: ../../whatsnew/3.14.rst:2917 +#: ../../whatsnew/3.14.rst:2919 msgid ":c:func:`PyLong_AsUInt32`" msgstr ":c:func:`PyLong_AsUInt32`" -#: ../../whatsnew/3.14.rst:2918 +#: ../../whatsnew/3.14.rst:2920 msgid ":c:func:`PyLong_AsUInt64`" msgstr ":c:func:`PyLong_AsUInt64`" -#: ../../whatsnew/3.14.rst:2919 +#: ../../whatsnew/3.14.rst:2921 msgid ":c:func:`PyLong_FromInt32`" msgstr ":c:func:`PyLong_FromInt32`" -#: ../../whatsnew/3.14.rst:2920 +#: ../../whatsnew/3.14.rst:2922 msgid ":c:func:`PyLong_FromInt64`" msgstr ":c:func:`PyLong_FromInt64`" -#: ../../whatsnew/3.14.rst:2921 +#: ../../whatsnew/3.14.rst:2923 msgid ":c:func:`PyLong_FromUInt32`" msgstr ":c:func:`PyLong_FromUInt32`" -#: ../../whatsnew/3.14.rst:2922 +#: ../../whatsnew/3.14.rst:2924 msgid ":c:func:`PyLong_FromUInt64`" msgstr ":c:func:`PyLong_FromUInt64`" -#: ../../whatsnew/3.14.rst:2924 +#: ../../whatsnew/3.14.rst:2926 msgid "(Contributed by Victor Stinner in :gh:`120389`.)" msgstr "(由 Victor Stinner 於 :gh:`120389` 貢獻。)" -#: ../../whatsnew/3.14.rst:2926 +#: ../../whatsnew/3.14.rst:2928 msgid "" "Add a new import and export API for Python :class:`int` objects (:pep:`757`):" msgstr "" -#: ../../whatsnew/3.14.rst:2929 +#: ../../whatsnew/3.14.rst:2931 msgid ":c:func:`PyLong_GetNativeLayout`" msgstr ":c:func:`PyLong_GetNativeLayout`" -#: ../../whatsnew/3.14.rst:2930 +#: ../../whatsnew/3.14.rst:2932 msgid ":c:func:`PyLong_Export`" msgstr ":c:func:`PyLong_Export`" -#: ../../whatsnew/3.14.rst:2931 +#: ../../whatsnew/3.14.rst:2933 msgid ":c:func:`PyLong_FreeExport`" msgstr ":c:func:`PyLong_FreeExport`" -#: ../../whatsnew/3.14.rst:2932 +#: ../../whatsnew/3.14.rst:2934 msgid ":c:func:`PyLongWriter_Create`" msgstr ":c:func:`PyLongWriter_Create`" -#: ../../whatsnew/3.14.rst:2933 +#: ../../whatsnew/3.14.rst:2935 msgid ":c:func:`PyLongWriter_Finish`" msgstr ":c:func:`PyLongWriter_Finish`" -#: ../../whatsnew/3.14.rst:2934 +#: ../../whatsnew/3.14.rst:2936 msgid ":c:func:`PyLongWriter_Discard`" msgstr ":c:func:`PyLongWriter_Discard`" -#: ../../whatsnew/3.14.rst:2936 +#: ../../whatsnew/3.14.rst:2938 msgid "(Contributed by Sergey B Kirpichev and Victor Stinner in :gh:`102471`.)" msgstr "(由 Sergey B Kirpichev 和 Victor Stinner 於 :gh:`102471` 貢獻。)" -#: ../../whatsnew/3.14.rst:2938 +#: ../../whatsnew/3.14.rst:2940 msgid "" "Add :c:func:`PyMonitoring_FireBranchLeftEvent` and :c:func:" "`PyMonitoring_FireBranchRightEvent` for generating :monitoring-event:" @@ -5507,13 +5527,13 @@ msgid "" "(Contributed by Mark Shannon in :gh:`122548`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2944 +#: ../../whatsnew/3.14.rst:2946 msgid "" "Add :c:func:`PyType_Freeze` function to make a type immutable. (Contributed " "by Victor Stinner in :gh:`121654`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2947 +#: ../../whatsnew/3.14.rst:2949 msgid "" "Add :c:func:`PyType_GetBaseByToken` and :c:data:`Py_tp_token` slot for " "easier superclass identification, which attempts to resolve the type " @@ -5521,110 +5541,110 @@ msgid "" "in :gh:`124153`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2952 +#: ../../whatsnew/3.14.rst:2954 msgid "" "Add a new :c:func:`PyUnicode_Equal` function to test if two strings are " "equal. The function is also added to the Limited C API. (Contributed by " "Victor Stinner in :gh:`124502`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2957 +#: ../../whatsnew/3.14.rst:2959 msgid "" "Add a new :c:type:`PyUnicodeWriter` API to create a Python :class:`str` " "object, with the following functions:" msgstr "" -#: ../../whatsnew/3.14.rst:2960 +#: ../../whatsnew/3.14.rst:2962 msgid ":c:func:`PyUnicodeWriter_Create`" msgstr ":c:func:`PyUnicodeWriter_Create`" -#: ../../whatsnew/3.14.rst:2961 +#: ../../whatsnew/3.14.rst:2963 msgid ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" msgstr ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" -#: ../../whatsnew/3.14.rst:2962 +#: ../../whatsnew/3.14.rst:2964 msgid ":c:func:`PyUnicodeWriter_Discard`" msgstr ":c:func:`PyUnicodeWriter_Discard`" -#: ../../whatsnew/3.14.rst:2963 +#: ../../whatsnew/3.14.rst:2965 msgid ":c:func:`PyUnicodeWriter_Finish`" msgstr ":c:func:`PyUnicodeWriter_Finish`" -#: ../../whatsnew/3.14.rst:2964 +#: ../../whatsnew/3.14.rst:2966 msgid ":c:func:`PyUnicodeWriter_Format`" msgstr ":c:func:`PyUnicodeWriter_Format`" -#: ../../whatsnew/3.14.rst:2965 +#: ../../whatsnew/3.14.rst:2967 msgid ":c:func:`PyUnicodeWriter_WriteASCII`" msgstr ":c:func:`PyUnicodeWriter_WriteASCII`" -#: ../../whatsnew/3.14.rst:2966 +#: ../../whatsnew/3.14.rst:2968 msgid ":c:func:`PyUnicodeWriter_WriteChar`" msgstr ":c:func:`PyUnicodeWriter_WriteChar`" -#: ../../whatsnew/3.14.rst:2967 +#: ../../whatsnew/3.14.rst:2969 msgid ":c:func:`PyUnicodeWriter_WriteRepr`" msgstr ":c:func:`PyUnicodeWriter_WriteRepr`" -#: ../../whatsnew/3.14.rst:2968 +#: ../../whatsnew/3.14.rst:2970 msgid ":c:func:`PyUnicodeWriter_WriteStr`" msgstr ":c:func:`PyUnicodeWriter_WriteStr`" -#: ../../whatsnew/3.14.rst:2969 +#: ../../whatsnew/3.14.rst:2971 msgid ":c:func:`PyUnicodeWriter_WriteSubstring`" msgstr ":c:func:`PyUnicodeWriter_WriteSubstring`" -#: ../../whatsnew/3.14.rst:2970 +#: ../../whatsnew/3.14.rst:2972 msgid ":c:func:`PyUnicodeWriter_WriteUCS4`" msgstr ":c:func:`PyUnicodeWriter_WriteUCS4`" -#: ../../whatsnew/3.14.rst:2971 +#: ../../whatsnew/3.14.rst:2973 msgid ":c:func:`PyUnicodeWriter_WriteUTF8`" msgstr ":c:func:`PyUnicodeWriter_WriteUTF8`" -#: ../../whatsnew/3.14.rst:2972 +#: ../../whatsnew/3.14.rst:2974 msgid ":c:func:`PyUnicodeWriter_WriteWideChar`" msgstr ":c:func:`PyUnicodeWriter_WriteWideChar`" -#: ../../whatsnew/3.14.rst:2974 +#: ../../whatsnew/3.14.rst:2976 msgid "(Contributed by Victor Stinner in :gh:`119182`.)" msgstr "(由 Victor Stinner 於 :gh:`119182` 貢獻。)" -#: ../../whatsnew/3.14.rst:2976 +#: ../../whatsnew/3.14.rst:2978 msgid "" "The ``k`` and ``K`` formats in :c:func:`PyArg_ParseTuple` and similar " "functions now use :meth:`~object.__index__` if available, like all other " "integer formats. (Contributed by Serhiy Storchaka in :gh:`112068`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2981 +#: ../../whatsnew/3.14.rst:2983 msgid "" "Add support for a new ``p`` format unit in :c:func:`Py_BuildValue` that " "produces a Python :class:`bool` object from a C integer. (Contributed by " "Pablo Galindo in :issue:`45325`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2985 +#: ../../whatsnew/3.14.rst:2987 msgid "" "Add :c:func:`PyUnstable_IsImmortal` for determining if an object is :term:" "`immortal`, for debugging purposes. (Contributed by Peter Bierma in :gh:" "`128509`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2989 +#: ../../whatsnew/3.14.rst:2991 msgid "" "Add :c:func:`PyUnstable_Object_EnableDeferredRefcount` for enabling deferred " "reference counting, as outlined in :pep:`703`." msgstr "" -#: ../../whatsnew/3.14.rst:2992 +#: ../../whatsnew/3.14.rst:2994 msgid "" "Add :c:func:`PyUnstable_Object_IsUniquelyReferenced` as a replacement for " "``Py_REFCNT(op) == 1`` on :term:`free threaded ` builds. " "(Contributed by Peter Bierma in :gh:`133140`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2997 +#: ../../whatsnew/3.14.rst:2999 msgid "" "Add :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` to determine if " "an object is a unique temporary object on the interpreter's operand stack. " @@ -5633,11 +5653,11 @@ msgid "" "functions. (Contributed by Sam Gross in :gh:`133164`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3007 +#: ../../whatsnew/3.14.rst:3009 msgid "Limited C API changes" msgstr "" -#: ../../whatsnew/3.14.rst:3009 +#: ../../whatsnew/3.14.rst:3011 msgid "" "In the limited C API version 3.14 and newer, :c:func:`Py_TYPE` and :c:func:" "`Py_REFCNT` are now implemented as an opaque function call to hide " @@ -5645,7 +5665,7 @@ msgid "" "gh:`124127`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3014 +#: ../../whatsnew/3.14.rst:3016 msgid "" "Remove the :c:macro:`PySequence_Fast_GET_SIZE`, :c:macro:" "`PySequence_Fast_GET_ITEM`, and :c:macro:`PySequence_Fast_ITEMS` macros from " @@ -5653,32 +5673,32 @@ msgid "" "(Contributed by Victor Stinner in :gh:`91417`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3025 +#: ../../whatsnew/3.14.rst:3027 msgid "Removed C APIs" msgstr "被移除的 C API" -#: ../../whatsnew/3.14.rst:3027 +#: ../../whatsnew/3.14.rst:3029 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases was deprecated in Python 3.12, and now raises a :exc:`TypeError`. " "(Contributed by Nikita Sobolev in :gh:`119775`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3032 +#: ../../whatsnew/3.14.rst:3034 msgid "" "Remove ``PyDictObject.ma_version_tag`` member, which was deprecated in " "Python 3.12. Use the :c:func:`PyDict_AddWatcher` API instead. (Contributed " "by Sam Gross in :gh:`124296`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3037 +#: ../../whatsnew/3.14.rst:3039 msgid "" "Remove the private ``_Py_InitializeMain()`` function. It was a :term:" "`provisional API` added to Python 3.8 by :pep:`587`. (Contributed by Victor " "Stinner in :gh:`129033`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3041 +#: ../../whatsnew/3.14.rst:3043 msgid "" "Remove the undocumented APIs :c:macro:`!Py_C_RECURSION_LIMIT` and :c:member:" "`!PyThreadState.c_recursion_remaining`. These were added in 3.13 and have " @@ -5687,18 +5707,18 @@ msgid "" "`133079`, see also :gh:`130396`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3052 +#: ../../whatsnew/3.14.rst:3054 msgid "Deprecated C APIs" msgstr "已棄用的 C API" -#: ../../whatsnew/3.14.rst:3054 +#: ../../whatsnew/3.14.rst:3056 msgid "" "The :c:macro:`!Py_HUGE_VAL` macro is now :term:`soft deprecated`. Use :c:" "macro:`!Py_INFINITY` instead. (Contributed by Sergey B Kirpichev in :gh:" "`120026`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3058 +#: ../../whatsnew/3.14.rst:3060 msgid "" "The :c:macro:`!Py_IS_NAN`, :c:macro:`!Py_IS_INFINITY`, and :c:macro:`!" "Py_IS_FINITE` macros are now :term:`soft deprecated`. Use :c:macro:`!" @@ -5706,7 +5726,7 @@ msgid "" "file:`math.h` since C99. (Contributed by Sergey B Kirpichev in :gh:`119613`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3064 +#: ../../whatsnew/3.14.rst:3066 msgid "" "Non-tuple sequences are now deprecated as argument for the ``(items)`` " "format unit in :c:func:`PyArg_ParseTuple` and other :ref:`argument parsing " @@ -5715,14 +5735,14 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`50333`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3071 +#: ../../whatsnew/3.14.rst:3073 msgid "" "The ``_PyMonitoring_FireBranchEvent`` function is now deprecated and should " "be replaced with calls to :c:func:`PyMonitoring_FireBranchLeftEvent` and :c:" "func:`PyMonitoring_FireBranchRightEvent`." msgstr "" -#: ../../whatsnew/3.14.rst:3076 +#: ../../whatsnew/3.14.rst:3078 msgid "" "The previously undocumented function :c:func:`PySequence_In` is now :term:" "`soft deprecated`. Use :c:func:`PySequence_Contains` instead. (Contributed " @@ -6092,10 +6112,6 @@ msgstr "" msgid "The bundled copy of ``libmpdec``." msgstr "``libmpdecimal`` 的打包副本 (bundled copy)。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:2 -msgid "Pending removal in Python 3.18" -msgstr "Python 3.18 中待移除的項目" - #: ../../deprecations/c-api-pending-removal-in-3.18.rst:4 msgid "" "The following private functions are deprecated and planned for removal in " @@ -6350,11 +6366,11 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.14.rst:3095 +#: ../../whatsnew/3.14.rst:3097 msgid "Build changes" msgstr "建置變更" -#: ../../whatsnew/3.14.rst:3097 +#: ../../whatsnew/3.14.rst:3099 msgid "" ":pep:`776`: Emscripten is now an officially supported platform at :pep:`tier " "3 <11#tier-3>`. As a part of this effort, more than 25 bugs in `Emscripten " @@ -6364,31 +6380,31 @@ msgid "" "Chatham in :gh:`127146`, :gh:`127683`, and :gh:`136931`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3107 +#: ../../whatsnew/3.14.rst:3109 msgid "Official Android binary releases are now provided on python.org__." msgstr "" -#: ../../whatsnew/3.14.rst:3111 +#: ../../whatsnew/3.14.rst:3113 msgid "" "GNU Autoconf 2.72 is now required to generate :file:`configure`. " "(Contributed by Erlend Aasland in :gh:`115765`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3114 +#: ../../whatsnew/3.14.rst:3116 msgid "" "``wasm32-unknown-emscripten`` is now a :pep:`11` tier 3 platform. " "(Contributed by R. Hood Chatham in :gh:`127146`, :gh:`127683`, and :gh:" "`136931`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3117 +#: ../../whatsnew/3.14.rst:3119 msgid "" "``#pragma``-based linking with ``python3*.lib`` can now be switched off " "with :c:expr:`Py_NO_LINK_LIB`. (Contributed by Jean-Christophe Fillion-Robin " "in :gh:`82909`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3121 +#: ../../whatsnew/3.14.rst:3123 msgid "" "CPython now enables a set of recommended compiler options by default for " "improved security. Use the :option:`--disable-safety` :file:`configure` " @@ -6396,45 +6412,45 @@ msgid "" "larger set of compiler options, albeit with a performance cost." msgstr "" -#: ../../whatsnew/3.14.rst:3127 +#: ../../whatsnew/3.14.rst:3129 msgid "" "The ``WITH_FREELISTS`` macro and ``--without-freelists`` :file:`configure` " "option have been removed." msgstr "" -#: ../../whatsnew/3.14.rst:3130 +#: ../../whatsnew/3.14.rst:3132 msgid "" "The new :file:`configure` option :option:`--with-tail-call-interp` may be " "used to enable the experimental tail call interpreter. See :ref:`whatsnew314-" "tail-call-interpreter` for further details." msgstr "" -#: ../../whatsnew/3.14.rst:3134 +#: ../../whatsnew/3.14.rst:3136 msgid "" "To disable the new remote debugging support, use the :option:`--without-" "remote-debug` :file:`configure` option. This may be useful for security " "reasons." msgstr "" -#: ../../whatsnew/3.14.rst:3138 +#: ../../whatsnew/3.14.rst:3140 msgid "" "iOS and macOS apps can now be configured to redirect ``stdout`` and " "``stderr`` content to the system log. (Contributed by Russell Keith-Magee " "in :gh:`127592`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3142 +#: ../../whatsnew/3.14.rst:3144 msgid "" "The iOS testbed is now able to stream test output while the test is running. " "The testbed can also be used to run the test suite of projects other than " "CPython itself. (Contributed by Russell Keith-Magee in :gh:`127592`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3151 +#: ../../whatsnew/3.14.rst:3153 msgid ":file:`build-details.json`" msgstr ":file:`build-details.json`" -#: ../../whatsnew/3.14.rst:3153 +#: ../../whatsnew/3.14.rst:3155 msgid "" "Installations of Python now contain a new file, :file:`build-details.json`. " "This is a static JSON document containing build details for CPython, to " @@ -6442,7 +6458,7 @@ msgid "" "cases such as Python launchers, cross-compilation, and so on." msgstr "" -#: ../../whatsnew/3.14.rst:3159 +#: ../../whatsnew/3.14.rst:3161 msgid "" ":file:`build-details.json` must be installed in the platform-independent " "standard library directory. This corresponds to the :ref:`'stdlib' " @@ -6450,17 +6466,17 @@ msgid "" "by running ``sysconfig.get_path('stdlib')``." msgstr "" -#: ../../whatsnew/3.14.rst:3165 +#: ../../whatsnew/3.14.rst:3167 msgid "" ":pep:`739` -- ``build-details.json`` 1.0 -- a static description file for " "Python build details" msgstr "" -#: ../../whatsnew/3.14.rst:3172 +#: ../../whatsnew/3.14.rst:3174 msgid "Discontinuation of PGP signatures" msgstr "" -#: ../../whatsnew/3.14.rst:3174 +#: ../../whatsnew/3.14.rst:3176 msgid "" "PGP (Pretty Good Privacy) signatures will not be provided for releases of " "Python 3.14 or future versions. To verify CPython artifacts, users must use " @@ -6468,15 +6484,15 @@ msgid "" "sigstore/>`__. Releases have been signed using Sigstore_ since Python 3.11." msgstr "" -#: ../../whatsnew/3.14.rst:3180 +#: ../../whatsnew/3.14.rst:3182 msgid "This change in release process was specified in :pep:`761`." msgstr "" -#: ../../whatsnew/3.14.rst:3188 +#: ../../whatsnew/3.14.rst:3190 msgid "Free-threaded Python is officially supported" msgstr "" -#: ../../whatsnew/3.14.rst:3190 +#: ../../whatsnew/3.14.rst:3192 msgid "" "The free-threaded build of Python is now supported and no longer " "experimental. This is the start of `phase II `__, with free-threading as the default or sole build of Python is " @@ -6507,19 +6523,19 @@ msgid "" "and the community. This decision is for the future." msgstr "" -#: ../../whatsnew/3.14.rst:3210 +#: ../../whatsnew/3.14.rst:3212 msgid ":pep:`779`" msgstr ":pep:`779`" -#: ../../whatsnew/3.14.rst:3212 +#: ../../whatsnew/3.14.rst:3214 msgid "`PEP 779's acceptance `__" msgstr "`PEP 779 的接受 `__" -#: ../../whatsnew/3.14.rst:3218 +#: ../../whatsnew/3.14.rst:3220 msgid "Binary releases for the experimental just-in-time compiler" msgstr "" -#: ../../whatsnew/3.14.rst:3220 +#: ../../whatsnew/3.14.rst:3222 msgid "" "The official macOS and Windows release binaries now include an " "*experimental* just-in-time (JIT) compiler. Although it is **not** " @@ -6529,7 +6545,7 @@ msgid "" "off` configuration option for similar behavior." msgstr "" -#: ../../whatsnew/3.14.rst:3227 +#: ../../whatsnew/3.14.rst:3229 msgid "" "The JIT is at an early stage and still in active development. As such, the " "typical performance impact of enabling it can range from 10% slower to 20% " @@ -6541,7 +6557,7 @@ msgid "" "current process." msgstr "" -#: ../../whatsnew/3.14.rst:3235 +#: ../../whatsnew/3.14.rst:3237 msgid "" "Currently, the most significant missing functionality is that native " "debuggers and profilers like ``gdb`` and ``perf`` are unable to unwind " @@ -6550,83 +6566,83 @@ msgid "" "not support JIT compilation." msgstr "" -#: ../../whatsnew/3.14.rst:3240 +#: ../../whatsnew/3.14.rst:3242 msgid "" "Please report any bugs or major performance regressions that you encounter!" msgstr "" -#: ../../whatsnew/3.14.rst:3242 +#: ../../whatsnew/3.14.rst:3244 msgid ":pep:`744`" msgstr ":pep:`744`" -#: ../../whatsnew/3.14.rst:3246 +#: ../../whatsnew/3.14.rst:3248 msgid "Porting to Python 3.14" msgstr "移植至 Python 3.14" -#: ../../whatsnew/3.14.rst:3248 +#: ../../whatsnew/3.14.rst:3250 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.14.rst:3253 +#: ../../whatsnew/3.14.rst:3255 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.14.rst:3255 +#: ../../whatsnew/3.14.rst:3257 msgid "" "On Unix platforms other than macOS, *forkserver* is now the default :ref:" "`start method ` for :mod:`multiprocessing` " "and :class:`~concurrent.futures.ProcessPoolExecutor`, instead of *fork*." msgstr "" -#: ../../whatsnew/3.14.rst:3259 +#: ../../whatsnew/3.14.rst:3261 msgid "" "See :ref:`(1) ` and :ref:`(2) " "` for details." msgstr "" -#: ../../whatsnew/3.14.rst:3262 +#: ../../whatsnew/3.14.rst:3264 msgid "" "If you encounter :exc:`NameError`\\s or pickling errors coming out of :mod:" "`multiprocessing` or :mod:`concurrent.futures`, see the :ref:`forkserver " "restrictions `." msgstr "" -#: ../../whatsnew/3.14.rst:3266 +#: ../../whatsnew/3.14.rst:3268 msgid "" "This change does not affect Windows or macOS, where :ref:`'spawn' " "` remains the default start method." msgstr "" -#: ../../whatsnew/3.14.rst:3269 +#: ../../whatsnew/3.14.rst:3271 msgid "" ":class:`functools.partial` is now a method descriptor. Wrap it in :func:" "`staticmethod` if you want to preserve the old behavior. (Contributed by " "Serhiy Storchaka and Dominykas Grigonis in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3273 +#: ../../whatsnew/3.14.rst:3275 msgid "" "The :ref:`garbage collector is now incremental `, which means that the behavior of :func:`gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.14.rst:3280 +#: ../../whatsnew/3.14.rst:3282 msgid "" "The :func:`locale.nl_langinfo` function now temporarily sets the " "``LC_CTYPE`` locale in some cases. This temporary change affects other " "threads. (Contributed by Serhiy Storchaka in :gh:`69998`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3285 +#: ../../whatsnew/3.14.rst:3287 msgid "" ":class:`types.UnionType` is now an alias for :class:`typing.Union`, causing " "changes in some behaviors. See :ref:`above ` for " "more details. (Contributed by Jelle Zijlstra in :gh:`105499`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3290 +#: ../../whatsnew/3.14.rst:3292 msgid "" "The runtime behavior of annotations has changed in various ways; see :ref:" "`above ` for details. While most code that " @@ -6634,29 +6650,29 @@ msgid "" "details may behave differently." msgstr "" -#: ../../whatsnew/3.14.rst:3295 +#: ../../whatsnew/3.14.rst:3297 msgid "" "As part of making the :mod:`mimetypes` CLI public, it now exits with ``1`` " "on failure instead of ``0`` and ``2`` on incorrect command-line parameters " "instead of ``1``. Error messages are now printed to stderr." msgstr "" -#: ../../whatsnew/3.14.rst:3300 +#: ../../whatsnew/3.14.rst:3302 msgid "" "The ``\\B`` pattern in regular expression now matches the empty string when " "given as the entire pattern, which may cause behavioural changes." msgstr "" -#: ../../whatsnew/3.14.rst:3303 +#: ../../whatsnew/3.14.rst:3305 msgid "" "On FreeBSD, :data:`sys.platform` no longer contains the major version number." msgstr "" -#: ../../whatsnew/3.14.rst:3309 +#: ../../whatsnew/3.14.rst:3311 msgid "Changes in annotations (:pep:`649` and :pep:`749`)" msgstr "" -#: ../../whatsnew/3.14.rst:3311 +#: ../../whatsnew/3.14.rst:3313 msgid "" "This section contains guidance on changes that may be needed to annotations " "or Python code that interacts with or introspects annotations, due to the " @@ -6664,24 +6680,24 @@ msgid "" "deferred-annotations>`." msgstr "" -#: ../../whatsnew/3.14.rst:3316 +#: ../../whatsnew/3.14.rst:3318 msgid "" "In the majority of cases, working code from older versions of Python will " "not require any changes." msgstr "" -#: ../../whatsnew/3.14.rst:3321 +#: ../../whatsnew/3.14.rst:3323 msgid "Implications for annotated code" msgstr "" -#: ../../whatsnew/3.14.rst:3323 +#: ../../whatsnew/3.14.rst:3325 msgid "" "If you define annotations in your code (for example, for use with a static " "type checker), then this change probably does not affect you: you can keep " "writing annotations the same way you did with previous versions of Python." msgstr "" -#: ../../whatsnew/3.14.rst:3327 +#: ../../whatsnew/3.14.rst:3329 msgid "" "You will likely be able to remove quoted strings in annotations, which are " "frequently used for forward references. Similarly, if you use ``from " @@ -6692,11 +6708,11 @@ msgid "" "annotations before they work as expected." msgstr "" -#: ../../whatsnew/3.14.rst:3337 +#: ../../whatsnew/3.14.rst:3339 msgid "Implications for readers of ``__annotations__``" msgstr "" -#: ../../whatsnew/3.14.rst:3339 +#: ../../whatsnew/3.14.rst:3341 msgid "" "If your code reads the :attr:`~object.__annotations__` attribute on objects, " "you may want to make changes in order to support code that relies on " @@ -6705,7 +6721,7 @@ msgid "" "FORWARDREF` format, as the :mod:`dataclasses` module now does." msgstr "" -#: ../../whatsnew/3.14.rst:3346 +#: ../../whatsnew/3.14.rst:3348 msgid "" "The external :pypi:`typing_extensions` package provides partial backports of " "some of the functionality of the :mod:`annotationlib` module, such as the :" @@ -6714,11 +6730,11 @@ msgid "" "that takes advantage of the new behavior in Python 3.14." msgstr "" -#: ../../whatsnew/3.14.rst:3355 +#: ../../whatsnew/3.14.rst:3357 msgid "Related changes" msgstr "" -#: ../../whatsnew/3.14.rst:3357 +#: ../../whatsnew/3.14.rst:3359 msgid "" "The changes in Python 3.14 are designed to rework how :attr:`!" "__annotations__` works at runtime while minimizing breakage to code that " @@ -6730,7 +6746,7 @@ msgid "" "the :mod:`annotationlib` module." msgstr "" -#: ../../whatsnew/3.14.rst:3366 +#: ../../whatsnew/3.14.rst:3368 msgid "" "In particular, do not read annotations directly from the namespace " "dictionary attribute of type objects. Use :func:`annotationlib." @@ -6738,25 +6754,25 @@ msgid "" "`annotationlib.get_annotations` afterwards." msgstr "" -#: ../../whatsnew/3.14.rst:3371 +#: ../../whatsnew/3.14.rst:3373 msgid "" "In previous releases, it was sometimes possible to access class annotations " "from an instance of an annotated class. This behavior was undocumented and " "accidental, and will no longer work in Python 3.14." msgstr "" -#: ../../whatsnew/3.14.rst:3377 +#: ../../whatsnew/3.14.rst:3379 msgid "``from __future__ import annotations``" msgstr "``from __future__ import annotations``" -#: ../../whatsnew/3.14.rst:3379 +#: ../../whatsnew/3.14.rst:3381 msgid "" "In Python 3.7, :pep:`563` introduced the ``from __future__ import " "annotations`` :ref:`future statement `, which turns all annotations " "into strings." msgstr "" -#: ../../whatsnew/3.14.rst:3382 +#: ../../whatsnew/3.14.rst:3384 msgid "" "However, this statement is now deprecated and it is expected to be removed " "in a future version of Python. This removal will not happen until after " @@ -6764,17 +6780,17 @@ msgid "" "Python without support for deferred evaluation of annotations." msgstr "" -#: ../../whatsnew/3.14.rst:3388 +#: ../../whatsnew/3.14.rst:3390 msgid "" "In Python 3.14, the behavior of code using ``from __future__ import " "annotations`` is unchanged." msgstr "" -#: ../../whatsnew/3.14.rst:3393 +#: ../../whatsnew/3.14.rst:3395 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.14.rst:3395 +#: ../../whatsnew/3.14.rst:3397 msgid "" ":c:func:`Py_Finalize` now deletes all interned strings. This is backwards " "incompatible to any C extension that holds onto an interned string after a " @@ -6787,14 +6803,14 @@ msgid "" "`113601`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3405 +#: ../../whatsnew/3.14.rst:3407 msgid "" "The :ref:`Unicode Exception Objects ` C API now raises a :" "exc:`TypeError` if its exception argument is not a :exc:`UnicodeError` " "object. (Contributed by Bénédikt Tran in :gh:`127691`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3412 +#: ../../whatsnew/3.14.rst:3414 msgid "" "The interpreter internally avoids some reference count modifications when " "loading objects onto the operands stack by :term:`borrowing