From 653da9d16881fe1812808f7fb61b4ecb7db6b6ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 8 Nov 2025 00:15:15 +0000 Subject: [PATCH 1/9] sync with cpython 5dc8ecc5 --- c-api/exceptions.po | 439 ++++++++++++++++++++++++-------------------- 1 file changed, 241 insertions(+), 198 deletions(-) diff --git a/c-api/exceptions.po b/c-api/exceptions.po index c98d7ad7d2b..09c06cdfe21 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-07 00:14+0000\n" +"POT-Creation-Date: 2025-11-08 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -416,16 +416,23 @@ msgstr "" #: ../../c-api/exceptions.rst:399 msgid "" +"Similar to :c:func:`PyErr_WarnExplicit`, but uses :c:func:" +"`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" +"encoded string." +msgstr "" + +#: ../../c-api/exceptions.rst:408 +msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :class:`!warnings." "WarningMessage`." msgstr "" -#: ../../c-api/exceptions.rst:406 +#: ../../c-api/exceptions.rst:415 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:410 +#: ../../c-api/exceptions.rst:419 msgid "" "Test whether the error indicator is set. If set, return the exception " "*type* (the first argument to the last call to one of the ``PyErr_Set*`` " @@ -434,11 +441,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:416 +#: ../../c-api/exceptions.rst:425 msgid "The caller must have an :term:`attached thread state`." msgstr "" -#: ../../c-api/exceptions.rst:420 +#: ../../c-api/exceptions.rst:429 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -446,14 +453,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:428 +#: ../../c-api/exceptions.rst:437 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:435 +#: ../../c-api/exceptions.rst:444 msgid "" "Return true if the *given* exception matches the exception type in *exc*. " "If *exc* is a class object, this also returns true when *given* is an " @@ -461,23 +468,23 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:443 +#: ../../c-api/exceptions.rst:452 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time. Return ``NULL`` if the error indicator is not set." msgstr "" -#: ../../c-api/exceptions.rst:446 +#: ../../c-api/exceptions.rst:455 msgid "" "This function is used by code that needs to catch exceptions, or code that " "needs to save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:449 ../../c-api/exceptions.rst:493 +#: ../../c-api/exceptions.rst:458 ../../c-api/exceptions.rst:502 msgid "For example::" msgstr "舉例來說: ::" -#: ../../c-api/exceptions.rst:451 +#: ../../c-api/exceptions.rst:460 msgid "" "{\n" " PyObject *exc = PyErr_GetRaisedException();\n" @@ -495,27 +502,27 @@ msgstr "" " PyErr_SetRaisedException(exc);\n" "}" -#: ../../c-api/exceptions.rst:459 +#: ../../c-api/exceptions.rst:468 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: ../../c-api/exceptions.rst:467 +#: ../../c-api/exceptions.rst:476 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " "exception if one is set." msgstr "" -#: ../../c-api/exceptions.rst:472 +#: ../../c-api/exceptions.rst:481 msgid "This call steals a reference to *exc*, which must be a valid exception." msgstr "" -#: ../../c-api/exceptions.rst:481 +#: ../../c-api/exceptions.rst:490 msgid "Use :c:func:`PyErr_GetRaisedException` instead." msgstr "請改用 :c:func:`PyErr_GetRaisedException`。" -#: ../../c-api/exceptions.rst:483 +#: ../../c-api/exceptions.rst:492 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -524,13 +531,13 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:490 +#: ../../c-api/exceptions.rst:499 msgid "" "This function is normally only used by legacy code that needs to catch " "exceptions or save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:495 +#: ../../c-api/exceptions.rst:504 msgid "" "{\n" " PyObject *type, *value, *traceback;\n" @@ -550,11 +557,11 @@ msgstr "" " PyErr_Restore(type, value, traceback);\n" "}" -#: ../../c-api/exceptions.rst:509 +#: ../../c-api/exceptions.rst:518 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "請改用 :c:func:`PyErr_SetRaisedException`。" -#: ../../c-api/exceptions.rst:511 +#: ../../c-api/exceptions.rst:520 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -567,20 +574,20 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:525 +#: ../../c-api/exceptions.rst:534 msgid "" "This function is normally only used by legacy code that needs to save and " "restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save " "the current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:534 +#: ../../c-api/exceptions.rst:543 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" -#: ../../c-api/exceptions.rst:537 +#: ../../c-api/exceptions.rst:546 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -590,14 +597,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:545 +#: ../../c-api/exceptions.rst:554 msgid "" "This function *does not* implicitly set the :attr:`~BaseException." "__traceback__` attribute on the exception value. If setting the traceback " "appropriately is desired, the following additional snippet is needed::" msgstr "" -#: ../../c-api/exceptions.rst:550 +#: ../../c-api/exceptions.rst:559 msgid "" "if (tb != NULL) {\n" " PyException_SetTraceback(val, tb);\n" @@ -607,7 +614,7 @@ msgstr "" " PyException_SetTraceback(val, tb);\n" "}" -#: ../../c-api/exceptions.rst:557 +#: ../../c-api/exceptions.rst:566 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." "exception`. This refers to an exception that was *already caught*, not to an " @@ -615,7 +622,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: ../../c-api/exceptions.rst:564 +#: ../../c-api/exceptions.rst:573 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -623,14 +630,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:573 +#: ../../c-api/exceptions.rst:582 msgid "" "Set the active exception, as known from ``sys.exception()``. This refers to " "an exception that was *already caught*, not to an exception that was freshly " "raised. To clear the exception state, pass ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:580 +#: ../../c-api/exceptions.rst:589 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -638,7 +645,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:589 +#: ../../c-api/exceptions.rst:598 msgid "" "Retrieve the old-style representation of the exception info, as known from :" "func:`sys.exc_info`. This refers to an exception that was *already caught*, " @@ -648,7 +655,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:598 +#: ../../c-api/exceptions.rst:607 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -656,7 +663,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:608 +#: ../../c-api/exceptions.rst:617 msgid "" "Set the exception info, as known from ``sys.exc_info()``. This refers to an " "exception that was *already caught*, not to an exception that was freshly " @@ -666,7 +673,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:617 +#: ../../c-api/exceptions.rst:626 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -674,22 +681,22 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:624 +#: ../../c-api/exceptions.rst:633 msgid "" "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " "The interpreter now derives them from the exception instance (the ``value`` " "argument). The function still steals references of all three arguments." msgstr "" -#: ../../c-api/exceptions.rst:632 +#: ../../c-api/exceptions.rst:641 msgid "Signal Handling" msgstr "訊號處理" -#: ../../c-api/exceptions.rst:642 +#: ../../c-api/exceptions.rst:651 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:644 +#: ../../c-api/exceptions.rst:653 msgid "" "If the function is called from the main thread and under the main Python " "interpreter, it checks whether a signal has been sent to the processes and " @@ -697,7 +704,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:649 +#: ../../c-api/exceptions.rst:658 msgid "" "The function attempts to handle all pending signals, and then returns ``0``. " "However, if a Python signal handler raises an exception, the error indicator " @@ -706,44 +713,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:655 +#: ../../c-api/exceptions.rst:664 msgid "" "If the function is called from a non-main thread, or under a non-main Python " "interpreter, it does nothing and returns ``0``." msgstr "" -#: ../../c-api/exceptions.rst:658 +#: ../../c-api/exceptions.rst:667 msgid "" "This function can be called by long-running C code that wants to be " "interruptible by user requests (such as by pressing Ctrl-C)." msgstr "" -#: ../../c-api/exceptions.rst:662 +#: ../../c-api/exceptions.rst:671 msgid "" "The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:673 +#: ../../c-api/exceptions.rst:682 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:677 ../../c-api/exceptions.rst:704 +#: ../../c-api/exceptions.rst:686 ../../c-api/exceptions.rst:713 msgid "" "This function is async-signal-safe. It can be called without an :term:" "`attached thread state` and from a C signal handler." msgstr "" -#: ../../c-api/exceptions.rst:687 +#: ../../c-api/exceptions.rst:696 msgid "" "Simulate the effect of a signal arriving. The next time :c:func:" "`PyErr_CheckSignals` is called, the Python signal handler for the given " "signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:691 +#: ../../c-api/exceptions.rst:700 msgid "" "This function can be called by C code that sets up its own signal handling " "and wants Python signal handlers to be invoked as expected when an " @@ -751,27 +758,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:696 +#: ../../c-api/exceptions.rst:705 msgid "" "If the given signal isn't handled by Python (it was set to :py:const:`signal." "SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: ../../c-api/exceptions.rst:699 +#: ../../c-api/exceptions.rst:708 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:712 +#: ../../c-api/exceptions.rst:721 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:716 +#: ../../c-api/exceptions.rst:725 msgid "" "The value ``-1`` disables the feature; this is the initial state. This is " "equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error " @@ -779,15 +786,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:721 +#: ../../c-api/exceptions.rst:730 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:726 +#: ../../c-api/exceptions.rst:735 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:730 +#: ../../c-api/exceptions.rst:739 msgid "" "This utility function creates and returns a new exception class. The *name* " "argument must be the name of the new exception, a C string of the form " @@ -796,7 +803,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:736 +#: ../../c-api/exceptions.rst:745 msgid "" "The :attr:`~type.__module__` attribute of the new class is set to the first " "part (up to the last dot) of the *name* argument, and the class name is set " @@ -806,41 +813,41 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:745 +#: ../../c-api/exceptions.rst:754 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:754 +#: ../../c-api/exceptions.rst:763 msgid "" "Return non-zero if *ob* is an exception class, zero otherwise. This function " "always succeeds." msgstr "" -#: ../../c-api/exceptions.rst:759 +#: ../../c-api/exceptions.rst:768 msgid "Return :c:member:`~PyTypeObject.tp_name` of the exception class *ob*." msgstr "回傳例外類別 *ob* 的 :c:member:`~PyTypeObject.tp_name`。" -#: ../../c-api/exceptions.rst:763 +#: ../../c-api/exceptions.rst:772 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:767 +#: ../../c-api/exceptions.rst:776 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through the :attr:`~BaseException.__traceback__` " "attribute. If there is no traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:775 +#: ../../c-api/exceptions.rst:784 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:781 +#: ../../c-api/exceptions.rst:790 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -848,14 +855,14 @@ msgid "" "there is no context associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:789 +#: ../../c-api/exceptions.rst:798 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:796 +#: ../../c-api/exceptions.rst:805 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " @@ -863,28 +870,28 @@ msgid "" "attribute." msgstr "" -#: ../../c-api/exceptions.rst:804 +#: ../../c-api/exceptions.rst:813 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or ``None``. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:808 +#: ../../c-api/exceptions.rst:817 msgid "" "The :attr:`~BaseException.__suppress_context__` attribute is implicitly set " "to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:814 +#: ../../c-api/exceptions.rst:823 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "回傳例外 *ex* 的 :attr:`~BaseException.args`。" -#: ../../c-api/exceptions.rst:819 +#: ../../c-api/exceptions.rst:828 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "設定例外 *ex* 的 :attr:`~BaseException.args` 為 *args*。" -#: ../../c-api/exceptions.rst:823 +#: ../../c-api/exceptions.rst:832 msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " @@ -896,98 +903,98 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: ../../c-api/exceptions.rst:837 +#: ../../c-api/exceptions.rst:846 msgid "Unicode Exception Objects" msgstr "Unicode 例外物件" -#: ../../c-api/exceptions.rst:839 +#: ../../c-api/exceptions.rst:848 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:843 +#: ../../c-api/exceptions.rst:852 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:850 +#: ../../c-api/exceptions.rst:859 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:856 +#: ../../c-api/exceptions.rst:865 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:862 +#: ../../c-api/exceptions.rst:871 msgid "" "Get the *start* attribute of the given exception object and place it into " "*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:866 +#: ../../c-api/exceptions.rst:875 msgid "" "If the :attr:`UnicodeError.object` is an empty sequence, the resulting " "*start* is ``0``. Otherwise, it is clipped to ``[0, len(object) - 1]``." msgstr "" -#: ../../c-api/exceptions.rst:869 +#: ../../c-api/exceptions.rst:878 msgid ":attr:`UnicodeError.start`" msgstr ":attr:`UnicodeError.start`" -#: ../../c-api/exceptions.rst:875 +#: ../../c-api/exceptions.rst:884 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:880 +#: ../../c-api/exceptions.rst:889 msgid "" "While passing a negative *start* does not raise an exception, the " "corresponding getters will not consider it as a relative offset." msgstr "" -#: ../../c-api/exceptions.rst:888 +#: ../../c-api/exceptions.rst:897 msgid "" "Get the *end* attribute of the given exception object and place it into " "*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:892 +#: ../../c-api/exceptions.rst:901 msgid "" "If the :attr:`UnicodeError.object` is an empty sequence, the resulting *end* " "is ``0``. Otherwise, it is clipped to ``[1, len(object)]``." msgstr "" -#: ../../c-api/exceptions.rst:899 +#: ../../c-api/exceptions.rst:908 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:902 +#: ../../c-api/exceptions.rst:911 msgid ":attr:`UnicodeError.end`" msgstr ":attr:`UnicodeError.end`" -#: ../../c-api/exceptions.rst:908 +#: ../../c-api/exceptions.rst:917 msgid "Return the *reason* attribute of the given exception object." msgstr "回傳給定例外物件的 *reason* 屬性。" -#: ../../c-api/exceptions.rst:914 +#: ../../c-api/exceptions.rst:923 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:921 +#: ../../c-api/exceptions.rst:930 msgid "Recursion Control" msgstr "遞迴控制" -#: ../../c-api/exceptions.rst:923 +#: ../../c-api/exceptions.rst:932 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -997,37 +1004,37 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:932 +#: ../../c-api/exceptions.rst:941 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:934 +#: ../../c-api/exceptions.rst:943 msgid "" "The function then checks if the stack limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:938 +#: ../../c-api/exceptions.rst:947 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:942 ../../c-api/exceptions.rst:950 +#: ../../c-api/exceptions.rst:951 ../../c-api/exceptions.rst:959 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:947 +#: ../../c-api/exceptions.rst:956 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:953 +#: ../../c-api/exceptions.rst:962 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -1036,13 +1043,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:961 +#: ../../c-api/exceptions.rst:970 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:964 +#: ../../c-api/exceptions.rst:973 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -1050,301 +1057,301 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:970 +#: ../../c-api/exceptions.rst:979 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:974 +#: ../../c-api/exceptions.rst:983 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:979 +#: ../../c-api/exceptions.rst:988 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:984 +#: ../../c-api/exceptions.rst:993 msgid "" "Get the recursion limit for the current interpreter. It can be set with :c:" "func:`Py_SetRecursionLimit`. The recursion limit prevents the Python " "interpreter stack from growing infinitely." msgstr "" -#: ../../c-api/exceptions.rst:988 ../../c-api/exceptions.rst:998 +#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1007 msgid "" "This function cannot fail, and the caller must hold an :term:`attached " "thread state`." msgstr "" -#: ../../c-api/exceptions.rst:992 +#: ../../c-api/exceptions.rst:1001 msgid ":py:func:`sys.getrecursionlimit`" msgstr ":py:func:`sys.getrecursionlimit`" -#: ../../c-api/exceptions.rst:996 +#: ../../c-api/exceptions.rst:1005 msgid "Set the recursion limit for the current interpreter." msgstr "" -#: ../../c-api/exceptions.rst:1002 +#: ../../c-api/exceptions.rst:1011 msgid ":py:func:`sys.setrecursionlimit`" msgstr ":py:func:`sys.setrecursionlimit`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1016 msgid "Exception and warning types" msgstr "例外和警告型別" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1018 msgid "" "All standard Python exceptions and warning categories are available as " "global variables whose names are ``PyExc_`` followed by the Python exception " "name. These have the type :c:expr:`PyObject*`; they are all class objects." msgstr "" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1022 msgid "For completeness, here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1016 +#: ../../c-api/exceptions.rst:1025 msgid "Exception types" msgstr "例外型別" -#: ../../c-api/exceptions.rst:1023 ../../c-api/exceptions.rst:1169 -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1032 ../../c-api/exceptions.rst:1178 +#: ../../c-api/exceptions.rst:1208 msgid "C name" msgstr "C 名稱" -#: ../../c-api/exceptions.rst:1024 ../../c-api/exceptions.rst:1170 -#: ../../c-api/exceptions.rst:1200 +#: ../../c-api/exceptions.rst:1033 ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1209 msgid "Python name" msgstr "Python 名稱" -#: ../../c-api/exceptions.rst:1026 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1028 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`BaseExceptionGroup`" msgstr ":exc:`BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1030 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1032 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1034 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1036 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1038 +#: ../../c-api/exceptions.rst:1047 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1040 +#: ../../c-api/exceptions.rst:1049 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1042 +#: ../../c-api/exceptions.rst:1051 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1044 +#: ../../c-api/exceptions.rst:1053 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1046 +#: ../../c-api/exceptions.rst:1055 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1048 +#: ../../c-api/exceptions.rst:1057 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1050 +#: ../../c-api/exceptions.rst:1059 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1052 +#: ../../c-api/exceptions.rst:1061 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1054 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1056 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1058 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1060 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1062 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1064 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1066 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1068 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1070 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1072 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1076 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1078 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1080 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1082 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1084 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1086 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1088 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1090 ../../c-api/exceptions.rst:1173 -#: ../../c-api/exceptions.rst:1176 ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1099 ../../c-api/exceptions.rst:1182 +#: ../../c-api/exceptions.rst:1185 ../../c-api/exceptions.rst:1188 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1092 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1094 +#: ../../c-api/exceptions.rst:1103 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1096 +#: ../../c-api/exceptions.rst:1105 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1098 +#: ../../c-api/exceptions.rst:1107 msgid ":exc:`PythonFinalizationError`" msgstr ":exc:`PythonFinalizationError`" -#: ../../c-api/exceptions.rst:1100 +#: ../../c-api/exceptions.rst:1109 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1102 +#: ../../c-api/exceptions.rst:1111 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1104 +#: ../../c-api/exceptions.rst:1113 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1106 +#: ../../c-api/exceptions.rst:1115 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1108 +#: ../../c-api/exceptions.rst:1117 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1110 +#: ../../c-api/exceptions.rst:1119 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1112 +#: ../../c-api/exceptions.rst:1121 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1114 +#: ../../c-api/exceptions.rst:1123 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1116 +#: ../../c-api/exceptions.rst:1125 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1118 +#: ../../c-api/exceptions.rst:1127 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1120 +#: ../../c-api/exceptions.rst:1129 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1122 +#: ../../c-api/exceptions.rst:1131 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1124 +#: ../../c-api/exceptions.rst:1133 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1126 +#: ../../c-api/exceptions.rst:1135 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1137 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1130 +#: ../../c-api/exceptions.rst:1139 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1132 +#: ../../c-api/exceptions.rst:1141 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1134 +#: ../../c-api/exceptions.rst:1143 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1145 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1364,128 +1371,164 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1146 +#: ../../c-api/exceptions.rst:1155 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`。" -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:1158 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`。" -#: ../../c-api/exceptions.rst:1152 +#: ../../c-api/exceptions.rst:1161 msgid ":c:data:`PyExc_BaseExceptionGroup`." msgstr ":c:data:`PyExc_BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1157 +#: ../../c-api/exceptions.rst:1166 msgid "OSError aliases" msgstr "OSError 別名" -#: ../../c-api/exceptions.rst:1159 +#: ../../c-api/exceptions.rst:1168 msgid "The following are a compatibility aliases to :c:data:`PyExc_OSError`." msgstr "" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1170 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1171 +#: ../../c-api/exceptions.rst:1180 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:1180 +#: ../../c-api/exceptions.rst:1189 msgid "[win]_" msgstr "[win]_" -#: ../../c-api/exceptions.rst:1182 +#: ../../c-api/exceptions.rst:1191 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1194 msgid "" ":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that " "uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1192 +#: ../../c-api/exceptions.rst:1201 msgid "Warning types" msgstr "警告型別" -#: ../../c-api/exceptions.rst:1202 +#: ../../c-api/exceptions.rst:1211 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1204 +#: ../../c-api/exceptions.rst:1213 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1206 +#: ../../c-api/exceptions.rst:1215 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1208 +#: ../../c-api/exceptions.rst:1217 msgid ":exc:`EncodingWarning`" msgstr ":exc:`EncodingWarning`" -#: ../../c-api/exceptions.rst:1210 +#: ../../c-api/exceptions.rst:1219 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1212 +#: ../../c-api/exceptions.rst:1221 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1214 +#: ../../c-api/exceptions.rst:1223 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1216 +#: ../../c-api/exceptions.rst:1225 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1218 +#: ../../c-api/exceptions.rst:1227 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1220 +#: ../../c-api/exceptions.rst:1229 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1222 +#: ../../c-api/exceptions.rst:1231 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1224 +#: ../../c-api/exceptions.rst:1233 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1226 +#: ../../c-api/exceptions.rst:1235 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`。" -#: ../../c-api/exceptions.rst:1229 +#: ../../c-api/exceptions.rst:1238 msgid ":c:data:`PyExc_EncodingWarning`." msgstr ":c:data:`PyExc_EncodingWarning`。" +#: ../../c-api/exceptions.rst:1243 +msgid "Tracebacks" +msgstr "" + +#: ../../c-api/exceptions.rst:1247 +msgid "" +"Type object for traceback objects. This is available as :class:`types." +"TracebackType` in the Python layer." +msgstr "" + +#: ../../c-api/exceptions.rst:1253 +msgid "" +"Return true if *op* is a traceback object, false otherwise. This function " +"does not account for subtypes." +msgstr "" + +#: ../../c-api/exceptions.rst:1259 +msgid "" +"Replace the :attr:`~BaseException.__traceback__` attribute on the current " +"exception with a new traceback prepending *f* to the existing chain." +msgstr "" + +#: ../../c-api/exceptions.rst:1262 +msgid "Calling this function without an exception set is undefined behavior." +msgstr "" + +#: ../../c-api/exceptions.rst:1264 ../../c-api/exceptions.rst:1272 +msgid "" +"This function returns ``0`` on success, and returns ``-1`` with an exception " +"set on failure." +msgstr "" + +#: ../../c-api/exceptions.rst:1270 +msgid "Write the traceback *tb* into the file *f*." +msgstr "" + #: ../../c-api/exceptions.rst:183 msgid "strerror (C function)" msgstr "strerror(C 函式)" -#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668 -#: ../../c-api/exceptions.rst:683 +#: ../../c-api/exceptions.rst:646 ../../c-api/exceptions.rst:677 +#: ../../c-api/exceptions.rst:692 msgid "module" msgstr "module(模組)" -#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668 -#: ../../c-api/exceptions.rst:683 +#: ../../c-api/exceptions.rst:646 ../../c-api/exceptions.rst:677 +#: ../../c-api/exceptions.rst:692 msgid "signal" msgstr "signal(訊號)" -#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668 +#: ../../c-api/exceptions.rst:646 ../../c-api/exceptions.rst:677 msgid "SIGINT (C macro)" msgstr "SIGINT(C 巨集)" -#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668 -#: ../../c-api/exceptions.rst:683 +#: ../../c-api/exceptions.rst:646 ../../c-api/exceptions.rst:677 +#: ../../c-api/exceptions.rst:692 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" From 9acc04c884b8b10986c2e8a31d6e50f5ff081e75 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 9 Nov 2025 00:19:09 +0000 Subject: [PATCH 2/9] sync with cpython d8a2b8a4 --- c-api/buffer.po | 164 ++++---- c-api/exceptions.po | 449 +++++++++++---------- c-api/hash.po | 119 ++++-- c-api/intro.po | 710 +++++++++++++++++---------------- library/json.po | 475 +++++++++++----------- library/sys.po | 937 ++++++++++++++++++++++---------------------- library/time.po | 11 +- 7 files changed, 1498 insertions(+), 1367 deletions(-) diff --git a/c-api/buffer.po b/c-api/buffer.po index 2307ed3d901..c53ee22c8ef 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 00:15+0000\n" +"POT-Creation-Date: 2025-11-09 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -362,12 +362,16 @@ msgid "" msgstr "" #: ../../c-api/buffer.rst:266 +msgid "This is a :term:`soft deprecated` alias to :c:macro:`PyBUF_WRITABLE`." +msgstr "" + +#: ../../c-api/buffer.rst:270 msgid "" "Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be " "filled in correctly. Otherwise, this field MUST be ``NULL``." msgstr "" -#: ../../c-api/buffer.rst:270 +#: ../../c-api/buffer.rst:274 msgid "" ":c:macro:`PyBUF_WRITABLE` can be \\|'d to any of the flags in the next " "section. Since :c:macro:`PyBUF_SIMPLE` is defined as 0, :c:macro:" @@ -375,159 +379,159 @@ msgid "" "writable buffer." msgstr "" -#: ../../c-api/buffer.rst:274 +#: ../../c-api/buffer.rst:278 msgid "" ":c:macro:`PyBUF_FORMAT` must be \\|'d to any of the flags except :c:macro:" "`PyBUF_SIMPLE`, because the latter already implies format ``B`` (unsigned " "bytes). :c:macro:`!PyBUF_FORMAT` cannot be used on its own." msgstr "" -#: ../../c-api/buffer.rst:280 +#: ../../c-api/buffer.rst:284 msgid "shape, strides, suboffsets" msgstr "" -#: ../../c-api/buffer.rst:282 +#: ../../c-api/buffer.rst:286 msgid "" "The flags that control the logical structure of the memory are listed in " "decreasing order of complexity. Note that each flag contains all bits of the " "flags below it." msgstr "" -#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313 -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:293 ../../c-api/buffer.rst:317 +#: ../../c-api/buffer.rst:342 msgid "Request" msgstr "" -#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313 -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:293 ../../c-api/buffer.rst:317 +#: ../../c-api/buffer.rst:342 msgid "shape" msgstr "" -#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313 -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:293 ../../c-api/buffer.rst:317 +#: ../../c-api/buffer.rst:342 msgid "strides" msgstr "" -#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313 -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:293 ../../c-api/buffer.rst:317 +#: ../../c-api/buffer.rst:342 msgid "suboffsets" msgstr "" -#: ../../c-api/buffer.rst:291 ../../c-api/buffer.rst:293 -#: ../../c-api/buffer.rst:295 ../../c-api/buffer.rst:315 -#: ../../c-api/buffer.rst:317 ../../c-api/buffer.rst:319 -#: ../../c-api/buffer.rst:321 ../../c-api/buffer.rst:340 -#: ../../c-api/buffer.rst:342 ../../c-api/buffer.rst:344 +#: ../../c-api/buffer.rst:295 ../../c-api/buffer.rst:297 +#: ../../c-api/buffer.rst:299 ../../c-api/buffer.rst:319 +#: ../../c-api/buffer.rst:321 ../../c-api/buffer.rst:323 +#: ../../c-api/buffer.rst:325 ../../c-api/buffer.rst:344 #: ../../c-api/buffer.rst:346 ../../c-api/buffer.rst:348 #: ../../c-api/buffer.rst:350 ../../c-api/buffer.rst:352 -#: ../../c-api/buffer.rst:354 +#: ../../c-api/buffer.rst:354 ../../c-api/buffer.rst:356 +#: ../../c-api/buffer.rst:358 msgid "yes" msgstr "" -#: ../../c-api/buffer.rst:291 ../../c-api/buffer.rst:340 -#: ../../c-api/buffer.rst:342 +#: ../../c-api/buffer.rst:295 ../../c-api/buffer.rst:344 +#: ../../c-api/buffer.rst:346 msgid "if needed" msgstr "" -#: ../../c-api/buffer.rst:293 ../../c-api/buffer.rst:295 -#: ../../c-api/buffer.rst:297 ../../c-api/buffer.rst:315 -#: ../../c-api/buffer.rst:317 ../../c-api/buffer.rst:319 -#: ../../c-api/buffer.rst:321 ../../c-api/buffer.rst:344 -#: ../../c-api/buffer.rst:346 ../../c-api/buffer.rst:348 +#: ../../c-api/buffer.rst:297 ../../c-api/buffer.rst:299 +#: ../../c-api/buffer.rst:301 ../../c-api/buffer.rst:319 +#: ../../c-api/buffer.rst:321 ../../c-api/buffer.rst:323 +#: ../../c-api/buffer.rst:325 ../../c-api/buffer.rst:348 #: ../../c-api/buffer.rst:350 ../../c-api/buffer.rst:352 -#: ../../c-api/buffer.rst:354 +#: ../../c-api/buffer.rst:354 ../../c-api/buffer.rst:356 +#: ../../c-api/buffer.rst:358 msgid "NULL" msgstr "NULL" -#: ../../c-api/buffer.rst:304 +#: ../../c-api/buffer.rst:308 msgid "contiguity requests" msgstr "" -#: ../../c-api/buffer.rst:306 +#: ../../c-api/buffer.rst:310 msgid "" "C or Fortran :term:`contiguity ` can be explicitly requested, " "with and without stride information. Without stride information, the buffer " "must be C-contiguous." msgstr "" -#: ../../c-api/buffer.rst:313 ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:317 ../../c-api/buffer.rst:342 msgid "contig" msgstr "" -#: ../../c-api/buffer.rst:315 ../../c-api/buffer.rst:321 -#: ../../c-api/buffer.rst:352 ../../c-api/buffer.rst:354 +#: ../../c-api/buffer.rst:319 ../../c-api/buffer.rst:325 +#: ../../c-api/buffer.rst:356 ../../c-api/buffer.rst:358 msgid "C" msgstr "C" -#: ../../c-api/buffer.rst:317 +#: ../../c-api/buffer.rst:321 msgid "F" msgstr "F" -#: ../../c-api/buffer.rst:319 +#: ../../c-api/buffer.rst:323 msgid "C or F" msgstr "C 或 F" -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:325 msgid ":c:macro:`PyBUF_ND`" msgstr ":c:macro:`PyBUF_ND`" -#: ../../c-api/buffer.rst:326 +#: ../../c-api/buffer.rst:330 msgid "compound requests" msgstr "" -#: ../../c-api/buffer.rst:328 +#: ../../c-api/buffer.rst:332 msgid "" "All possible requests are fully defined by some combination of the flags in " "the previous section. For convenience, the buffer protocol provides " "frequently used combinations as single flags." msgstr "" -#: ../../c-api/buffer.rst:332 +#: ../../c-api/buffer.rst:336 msgid "" "In the following table *U* stands for undefined contiguity. The consumer " "would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity." msgstr "" -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:342 msgid "readonly" msgstr "" -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:342 msgid "format" msgstr "" -#: ../../c-api/buffer.rst:340 ../../c-api/buffer.rst:342 #: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:346 #: ../../c-api/buffer.rst:348 ../../c-api/buffer.rst:350 +#: ../../c-api/buffer.rst:352 ../../c-api/buffer.rst:354 msgid "U" msgstr "U" -#: ../../c-api/buffer.rst:340 ../../c-api/buffer.rst:344 -#: ../../c-api/buffer.rst:348 ../../c-api/buffer.rst:352 +#: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:348 +#: ../../c-api/buffer.rst:352 ../../c-api/buffer.rst:356 msgid "0" msgstr "0" -#: ../../c-api/buffer.rst:342 ../../c-api/buffer.rst:346 -#: ../../c-api/buffer.rst:350 ../../c-api/buffer.rst:354 +#: ../../c-api/buffer.rst:346 ../../c-api/buffer.rst:350 +#: ../../c-api/buffer.rst:354 ../../c-api/buffer.rst:358 msgid "1 or 0" msgstr "1 或 0" -#: ../../c-api/buffer.rst:359 +#: ../../c-api/buffer.rst:363 msgid "Complex arrays" msgstr "" -#: ../../c-api/buffer.rst:362 +#: ../../c-api/buffer.rst:366 msgid "NumPy-style: shape and strides" msgstr "" -#: ../../c-api/buffer.rst:364 +#: ../../c-api/buffer.rst:368 msgid "" "The logical structure of NumPy-style arrays is defined by :c:member:" "`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer." "shape` and :c:member:`~Py_buffer.strides`." msgstr "" -#: ../../c-api/buffer.rst:367 +#: ../../c-api/buffer.rst:371 msgid "" "If ``ndim == 0``, the memory location pointed to by :c:member:`~Py_buffer." "buf` is interpreted as a scalar of size :c:member:`~Py_buffer.itemsize`. In " @@ -535,14 +539,14 @@ msgid "" "strides` are ``NULL``." msgstr "" -#: ../../c-api/buffer.rst:371 +#: ../../c-api/buffer.rst:375 msgid "" "If :c:member:`~Py_buffer.strides` is ``NULL``, the array is interpreted as a " "standard n-dimensional C-array. Otherwise, the consumer must access an n-" "dimensional array as follows:" msgstr "" -#: ../../c-api/buffer.rst:375 +#: ../../c-api/buffer.rst:379 msgid "" "ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * " "strides[n-1];\n" @@ -552,14 +556,14 @@ msgstr "" "strides[n-1];\n" "item = *((typeof(item) *)ptr);" -#: ../../c-api/buffer.rst:381 +#: ../../c-api/buffer.rst:385 msgid "" "As noted above, :c:member:`~Py_buffer.buf` can point to any location within " "the actual memory block. An exporter can check the validity of a buffer with " "this function:" msgstr "" -#: ../../c-api/buffer.rst:385 +#: ../../c-api/buffer.rst:389 msgid "" "def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n" " \"\"\"Verify that the parameters represent a valid array within\n" @@ -588,11 +592,11 @@ msgid "" " return 0 <= offset+imin and offset+imax+itemsize <= memlen" msgstr "" -#: ../../c-api/buffer.rst:415 +#: ../../c-api/buffer.rst:419 msgid "PIL-style: shape, strides and suboffsets" msgstr "" -#: ../../c-api/buffer.rst:417 +#: ../../c-api/buffer.rst:421 msgid "" "In addition to the regular items, PIL-style arrays can contain pointers that " "must be followed in order to get to the next element in a dimension. For " @@ -603,14 +607,14 @@ msgid "" "x[2][3]`` arrays that can be located anywhere in memory." msgstr "" -#: ../../c-api/buffer.rst:426 +#: ../../c-api/buffer.rst:430 msgid "" "Here is a function that returns a pointer to the element in an N-D array " "pointed to by an N-dimensional index when there are both non-``NULL`` " "strides and suboffsets::" msgstr "" -#: ../../c-api/buffer.rst:430 +#: ../../c-api/buffer.rst:434 msgid "" "void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n" " Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n" @@ -638,25 +642,25 @@ msgstr "" " return (void*)pointer;\n" "}" -#: ../../c-api/buffer.rst:445 +#: ../../c-api/buffer.rst:449 msgid "Buffer-related functions" msgstr "" -#: ../../c-api/buffer.rst:449 +#: ../../c-api/buffer.rst:453 msgid "" "Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When " "``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` " "will succeed. This function always succeeds." msgstr "" -#: ../../c-api/buffer.rst:456 +#: ../../c-api/buffer.rst:460 msgid "" "Send a request to *exporter* to fill in *view* as specified by *flags*. If " "the exporter cannot provide a buffer of the exact type, it MUST raise :exc:" "`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/buffer.rst:461 +#: ../../c-api/buffer.rst:465 msgid "" "On success, fill in *view*, set ``view->obj`` to a new reference to " "*exporter* and return 0. In the case of chained buffer providers that " @@ -664,7 +668,7 @@ msgid "" "instead of *exporter* (See :ref:`Buffer Object Structures `)." msgstr "" -#: ../../c-api/buffer.rst:466 +#: ../../c-api/buffer.rst:470 msgid "" "Successful calls to :c:func:`PyObject_GetBuffer` must be paired with calls " "to :c:func:`PyBuffer_Release`, similar to :c:func:`malloc` and :c:func:" @@ -672,7 +676,7 @@ msgid "" "`PyBuffer_Release` must be called exactly once." msgstr "" -#: ../../c-api/buffer.rst:474 +#: ../../c-api/buffer.rst:478 msgid "" "Release the buffer *view* and release the :term:`strong reference` (i.e. " "decrement the reference count) to the view's supporting object, ``view-" @@ -680,19 +684,19 @@ msgid "" "used, otherwise reference leaks may occur." msgstr "" -#: ../../c-api/buffer.rst:479 +#: ../../c-api/buffer.rst:483 msgid "" "It is an error to call this function on a buffer that was not obtained via :" "c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../c-api/buffer.rst:485 +#: ../../c-api/buffer.rst:489 msgid "" "Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:" "`~Py_buffer.format`. On error, raise an exception and return -1." msgstr "" -#: ../../c-api/buffer.rst:493 +#: ../../c-api/buffer.rst:497 msgid "" "Return ``1`` if the memory defined by the *view* is C-style (*order* is " "``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either " @@ -700,69 +704,69 @@ msgid "" "succeeds." msgstr "" -#: ../../c-api/buffer.rst:500 +#: ../../c-api/buffer.rst:504 msgid "" "Get the memory area pointed to by the *indices* inside the given *view*. " "*indices* must point to an array of ``view->ndim`` indices." msgstr "" -#: ../../c-api/buffer.rst:506 +#: ../../c-api/buffer.rst:510 msgid "" "Copy contiguous *len* bytes from *buf* to *view*. *fort* can be ``'C'`` or " "``'F'`` (for C-style or Fortran-style ordering). ``0`` is returned on " "success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:513 +#: ../../c-api/buffer.rst:517 msgid "" "Copy *len* bytes from *src* to its contiguous representation in *buf*. " "*order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style " "ordering or either one). ``0`` is returned on success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:517 +#: ../../c-api/buffer.rst:521 msgid "This function fails if *len* != *src->len*." msgstr "" -#: ../../c-api/buffer.rst:522 +#: ../../c-api/buffer.rst:526 msgid "" "Copy data from *src* to *dest* buffer. Can convert between C-style and or " "Fortran-style buffers." msgstr "" -#: ../../c-api/buffer.rst:525 +#: ../../c-api/buffer.rst:529 msgid "``0`` is returned on success, ``-1`` on error." msgstr "成功時回傳 ``0``,錯誤時回傳 ``-1``。" -#: ../../c-api/buffer.rst:529 +#: ../../c-api/buffer.rst:533 msgid "" "Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style " "if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the " "given shape with the given number of bytes per element." msgstr "" -#: ../../c-api/buffer.rst:536 +#: ../../c-api/buffer.rst:540 msgid "" "Handle buffer requests for an exporter that wants to expose *buf* of size " "*len* with writability set according to *readonly*. *buf* is interpreted as " "a sequence of unsigned bytes." msgstr "" -#: ../../c-api/buffer.rst:540 +#: ../../c-api/buffer.rst:544 msgid "" "The *flags* argument indicates the request type. This function always fills " "in *view* as specified by flags, unless *buf* has been designated as read-" "only and :c:macro:`PyBUF_WRITABLE` is set in *flags*." msgstr "" -#: ../../c-api/buffer.rst:544 +#: ../../c-api/buffer.rst:548 msgid "" "On success, set ``view->obj`` to a new reference to *exporter* and return 0. " "Otherwise, raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and " "return ``-1``;" msgstr "" -#: ../../c-api/buffer.rst:548 +#: ../../c-api/buffer.rst:552 msgid "" "If this function is used as part of a :ref:`getbufferproc `, " "*exporter* MUST be set to the exporting object and *flags* must be passed " @@ -789,14 +793,14 @@ msgstr "buffer object(緩衝物件)" msgid "PyBufferProcs (C type)" msgstr "PyBufferProcs(C 型別)" -#: ../../c-api/buffer.rst:301 +#: ../../c-api/buffer.rst:305 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../c-api/buffer.rst:301 +#: ../../c-api/buffer.rst:305 msgid "C-contiguous" msgstr "C-contiguous(C 連續的)" -#: ../../c-api/buffer.rst:301 +#: ../../c-api/buffer.rst:305 msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 09c06cdfe21..f05ed3acbc4 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-08 00:13+0000\n" +"POT-Creation-Date: 2025-11-09 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -346,11 +346,30 @@ msgid "" "use." msgstr "" -#: ../../c-api/exceptions.rst:335 +#: ../../c-api/exceptions.rst:336 +msgid "" +"Get the source line in *filename* at line *lineno*. *filename* should be a " +"Python :class:`str` object." +msgstr "" + +#: ../../c-api/exceptions.rst:339 +msgid "" +"On success, this function returns a Python string object with the found " +"line. On failure, this function returns ``NULL`` without an exception set." +msgstr "" + +#: ../../c-api/exceptions.rst:345 +msgid "" +"Similar to :c:func:`PyErr_ProgramTextObject`, but *filename* is a :c:expr:" +"`const char *`, which is decoded with the :term:`filesystem encoding and " +"error handler`, instead of a Python object reference." +msgstr "" + +#: ../../c-api/exceptions.rst:352 msgid "Issuing warnings" msgstr "" -#: ../../c-api/exceptions.rst:337 +#: ../../c-api/exceptions.rst:354 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -366,7 +385,7 @@ msgid "" "return an error value)." msgstr "" -#: ../../c-api/exceptions.rst:352 +#: ../../c-api/exceptions.rst:369 msgid "" "Issue a warning message. The *category* argument is a warning category (see " "below) or ``NULL``; the *message* argument is a UTF-8 encoded string. " @@ -376,7 +395,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: ../../c-api/exceptions.rst:359 +#: ../../c-api/exceptions.rst:376 msgid "" "Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:" "`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default " @@ -385,14 +404,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: ../../c-api/exceptions.rst:365 +#: ../../c-api/exceptions.rst:382 msgid "" "For information about warning control, see the documentation for the :mod:" "`warnings` module and the :option:`-W` option in the command line " "documentation. There is no C API for warning control." msgstr "" -#: ../../c-api/exceptions.rst:372 +#: ../../c-api/exceptions.rst:389 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -400,39 +419,39 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: ../../c-api/exceptions.rst:383 +#: ../../c-api/exceptions.rst:400 msgid "" "Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and " "*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:390 +#: ../../c-api/exceptions.rst:407 msgid "" "Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" "encoded string." msgstr "" -#: ../../c-api/exceptions.rst:399 +#: ../../c-api/exceptions.rst:416 msgid "" "Similar to :c:func:`PyErr_WarnExplicit`, but uses :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" "encoded string." msgstr "" -#: ../../c-api/exceptions.rst:408 +#: ../../c-api/exceptions.rst:425 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :class:`!warnings." "WarningMessage`." msgstr "" -#: ../../c-api/exceptions.rst:415 +#: ../../c-api/exceptions.rst:432 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:419 +#: ../../c-api/exceptions.rst:436 msgid "" "Test whether the error indicator is set. If set, return the exception " "*type* (the first argument to the last call to one of the ``PyErr_Set*`` " @@ -441,11 +460,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:425 +#: ../../c-api/exceptions.rst:442 msgid "The caller must have an :term:`attached thread state`." msgstr "" -#: ../../c-api/exceptions.rst:429 +#: ../../c-api/exceptions.rst:446 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -453,14 +472,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:437 +#: ../../c-api/exceptions.rst:454 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:444 +#: ../../c-api/exceptions.rst:461 msgid "" "Return true if the *given* exception matches the exception type in *exc*. " "If *exc* is a class object, this also returns true when *given* is an " @@ -468,23 +487,23 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:452 +#: ../../c-api/exceptions.rst:469 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time. Return ``NULL`` if the error indicator is not set." msgstr "" -#: ../../c-api/exceptions.rst:455 +#: ../../c-api/exceptions.rst:472 msgid "" "This function is used by code that needs to catch exceptions, or code that " "needs to save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:458 ../../c-api/exceptions.rst:502 +#: ../../c-api/exceptions.rst:475 ../../c-api/exceptions.rst:519 msgid "For example::" msgstr "舉例來說: ::" -#: ../../c-api/exceptions.rst:460 +#: ../../c-api/exceptions.rst:477 msgid "" "{\n" " PyObject *exc = PyErr_GetRaisedException();\n" @@ -502,27 +521,27 @@ msgstr "" " PyErr_SetRaisedException(exc);\n" "}" -#: ../../c-api/exceptions.rst:468 +#: ../../c-api/exceptions.rst:485 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: ../../c-api/exceptions.rst:476 +#: ../../c-api/exceptions.rst:493 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " "exception if one is set." msgstr "" -#: ../../c-api/exceptions.rst:481 +#: ../../c-api/exceptions.rst:498 msgid "This call steals a reference to *exc*, which must be a valid exception." msgstr "" -#: ../../c-api/exceptions.rst:490 +#: ../../c-api/exceptions.rst:507 msgid "Use :c:func:`PyErr_GetRaisedException` instead." msgstr "請改用 :c:func:`PyErr_GetRaisedException`。" -#: ../../c-api/exceptions.rst:492 +#: ../../c-api/exceptions.rst:509 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -531,13 +550,13 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:499 +#: ../../c-api/exceptions.rst:516 msgid "" "This function is normally only used by legacy code that needs to catch " "exceptions or save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:504 +#: ../../c-api/exceptions.rst:521 msgid "" "{\n" " PyObject *type, *value, *traceback;\n" @@ -557,11 +576,11 @@ msgstr "" " PyErr_Restore(type, value, traceback);\n" "}" -#: ../../c-api/exceptions.rst:518 +#: ../../c-api/exceptions.rst:535 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "請改用 :c:func:`PyErr_SetRaisedException`。" -#: ../../c-api/exceptions.rst:520 +#: ../../c-api/exceptions.rst:537 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -574,20 +593,20 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:534 +#: ../../c-api/exceptions.rst:551 msgid "" "This function is normally only used by legacy code that needs to save and " "restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save " "the current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:543 +#: ../../c-api/exceptions.rst:560 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" -#: ../../c-api/exceptions.rst:546 +#: ../../c-api/exceptions.rst:563 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -597,14 +616,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:554 +#: ../../c-api/exceptions.rst:571 msgid "" "This function *does not* implicitly set the :attr:`~BaseException." "__traceback__` attribute on the exception value. If setting the traceback " "appropriately is desired, the following additional snippet is needed::" msgstr "" -#: ../../c-api/exceptions.rst:559 +#: ../../c-api/exceptions.rst:576 msgid "" "if (tb != NULL) {\n" " PyException_SetTraceback(val, tb);\n" @@ -614,7 +633,7 @@ msgstr "" " PyException_SetTraceback(val, tb);\n" "}" -#: ../../c-api/exceptions.rst:566 +#: ../../c-api/exceptions.rst:583 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." "exception`. This refers to an exception that was *already caught*, not to an " @@ -622,7 +641,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: ../../c-api/exceptions.rst:573 +#: ../../c-api/exceptions.rst:590 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -630,14 +649,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:582 +#: ../../c-api/exceptions.rst:599 msgid "" "Set the active exception, as known from ``sys.exception()``. This refers to " "an exception that was *already caught*, not to an exception that was freshly " "raised. To clear the exception state, pass ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:589 +#: ../../c-api/exceptions.rst:606 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -645,7 +664,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:598 +#: ../../c-api/exceptions.rst:615 msgid "" "Retrieve the old-style representation of the exception info, as known from :" "func:`sys.exc_info`. This refers to an exception that was *already caught*, " @@ -655,7 +674,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:607 +#: ../../c-api/exceptions.rst:624 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -663,7 +682,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:617 +#: ../../c-api/exceptions.rst:634 msgid "" "Set the exception info, as known from ``sys.exc_info()``. This refers to an " "exception that was *already caught*, not to an exception that was freshly " @@ -673,7 +692,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:626 +#: ../../c-api/exceptions.rst:643 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -681,22 +700,22 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:633 +#: ../../c-api/exceptions.rst:650 msgid "" "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " "The interpreter now derives them from the exception instance (the ``value`` " "argument). The function still steals references of all three arguments." msgstr "" -#: ../../c-api/exceptions.rst:641 +#: ../../c-api/exceptions.rst:658 msgid "Signal Handling" msgstr "訊號處理" -#: ../../c-api/exceptions.rst:651 +#: ../../c-api/exceptions.rst:668 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:670 msgid "" "If the function is called from the main thread and under the main Python " "interpreter, it checks whether a signal has been sent to the processes and " @@ -704,7 +723,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:658 +#: ../../c-api/exceptions.rst:675 msgid "" "The function attempts to handle all pending signals, and then returns ``0``. " "However, if a Python signal handler raises an exception, the error indicator " @@ -713,44 +732,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:664 +#: ../../c-api/exceptions.rst:681 msgid "" "If the function is called from a non-main thread, or under a non-main Python " "interpreter, it does nothing and returns ``0``." msgstr "" -#: ../../c-api/exceptions.rst:667 +#: ../../c-api/exceptions.rst:684 msgid "" "This function can be called by long-running C code that wants to be " "interruptible by user requests (such as by pressing Ctrl-C)." msgstr "" -#: ../../c-api/exceptions.rst:671 +#: ../../c-api/exceptions.rst:688 msgid "" "The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:682 +#: ../../c-api/exceptions.rst:699 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:686 ../../c-api/exceptions.rst:713 +#: ../../c-api/exceptions.rst:703 ../../c-api/exceptions.rst:730 msgid "" "This function is async-signal-safe. It can be called without an :term:" "`attached thread state` and from a C signal handler." msgstr "" -#: ../../c-api/exceptions.rst:696 +#: ../../c-api/exceptions.rst:713 msgid "" "Simulate the effect of a signal arriving. The next time :c:func:" "`PyErr_CheckSignals` is called, the Python signal handler for the given " "signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:700 +#: ../../c-api/exceptions.rst:717 msgid "" "This function can be called by C code that sets up its own signal handling " "and wants Python signal handlers to be invoked as expected when an " @@ -758,27 +777,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:705 +#: ../../c-api/exceptions.rst:722 msgid "" "If the given signal isn't handled by Python (it was set to :py:const:`signal." "SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: ../../c-api/exceptions.rst:708 +#: ../../c-api/exceptions.rst:725 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:721 +#: ../../c-api/exceptions.rst:738 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:725 +#: ../../c-api/exceptions.rst:742 msgid "" "The value ``-1`` disables the feature; this is the initial state. This is " "equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error " @@ -786,15 +805,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:730 +#: ../../c-api/exceptions.rst:747 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:735 +#: ../../c-api/exceptions.rst:752 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:739 +#: ../../c-api/exceptions.rst:756 msgid "" "This utility function creates and returns a new exception class. The *name* " "argument must be the name of the new exception, a C string of the form " @@ -803,7 +822,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:745 +#: ../../c-api/exceptions.rst:762 msgid "" "The :attr:`~type.__module__` attribute of the new class is set to the first " "part (up to the last dot) of the *name* argument, and the class name is set " @@ -813,41 +832,41 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:754 +#: ../../c-api/exceptions.rst:771 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:763 +#: ../../c-api/exceptions.rst:780 msgid "" "Return non-zero if *ob* is an exception class, zero otherwise. This function " "always succeeds." msgstr "" -#: ../../c-api/exceptions.rst:768 +#: ../../c-api/exceptions.rst:785 msgid "Return :c:member:`~PyTypeObject.tp_name` of the exception class *ob*." msgstr "回傳例外類別 *ob* 的 :c:member:`~PyTypeObject.tp_name`。" -#: ../../c-api/exceptions.rst:772 +#: ../../c-api/exceptions.rst:789 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:776 +#: ../../c-api/exceptions.rst:793 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through the :attr:`~BaseException.__traceback__` " "attribute. If there is no traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:784 +#: ../../c-api/exceptions.rst:801 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:790 +#: ../../c-api/exceptions.rst:807 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -855,14 +874,14 @@ msgid "" "there is no context associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:798 +#: ../../c-api/exceptions.rst:815 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:805 +#: ../../c-api/exceptions.rst:822 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " @@ -870,28 +889,28 @@ msgid "" "attribute." msgstr "" -#: ../../c-api/exceptions.rst:813 +#: ../../c-api/exceptions.rst:830 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or ``None``. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:817 +#: ../../c-api/exceptions.rst:834 msgid "" "The :attr:`~BaseException.__suppress_context__` attribute is implicitly set " "to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:823 +#: ../../c-api/exceptions.rst:840 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "回傳例外 *ex* 的 :attr:`~BaseException.args`。" -#: ../../c-api/exceptions.rst:828 +#: ../../c-api/exceptions.rst:845 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "設定例外 *ex* 的 :attr:`~BaseException.args` 為 *args*。" -#: ../../c-api/exceptions.rst:832 +#: ../../c-api/exceptions.rst:849 msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " @@ -903,98 +922,98 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: ../../c-api/exceptions.rst:846 +#: ../../c-api/exceptions.rst:863 msgid "Unicode Exception Objects" msgstr "Unicode 例外物件" -#: ../../c-api/exceptions.rst:848 +#: ../../c-api/exceptions.rst:865 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:852 +#: ../../c-api/exceptions.rst:869 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:859 +#: ../../c-api/exceptions.rst:876 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:865 +#: ../../c-api/exceptions.rst:882 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:871 +#: ../../c-api/exceptions.rst:888 msgid "" "Get the *start* attribute of the given exception object and place it into " "*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:875 +#: ../../c-api/exceptions.rst:892 msgid "" "If the :attr:`UnicodeError.object` is an empty sequence, the resulting " "*start* is ``0``. Otherwise, it is clipped to ``[0, len(object) - 1]``." msgstr "" -#: ../../c-api/exceptions.rst:878 +#: ../../c-api/exceptions.rst:895 msgid ":attr:`UnicodeError.start`" msgstr ":attr:`UnicodeError.start`" -#: ../../c-api/exceptions.rst:884 +#: ../../c-api/exceptions.rst:901 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:889 +#: ../../c-api/exceptions.rst:906 msgid "" "While passing a negative *start* does not raise an exception, the " "corresponding getters will not consider it as a relative offset." msgstr "" -#: ../../c-api/exceptions.rst:897 +#: ../../c-api/exceptions.rst:914 msgid "" "Get the *end* attribute of the given exception object and place it into " "*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:901 +#: ../../c-api/exceptions.rst:918 msgid "" "If the :attr:`UnicodeError.object` is an empty sequence, the resulting *end* " "is ``0``. Otherwise, it is clipped to ``[1, len(object)]``." msgstr "" -#: ../../c-api/exceptions.rst:908 +#: ../../c-api/exceptions.rst:925 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:911 +#: ../../c-api/exceptions.rst:928 msgid ":attr:`UnicodeError.end`" msgstr ":attr:`UnicodeError.end`" -#: ../../c-api/exceptions.rst:917 +#: ../../c-api/exceptions.rst:934 msgid "Return the *reason* attribute of the given exception object." msgstr "回傳給定例外物件的 *reason* 屬性。" -#: ../../c-api/exceptions.rst:923 +#: ../../c-api/exceptions.rst:940 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:930 +#: ../../c-api/exceptions.rst:947 msgid "Recursion Control" msgstr "遞迴控制" -#: ../../c-api/exceptions.rst:932 +#: ../../c-api/exceptions.rst:949 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -1004,37 +1023,37 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:958 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:943 +#: ../../c-api/exceptions.rst:960 msgid "" "The function then checks if the stack limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:947 +#: ../../c-api/exceptions.rst:964 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:951 ../../c-api/exceptions.rst:959 +#: ../../c-api/exceptions.rst:968 ../../c-api/exceptions.rst:976 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:956 +#: ../../c-api/exceptions.rst:973 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:962 +#: ../../c-api/exceptions.rst:979 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -1043,13 +1062,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:970 +#: ../../c-api/exceptions.rst:987 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:973 +#: ../../c-api/exceptions.rst:990 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -1057,301 +1076,301 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:979 +#: ../../c-api/exceptions.rst:996 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:983 +#: ../../c-api/exceptions.rst:1000 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:988 +#: ../../c-api/exceptions.rst:1005 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:993 +#: ../../c-api/exceptions.rst:1010 msgid "" "Get the recursion limit for the current interpreter. It can be set with :c:" "func:`Py_SetRecursionLimit`. The recursion limit prevents the Python " "interpreter stack from growing infinitely." msgstr "" -#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1014 ../../c-api/exceptions.rst:1024 msgid "" "This function cannot fail, and the caller must hold an :term:`attached " "thread state`." msgstr "" -#: ../../c-api/exceptions.rst:1001 +#: ../../c-api/exceptions.rst:1018 msgid ":py:func:`sys.getrecursionlimit`" msgstr ":py:func:`sys.getrecursionlimit`" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1022 msgid "Set the recursion limit for the current interpreter." msgstr "" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1028 msgid ":py:func:`sys.setrecursionlimit`" msgstr ":py:func:`sys.setrecursionlimit`" -#: ../../c-api/exceptions.rst:1016 +#: ../../c-api/exceptions.rst:1033 msgid "Exception and warning types" msgstr "例外和警告型別" -#: ../../c-api/exceptions.rst:1018 +#: ../../c-api/exceptions.rst:1035 msgid "" "All standard Python exceptions and warning categories are available as " "global variables whose names are ``PyExc_`` followed by the Python exception " "name. These have the type :c:expr:`PyObject*`; they are all class objects." msgstr "" -#: ../../c-api/exceptions.rst:1022 +#: ../../c-api/exceptions.rst:1039 msgid "For completeness, here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1042 msgid "Exception types" msgstr "例外型別" -#: ../../c-api/exceptions.rst:1032 ../../c-api/exceptions.rst:1178 -#: ../../c-api/exceptions.rst:1208 +#: ../../c-api/exceptions.rst:1049 ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1225 msgid "C name" msgstr "C 名稱" -#: ../../c-api/exceptions.rst:1033 ../../c-api/exceptions.rst:1179 -#: ../../c-api/exceptions.rst:1209 +#: ../../c-api/exceptions.rst:1050 ../../c-api/exceptions.rst:1196 +#: ../../c-api/exceptions.rst:1226 msgid "Python name" msgstr "Python 名稱" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1052 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1054 msgid ":exc:`BaseExceptionGroup`" msgstr ":exc:`BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1056 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1058 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1060 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1062 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1064 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1066 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1068 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1070 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1072 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1074 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1076 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1078 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1080 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1082 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1084 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1086 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1088 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1090 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1092 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1094 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1096 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1098 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1100 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1102 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1104 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1106 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1108 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1110 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1112 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1114 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1099 ../../c-api/exceptions.rst:1182 -#: ../../c-api/exceptions.rst:1185 ../../c-api/exceptions.rst:1188 +#: ../../c-api/exceptions.rst:1116 ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1202 ../../c-api/exceptions.rst:1205 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1118 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1120 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1122 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1124 msgid ":exc:`PythonFinalizationError`" msgstr ":exc:`PythonFinalizationError`" -#: ../../c-api/exceptions.rst:1109 +#: ../../c-api/exceptions.rst:1126 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1111 +#: ../../c-api/exceptions.rst:1128 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:1130 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1115 +#: ../../c-api/exceptions.rst:1132 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1117 +#: ../../c-api/exceptions.rst:1134 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:1136 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:1138 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1140 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1125 +#: ../../c-api/exceptions.rst:1142 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1127 +#: ../../c-api/exceptions.rst:1144 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:1146 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:1148 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:1150 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1135 +#: ../../c-api/exceptions.rst:1152 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1137 +#: ../../c-api/exceptions.rst:1154 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1139 +#: ../../c-api/exceptions.rst:1156 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1141 +#: ../../c-api/exceptions.rst:1158 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1143 +#: ../../c-api/exceptions.rst:1160 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1145 +#: ../../c-api/exceptions.rst:1162 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1371,141 +1390,141 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1155 +#: ../../c-api/exceptions.rst:1172 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`。" -#: ../../c-api/exceptions.rst:1158 +#: ../../c-api/exceptions.rst:1175 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`。" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1178 msgid ":c:data:`PyExc_BaseExceptionGroup`." msgstr ":c:data:`PyExc_BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1166 +#: ../../c-api/exceptions.rst:1183 msgid "OSError aliases" msgstr "OSError 別名" -#: ../../c-api/exceptions.rst:1168 +#: ../../c-api/exceptions.rst:1185 msgid "The following are a compatibility aliases to :c:data:`PyExc_OSError`." msgstr "" -#: ../../c-api/exceptions.rst:1170 +#: ../../c-api/exceptions.rst:1187 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1180 +#: ../../c-api/exceptions.rst:1197 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1206 msgid "[win]_" msgstr "[win]_" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1208 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1194 +#: ../../c-api/exceptions.rst:1211 msgid "" ":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that " "uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1201 +#: ../../c-api/exceptions.rst:1218 msgid "Warning types" msgstr "警告型別" -#: ../../c-api/exceptions.rst:1211 +#: ../../c-api/exceptions.rst:1228 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1213 +#: ../../c-api/exceptions.rst:1230 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1215 +#: ../../c-api/exceptions.rst:1232 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1217 +#: ../../c-api/exceptions.rst:1234 msgid ":exc:`EncodingWarning`" msgstr ":exc:`EncodingWarning`" -#: ../../c-api/exceptions.rst:1219 +#: ../../c-api/exceptions.rst:1236 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1221 +#: ../../c-api/exceptions.rst:1238 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1223 +#: ../../c-api/exceptions.rst:1240 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1225 +#: ../../c-api/exceptions.rst:1242 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1227 +#: ../../c-api/exceptions.rst:1244 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1229 +#: ../../c-api/exceptions.rst:1246 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1231 +#: ../../c-api/exceptions.rst:1248 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1233 +#: ../../c-api/exceptions.rst:1250 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1235 +#: ../../c-api/exceptions.rst:1252 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`。" -#: ../../c-api/exceptions.rst:1238 +#: ../../c-api/exceptions.rst:1255 msgid ":c:data:`PyExc_EncodingWarning`." msgstr ":c:data:`PyExc_EncodingWarning`。" -#: ../../c-api/exceptions.rst:1243 +#: ../../c-api/exceptions.rst:1260 msgid "Tracebacks" msgstr "" -#: ../../c-api/exceptions.rst:1247 +#: ../../c-api/exceptions.rst:1264 msgid "" "Type object for traceback objects. This is available as :class:`types." "TracebackType` in the Python layer." msgstr "" -#: ../../c-api/exceptions.rst:1253 +#: ../../c-api/exceptions.rst:1270 msgid "" "Return true if *op* is a traceback object, false otherwise. This function " "does not account for subtypes." msgstr "" -#: ../../c-api/exceptions.rst:1259 +#: ../../c-api/exceptions.rst:1276 msgid "" "Replace the :attr:`~BaseException.__traceback__` attribute on the current " "exception with a new traceback prepending *f* to the existing chain." msgstr "" -#: ../../c-api/exceptions.rst:1262 +#: ../../c-api/exceptions.rst:1279 msgid "Calling this function without an exception set is undefined behavior." msgstr "" -#: ../../c-api/exceptions.rst:1264 ../../c-api/exceptions.rst:1272 +#: ../../c-api/exceptions.rst:1281 ../../c-api/exceptions.rst:1289 msgid "" "This function returns ``0`` on success, and returns ``-1`` with an exception " "set on failure." msgstr "" -#: ../../c-api/exceptions.rst:1270 +#: ../../c-api/exceptions.rst:1287 msgid "Write the traceback *tb* into the file *f*." msgstr "" @@ -1513,22 +1532,22 @@ msgstr "" msgid "strerror (C function)" msgstr "strerror(C 函式)" -#: ../../c-api/exceptions.rst:646 ../../c-api/exceptions.rst:677 -#: ../../c-api/exceptions.rst:692 +#: ../../c-api/exceptions.rst:663 ../../c-api/exceptions.rst:694 +#: ../../c-api/exceptions.rst:709 msgid "module" msgstr "module(模組)" -#: ../../c-api/exceptions.rst:646 ../../c-api/exceptions.rst:677 -#: ../../c-api/exceptions.rst:692 +#: ../../c-api/exceptions.rst:663 ../../c-api/exceptions.rst:694 +#: ../../c-api/exceptions.rst:709 msgid "signal" msgstr "signal(訊號)" -#: ../../c-api/exceptions.rst:646 ../../c-api/exceptions.rst:677 +#: ../../c-api/exceptions.rst:663 ../../c-api/exceptions.rst:694 msgid "SIGINT (C macro)" msgstr "SIGINT(C 巨集)" -#: ../../c-api/exceptions.rst:646 ../../c-api/exceptions.rst:677 -#: ../../c-api/exceptions.rst:692 +#: ../../c-api/exceptions.rst:663 ../../c-api/exceptions.rst:694 +#: ../../c-api/exceptions.rst:709 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" diff --git a/c-api/hash.po b/c-api/hash.po index cbd53b8163c..020fd33cf32 100644 --- a/c-api/hash.po +++ b/c-api/hash.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-11-09 00:17+0000\n" "PO-Revision-Date: 2024-04-30 00:20+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,11 +30,62 @@ msgstr "另請參閱 :c:member:`PyTypeObject.tp_hash` 成員和 :ref:`numeric-ha msgid "Hash value type: signed integer." msgstr "雜湊值型別:有符號整數。" -#: ../../c-api/hash.rst:16 +#: ../../c-api/hash.rst:17 msgid "Hash value type: unsigned integer." msgstr "雜湊值型別:無符號整數。" -#: ../../c-api/hash.rst:22 +#: ../../c-api/hash.rst:24 +msgid "" +"A numerical value indicating the algorithm for hashing of :class:`str`, :" +"class:`bytes`, and :class:`memoryview`." +msgstr "" + +#: ../../c-api/hash.rst:27 +msgid "The algorithm name is exposed by :data:`sys.hash_info.algorithm`." +msgstr "" + +#: ../../c-api/hash.rst:36 +msgid "" +"Numerical values to compare to :c:macro:`Py_HASH_ALGORITHM` to determine " +"which algorithm is used for hashing. The hash algorithm can be configured " +"via the configure :option:`--with-hash-algorithm` option." +msgstr "" + +#: ../../c-api/hash.rst:40 +msgid "Add :c:macro:`!Py_HASH_FNV` and :c:macro:`!Py_HASH_SIPHASH24`." +msgstr "" + +#: ../../c-api/hash.rst:43 +msgid "Add :c:macro:`!Py_HASH_SIPHASH13`." +msgstr "" + +#: ../../c-api/hash.rst:49 +msgid "" +"Buffers of length in range ``[1, Py_HASH_CUTOFF)`` are hashed using DJBX33A " +"instead of the algorithm described by :c:macro:`Py_HASH_ALGORITHM`." +msgstr "" + +#: ../../c-api/hash.rst:52 +msgid "A :c:macro:`!Py_HASH_CUTOFF` of 0 disables the optimization." +msgstr "" + +#: ../../c-api/hash.rst:53 +msgid "" +":c:macro:`!Py_HASH_CUTOFF` must be non-negative and less or equal than 7." +msgstr "" + +#: ../../c-api/hash.rst:55 +msgid "" +"32-bit platforms should use a cutoff smaller than 64-bit platforms because " +"it is easier to create colliding strings. A cutoff of 7 on 64-bit platforms " +"and 5 on 32-bit platforms should provide a decent safety margin." +msgstr "" + +#: ../../c-api/hash.rst:59 +msgid "This corresponds to the :data:`sys.hash_info.cutoff` constant." +msgstr "" + +#: ../../c-api/hash.rst:66 msgid "" "The `Mersenne prime `_ ``P = " "2**n -1``, used for numeric hash scheme." @@ -42,53 +93,77 @@ msgstr "" "用於數值雜湊方案的\\ `梅森質數 (Mersenne prime) `_ ``P = 2**n -1``。" -#: ../../c-api/hash.rst:28 +#: ../../c-api/hash.rst:69 +msgid "This corresponds to the :data:`sys.hash_info.modulus` constant." +msgstr "" + +#: ../../c-api/hash.rst:76 msgid "The exponent ``n`` of ``P`` in :c:macro:`PyHASH_MODULUS`." msgstr ":c:macro:`PyHASH_MODULUS` 中 ``P`` 的指數 ``n``。" -#: ../../c-api/hash.rst:34 +#: ../../c-api/hash.rst:83 msgid "Prime multiplier used in string and various other hashes." msgstr "用於字串和其他各種雜湊的質數乘數 (prime multiplier)。" -#: ../../c-api/hash.rst:40 +#: ../../c-api/hash.rst:90 msgid "The hash value returned for a positive infinity." msgstr "正無窮大回傳的雜湊值。" -#: ../../c-api/hash.rst:46 +#: ../../c-api/hash.rst:92 +msgid "This corresponds to the :data:`sys.hash_info.inf` constant." +msgstr "" + +#: ../../c-api/hash.rst:99 msgid "The multiplier used for the imaginary part of a complex number." msgstr "用於複數虛數部分的乘數。" -#: ../../c-api/hash.rst:52 +#: ../../c-api/hash.rst:101 +msgid "This corresponds to the :data:`sys.hash_info.imag` constant." +msgstr "" + +#: ../../c-api/hash.rst:108 msgid "Hash function definition used by :c:func:`PyHash_GetFuncDef`." msgstr ":c:func:`PyHash_GetFuncDef` 所使用的雜湊函式定義。" -#: ../../c-api/hash.rst:56 +#: ../../c-api/hash.rst:112 msgid "Hash function." msgstr "雜湊函式。" -#: ../../c-api/hash.rst:60 +#: ../../c-api/hash.rst:116 msgid "Hash function name (UTF-8 encoded string)." msgstr "雜湊函式名稱(UTF-8 編碼字串)。" -#: ../../c-api/hash.rst:64 +#: ../../c-api/hash.rst:118 +msgid "This corresponds to the :data:`sys.hash_info.algorithm` constant." +msgstr "" + +#: ../../c-api/hash.rst:122 msgid "Internal size of the hash value in bits." msgstr "雜湊值的內部大小(以位元為單位)。" -#: ../../c-api/hash.rst:68 +#: ../../c-api/hash.rst:124 +msgid "This corresponds to the :data:`sys.hash_info.hash_bits` constant." +msgstr "" + +#: ../../c-api/hash.rst:128 msgid "Size of seed input in bits." msgstr "Seed 輸入的大小(以位元為單位)。" -#: ../../c-api/hash.rst:75 +#: ../../c-api/hash.rst:130 +msgid "This corresponds to the :data:`sys.hash_info.seed_bits` constant." +msgstr "" + +#: ../../c-api/hash.rst:137 msgid "Get the hash function definition." msgstr "取得雜湊函式定義。" -#: ../../c-api/hash.rst:78 +#: ../../c-api/hash.rst:140 msgid ":pep:`456` \"Secure and interchangeable hash algorithm\"." msgstr "" ":pep:`456`\\ 「安全且可交替使用的雜湊演算法 (Secure and interchangeable hash " "algorithm)」。" -#: ../../c-api/hash.rst:85 +#: ../../c-api/hash.rst:147 msgid "" "Hash a pointer value: process the pointer value as an integer (cast it to " "``uintptr_t`` internally). The pointer is not dereferenced." @@ -96,11 +171,11 @@ msgstr "" "雜湊指標值:將指標值作為整數處理(在內部轉型為 ``uintptr_t``)。指標不會被取" "值 (dereference)。" -#: ../../c-api/hash.rst:88 +#: ../../c-api/hash.rst:150 msgid "The function cannot fail: it cannot return ``-1``." msgstr "此函式不會失敗:它不會回傳 ``-1``。" -#: ../../c-api/hash.rst:95 +#: ../../c-api/hash.rst:157 msgid "" "Compute and return the hash value of a buffer of *len* bytes starting at " "address *ptr*. The hash is guaranteed to match that of :class:`bytes`, :" @@ -108,21 +183,21 @@ msgid "" "`buffer protocol `." msgstr "" -#: ../../c-api/hash.rst:100 +#: ../../c-api/hash.rst:162 msgid "" "Use this function to implement hashing for immutable objects whose :c:member:" "`~PyTypeObject.tp_richcompare` function compares to another object's buffer." msgstr "" -#: ../../c-api/hash.rst:104 +#: ../../c-api/hash.rst:166 msgid "*len* must be greater than or equal to ``0``." msgstr "*len* 必須大於或等於 ``0``。" -#: ../../c-api/hash.rst:106 +#: ../../c-api/hash.rst:168 msgid "This function always succeeds." msgstr "此函式總是會成功執行。" -#: ../../c-api/hash.rst:113 +#: ../../c-api/hash.rst:175 msgid "" "Generic hashing function that is meant to be put into a type object's " "``tp_hash`` slot. Its result only depends on the object's identity." @@ -130,6 +205,6 @@ msgstr "" "泛用雜湊函式,旨在放入型別物件的 ``tp_hash`` 插槽中。其結果僅取決於物件的識別" "性。" -#: ../../c-api/hash.rst:118 +#: ../../c-api/hash.rst:180 msgid "In CPython, it is equivalent to :c:func:`Py_HashPointer`." msgstr "在 CPython 中,它等價於 :c:func:`Py_HashPointer`。" diff --git a/c-api/intro.po b/c-api/intro.po index 3e9ccded146..cae67c2de94 100644 --- a/c-api/intro.po +++ b/c-api/intro.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-11-09 00:17+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,8 +32,8 @@ msgid "" "API. The first reason is to write *extension modules* for specific purposes; " "these are C modules that extend the Python interpreter. This is probably " "the most common use. The second reason is to use Python as a component in a " -"larger application; this technique is generally referred to " -"as :dfn:`embedding` Python in an application." +"larger application; this technique is generally referred to as :dfn:" +"`embedding` Python in an application." msgstr "" "對於 Python 的應用程式開發介面使得 C 和 C++ 開發者能夠在各種層級存取 Python " "直譯器。該 API 同樣可用於 C++,但為簡潔起見,通常將其稱為 Python/C API。使用 " @@ -119,8 +119,8 @@ msgstr "" #: ../../c-api/intro.rst:64 msgid "" "This implies inclusion of the following standard headers: ````, " -"````, ````, ````, ```` and " -"```` (if available)." +"````, ````, ````, ```` and ```` (if available)." msgstr "" "這意味著會引入以下標準標頭:````、````、````、" "````、```` 和 ````\\ (如果可用)。" @@ -168,17 +168,17 @@ msgstr "" #: ../../c-api/intro.rst:89 msgid "" "The header files are typically installed with Python. On Unix, these are " -"located in the directories :file:`{prefix}/include/pythonversion/` " -"and :file:`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--" -"prefix>` and :option:`exec_prefix <--exec-prefix>` are defined by the " -"corresponding parameters to Python's :program:`configure` script and " -"*version* is ``'%d.%d' % sys.version_info[:2]``. On Windows, the headers " -"are installed in :file:`{prefix}/include`, where ``prefix`` is the " -"installation directory specified to the installer." +"located in the directories :file:`{prefix}/include/pythonversion/` and :file:" +"`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--prefix>` " +"and :option:`exec_prefix <--exec-prefix>` are defined by the corresponding " +"parameters to Python's :program:`configure` script and *version* is ``'%d." +"%d' % sys.version_info[:2]``. On Windows, the headers are installed in :" +"file:`{prefix}/include`, where ``prefix`` is the installation directory " +"specified to the installer." msgstr "" "標頭檔通常隨 Python 一起安裝。在 Unix 上它們位於目錄 :file:`{prefix}/include/" -"pythonversion/` 和 :file:`{exec_prefix}/include/pythonversion/`,其" -"中 :option:`prefix <--prefix>` 和 :option:`exec_prefix <--exec-prefix>` 由 " +"pythonversion/` 和 :file:`{exec_prefix}/include/pythonversion/`,其中 :" +"option:`prefix <--prefix>` 和 :option:`exec_prefix <--exec-prefix>` 由 " "Python 的 :program:`configure` 腳本的相應參數定義,*version* 是 ``'%d.%d' % " "sys.version_info[:2]``。在 Windows 上,標頭安裝在 :file:`{prefix}/include` " "中,其中 ``prefix`` 是指定給安裝程式 (installer) 用的安裝目錄。" @@ -188,14 +188,14 @@ msgid "" "To include the headers, place both directories (if different) on your " "compiler's search path for includes. Do *not* place the parent directories " "on the search path and then use ``#include ``; this will " -"break on multi-platform builds since the platform independent headers " -"under :option:`prefix <--prefix>` include the platform specific headers " -"from :option:`exec_prefix <--exec-prefix>`." +"break on multi-platform builds since the platform independent headers under :" +"option:`prefix <--prefix>` include the platform specific headers from :" +"option:`exec_prefix <--exec-prefix>`." msgstr "" "要引入標頭,請將兩個(如果不同)目錄放在編譯器的引入搜尋路徑 (search path) " -"中。*不要*\\ 將父目錄放在搜尋路徑上,然後使用 ``#include ``;這會在多平台建置上壞掉,因為 :option:`prefix <--prefix>` 下獨立" -"於平台的標頭包括來自 :option:`exec_prefix <--exec-prefix>` 的平台特定標頭。" +"中。*不要*\\ 將父目錄放在搜尋路徑上,然後使用 ``#include ``;這會在多平台建置上壞掉,因為 :option:`prefix <--prefix>` 下獨立於平台的" +"標頭包括來自 :option:`exec_prefix <--exec-prefix>` 的平台特定標頭。" #: ../../c-api/intro.rst:105 msgid "" @@ -213,13 +213,12 @@ msgstr "有用的巨集" #: ../../c-api/intro.rst:113 msgid "" "Several useful macros are defined in the Python header files. Many are " -"defined closer to where they are useful (for " -"example, :c:macro:`Py_RETURN_NONE`, :c:macro:`PyMODINIT_FUNC`). Others of a " -"more general utility are defined here. This is not necessarily a complete " -"listing." +"defined closer to where they are useful (for example, :c:macro:" +"`Py_RETURN_NONE`, :c:macro:`PyMODINIT_FUNC`). Others of a more general " +"utility are defined here. This is not necessarily a complete listing." msgstr "" -"Python 標頭檔中定義了幾個有用的巨集,大多被定義在它們有用的地方附近(例" -"如 :c:macro:`Py_RETURN_NONE`、:c:macro:`PyMODINIT_FUNC`),其他是更通用的工具程式。" +"Python 標頭檔中定義了幾個有用的巨集,大多被定義在它們有用的地方附近(例如 :c:" +"macro:`Py_RETURN_NONE`、:c:macro:`PyMODINIT_FUNC`),其他是更通用的工具程式。" "以下並不一定是完整的列表。" #: ../../c-api/intro.rst:122 @@ -254,13 +253,12 @@ msgstr "" #: ../../c-api/intro.rst:139 msgid "" -"If Python is :ref:`built in debug mode ` (if " -"the :c:macro:`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` " -"macro does nothing." +"If Python is :ref:`built in debug mode ` (if the :c:macro:" +"`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does " +"nothing." msgstr "" -"如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如" -"果 :c:macro:`Py_DEBUG` 巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼" -"都不會做。" +"如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 :c:macro:" +"`Py_DEBUG` 巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。" #: ../../c-api/intro.rst:142 msgid "It must be specified before the function return type. Usage::" @@ -284,8 +282,8 @@ msgid "" "symbol name." msgstr "將其用於已棄用的聲明。巨集必須放在符號名稱之前。" -#: ../../c-api/intro.rst:158 ../../c-api/intro.rst:244 -#: ../../c-api/intro.rst:262 +#: ../../c-api/intro.rst:158 ../../c-api/intro.rst:267 +#: ../../c-api/intro.rst:285 msgid "Example::" msgstr "範例: ::" @@ -320,8 +318,8 @@ msgstr "回傳 ``x`` 和 ``y`` 之間的最小值。" #: ../../c-api/intro.rst:190 msgid "" "Disable inlining on a function. For example, it reduces the C stack " -"consumption: useful on LTO+PGO builds which heavily inline code " -"(see :issue:`33720`)." +"consumption: useful on LTO+PGO builds which heavily inline code (see :issue:" +"`33720`)." msgstr "" "禁用函式的嵌入。例如,它減少了 C 堆疊的消耗:對大量嵌入程式碼的 LTO+PGO 建置" "很有用(請參閱 :issue:`33720`)。" @@ -366,8 +364,8 @@ msgid "" "A use for ``Py_UNREACHABLE()`` is following a call a function that never " "returns but that is not declared :c:macro:`_Py_NO_RETURN`." msgstr "" -"``Py_UNREACHABLE()`` 的一個用途是,在對一個永不回傳但並未聲明" -"為 :c:macro:`_Py_NO_RETURN` 的函式之呼叫後使用。" +"``Py_UNREACHABLE()`` 的一個用途是,在對一個永不回傳但並未聲明為 :c:macro:" +"`_Py_NO_RETURN` 的函式之呼叫後使用。" #: ../../c-api/intro.rst:221 msgid "" @@ -391,13 +389,43 @@ msgstr "" #: ../../c-api/intro.rst:238 msgid "" -"Creates a variable with name ``name`` that can be used in docstrings. If " +"Asserts a compile-time condition *cond*, as a statement. The build will fail " +"if the condition is false or cannot be evaluated at compile time." +msgstr "" + +#: ../../c-api/intro.rst:241 ../../c-api/intro.rst:252 +#: ../../c-api/intro.rst:297 +#, fuzzy +msgid "For example::" +msgstr "範例: ::" + +#: ../../c-api/intro.rst:243 +msgid "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" +msgstr "" + +#: ../../c-api/intro.rst:249 +msgid "" +"Asserts a compile-time condition *cond*, as an expression that evaluates to " +"``0``. The build will fail if the condition is false or cannot be evaluated " +"at compile time." +msgstr "" + +#: ../../c-api/intro.rst:254 +msgid "" +"#define foo_to_char(foo) \\\n" +" ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" +msgstr "" + +#: ../../c-api/intro.rst:261 +#, fuzzy +msgid "" +"Creates a variable with name *name* that can be used in docstrings. If " "Python is built without docstrings, the value will be empty." msgstr "" "建立一個名為 ``name`` 的變數,可以在文件字串中使用。如果 Python 是在沒有文件" "字串的情況下建置,則該值將為空。" -#: ../../c-api/intro.rst:241 +#: ../../c-api/intro.rst:264 msgid "" "Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -405,7 +433,7 @@ msgstr "" "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STRVAR` 作為文件字串可以支援在沒有" "文件字串的情況下建置 Python。" -#: ../../c-api/intro.rst:246 +#: ../../c-api/intro.rst:269 msgid "" "PyDoc_STRVAR(pop_doc, \"Remove and return the rightmost element.\");\n" "\n" @@ -416,13 +444,13 @@ msgid "" "}" msgstr "" -#: ../../c-api/intro.rst:256 +#: ../../c-api/intro.rst:279 msgid "" "Creates a docstring for the given input string or an empty string if " "docstrings are disabled." msgstr "為給定的輸入字串建立一個文件字串,如果文件字串被禁用則建立空字串。" -#: ../../c-api/intro.rst:259 +#: ../../c-api/intro.rst:282 msgid "" "Use :c:macro:`PyDoc_STR` in specifying docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -430,7 +458,7 @@ msgstr "" "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STR` 指定文件字串以支援在沒有文件" "字串下建置 Python。" -#: ../../c-api/intro.rst:264 +#: ../../c-api/intro.rst:287 msgid "" "static PyMethodDef pysqlite_row_methods[] = {\n" " {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" @@ -439,11 +467,23 @@ msgid "" "};" msgstr "" -#: ../../c-api/intro.rst:274 +#: ../../c-api/intro.rst:295 +msgid "Declares a static character array variable with the given name *name*." +msgstr "" + +#: ../../c-api/intro.rst:299 +msgid "" +"PyDoc_VAR(python_doc) = PyDoc_STR(\"A genus of constricting snakes in the " +"Pythonidae family native \"\n" +" \"to the tropics and subtropics of the " +"Eastern Hemisphere.\");" +msgstr "" + +#: ../../c-api/intro.rst:306 msgid "Objects, Types and Reference Counts" msgstr "物件、型別和參照計數" -#: ../../c-api/intro.rst:278 +#: ../../c-api/intro.rst:310 msgid "" "Most Python/C API functions have one or more arguments as well as a return " "value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data " @@ -451,9 +491,9 @@ msgid "" "are treated the same way by the Python language in most situations (e.g., " "assignments, scope rules, and argument passing), it is only fitting that " "they should be represented by a single C type. Almost all Python objects " -"live on the heap: you never declare an automatic or static variable of " -"type :c:type:`PyObject`, only pointer variables of type :c:expr:`PyObject*` " -"can be declared. The sole exception are the type objects; since these must " +"live on the heap: you never declare an automatic or static variable of type :" +"c:type:`PyObject`, only pointer variables of type :c:expr:`PyObject*` can " +"be declared. The sole exception are the type objects; since these must " "never be deallocated, they are typically static :c:type:`PyTypeObject` " "objects." msgstr "" @@ -466,28 +506,27 @@ msgstr "" "別物件;由於它們絕不能被釋放,因此它們通常是靜態 :c:type:`PyTypeObject` 物" "件。" -#: ../../c-api/intro.rst:289 +#: ../../c-api/intro.rst:321 msgid "" -"All Python objects (even Python integers) have a :dfn:`type` and " -"a :dfn:`reference count`. An object's type determines what kind of object " -"it is (e.g., an integer, a list, or a user-defined function; there are many " -"more as explained in :ref:`types`). For each of the well-known types there " -"is a macro to check whether an object is of that type; for instance, " +"All Python objects (even Python integers) have a :dfn:`type` and a :dfn:" +"`reference count`. An object's type determines what kind of object it is (e." +"g., an integer, a list, or a user-defined function; there are many more as " +"explained in :ref:`types`). For each of the well-known types there is a " +"macro to check whether an object is of that type; for instance, " "``PyList_Check(a)`` is true if (and only if) the object pointed to by *a* is " "a Python list." msgstr "" "所有 Python 物件(甚至是 Python 整數)都有一個型別 (:dfn:`type`) 和一個參照計" "數 (:dfn:`reference count`)。一個物件的型別決定了它是什麼種類的物件(例如一個" -"整數、一個 list 或一個使用者定義的函式;還有更多型別,請見" -"\\ :ref:`types`\\ )。對於每個眾所周知的型別,都有一個巨集來檢查物件是否屬於" -"該型別;例如,若(且唯若)*a* 指向的物件是 Python list 時," -"``PyList_Check(a)`` 為真。" +"整數、一個 list 或一個使用者定義的函式;還有更多型別,請見\\ :ref:" +"`types`\\ )。對於每個眾所周知的型別,都有一個巨集來檢查物件是否屬於該型別;" +"例如,若(且唯若)*a* 指向的物件是 Python list 時,``PyList_Check(a)`` 為真。" -#: ../../c-api/intro.rst:300 +#: ../../c-api/intro.rst:332 msgid "Reference Counts" msgstr "參照計數" -#: ../../c-api/intro.rst:302 +#: ../../c-api/intro.rst:334 msgid "" "The reference count is important because today's computers have a finite " "(and often severely limited) memory size; it counts how many different " @@ -510,23 +549,23 @@ msgstr "" "則可以依次為那些其他物件解除配置,依此類推。(此處相互參照物件的存在是個明顯" "的問題;目前,解決方案是「就不要那樣做」。)" -#: ../../c-api/intro.rst:319 +#: ../../c-api/intro.rst:351 msgid "" "Reference counts are always manipulated explicitly. The normal way is to " "use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. " "increment its reference count by one), and :c:func:`Py_DECREF` to release " -"that reference (i.e. decrement the reference count by one). " -"The :c:func:`Py_DECREF` macro is considerably more complex than the incref " -"one, since it must check whether the reference count becomes zero and then " -"cause the object's deallocator to be called. The deallocator is a function " -"pointer contained in the object's type structure. The type-specific " -"deallocator takes care of releasing references for other objects contained " -"in the object if this is a compound object type, such as a list, as well as " -"performing any additional finalization that's needed. There's no chance " -"that the reference count can overflow; at least as many bits are used to " -"hold the reference count as there are distinct memory locations in virtual " -"memory (assuming ``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the " -"reference count increment is a simple operation." +"that reference (i.e. decrement the reference count by one). The :c:func:" +"`Py_DECREF` macro is considerably more complex than the incref one, since it " +"must check whether the reference count becomes zero and then cause the " +"object's deallocator to be called. The deallocator is a function pointer " +"contained in the object's type structure. The type-specific deallocator " +"takes care of releasing references for other objects contained in the object " +"if this is a compound object type, such as a list, as well as performing any " +"additional finalization that's needed. There's no chance that the reference " +"count can overflow; at least as many bits are used to hold the reference " +"count as there are distinct memory locations in virtual memory (assuming " +"``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the reference count " +"increment is a simple operation." msgstr "" "參照計數總是被明確地操作。正常的方法是使用巨集 :c:func:`Py_INCREF` 來取得對於" "物件的參照(即參照計數加一),並使用巨集 :c:func:`Py_DECREF` 來釋放參照(即將" @@ -538,7 +577,7 @@ msgstr "" "元會被使用(假設 ``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加" "是一個簡單的操作。" -#: ../../c-api/intro.rst:335 +#: ../../c-api/intro.rst:367 msgid "" "It is not necessary to hold a :term:`strong reference` (i.e. increment the " "reference count) for every local variable that contains a pointer to an " @@ -564,15 +603,15 @@ msgstr "" "種情況的一個重要情況是在從 Python 呼叫的擴充模組中作為引數傳遞給 C 函式的物" "件;呼叫機制保證在呼叫期間保持對每個參數的參照。" -#: ../../c-api/intro.rst:351 +#: ../../c-api/intro.rst:383 msgid "" "However, a common pitfall is to extract an object from a list and hold on to " "it for a while without taking a new reference. Some other operation might " "conceivably remove the object from the list, releasing that reference, and " "possibly deallocating it. The real danger is that innocent-looking " "operations may invoke arbitrary Python code which could do this; there is a " -"code path which allows control to flow back to the user from " -"a :c:func:`Py_DECREF`, so almost any operation is potentially dangerous." +"code path which allows control to flow back to the user from a :c:func:" +"`Py_DECREF`, so almost any operation is potentially dangerous." msgstr "" "然而,一個常見的陷阱是從一個 list 中提取一個物件並保留它一段時間而不取得其參" "照。某些其他操作可能會從列表中刪除該物件,減少其參照計數並可能取消分配它。真" @@ -580,7 +619,7 @@ msgstr "" "程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作都有潛" "在危險。" -#: ../../c-api/intro.rst:359 +#: ../../c-api/intro.rst:391 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " @@ -595,11 +634,11 @@ msgstr "" "計數)。這讓呼叫者有責任在處理完結果後呼叫 :c:func:`Py_DECREF`;這就成為第二" "本質。" -#: ../../c-api/intro.rst:370 +#: ../../c-api/intro.rst:402 msgid "Reference Count Details" msgstr "參照計數詳細資訊" -#: ../../c-api/intro.rst:372 +#: ../../c-api/intro.rst:404 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -607,24 +646,24 @@ msgid "" "shared). \"Owning a reference\" means being responsible for calling " "Py_DECREF on it when the reference is no longer needed. Ownership can also " "be transferred, meaning that the code that receives ownership of the " -"reference then becomes responsible for eventually releasing it by " -"calling :c:func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer " -"needed---or passing on this responsibility (usually to its caller). When a " -"function passes ownership of a reference on to its caller, the caller is " -"said to receive a *new* reference. When no ownership is transferred, the " -"caller is said to *borrow* the reference. Nothing needs to be done for " -"a :term:`borrowed reference`." +"reference then becomes responsible for eventually releasing it by calling :c:" +"func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer needed---or " +"passing on this responsibility (usually to its caller). When a function " +"passes ownership of a reference on to its caller, the caller is said to " +"receive a *new* reference. When no ownership is transferred, the caller is " +"said to *borrow* the reference. Nothing needs to be done for a :term:" +"`borrowed reference`." msgstr "" "Python/C API 中函式的參照計數行為最好用\\ *參照的所有權*\\ 來解釋。所有權附屬" "於參照而非物件(物件並非被擁有,它們總是共享的)。「擁有參照」意味著當不再需" "要該參照時,負責在其上呼叫 Py_DECREF。所有權也可以轉移,這意味著接收參照所有" -"權的程式碼最終會負責在不需要參照時透過呼叫 :c:func:`Py_DECREF` " -"或 :c:func:`Py_XDECREF` 釋放參照 --- 或者將這個責任再傳遞出去(通常是給它的呼" -"叫者)。當一個函式將參照的所有權傳遞給它的呼叫者時,呼叫者被稱為接收到一個\\ " -"*新*\\ 參照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是" -"\\ :term:`借用參照 `\\ 就不需要做任何事情。" +"權的程式碼最終會負責在不需要參照時透過呼叫 :c:func:`Py_DECREF` 或 :c:func:" +"`Py_XDECREF` 釋放參照 --- 或者將這個責任再傳遞出去(通常是給它的呼叫者)。當" +"一個函式將參照的所有權傳遞給它的呼叫者時,呼叫者被稱為接收到一個\\ *新*\\ 參" +"照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是\\ :term:`借用參" +"照 `\\ 就不需要做任何事情。" -#: ../../c-api/intro.rst:385 +#: ../../c-api/intro.rst:417 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " @@ -636,24 +675,24 @@ msgstr "" "物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定" "它現在擁有該參照,並且你不再對它負責。" -#: ../../c-api/intro.rst:395 +#: ../../c-api/intro.rst:427 msgid "" -"Few functions steal references; the two notable exceptions " -"are :c:func:`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a " -"reference to the item (but not to the tuple or list into which the item is " -"put!). These functions were designed to steal a reference because of a " -"common idiom for populating a tuple or list with newly created objects; for " -"example, the code to create the tuple ``(1, 2, \"three\")`` could look like " -"this (forgetting about error handling for the moment; a better way to code " -"this is shown below)::" +"Few functions steal references; the two notable exceptions are :c:func:" +"`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " +"the item (but not to the tuple or list into which the item is put!). These " +"functions were designed to steal a reference because of a common idiom for " +"populating a tuple or list with newly created objects; for example, the code " +"to create the tuple ``(1, 2, \"three\")`` could look like this (forgetting " +"about error handling for the moment; a better way to code this is shown " +"below)::" msgstr "" -"很少有函式會竊取參照;兩個值得注意的例外是 :c:func:`PyList_SetItem` " -"和 :c:func:`PyTuple_SetItem`,它們竊取了對項目的參照(但不是對項目所在的 " -"tuple 或 list 的參照!)。因為有著使用新建立的物件來增加 (populate) tuple 或 " -"list 的習慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的" -"程式碼可以如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):" +"很少有函式會竊取參照;兩個值得注意的例外是 :c:func:`PyList_SetItem` 和 :c:" +"func:`PyTuple_SetItem`,它們竊取了對項目的參照(但不是對項目所在的 tuple 或 " +"list 的參照!)。因為有著使用新建立的物件來增加 (populate) tuple 或 list 的習" +"慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以" +"如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):" -#: ../../c-api/intro.rst:403 +#: ../../c-api/intro.rst:435 msgid "" "PyObject *t;\n" "\n" @@ -669,52 +708,51 @@ msgstr "" "PyTuple_SetItem(t, 1, PyLong_FromLong(2L));\n" "PyTuple_SetItem(t, 2, PyUnicode_FromString(\"three\"));" -#: ../../c-api/intro.rst:410 +#: ../../c-api/intro.rst:442 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " "stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object " "although the reference to it will be stolen, use :c:func:`Py_INCREF` to grab " "another reference before calling the reference-stealing function." msgstr "" -"這裡 :c:func:`PyLong_FromLong` 會回傳一個新的參照,它立即" -"被 :c:func:`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將" -"被竊取,請在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來取得另一個參照。" +"這裡 :c:func:`PyLong_FromLong` 會回傳一個新的參照,它立即被 :c:func:" +"`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將被竊取,請" +"在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來取得另一個參照。" -#: ../../c-api/intro.rst:415 +#: ../../c-api/intro.rst:447 msgid "" "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " "items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to " -"do this since tuples are an immutable data type. You should only " -"use :c:func:`PyTuple_SetItem` for tuples that you are creating yourself." +"do this since tuples are an immutable data type. You should only use :c:" +"func:`PyTuple_SetItem` for tuples that you are creating yourself." msgstr "" -"附帶地說,:c:func:`PyTuple_SetItem` 是設定 tuple 項目的\\ *唯一*\\ 方" -"法; :c:func:`PySequence_SetItem` 和 :c:func:`PyObject_SetItem` 拒絕這樣做," -"因為 tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple " -"使用 :c:func:`PyTuple_SetItem`。" +"附帶地說,:c:func:`PyTuple_SetItem` 是設定 tuple 項目的\\ *唯一*\\ 方法; :c:" +"func:`PySequence_SetItem` 和 :c:func:`PyObject_SetItem` 拒絕這樣做,因為 " +"tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple 使" +"用 :c:func:`PyTuple_SetItem`。" -#: ../../c-api/intro.rst:420 +#: ../../c-api/intro.rst:452 msgid "" -"Equivalent code for populating a list can be written " -"using :c:func:`PyList_New` and :c:func:`PyList_SetItem`." +"Equivalent code for populating a list can be written using :c:func:" +"`PyList_New` and :c:func:`PyList_SetItem`." msgstr "" "可以使用 :c:func:`PyList_New` 和 :c:func:`PyList_SetItem` 編寫用於填充列表的" "等效程式碼。" -#: ../../c-api/intro.rst:423 +#: ../../c-api/intro.rst:455 msgid "" "However, in practice, you will rarely use these ways of creating and " -"populating a tuple or list. There's a generic " -"function, :c:func:`Py_BuildValue`, that can create most common objects from " -"C values, directed by a :dfn:`format string`. For example, the above two " -"blocks of code could be replaced by the following (which also takes care of " -"the error checking)::" +"populating a tuple or list. There's a generic function, :c:func:" +"`Py_BuildValue`, that can create most common objects from C values, directed " +"by a :dfn:`format string`. For example, the above two blocks of code could " +"be replaced by the following (which also takes care of the error checking)::" msgstr "" "但是在實際操作中你很少會使用這些方法來建立和增加 tuple 和 list。有一個通用函" "式 :c:func:`Py_BuildValue` 可以從 C 值建立最常見的物件,由 :dfn:`format " "string` 引導。例如上面的兩個程式碼可以用以下程式碼替換(它還負責了錯誤檢" "查): ::" -#: ../../c-api/intro.rst:429 +#: ../../c-api/intro.rst:461 msgid "" "PyObject *tuple, *list;\n" "\n" @@ -726,7 +764,7 @@ msgstr "" "tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n" "list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");" -#: ../../c-api/intro.rst:434 +#: ../../c-api/intro.rst:466 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " "items whose references you are only borrowing, like arguments that were " @@ -741,7 +779,7 @@ msgstr "" "穩健,因為你不取得新的一個參照就可以放棄參照(「讓它被竊取」)。例如,此函式" "將 list(實際上是任何可變序列)的所有項目設定於給定項目:" -#: ../../c-api/intro.rst:441 +#: ../../c-api/intro.rst:473 msgid "" "int\n" "set_all(PyObject *target, PyObject *item)\n" @@ -785,7 +823,7 @@ msgstr "" " return 0;\n" "}" -#: ../../c-api/intro.rst:464 +#: ../../c-api/intro.rst:496 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -803,7 +841,7 @@ msgstr "" "照的通用函式,如 :c:func:`PyObject_GetItem` 和 :c:func:`PySequence_GetItem`," "總是回傳一個新的參照(呼叫者成為參照的所有者)。" -#: ../../c-api/intro.rst:473 +#: ../../c-api/intro.rst:505 msgid "" "It is important to realize that whether you own a reference returned by a " "function depends on which function you call only --- *the plumage* (the type " @@ -819,16 +857,16 @@ msgstr "" "如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中取得相同的項目(且恰好" "使用完全相同的引數),你確實會擁有對回傳物件的參照。" -#: ../../c-api/intro.rst:485 +#: ../../c-api/intro.rst:517 msgid "" "Here is an example of how you could write a function that computes the sum " "of the items in a list of integers; once using :c:func:`PyList_GetItem`, " "and once using :c:func:`PySequence_GetItem`. ::" msgstr "" -"以下是一個範例,說明如何編寫函式來計算一個整數 list 中項目的總和;一次使" -"用 :c:func:`PyList_GetItem`,一次使用 :c:func:`PySequence_GetItem`: ::" +"以下是一個範例,說明如何編寫函式來計算一個整數 list 中項目的總和;一次使用 :" +"c:func:`PyList_GetItem`,一次使用 :c:func:`PySequence_GetItem`: ::" -#: ../../c-api/intro.rst:489 +#: ../../c-api/intro.rst:521 msgid "" "long\n" "sum_list(PyObject *list)\n" @@ -853,7 +891,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/intro.rst:515 +#: ../../c-api/intro.rst:547 msgid "" "long\n" "sum_sequence(PyObject *sequence)\n" @@ -884,26 +922,26 @@ msgid "" "}" msgstr "" -#: ../../c-api/intro.rst:549 +#: ../../c-api/intro.rst:581 msgid "Types" msgstr "型別" -#: ../../c-api/intro.rst:551 +#: ../../c-api/intro.rst:583 msgid "" "There are few other data types that play a significant role in the Python/C " -"API; most are simple C types such " -"as :c:expr:`int`, :c:expr:`long`, :c:expr:`double` and :c:expr:`char*`. A " -"few structure types are used to describe static tables used to list the " -"functions exported by a module or the data attributes of a new object type, " -"and another is used to describe the value of a complex number. These will " -"be discussed together with the functions that use them." +"API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" +"`double` and :c:expr:`char*`. A few structure types are used to describe " +"static tables used to list the functions exported by a module or the data " +"attributes of a new object type, and another is used to describe the value " +"of a complex number. These will be discussed together with the functions " +"that use them." msgstr "" "有少數幾個其他的資料型別在 Python/C API 中發揮重要作用;大多數是簡單的 C 型" "別,例如 :c:expr:`int`、:c:expr:`long`、:c:expr:`double` 和 :c:expr:`char*`。" "一些結構型別被用於描述用於列出模組所匯出的函式或新物件型別的資料屬性的靜態" "表,其他則用於描述複數的值。這些將與使用它們的函式一起討論。" -#: ../../c-api/intro.rst:561 +#: ../../c-api/intro.rst:593 msgid "" "A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " "C99 doesn't define such a thing directly (size_t is an unsigned integral " @@ -911,14 +949,14 @@ msgid "" "positive value of type :c:type:`Py_ssize_t`." msgstr "" "一個帶符號的整數型別,使得 ``sizeof(Py_ssize_t) == sizeof(size_t)``。 C99 沒" -"有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參" -"閱 :pep:`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。" +"有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參閱 :pep:" +"`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。" -#: ../../c-api/intro.rst:570 +#: ../../c-api/intro.rst:602 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:572 +#: ../../c-api/intro.rst:604 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -930,7 +968,7 @@ msgstr "" "給呼叫者,然後傳遞給呼叫者的呼叫者,依此類推,直到它們到達頂層直譯器,在那裡" "它們透過堆疊回溯 (stack trace) 回報給使用者。" -#: ../../c-api/intro.rst:580 +#: ../../c-api/intro.rst:612 msgid "" "For C programmers, however, error checking always has to be explicit. All " "functions in the Python/C API can raise exceptions, unless an explicit claim " @@ -952,36 +990,36 @@ msgstr "" "確的錯誤指示器或者有不明確的回傳值,而需要使用 :c:func:`PyErr_Occurred` 明確" "測試錯誤。這些例外都會被明確地記錄於文件。" -#: ../../c-api/intro.rst:595 +#: ../../c-api/intro.rst:627 msgid "" "Exception state is maintained in per-thread storage (this is equivalent to " "using global storage in an unthreaded application). A thread can be in one " -"of two states: an exception has occurred, or not. The " -"function :c:func:`PyErr_Occurred` can be used to check for this: it returns " -"a borrowed reference to the exception type object when an exception has " -"occurred, and ``NULL`` otherwise. There are a number of functions to set " -"the exception state: :c:func:`PyErr_SetString` is the most common (though " -"not the most general) function to set the exception state, " -"and :c:func:`PyErr_Clear` clears the exception state." +"of two states: an exception has occurred, or not. The function :c:func:" +"`PyErr_Occurred` can be used to check for this: it returns a borrowed " +"reference to the exception type object when an exception has occurred, and " +"``NULL`` otherwise. There are a number of functions to set the exception " +"state: :c:func:`PyErr_SetString` is the most common (though not the most " +"general) function to set the exception state, and :c:func:`PyErr_Clear` " +"clears the exception state." msgstr "" "例外的狀態會在個別執行緒的儲存空間 (per-thread storage) 中維護(這相當於在非" "執行緒應用程式中使用全域儲存空間)。執行緒可以處於兩種狀態之一:發生例外或未" "發生例外。函式 :c:func:`PyErr_Occurred` 可用於檢查這一點:當例外發生時,它回" -"傳對例外型別物件的借用參照,否則回傳 ``NULL``。設定例外狀態的函式有很" -"多::c:func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函" -"式,而 :c:func:`PyErr_Clear` 是用來清除例外狀態。" +"傳對例外型別物件的借用參照,否則回傳 ``NULL``。設定例外狀態的函式有很多::c:" +"func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :" +"c:func:`PyErr_Clear` 是用來清除例外狀態。" -#: ../../c-api/intro.rst:605 +#: ../../c-api/intro.rst:637 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " -"traceback. These have the same meanings as the Python result of " -"``sys.exc_info()``; however, they are not the same: the Python objects " -"represent the last exception being handled by a " -"Python :keyword:`try` ... :keyword:`except` statement, while the C level " -"exception state only exists while an exception is being passed on between C " -"functions until it reaches the Python bytecode interpreter's main loop, " -"which takes care of transferring it to ``sys.exc_info()`` and friends." +"traceback. These have the same meanings as the Python result of ``sys." +"exc_info()``; however, they are not the same: the Python objects represent " +"the last exception being handled by a Python :keyword:`try` ... :keyword:" +"`except` statement, while the C level exception state only exists while an " +"exception is being passed on between C functions until it reaches the Python " +"bytecode interpreter's main loop, which takes care of transferring it to " +"``sys.exc_info()`` and friends." msgstr "" "完整的例外狀態由三個(都可以為 ``NULL`` 的)物件組成:例外型別、對應的例外值" "和回溯。這些與 ``sys.exc_info()`` 的 Python 結果具有相同的含義;但是它們並不" @@ -990,18 +1028,18 @@ msgstr "" "達 Python 位元組碼直譯器的主迴圈,該迴圈負責將它傳遞給 ``sys.exc_info()`` 和" "其系列函式。" -#: ../../c-api/intro.rst:617 +#: ../../c-api/intro.rst:649 msgid "" "Note that starting with Python 1.5, the preferred, thread-safe way to access " -"the exception state from Python code is to call the " -"function :func:`sys.exc_info`, which returns the per-thread exception state " -"for Python code. Also, the semantics of both ways to access the exception " -"state have changed so that a function which catches an exception will save " -"and restore its thread's exception state so as to preserve the exception " -"state of its caller. This prevents common bugs in exception handling code " -"caused by an innocent-looking function overwriting the exception being " -"handled; it also reduces the often unwanted lifetime extension for objects " -"that are referenced by the stack frames in the traceback." +"the exception state from Python code is to call the function :func:`sys." +"exc_info`, which returns the per-thread exception state for Python code. " +"Also, the semantics of both ways to access the exception state have changed " +"so that a function which catches an exception will save and restore its " +"thread's exception state so as to preserve the exception state of its " +"caller. This prevents common bugs in exception handling code caused by an " +"innocent-looking function overwriting the exception being handled; it also " +"reduces the often unwanted lifetime extension for objects that are " +"referenced by the stack frames in the traceback." msgstr "" "請注意,從 Python 1.5 開始,從 Python 程式碼存取例外狀態的首選且支援執行緒安" "全的方法是呼叫 :func:`sys.exc_info` 函式,它回傳 Python 程式碼的個別執行緒例" @@ -1010,7 +1048,7 @@ msgstr "" "式碼中的常見錯誤,這些錯誤是由看似無辜的函式覆蓋了正在處理的例外而引起的;它" "還替回溯中被堆疊框 (stack frame) 參照的物件減少了通常不需要的生命週期延長。" -#: ../../c-api/intro.rst:628 +#: ../../c-api/intro.rst:660 msgid "" "As a general principle, a function that calls another function to perform " "some task should check whether the called function raised an exception, and " @@ -1025,7 +1063,7 @@ msgstr "" "並回傳一個錯誤指示符,但它\\ *不應該*\\ 設定另一個例外 --- 這將覆蓋剛剛引發的" "例外,並丟失關於錯誤確切原因的重要資訊。" -#: ../../c-api/intro.rst:637 +#: ../../c-api/intro.rst:669 msgid "" "A simple example of detecting exceptions and passing them on is shown in " "the :c:func:`!sum_sequence` example above. It so happens that this example " @@ -1037,7 +1075,7 @@ msgstr "" "巧這個例子在檢測到錯誤時不需要清理任何擁有的參照。以下範例函式展示了一些錯誤" "清理。首先,為了提醒你為什麼喜歡 Python,我們展示了等效的 Python 程式碼: ::" -#: ../../c-api/intro.rst:643 +#: ../../c-api/intro.rst:675 msgid "" "def incr_item(dict, key):\n" " try:\n" @@ -1053,11 +1091,11 @@ msgstr "" " item = 0\n" " dict[key] = item + 1" -#: ../../c-api/intro.rst:652 +#: ../../c-api/intro.rst:684 msgid "Here is the corresponding C code, in all its glory::" msgstr "這是相應的 C 程式碼:" -#: ../../c-api/intro.rst:654 +#: ../../c-api/intro.rst:686 msgid "" "int\n" "incr_item(PyObject *dict, PyObject *key)\n" @@ -1103,31 +1141,30 @@ msgid "" "}" msgstr "" -#: ../../c-api/intro.rst:704 +#: ../../c-api/intro.rst:736 msgid "" "This example represents an endorsed use of the ``goto`` statement in C! It " -"illustrates the use of :c:func:`PyErr_ExceptionMatches` " -"and :c:func:`PyErr_Clear` to handle specific exceptions, and the use " -"of :c:func:`Py_XDECREF` to dispose of owned references that may be ``NULL`` " -"(note the ``'X'`` in the name; :c:func:`Py_DECREF` would crash when " -"confronted with a ``NULL`` reference). It is important that the variables " -"used to hold owned references are initialized to ``NULL`` for this to work; " -"likewise, the proposed return value is initialized to ``-1`` (failure) and " -"only set to success after the final call made is successful." -msgstr "" -"這個例子代表了在 C 語言中對使用 ``goto`` 陳述句的認同!它闡述了" -"以 :c:func:`PyErr_ExceptionMatches` 和 :c:func:`PyErr_Clear` 來處理特定的例" -"外,以及以 :c:func:`Py_XDECREF` 來配置其所擁有且可能為 ``NULL`` 的參照(注意" -"名稱中的 ``'X'``\\ ;:c:func:`Py_DECREF` 在遇到 ``NULL`` 參照時會崩潰)。重要" -"的是,用於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣" -"地,回傳值被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成" -"功。" - -#: ../../c-api/intro.rst:718 +"illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:" +"`PyErr_Clear` to handle specific exceptions, and the use of :c:func:" +"`Py_XDECREF` to dispose of owned references that may be ``NULL`` (note the " +"``'X'`` in the name; :c:func:`Py_DECREF` would crash when confronted with a " +"``NULL`` reference). It is important that the variables used to hold owned " +"references are initialized to ``NULL`` for this to work; likewise, the " +"proposed return value is initialized to ``-1`` (failure) and only set to " +"success after the final call made is successful." +msgstr "" +"這個例子代表了在 C 語言中對使用 ``goto`` 陳述句的認同!它闡述了以 :c:func:" +"`PyErr_ExceptionMatches` 和 :c:func:`PyErr_Clear` 來處理特定的例外,以及以 :" +"c:func:`Py_XDECREF` 來配置其所擁有且可能為 ``NULL`` 的參照(注意名稱中的 " +"``'X'``\\ ;:c:func:`Py_DECREF` 在遇到 ``NULL`` 參照時會崩潰)。重要的是,用" +"於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣地,回傳值" +"被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成功。" + +#: ../../c-api/intro.rst:750 msgid "Embedding Python" msgstr "嵌入式Python" -#: ../../c-api/intro.rst:720 +#: ../../c-api/intro.rst:752 msgid "" "The one important task that only embedders (as opposed to extension writers) " "of the Python interpreter have to worry about is the initialization, and " @@ -1137,7 +1174,7 @@ msgstr "" "只有 Python 直譯器的嵌入者(而不是擴充編寫者)需要擔心的一項重要任務是 " "Python 直譯器的初始化與完成階段。直譯器的大部分功能只能在直譯器初始化後使用。" -#: ../../c-api/intro.rst:733 +#: ../../c-api/intro.rst:765 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -1148,20 +1185,19 @@ msgstr "" "立基礎模組 :mod:`builtins`、:mod:`__main__` 和 :mod:`sys`。它還會初始化模組搜" "索路徑 (``sys.path``)。" -#: ../../c-api/intro.rst:738 +#: ../../c-api/intro.rst:770 msgid "" -":c:func:`Py_Initialize` does not set the \"script argument list\" " -"(``sys.argv``). If this variable is needed by Python code that will be " -"executed later, setting :c:member:`PyConfig.argv` " -"and :c:member:`PyConfig.parse_argv` must be set: see :ref:`Python " -"Initialization Configuration `." +":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys." +"argv``). If this variable is needed by Python code that will be executed " +"later, setting :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` " +"must be set: see :ref:`Python Initialization Configuration `." msgstr "" -":c:func:`Py_Initialize` 不設定「腳本引數列表 (script argument list)」 " -"(``sys.argv``)。如果稍後將要執行的 Python 程式碼需要此變數,則必須設" -"定 :c:member:`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請" -"見 :ref:`Python 初始化配置 `。" +":c:func:`Py_Initialize` 不設定「腳本引數列表 (script argument list)」 (``sys." +"argv``)。如果稍後將要執行的 Python 程式碼需要此變數,則必須設定 :c:member:" +"`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請見 :ref:`Python 初始化" +"配置 `。" -#: ../../c-api/intro.rst:743 +#: ../../c-api/intro.rst:775 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -1172,75 +1208,73 @@ msgid "" "to the parent directory where the executable named :file:`python` is found " "on the shell command search path (the environment variable :envvar:`PATH`)." msgstr "" -"在大多數系統上(特別是在 Unix 和 Windows 上,儘管細節略有不" -"同),:c:func:`Py_Initialize` 會假設Python 函式庫相對於 Python 直譯器可執行檔" -"案的位置固定,並根據其對標準 Python 直譯器可執行檔案位置的最佳猜測來計算模組" -"搜尋路徑。或者更詳細地說,它會在 shell 命令搜尋路徑(環境變" -"數 :envvar:`PATH`)中找到名為 :file:`python` 的可執行檔案,並在其父目錄中查找" -"一個名為 :file:`lib/python{X.Y}` 的目錄的相對位置。" +"在大多數系統上(特別是在 Unix 和 Windows 上,儘管細節略有不同),:c:func:" +"`Py_Initialize` 會假設Python 函式庫相對於 Python 直譯器可執行檔案的位置固定," +"並根據其對標準 Python 直譯器可執行檔案位置的最佳猜測來計算模組搜尋路徑。或者" +"更詳細地說,它會在 shell 命令搜尋路徑(環境變數 :envvar:`PATH`)中找到名為 :" +"file:`python` 的可執行檔案,並在其父目錄中查找一個名為 :file:`lib/python{X.Y}" +"` 的目錄的相對位置。" -#: ../../c-api/intro.rst:752 +#: ../../c-api/intro.rst:784 msgid "" "For instance, if the Python executable is found in :file:`/usr/local/bin/" "python`, it will assume that the libraries are in :file:`/usr/local/lib/" "python{X.Y}`. (In fact, this particular path is also the \"fallback\" " -"location, used when no executable file named :file:`python` is found " -"along :envvar:`PATH`.) The user can override this behavior by setting the " +"location, used when no executable file named :file:`python` is found along :" +"envvar:`PATH`.) The user can override this behavior by setting the " "environment variable :envvar:`PYTHONHOME`, or insert additional directories " "in front of the standard path by setting :envvar:`PYTHONPATH`." msgstr "" "例如,如果在 :file:`/usr/local/bin/python` 中找到 Python 可執行檔案,它將假定" "函式庫位於 :file:`/usr/local/lib/python{X.Y}` 中。(事實上這個特定的路徑也是" "「後備 (fallback)」位置,當在 :envvar:`PATH` 中找不到名為 :file:`python` 的可" -"執行檔案時使用。)使用者可以透過設定環境變數來覆蓋此行" -"為 :envvar:`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入" -"額外的目錄。" - -#: ../../c-api/intro.rst:766 -msgid "" -"The embedding application can steer the search by " -"setting :c:member:`PyConfig.program_name` *before* " -"calling :c:func:`Py_InitializeFromConfig`. Note that :envvar:`PYTHONHOME` " -"still overrides this and :envvar:`PYTHONPATH` is still inserted in front of " -"the standard path. An application that requires total control has to " -"provide its own implementation " -"of :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, " -"and :c:func:`Py_GetProgramFullPath` (all defined in :file:`Modules/" -"getpath.c`)." +"執行檔案時使用。)使用者可以透過設定環境變數來覆蓋此行為 :envvar:" +"`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入額外的目" +"錄。" + +#: ../../c-api/intro.rst:798 +msgid "" +"The embedding application can steer the search by setting :c:member:" +"`PyConfig.program_name` *before* calling :c:func:`Py_InitializeFromConfig`. " +"Note that :envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` " +"is still inserted in front of the standard path. An application that " +"requires total control has to provide its own implementation of :c:func:" +"`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, and :c:" +"func:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`)." msgstr "" "嵌入的應用程式可以透過在呼叫 :c:func:`Py_InitializeFromConfig` *之前*\\ 設" "定 :c:member:`PyConfig.program_name` 來引導搜尋。請注意 :envvar:`PYTHONHOME` " "仍然覆蓋它並且 :envvar:`PYTHONPATH` 仍然插入在標準路徑的前面。需要完全控制權" -"的應用程式必須實作自己" -"的 :c:func:`Py_GetPath`、:c:func:`Py_GetPrefix`、:c:func:`Py_GetExecPrefix` " -"和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :file:`Modules/getpath.c`)。" +"的應用程式必須實作自己的 :c:func:`Py_GetPath`、:c:func:`Py_GetPrefix`、:c:" +"func:`Py_GetExecPrefix` 和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :" +"file:`Modules/getpath.c`)。" -#: ../../c-api/intro.rst:777 +#: ../../c-api/intro.rst:809 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " -"application may want to start over (make another call " -"to :c:func:`Py_Initialize`) or the application is simply done with its use " -"of Python and wants to free memory allocated by Python. This can be " -"accomplished by calling :c:func:`Py_FinalizeEx`. The " -"function :c:func:`Py_IsInitialized` returns true if Python is currently in " -"the initialized state. More information about these functions is given in a " -"later chapter. Notice that :c:func:`Py_FinalizeEx` does *not* free all " -"memory allocated by the Python interpreter, e.g. memory allocated by " -"extension modules currently cannot be released." +"application may want to start over (make another call to :c:func:" +"`Py_Initialize`) or the application is simply done with its use of Python " +"and wants to free memory allocated by Python. This can be accomplished by " +"calling :c:func:`Py_FinalizeEx`. The function :c:func:`Py_IsInitialized` " +"returns true if Python is currently in the initialized state. More " +"information about these functions is given in a later chapter. Notice that :" +"c:func:`Py_FinalizeEx` does *not* free all memory allocated by the Python " +"interpreter, e.g. memory allocated by extension modules currently cannot be " +"released." msgstr "" "有時會希望能夠「取消初始化 (uninitialize)」Python。例如,應用程式可能想要重新" "開始(再次呼叫 :c:func:`Py_Initialize`)或者應用程式簡單地完成了對 Python 的" "使用並想要釋放 Python 分配的記憶體。這可以透過呼叫 :c:func:`Py_FinalizeEx` 來" "完成。如果 Python 目前處於初始化狀態,函式 :c:func:`Py_IsInitialized` 會回傳 " -"true。有關這些功能的更多資訊將在後面的章節中給出。請注" -"意 :c:func:`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例" -"如目前無法釋放被擴充模組所分配的記憶體。" +"true。有關這些功能的更多資訊將在後面的章節中給出。請注意 :c:func:" +"`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例如目前無法釋" +"放被擴充模組所分配的記憶體。" -#: ../../c-api/intro.rst:791 +#: ../../c-api/intro.rst:823 msgid "Debugging Builds" msgstr "除錯建置" -#: ../../c-api/intro.rst:793 +#: ../../c-api/intro.rst:825 msgid "" "Python can be built with several macros to enable extra checks of the " "interpreter and extension modules. These checks tend to add a large amount " @@ -1249,36 +1283,36 @@ msgstr "" "Python 可以在建置時使用多個巨集來啟用對直譯器和擴充模組的額外檢查,這些檢查往" "往會在執行環境 (runtime) 增加大量開銷 (overhead),因此預設情況下不啟用它們。" -#: ../../c-api/intro.rst:797 +#: ../../c-api/intro.rst:829 msgid "" -"A full list of the various types of debugging builds is in the " -"file :file:`Misc/SpecialBuilds.txt` in the Python source distribution. " -"Builds are available that support tracing of reference counts, debugging the " -"memory allocator, or low-level profiling of the main interpreter loop. Only " -"the most frequently used builds will be described in the remainder of this " +"A full list of the various types of debugging builds is in the file :file:" +"`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are " +"available that support tracing of reference counts, debugging the memory " +"allocator, or low-level profiling of the main interpreter loop. Only the " +"most frequently used builds will be described in the remainder of this " "section." msgstr "" "Python 原始碼發佈版本中的 :file:`Misc/SpecialBuilds.txt` 檔案有一份包含多種除" "錯構置的完整列表,為支援追蹤參照計數、為記憶體分配器除錯或對主直譯器迴圈進行" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" -#: ../../c-api/intro.rst:805 +#: ../../c-api/intro.rst:837 msgid "" "Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `. :c:macro:`!Py_DEBUG` is enabled in the Unix build by " -"adding :option:`--with-pydebug` to the :file:`./configure` command. It is " -"also implied by the presence of the not-Python-specific :c:macro:`!_DEBUG` " -"macro. When :c:macro:`!Py_DEBUG` is enabled in the Unix build, compiler " -"optimization is disabled." +"build>`. :c:macro:`!Py_DEBUG` is enabled in the Unix build by adding :option:" +"`--with-pydebug` to the :file:`./configure` command. It is also implied by " +"the presence of the not-Python-specific :c:macro:`!_DEBUG` macro. When :c:" +"macro:`!Py_DEBUG` is enabled in the Unix build, compiler optimization is " +"disabled." msgstr "" "使用定義的 :c:macro:`!Py_DEBUG` 巨集編譯直譯器會生成 :ref:`Python 的除錯建置 " "`。 :c:macro:`!Py_DEBUG` 在 Unix 建置中要透過在 :file:`./" -"configure` 命令中加入 :option:`--with-pydebug` 來啟用。非 Python 限定" -"的 :c:macro:`!_DEBUG` 巨集的存在也暗示了這一點。當 :c:macro:`!Py_DEBUG` 在 " -"Unix 建置中啟用時,編譯器最佳化會被禁用。" +"configure` 命令中加入 :option:`--with-pydebug` 來啟用。非 Python 限定的 :c:" +"macro:`!_DEBUG` 巨集的存在也暗示了這一點。當 :c:macro:`!Py_DEBUG` 在 Unix 建" +"置中啟用時,編譯器最佳化會被禁用。" -#: ../../c-api/intro.rst:813 +#: ../../c-api/intro.rst:845 msgid "" "In addition to the reference count debugging described below, extra checks " "are performed, see :ref:`Python Debug Build `." @@ -1286,72 +1320,72 @@ msgstr "" "除了下面描述的參照計數除錯之外,還會執行額外的檢查,請參閱 :ref:`Python 除錯" "建置 `。" -#: ../../c-api/intro.rst:816 +#: ../../c-api/intro.rst:848 msgid "" -"Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see " -"the :option:`configure --with-trace-refs option <--with-trace-refs>`). When " -"defined, a circular doubly linked list of active objects is maintained by " -"adding two extra fields to every :c:type:`PyObject`. Total allocations are " -"tracked as well. Upon exit, all existing references are printed. (In " -"interactive mode this happens after every statement run by the interpreter.)" +"Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" +"`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " +"circular doubly linked list of active objects is maintained by adding two " +"extra fields to every :c:type:`PyObject`. Total allocations are tracked as " +"well. Upon exit, all existing references are printed. (In interactive mode " +"this happens after every statement run by the interpreter.)" msgstr "" "定義 :c:macro:`Py_TRACE_REFS` 來啟用參照追蹤(參見\\ :option:`設定 --with-" -"trace-refs 選項 <--with-trace-refs>`)。當有定義時,透過向每" -"個 :c:type:`PyObject` 新增兩個額外欄位來維護有效物件的循環雙向鍊表 (circular " -"doubly linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模" -"式下,這發生在直譯器運行的每個陳述句之後。)" +"trace-refs 選項 <--with-trace-refs>`)。當有定義時,透過向每個 :c:type:" +"`PyObject` 新增兩個額外欄位來維護有效物件的循環雙向鍊表 (circular doubly " +"linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下," +"這發生在直譯器運行的每個陳述句之後。)" -#: ../../c-api/intro.rst:823 +#: ../../c-api/intro.rst:855 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." msgstr "" -"有關更多詳細資訊,請參閱 Python 原始碼發布版中的 :file:`Misc/" -"SpecialBuilds.txt`。" +"有關更多詳細資訊,請參閱 Python 原始碼發布版中的 :file:`Misc/SpecialBuilds." +"txt`。" -#: ../../c-api/intro.rst:830 +#: ../../c-api/intro.rst:862 msgid "Recommended third party tools" msgstr "" -#: ../../c-api/intro.rst:832 +#: ../../c-api/intro.rst:864 msgid "" "The following third party tools offer both simpler and more sophisticated " "approaches to creating C, C++ and Rust extensions for Python:" msgstr "" -#: ../../c-api/intro.rst:835 +#: ../../c-api/intro.rst:867 msgid "`Cython `_" msgstr "" -#: ../../c-api/intro.rst:836 +#: ../../c-api/intro.rst:868 msgid "`cffi `_" msgstr "" -#: ../../c-api/intro.rst:837 +#: ../../c-api/intro.rst:869 msgid "`HPy `_" msgstr "" -#: ../../c-api/intro.rst:838 +#: ../../c-api/intro.rst:870 msgid "`nanobind `_ (C++)" msgstr "" -#: ../../c-api/intro.rst:839 +#: ../../c-api/intro.rst:871 msgid "`Numba `_" msgstr "" -#: ../../c-api/intro.rst:840 +#: ../../c-api/intro.rst:872 msgid "`pybind11 `_ (C++)" msgstr "" -#: ../../c-api/intro.rst:841 +#: ../../c-api/intro.rst:873 msgid "`PyO3 `_ (Rust)" msgstr "" -#: ../../c-api/intro.rst:842 +#: ../../c-api/intro.rst:874 msgid "`SWIG `_" msgstr "" -#: ../../c-api/intro.rst:844 +#: ../../c-api/intro.rst:876 msgid "" "Using tools such as these can help avoid writing code that is tightly bound " "to a particular version of CPython, avoid reference counting errors, and " @@ -1362,7 +1396,7 @@ msgid "" "sources." msgstr "" -#: ../../c-api/intro.rst:851 +#: ../../c-api/intro.rst:883 msgid "" "These projects are not supported by the same people who maintain Python, and " "issues need to be raised with the projects directly. Remember to check that " @@ -1370,140 +1404,140 @@ msgid "" "outdated." msgstr "" -#: ../../c-api/intro.rst:858 +#: ../../c-api/intro.rst:890 msgid "" -"`Python Packaging User Guide: Binary Extensions `_" +"`Python Packaging User Guide: Binary Extensions `_" msgstr "" -#: ../../c-api/intro.rst:859 +#: ../../c-api/intro.rst:891 msgid "" "The Python Packaging User Guide not only covers several available tools that " "simplify the creation of binary extensions, but also discusses the various " "reasons why creating an extension module may be desirable in the first place." msgstr "" -#: ../../c-api/intro.rst:276 +#: ../../c-api/intro.rst:308 msgid "object" msgstr "object(物件)" -#: ../../c-api/intro.rst:276 +#: ../../c-api/intro.rst:308 msgid "type" msgstr "type(型別)" -#: ../../c-api/intro.rst:315 +#: ../../c-api/intro.rst:347 msgid "Py_INCREF (C function)" msgstr "Py_INCREF(C 函式)" -#: ../../c-api/intro.rst:315 +#: ../../c-api/intro.rst:347 msgid "Py_DECREF (C function)" msgstr "Py_DECREF(C 函式)" -#: ../../c-api/intro.rst:391 +#: ../../c-api/intro.rst:423 msgid "PyList_SetItem (C function)" msgstr "PyList_SetItem(C 函式)" -#: ../../c-api/intro.rst:391 +#: ../../c-api/intro.rst:423 msgid "PyTuple_SetItem (C function)" msgstr "PyTuple_SetItem(C 函式)" -#: ../../c-api/intro.rst:462 +#: ../../c-api/intro.rst:494 msgid "set_all()" msgstr "set_all()" -#: ../../c-api/intro.rst:481 +#: ../../c-api/intro.rst:513 msgid "PyList_GetItem (C function)" msgstr "PyList_GetItem(C 函式)" -#: ../../c-api/intro.rst:481 +#: ../../c-api/intro.rst:513 msgid "PySequence_GetItem (C function)" msgstr "PySequence_GetItem(C 函式)" -#: ../../c-api/intro.rst:511 +#: ../../c-api/intro.rst:543 msgid "sum_list()" msgstr "sum_list()" -#: ../../c-api/intro.rst:543 ../../c-api/intro.rst:635 +#: ../../c-api/intro.rst:575 ../../c-api/intro.rst:667 msgid "sum_sequence()" msgstr "sum_sequence()" -#: ../../c-api/intro.rst:578 +#: ../../c-api/intro.rst:610 msgid "PyErr_Occurred (C function)" msgstr "PyErr_Occurred(C 函式)" -#: ../../c-api/intro.rst:591 +#: ../../c-api/intro.rst:623 msgid "PyErr_SetString (C function)" msgstr "PyErr_SetString(C 函式)" -#: ../../c-api/intro.rst:591 ../../c-api/intro.rst:699 +#: ../../c-api/intro.rst:623 ../../c-api/intro.rst:731 msgid "PyErr_Clear (C function)" msgstr "PyErr_Clear(C 函式)" -#: ../../c-api/intro.rst:615 +#: ../../c-api/intro.rst:647 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../c-api/intro.rst:650 ../../c-api/intro.rst:697 +#: ../../c-api/intro.rst:682 ../../c-api/intro.rst:729 msgid "incr_item()" msgstr "incr_item()" -#: ../../c-api/intro.rst:699 +#: ../../c-api/intro.rst:731 msgid "PyErr_ExceptionMatches (C function)" msgstr "PyErr_ExceptionMatches(C 函式)" -#: ../../c-api/intro.rst:699 +#: ../../c-api/intro.rst:731 msgid "Py_XDECREF (C function)" msgstr "Py_XDECREF(C 函式)" -#: ../../c-api/intro.rst:725 +#: ../../c-api/intro.rst:757 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/intro.rst:725 +#: ../../c-api/intro.rst:757 msgid "module" msgstr "module(模組)" -#: ../../c-api/intro.rst:725 +#: ../../c-api/intro.rst:757 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/intro.rst:725 +#: ../../c-api/intro.rst:757 msgid "__main__" msgstr "__main__" -#: ../../c-api/intro.rst:725 +#: ../../c-api/intro.rst:757 msgid "sys" msgstr "sys" -#: ../../c-api/intro.rst:725 +#: ../../c-api/intro.rst:757 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/intro.rst:725 +#: ../../c-api/intro.rst:757 msgid "path" msgstr "path(路徑)" -#: ../../c-api/intro.rst:725 +#: ../../c-api/intro.rst:757 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/intro.rst:760 +#: ../../c-api/intro.rst:792 msgid "Py_GetPath (C function)" msgstr "Py_GetPath(C 函式)" -#: ../../c-api/intro.rst:760 +#: ../../c-api/intro.rst:792 msgid "Py_GetPrefix (C function)" msgstr "Py_GetPrefix(C 函式)" -#: ../../c-api/intro.rst:760 +#: ../../c-api/intro.rst:792 msgid "Py_GetExecPrefix (C function)" msgstr "Py_GetExecPrefix(C 函式)" -#: ../../c-api/intro.rst:760 +#: ../../c-api/intro.rst:792 msgid "Py_GetProgramFullPath (C function)" msgstr "Py_GetProgramFullPath(C 函式)" -#: ../../c-api/intro.rst:775 +#: ../../c-api/intro.rst:807 msgid "Py_IsInitialized (C function)" msgstr "Py_IsInitialized(C 函式)" diff --git a/library/json.po b/library/json.po index 604ad4da7c3..786ffdfdb6a 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,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-11-09 00:17+0000\n" "PO-Revision-Date: 2023-08-05 15:25+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,12 +30,12 @@ msgstr "**原始碼:**\\ :source:`Lib/json/__init__.py`" #: ../../library/json.rst:14 msgid "" -"`JSON (JavaScript Object Notation) `_, specified " -"by :rfc:`7159` (which obsoletes :rfc:`4627`) and by `ECMA-404 `_, specified by :rfc:" +"`7159` (which obsoletes :rfc:`4627`) and by `ECMA-404 `_, is a " -"lightweight data interchange format inspired by `JavaScript `_ object literal syntax (although it is " -"not a strict subset of JavaScript [#rfc-errata]_ )." +"lightweight data interchange format inspired by `JavaScript `_ object literal syntax (although it is not a " +"strict subset of JavaScript [#rfc-errata]_ )." msgstr "" "`JSON (JavaScript Object Notation) `_ 是一個輕量化的資料交" "換格式,在 :rfc:`7159`\\ (其廢棄了 :rfc:`4627`\\ )及 `ECMA-404 >> import json\n" ">>> def custom_json(obj):\n" "... if isinstance(obj, complex):\n" -"... return {'__complex__': True, 'real': obj.real, 'imag': " -"obj.imag}\n" +"... return {'__complex__': True, 'real': obj.real, 'imag': obj." +"imag}\n" "... raise TypeError(f'Cannot serialize object of {type(obj)}')\n" "...\n" ">>> json.dumps(1 + 2j, default=custom_json)\n" @@ -161,8 +161,8 @@ msgstr "" ">>> import json\n" ">>> def custom_json(obj):\n" "... if isinstance(obj, complex):\n" -"... return {'__complex__': True, 'real': obj.real, 'imag': " -"obj.imag}\n" +"... return {'__complex__': True, 'real': obj.real, 'imag': obj." +"imag}\n" "... raise TypeError(f'Cannot serialize object of {type(obj)}')\n" "...\n" ">>> json.dumps(1 + 2j, default=custom_json)\n" @@ -303,8 +303,8 @@ msgid "" "conversion table `." msgstr "" "參考這個 :ref:`Python-to-JSON 轉換表 `\\ 將 *obj* 序列化為" -"符合 JSON 格式的串流,並寫入到 *fp* (一個支援 ``.write()`` 方法" -"的 :term:`file-like object`)" +"符合 JSON 格式的串流,並寫入到 *fp* (一個支援 ``.write()`` 方法的 :term:" +"`file-like object`)" # SkyLull: 我想這裡的 "framed protocol" 指的是 # https://peps.python.org/pep-3154/#framing @@ -335,19 +335,21 @@ msgstr "" #: ../../library/json.rst:178 msgid "" -"If ``True``, keys that are not of a basic type " -"(:class:`str`, :class:`int`, :class:`float`, :class:`bool`, ``None``) will " -"be skipped instead of raising a :exc:`TypeError`. Default ``False``." +"If ``True``, keys that are not of a basic type (:class:`str`, :class:`int`, :" +"class:`float`, :class:`bool`, ``None``) will be skipped instead of raising " +"a :exc:`TypeError`. Default ``False``." msgstr "" #: ../../library/json.rst:184 msgid "" "If ``True`` (the default), the output is guaranteed to have all incoming non-" -"ASCII characters escaped. If ``False``, these characters will be outputted " -"as-is." +"ASCII and non-printable characters escaped. If ``False``, all characters " +"will be outputted as-is, except for the characters that must be escaped: " +"quotation mark, reverse solidus, and the control characters U+0000 through " +"U+001F." msgstr "" -#: ../../library/json.rst:189 +#: ../../library/json.rst:191 msgid "" "If ``False``, the circular reference check for container types is skipped " "and a circular reference will result in a :exc:`RecursionError` (or worse). " @@ -357,7 +359,7 @@ msgstr "" "跳過,若有循環參照則最後將引發 :exc:`RecursionError`\\ (或其他更糟的錯誤)。" "預設為 ``True``。" -#: ../../library/json.rst:194 +#: ../../library/json.rst:196 msgid "" "If ``False``, serialization of out-of-range :class:`float` values (``nan``, " "``inf``, ``-inf``) will result in a :exc:`ValueError`, in strict compliance " @@ -369,14 +371,14 @@ msgstr "" "值),則將使用它們的 JavaScript 等效表示 (``NaN``, ``Infinity``, ``-" "Infinity``)。" -#: ../../library/json.rst:201 +#: ../../library/json.rst:203 msgid "" "If set, a custom JSON encoder with the :meth:`~JSONEncoder.default` method " "overridden, for serializing into custom datatypes. If ``None`` (the " "default), :class:`!JSONEncoder` is used." msgstr "" -#: ../../library/json.rst:208 +#: ../../library/json.rst:210 msgid "" "If a positive integer or string, JSON array elements and object members will " "be pretty-printed with that indent level. A positive integer indents that " @@ -385,7 +387,7 @@ msgid "" "inserted. If ``None`` (the default), the most compact representation is used." msgstr "" -#: ../../library/json.rst:218 +#: ../../library/json.rst:220 msgid "" "A two-tuple: ``(item_separator, key_separator)``. If ``None`` (the default), " "*separators* defaults to ``(', ', ': ')`` if *indent* is ``None``, and " @@ -396,42 +398,42 @@ msgstr "" "則 *separators* 被預設為 ``(', ', ': ')``,否則預設為 ``(',', ': ')``。想要獲" "得最緊湊的 JSON 表示形式,你可以指定 ``(',', ':')`` 來消除空格。" -#: ../../library/json.rst:227 +#: ../../library/json.rst:229 msgid "" "A function that is called for objects that can't otherwise be serialized. It " -"should return a JSON encodable version of the object or raise " -"a :exc:`TypeError`. If ``None`` (the default), :exc:`!TypeError` is raised." +"should return a JSON encodable version of the object or raise a :exc:" +"`TypeError`. If ``None`` (the default), :exc:`!TypeError` is raised." msgstr "" -#: ../../library/json.rst:234 +#: ../../library/json.rst:236 msgid "" "If ``True``, dictionaries will be outputted sorted by key. Default ``False``." msgstr "" -#: ../../library/json.rst:238 ../../library/json.rst:523 +#: ../../library/json.rst:240 ../../library/json.rst:527 msgid "Allow strings for *indent* in addition to integers." msgstr "除了整數之外,*indent* 還允許使用字串作為輸入。" -#: ../../library/json.rst:241 ../../library/json.rst:531 +#: ../../library/json.rst:243 ../../library/json.rst:535 msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``." msgstr "如果 *indent* 不是 ``None``,則使用 ``(',', ': ')`` 作為預設值" -#: ../../library/json.rst:244 ../../library/json.rst:343 +#: ../../library/json.rst:246 ../../library/json.rst:345 msgid "" "All optional parameters are now :ref:`keyword-only `." msgstr "" "所有可選參數現在都是\\ :ref:`僅限關鍵字 `\\ 參數了。" -#: ../../library/json.rst:253 +#: ../../library/json.rst:255 msgid "" "Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion " -"table `. The arguments have the same meaning as " -"in :func:`dump`." +"table `. The arguments have the same meaning as in :func:" +"`dump`." msgstr "" -"使用此\\ :ref:`轉換表 `\\ 來將 *obj* 序列化為 JSON 格" -"式 :class:`str`。這個引數的作用與 :func:`dump` 中的同名引數意義相同。" +"使用此\\ :ref:`轉換表 `\\ 來將 *obj* 序列化為 JSON 格式 :" +"class:`str`。這個引數的作用與 :func:`dump` 中的同名引數意義相同。" -#: ../../library/json.rst:259 +#: ../../library/json.rst:261 msgid "" "Keys in key/value pairs of JSON are always of the type :class:`str`. When a " "dictionary is converted into JSON, all the keys of the dictionary are " @@ -444,7 +446,7 @@ msgstr "" "轉換回字典,則該字典可能不等於原始字典。也就是說,如果字典 x 含有非字串鍵值," "則 ``loads(dumps(x)) != x``。" -#: ../../library/json.rst:270 +#: ../../library/json.rst:272 msgid "" "Deserialize *fp* to a Python object using the :ref:`JSON-to-Python " "conversion table `." @@ -452,20 +454,20 @@ msgstr "" "使用此 :ref:`JSON-to-Python 轉換表 `\\ 將 *fp* 解碼為 " "Python 物件。" -#: ../../library/json.rst:273 +#: ../../library/json.rst:275 msgid "" "A ``.read()``-supporting :term:`text file` or :term:`binary file` containing " "the JSON document to be deserialized." msgstr "" -#: ../../library/json.rst:278 +#: ../../library/json.rst:280 msgid "" "If set, a custom JSON decoder. Additional keyword arguments to :func:`!load` " -"will be passed to the constructor of *cls*. If ``None`` (the " -"default), :class:`!JSONDecoder` is used." +"will be passed to the constructor of *cls*. If ``None`` (the default), :" +"class:`!JSONDecoder` is used." msgstr "" -#: ../../library/json.rst:285 +#: ../../library/json.rst:287 msgid "" "If set, a function that is called with the result of any JSON object literal " "decoded (a :class:`dict`). The return value of this function will be used " @@ -473,11 +475,11 @@ msgid "" "decoders, for example `JSON-RPC `_ class hinting. " "Default ``None``." msgstr "" -"如果有設定,會用解碼後的 JSON 物件字面值的結果(一個 :class:`dict`)來呼叫此函式。" -"此函式的回傳值將用來取代 :class:`dict`。此功能可用於實作自訂解碼器," -"例如 `JSON-RPC `_ 類別提示。預設為 ``None``。" +"如果有設定,會用解碼後的 JSON 物件字面值的結果(一個 :class:`dict`)來呼叫此" +"函式。此函式的回傳值將用來取代 :class:`dict`。此功能可用於實作自訂解碼器,例" +"如 `JSON-RPC `_ 類別提示。預設為 ``None``。" -#: ../../library/json.rst:295 +#: ../../library/json.rst:297 msgid "" "If set, a function that is called with the result of any JSON object literal " "decoded with an ordered list of pairs. The return value of this function " @@ -485,67 +487,65 @@ msgid "" "implement custom decoders. If *object_hook* is also set, *object_pairs_hook* " "takes priority. Default ``None``." msgstr "" -"如果有設定,會用任何 JSON 物件字面值以有序對串列解碼的結果來呼叫此函式。" -"此函式的回傳值將用來取代 :class:`dict`。此功能可用於實作自訂解碼器。" -"如果也設定了 *object_hook*,以 *object_pairs_hook* 優先。預設為 ``None``。" +"如果有設定,會用任何 JSON 物件字面值以有序對串列解碼的結果來呼叫此函式。此函" +"式的回傳值將用來取代 :class:`dict`。此功能可用於實作自訂解碼器。如果也設定了 " +"*object_hook*,以 *object_pairs_hook* 優先。預設為 ``None``。" -#: ../../library/json.rst:305 +#: ../../library/json.rst:307 msgid "" "If set, a function that is called with the string of every JSON float to be " "decoded. If ``None`` (the default), it is equivalent to ``float(num_str)``. " -"This can be used to parse JSON floats into custom datatypes, for " -"example :class:`decimal.Decimal`." +"This can be used to parse JSON floats into custom datatypes, for example :" +"class:`decimal.Decimal`." msgstr "" -"如果有設定,會用每個要被解碼的 JSON 浮點數字串來呼叫此函式。" -"如果為 ``None``\\ (預設值),則等同於 ``float(num_str)``。" -"此功能可用於將 JSON 浮點數剖析為自訂資料型別,例如 :class:`decimal.Decimal`。" +"如果有設定,會用每個要被解碼的 JSON 浮點數字串來呼叫此函式。如果為 " +"``None``\\ (預設值),則等同於 ``float(num_str)``。此功能可用於將 JSON 浮點" +"數剖析為自訂資料型別,例如 :class:`decimal.Decimal`。" -#: ../../library/json.rst:313 +#: ../../library/json.rst:315 msgid "" "If set, a function that is called with the string of every JSON int to be " "decoded. If ``None`` (the default), it is equivalent to ``int(num_str)``. " -"This can be used to parse JSON integers into custom datatypes, for " -"example :class:`float`." +"This can be used to parse JSON integers into custom datatypes, for example :" +"class:`float`." msgstr "" -"如果有設定,會用每個要被解碼的 JSON 整數字串來呼叫此函式。" -"如果為 ``None``\\ (預設值),則等同於 ``int(num_str)``。" -"此功能可用於將 JSON 整數剖析為自訂資料型別,例如 :class:`float`。" +"如果有設定,會用每個要被解碼的 JSON 整數字串來呼叫此函式。如果為 ``None``\\ " +"(預設值),則等同於 ``int(num_str)``。此功能可用於將 JSON 整數剖析為自訂資料" +"型別,例如 :class:`float`。" -#: ../../library/json.rst:321 +#: ../../library/json.rst:323 msgid "" "If set, a function that is called with one of the following strings: ``'-" "Infinity'``, ``'Infinity'``, or ``'NaN'``. This can be used to raise an " "exception if invalid JSON numbers are encountered. Default ``None``." msgstr "" -"如果有設定,會用以下字串之一來呼叫此函式:``'-Infinity'``、" -"``'Infinity'`` 或 ``'NaN'``。此功能可用於在遇到無效的 JSON 數字時引發例外。" -"預設為 ``None``。" +"如果有設定,會用以下字串之一來呼叫此函式:``'-Infinity'``、``'Infinity'`` 或 " +"``'NaN'``。此功能可用於在遇到無效的 JSON 數字時引發例外。預設為 ``None``。" #: ../../library/json.rst:0 msgid "Raises" msgstr "" -#: ../../library/json.rst:329 +#: ../../library/json.rst:331 msgid "When the data being deserialized is not a valid JSON document." msgstr "當被去序列化的資料不是有效的 JSON 文件時。" -#: ../../library/json.rst:332 +#: ../../library/json.rst:334 msgid "" "When the data being deserialized does not contain UTF-8, UTF-16 or UTF-32 " "encoded data." -msgstr "" -"當被去序列化的資料不包含 UTF-8、UTF-16 或 UTF-32 編碼資料時。" +msgstr "當被去序列化的資料不包含 UTF-8、UTF-16 或 UTF-32 編碼資料時。" -#: ../../library/json.rst:338 +#: ../../library/json.rst:340 msgid "Added the optional *object_pairs_hook* parameter." msgstr "新增可選的 *object_pairs_hook* 參數。" -#: ../../library/json.rst:339 +#: ../../library/json.rst:341 msgid "*parse_constant* doesn't get called on 'null', 'true', 'false' anymore." msgstr "" "遭遇 'null'、'true' 或 'false' 時不再以 *parse_constant* 給定的函式來處理了。" -#: ../../library/json.rst:344 +#: ../../library/json.rst:346 msgid "" "*fp* can now be a :term:`binary file`. The input encoding should be UTF-8, " "UTF-16 or UTF-32." @@ -553,7 +553,7 @@ msgstr "" "現在,*fp* 可以是一個\\ :term:`二進位檔案 `,前提是其編碼格式為 " "UTF-8、UTF-16 或 UTF-32。" -#: ../../library/json.rst:347 +#: ../../library/json.rst:349 msgid "" "The default *parse_int* of :func:`int` now limits the maximum length of the " "integer string via the interpreter's :ref:`integer string conversion length " @@ -563,18 +563,18 @@ msgstr "" "由直譯器的\\ :ref:`整數字串轉換長度限制 `\\ 機制來達成," "這能防止阻斷服務攻擊 (Denial of Service attacks)。" -#: ../../library/json.rst:355 +#: ../../library/json.rst:357 msgid "" "Identical to :func:`load`, but instead of a file-like object, deserialize " "*s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance " "containing a JSON document) to a Python object using this :ref:`conversion " "table `." msgstr "" -"與 :func:`load` 相同,但不是類檔案物件,而是使用\\ :ref:`轉換表 `\\ " -"將 *s*\\ (一個包含 JSON 文件的 :class:`str`、:class:`bytes` 或 :class:`bytearray` 實例)" -"去序列化為 Python 物件。" +"與 :func:`load` 相同,但不是類檔案物件,而是使用\\ :ref:`轉換表 `\\ 將 *s*\\ (一個包含 JSON 文件的 :class:`str`、:class:`bytes` 或 :" +"class:`bytearray` 實例)去序列化為 Python 物件。" -#: ../../library/json.rst:360 +#: ../../library/json.rst:362 msgid "" "*s* can now be of type :class:`bytes` or :class:`bytearray`. The input " "encoding should be UTF-8, UTF-16 or UTF-32." @@ -582,95 +582,95 @@ msgstr "" "現在,*s* 可以是一個二進位檔案如 :class:`bytes` 或 :class:`bytearray`,前提是" "其編碼格式為 UTF-8、UTF-16 或 UTF-32。" -#: ../../library/json.rst:364 +#: ../../library/json.rst:366 msgid "The keyword argument *encoding* has been removed." msgstr "刪除關鍵字引數 *encoding*。" -#: ../../library/json.rst:369 +#: ../../library/json.rst:371 msgid "Encoders and Decoders" msgstr "編碼器與解碼器" -#: ../../library/json.rst:373 +#: ../../library/json.rst:375 msgid "Simple JSON decoder." msgstr "簡易 JSON 解碼器" -#: ../../library/json.rst:375 +#: ../../library/json.rst:377 msgid "Performs the following translations in decoding by default:" msgstr "預設將執行下列資料型別轉換:" -#: ../../library/json.rst:380 ../../library/json.rst:468 +#: ../../library/json.rst:382 ../../library/json.rst:470 msgid "JSON" msgstr "JSON" -#: ../../library/json.rst:380 ../../library/json.rst:468 +#: ../../library/json.rst:382 ../../library/json.rst:470 msgid "Python" msgstr "Python" -#: ../../library/json.rst:382 ../../library/json.rst:470 +#: ../../library/json.rst:384 ../../library/json.rst:472 msgid "object" msgstr "object" -#: ../../library/json.rst:382 ../../library/json.rst:470 +#: ../../library/json.rst:384 ../../library/json.rst:472 msgid "dict" msgstr "dict" -#: ../../library/json.rst:384 ../../library/json.rst:472 +#: ../../library/json.rst:386 ../../library/json.rst:474 msgid "array" msgstr "array" -#: ../../library/json.rst:384 +#: ../../library/json.rst:386 msgid "list" msgstr "list" -#: ../../library/json.rst:386 ../../library/json.rst:474 +#: ../../library/json.rst:388 ../../library/json.rst:476 msgid "string" msgstr "string" -#: ../../library/json.rst:386 ../../library/json.rst:474 +#: ../../library/json.rst:388 ../../library/json.rst:476 msgid "str" msgstr "str" -#: ../../library/json.rst:388 +#: ../../library/json.rst:390 msgid "number (int)" msgstr "number (整數)" -#: ../../library/json.rst:388 +#: ../../library/json.rst:390 msgid "int" msgstr "int" -#: ../../library/json.rst:390 +#: ../../library/json.rst:392 msgid "number (real)" msgstr "number (實數)" -#: ../../library/json.rst:390 +#: ../../library/json.rst:392 msgid "float" msgstr "float" -#: ../../library/json.rst:392 ../../library/json.rst:478 +#: ../../library/json.rst:394 ../../library/json.rst:480 msgid "true" msgstr "true" -#: ../../library/json.rst:392 ../../library/json.rst:478 +#: ../../library/json.rst:394 ../../library/json.rst:480 msgid "True" msgstr "True" -#: ../../library/json.rst:394 ../../library/json.rst:480 +#: ../../library/json.rst:396 ../../library/json.rst:482 msgid "false" msgstr "false" -#: ../../library/json.rst:394 ../../library/json.rst:480 +#: ../../library/json.rst:396 ../../library/json.rst:482 msgid "False" msgstr "False" -#: ../../library/json.rst:396 ../../library/json.rst:482 +#: ../../library/json.rst:398 ../../library/json.rst:484 msgid "null" msgstr "null" -#: ../../library/json.rst:396 ../../library/json.rst:482 +#: ../../library/json.rst:398 ../../library/json.rst:484 msgid "None" msgstr "None" -#: ../../library/json.rst:399 +#: ../../library/json.rst:401 msgid "" "It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their " "corresponding ``float`` values, which is outside the JSON spec." @@ -678,31 +678,31 @@ msgstr "" "雖然 ``NaN``、``Infinity`` 和 ``-Infinity`` 並不符合 JSON 規範,但解碼器依然" "能正確地將其轉換到相應的 Python ``float`` 值。" -#: ../../library/json.rst:402 +#: ../../library/json.rst:404 msgid "" "*object_hook* is an optional function that will be called with the result of " "every JSON object decoded and its return value will be used in place of the " -"given :class:`dict`. This can be used to provide custom deserializations " -"(e.g. to support `JSON-RPC `_ class hinting)." +"given :class:`dict`. This can be used to provide custom deserializations (e." +"g. to support `JSON-RPC `_ class hinting)." msgstr "" "*object_hook* 是一個可選函式,其接受一個解碼後的 JSON 物件作為輸入,並使用其" "回傳值來取代原先的 :class:`dict`。這個功能可用於提供自訂的去序列化(例如支援 " "`JSON-RPC `_ 類別提示)。" -#: ../../library/json.rst:407 +#: ../../library/json.rst:409 msgid "" "*object_pairs_hook* is an optional function that will be called with the " "result of every JSON object decoded with an ordered list of pairs. The " -"return value of *object_pairs_hook* will be used instead of " -"the :class:`dict`. This feature can be used to implement custom decoders. " -"If *object_hook* is also defined, the *object_pairs_hook* takes priority." +"return value of *object_pairs_hook* will be used instead of the :class:" +"`dict`. This feature can be used to implement custom decoders. If " +"*object_hook* is also defined, the *object_pairs_hook* takes priority." msgstr "" -#: ../../library/json.rst:413 +#: ../../library/json.rst:415 msgid "Added support for *object_pairs_hook*." msgstr "新增對於 *object_pairs_hook* 的支援。" -#: ../../library/json.rst:416 +#: ../../library/json.rst:418 msgid "" "*parse_float* is an optional function that will be called with the string of " "every JSON float to be decoded. By default, this is equivalent to " @@ -713,7 +713,7 @@ msgstr "" "的函式來進行解碼。預設情況這等效於 ``float(num_str)``。這個參數可用於將 JSON " "中的浮點數解碼或剖析為另一種資料型別(例如 :class:`decimal.Decimal`\\ )。" -#: ../../library/json.rst:421 +#: ../../library/json.rst:423 msgid "" "*parse_int* is an optional function that will be called with the string of " "every JSON int to be decoded. By default, this is equivalent to " @@ -724,7 +724,7 @@ msgstr "" "``int(num_str)``。這個參數可用於將 JSON 中的整數解碼或剖析為另一種資料型別" "(例如 :class:`float`)。" -#: ../../library/json.rst:426 +#: ../../library/json.rst:428 msgid "" "*parse_constant* is an optional function that will be called with one of the " "following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be " @@ -734,7 +734,7 @@ msgstr "" "``'Infinity'`` 或 ``'NaN'`` 其中之一則會改用這個參數給定的函式來進行解碼。這" "也可用於使解碼過程中遇到無效的 JSON 數字時引發一個例外。" -#: ../../library/json.rst:430 +#: ../../library/json.rst:432 msgid "" "If *strict* is false (``True`` is the default), then control characters will " "be allowed inside strings. Control characters in this context are those " @@ -745,33 +745,33 @@ msgstr "" "語境中的控制字元指的是 ASCII 字元編碼在 0~31 範圍內的字元,包括 ``'\\t'``" "(tab)、``'\\n'``、``'\\r'`` 和 ``'\\0'``。" -#: ../../library/json.rst:435 +#: ../../library/json.rst:437 msgid "" -"If the data being deserialized is not a valid JSON document, " -"a :exc:`JSONDecodeError` will be raised." +"If the data being deserialized is not a valid JSON document, a :exc:" +"`JSONDecodeError` will be raised." msgstr "" -"如果被去序列化(deserialized)的資料不符合 JSON 格式,將會引" -"發 :exc:`JSONDecodeError` 例外。" +"如果被去序列化(deserialized)的資料不符合 JSON 格式,將會引發 :exc:" +"`JSONDecodeError` 例外。" -#: ../../library/json.rst:438 ../../library/json.rst:539 +#: ../../library/json.rst:440 ../../library/json.rst:543 msgid "All parameters are now :ref:`keyword-only `." msgstr "" "所有參數現在都是\\ :ref:`僅限關鍵字參數 `\\ 了。" -#: ../../library/json.rst:443 +#: ../../library/json.rst:445 msgid "" "Return the Python representation of *s* (a :class:`str` instance containing " "a JSON document)." msgstr "" "回傳用 Python 型式表達的 *s* (一個含有 JSON 文件的 :class:`str` 實例)。" -#: ../../library/json.rst:446 +#: ../../library/json.rst:448 msgid "" ":exc:`JSONDecodeError` will be raised if the given JSON document is not " "valid." msgstr "若給定的輸入不符合 JSON 格式會引發 :exc:`JSONDecodeError` 例外。" -#: ../../library/json.rst:451 +#: ../../library/json.rst:453 msgid "" "Decode a JSON document from *s* (a :class:`str` beginning with a JSON " "document) and return a 2-tuple of the Python representation and the index in " @@ -780,43 +780,43 @@ msgstr "" "將 *s* (一個開頭部分含有合格 JSON 文件的 :class:`str`) 解碼,並將 JSON 文件" "結束點的索引值(index)和解碼結果合併為一個二元組(2-tuple)後回傳。" -#: ../../library/json.rst:455 +#: ../../library/json.rst:457 msgid "" "This can be used to decode a JSON document from a string that may have " "extraneous data at the end." msgstr "這個方法可以用來解碼尾段可能帶有 JSON 以外資料的文字。" -#: ../../library/json.rst:461 +#: ../../library/json.rst:463 msgid "Extensible JSON encoder for Python data structures." msgstr "可擴充的 Python 資料結構 JSON 編碼器。" -#: ../../library/json.rst:463 +#: ../../library/json.rst:465 msgid "Supports the following objects and types by default:" msgstr "預設可支援下列物件及型別:" -#: ../../library/json.rst:472 +#: ../../library/json.rst:474 msgid "list, tuple" msgstr "list, tuple" -#: ../../library/json.rst:476 +#: ../../library/json.rst:478 msgid "int, float, int- & float-derived Enums" msgstr "" "int、float 或可作為整數或浮點數運算的衍生列舉(int- or float-derived Enums)" -#: ../../library/json.rst:476 +#: ../../library/json.rst:478 msgid "number" msgstr "number" -#: ../../library/json.rst:485 +#: ../../library/json.rst:487 msgid "Added support for int- and float-derived Enum classes." msgstr "" "增加對整數(int)、浮點數(float)或可作為整數或浮點數運算的衍生列舉(int- " "or float-derived Enums)類別的支援性。" -#: ../../library/json.rst:488 +#: ../../library/json.rst:490 msgid "" -"To extend this to recognize other objects, subclass and implement " -"a :meth:`~JSONEncoder.default` method with another method that returns a " +"To extend this to recognize other objects, subclass and implement a :meth:" +"`~JSONEncoder.default` method with another method that returns a " "serializable object for ``o`` if possible, otherwise it should call the " "superclass implementation (to raise :exc:`TypeError`)." msgstr "" @@ -824,28 +824,30 @@ msgstr "" "方法。此方法應回傳一個可序列化的 ``o`` 物件,否則此方法應呼叫父類別的 " "JSONEncoder.default 方法(以引發 :exc:`TypeError` 例外)。" -#: ../../library/json.rst:493 +#: ../../library/json.rst:495 msgid "" "If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when " -"trying to encode keys that are " -"not :class:`str`, :class:`int`, :class:`float`, :class:`bool` or ``None``. " -"If *skipkeys* is true, such items are simply skipped." +"trying to encode keys that are not :class:`str`, :class:`int`, :class:" +"`float`, :class:`bool` or ``None``. If *skipkeys* is true, such items are " +"simply skipped." msgstr "" -"若 *skipkeys* 為 false(預設值),則當在編碼不" -"是 :class:`str`、:class:`int`、:class:`float`、:class:`bool` 或 ``None`` 的鍵" -"值時,將引發 :exc:`TypeError`。如果 *skipkeys* 為 true,這些項目將直接被跳" -"過。" +"若 *skipkeys* 為 false(預設值),則當在編碼不是 :class:`str`、:class:" +"`int`、:class:`float`、:class:`bool` 或 ``None`` 的鍵值時,將引發 :exc:" +"`TypeError`。如果 *skipkeys* 為 true,這些項目將直接被跳過。" -#: ../../library/json.rst:497 +#: ../../library/json.rst:499 +#, fuzzy msgid "" "If *ensure_ascii* is true (the default), the output is guaranteed to have " -"all incoming non-ASCII characters escaped. If *ensure_ascii* is false, " -"these characters will be output as-is." +"all incoming non-ASCII and non-printable characters escaped. If " +"*ensure_ascii* is false, all characters will be output as-is, except for the " +"characters that must be escaped: quotation mark, reverse solidus, and the " +"control characters U+0000 through U+001F." msgstr "" "如果 *ensure_ascii* 被設為 true(預設值),則輸出時將確保所有輸入的非 ASCII " "字元都會被跳脫。若 *ensure_ascii* 為 false,則這些字元將照原樣輸出。" -#: ../../library/json.rst:501 +#: ../../library/json.rst:505 msgid "" "If *check_circular* is true (the default), then lists, dicts, and custom " "encoded objects will be checked for circular references during encoding to " @@ -853,10 +855,10 @@ msgid "" "Otherwise, no such check takes place." msgstr "" "如果 *check_circular* 為 true(預設值),則會在編碼期間檢查串列(list)、字典" -"(dict)和自訂編碼物件的循環參照,以防止無限遞迴(一個會導" -"致 :exc:`RecursionError` 例外的問題)。否則不會進行此類檢查。" +"(dict)和自訂編碼物件的循環參照,以防止無限遞迴(一個會導致 :exc:" +"`RecursionError` 例外的問題)。否則不會進行此類檢查。" -#: ../../library/json.rst:506 +#: ../../library/json.rst:510 msgid "" "If *allow_nan* is true (the default), then ``NaN``, ``Infinity``, and ``-" "Infinity`` will be encoded as such. This behavior is not JSON specification " @@ -868,7 +870,7 @@ msgstr "" "數基於 JavaScript 的編碼器和解碼器一致。否則若設為 false,嘗試對這些浮點數進" "行編碼將引發 :exc:`ValueError` 例外。" -#: ../../library/json.rst:512 +#: ../../library/json.rst:516 msgid "" "If *sort_keys* is true (default: ``False``), then the output of dictionaries " "will be sorted by key; this is useful for regression tests to ensure that " @@ -878,7 +880,7 @@ msgstr "" "按鍵值排序。這項功能可確保 JSON 序列化的結果能被互相比較,能讓日常的回歸測試" "檢查變得方便一些。" -#: ../../library/json.rst:516 +#: ../../library/json.rst:520 msgid "" "If *indent* is a non-negative integer or string, then JSON array elements " "and object members will be pretty-printed with that indent level. An indent " @@ -892,7 +894,7 @@ msgstr "" "值)等於是選擇最緊湊的表示法。使用正整數縮排可以在每層縮排數量相同的空格。如" "果 *indent* 是一個字串(例如 ``\"\\t\"``\\ ),則該字串用於縮排每個層級。" -#: ../../library/json.rst:526 +#: ../../library/json.rst:530 msgid "" "If specified, *separators* should be an ``(item_separator, key_separator)`` " "tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', " @@ -904,35 +906,35 @@ msgstr "" "')``,否則預設為 ``(',', ': ')``。想要獲得最緊湊的 JSON 表示形式,你可以改成" "指定 ``(',', ':')`` 來消除空格。" -#: ../../library/json.rst:534 +#: ../../library/json.rst:538 msgid "" "If specified, *default* should be a function that gets called for objects " "that can't otherwise be serialized. It should return a JSON encodable " -"version of the object or raise a :exc:`TypeError`. If not " -"specified, :exc:`TypeError` is raised." +"version of the object or raise a :exc:`TypeError`. If not specified, :exc:" +"`TypeError` is raised." msgstr "" "如果有指定本參數,*default* 會是一個遭遇無法序列化的物件時會被呼叫的函式。它" "應該回傳該物件的 JSON 可編碼版本或引發 :exc:`TypeError`。如果未指定,則會直接" "引發 :exc:`TypeError`。" -#: ../../library/json.rst:545 +#: ../../library/json.rst:549 msgid "" "Implement this method in a subclass such that it returns a serializable " -"object for *o*, or calls the base implementation (to raise " -"a :exc:`TypeError`)." +"object for *o*, or calls the base implementation (to raise a :exc:" +"`TypeError`)." msgstr "" "在任意一個子類別裡實作這個方法時須讓其回傳一個可序列化的物件 *o* ,或呼叫原始" "的實作以引發 :exc:`TypeError` 例外。" -#: ../../library/json.rst:549 +#: ../../library/json.rst:553 msgid "" -"For example, to support arbitrary iterators, you could " -"implement :meth:`~JSONEncoder.default` like this::" +"For example, to support arbitrary iterators, you could implement :meth:" +"`~JSONEncoder.default` like this::" msgstr "" -"舉例來說,想要讓編碼器支援任意疊代器(iterator),你可以實作這樣子" -"的 :meth:`~JSONEncoder.default`: ::" +"舉例來說,想要讓編碼器支援任意疊代器(iterator),你可以實作這樣子的 :meth:" +"`~JSONEncoder.default`: ::" -#: ../../library/json.rst:552 +#: ../../library/json.rst:556 msgid "" "def default(self, o):\n" " try:\n" @@ -954,13 +956,13 @@ msgstr "" " # 讓基底類別的預設方法引發 TypeError\n" " return super().default(o)" -#: ../../library/json.rst:565 +#: ../../library/json.rst:569 msgid "" "Return a JSON string representation of a Python data structure, *o*. For " "example::" msgstr "回傳一個 Python 資料結構物件 *o* 的 JSON 的字串表示。例如: ::" -#: ../../library/json.rst:568 +#: ../../library/json.rst:572 msgid "" ">>> json.JSONEncoder().encode({\"foo\": [\"bar\", \"baz\"]})\n" "'{\"foo\": [\"bar\", \"baz\"]}'" @@ -968,7 +970,7 @@ msgstr "" ">>> json.JSONEncoder().encode({\"foo\": [\"bar\", \"baz\"]})\n" "'{\"foo\": [\"bar\", \"baz\"]}'" -#: ../../library/json.rst:574 +#: ../../library/json.rst:578 msgid "" "Encode the given object, *o*, and yield each string representation as " "available. For example::" @@ -976,7 +978,7 @@ msgstr "" "將物件 *o* 編碼,並將結果統整為一個能依序產生(yield)各結果字串的物件。如下" "例: ::" -#: ../../library/json.rst:577 +#: ../../library/json.rst:581 msgid "" "for chunk in json.JSONEncoder().iterencode(bigobject):\n" " mysocket.write(chunk)" @@ -984,39 +986,39 @@ msgstr "" "for chunk in json.JSONEncoder().iterencode(bigobject):\n" " mysocket.write(chunk)" -#: ../../library/json.rst:582 +#: ../../library/json.rst:586 msgid "Exceptions" msgstr "例外" -#: ../../library/json.rst:586 +#: ../../library/json.rst:590 msgid "Subclass of :exc:`ValueError` with the following additional attributes:" msgstr ":exc:`ValueError` 的子類別具有下列額外屬性:" -#: ../../library/json.rst:590 +#: ../../library/json.rst:594 msgid "The unformatted error message." msgstr "未受格式化的錯誤訊息。" -#: ../../library/json.rst:594 +#: ../../library/json.rst:598 msgid "The JSON document being parsed." msgstr "正在被剖析的 JSON 文件。" -#: ../../library/json.rst:598 +#: ../../library/json.rst:602 msgid "The start index of *doc* where parsing failed." msgstr "*doc* 剖析失敗處的起始點的索引值。" -#: ../../library/json.rst:602 +#: ../../library/json.rst:606 msgid "The line corresponding to *pos*." msgstr "*pos* 所在的列(line)數。" -#: ../../library/json.rst:606 +#: ../../library/json.rst:610 msgid "The column corresponding to *pos*." msgstr "*pos* 所在的行(column)數。" -#: ../../library/json.rst:612 +#: ../../library/json.rst:616 msgid "Standard Compliance and Interoperability" msgstr "合規性與互通性(Interoperability)" -#: ../../library/json.rst:614 +#: ../../library/json.rst:618 msgid "" "The JSON format is specified by :rfc:`7159` and by `ECMA-404 `_. This " @@ -1029,7 +1031,7 @@ msgstr "" "組對 RFC 的遵循程度。簡單起見,:class:`JSONEncoder` 和 :class:`JSONDecoder` " "子類別以及未明確提及的參數將不予討論。" -#: ../../library/json.rst:620 +#: ../../library/json.rst:624 msgid "" "This module does not comply with the RFC in a strict fashion, implementing " "some extensions that are valid JavaScript but not valid JSON. In particular:" @@ -1037,17 +1039,17 @@ msgstr "" "這個模組的部份實作並未非常嚴格地遵循 RFC 規範。準確來說,下列實際實作符合 " "JavaScript 語法格式,但並不符合 JSON 格式:" -#: ../../library/json.rst:623 +#: ../../library/json.rst:627 msgid "Infinite and NaN number values are accepted and output;" msgstr "無限(Infinite)和非數字(NaN)值會被接受。" -#: ../../library/json.rst:624 +#: ../../library/json.rst:628 msgid "" "Repeated names within an object are accepted, and only the value of the last " "name-value pair is used." msgstr "同一個物件內可以有重複的名稱,但只有最後一個同名物件是有效的。" -#: ../../library/json.rst:627 +#: ../../library/json.rst:631 msgid "" "Since the RFC permits RFC-compliant parsers to accept input texts that are " "not RFC-compliant, this module's deserializer is technically RFC-compliant " @@ -1056,11 +1058,11 @@ msgstr "" "不過 RFC 准許遵循 RFC 的剖析器接受不合規的文字輸入,所以技術上來說若以預設設" "定運作,本模組的去序列化器(deserializer)是符合 RFC 規範的。" -#: ../../library/json.rst:632 +#: ../../library/json.rst:636 msgid "Character Encodings" msgstr "字元編碼格式" -#: ../../library/json.rst:634 +#: ../../library/json.rst:638 msgid "" "The RFC requires that JSON be represented using either UTF-8, UTF-16, or " "UTF-32, with UTF-8 being the recommended default for maximum " @@ -1069,27 +1071,27 @@ msgstr "" "RFC 要求 JSON 必須以 UTF-8、UTF-16 或 UTF-32 格式編碼。並推薦以 UTF-8 編碼以" "達成最佳的互通性。" -#: ../../library/json.rst:637 +#: ../../library/json.rst:641 +#, fuzzy msgid "" "As permitted, though not required, by the RFC, this module's serializer sets " "*ensure_ascii=True* by default, thus escaping the output so that the " -"resulting strings only contain ASCII characters." +"resulting strings only contain printable ASCII characters." msgstr "" "RFC 准許但並不強制編碼器的 *ensure_ascii=True* 行為是預設值,但本模組依然實作" "了此一選項作為預設,因此本模組預設會跳脫所有非 ASCII 字元。" -#: ../../library/json.rst:641 +#: ../../library/json.rst:645 msgid "" "Other than the *ensure_ascii* parameter, this module is defined strictly in " "terms of conversion between Python objects and :class:`Unicode strings " "`, and thus does not otherwise directly address the issue of character " "encodings." msgstr "" -"除了 *ensure_ascii* 選項參數之外,本模組嚴格遵循 Python 物件" -"與 :class:`Unicode strings ` 之間的轉換規範,因此並不另外處理字元編碼的" -"問題。" +"除了 *ensure_ascii* 選項參數之外,本模組嚴格遵循 Python 物件與 :class:" +"`Unicode strings ` 之間的轉換規範,因此並不另外處理字元編碼的問題。" -#: ../../library/json.rst:646 +#: ../../library/json.rst:650 msgid "" "The RFC prohibits adding a byte order mark (BOM) to the start of a JSON " "text, and this module's serializer does not add a BOM to its output. The RFC " @@ -1102,24 +1104,24 @@ msgstr "" "(deserializer)忽略文件初始的端序記號,因此本模組的去序列化器將在遭遇位於文" "件開頭的端序記號時引發 :exc:`ValueError` 例外。" -#: ../../library/json.rst:652 +#: ../../library/json.rst:656 msgid "" "The RFC does not explicitly forbid JSON strings which contain byte sequences " "that don't correspond to valid Unicode characters (e.g. unpaired UTF-16 " "surrogates), but it does note that they may cause interoperability problems. " -"By default, this module accepts and outputs (when present in the " -"original :class:`str`) code points for such sequences." +"By default, this module accepts and outputs (when present in the original :" +"class:`str`) code points for such sequences." msgstr "" "RFC 並未明確禁止 JSON 文件包含無法對應有效 Unicode 字元的位元組序列(例如未配" "對的 UTF-16 代理對(surrogate pairs)),但這個特性的確可能會引起相容性問題。" "預設情況下,當原始輸入的 :class:`str` 中存在此類序列時,該模組將接受並輸出這" "些序列的編碼位置(code points)。" -#: ../../library/json.rst:660 +#: ../../library/json.rst:664 msgid "Infinite and NaN Number Values" msgstr "正負無限與非數值" -#: ../../library/json.rst:662 +#: ../../library/json.rst:666 msgid "" "The RFC does not permit the representation of infinite or NaN number values. " "Despite that, by default, this module accepts and outputs ``Infinity``, ``-" @@ -1128,7 +1130,7 @@ msgstr "" "RFC 不允許表現無限大或非數值(NaN)。但預設情況下,這個模組仍接受並輸出 " "``Infinity``、``-Infinity`` 和 ``NaN``,如同它們是有效的 JSON 數值字面值: ::" -#: ../../library/json.rst:666 +#: ../../library/json.rst:670 msgid "" ">>> # Neither of these calls raises an exception, but the results are not " "valid JSON\n" @@ -1143,7 +1145,7 @@ msgid "" "nan" msgstr "" -#: ../../library/json.rst:677 +#: ../../library/json.rst:681 msgid "" "In the serializer, the *allow_nan* parameter can be used to alter this " "behavior. In the deserializer, the *parse_constant* parameter can be used " @@ -1152,11 +1154,11 @@ msgstr "" "在序列化器中,*allow_nan* 參數可以改變這個行為。在去序列化器中," "*parse_constant* 參數可以改變這個行為。" -#: ../../library/json.rst:683 +#: ../../library/json.rst:687 msgid "Repeated Names Within an Object" msgstr "物件內重複的名稱" -#: ../../library/json.rst:685 +#: ../../library/json.rst:689 msgid "" "The RFC specifies that the names within a JSON object should be unique, but " "does not mandate how repeated names in JSON objects should be handled. By " @@ -1167,7 +1169,7 @@ msgstr "" "字。預設情況下,本模組不會因此引發例外;相反的,它會忽略該名字的所有重複鍵值" "對,並只保留最後一個: ::" -#: ../../library/json.rst:690 +#: ../../library/json.rst:694 msgid "" ">>> weird_json = '{\"x\": 1, \"x\": 2, \"x\": 3}'\n" ">>> json.loads(weird_json)\n" @@ -1177,15 +1179,15 @@ msgstr "" ">>> json.loads(weird_json)\n" "{'x': 3}" -#: ../../library/json.rst:694 +#: ../../library/json.rst:698 msgid "The *object_pairs_hook* parameter can be used to alter this behavior." msgstr "*object_pairs_hook* 參數可以改變這個行為。" -#: ../../library/json.rst:698 +#: ../../library/json.rst:702 msgid "Top-level Non-Object, Non-Array Values" msgstr "位於頂層的非物件及非列表值" -#: ../../library/json.rst:700 +#: ../../library/json.rst:704 msgid "" "The old version of JSON specified by the obsolete :rfc:`4627` required that " "the top-level value of a JSON text must be either a JSON object or array " @@ -1199,37 +1201,37 @@ msgstr "" "boolean、數字或字串值。 :rfc:`7159` 移除了這個限制,而本模組的序列化器或去串" "列化器中未曾實施過該限制。" -#: ../../library/json.rst:707 +#: ../../library/json.rst:711 msgid "" "Regardless, for maximum interoperability, you may wish to voluntarily adhere " "to the restriction yourself." msgstr "如果想要最大限度地保留互通性,你可能還是會想要自行施加這個限制。" -#: ../../library/json.rst:712 +#: ../../library/json.rst:716 msgid "Implementation Limitations" msgstr "實作限制" -#: ../../library/json.rst:714 +#: ../../library/json.rst:718 msgid "Some JSON deserializer implementations may set limits on:" msgstr "某些 JSON 去序列化器的實作可能會造成下列限制:" -#: ../../library/json.rst:716 +#: ../../library/json.rst:720 msgid "the size of accepted JSON texts" msgstr "JSON 文件長度上限" -#: ../../library/json.rst:717 +#: ../../library/json.rst:721 msgid "the maximum level of nesting of JSON objects and arrays" msgstr "JSON 物件或陣列的最大巢狀層數(level of nesting)限制" -#: ../../library/json.rst:718 +#: ../../library/json.rst:722 msgid "the range and precision of JSON numbers" msgstr "數字的精準度或範圍" -#: ../../library/json.rst:719 +#: ../../library/json.rst:723 msgid "the content and maximum length of JSON strings" msgstr "JSON 字串長度上限" -#: ../../library/json.rst:721 +#: ../../library/json.rst:725 msgid "" "This module does not impose any such limits beyond those of the relevant " "Python datatypes themselves or the Python interpreter itself." @@ -1237,7 +1239,7 @@ msgstr "" "本模組除了 Python 資料型態本身或 Python 直譯器本身的限制以外,不會設定任何此" "類限制。" -#: ../../library/json.rst:724 +#: ../../library/json.rst:728 msgid "" "When serializing to JSON, beware any such limitations in applications that " "may consume your JSON. In particular, it is common for JSON numbers to be " @@ -1252,31 +1254,30 @@ msgstr "" "因而受到其表示範圍和精度限制的影響。這在序列化極大的 Python :class:`int` 數" "值、或是序列化特殊數字型別的實例時(例如 :class:`decimal.Decimal`)尤其重要。" -#: ../../library/json.rst:737 +#: ../../library/json.rst:741 msgid "Command-line interface" msgstr "命令列介面" -#: ../../library/json.rst:742 +#: ../../library/json.rst:746 msgid "**Source code:** :source:`Lib/json/tool.py`" msgstr "**原始碼:**\\ :source:`Lib/json/tool.py`" -#: ../../library/json.rst:746 +#: ../../library/json.rst:750 msgid "" "The :mod:`json` module can be invoked as a script via ``python -m json`` to " "validate and pretty-print JSON objects. The :mod:`json.tool` submodule " "implements this interface." msgstr "" -#: ../../library/json.rst:750 +#: ../../library/json.rst:754 msgid "" -"If the optional ``infile`` and ``outfile`` arguments are not " -"specified, :data:`sys.stdin` and :data:`sys.stdout` will be used " -"respectively:" +"If the optional ``infile`` and ``outfile`` arguments are not specified, :" +"data:`sys.stdin` and :data:`sys.stdout` will be used respectively:" msgstr "" -"如果沒有指定可選引數 ``infile`` 和 ``outfile`` ,則 :data:`sys.stdin` " -"和 :data:`sys.stdout` 將各自做為輸入和輸出的預設值。" +"如果沒有指定可選引數 ``infile`` 和 ``outfile`` ,則 :data:`sys.stdin` 和 :" +"data:`sys.stdout` 將各自做為輸入和輸出的預設值。" -#: ../../library/json.rst:753 +#: ../../library/json.rst:757 msgid "" "$ echo '{\"json\": \"obj\"}' | python -m json\n" "{\n" @@ -1292,7 +1293,7 @@ msgstr "" "$ echo '{1.2:3.4}' | python -m json\n" "Expecting property name enclosed in double quotes: line 1 column 2 (char 1)" -#: ../../library/json.rst:762 +#: ../../library/json.rst:766 msgid "" "The output is now in the same order as the input. Use the :option:`--sort-" "keys` option to sort the output of dictionaries alphabetically by key." @@ -1300,22 +1301,22 @@ msgstr "" "現在開始輸出和輸入的資料順序會是相同的。傳入 :option:`--sort-keys` 引數以按照" "鍵值的字母順序對輸出進行排序。" -#: ../../library/json.rst:767 +#: ../../library/json.rst:771 msgid "" "The :mod:`json` module may now be directly executed as ``python -m json``. " "For backwards compatibility, invoking the CLI as ``python -m json.tool`` " "remains supported." msgstr "" -#: ../../library/json.rst:774 +#: ../../library/json.rst:778 msgid "Command-line options" msgstr "命令列選項" -#: ../../library/json.rst:778 +#: ../../library/json.rst:782 msgid "The JSON file to be validated or pretty-printed:" msgstr "將被用於校驗或美化呈現的 JSON 文件:" -#: ../../library/json.rst:780 +#: ../../library/json.rst:784 msgid "" "$ python -m json mp_films.json\n" "[\n" @@ -1341,45 +1342,45 @@ msgstr "" " }\n" "]" -#: ../../library/json.rst:794 +#: ../../library/json.rst:798 msgid "If *infile* is not specified, read from :data:`sys.stdin`." msgstr "如果沒有指定 *infile* 則會從 :data:`sys.stdin` 讀取輸入。" -#: ../../library/json.rst:798 +#: ../../library/json.rst:802 msgid "" "Write the output of the *infile* to the given *outfile*. Otherwise, write it " "to :data:`sys.stdout`." msgstr "" -"將 *infile* 的結果寫入到給定的 *outfile*。若未提供則寫入" -"到 :data:`sys.stdout`。" +"將 *infile* 的結果寫入到給定的 *outfile*。若未提供則寫入到 :data:`sys." +"stdout`。" -#: ../../library/json.rst:803 +#: ../../library/json.rst:807 msgid "Sort the output of dictionaries alphabetically by key." msgstr "按照鍵值的字母順序對輸出字典進行排序。" -#: ../../library/json.rst:809 +#: ../../library/json.rst:813 msgid "" "Disable escaping of non-ascii characters, see :func:`json.dumps` for more " "information." msgstr "關閉非 ASCII 字元的自動跳脫功能。詳情請參照 :func:`json.dumps`。" -#: ../../library/json.rst:815 +#: ../../library/json.rst:819 msgid "Parse every input line as separate JSON object." msgstr "將每一行輸入都單獨輸出為一個 JSON 物件。" -#: ../../library/json.rst:821 +#: ../../library/json.rst:825 msgid "Mutually exclusive options for whitespace control." msgstr "互斥的空白字元控制選項。" -#: ../../library/json.rst:827 +#: ../../library/json.rst:831 msgid "Show the help message." msgstr "顯示說明訊息。" -#: ../../library/json.rst:831 +#: ../../library/json.rst:835 msgid "Footnotes" msgstr "註解" -#: ../../library/json.rst:832 +#: ../../library/json.rst:836 msgid "" "As noted in `the errata for RFC 7159 `_, JSON permits literal U+2028 (LINE SEPARATOR) " diff --git a/library/sys.po b/library/sys.po index 1f291b5ae4d..4b6bbf70e85 100644 --- a/library/sys.po +++ b/library/sys.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-09 05:11+0800\n" +"POT-Creation-Date: 2025-11-09 00:17+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,10 +44,10 @@ msgstr "" #: ../../library/sys.rst:25 ../../library/sys.rst:298 ../../library/sys.rst:368 #: ../../library/sys.rst:789 ../../library/sys.rst:807 -#: ../../library/sys.rst:1056 ../../library/sys.rst:1662 -#: ../../library/sys.rst:1905 ../../library/sys.rst:1920 -#: ../../library/sys.rst:1928 ../../library/sys.rst:1966 -#: ../../library/sys.rst:1982 ../../library/sys.rst:2229 +#: ../../library/sys.rst:1056 ../../library/sys.rst:1666 +#: ../../library/sys.rst:1909 ../../library/sys.rst:1924 +#: ../../library/sys.rst:1932 ../../library/sys.rst:1970 +#: ../../library/sys.rst:1986 ../../library/sys.rst:2233 msgid "Availability" msgstr "可用性" @@ -75,8 +75,8 @@ msgid "" "particular, malicious code can trivially disable or bypass hooks added using " "this function. At a minimum, any security-sensitive hooks must be added " "using the C API :c:func:`PySys_AddAuditHook` before initialising the " -"runtime, and any modules allowing arbitrary memory modification (such " -"as :mod:`ctypes`) should be completely removed or closely monitored." +"runtime, and any modules allowing arbitrary memory modification (such as :" +"mod:`ctypes`) should be completely removed or closely monitored." msgstr "" #: ../../library/sys.rst:49 ../../library/sys.rst:51 @@ -87,10 +87,10 @@ msgid "" "and the exception suppressed. As a result, callers cannot assume that their " "hook has been added unless they control all existing hooks." msgstr "" -"呼叫 :func:`sys.addaudithook` 本身會引發一個不帶任何引數、名為 " -"``sys.addaudithook`` 的稽核事件。如果任何現有的 hook 引發" -"從 :class:`RuntimeError` 衍生的例外,則不會添加新的 hook 並抑制異常。因此,除" -"非呼叫者控制所有已存在的 hook,他們不能假設他們的 hook 已被添加。" +"呼叫 :func:`sys.addaudithook` 本身會引發一個不帶任何引數、名為 ``sys." +"addaudithook`` 的稽核事件。如果任何現有的 hook 引發從 :class:`RuntimeError` " +"衍生的例外,則不會添加新的 hook 並抑制異常。因此,除非呼叫者控制所有已存在的 " +"hook,他們不能假設他們的 hook 已被添加。" #: ../../library/sys.rst:58 msgid "" @@ -170,8 +170,8 @@ msgstr "" #: ../../library/sys.rst:119 msgid "" -"Hooks are added using the :func:`sys.addaudithook` " -"or :c:func:`PySys_AddAuditHook` functions." +"Hooks are added using the :func:`sys.addaudithook` or :c:func:" +"`PySys_AddAuditHook` functions." msgstr "" #: ../../library/sys.rst:122 @@ -195,11 +195,11 @@ msgstr "" #: ../../library/sys.rst:135 msgid "" -"When running under :ref:`sys-path-init-virtual-" -"environments`, :data:`exec_prefix` gets overwritten to the virtual " -"environment prefix. :data:`base_exec_prefix`, conversely, does not change, " -"and always points to the base Python installation. Refer to :ref:`sys-path-" -"init-virtual-environments` for more information." +"When running under :ref:`sys-path-init-virtual-environments`, :data:" +"`exec_prefix` gets overwritten to the virtual environment prefix. :data:" +"`base_exec_prefix`, conversely, does not change, and always points to the " +"base Python installation. Refer to :ref:`sys-path-init-virtual-environments` " +"for more information." msgstr "" #: ../../library/sys.rst:146 @@ -243,10 +243,9 @@ msgstr "" #: ../../library/sys.rst:179 msgid "" -"Tracing is suspended while calling a tracing function set " -"by :func:`settrace` or :func:`setprofile` to avoid infinite " -"recursion. :func:`!call_tracing` enables explicit recursion of the tracing " -"function." +"Tracing is suspended while calling a tracing function set by :func:" +"`settrace` or :func:`setprofile` to avoid infinite recursion. :func:`!" +"call_tracing` enables explicit recursion of the tracing function." msgstr "" #: ../../library/sys.rst:186 @@ -317,8 +316,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` " -"``sys._current_exceptions``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." +"_current_exceptions``。" #: ../../library/sys.rst:239 msgid "" @@ -345,30 +344,29 @@ msgstr "" #: ../../library/sys.rst:256 msgid "" -"The default implementation first consults the environment " -"variable :envvar:`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this " -"function returns immediately; i.e. it is a no-op. If the environment " -"variable is not set, or is set to the empty string, ``pdb.set_trace()`` is " -"called. Otherwise this variable should name a function to run, using " -"Python's dotted-import nomenclature, e.g. " -"``package.subpackage.module.function``. In this case, " +"The default implementation first consults the environment variable :envvar:" +"`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns " +"immediately; i.e. it is a no-op. If the environment variable is not set, or " +"is set to the empty string, ``pdb.set_trace()`` is called. Otherwise this " +"variable should name a function to run, using Python's dotted-import " +"nomenclature, e.g. ``package.subpackage.module.function``. In this case, " "``package.subpackage.module`` would be imported and the resulting module " "must have a callable named ``function()``. This is run, passing in " -"``*args`` and ``**kws``, and whatever ``function()`` returns, " -"``sys.breakpointhook()`` returns to the built-in :func:`breakpoint` function." +"``*args`` and ``**kws``, and whatever ``function()`` returns, ``sys." +"breakpointhook()`` returns to the built-in :func:`breakpoint` function." msgstr "" #: ../../library/sys.rst:268 msgid "" -"Note that if anything goes wrong while importing the callable named " -"by :envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " +"Note that if anything goes wrong while importing the callable named by :" +"envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " "breakpoint is ignored." msgstr "" #: ../../library/sys.rst:272 msgid "" -"Also note that if ``sys.breakpointhook()`` is overridden " -"programmatically, :envvar:`PYTHONBREAKPOINT` is *not* consulted." +"Also note that if ``sys.breakpointhook()`` is overridden programmatically, :" +"envvar:`PYTHONBREAKPOINT` is *not* consulted." msgstr "" #: ../../library/sys.rst:279 @@ -396,19 +394,19 @@ msgstr "" #: ../../library/sys.rst:303 msgid "" -"If *value* is not ``None``, this function prints ``repr(value)`` to " -"``sys.stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is " -"not encodable to ``sys.stdout.encoding`` with ``sys.stdout.errors`` error " -"handler (which is probably ``'strict'``), encode it to " -"``sys.stdout.encoding`` with ``'backslashreplace'`` error handler." +"If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." +"stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not " +"encodable to ``sys.stdout.encoding`` with ``sys.stdout.errors`` error " +"handler (which is probably ``'strict'``), encode it to ``sys.stdout." +"encoding`` with ``'backslashreplace'`` error handler." msgstr "" #: ../../library/sys.rst:309 msgid "" -"``sys.displayhook`` is called on the result of evaluating " -"an :term:`expression` entered in an interactive Python session. The display " -"of these values can be customized by assigning another one-argument function " -"to ``sys.displayhook``." +"``sys.displayhook`` is called on the result of evaluating an :term:" +"`expression` entered in an interactive Python session. The display of these " +"values can be customized by assigning another one-argument function to ``sys." +"displayhook``." msgstr "" #: ../../library/sys.rst:313 @@ -444,9 +442,9 @@ msgstr "" msgid "" "If this is true, Python won't try to write ``.pyc`` files on the import of " "source modules. This value is initially set to ``True`` or ``False`` " -"depending on the :option:`-B` command line option and " -"the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable, but you can set " -"it yourself to control bytecode file generation." +"depending on the :option:`-B` command line option and the :envvar:" +"`PYTHONDONTWRITEBYTECODE` environment variable, but you can set it yourself " +"to control bytecode file generation." msgstr "" #: ../../library/sys.rst:348 @@ -497,9 +495,9 @@ msgstr "" #: ../../library/sys.rst:385 msgid "" "This value is initially set based on the value of the :option:`-X` " -"``pycache_prefix=PATH`` command-line option or " -"the :envvar:`PYTHONPYCACHEPREFIX` environment variable (command-line takes " -"precedence). If neither are set, it is ``None``." +"``pycache_prefix=PATH`` command-line option or the :envvar:" +"`PYTHONPYCACHEPREFIX` environment variable (command-line takes precedence). " +"If neither are set, it is ``None``." msgstr "" #: ../../library/sys.rst:395 @@ -524,15 +522,15 @@ msgid "" "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " "hook has been set, ``hook`` may be ``None``. If any hook raises an exception " "derived from :class:`RuntimeError` the call to the hook will be suppressed. " -"Otherwise, the audit hook exception will be reported as unraisable and " -"``sys.excepthook`` will be called." +"Otherwise, the audit hook exception will be reported as unraisable and ``sys." +"excepthook`` will be called." msgstr "" #: ../../library/sys.rst:415 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " -"the :func:`threading.excepthook` function handles exception raised " -"by :func:`threading.Thread.run`." +"the :func:`threading.excepthook` function handles exception raised by :func:" +"`threading.Thread.run`." msgstr "" #: ../../library/sys.rst:425 @@ -568,11 +566,11 @@ msgstr "" msgid "" "This function returns the old-style representation of the handled exception. " "If an exception ``e`` is currently handled (so :func:`exception` would " -"return ``e``), :func:`exc_info` returns the tuple ``(type(e), e, " -"e.__traceback__)``. That is, a tuple containing the type of the exception (a " -"subclass of :exc:`BaseException`), the exception itself, and " -"a :ref:`traceback object ` which typically encapsulates " -"the call stack at the point where the exception last occurred." +"return ``e``), :func:`exc_info` returns the tuple ``(type(e), e, e." +"__traceback__)``. That is, a tuple containing the type of the exception (a " +"subclass of :exc:`BaseException`), the exception itself, and a :ref:" +"`traceback object ` which typically encapsulates the call " +"stack at the point where the exception last occurred." msgstr "" #: ../../library/sys.rst:463 @@ -585,8 +583,8 @@ msgstr "" msgid "" "The ``type`` and ``traceback`` fields are now derived from the ``value`` " "(the exception instance), so when an exception is modified while it is being " -"handled, the changes are reflected in the results of subsequent calls " -"to :func:`exc_info`." +"handled, the changes are reflected in the results of subsequent calls to :" +"func:`exc_info`." msgstr "" #: ../../library/sys.rst:474 @@ -595,22 +593,21 @@ msgid "" "dependent Python files are installed; by default, this is also ``'/usr/" "local'``. This can be set at build time with the ``--exec-prefix`` argument " "to the :program:`configure` script. Specifically, all configuration files " -"(e.g. the :file:`pyconfig.h` header file) are installed in the " -"directory :file:`{exec_prefix}/lib/python{X.Y}/config`, and shared library " -"modules are installed in :file:`{exec_prefix}/lib/python{X.Y}/lib-dynload`, " -"where *X.Y* is the version number of Python, for example ``3.2``." +"(e.g. the :file:`pyconfig.h` header file) are installed in the directory :" +"file:`{exec_prefix}/lib/python{X.Y}/config`, and shared library modules are " +"installed in :file:`{exec_prefix}/lib/python{X.Y}/lib-dynload`, where *X.Y* " +"is the version number of Python, for example ``3.2``." msgstr "" #: ../../library/sys.rst:485 msgid "" -"If a :ref:`virtual environment ` is in effect, " -"this :data:`exec_prefix` will point to the virtual environment. The value " -"for the Python installation will still be available, " -"via :data:`base_exec_prefix`. Refer to :ref:`sys-path-init-virtual-" -"environments` for more information." +"If a :ref:`virtual environment ` is in effect, this :data:" +"`exec_prefix` will point to the virtual environment. The value for the " +"Python installation will still be available, via :data:`base_exec_prefix`. " +"Refer to :ref:`sys-path-init-virtual-environments` for more information." msgstr "" -#: ../../library/sys.rst:492 ../../library/sys.rst:1627 +#: ../../library/sys.rst:492 ../../library/sys.rst:1631 msgid "" "When running under a :ref:`virtual environment `, :data:`prefix` " "and :data:`exec_prefix` are now set to the virtual environment prefix by " @@ -660,9 +657,9 @@ msgstr "" #: ../../library/sys.rst:529 msgid "" -"If an error occurs in the cleanup after the Python interpreter has " -"caught :exc:`SystemExit` (such as an error flushing buffered data in the " -"standard streams), the exit status is changed to 120." +"If an error occurs in the cleanup after the Python interpreter has caught :" +"exc:`SystemExit` (such as an error flushing buffered data in the standard " +"streams), the exit status is changed to 120." msgstr "" #: ../../library/sys.rst:537 @@ -748,14 +745,14 @@ msgstr "" #: ../../library/sys.rst:602 msgid "" -":option:`-X thread_inherit_context <-X>` " -"and :envvar:`PYTHON_THREAD_INHERIT_CONTEXT`" +":option:`-X thread_inherit_context <-X>` and :envvar:" +"`PYTHON_THREAD_INHERIT_CONTEXT`" msgstr "" #: ../../library/sys.rst:606 msgid "" -":option:`-X context_aware_warnings <-X>` " -"and :envvar:`PYTHON_CONTEXT_AWARE_WARNINGS`" +":option:`-X context_aware_warnings <-X>` and :envvar:" +"`PYTHON_CONTEXT_AWARE_WARNINGS`" msgstr "" #: ../../library/sys.rst:610 @@ -976,8 +973,8 @@ msgstr "" #: ../../library/sys.rst:728 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " -"``s`` is any string representing a decimal number with at most :attr:`!" -"sys.float_info.dig` significant digits, then converting ``s`` to a float and " +"``s`` is any string representing a decimal number with at most :attr:`!sys." +"float_info.dig` significant digits, then converting ``s`` to a float and " "back again will recover a string representing the same decimal value::" msgstr "" @@ -1019,9 +1016,9 @@ msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " "debugging memory leaks. Because of the interpreter's internal caches, the " -"result can vary from call to call; you may have to " -"call :func:`_clear_internal_caches` and :func:`gc.collect` to get more " -"predictable results." +"result can vary from call to call; you may have to call :func:" +"`_clear_internal_caches` and :func:`gc.collect` to get more predictable " +"results." msgstr "" #: ../../library/sys.rst:770 @@ -1059,8 +1056,8 @@ msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` to convert between Unicode filenames and bytes " -"filenames. The filesystem error handler is returned " -"from :func:`getfilesystemencodeerrors`." +"filenames. The filesystem error handler is returned from :func:" +"`getfilesystemencodeerrors`." msgstr "" #: ../../library/sys.rst:818 @@ -1080,9 +1077,9 @@ msgstr "" #: ../../library/sys.rst:826 ../../library/sys.rst:854 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " -"startup by the :c:func:`PyConfig_Read` function: " -"see :c:member:`~PyConfig.filesystem_encoding` " -"and :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." +"startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." +"filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" +"c:type:`PyConfig`." msgstr "" #: ../../library/sys.rst:831 @@ -1091,8 +1088,8 @@ msgstr ":func:`getfilesystemencoding` 的結果不再為 ``None``。" #: ../../library/sys.rst:834 msgid "" -"Windows is no longer guaranteed to return ``'mbcs'``. See :pep:`529` " -"and :func:`_enablelegacywindowsfsencoding` for more information." +"Windows is no longer guaranteed to return ``'mbcs'``. See :pep:`529` and :" +"func:`_enablelegacywindowsfsencoding` for more information." msgstr "" #: ../../library/sys.rst:838 @@ -1105,8 +1102,8 @@ msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " "` to convert between Unicode " -"filenames and bytes filenames. The filesystem encoding is returned " -"from :func:`getfilesystemencoding`." +"filenames and bytes filenames. The filesystem encoding is returned from :" +"func:`getfilesystemencoding`." msgstr "" #: ../../library/sys.rst:863 @@ -1125,10 +1122,10 @@ msgstr "" #: ../../library/sys.rst:874 msgid "" "Note that the returned value may not actually reflect how many references to " -"the object are actually held. For example, some objects " -"are :term:`immortal` and have a very high refcount that does not reflect the " -"actual number of references. Consequently, do not rely on the returned " -"value to be accurate, other than a value of 0 or 1." +"the object are actually held. For example, some objects are :term:" +"`immortal` and have a very high refcount that does not reflect the actual " +"number of references. Consequently, do not rely on the returned value to be " +"accurate, other than a value of 0 or 1." msgstr "" #: ../../library/sys.rst:882 @@ -1147,8 +1144,8 @@ msgstr "" msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " -"causing an overflow of the C stack and crashing Python. It can be set " -"by :func:`setrecursionlimit`." +"causing an overflow of the C stack and crashing Python. It can be set by :" +"func:`setrecursionlimit`." msgstr "" #: ../../library/sys.rst:899 @@ -1187,8 +1184,8 @@ msgstr "" #: ../../library/sys.rst:920 msgid "" -"Return the interpreter's \"thread switch interval\" in seconds; " -"see :func:`setswitchinterval`." +"Return the interpreter's \"thread switch interval\" in seconds; see :func:" +"`setswitchinterval`." msgstr "" #: ../../library/sys.rst:928 @@ -1205,8 +1202,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." msgstr "" -"引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` " -"``sys._getframe``。" +"引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." +"_getframe``。" #: ../../library/sys.rst:937 ../../library/sys.rst:953 msgid "" @@ -1228,8 +1225,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." msgstr "" -"引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` " -"``sys._getframemodulename``。" +"引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." +"_getframemodulename``。" #: ../../library/sys.rst:961 msgid "" @@ -1248,14 +1245,13 @@ msgstr "" msgid "" "Objects from the list are not safe to use. Specifically, the result will " "include objects from all interpreters that share their object allocator " -"state (that is, ones created " -"with :c:member:`PyInterpreterConfig.use_main_obmalloc` set to 1 or " -"using :c:func:`Py_NewInterpreter`, and the :ref:`main interpreter `). Mixing objects from different interpreters may lead " -"to crashes or other unexpected behavior." +"state (that is, ones created with :c:member:`PyInterpreterConfig." +"use_main_obmalloc` set to 1 or using :c:func:`Py_NewInterpreter`, and the :" +"ref:`main interpreter `). Mixing objects from " +"different interpreters may lead to crashes or other unexpected behavior." msgstr "" -#: ../../library/sys.rst:980 ../../library/sys.rst:1384 +#: ../../library/sys.rst:980 ../../library/sys.rst:1388 msgid "" "This function should be used for specialized purposes only. It is not " "guaranteed to exist in all implementations of Python." @@ -1288,9 +1284,9 @@ msgid "" "*service_pack_minor*, *service_pack_major*, *suite_mask*, *product_type* and " "*platform_version*. *service_pack* contains a string, *platform_version* a 3-" "tuple and all other values are integers. The components can also be accessed " -"by name, so ``sys.getwindowsversion()[0]`` is equivalent to " -"``sys.getwindowsversion().major``. For compatibility with prior versions, " -"only the first 5 elements are retrievable by indexing." +"by name, so ``sys.getwindowsversion()[0]`` is equivalent to ``sys." +"getwindowsversion().major``. For compatibility with prior versions, only the " +"first 5 elements are retrievable by indexing." msgstr "" #: ../../library/sys.rst:1026 @@ -1367,19 +1363,19 @@ msgstr "新增 *platform_version*" #: ../../library/sys.rst:1068 msgid "" -"Returns an *asyncgen_hooks* object, which is similar to " -"a :class:`~collections.namedtuple` of the form ``(firstiter, finalizer)``, " -"where *firstiter* and *finalizer* are expected to be either ``None`` or " -"functions which take an :term:`asynchronous generator iterator` as an " -"argument, and are used to schedule finalization of an asynchronous generator " -"by an event loop." +"Returns an *asyncgen_hooks* object, which is similar to a :class:" +"`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " +"*firstiter* and *finalizer* are expected to be either ``None`` or functions " +"which take an :term:`asynchronous generator iterator` as an argument, and " +"are used to schedule finalization of an asynchronous generator by an event " +"loop." msgstr "" #: ../../library/sys.rst:1075 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`。" -#: ../../library/sys.rst:1079 ../../library/sys.rst:1874 +#: ../../library/sys.rst:1079 ../../library/sys.rst:1878 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" @@ -1387,11 +1383,11 @@ msgstr "" #: ../../library/sys.rst:1085 msgid "" -"Get the current coroutine origin tracking depth, as set " -"by :func:`set_coroutine_origin_tracking_depth`." +"Get the current coroutine origin tracking depth, as set by :func:" +"`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1091 ../../library/sys.rst:1895 +#: ../../library/sys.rst:1091 ../../library/sys.rst:1899 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." @@ -1436,10 +1432,15 @@ msgid "The size of the seed key of the hash algorithm" msgstr "" #: ../../library/sys.rst:1135 -msgid "Added *algorithm*, *hash_bits* and *seed_bits*" +msgid "Cutoff for small string DJBX33A optimization in range ``[1, cutoff)``." +msgstr "" + +#: ../../library/sys.rst:1139 +#, fuzzy +msgid "Added *algorithm*, *hash_bits*, *seed_bits*, and *cutoff*." msgstr "新增 *algorithm*、*hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:1141 +#: ../../library/sys.rst:1145 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1447,7 +1448,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:1145 +#: ../../library/sys.rst:1149 msgid "" "if sys.hexversion >= 0x010502F0:\n" " # use some advanced feature\n" @@ -1457,7 +1458,7 @@ msgid "" " ..." msgstr "" -#: ../../library/sys.rst:1152 +#: ../../library/sys.rst:1156 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1465,25 +1466,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1157 +#: ../../library/sys.rst:1161 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1162 +#: ../../library/sys.rst:1166 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:1166 +#: ../../library/sys.rst:1170 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:1170 +#: ../../library/sys.rst:1174 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1495,13 +1496,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1180 +#: ../../library/sys.rst:1184 msgid "" -"*hexversion* is the implementation version in hexadecimal format, " -"like :data:`sys.hexversion`." +"*hexversion* is the implementation version in hexadecimal format, like :data:" +"`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1183 +#: ../../library/sys.rst:1187 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1510,7 +1511,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1190 +#: ../../library/sys.rst:1194 msgid "" "*supports_isolated_interpreters* is a boolean value, whether this " "implementation supports multiple isolated interpreters. It is ``True`` for " @@ -1518,68 +1519,67 @@ msgid "" "level :mod:`!_interpreters` module." msgstr "" -#: ../../library/sys.rst:1197 +#: ../../library/sys.rst:1201 msgid ":pep:`684`, :pep:`734`, and :mod:`concurrent.interpreters`." msgstr "" -#: ../../library/sys.rst:1199 +#: ../../library/sys.rst:1203 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " -"underscore, and are not described here. Regardless of its " -"contents, :data:`sys.implementation` will not change during a run of the " -"interpreter, nor between implementation versions. (It may change between " -"Python language versions, however.) See :pep:`421` for more information." +"underscore, and are not described here. Regardless of its contents, :data:" +"`sys.implementation` will not change during a run of the interpreter, nor " +"between implementation versions. (It may change between Python language " +"versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1208 +#: ../../library/sys.rst:1212 msgid "Added ``supports_isolated_interpreters`` field." msgstr "" -#: ../../library/sys.rst:1213 +#: ../../library/sys.rst:1217 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1218 +#: ../../library/sys.rst:1222 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1223 +#: ../../library/sys.rst:1227 msgid "" "The number of bits held in each digit. Python integers are stored internally " "in base ``2**int_info.bits_per_digit``." msgstr "" -#: ../../library/sys.rst:1228 +#: ../../library/sys.rst:1232 msgid "The size in bytes of the C type used to represent a digit." msgstr "" -#: ../../library/sys.rst:1232 +#: ../../library/sys.rst:1236 msgid "" "The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1237 +#: ../../library/sys.rst:1241 msgid "" -"The minimum non-zero value " -"for :func:`sys.set_int_max_str_digits`, :envvar:`PYTHONINTMAXSTRDIGITS`, " -"or :option:`-X int_max_str_digits <-X>`." +"The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" +"`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1244 +#: ../../library/sys.rst:1248 msgid "" -"Added :attr:`~int_info.default_max_str_digits` " -"and :attr:`~int_info.str_digits_check_threshold`." +"Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." +"str_digits_check_threshold`." msgstr "" -"新增 :attr:`~int_info.default_max_str_digits` " -"和 :attr:`~int_info.str_digits_check_threshold`。" +"新增 :attr:`~int_info.default_max_str_digits` 和 :attr:`~int_info." +"str_digits_check_threshold`。" -#: ../../library/sys.rst:1250 +#: ../../library/sys.rst:1254 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1256 ../../library/sys.rst:1258 +#: ../../library/sys.rst:1260 ../../library/sys.rst:1262 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1267 +#: ../../library/sys.rst:1271 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1606,44 +1606,44 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1275 +#: ../../library/sys.rst:1279 msgid "" "Interned strings are not :term:`immortal`; you must keep a reference to the " "return value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1281 +#: ../../library/sys.rst:1285 msgid "" "Return :const:`True` if the :term:`GIL` is enabled and :const:`False` if it " "is disabled." msgstr "" -#: ../../library/sys.rst:1288 ../../library/sys.rst:1396 +#: ../../library/sys.rst:1292 ../../library/sys.rst:1400 msgid "It is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:1292 +#: ../../library/sys.rst:1296 msgid "" "Return :const:`True` if the main Python interpreter is :term:`shutting down " "`. Return :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1295 +#: ../../library/sys.rst:1299 msgid "See also the :exc:`PythonFinalizationError` exception." msgstr "另請參閱 :exc:`PythonFinalizationError` 例外。" -#: ../../library/sys.rst:1301 +#: ../../library/sys.rst:1305 msgid "Utilities for observing just-in-time compilation." msgstr "" -#: ../../library/sys.rst:1305 +#: ../../library/sys.rst:1309 msgid "" -"JIT compilation is an *experimental implementation detail* of CPython. " -"``sys._jit`` is not guaranteed to exist or behave the same way in all Python " +"JIT compilation is an *experimental implementation detail* of CPython. ``sys." +"_jit`` is not guaranteed to exist or behave the same way in all Python " "implementations, versions, or build configurations." msgstr "" -#: ../../library/sys.rst:1313 +#: ../../library/sys.rst:1317 msgid "" "Return ``True`` if the current Python executable supports JIT compilation, " "and ``False`` otherwise. This can be controlled by building CPython with " @@ -1651,28 +1651,28 @@ msgid "" "experimental-jit` option on all other platforms." msgstr "" -#: ../../library/sys.rst:1320 +#: ../../library/sys.rst:1324 msgid "" "Return ``True`` if JIT compilation is enabled for the current Python process " "(implies :func:`sys._jit.is_available`), and ``False`` otherwise. If JIT " -"compilation is available, this can be controlled by setting " -"the :envvar:`PYTHON_JIT` environment variable to ``0`` (disabled) or ``1`` " -"(enabled) at interpreter startup." +"compilation is available, this can be controlled by setting the :envvar:" +"`PYTHON_JIT` environment variable to ``0`` (disabled) or ``1`` (enabled) at " +"interpreter startup." msgstr "" -#: ../../library/sys.rst:1328 +#: ../../library/sys.rst:1332 msgid "" "Return ``True`` if the topmost Python frame is currently executing JIT code " "(implies :func:`sys._jit.is_enabled`), and ``False`` otherwise." msgstr "" -#: ../../library/sys.rst:1333 +#: ../../library/sys.rst:1337 msgid "" "This function is intended for testing and debugging the JIT itself. It " "should be avoided for any other purpose." msgstr "" -#: ../../library/sys.rst:1338 +#: ../../library/sys.rst:1342 msgid "" "Due to the nature of tracing JIT compilers, repeated calls to this function " "may give surprising results. For example, branching on its return value will " @@ -1680,7 +1680,7 @@ msgid "" "entered or exited):" msgstr "" -#: ../../library/sys.rst:1343 +#: ../../library/sys.rst:1347 msgid "" ">>> for warmup in range(BIG_NUMBER):\n" "... # This line is \"hot\", and is eventually JIT-compiled:\n" @@ -1695,7 +1695,7 @@ msgid "" "AssertionError" msgstr "" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1363 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1706,100 +1706,99 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1371 +#: ../../library/sys.rst:1375 msgid "" "Return :const:`True` if the given object is :term:`immortal`, :const:`False` " "otherwise." msgstr "" -#: ../../library/sys.rst:1376 +#: ../../library/sys.rst:1380 msgid "" "Objects that are immortal (and thus return ``True`` upon being passed to " "this function) are not guaranteed to be immortal in future versions, and " "vice versa for mortal objects." msgstr "" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1393 msgid "" "Return :const:`True` if the given string is \"interned\", :const:`False` " "otherwise." msgstr "" -#: ../../library/sys.rst:1403 +#: ../../library/sys.rst:1407 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " -"hold the legacy representation of ``sys.last_exc``, as returned " -"from :func:`exc_info` above." +"hold the legacy representation of ``sys.last_exc``, as returned from :func:" +"`exc_info` above." msgstr "" -#: ../../library/sys.rst:1409 +#: ../../library/sys.rst:1413 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1416 +#: ../../library/sys.rst:1420 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1419 +#: ../../library/sys.rst:1423 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1427 +#: ../../library/sys.rst:1431 msgid "" -"A list of :term:`meta path finder` objects that have " -"their :meth:`~importlib.abc.MetaPathFinder.find_spec` methods called to see " -"if one of the objects can find the module to be imported. By default, it " -"holds entries that implement Python's default import semantics. " -"The :meth:`~importlib.abc.MetaPathFinder.find_spec` method is called with at " -"least the absolute name of the module being imported. If the module to be " -"imported is contained in a package, then the parent " -"package's :attr:`~module.__path__` attribute is passed in as a second " -"argument. The method returns a :term:`module spec`, or ``None`` if the " -"module cannot be found." +"A list of :term:`meta path finder` objects that have their :meth:`~importlib." +"abc.MetaPathFinder.find_spec` methods called to see if one of the objects " +"can find the module to be imported. By default, it holds entries that " +"implement Python's default import semantics. The :meth:`~importlib.abc." +"MetaPathFinder.find_spec` method is called with at least the absolute name " +"of the module being imported. If the module to be imported is contained in a " +"package, then the parent package's :attr:`~module.__path__` attribute is " +"passed in as a second argument. The method returns a :term:`module spec`, or " +"``None`` if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1440 +#: ../../library/sys.rst:1444 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1441 +#: ../../library/sys.rst:1445 msgid "" -"The abstract base class defining the interface of finder objects " -"on :data:`meta_path`." +"The abstract base class defining the interface of finder objects on :data:" +"`meta_path`." msgstr "" -#: ../../library/sys.rst:1443 +#: ../../library/sys.rst:1447 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1444 +#: ../../library/sys.rst:1448 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1450 +#: ../../library/sys.rst:1454 msgid "" -":term:`Module specs ` were introduced in Python 3.4, " -"by :pep:`451`." +":term:`Module specs ` were introduced in Python 3.4, by :pep:" +"`451`." msgstr "" -#: ../../library/sys.rst:1455 +#: ../../library/sys.rst:1459 msgid "" -"Removed the fallback that looked for a :meth:`!find_module` method if " -"a :data:`meta_path` entry didn't have " -"a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." +"Removed the fallback that looked for a :meth:`!find_module` method if a :" +"data:`meta_path` entry didn't have a :meth:`~importlib.abc.MetaPathFinder." +"find_spec` method." msgstr "" -#: ../../library/sys.rst:1461 +#: ../../library/sys.rst:1465 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1811,13 +1810,13 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1473 +#: ../../library/sys.rst:1477 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1476 +#: ../../library/sys.rst:1480 msgid "" "The elements of :data:`sys.orig_argv` are the arguments to the Python " "interpreter, while the elements of :data:`sys.argv` are the arguments to the " @@ -1825,68 +1824,68 @@ msgid "" "in :data:`sys.orig_argv` and missing from :data:`sys.argv`." msgstr "" -#: ../../library/sys.rst:1488 +#: ../../library/sys.rst:1492 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1492 +#: ../../library/sys.rst:1496 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1496 +#: ../../library/sys.rst:1500 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1498 +#: ../../library/sys.rst:1502 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1504 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1503 +#: ../../library/sys.rst:1507 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1506 +#: ../../library/sys.rst:1510 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1512 +#: ../../library/sys.rst:1516 msgid "" -"Module :mod:`site` This describes how to use .pth files to " -"extend :data:`sys.path`." +"Module :mod:`site` This describes how to use .pth files to extend :data:`sys." +"path`." msgstr "" -#: ../../library/sys.rst:1517 +#: ../../library/sys.rst:1521 msgid "" -"A list of callables that take a path argument to try to create " -"a :term:`finder` for the path. If a finder can be created, it is to be " -"returned by the callable, else raise :exc:`ImportError`." +"A list of callables that take a path argument to try to create a :term:" +"`finder` for the path. If a finder can be created, it is to be returned by " +"the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1521 ../../library/sys.rst:1532 +#: ../../library/sys.rst:1525 ../../library/sys.rst:1536 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1526 +#: ../../library/sys.rst:1530 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1894,99 +1893,99 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1537 +#: ../../library/sys.rst:1541 msgid "A string containing a platform identifier. Known values are:" msgstr "" -#: ../../library/sys.rst:1540 +#: ../../library/sys.rst:1544 msgid "System" msgstr "系統" -#: ../../library/sys.rst:1540 +#: ../../library/sys.rst:1544 msgid "``platform`` value" msgstr "``platform`` 值" -#: ../../library/sys.rst:1542 +#: ../../library/sys.rst:1546 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1542 +#: ../../library/sys.rst:1546 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1543 +#: ../../library/sys.rst:1547 msgid "Android" msgstr "Android" -#: ../../library/sys.rst:1543 +#: ../../library/sys.rst:1547 msgid "``'android'``" msgstr "``'android'``" -#: ../../library/sys.rst:1544 +#: ../../library/sys.rst:1548 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1544 +#: ../../library/sys.rst:1548 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1549 msgid "FreeBSD" msgstr "FreeBSD" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1549 msgid "``'freebsd'``" msgstr "``'freebsd'``" -#: ../../library/sys.rst:1546 +#: ../../library/sys.rst:1550 msgid "iOS" msgstr "iOS" -#: ../../library/sys.rst:1546 +#: ../../library/sys.rst:1550 msgid "``'ios'``" msgstr "``'ios'``" -#: ../../library/sys.rst:1547 +#: ../../library/sys.rst:1551 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1547 +#: ../../library/sys.rst:1551 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1548 +#: ../../library/sys.rst:1552 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1548 +#: ../../library/sys.rst:1552 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1549 +#: ../../library/sys.rst:1553 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1549 +#: ../../library/sys.rst:1553 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1550 +#: ../../library/sys.rst:1554 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1550 +#: ../../library/sys.rst:1554 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1551 +#: ../../library/sys.rst:1555 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1551 +#: ../../library/sys.rst:1555 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1554 +#: ../../library/sys.rst:1558 msgid "" "On Unix systems not listed in the table, the value is the lowercased OS name " "as returned by ``uname -s``, with the first part of the version as returned " @@ -1995,7 +1994,7 @@ msgid "" "therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1560 +#: ../../library/sys.rst:1564 msgid "" "if sys.platform.startswith('sunos'):\n" " # SunOS-specific code here..." @@ -2003,81 +2002,81 @@ msgstr "" "if sys.platform.startswith('sunos'):\n" " # 這裡會是 SunOS 專屬的程式碼..." -#: ../../library/sys.rst:1563 +#: ../../library/sys.rst:1567 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``." msgstr "" -#: ../../library/sys.rst:1567 +#: ../../library/sys.rst:1571 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``." msgstr "" -#: ../../library/sys.rst:1571 +#: ../../library/sys.rst:1575 msgid "" "On Android, :data:`sys.platform` now returns ``'android'`` rather than " "``'linux'``." msgstr "" -#: ../../library/sys.rst:1575 +#: ../../library/sys.rst:1579 msgid "" "On FreeBSD, :data:`sys.platform` doesn't contain the major version anymore. " "It is always ``'freebsd'``, instead of ``'freebsd13'`` or ``'freebsd14'``." msgstr "" -#: ../../library/sys.rst:1581 +#: ../../library/sys.rst:1585 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1584 +#: ../../library/sys.rst:1588 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1590 +#: ../../library/sys.rst:1594 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1593 +#: ../../library/sys.rst:1597 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " -"equal to ``\"lib64\"`` on 64-bit platforms which gives the following " -"``sys.path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" +"equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." +"path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1601 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1599 +#: ../../library/sys.rst:1603 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1602 +#: ../../library/sys.rst:1606 msgid "" -"``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, " -"not :data:`sys.platlibdir`): Third-party modules" +"``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." +"platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1604 +#: ../../library/sys.rst:1608 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1612 +#: ../../library/sys.rst:1616 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -2086,7 +2085,7 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1620 +#: ../../library/sys.rst:1624 msgid "" "If a :ref:`virtual environment ` is in effect, this :data:`prefix` " "will point to the virtual environment. The value for the Python installation " @@ -2094,7 +2093,7 @@ msgid "" "init-virtual-environments` for more information." msgstr "" -#: ../../library/sys.rst:1644 +#: ../../library/sys.rst:1648 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -2104,25 +2103,25 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1654 +#: ../../library/sys.rst:1658 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " "enable a lazy resolving of symbols when importing a module, if called as " "``sys.setdlopenflags(0)``. To share symbols across extension modules, call " "as ``sys.setdlopenflags(os.RTLD_GLOBAL)``. Symbolic names for the flag " -"values can be found in the :mod:`os` module (:samp:`RTLD_{xxx}` constants, " -"e.g. :const:`os.RTLD_LAZY`)." +"values can be found in the :mod:`os` module (:samp:`RTLD_{xxx}` constants, e." +"g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1666 +#: ../../library/sys.rst:1670 msgid "" "Set the :ref:`integer string conversion length limitation " -"` used by this interpreter. See " -"also :func:`get_int_max_str_digits`." +"` used by this interpreter. See also :func:" +"`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1678 +#: ../../library/sys.rst:1682 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -2137,14 +2136,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1690 +#: ../../library/sys.rst:1694 msgid "" -"The same tracing mechanism is used for :func:`!setprofile` " -"as :func:`settrace`. To trace calls with :func:`!setprofile` inside a " -"tracing function (e.g. in a debugger breakpoint), see :func:`call_tracing`." +"The same tracing mechanism is used for :func:`!setprofile` as :func:" +"`settrace`. To trace calls with :func:`!setprofile` inside a tracing " +"function (e.g. in a debugger breakpoint), see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1694 +#: ../../library/sys.rst:1698 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2152,71 +2151,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1699 ../../library/sys.rst:1786 +#: ../../library/sys.rst:1703 ../../library/sys.rst:1790 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1701 ../../library/sys.rst:1788 +#: ../../library/sys.rst:1705 ../../library/sys.rst:1792 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1702 +#: ../../library/sys.rst:1706 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1705 ../../library/sys.rst:1803 +#: ../../library/sys.rst:1709 ../../library/sys.rst:1807 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1706 +#: ../../library/sys.rst:1710 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1710 +#: ../../library/sys.rst:1714 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1715 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1714 +#: ../../library/sys.rst:1718 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1715 +#: ../../library/sys.rst:1719 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1717 +#: ../../library/sys.rst:1721 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1718 +#: ../../library/sys.rst:1722 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1720 +#: ../../library/sys.rst:1724 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1725 +#: ../../library/sys.rst:1729 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1729 +#: ../../library/sys.rst:1733 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -2224,19 +2223,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1734 +#: ../../library/sys.rst:1738 msgid "" -"If the new limit is too low at the current recursion depth, " -"a :exc:`RecursionError` exception is raised." +"If the new limit is too low at the current recursion depth, a :exc:" +"`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1737 +#: ../../library/sys.rst:1741 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1744 +#: ../../library/sys.rst:1748 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2247,16 +2246,16 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1761 +#: ../../library/sys.rst:1765 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " "debugger to support multiple threads, it must register a trace function " -"using :func:`settrace` for each thread being debugged or " -"use :func:`threading.settrace`." +"using :func:`settrace` for each thread being debugged or use :func:" +"`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1766 +#: ../../library/sys.rst:1770 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the :ref:`current stack frame `. *event* is a " @@ -2264,7 +2263,7 @@ msgid "" "``'opcode'``. *arg* depends on the event type." msgstr "" -#: ../../library/sys.rst:1771 +#: ../../library/sys.rst:1775 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2272,36 +2271,36 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1776 +#: ../../library/sys.rst:1780 msgid "" "The local trace function should return a reference to itself, or to another " "function which would then be used as the local trace function for the scope." msgstr "" -#: ../../library/sys.rst:1779 +#: ../../library/sys.rst:1783 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1783 +#: ../../library/sys.rst:1787 msgid "" "Tracing is disabled while calling the trace function (e.g. a function set " "by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1789 +#: ../../library/sys.rst:1793 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1793 +#: ../../library/sys.rst:1797 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1794 +#: ../../library/sys.rst:1798 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2311,7 +2310,7 @@ msgid "" "to :const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1804 +#: ../../library/sys.rst:1808 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2319,62 +2318,62 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1809 +#: ../../library/sys.rst:1813 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1810 +#: ../../library/sys.rst:1814 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1814 +#: ../../library/sys.rst:1818 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1815 +#: ../../library/sys.rst:1819 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " "value specifies the new local trace function. Per-opcode events are not " -"emitted by default: they must be explicitly requested by " -"setting :attr:`~frame.f_trace_opcodes` to :const:`True` on the :ref:`frame " -"`." +"emitted by default: they must be explicitly requested by setting :attr:" +"`~frame.f_trace_opcodes` to :const:`True` on the :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1822 +#: ../../library/sys.rst:1826 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1825 +#: ../../library/sys.rst:1829 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " "it being set indirectly via the return value from an already installed trace " "function. This is also required for activating the trace function on the " "current frame, which :func:`settrace` doesn't do. Note that in order for " -"this to work, a global tracing function must have been installed " -"with :func:`settrace` in order to enable the runtime tracing machinery, but " -"it doesn't need to be the same tracing function (e.g. it could be a low " -"overhead tracing function that simply returns ``None`` to disable itself " -"immediately on each frame)." +"this to work, a global tracing function must have been installed with :func:" +"`settrace` in order to enable the runtime tracing machinery, but it doesn't " +"need to be the same tracing function (e.g. it could be a low overhead " +"tracing function that simply returns ``None`` to disable itself immediately " +"on each frame)." msgstr "" -#: ../../library/sys.rst:1836 +#: ../../library/sys.rst:1840 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1838 +#: ../../library/sys.rst:1842 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.settrace``。" -#: ../../library/sys.rst:1842 +#: ../../library/sys.rst:1846 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2382,51 +2381,51 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1849 +#: ../../library/sys.rst:1853 msgid "" -"``'opcode'`` event type added; :attr:`~frame.f_trace_lines` " -"and :attr:`~frame.f_trace_opcodes` attributes added to frames" +"``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:" +"`~frame.f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1854 +#: ../../library/sys.rst:1858 msgid "" -"Accepts two optional keyword arguments which are callables that accept " -"an :term:`asynchronous generator iterator` as an argument. The *firstiter* " +"Accepts two optional keyword arguments which are callables that accept an :" +"term:`asynchronous generator iterator` as an argument. The *firstiter* " "callable will be called when an asynchronous generator is iterated for the " "first time. The *finalizer* will be called when an asynchronous generator is " "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1860 +#: ../../library/sys.rst:1864 msgid "" -"Raises an :ref:`auditing event ` " -"``sys.set_asyncgen_hooks_firstiter`` with no arguments." +"Raises an :ref:`auditing event ` ``sys." +"set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` " -"``sys.set_asyncgen_hooks_firstiter``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." +"set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1862 +#: ../../library/sys.rst:1866 msgid "" -"Raises an :ref:`auditing event ` " -"``sys.set_asyncgen_hooks_finalizer`` with no arguments." +"Raises an :ref:`auditing event ` ``sys." +"set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` " -"``sys.set_asyncgen_hooks_finalizer``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." +"set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1864 +#: ../../library/sys.rst:1868 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1867 +#: ../../library/sys.rst:1871 msgid "" "See :pep:`525` for more details, and for a reference example of a " -"*finalizer* method see the implementation of " -"``asyncio.Loop.shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" +"*finalizer* method see the implementation of ``asyncio.Loop." +"shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1879 +#: ../../library/sys.rst:1883 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2435,53 +2434,53 @@ msgid "" "disabled, ``cr_origin`` will be ``None``." msgstr "" -#: ../../library/sys.rst:1886 +#: ../../library/sys.rst:1890 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, set *depth* to zero." msgstr "" -#: ../../library/sys.rst:1890 +#: ../../library/sys.rst:1894 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1900 +#: ../../library/sys.rst:1904 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1903 +#: ../../library/sys.rst:1907 msgid "Stack trampolines cannot be activated if the JIT is active." msgstr "" -#: ../../library/sys.rst:1911 +#: ../../library/sys.rst:1915 msgid ":ref:`perf_profiling`" msgstr ":ref:`perf_profiling`" -#: ../../library/sys.rst:1912 +#: ../../library/sys.rst:1916 msgid "https://perf.wiki.kernel.org" msgstr "https://perf.wiki.kernel.org" -#: ../../library/sys.rst:1916 +#: ../../library/sys.rst:1920 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1918 +#: ../../library/sys.rst:1922 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1926 +#: ../../library/sys.rst:1930 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1935 +#: ../../library/sys.rst:1939 msgid "" "Executes *script*, a file containing Python code in the remote process with " "the given *pid*." msgstr "" -#: ../../library/sys.rst:1938 +#: ../../library/sys.rst:1942 msgid "" "This function returns immediately, and the code will be executed by the " "target process's main thread at the next available opportunity, similarly to " @@ -2491,7 +2490,7 @@ msgid "" "been overwritten." msgstr "" -#: ../../library/sys.rst:1945 +#: ../../library/sys.rst:1949 msgid "" "The remote process must be running a CPython interpreter of the same major " "and minor version as the local process. If either the local or remote " @@ -2499,15 +2498,15 @@ msgid "" "local and remote interpreters must be the same exact version." msgstr "" -#: ../../library/sys.rst:1950 ../../library/sys.rst:1952 +#: ../../library/sys.rst:1954 ../../library/sys.rst:1956 msgid "" "When the code is executed in the remote process, an :ref:`auditing event " "` ``sys.remote_exec`` is raised with the *pid* and the path to the " -"script file. This event is raised in the process that " -"called :func:`sys.remote_exec`." +"script file. This event is raised in the process that called :func:`sys." +"remote_exec`." msgstr "" -#: ../../library/sys.rst:1957 ../../library/sys.rst:1959 +#: ../../library/sys.rst:1961 ../../library/sys.rst:1963 msgid "" "When the script is executed in the remote process, an :ref:`auditing event " "` ``cpython.remote_debugger_script`` is raised with the path in " @@ -2515,75 +2514,74 @@ msgid "" "that called :func:`sys.remote_exec`." msgstr "" -#: ../../library/sys.rst:1972 +#: ../../library/sys.rst:1976 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1976 +#: ../../library/sys.rst:1980 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1979 +#: ../../library/sys.rst:1983 msgid "" -"See also :func:`sys.getfilesystemencoding` " -"and :func:`sys.getfilesystemencodeerrors`." +"See also :func:`sys.getfilesystemencoding` and :func:`sys." +"getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1985 +#: ../../library/sys.rst:1989 msgid "" "Changing the filesystem encoding after Python startup is risky because the " "old fsencoding or paths encoded by the old fsencoding may be cached " "somewhere. Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" -#: ../../library/sys.rst:1989 +#: ../../library/sys.rst:1993 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`。" -#: ../../library/sys.rst:1992 +#: ../../library/sys.rst:1996 msgid "Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" -#: ../../library/sys.rst:1999 +#: ../../library/sys.rst:2003 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:2002 +#: ../../library/sys.rst:2006 msgid "" -"``stdin`` is used for all interactive input (including calls " -"to :func:`input`);" +"``stdin`` is used for all interactive input (including calls to :func:" +"`input`);" msgstr "" -#: ../../library/sys.rst:2004 +#: ../../library/sys.rst:2008 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:2006 +#: ../../library/sys.rst:2010 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:2008 +#: ../../library/sys.rst:2012 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:2012 +#: ../../library/sys.rst:2016 msgid "" -"The encoding and error handling are is initialized " -"from :c:member:`PyConfig.stdio_encoding` " -"and :c:member:`PyConfig.stdio_errors`." +"The encoding and error handling are is initialized from :c:member:`PyConfig." +"stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:2015 +#: ../../library/sys.rst:2019 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2594,45 +2592,44 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:2024 +#: ../../library/sys.rst:2028 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:2029 +#: ../../library/sys.rst:2033 msgid "" -"Under all platforms, you can override the character encoding by setting " -"the :envvar:`PYTHONIOENCODING` environment variable before starting Python " -"or by using the new :option:`-X` ``utf8`` command line option " -"and :envvar:`PYTHONUTF8` environment variable. However, for the Windows " -"console, this only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also " -"set." +"Under all platforms, you can override the character encoding by setting the :" +"envvar:`PYTHONIOENCODING` environment variable before starting Python or by " +"using the new :option:`-X` ``utf8`` command line option and :envvar:" +"`PYTHONUTF8` environment variable. However, for the Windows console, this " +"only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:2036 +#: ../../library/sys.rst:2040 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" "buffered in both cases. You can make both streams unbuffered by passing " -"the :option:`-u` command-line option or setting " -"the :envvar:`PYTHONUNBUFFERED` environment variable." +"the :option:`-u` command-line option or setting the :envvar:" +"`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:2042 +#: ../../library/sys.rst:2046 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:2048 +#: ../../library/sys.rst:2052 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:2052 +#: ../../library/sys.rst:2056 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2640,7 +2637,7 @@ msgid "" "support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:2062 +#: ../../library/sys.rst:2066 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2648,7 +2645,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:2067 +#: ../../library/sys.rst:2071 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2656,7 +2653,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:2073 +#: ../../library/sys.rst:2077 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2664,12 +2661,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:2081 +#: ../../library/sys.rst:2085 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:2083 +#: ../../library/sys.rst:2087 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2677,7 +2674,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:2088 +#: ../../library/sys.rst:2092 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2685,60 +2682,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:2093 +#: ../../library/sys.rst:2097 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:2100 +#: ../../library/sys.rst:2104 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:2105 +#: ../../library/sys.rst:2109 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:2107 +#: ../../library/sys.rst:2111 msgid "``\"nt\"``: Windows threads" msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:2108 +#: ../../library/sys.rst:2112 msgid "``\"pthread\"``: POSIX threads" msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:2109 +#: ../../library/sys.rst:2113 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:2111 +#: ../../library/sys.rst:2115 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:2115 +#: ../../library/sys.rst:2119 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:2117 +#: ../../library/sys.rst:2121 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:2118 +#: ../../library/sys.rst:2122 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:2119 +#: ../../library/sys.rst:2123 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:2123 +#: ../../library/sys.rst:2127 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:2131 +#: ../../library/sys.rst:2135 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2747,73 +2744,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:2139 +#: ../../library/sys.rst:2143 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:2141 +#: ../../library/sys.rst:2145 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:2145 +#: ../../library/sys.rst:2149 msgid "The *unraisable* argument has the following attributes:" msgstr "*unraisable* 引數具有以下屬性:" -#: ../../library/sys.rst:2147 +#: ../../library/sys.rst:2151 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:2148 +#: ../../library/sys.rst:2152 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:2149 +#: ../../library/sys.rst:2153 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:2150 +#: ../../library/sys.rst:2154 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:2151 +#: ../../library/sys.rst:2155 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:2153 +#: ../../library/sys.rst:2157 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " -"``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message " -"if :attr:`!err_msg` is ``None``." +"``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" +"attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:2157 +#: ../../library/sys.rst:2161 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:2162 +#: ../../library/sys.rst:2166 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:2166 +#: ../../library/sys.rst:2170 msgid "" "Storing :attr:`!exc_value` using a custom hook can create a reference cycle. " "It should be cleared explicitly to break the reference cycle when the " "exception is no longer needed." msgstr "" -#: ../../library/sys.rst:2170 +#: ../../library/sys.rst:2174 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:2174 ../../library/sys.rst:2176 +#: ../../library/sys.rst:2178 ../../library/sys.rst:2180 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2821,7 +2818,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:2185 +#: ../../library/sys.rst:2189 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2830,41 +2827,41 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:2194 +#: ../../library/sys.rst:2198 msgid "" "The C API version, equivalent to the C macro :c:macro:`PYTHON_API_VERSION`. " "Defined for backwards compatibility." msgstr "" -#: ../../library/sys.rst:2197 +#: ../../library/sys.rst:2201 msgid "" "Currently, this constant is not updated in new Python versions, and is not " "useful for versioning. This may change in the future." msgstr "" -#: ../../library/sys.rst:2203 +#: ../../library/sys.rst:2207 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " "*releaselevel* are integers; the release level is ``'alpha'``, ``'beta'``, " "``'candidate'``, or ``'final'``. The ``version_info`` value corresponding " "to the Python version 2.0 is ``(2, 0, 0, 'final', 0)``. The components can " -"also be accessed by name, so ``sys.version_info[0]`` is equivalent to " -"``sys.version_info.major`` and so on." +"also be accessed by name, so ``sys.version_info[0]`` is equivalent to ``sys." +"version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:2211 +#: ../../library/sys.rst:2215 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:2216 +#: ../../library/sys.rst:2220 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:2223 +#: ../../library/sys.rst:2227 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2873,20 +2870,20 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:2235 +#: ../../library/sys.rst:2239 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:2241 +#: ../../library/sys.rst:2245 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:2245 +#: ../../library/sys.rst:2249 msgid "" "$ ./python -Xa=b -Xc\n" "Python 3.2a3+ (py3k, Oct 16 2010, 20:14:50)\n" @@ -2906,18 +2903,18 @@ msgstr "" ">>> sys._xoptions\n" "{'a': 'b', 'c': True}" -#: ../../library/sys.rst:2257 +#: ../../library/sys.rst:2261 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:2265 +#: ../../library/sys.rst:2269 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:2266 +#: ../../library/sys.rst:2270 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2938,50 +2935,50 @@ msgstr "object(物件)" msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:990 ../../library/sys.rst:1674 +#: ../../library/sys.rst:990 ../../library/sys.rst:1678 msgid "profile function" msgstr "" -#: ../../library/sys.rst:990 ../../library/sys.rst:1674 +#: ../../library/sys.rst:990 ../../library/sys.rst:1678 msgid "profiler" msgstr "" -#: ../../library/sys.rst:999 ../../library/sys.rst:1757 +#: ../../library/sys.rst:999 ../../library/sys.rst:1761 msgid "trace function" msgstr "" -#: ../../library/sys.rst:999 ../../library/sys.rst:1757 +#: ../../library/sys.rst:999 ../../library/sys.rst:1761 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1486 +#: ../../library/sys.rst:1490 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1486 +#: ../../library/sys.rst:1490 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1486 +#: ../../library/sys.rst:1490 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1638 +#: ../../library/sys.rst:1642 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1638 +#: ../../library/sys.rst:1642 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1638 +#: ../../library/sys.rst:1642 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1638 +#: ../../library/sys.rst:1642 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1638 +#: ../../library/sys.rst:1642 msgid "..." msgstr "..." diff --git a/library/time.po b/library/time.po index 0c9428095c1..45c42ebc429 100644 --- a/library/time.po +++ b/library/time.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 00:16+0000\n" +"POT-Creation-Date: 2025-11-09 00:17+0000\n" "PO-Revision-Date: 2024-11-20 15:25+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -613,14 +613,15 @@ msgid "Windows implementation" msgstr "Windows 實作" #: ../../library/time.rst:396 +#, fuzzy msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " "time slice to any other thread that is ready to run. If there are no other " "threads ready to run, the function returns immediately, and the thread " -"continues execution. On Windows 8.1 and newer the implementation uses a " -"`high-resolution timer `_ which provides resolution of 100 " -"nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." +"continues execution. On Windows 10 and newer the implementation uses a " +"`high-resolution timer `_ which provides resolution of " +"100 nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." msgstr "" "在 Windows 上,如果 *secs* 為零,則執行緒將其剩餘的時間片段讓給任何準備運行的" "其他執行緒。如果沒有其他執行緒準備運行,該函式將立即回傳,而執行緒會繼續執" From 66b11180230c60c4aaf58bb1444a14220d909b4f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 9 Nov 2025 17:04:05 +0000 Subject: [PATCH 3/9] sync with cpython a8b27305 --- c-api/allocation.po | 132 ++++-- c-api/concrete.po | 6 +- c-api/curses.po | 185 +++++++++ c-api/veryhigh.po | 153 ++++--- c-api/weakref.po | 51 +-- library/os.po | 986 ++++++++++++++++++++++---------------------- 6 files changed, 891 insertions(+), 622 deletions(-) create mode 100644 c-api/curses.po diff --git a/c-api/allocation.po b/c-api/allocation.po index 25affaa91f6..cd511b78abf 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -9,7 +9,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-11-09 17:02+0000\n" "PO-Revision-Date: 2022-10-16 15:35+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,10 +37,10 @@ msgstr "" #: ../../c-api/allocation.rst:24 msgid "" -"In general, consider this function to be a low-level routine. " -"Use :c:member:`~PyTypeObject.tp_alloc` where possible. For " -"implementing :c:member:`!tp_alloc` for your type, " -"prefer :c:func:`PyType_GenericAlloc` or :c:func:`PyObject_New`." +"In general, consider this function to be a low-level routine. Use :c:member:" +"`~PyTypeObject.tp_alloc` where possible. For implementing :c:member:`!" +"tp_alloc` for your type, prefer :c:func:`PyType_GenericAlloc` or :c:func:" +"`PyObject_New`." msgstr "" #: ../../c-api/allocation.rst:31 @@ -66,15 +66,15 @@ msgstr "" #: ../../c-api/allocation.rst:48 msgid "" "Allocates a new Python object using the C structure type *TYPE* and the " -"Python type object *typeobj* (``PyTypeObject*``) by " -"calling :c:func:`PyObject_Malloc` to allocate memory and initializing it " -"like :c:func:`PyObject_Init`. The caller will own the only reference to the " -"object (i.e. its reference count will be one)." +"Python type object *typeobj* (``PyTypeObject*``) by calling :c:func:" +"`PyObject_Malloc` to allocate memory and initializing it like :c:func:" +"`PyObject_Init`. The caller will own the only reference to the object (i.e. " +"its reference count will be one)." msgstr "" "使用 C 結構型別 *TYPE* 和 Python 型別物件 *typeobj* (``PyTypeObject*``) 分配" -"一個新的 Python 物件。它會呼叫 :c:func:`PyObject_Malloc` 來分配記憶體," -"並且會像 :c:func:`PyObject_Init` 一樣初始化它。呼叫者會擁有該物件的唯一參照" -"(也就是它的參照計數會是 1)。" +"一個新的 Python 物件。它會呼叫 :c:func:`PyObject_Malloc` 來分配記憶體,並且會" +"像 :c:func:`PyObject_Init` 一樣初始化它。呼叫者會擁有該物件的唯一參照(也就是" +"它的參照計數會是 1)。" #: ../../c-api/allocation.rst:54 ../../c-api/allocation.rst:107 msgid "" @@ -84,30 +84,28 @@ msgstr "" #: ../../c-api/allocation.rst:57 ../../c-api/allocation.rst:110 msgid "" -"When populating a type's :c:member:`~PyTypeObject.tp_alloc` " -"slot, :c:func:`PyType_GenericAlloc` is preferred over a custom function that " -"simply calls this macro." +"When populating a type's :c:member:`~PyTypeObject.tp_alloc` slot, :c:func:" +"`PyType_GenericAlloc` is preferred over a custom function that simply calls " +"this macro." msgstr "" #: ../../c-api/allocation.rst:61 msgid "" -"This macro does not " -"call :c:member:`~PyTypeObject.tp_alloc`, :c:member:`~PyTypeObject.tp_new` " -"(:meth:`~object.__new__`), or :c:member:`~PyTypeObject.tp_init` " -"(:meth:`~object.__init__`)." +"This macro does not call :c:member:`~PyTypeObject.tp_alloc`, :c:member:" +"`~PyTypeObject.tp_new` (:meth:`~object.__new__`), or :c:member:" +"`~PyTypeObject.tp_init` (:meth:`~object.__init__`)." msgstr "" -"這個巨集不會呼叫 :c:member:`~PyTypeObject.tp_alloc`、:c:member:`~PyTypeObject.tp_new` " -"(:meth:`~object.__new__`)、或 :c:member:`~PyTypeObject.tp_init` " -"(:meth:`~object.__init__`)。" +"這個巨集不會呼叫 :c:member:`~PyTypeObject.tp_alloc`、:c:member:" +"`~PyTypeObject.tp_new` (:meth:`~object.__new__`)、或 :c:member:" +"`~PyTypeObject.tp_init` (:meth:`~object.__init__`)。" #: ../../c-api/allocation.rst:65 msgid "" -"This cannot be used for objects with :c:macro:`Py_TPFLAGS_HAVE_GC` set " -"in :c:member:`~PyTypeObject.tp_flags`; use :c:macro:`PyObject_GC_New` " -"instead." +"This cannot be used for objects with :c:macro:`Py_TPFLAGS_HAVE_GC` set in :c:" +"member:`~PyTypeObject.tp_flags`; use :c:macro:`PyObject_GC_New` instead." msgstr "" -"這不能用於有在 :c:member:`~PyTypeObject.tp_flags` 中設定 " -":c:macro:`Py_TPFLAGS_HAVE_GC` 的物件;請改用 :c:macro:`PyObject_GC_New`。" +"這不能用於有在 :c:member:`~PyTypeObject.tp_flags` 中設定 :c:macro:" +"`Py_TPFLAGS_HAVE_GC` 的物件;請改用 :c:macro:`PyObject_GC_New`。" #: ../../c-api/allocation.rst:68 msgid "" @@ -124,9 +122,9 @@ msgstr "" #: ../../c-api/allocation.rst:78 ../../c-api/allocation.rst:128 msgid "" "This macro does not construct a fully initialized object of the given type; " -"it merely allocates memory and prepares it for further initialization " -"by :c:member:`~PyTypeObject.tp_init`. To construct a fully initialized " -"object, call *typeobj* instead. For example::" +"it merely allocates memory and prepares it for further initialization by :c:" +"member:`~PyTypeObject.tp_init`. To construct a fully initialized object, " +"call *typeobj* instead. For example::" msgstr "" #: ../../c-api/allocation.rst:83 @@ -134,6 +132,8 @@ msgid "PyObject *foo = PyObject_CallNoArgs((PyObject *)&PyFoo_Type);" msgstr "PyObject *foo = PyObject_CallNoArgs((PyObject *)&PyFoo_Type);" #: ../../c-api/allocation.rst:87 ../../c-api/allocation.rst:137 +#: ../../c-api/allocation.rst:182 ../../c-api/allocation.rst:184 +#: ../../c-api/allocation.rst:186 msgid ":c:func:`PyObject_Free`" msgstr ":c:func:`PyObject_Free`" @@ -156,8 +156,8 @@ msgstr "和 :c:macro:`PyObject_New` 類似,但有以下差異:" #: ../../c-api/allocation.rst:97 msgid "" "It allocates enough memory for the *TYPE* structure plus *size* " -"(``Py_ssize_t``) fields of the size given by " -"the :c:member:`~PyTypeObject.tp_itemsize` field of *typeobj*." +"(``Py_ssize_t``) fields of the size given by the :c:member:`~PyTypeObject." +"tp_itemsize` field of *typeobj*." msgstr "" #: ../../c-api/allocation.rst:100 @@ -174,12 +174,11 @@ msgstr "" #: ../../c-api/allocation.rst:114 msgid "" -"This cannot be used for objects with :c:macro:`Py_TPFLAGS_HAVE_GC` set " -"in :c:member:`~PyTypeObject.tp_flags`; use :c:macro:`PyObject_GC_NewVar` " -"instead." +"This cannot be used for objects with :c:macro:`Py_TPFLAGS_HAVE_GC` set in :c:" +"member:`~PyTypeObject.tp_flags`; use :c:macro:`PyObject_GC_NewVar` instead." msgstr "" -"這不能用於有在 :c:member:`~PyTypeObject.tp_flags` 中設定 " -":c:macro:`Py_TPFLAGS_HAVE_GC` 的物件;請改用 :c:macro:`PyObject_GC_NewVar`。" +"這不能用於有在 :c:member:`~PyTypeObject.tp_flags` 中設定 :c:macro:" +"`Py_TPFLAGS_HAVE_GC` 的物件;請改用 :c:macro:`PyObject_GC_NewVar`。" #: ../../c-api/allocation.rst:118 msgid "" @@ -198,10 +197,6 @@ msgid ":c:macro:`PyObject_GC_NewVar`" msgstr ":c:macro:`PyObject_GC_NewVar`" #: ../../c-api/allocation.rst:145 -msgid "Same as :c:func:`PyObject_Free`." -msgstr "和 :c:func:`PyObject_Free` 相同。" - -#: ../../c-api/allocation.rst:149 msgid "" "Object which is visible in Python as ``None``. This should only be accessed " "using the :c:macro:`Py_None` macro, which evaluates to a pointer to this " @@ -210,10 +205,61 @@ msgstr "" "這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存" "取,該巨集的拿到指向該物件的指標。" -#: ../../c-api/allocation.rst:156 +#: ../../c-api/allocation.rst:152 msgid ":ref:`moduleobjects`" msgstr ":ref:`moduleobjects`" -#: ../../c-api/allocation.rst:157 +#: ../../c-api/allocation.rst:153 msgid "To allocate and create extension modules." msgstr "分配記憶體和建立擴充模組。" + +#: ../../c-api/allocation.rst:157 +msgid "Deprecated aliases" +msgstr "" + +#: ../../c-api/allocation.rst:159 +msgid "" +"These are :term:`soft deprecated` aliases to existing functions and macros. " +"They exist solely for backwards compatibility." +msgstr "" + +#: ../../c-api/allocation.rst:167 +msgid "Deprecated alias" +msgstr "" + +#: ../../c-api/allocation.rst:168 +msgid "Function" +msgstr "" + +#: ../../c-api/allocation.rst:170 +#, fuzzy +msgid ":c:macro:`PyObject_New`" +msgstr ":c:macro:`PyObject_GC_New`" + +#: ../../c-api/allocation.rst:172 +#, fuzzy +msgid ":c:macro:`PyObject_NewVar`" +msgstr ":c:macro:`PyObject_GC_NewVar`" + +#: ../../c-api/allocation.rst:174 +#, fuzzy +msgid ":c:func:`PyObject_Init`" +msgstr ":c:func:`PyObject_Free`" + +#: ../../c-api/allocation.rst:176 +#, fuzzy +msgid ":c:func:`PyObject_InitVar`" +msgstr ":c:func:`PyObject_Free`" + +#: ../../c-api/allocation.rst:178 +#, fuzzy +msgid ":c:func:`PyObject_Malloc`" +msgstr ":c:func:`PyObject_Free`" + +#: ../../c-api/allocation.rst:180 +#, fuzzy +msgid ":c:func:`PyObject_Realloc`" +msgstr ":c:func:`PyObject_Free`" + +#~ msgid "Same as :c:func:`PyObject_Free`." +#~ msgstr "和 :c:func:`PyObject_Free` 相同。" diff --git a/c-api/concrete.po b/c-api/concrete.po index e9bba3e2a5d..72c16ef7695 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2025-11-09 17:02+0000\n" "PO-Revision-Date: 2022-11-13 20:37+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,6 +86,10 @@ msgstr "函式物件" msgid "Other Objects" msgstr "其他物件" +#: ../../c-api/concrete.rst:122 +msgid "C API for extension modules" +msgstr "" + #: ../../c-api/concrete.rst:43 ../../c-api/concrete.rst:58 #: ../../c-api/concrete.rst:80 msgid "object" diff --git a/c-api/curses.po b/c-api/curses.po new file mode 100644 index 00000000000..e7b2bb26530 --- /dev/null +++ b/c-api/curses.po @@ -0,0 +1,185 @@ +# 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: 2025-11-09 17:02+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" + +#: ../../c-api/curses.rst:4 +msgid "Curses C API" +msgstr "" + +#: ../../c-api/curses.rst:6 +msgid "" +":mod:`curses` exposes a small C interface for extension modules. Consumers " +"must include the header file :file:`py_curses.h` (which is not included by " +"default by :file:`Python.h`) and :c:func:`import_curses` must be invoked, " +"usually as part of the module initialisation function, to populate :c:var:" +"`PyCurses_API`." +msgstr "" + +#: ../../c-api/curses.rst:14 +msgid "" +"Neither the C API nor the pure Python :mod:`curses` module are compatible " +"with subinterpreters." +msgstr "" + +#: ../../c-api/curses.rst:19 +msgid "" +"Import the curses C API. The macro does not need a semi-colon to be called." +msgstr "" + +#: ../../c-api/curses.rst:21 +msgid "On success, populate the :c:var:`PyCurses_API` pointer." +msgstr "" + +#: ../../c-api/curses.rst:23 +msgid "" +"On failure, set :c:var:`PyCurses_API` to NULL and set an exception. The " +"caller must check if an error occurred via :c:func:`PyErr_Occurred`:" +msgstr "" + +#: ../../c-api/curses.rst:26 +msgid "" +"import_curses(); // semi-colon is optional but recommended\n" +"if (PyErr_Occurred()) { /* cleanup */ }" +msgstr "" + +#: ../../c-api/curses.rst:34 +msgid "" +"Dynamically allocated object containing the curses C API. This variable is " +"only available once :c:macro:`import_curses` succeeds." +msgstr "" + +#: ../../c-api/curses.rst:37 +msgid "``PyCurses_API[0]`` corresponds to :c:data:`PyCursesWindow_Type`." +msgstr "" + +#: ../../c-api/curses.rst:39 +msgid "" +"``PyCurses_API[1]``, ``PyCurses_API[2]``, and ``PyCurses_API[3]`` are " +"pointers to predicate functions of type ``int (*)(void)``." +msgstr "" + +#: ../../c-api/curses.rst:42 +msgid "" +"When called, these predicates return whether :func:`curses.setupterm`, :func:" +"`curses.initscr`, and :func:`curses.start_color` have been called " +"respectively." +msgstr "" + +#: ../../c-api/curses.rst:46 +msgid "" +"See also the convenience macros :c:macro:`PyCursesSetupTermCalled`, :c:macro:" +"`PyCursesInitialised`, and :c:macro:`PyCursesInitialisedColor`." +msgstr "" + +#: ../../c-api/curses.rst:51 +msgid "" +"The number of entries in this structure is subject to changes. Consider " +"using :c:macro:`PyCurses_API_pointers` to check if new fields are available " +"or not." +msgstr "" + +#: ../../c-api/curses.rst:58 +msgid "" +"The number of accessible fields (``4``) in :c:var:`PyCurses_API`. This " +"number is incremented whenever new fields are added." +msgstr "" + +#: ../../c-api/curses.rst:64 +msgid "" +"The :ref:`heap type ` corresponding to :class:`curses.window`." +msgstr "" + +#: ../../c-api/curses.rst:69 +msgid "" +"Return true if *op* is a :class:`curses.window` instance, false otherwise." +msgstr "" + +#: ../../c-api/curses.rst:72 +msgid "" +"The following macros are convenience macros expanding into C statements. In " +"particular, they can only be used as ``macro;`` or ``macro``, but not " +"``macro()`` or ``macro();``." +msgstr "" + +#: ../../c-api/curses.rst:78 +msgid "Macro checking if :func:`curses.setupterm` has been called." +msgstr "" + +#: ../../c-api/curses.rst:80 ../../c-api/curses.rst:97 +#: ../../c-api/curses.rst:114 +msgid "The macro expansion is roughly equivalent to:" +msgstr "" + +#: ../../c-api/curses.rst:82 +msgid "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_setupterm_called = (predicate_t)PyCurses_API[1];\n" +" if (!was_setupterm_called()) {\n" +" return NULL;\n" +" }\n" +"}" +msgstr "" + +#: ../../c-api/curses.rst:95 +msgid "Macro checking if :func:`curses.initscr` has been called." +msgstr "" + +#: ../../c-api/curses.rst:99 +msgid "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_initscr_called = (predicate_t)PyCurses_API[2];\n" +" if (!was_initscr_called()) {\n" +" return NULL;\n" +" }\n" +"}" +msgstr "" + +#: ../../c-api/curses.rst:112 +msgid "Macro checking if :func:`curses.start_color` has been called." +msgstr "" + +#: ../../c-api/curses.rst:116 +msgid "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_start_color_called = (predicate_t)PyCurses_API[3];\n" +" if (!was_start_color_called()) {\n" +" return NULL;\n" +" }\n" +"}" +msgstr "" + +#: ../../c-api/curses.rst:128 +msgid "Internal data" +msgstr "" + +#: ../../c-api/curses.rst:130 +msgid "" +"The following objects are exposed by the C API but should be considered " +"internal-only." +msgstr "" + +#: ../../c-api/curses.rst:135 +msgid "Name of the curses capsule to pass to :c:func:`PyCapsule_Import`." +msgstr "" + +#: ../../c-api/curses.rst:137 +msgid "Internal usage only. Use :c:macro:`import_curses` instead." +msgstr "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 60d246703cc..472dd865778 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 00:16+0000\n" +"POT-Creation-Date: 2025-11-09 17:02+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,11 +32,12 @@ msgstr "" msgid "" "Several of these functions accept a start symbol from the grammar as a " "parameter. The available start symbols are :c:data:`Py_eval_input`, :c:data:" -"`Py_file_input`, and :c:data:`Py_single_input`. These are described " -"following the functions which accept them as parameters." +"`Py_file_input`, :c:data:`Py_single_input`, and :c:data:" +"`Py_func_type_input`. These are described following the functions which " +"accept them as parameters." msgstr "" -#: ../../c-api/veryhigh.rst:19 +#: ../../c-api/veryhigh.rst:20 msgid "" "Note also that several of these functions take :c:expr:`FILE*` parameters. " "One particular issue which needs to be handled carefully is that the :c:type:" @@ -48,25 +49,25 @@ msgid "" "runtime is using." msgstr "" -#: ../../c-api/veryhigh.rst:30 +#: ../../c-api/veryhigh.rst:31 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:36 +#: ../../c-api/veryhigh.rst:37 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving the *closeit* argument set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:42 +#: ../../c-api/veryhigh.rst:43 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving the *flags* argument set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:48 +#: ../../c-api/veryhigh.rst:49 msgid "" "If *fp* refers to a file associated with an interactive device (console or " "terminal input or Unix pseudo-terminal), return the value of :c:func:" @@ -77,13 +78,13 @@ msgid "" "before ``PyRun_SimpleFileExFlags()`` returns." msgstr "" -#: ../../c-api/veryhigh.rst:60 +#: ../../c-api/veryhigh.rst:61 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, " "leaving the :c:struct:`PyCompilerFlags`\\* argument set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:66 +#: ../../c-api/veryhigh.rst:67 msgid "" "Executes the Python source code from *command* in the :mod:`__main__` module " "according to the *flags* argument. If :mod:`__main__` does not already " @@ -92,26 +93,26 @@ msgid "" "information. For the meaning of *flags*, see below." msgstr "" -#: ../../c-api/veryhigh.rst:72 +#: ../../c-api/veryhigh.rst:73 msgid "" "Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " "function will not return ``-1``, but exit the process, as long as :c:member:" "`PyConfig.inspect` is zero." msgstr "" -#: ../../c-api/veryhigh.rst:79 +#: ../../c-api/veryhigh.rst:80 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:85 +#: ../../c-api/veryhigh.rst:86 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:91 +#: ../../c-api/veryhigh.rst:92 msgid "" "Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is " "read from *fp* instead of an in-memory string. *filename* should be the name " @@ -120,20 +121,20 @@ msgid "" "``PyRun_SimpleFileExFlags()`` returns." msgstr "" -#: ../../c-api/veryhigh.rst:98 +#: ../../c-api/veryhigh.rst:99 msgid "" "On Windows, *fp* should be opened as binary mode (e.g. ``fopen(filename, " "\"rb\")``). Otherwise, Python may not handle script file with LF line ending " "correctly." msgstr "" -#: ../../c-api/veryhigh.rst:104 +#: ../../c-api/veryhigh.rst:105 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:110 +#: ../../c-api/veryhigh.rst:111 msgid "" "Read and execute a single statement from a file associated with an " "interactive device according to the *flags* argument. The user will be " @@ -141,7 +142,7 @@ msgid "" "term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/veryhigh.rst:115 +#: ../../c-api/veryhigh.rst:116 msgid "" "Returns ``0`` when the input was executed successfully, ``-1`` if there was " "an exception, or an error code from the :file:`errcode.h` include file " @@ -150,13 +151,13 @@ msgid "" "specifically if needed.)" msgstr "" -#: ../../c-api/veryhigh.rst:124 +#: ../../c-api/veryhigh.rst:125 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` " "below, leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:130 +#: ../../c-api/veryhigh.rst:131 msgid "" "Read and execute statements from a file associated with an interactive " "device until EOF is reached. The user will be prompted using ``sys.ps1`` " @@ -164,7 +165,7 @@ msgid "" "and error handler`. Returns ``0`` at EOF or a negative number upon failure." msgstr "" -#: ../../c-api/veryhigh.rst:138 +#: ../../c-api/veryhigh.rst:139 msgid "" "Can be set to point to a function with the prototype ``int func(void)``. " "The function will be called when Python's interpreter prompt is about to " @@ -174,13 +175,13 @@ msgid "" "Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:146 ../../c-api/veryhigh.rst:170 +#: ../../c-api/veryhigh.rst:147 ../../c-api/veryhigh.rst:171 msgid "" "This function is only called from the :ref:`main interpreter `." msgstr "" -#: ../../c-api/veryhigh.rst:153 +#: ../../c-api/veryhigh.rst:154 msgid "" "Can be set to point to a function with the prototype ``char *func(FILE " "*stdin, FILE *stdout, char *prompt)``, overriding the default function used " @@ -191,33 +192,32 @@ msgid "" "line-editing and tab-completion features." msgstr "" -#: ../../c-api/veryhigh.rst:162 +#: ../../c-api/veryhigh.rst:163 msgid "" "The result must be a string allocated by :c:func:`PyMem_RawMalloc` or :c:" "func:`PyMem_RawRealloc`, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/veryhigh.rst:165 +#: ../../c-api/veryhigh.rst:166 msgid "" "The result must be allocated by :c:func:`PyMem_RawMalloc` or :c:func:" "`PyMem_RawRealloc`, instead of being allocated by :c:func:`PyMem_Malloc` or :" "c:func:`PyMem_Realloc`." msgstr "" -#: ../../c-api/veryhigh.rst:176 +#: ../../c-api/veryhigh.rst:177 msgid "" "This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:182 +#: ../../c-api/veryhigh.rst:183 msgid "" "Execute Python source code from *str* in the context specified by the " "objects *globals* and *locals* with the compiler flags specified by " "*flags*. *globals* must be a dictionary; *locals* can be any object that " "implements the mapping protocol. The parameter *start* specifies the start " -"symbol and must one of the following: :c:data:`Py_eval_input`, :c:data:" -"`Py_file_input`, or :c:data:`Py_single_input`." +"symbol and must one of the :ref:`available start symbols `." msgstr "" #: ../../c-api/veryhigh.rst:189 @@ -269,11 +269,11 @@ msgstr "" msgid "" "Parse and compile the Python source code in *str*, returning the resulting " "code object. The start symbol is given by *start*; this can be used to " -"constrain the code which can be compiled and should be :c:data:" -"`Py_eval_input`, :c:data:`Py_file_input`, or :c:data:`Py_single_input`. The " -"filename specified by *filename* is used to construct the code object and " -"may appear in tracebacks or :exc:`SyntaxError` exception messages. This " -"returns ``NULL`` if the code cannot be parsed or compiled." +"constrain the code which can be compiled and should be :ref:`available start " +"symbols `. The filename specified by *filename* is used to " +"construct the code object and may appear in tracebacks or :exc:`SyntaxError` " +"exception messages. This returns ``NULL`` if the code cannot be parsed or " +"compiled." msgstr "" #: ../../c-api/veryhigh.rst:242 @@ -335,27 +335,7 @@ msgid "" "true on success, false on failure." msgstr "" -#: ../../c-api/veryhigh.rst:304 -msgid "" -"The start symbol from the Python grammar for isolated expressions; for use " -"with :c:func:`Py_CompileString`." -msgstr "" - -#: ../../c-api/veryhigh.rst:312 -msgid "" -"The start symbol from the Python grammar for sequences of statements as read " -"from a file or other source; for use with :c:func:`Py_CompileString`. This " -"is the symbol to use when compiling arbitrarily long Python source code." -msgstr "" - -#: ../../c-api/veryhigh.rst:321 -msgid "" -"The start symbol from the Python grammar for a single statement; for use " -"with :c:func:`Py_CompileString`. This is the symbol used for the interactive " -"interpreter loop." -msgstr "" - -#: ../../c-api/veryhigh.rst:328 +#: ../../c-api/veryhigh.rst:302 msgid "" "This is the structure used to hold compiler flags. In cases where code is " "only being compiled, it is passed as ``int flags``, and in cases where code " @@ -363,44 +343,44 @@ msgid "" "case, ``from __future__ import`` can modify *flags*." msgstr "" -#: ../../c-api/veryhigh.rst:333 +#: ../../c-api/veryhigh.rst:307 msgid "" "Whenever ``PyCompilerFlags *flags`` is ``NULL``, :c:member:`~PyCompilerFlags." "cf_flags` is treated as equal to ``0``, and any modification due to ``from " "__future__ import`` is discarded." msgstr "" -#: ../../c-api/veryhigh.rst:339 +#: ../../c-api/veryhigh.rst:313 msgid "Compiler flags." msgstr "" -#: ../../c-api/veryhigh.rst:343 +#: ../../c-api/veryhigh.rst:317 msgid "" "*cf_feature_version* is the minor Python version. It should be initialized " "to ``PY_MINOR_VERSION``." msgstr "" -#: ../../c-api/veryhigh.rst:346 +#: ../../c-api/veryhigh.rst:320 msgid "" "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " "flag is set in :c:member:`~PyCompilerFlags.cf_flags`." msgstr "" -#: ../../c-api/veryhigh.rst:349 +#: ../../c-api/veryhigh.rst:323 msgid "Added *cf_feature_version* field." msgstr "新增 *cf_feature_version* 欄位。" -#: ../../c-api/veryhigh.rst:352 +#: ../../c-api/veryhigh.rst:326 msgid "The available compiler flags are accessible as macros:" msgstr "" -#: ../../c-api/veryhigh.rst:361 +#: ../../c-api/veryhigh.rst:335 msgid "" "See :ref:`compiler flags ` in documentation of the :py:" "mod:`!ast` Python module, which exports these constants under the same names." msgstr "" -#: ../../c-api/veryhigh.rst:365 +#: ../../c-api/veryhigh.rst:339 msgid "" "The \"``PyCF``\" flags above can be combined with \"``CO_FUTURE``\" flags " "such as :c:macro:`CO_FUTURE_ANNOTATIONS` to enable features normally " @@ -408,7 +388,50 @@ msgid "" "`c_codeobject_flags` for a complete list." msgstr "" -#: ../../c-api/veryhigh.rst:302 ../../c-api/veryhigh.rst:310 -#: ../../c-api/veryhigh.rst:319 +#: ../../c-api/veryhigh.rst:348 +msgid "Available start symbols" +msgstr "" + +#: ../../c-api/veryhigh.rst:355 +msgid "" +"The start symbol from the Python grammar for isolated expressions; for use " +"with :c:func:`Py_CompileString`." +msgstr "" + +#: ../../c-api/veryhigh.rst:363 +msgid "" +"The start symbol from the Python grammar for sequences of statements as read " +"from a file or other source; for use with :c:func:`Py_CompileString`. This " +"is the symbol to use when compiling arbitrarily long Python source code." +msgstr "" + +#: ../../c-api/veryhigh.rst:372 +msgid "" +"The start symbol from the Python grammar for a single statement; for use " +"with :c:func:`Py_CompileString`. This is the symbol used for the interactive " +"interpreter loop." +msgstr "" + +#: ../../c-api/veryhigh.rst:381 +msgid "" +"The start symbol from the Python grammar for a function type; for use with :" +"c:func:`Py_CompileString`. This is used to parse \"signature type comments\" " +"from :pep:`484`." +msgstr "" + +#: ../../c-api/veryhigh.rst:385 +msgid "This requires the :c:macro:`PyCF_ONLY_AST` flag to be set." +msgstr "" + +#: ../../c-api/veryhigh.rst:388 +msgid ":py:class:`ast.FunctionType`" +msgstr "" + +#: ../../c-api/veryhigh.rst:389 +msgid ":pep:`484`" +msgstr "" + +#: ../../c-api/veryhigh.rst:353 ../../c-api/veryhigh.rst:361 +#: ../../c-api/veryhigh.rst:370 ../../c-api/veryhigh.rst:379 msgid "Py_CompileString (C function)" msgstr "Py_CompileString(C 函式)" diff --git a/c-api/weakref.po b/c-api/weakref.po index 8f12902575b..c64e312766b 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.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-11-09 17:02+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,16 +38,22 @@ msgstr "" #: ../../c-api/weakref.rst:22 msgid "" -"Return non-zero if *ob* is a reference object. This function always " -"succeeds." +"Return non-zero if *ob* is a reference object or a subclass of the reference " +"type. This function always succeeds." msgstr "" -#: ../../c-api/weakref.rst:27 +#: ../../c-api/weakref.rst:28 +msgid "" +"Return non-zero if *ob* is a reference object, but not a subclass of the " +"reference type. This function always succeeds." +msgstr "" + +#: ../../c-api/weakref.rst:34 msgid "" "Return non-zero if *ob* is a proxy object. This function always succeeds." msgstr "" -#: ../../c-api/weakref.rst:32 +#: ../../c-api/weakref.rst:39 msgid "" "Return a weak reference object for the object *ob*. This will always return " "a new reference, but is not guaranteed to create a new object; an existing " @@ -59,7 +65,7 @@ msgid "" "``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." msgstr "" -#: ../../c-api/weakref.rst:44 +#: ../../c-api/weakref.rst:51 msgid "" "Return a weak reference proxy object for the object *ob*. This will always " "return a new reference, but is not guaranteed to create a new object; an " @@ -71,33 +77,33 @@ msgid "" "``None``, or ``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." msgstr "" -#: ../../c-api/weakref.rst:56 +#: ../../c-api/weakref.rst:63 msgid "" "Get a :term:`strong reference` to the referenced object from a weak " "reference, *ref*, into *\\*pobj*." msgstr "" -#: ../../c-api/weakref.rst:59 +#: ../../c-api/weakref.rst:66 msgid "" "On success, set *\\*pobj* to a new :term:`strong reference` to the " "referenced object and return 1." msgstr "" -#: ../../c-api/weakref.rst:61 +#: ../../c-api/weakref.rst:68 msgid "If the reference is dead, set *\\*pobj* to ``NULL`` and return 0." msgstr "" -#: ../../c-api/weakref.rst:62 +#: ../../c-api/weakref.rst:69 msgid "On error, raise an exception and return -1." msgstr "" -#: ../../c-api/weakref.rst:69 +#: ../../c-api/weakref.rst:76 msgid "" "Return a :term:`borrowed reference` to the referenced object from a weak " "reference, *ref*. If the referent is no longer live, returns ``Py_None``." msgstr "" -#: ../../c-api/weakref.rst:74 +#: ../../c-api/weakref.rst:81 msgid "" "This function returns a :term:`borrowed reference` to the referenced object. " "This means that you should always call :c:func:`Py_INCREF` on the object " @@ -105,39 +111,39 @@ msgid "" "reference." msgstr "" -#: ../../c-api/weakref.rst:79 ../../c-api/weakref.rst:87 +#: ../../c-api/weakref.rst:86 ../../c-api/weakref.rst:94 msgid "Use :c:func:`PyWeakref_GetRef` instead." msgstr "" -#: ../../c-api/weakref.rst:85 +#: ../../c-api/weakref.rst:92 msgid "Similar to :c:func:`PyWeakref_GetObject`, but does no error checking." msgstr "" -#: ../../c-api/weakref.rst:93 +#: ../../c-api/weakref.rst:100 msgid "" "Test if the weak reference *ref* is dead. Returns 1 if the reference is " "dead, 0 if it is alive, and -1 with an error set if *ref* is not a weak " "reference object." msgstr "" -#: ../../c-api/weakref.rst:102 +#: ../../c-api/weakref.rst:109 msgid "" "This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " "to clear weak references." msgstr "" -#: ../../c-api/weakref.rst:105 +#: ../../c-api/weakref.rst:112 msgid "" "This iterates through the weak references for *object* and calls callbacks " "for those references which have one. It returns when all callbacks have been " "attempted." msgstr "" -#: ../../c-api/weakref.rst:112 +#: ../../c-api/weakref.rst:119 msgid "Clears the weakrefs for *object* without calling the callbacks." msgstr "" -#: ../../c-api/weakref.rst:114 +#: ../../c-api/weakref.rst:121 msgid "" "This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " "for types with finalizers (i.e., :meth:`~object.__del__`). The handler for " @@ -146,9 +152,8 @@ msgid "" "clear any weakrefs that may have been created by the finalizer." msgstr "" -#: ../../c-api/weakref.rst:120 +#: ../../c-api/weakref.rst:127 msgid "" -"In most circumstances, it's more appropriate to " -"use :c:func:`PyObject_ClearWeakRefs` to clear weakrefs instead of this " -"function." +"In most circumstances, it's more appropriate to use :c:func:" +"`PyObject_ClearWeakRefs` to clear weakrefs instead of this function." msgstr "" diff --git a/library/os.po b/library/os.po index 4b37ac7df91..838f674f423 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-09-22 00:18+0000\n" +"POT-Creation-Date: 2025-11-09 17:02+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-" @@ -352,50 +352,50 @@ msgstr "" #: ../../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:3530 -#: ../../library/os.rst:3553 ../../library/os.rst:3567 -#: ../../library/os.rst:3787 ../../library/os.rst:3812 -#: ../../library/os.rst:3837 ../../library/os.rst:3891 -#: ../../library/os.rst:3900 ../../library/os.rst:3909 -#: ../../library/os.rst:3917 ../../library/os.rst:3926 -#: ../../library/os.rst:3935 ../../library/os.rst:4007 -#: ../../library/os.rst:4070 ../../library/os.rst:4080 -#: ../../library/os.rst:4098 ../../library/os.rst:4107 -#: ../../library/os.rst:4117 ../../library/os.rst:4127 -#: ../../library/os.rst:4137 ../../library/os.rst:4148 -#: ../../library/os.rst:4293 ../../library/os.rst:4362 -#: ../../library/os.rst:4397 ../../library/os.rst:4405 -#: ../../library/os.rst:4412 ../../library/os.rst:4419 -#: ../../library/os.rst:4426 ../../library/os.rst:4433 -#: ../../library/os.rst:4440 ../../library/os.rst:4447 -#: ../../library/os.rst:4455 ../../library/os.rst:4463 -#: ../../library/os.rst:4470 ../../library/os.rst:4477 -#: ../../library/os.rst:4486 ../../library/os.rst:4494 -#: ../../library/os.rst:4502 ../../library/os.rst:4509 -#: ../../library/os.rst:4516 ../../library/os.rst:4565 -#: ../../library/os.rst:4592 ../../library/os.rst:4615 -#: ../../library/os.rst:4631 ../../library/os.rst:4638 -#: ../../library/os.rst:4649 ../../library/os.rst:4659 -#: ../../library/os.rst:4668 ../../library/os.rst:4700 -#: ../../library/os.rst:4812 ../../library/os.rst:4828 -#: ../../library/os.rst:4861 ../../library/os.rst:4930 -#: ../../library/os.rst:4953 ../../library/os.rst:4964 -#: ../../library/os.rst:4976 ../../library/os.rst:5021 -#: ../../library/os.rst:5058 ../../library/os.rst:5081 -#: ../../library/os.rst:5102 ../../library/os.rst:5136 -#: ../../library/os.rst:5177 ../../library/os.rst:5197 -#: ../../library/os.rst:5211 ../../library/os.rst:5228 -#: ../../library/os.rst:5243 ../../library/os.rst:5254 -#: ../../library/os.rst:5266 ../../library/os.rst:5279 -#: ../../library/os.rst:5288 ../../library/os.rst:5298 -#: ../../library/os.rst:5311 ../../library/os.rst:5346 -#: ../../library/os.rst:5362 ../../library/os.rst:5373 -#: ../../library/os.rst:5385 ../../library/os.rst:5392 -#: ../../library/os.rst:5401 ../../library/os.rst:5410 -#: ../../library/os.rst:5419 ../../library/os.rst:5428 -#: ../../library/os.rst:5592 ../../library/os.rst:5601 -#: ../../library/os.rst:5625 ../../library/os.rst:5652 -#: ../../library/os.rst:5661 ../../library/os.rst:5784 +#: ../../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 msgid "Availability" msgstr "可用性" @@ -964,7 +964,7 @@ msgid "" "on iOS and Android." msgstr "" -#: ../../library/os.rst:819 ../../library/os.rst:5083 +#: ../../library/os.rst:819 ../../library/os.rst:5086 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1207,7 +1207,7 @@ 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:3532 +#: ../../library/os.rst:3535 msgid "" "The function is limited on WASI, see :ref:`wasm-availability` for more " "information." @@ -1316,7 +1316,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:1134 ../../library/os.rst:3571 +#: ../../library/os.rst:1134 ../../library/os.rst:3574 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" @@ -1525,12 +1525,12 @@ msgstr "" #: ../../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:3587 +#: ../../library/os.rst:3590 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" #: ../../library/os.rst:1306 ../../library/os.rst:1657 -#: ../../library/os.rst:1892 ../../library/os.rst:5179 +#: ../../library/os.rst:1892 ../../library/os.rst:5182 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 :" @@ -1547,11 +1547,11 @@ msgstr "" #: ../../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:3574 -#: ../../library/os.rst:3590 ../../library/os.rst:3630 -#: ../../library/os.rst:3730 ../../library/os.rst:3791 -#: ../../library/os.rst:4188 ../../library/os.rst:4368 -#: ../../library/os.rst:4937 +#: ../../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 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -2507,7 +2507,7 @@ msgid ":const:`stat.S_IXOTH`" msgstr ":const:`stat.S_IXOTH`" #: ../../library/os.rst:2195 ../../library/os.rst:2228 -#: ../../library/os.rst:3620 +#: ../../library/os.rst:3623 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " @@ -2624,7 +2624,7 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.link``。" -#: ../../library/os.rst:2347 ../../library/os.rst:4617 +#: ../../library/os.rst:2347 ../../library/os.rst:4620 msgid "Added Windows support." msgstr "新支援 Windows。" @@ -2633,7 +2633,7 @@ 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:3542 +#: ../../library/os.rst:2814 ../../library/os.rst:3545 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" @@ -2791,7 +2791,7 @@ msgid "" msgstr "" #: ../../library/os.rst:2476 ../../library/os.rst:2690 -#: ../../library/os.rst:3535 +#: ../../library/os.rst:3538 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" @@ -2952,7 +2952,7 @@ msgid "" msgstr "" #: ../../library/os.rst:2651 ../../library/os.rst:3394 -#: ../../library/os.rst:3563 +#: ../../library/os.rst:3566 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" @@ -3009,7 +3009,7 @@ msgid "" msgstr "" #: ../../library/os.rst:2712 ../../library/os.rst:2825 -#: ../../library/os.rst:3514 +#: ../../library/os.rst:3517 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." @@ -3028,7 +3028,7 @@ msgid "This function is semantically identical to :func:`unlink`." msgstr "" #: ../../library/os.rst:2721 ../../library/os.rst:2743 -#: ../../library/os.rst:3585 +#: ../../library/os.rst:3588 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -3485,9 +3485,9 @@ msgid "" "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:3088 ../../library/os.rst:4167 -#: ../../library/os.rst:4183 ../../library/os.rst:4199 -#: ../../library/os.rst:4219 +#: ../../library/os.rst:3088 ../../library/os.rst:4170 +#: ../../library/os.rst:4186 ../../library/os.rst:4202 +#: ../../library/os.rst:4222 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." @@ -3507,7 +3507,7 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:3104 ../../library/os.rst:3874 +#: ../../library/os.rst:3104 ../../library/os.rst:3877 msgid "Example::" msgstr "範例: ::" @@ -3989,6 +3989,12 @@ msgstr "" #: ../../library/os.rst:3508 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 +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 " "symlink will be created to match. Otherwise, the symlink will be created as " @@ -3997,7 +4003,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3519 +#: ../../library/os.rst:3522 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -4005,12 +4011,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3525 +#: ../../library/os.rst:3528 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3528 +#: ../../library/os.rst:3531 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -4018,27 +4024,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.symlink``。" -#: ../../library/os.rst:3538 +#: ../../library/os.rst:3541 msgid "" "Added the *dir_fd* parameter, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3545 +#: ../../library/os.rst:3548 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3551 +#: ../../library/os.rst:3554 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3560 +#: ../../library/os.rst:3563 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3565 +#: ../../library/os.rst:3568 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -4046,46 +4052,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:3580 +#: ../../library/os.rst:3583 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:3596 +#: ../../library/os.rst:3599 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3598 +#: ../../library/os.rst:3601 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:3601 +#: ../../library/os.rst:3604 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:3604 +#: ../../library/os.rst:3607 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:3607 +#: ../../library/os.rst:3610 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:3611 +#: ../../library/os.rst:3614 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3613 +#: ../../library/os.rst:3616 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 " @@ -4095,7 +4101,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3624 +#: ../../library/os.rst:3627 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -4103,13 +4109,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.utime``。" -#: ../../library/os.rst:3626 +#: ../../library/os.rst:3629 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3640 +#: ../../library/os.rst:3643 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* " @@ -4117,7 +4123,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3645 +#: ../../library/os.rst:3648 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 " @@ -4131,7 +4137,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3656 +#: ../../library/os.rst:3659 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 " @@ -4142,7 +4148,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3664 +#: ../../library/os.rst:3667 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -4155,7 +4161,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3673 +#: ../../library/os.rst:3676 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 " @@ -4165,35 +4171,35 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3679 +#: ../../library/os.rst:3682 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:3685 +#: ../../library/os.rst:3688 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:3691 +#: ../../library/os.rst:3694 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:3695 ../../library/os.rst:3757 +#: ../../library/os.rst:3698 ../../library/os.rst:3760 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:3699 +#: ../../library/os.rst:3702 msgid "" "import os\n" "from os.path import join, getsize\n" @@ -4205,14 +4211,14 @@ msgid "" " dirs.remove('__pycache__') # don't visit __pycache__ directories" msgstr "" -#: ../../library/os.rst:3708 +#: ../../library/os.rst:3711 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:3712 +#: ../../library/os.rst:3715 msgid "" "# Delete everything reachable from the directory named in \"top\",\n" "# assuming there are no symbolic links.\n" @@ -4227,7 +4233,7 @@ msgid "" "os.rmdir(top)" msgstr "" -#: ../../library/os.rst:3724 +#: ../../library/os.rst:3727 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -4235,25 +4241,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3726 +#: ../../library/os.rst:3729 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:3740 +#: ../../library/os.rst:3743 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:3743 +#: ../../library/os.rst:3746 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:3746 +#: ../../library/os.rst:3749 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -4261,14 +4267,14 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3753 +#: ../../library/os.rst:3756 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:3761 +#: ../../library/os.rst:3764 msgid "" "import os\n" "for root, dirs, files, rootfd in os.fwalk('python/Lib/xml'):\n" @@ -4280,13 +4286,13 @@ msgid "" " dirs.remove('__pycache__') # don't visit __pycache__ directories" msgstr "" -#: ../../library/os.rst:3770 +#: ../../library/os.rst:3773 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:3774 +#: ../../library/os.rst:3777 msgid "" "# Delete everything reachable from the directory named in \"top\",\n" "# assuming there are no symbolic links.\n" @@ -4300,7 +4306,7 @@ msgid "" " os.rmdir(name, dir_fd=rootfd)" msgstr "" -#: ../../library/os.rst:3785 +#: ../../library/os.rst:3788 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -4308,11 +4314,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3794 +#: ../../library/os.rst:3797 msgid "Added support for :class:`bytes` paths." msgstr "新增對 :class:`bytes` 路徑的支援。" -#: ../../library/os.rst:3800 +#: ../../library/os.rst:3803 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 " @@ -4320,7 +4326,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3805 +#: ../../library/os.rst:3808 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/" @@ -4330,15 +4336,15 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3835 +#: ../../library/os.rst:3838 msgid "These flags can be passed to :func:`memfd_create`." msgstr "這些旗標可以傳給 :func:`memfd_create`。" -#: ../../library/os.rst:3839 +#: ../../library/os.rst:3842 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "``MFD_HUGE*`` 旗標僅在 Linux 4.14 以上可用。" -#: ../../library/os.rst:3846 +#: ../../library/os.rst:3849 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." @@ -4347,7 +4353,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3852 +#: ../../library/os.rst:3855 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 " @@ -4355,39 +4361,39 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3857 +#: ../../library/os.rst:3860 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3860 +#: ../../library/os.rst:3863 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:3863 +#: ../../library/os.rst:3866 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:3867 +#: ../../library/os.rst:3870 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3870 +#: ../../library/os.rst:3873 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:3876 +#: ../../library/os.rst:3879 msgid "" "import os\n" "\n" @@ -4405,64 +4411,64 @@ msgid "" " os.close(fd)" msgstr "" -#: ../../library/os.rst:3897 +#: ../../library/os.rst:3900 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:3906 +#: ../../library/os.rst:3909 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:3915 +#: ../../library/os.rst:3918 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3923 +#: ../../library/os.rst:3926 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "設定新的 :func:`eventfd` 檔案描述器的 :const:`O_NONBLOCK` 狀態旗標。" -#: ../../library/os.rst:3932 +#: ../../library/os.rst:3935 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:3943 +#: ../../library/os.rst:3946 msgid "Timer File Descriptors" msgstr "計時器檔案描述器" -#: ../../library/os.rst:3947 +#: ../../library/os.rst:3950 msgid "" "These functions provide support for Linux's *timer file descriptor* API. " "Naturally, they are all only available on Linux." msgstr "" -#: ../../library/os.rst:3952 +#: ../../library/os.rst:3955 msgid "Create and return a timer file descriptor (*timerfd*)." msgstr "" -#: ../../library/os.rst:3954 +#: ../../library/os.rst:3957 msgid "The file descriptor returned by :func:`timerfd_create` supports:" msgstr "" -#: ../../library/os.rst:3956 +#: ../../library/os.rst:3959 msgid ":func:`read`" msgstr ":func:`read`" -#: ../../library/os.rst:3957 +#: ../../library/os.rst:3960 msgid ":func:`~select.select`" msgstr ":func:`~select.select`" -#: ../../library/os.rst:3958 +#: ../../library/os.rst:3961 msgid ":func:`~select.poll`" msgstr ":func:`~select.poll`" -#: ../../library/os.rst:3960 +#: ../../library/os.rst:3963 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` " @@ -4471,31 +4477,31 @@ msgid "" "byteorder)``." msgstr "" -#: ../../library/os.rst:3965 +#: ../../library/os.rst:3968 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:3968 +#: ../../library/os.rst:3971 msgid "" "*clockid* must be a valid :ref:`clock ID `, as " "defined in the :py:mod:`time` module:" msgstr "" -#: ../../library/os.rst:3971 +#: ../../library/os.rst:3974 msgid ":const:`time.CLOCK_REALTIME`" msgstr ":const:`time.CLOCK_REALTIME`" -#: ../../library/os.rst:3972 +#: ../../library/os.rst:3975 msgid ":const:`time.CLOCK_MONOTONIC`" msgstr ":const:`time.CLOCK_MONOTONIC`" -#: ../../library/os.rst:3973 +#: ../../library/os.rst:3976 msgid ":const:`time.CLOCK_BOOTTIME` (Since Linux 3.15 for timerfd_create)" msgstr "" -#: ../../library/os.rst:3975 +#: ../../library/os.rst:3978 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 " @@ -4503,35 +4509,35 @@ msgid "" "`TFD_TIMER_CANCEL_ON_SET`." msgstr "" -#: ../../library/os.rst:3980 +#: ../../library/os.rst:3983 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:3984 +#: ../../library/os.rst:3987 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:3987 +#: ../../library/os.rst:3990 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:3991 +#: ../../library/os.rst:3994 msgid ":const:`TFD_NONBLOCK`" msgstr ":const:`TFD_NONBLOCK`" -#: ../../library/os.rst:3992 +#: ../../library/os.rst:3995 msgid ":const:`TFD_CLOEXEC`" msgstr ":const:`TFD_CLOEXEC`" -#: ../../library/os.rst:3994 +#: ../../library/os.rst:3997 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 " @@ -4539,46 +4545,46 @@ msgid "" "raises :class:`OSError` with ``errno`` is set to :const:`errno.EAGAIN`." msgstr "" -#: ../../library/os.rst:4000 +#: ../../library/os.rst:4003 msgid ":const:`TFD_CLOEXEC` is always set by Python automatically." msgstr ":const:`TFD_CLOEXEC` 總是由 Python 自動設定。" -#: ../../library/os.rst:4002 +#: ../../library/os.rst:4005 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:4005 +#: ../../library/os.rst:4008 msgid "The :manpage:`timerfd_create(2)` man page." msgstr ":manpage:`timerfd_create(2)` 使用手冊。" -#: ../../library/os.rst:4014 +#: ../../library/os.rst:4017 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:4017 +#: ../../library/os.rst:4020 msgid "*fd* must be a valid timer file descriptor." msgstr "*fd* 必須是有效的計時器檔案描述器。" -#: ../../library/os.rst:4019 +#: ../../library/os.rst:4022 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:4023 +#: ../../library/os.rst:4026 msgid ":const:`TFD_TIMER_ABSTIME`" msgstr ":const:`TFD_TIMER_ABSTIME`" -#: ../../library/os.rst:4024 +#: ../../library/os.rst:4027 msgid ":const:`TFD_TIMER_CANCEL_ON_SET`" msgstr ":const:`TFD_TIMER_CANCEL_ON_SET`" -#: ../../library/os.rst:4026 +#: ../../library/os.rst:4029 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 " @@ -4586,20 +4592,20 @@ msgid "" "const:`errno.EINVAL`" msgstr "" -#: ../../library/os.rst:4031 +#: ../../library/os.rst:4034 msgid "" "By default the timer will fire when *initial* seconds have elapsed. (If " "*initial* is zero, timer will fire immediately.)" msgstr "" -#: ../../library/os.rst:4034 +#: ../../library/os.rst:4037 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:4038 +#: ../../library/os.rst:4041 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 " @@ -4609,7 +4615,7 @@ msgid "" "EINVAL`" msgstr "" -#: ../../library/os.rst:4045 +#: ../../library/os.rst:4048 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." @@ -4618,86 +4624,86 @@ msgid "" "ECANCELED." msgstr "" -#: ../../library/os.rst:4051 +#: ../../library/os.rst:4054 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:4055 +#: ../../library/os.rst:4058 msgid "" "Discontinuous system clock change will be caused by the following events:" msgstr "" -#: ../../library/os.rst:4057 +#: ../../library/os.rst:4060 msgid "``settimeofday``" msgstr "``settimeofday``" -#: ../../library/os.rst:4058 +#: ../../library/os.rst:4061 msgid "``clock_settime``" msgstr "``clock_settime``" -#: ../../library/os.rst:4059 +#: ../../library/os.rst:4062 msgid "set the system date and time by ``date`` command" msgstr "" -#: ../../library/os.rst:4061 +#: ../../library/os.rst:4064 msgid "" "Return a two-item tuple of (``next_expiration``, ``interval``) from the " "previous timer state, before this function executed." msgstr "" -#: ../../library/os.rst:4066 +#: ../../library/os.rst:4069 msgid "" ":manpage:`timerfd_create(2)`, :manpage:`timerfd_settime(2)`, :manpage:" "`settimeofday(2)`, :manpage:`clock_settime(2)`, and :manpage:`date(1)`." msgstr "" -#: ../../library/os.rst:4077 +#: ../../library/os.rst:4080 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:4087 +#: ../../library/os.rst:4090 msgid "Return a two-item tuple of floats (``next_expiration``, ``interval``)." msgstr "" -#: ../../library/os.rst:4089 +#: ../../library/os.rst:4092 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:4092 +#: ../../library/os.rst:4095 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:4096 +#: ../../library/os.rst:4099 msgid ":manpage:`timerfd_gettime(2)`" msgstr ":manpage:`timerfd_gettime(2)`" -#: ../../library/os.rst:4105 +#: ../../library/os.rst:4108 msgid "Similar to :func:`timerfd_gettime`, but return time as nanoseconds." msgstr "" -#: ../../library/os.rst:4113 +#: ../../library/os.rst:4116 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:4123 +#: ../../library/os.rst:4126 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:4133 +#: ../../library/os.rst:4136 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 " @@ -4705,22 +4711,22 @@ msgid "" "Epoch)." msgstr "" -#: ../../library/os.rst:4143 +#: ../../library/os.rst:4146 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:4154 +#: ../../library/os.rst:4157 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:4158 +#: ../../library/os.rst:4161 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:4162 +#: ../../library/os.rst:4165 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4728,7 +4734,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:4170 +#: ../../library/os.rst:4173 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4736,12 +4742,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:4172 ../../library/os.rst:4204 -#: ../../library/os.rst:4229 +#: ../../library/os.rst:4175 ../../library/os.rst:4207 +#: ../../library/os.rst:4232 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:4178 +#: ../../library/os.rst:4181 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4749,14 +4755,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:4186 +#: ../../library/os.rst:4189 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:4194 +#: ../../library/os.rst:4197 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4764,7 +4770,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:4202 +#: ../../library/os.rst:4205 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4772,7 +4778,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:4210 +#: ../../library/os.rst:4213 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4784,13 +4790,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:4224 +#: ../../library/os.rst:4227 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:4227 +#: ../../library/os.rst:4230 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4798,33 +4804,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:4235 +#: ../../library/os.rst:4238 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:4241 +#: ../../library/os.rst:4244 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:4247 +#: ../../library/os.rst:4250 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:4254 +#: ../../library/os.rst:4257 msgid "Process Management" msgstr "行程管理" -#: ../../library/os.rst:4256 +#: ../../library/os.rst:4259 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:4258 +#: ../../library/os.rst:4261 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 " @@ -4835,7 +4841,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:4269 +#: ../../library/os.rst:4272 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 " @@ -4844,31 +4850,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:4278 +#: ../../library/os.rst:4281 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:4280 +#: ../../library/os.rst:4283 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:4284 +#: ../../library/os.rst:4287 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:4287 +#: ../../library/os.rst:4290 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:4291 +#: ../../library/os.rst:4294 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -4876,7 +4882,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:4295 +#: ../../library/os.rst:4298 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4884,14 +4890,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:4302 +#: ../../library/os.rst:4305 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:4317 +#: ../../library/os.rst:4320 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 " @@ -4899,7 +4905,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:4322 +#: ../../library/os.rst:4325 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 " @@ -4907,7 +4913,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:4328 +#: ../../library/os.rst:4331 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4920,7 +4926,7 @@ msgid "" "is not enforced." msgstr "" -#: ../../library/os.rst:4337 +#: ../../library/os.rst:4340 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4934,7 +4940,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:4348 +#: ../../library/os.rst:4351 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 " @@ -4944,7 +4950,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:4355 +#: ../../library/os.rst:4358 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 " @@ -4953,7 +4959,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:4360 +#: ../../library/os.rst:4363 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4961,25 +4967,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:4364 +#: ../../library/os.rst:4367 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4373 +#: ../../library/os.rst:4376 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:4378 +#: ../../library/os.rst:4381 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:4381 +#: ../../library/os.rst:4384 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 " @@ -4987,139 +4993,139 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:4387 +#: ../../library/os.rst:4390 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:4394 +#: ../../library/os.rst:4397 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:4402 +#: ../../library/os.rst:4405 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:4410 +#: ../../library/os.rst:4413 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4417 +#: ../../library/os.rst:4420 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4424 +#: ../../library/os.rst:4427 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4431 +#: ../../library/os.rst:4434 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4438 +#: ../../library/os.rst:4441 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4445 +#: ../../library/os.rst:4448 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4452 +#: ../../library/os.rst:4455 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:4460 +#: ../../library/os.rst:4463 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:4468 +#: ../../library/os.rst:4471 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4475 +#: ../../library/os.rst:4478 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4482 +#: ../../library/os.rst:4485 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:4491 +#: ../../library/os.rst:4494 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4499 +#: ../../library/os.rst:4502 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:4507 +#: ../../library/os.rst:4510 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4514 +#: ../../library/os.rst:4517 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4521 +#: ../../library/os.rst:4524 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:4524 +#: ../../library/os.rst:4527 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4527 +#: ../../library/os.rst:4530 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4531 +#: ../../library/os.rst:4534 msgid "" "If you use TLS sockets in an application calling ``fork()``, see the warning " "in the :mod:`ssl` documentation." msgstr "" -#: ../../library/os.rst:4536 ../../library/os.rst:4580 +#: ../../library/os.rst:4539 ../../library/os.rst:4583 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:4539 +#: ../../library/os.rst:4542 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4543 +#: ../../library/os.rst:4546 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:4547 +#: ../../library/os.rst:4550 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 " @@ -5130,21 +5136,21 @@ msgid "" "``free``)." msgstr "" -#: ../../library/os.rst:4556 +#: ../../library/os.rst:4559 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:4560 +#: ../../library/os.rst:4563 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:4570 +#: ../../library/os.rst:4573 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, " @@ -5153,31 +5159,31 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4576 +#: ../../library/os.rst:4579 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4583 +#: ../../library/os.rst:4586 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4587 +#: ../../library/os.rst:4590 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:4601 +#: ../../library/os.rst:4604 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:4604 +#: ../../library/os.rst:4607 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -5187,11 +5193,11 @@ msgid "" "be set to *sig*." msgstr "" -#: ../../library/os.rst:4611 +#: ../../library/os.rst:4614 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`。" -#: ../../library/os.rst:4613 +#: ../../library/os.rst:4616 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -5199,11 +5205,11 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4627 +#: ../../library/os.rst:4630 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4629 +#: ../../library/os.rst:4632 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -5211,23 +5217,23 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4636 +#: ../../library/os.rst:4639 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4643 +#: ../../library/os.rst:4646 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:4647 +#: ../../library/os.rst:4650 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 使用手冊。" -#: ../../library/os.rst:4654 +#: ../../library/os.rst:4657 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 " @@ -5235,13 +5241,13 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4665 +#: ../../library/os.rst:4668 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4673 +#: ../../library/os.rst:4676 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 " @@ -5251,7 +5257,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4681 +#: ../../library/os.rst:4684 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -5263,63 +5269,63 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4691 +#: ../../library/os.rst:4694 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:4696 +#: ../../library/os.rst:4699 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:4703 +#: ../../library/os.rst:4706 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4706 +#: ../../library/os.rst:4709 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:4710 +#: ../../library/os.rst:4713 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:4719 +#: ../../library/os.rst:4722 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4721 +#: ../../library/os.rst:4724 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4723 +#: ../../library/os.rst:4726 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:4727 +#: ../../library/os.rst:4730 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:4731 +#: ../../library/os.rst:4734 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 " @@ -5328,39 +5334,39 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4739 +#: ../../library/os.rst:4742 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4741 +#: ../../library/os.rst:4744 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4745 +#: ../../library/os.rst:4748 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4747 +#: ../../library/os.rst:4750 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4751 +#: ../../library/os.rst:4754 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4753 +#: ../../library/os.rst:4756 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4757 +#: ../../library/os.rst:4760 msgid "(``os.POSIX_SPAWN_CLOSEFROM``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSEFROM``, *fd*)" -#: ../../library/os.rst:4759 +#: ../../library/os.rst:4762 msgid "Performs ``os.closerange(fd, INF)``." msgstr "" -#: ../../library/os.rst:4761 +#: ../../library/os.rst:4764 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -5370,7 +5376,7 @@ msgid "" "c:func:`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4768 +#: ../../library/os.rst:4771 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 " @@ -5379,7 +5385,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4774 +#: ../../library/os.rst:4777 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 " @@ -5390,7 +5396,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4782 +#: ../../library/os.rst:4785 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:" @@ -5398,7 +5404,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4787 +#: ../../library/os.rst:4790 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 " @@ -5406,14 +5412,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4792 +#: ../../library/os.rst:4795 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:4796 +#: ../../library/os.rst:4799 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -5423,7 +5429,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4803 ../../library/os.rst:4824 +#: ../../library/os.rst:4806 ../../library/os.rst:4827 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -5431,79 +5437,79 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4807 +#: ../../library/os.rst:4810 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:4818 +#: ../../library/os.rst:4821 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4820 +#: ../../library/os.rst:4823 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:4830 +#: ../../library/os.rst:4833 msgid "See :func:`posix_spawn` documentation." msgstr "見 :func:`posix_spawn` 文件。" -#: ../../library/os.rst:4836 +#: ../../library/os.rst:4839 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:4841 +#: ../../library/os.rst:4844 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4842 +#: ../../library/os.rst:4845 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4844 +#: ../../library/os.rst:4847 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4846 +#: ../../library/os.rst:4849 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:4850 +#: ../../library/os.rst:4853 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:4855 +#: ../../library/os.rst:4858 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:4859 +#: ../../library/os.rst:4862 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4875 +#: ../../library/os.rst:4878 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4877 +#: ../../library/os.rst:4880 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -5511,7 +5517,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4882 +#: ../../library/os.rst:4885 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 " @@ -5520,13 +5526,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4888 +#: ../../library/os.rst:4891 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:4891 +#: ../../library/os.rst:4894 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -5538,7 +5544,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4900 +#: ../../library/os.rst:4903 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -5551,7 +5557,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4910 +#: ../../library/os.rst:4913 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 " @@ -5563,13 +5569,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4919 +#: ../../library/os.rst:4922 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4922 +#: ../../library/os.rst:4925 msgid "" "import os\n" "os.spawnlp(os.P_WAIT, 'cp', 'cp', 'index.html', '/dev/null')\n" @@ -5583,7 +5589,7 @@ msgstr "" "L = ['cp', 'index.html', '/dev/null']\n" "os.spawnvpe(os.P_WAIT, 'cp', L, os.environ)" -#: ../../library/os.rst:4928 +#: ../../library/os.rst:4931 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -5591,7 +5597,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4932 +#: ../../library/os.rst:4935 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -5599,13 +5605,13 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4940 +#: ../../library/os.rst:4943 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:4948 +#: ../../library/os.rst:4951 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -5613,7 +5619,7 @@ msgid "" "been created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4958 +#: ../../library/os.rst:4961 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\* " @@ -5622,7 +5628,7 @@ msgid "" "successful, or ``-signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4970 +#: ../../library/os.rst:4973 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -5632,11 +5638,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4981 +#: ../../library/os.rst:4984 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4983 +#: ../../library/os.rst:4986 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:" @@ -5644,7 +5650,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4988 +#: ../../library/os.rst:4991 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 " @@ -5652,28 +5658,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4993 +#: ../../library/os.rst:4996 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:4997 +#: ../../library/os.rst:5000 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:5001 +#: ../../library/os.rst:5004 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:5005 +#: ../../library/os.rst:5008 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 " @@ -5684,14 +5690,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:5013 +#: ../../library/os.rst:5016 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:5017 +#: ../../library/os.rst:5020 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5699,7 +5705,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:5019 +#: ../../library/os.rst:5022 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5707,13 +5713,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:5023 +#: ../../library/os.rst:5026 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:5030 +#: ../../library/os.rst:5033 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 " @@ -5724,13 +5730,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:5038 +#: ../../library/os.rst:5041 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:5041 +#: ../../library/os.rst:5044 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 :" @@ -5739,7 +5745,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:5047 +#: ../../library/os.rst:5050 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is recommended " @@ -5747,54 +5753,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:5052 +#: ../../library/os.rst:5055 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:5056 +#: ../../library/os.rst:5059 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:5063 +#: ../../library/os.rst:5066 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:5066 +#: ../../library/os.rst:5069 msgid ":attr:`!user` - user time" msgstr ":attr:`!user` - 使用者時間" -#: ../../library/os.rst:5067 +#: ../../library/os.rst:5070 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:5068 +#: ../../library/os.rst:5071 msgid ":attr:`!children_user` - user time of all child processes" msgstr ":attr:`!children_user` - 所有子行程的使用者時間" -#: ../../library/os.rst:5069 +#: ../../library/os.rst:5072 msgid ":attr:`!children_system` - system time of all child processes" msgstr ":attr:`!children_system` - 所有子行程的系統時間" -#: ../../library/os.rst:5070 +#: ../../library/os.rst:5073 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:5072 +#: ../../library/os.rst:5075 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:5076 +#: ../../library/os.rst:5079 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5804,7 +5810,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:5090 +#: ../../library/os.rst:5093 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 " @@ -5813,87 +5819,87 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:5096 +#: ../../library/os.rst:5099 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:5099 ../../library/os.rst:5174 +#: ../../library/os.rst:5102 ../../library/os.rst:5177 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:5106 +#: ../../library/os.rst:5109 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:5113 +#: ../../library/os.rst:5116 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:5115 +#: ../../library/os.rst:5118 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:5118 +#: ../../library/os.rst:5121 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:5122 +#: ../../library/os.rst:5125 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:5125 +#: ../../library/os.rst:5128 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:5126 +#: ../../library/os.rst:5129 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:5127 +#: ../../library/os.rst:5130 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:5128 +#: ../../library/os.rst:5131 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:5129 +#: ../../library/os.rst:5132 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:5131 +#: ../../library/os.rst:5134 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:5140 +#: ../../library/os.rst:5143 msgid "This function is now available on macOS as well." msgstr "" -#: ../../library/os.rst:5146 +#: ../../library/os.rst:5149 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:5148 +#: ../../library/os.rst:5151 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 " @@ -5902,7 +5908,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:5153 +#: ../../library/os.rst:5156 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 " @@ -5912,7 +5918,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:5160 +#: ../../library/os.rst:5163 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 " @@ -5921,7 +5927,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:5166 +#: ../../library/os.rst:5169 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 " @@ -5933,7 +5939,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:5187 +#: ../../library/os.rst:5190 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 " @@ -5942,13 +5948,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:5194 ../../library/os.rst:5208 +#: ../../library/os.rst:5197 ../../library/os.rst:5211 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:5202 +#: ../../library/os.rst:5205 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5957,118 +5963,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:5219 +#: ../../library/os.rst:5222 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:5222 +#: ../../library/os.rst:5225 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:5223 +#: ../../library/os.rst:5226 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:5224 +#: ../../library/os.rst:5227 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:5225 +#: ../../library/os.rst:5228 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:5230 +#: ../../library/os.rst:5233 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:5233 +#: ../../library/os.rst:5236 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:5239 +#: ../../library/os.rst:5242 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:5248 +#: ../../library/os.rst:5251 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:5251 +#: ../../library/os.rst:5254 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:5261 +#: ../../library/os.rst:5264 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:5264 ../../library/os.rst:5296 +#: ../../library/os.rst:5267 ../../library/os.rst:5299 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:5273 +#: ../../library/os.rst:5276 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:5277 +#: ../../library/os.rst:5280 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:5284 +#: ../../library/os.rst:5287 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:5293 +#: ../../library/os.rst:5296 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:5308 +#: ../../library/os.rst:5311 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:5315 +#: ../../library/os.rst:5318 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "新增 :data:`CLD_KILLED` 和 :data:`CLD_STOPPED` 值。" -#: ../../library/os.rst:5321 +#: ../../library/os.rst:5324 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:5323 +#: ../../library/os.rst:5326 msgid "On Unix:" msgstr "在 Unix 上:" -#: ../../library/os.rst:5325 +#: ../../library/os.rst:5328 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:5328 +#: ../../library/os.rst:5331 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 " @@ -6076,15 +6082,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:5332 +#: ../../library/os.rst:5335 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "否則,引發 :exc:`ValueError`。" -#: ../../library/os.rst:5334 +#: ../../library/os.rst:5337 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:5336 +#: ../../library/os.rst:5339 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 " @@ -6092,234 +6098,234 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:5343 +#: ../../library/os.rst:5346 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:5351 +#: ../../library/os.rst:5354 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:5357 +#: ../../library/os.rst:5360 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:5360 ../../library/os.rst:5426 +#: ../../library/os.rst:5363 ../../library/os.rst:5429 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:5367 +#: ../../library/os.rst:5370 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:5371 +#: ../../library/os.rst:5374 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:5378 +#: ../../library/os.rst:5381 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:5381 +#: ../../library/os.rst:5384 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:5389 +#: ../../library/os.rst:5392 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:5397 +#: ../../library/os.rst:5400 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:5406 +#: ../../library/os.rst:5409 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:5408 +#: ../../library/os.rst:5411 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:5415 +#: ../../library/os.rst:5418 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:5417 +#: ../../library/os.rst:5420 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:5424 +#: ../../library/os.rst:5427 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5432 +#: ../../library/os.rst:5435 msgid "Interface to the scheduler" msgstr "排程器介面" -#: ../../library/os.rst:5434 +#: ../../library/os.rst:5437 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:5440 +#: ../../library/os.rst:5443 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5447 +#: ../../library/os.rst:5450 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5451 +#: ../../library/os.rst:5454 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5456 +#: ../../library/os.rst:5459 msgid "Scheduling policy for tasks with deadline constraints." msgstr "" -#: ../../library/os.rst:5462 +#: ../../library/os.rst:5465 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5466 +#: ../../library/os.rst:5469 msgid "Alias for :data:`SCHED_OTHER`." msgstr "" -#: ../../library/os.rst:5472 +#: ../../library/os.rst:5475 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5476 +#: ../../library/os.rst:5479 msgid "A First In First Out scheduling policy." msgstr "先進先出排程策略。" -#: ../../library/os.rst:5480 +#: ../../library/os.rst:5483 msgid "A round-robin scheduling policy." msgstr "輪轉排程策略。" -#: ../../library/os.rst:5484 +#: ../../library/os.rst:5487 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:5491 +#: ../../library/os.rst:5494 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:5495 +#: ../../library/os.rst:5498 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5499 +#: ../../library/os.rst:5502 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5504 +#: ../../library/os.rst:5507 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5510 +#: ../../library/os.rst:5513 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5516 +#: ../../library/os.rst:5519 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:5523 +#: ../../library/os.rst:5526 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:5530 +#: ../../library/os.rst:5533 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:5536 +#: ../../library/os.rst:5539 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:5542 +#: ../../library/os.rst:5545 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:5548 +#: ../../library/os.rst:5551 msgid "" "Voluntarily relinquish the CPU. See :manpage:`sched_yield(2)` for details." msgstr "" -#: ../../library/os.rst:5553 +#: ../../library/os.rst:5556 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:5560 +#: ../../library/os.rst:5563 msgid "Return the set of CPUs the process with PID *pid* is restricted to." msgstr "" -#: ../../library/os.rst:5562 +#: ../../library/os.rst:5565 msgid "" "If *pid* is zero, return the set of CPUs the calling thread of the current " "process is restricted to." msgstr "" -#: ../../library/os.rst:5565 +#: ../../library/os.rst:5568 msgid "See also the :func:`process_cpu_count` function." msgstr "也請見 :func:`process_cpu_count` 函式。" -#: ../../library/os.rst:5571 +#: ../../library/os.rst:5574 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5576 +#: ../../library/os.rst:5579 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 " @@ -6330,13 +6336,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5584 +#: ../../library/os.rst:5587 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5587 +#: ../../library/os.rst:5590 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 " @@ -6344,62 +6350,62 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5597 +#: ../../library/os.rst:5600 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:5606 +#: ../../library/os.rst:5609 msgid "" "Return the number of logical CPUs in the **system**. Returns ``None`` if " "undetermined." msgstr "" -#: ../../library/os.rst:5609 +#: ../../library/os.rst:5612 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:5614 +#: ../../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*." msgstr "" -#: ../../library/os.rst:5621 +#: ../../library/os.rst:5624 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:5630 +#: ../../library/os.rst:5633 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:5634 +#: ../../library/os.rst:5637 msgid "" "The :func:`cpu_count` function can be used to get the number of logical CPUs " "in the **system**." msgstr "" -#: ../../library/os.rst:5637 +#: ../../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*." msgstr "" -#: ../../library/os.rst:5640 +#: ../../library/os.rst:5643 msgid "See also the :func:`sched_getaffinity` function." msgstr "也請見 :func:`sched_getaffinity` 函式。" -#: ../../library/os.rst:5647 +#: ../../library/os.rst:5650 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -6408,44 +6414,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5657 +#: ../../library/os.rst:5660 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:5663 +#: ../../library/os.rst:5666 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5666 +#: ../../library/os.rst:5669 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5669 +#: ../../library/os.rst:5672 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5675 +#: ../../library/os.rst:5678 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:5683 +#: ../../library/os.rst:5686 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:5692 +#: ../../library/os.rst:5695 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -6454,7 +6460,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5702 +#: ../../library/os.rst:5705 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -6462,27 +6468,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5711 +#: ../../library/os.rst:5714 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:5719 +#: ../../library/os.rst:5722 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:5726 +#: ../../library/os.rst:5729 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:5733 +#: ../../library/os.rst:5736 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 " @@ -6491,36 +6497,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5742 +#: ../../library/os.rst:5745 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:5753 +#: ../../library/os.rst:5756 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:5761 +#: ../../library/os.rst:5764 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5766 +#: ../../library/os.rst:5769 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5769 +#: ../../library/os.rst:5772 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5772 +#: ../../library/os.rst:5775 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -6528,32 +6534,32 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5777 +#: ../../library/os.rst:5780 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:5781 +#: ../../library/os.rst:5784 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5790 +#: ../../library/os.rst:5793 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5792 +#: ../../library/os.rst:5795 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:5796 +#: ../../library/os.rst:5799 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -6563,63 +6569,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5803 +#: ../../library/os.rst:5806 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:5807 +#: ../../library/os.rst:5810 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5810 +#: ../../library/os.rst:5813 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:5814 +#: ../../library/os.rst:5817 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:5820 +#: ../../library/os.rst:5823 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:5824 +#: ../../library/os.rst:5827 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5828 +#: ../../library/os.rst:5831 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5834 +#: ../../library/os.rst:5837 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:5838 +#: ../../library/os.rst:5841 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:5845 +#: ../../library/os.rst:5848 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -6635,7 +6641,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:4597 ../../library/os.rst:4623 +#: ../../library/os.rst:4600 ../../library/os.rst:4626 msgid "process" msgstr "process" @@ -6688,8 +6694,8 @@ msgid "pty" msgstr "pty" #: ../../library/os.rst:2118 ../../library/os.rst:2531 -#: ../../library/os.rst:2732 ../../library/os.rst:3636 -#: ../../library/os.rst:3736 +#: ../../library/os.rst:2732 ../../library/os.rst:3639 +#: ../../library/os.rst:3739 msgid "directory" msgstr "directory(目錄)" @@ -6713,56 +6719,56 @@ msgstr "以及 os.makedirs()" msgid "stat" msgstr "stat" -#: ../../library/os.rst:3636 ../../library/os.rst:3736 +#: ../../library/os.rst:3639 ../../library/os.rst:3739 msgid "walking" msgstr "" -#: ../../library/os.rst:3636 ../../library/os.rst:3736 +#: ../../library/os.rst:3639 ../../library/os.rst:3739 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4597 ../../library/os.rst:4623 +#: ../../library/os.rst:4600 ../../library/os.rst:4626 msgid "killing" msgstr "" -#: ../../library/os.rst:4597 ../../library/os.rst:4623 +#: ../../library/os.rst:4600 ../../library/os.rst:4626 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5672 ../../library/os.rst:5708 +#: ../../library/os.rst:5675 ../../library/os.rst:5711 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5672 ../../library/os.rst:5680 -#: ../../library/os.rst:5688 ../../library/os.rst:5699 -#: ../../library/os.rst:5708 +#: ../../library/os.rst:5675 ../../library/os.rst:5683 +#: ../../library/os.rst:5691 ../../library/os.rst:5702 +#: ../../library/os.rst:5711 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5680 +#: ../../library/os.rst:5683 msgid ".." msgstr ".." -#: ../../library/os.rst:5688 ../../library/os.rst:5699 +#: ../../library/os.rst:5691 ../../library/os.rst:5702 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5689 +#: ../../library/os.rst:5692 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5689 +#: ../../library/os.rst:5692 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5715 +#: ../../library/os.rst:5718 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5715 +#: ../../library/os.rst:5718 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5715 +#: ../../library/os.rst:5718 msgid "; (semicolon)" msgstr "; (分號)" From 6abf878f8d8037cf3fbd54fd1d8e12d257744a78 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 10 Nov 2025 00:17:50 +0000 Subject: [PATCH 4/9] sync with cpython 6cbb8cb1 --- c-api/descriptor.po | 50 +++- c-api/exceptions.po | 292 ++++++++++---------- c-api/function.po | 62 +++-- library/dis.po | 232 ++++++++-------- library/unittest.mock-examples.po | 440 +++++++++++++++--------------- 5 files changed, 576 insertions(+), 500 deletions(-) diff --git a/c-api/descriptor.po b/c-api/descriptor.po index 7dc8620da45..6f2795117b5 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 00:16+0000\n" +"POT-Creation-Date: 2025-11-10 00:16+0000\n" "PO-Revision-Date: 2021-12-09 20:56+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,3 +45,51 @@ msgid "" msgstr "" "如果 descriptor 物件 *descr* 描述的是一個資料屬性則回傳非零值,或者如果它描述" "的是一個方法則回傳 ``0``。*descr* 必須為一個 descriptor 物件;沒有錯誤檢查。" + +#: ../../c-api/descriptor.rst:44 +msgid "Built-in descriptors" +msgstr "" + +#: ../../c-api/descriptor.rst:48 +msgid "" +"The type object for super objects. This is the same object as :class:`super` " +"in the Python layer." +msgstr "" + +#: ../../c-api/descriptor.rst:54 +msgid "" +"The type of class method objects. This is the same object as :class:" +"`classmethod` in the Python layer." +msgstr "" + +#: ../../c-api/descriptor.rst:60 +msgid "" +"Create a new :class:`classmethod` object wrapping *callable*. *callable* " +"must be a callable object and must not be ``NULL``." +msgstr "" + +#: ../../c-api/descriptor.rst:63 +msgid "" +"On success, this function returns a :term:`strong reference` to a new class " +"method descriptor. On failure, this function returns ``NULL`` with an " +"exception set." +msgstr "" + +#: ../../c-api/descriptor.rst:70 +msgid "" +"The type of static method objects. This is the same object as :class:" +"`staticmethod` in the Python layer." +msgstr "" + +#: ../../c-api/descriptor.rst:76 +msgid "" +"Create a new :class:`staticmethod` object wrapping *callable*. *callable* " +"must be a callable object and must not be ``NULL``." +msgstr "" + +#: ../../c-api/descriptor.rst:79 +msgid "" +"On success, this function returns a :term:`strong reference` to a new static " +"method descriptor. On failure, this function returns ``NULL`` with an " +"exception set." +msgstr "" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index f05ed3acbc4..744d8b49c21 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-09 00:17+0000\n" +"POT-Creation-Date: 2025-11-10 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -855,18 +855,28 @@ msgstr "例外物件" #: ../../c-api/exceptions.rst:793 msgid "" +"Return true if *op* is an instance of :class:`BaseException`, false " +"otherwise. This function always succeeds." +msgstr "" + +#: ../../c-api/exceptions.rst:799 +msgid "Equivalent to :c:func:`Py_TYPE(op) `." +msgstr "" + +#: ../../c-api/exceptions.rst:804 +msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through the :attr:`~BaseException.__traceback__` " "attribute. If there is no traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:801 +#: ../../c-api/exceptions.rst:812 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:807 +#: ../../c-api/exceptions.rst:818 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -874,14 +884,14 @@ msgid "" "there is no context associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:815 +#: ../../c-api/exceptions.rst:826 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:822 +#: ../../c-api/exceptions.rst:833 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " @@ -889,28 +899,28 @@ msgid "" "attribute." msgstr "" -#: ../../c-api/exceptions.rst:830 +#: ../../c-api/exceptions.rst:841 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or ``None``. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:834 +#: ../../c-api/exceptions.rst:845 msgid "" "The :attr:`~BaseException.__suppress_context__` attribute is implicitly set " "to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:840 +#: ../../c-api/exceptions.rst:851 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "回傳例外 *ex* 的 :attr:`~BaseException.args`。" -#: ../../c-api/exceptions.rst:845 +#: ../../c-api/exceptions.rst:856 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "設定例外 *ex* 的 :attr:`~BaseException.args` 為 *args*。" -#: ../../c-api/exceptions.rst:849 +#: ../../c-api/exceptions.rst:860 msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " @@ -922,98 +932,98 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: ../../c-api/exceptions.rst:863 +#: ../../c-api/exceptions.rst:874 msgid "Unicode Exception Objects" msgstr "Unicode 例外物件" -#: ../../c-api/exceptions.rst:865 +#: ../../c-api/exceptions.rst:876 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:869 +#: ../../c-api/exceptions.rst:880 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:876 +#: ../../c-api/exceptions.rst:887 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:882 +#: ../../c-api/exceptions.rst:893 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:888 +#: ../../c-api/exceptions.rst:899 msgid "" "Get the *start* attribute of the given exception object and place it into " "*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:892 +#: ../../c-api/exceptions.rst:903 msgid "" "If the :attr:`UnicodeError.object` is an empty sequence, the resulting " "*start* is ``0``. Otherwise, it is clipped to ``[0, len(object) - 1]``." msgstr "" -#: ../../c-api/exceptions.rst:895 +#: ../../c-api/exceptions.rst:906 msgid ":attr:`UnicodeError.start`" msgstr ":attr:`UnicodeError.start`" -#: ../../c-api/exceptions.rst:901 +#: ../../c-api/exceptions.rst:912 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:906 +#: ../../c-api/exceptions.rst:917 msgid "" "While passing a negative *start* does not raise an exception, the " "corresponding getters will not consider it as a relative offset." msgstr "" -#: ../../c-api/exceptions.rst:914 +#: ../../c-api/exceptions.rst:925 msgid "" "Get the *end* attribute of the given exception object and place it into " "*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:918 +#: ../../c-api/exceptions.rst:929 msgid "" "If the :attr:`UnicodeError.object` is an empty sequence, the resulting *end* " "is ``0``. Otherwise, it is clipped to ``[1, len(object)]``." msgstr "" -#: ../../c-api/exceptions.rst:925 +#: ../../c-api/exceptions.rst:936 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:928 +#: ../../c-api/exceptions.rst:939 msgid ":attr:`UnicodeError.end`" msgstr ":attr:`UnicodeError.end`" -#: ../../c-api/exceptions.rst:934 +#: ../../c-api/exceptions.rst:945 msgid "Return the *reason* attribute of the given exception object." msgstr "回傳給定例外物件的 *reason* 屬性。" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:951 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:947 +#: ../../c-api/exceptions.rst:958 msgid "Recursion Control" msgstr "遞迴控制" -#: ../../c-api/exceptions.rst:949 +#: ../../c-api/exceptions.rst:960 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -1023,37 +1033,37 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:958 +#: ../../c-api/exceptions.rst:969 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:960 +#: ../../c-api/exceptions.rst:971 msgid "" "The function then checks if the stack limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:964 +#: ../../c-api/exceptions.rst:975 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:968 ../../c-api/exceptions.rst:976 +#: ../../c-api/exceptions.rst:979 ../../c-api/exceptions.rst:987 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:973 +#: ../../c-api/exceptions.rst:984 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:979 +#: ../../c-api/exceptions.rst:990 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -1062,13 +1072,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:987 +#: ../../c-api/exceptions.rst:998 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:990 +#: ../../c-api/exceptions.rst:1001 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -1076,301 +1086,301 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:996 +#: ../../c-api/exceptions.rst:1007 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:1000 +#: ../../c-api/exceptions.rst:1011 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1016 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:1010 +#: ../../c-api/exceptions.rst:1021 msgid "" "Get the recursion limit for the current interpreter. It can be set with :c:" "func:`Py_SetRecursionLimit`. The recursion limit prevents the Python " "interpreter stack from growing infinitely." msgstr "" -#: ../../c-api/exceptions.rst:1014 ../../c-api/exceptions.rst:1024 +#: ../../c-api/exceptions.rst:1025 ../../c-api/exceptions.rst:1035 msgid "" "This function cannot fail, and the caller must hold an :term:`attached " "thread state`." msgstr "" -#: ../../c-api/exceptions.rst:1018 +#: ../../c-api/exceptions.rst:1029 msgid ":py:func:`sys.getrecursionlimit`" msgstr ":py:func:`sys.getrecursionlimit`" -#: ../../c-api/exceptions.rst:1022 +#: ../../c-api/exceptions.rst:1033 msgid "Set the recursion limit for the current interpreter." msgstr "" -#: ../../c-api/exceptions.rst:1028 +#: ../../c-api/exceptions.rst:1039 msgid ":py:func:`sys.setrecursionlimit`" msgstr ":py:func:`sys.setrecursionlimit`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1044 msgid "Exception and warning types" msgstr "例外和警告型別" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1046 msgid "" "All standard Python exceptions and warning categories are available as " "global variables whose names are ``PyExc_`` followed by the Python exception " "name. These have the type :c:expr:`PyObject*`; they are all class objects." msgstr "" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1050 msgid "For completeness, here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1042 +#: ../../c-api/exceptions.rst:1053 msgid "Exception types" msgstr "例外型別" -#: ../../c-api/exceptions.rst:1049 ../../c-api/exceptions.rst:1195 -#: ../../c-api/exceptions.rst:1225 +#: ../../c-api/exceptions.rst:1060 ../../c-api/exceptions.rst:1206 +#: ../../c-api/exceptions.rst:1236 msgid "C name" msgstr "C 名稱" -#: ../../c-api/exceptions.rst:1050 ../../c-api/exceptions.rst:1196 -#: ../../c-api/exceptions.rst:1226 +#: ../../c-api/exceptions.rst:1061 ../../c-api/exceptions.rst:1207 +#: ../../c-api/exceptions.rst:1237 msgid "Python name" msgstr "Python 名稱" -#: ../../c-api/exceptions.rst:1052 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1054 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`BaseExceptionGroup`" msgstr ":exc:`BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1056 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1058 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1060 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1062 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1064 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1066 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1068 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1070 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1072 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1076 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1078 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1080 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1082 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1084 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1086 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1088 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1090 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1092 +#: ../../c-api/exceptions.rst:1103 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1094 +#: ../../c-api/exceptions.rst:1105 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1096 +#: ../../c-api/exceptions.rst:1107 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1098 +#: ../../c-api/exceptions.rst:1109 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1100 +#: ../../c-api/exceptions.rst:1111 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1102 +#: ../../c-api/exceptions.rst:1113 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1104 +#: ../../c-api/exceptions.rst:1115 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1106 +#: ../../c-api/exceptions.rst:1117 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1108 +#: ../../c-api/exceptions.rst:1119 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1110 +#: ../../c-api/exceptions.rst:1121 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1112 +#: ../../c-api/exceptions.rst:1123 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1114 +#: ../../c-api/exceptions.rst:1125 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1116 ../../c-api/exceptions.rst:1199 -#: ../../c-api/exceptions.rst:1202 ../../c-api/exceptions.rst:1205 +#: ../../c-api/exceptions.rst:1127 ../../c-api/exceptions.rst:1210 +#: ../../c-api/exceptions.rst:1213 ../../c-api/exceptions.rst:1216 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1118 +#: ../../c-api/exceptions.rst:1129 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1120 +#: ../../c-api/exceptions.rst:1131 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1122 +#: ../../c-api/exceptions.rst:1133 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1124 +#: ../../c-api/exceptions.rst:1135 msgid ":exc:`PythonFinalizationError`" msgstr ":exc:`PythonFinalizationError`" -#: ../../c-api/exceptions.rst:1126 +#: ../../c-api/exceptions.rst:1137 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1139 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1130 +#: ../../c-api/exceptions.rst:1141 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1132 +#: ../../c-api/exceptions.rst:1143 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1134 +#: ../../c-api/exceptions.rst:1145 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1147 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1138 +#: ../../c-api/exceptions.rst:1149 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1140 +#: ../../c-api/exceptions.rst:1151 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1142 +#: ../../c-api/exceptions.rst:1153 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1144 +#: ../../c-api/exceptions.rst:1155 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1146 +#: ../../c-api/exceptions.rst:1157 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1148 +#: ../../c-api/exceptions.rst:1159 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1150 +#: ../../c-api/exceptions.rst:1161 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1152 +#: ../../c-api/exceptions.rst:1163 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1154 +#: ../../c-api/exceptions.rst:1165 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1156 +#: ../../c-api/exceptions.rst:1167 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1158 +#: ../../c-api/exceptions.rst:1169 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1171 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1162 +#: ../../c-api/exceptions.rst:1173 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1390,141 +1400,141 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1172 +#: ../../c-api/exceptions.rst:1183 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`。" -#: ../../c-api/exceptions.rst:1175 +#: ../../c-api/exceptions.rst:1186 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`。" -#: ../../c-api/exceptions.rst:1178 +#: ../../c-api/exceptions.rst:1189 msgid ":c:data:`PyExc_BaseExceptionGroup`." msgstr ":c:data:`PyExc_BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1194 msgid "OSError aliases" msgstr "OSError 別名" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1196 msgid "The following are a compatibility aliases to :c:data:`PyExc_OSError`." msgstr "" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1198 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1208 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:1206 +#: ../../c-api/exceptions.rst:1217 msgid "[win]_" msgstr "[win]_" -#: ../../c-api/exceptions.rst:1208 +#: ../../c-api/exceptions.rst:1219 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1211 +#: ../../c-api/exceptions.rst:1222 msgid "" ":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that " "uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1218 +#: ../../c-api/exceptions.rst:1229 msgid "Warning types" msgstr "警告型別" -#: ../../c-api/exceptions.rst:1228 +#: ../../c-api/exceptions.rst:1239 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1230 +#: ../../c-api/exceptions.rst:1241 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1232 +#: ../../c-api/exceptions.rst:1243 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1234 +#: ../../c-api/exceptions.rst:1245 msgid ":exc:`EncodingWarning`" msgstr ":exc:`EncodingWarning`" -#: ../../c-api/exceptions.rst:1236 +#: ../../c-api/exceptions.rst:1247 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1238 +#: ../../c-api/exceptions.rst:1249 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1240 +#: ../../c-api/exceptions.rst:1251 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1242 +#: ../../c-api/exceptions.rst:1253 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1244 +#: ../../c-api/exceptions.rst:1255 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1246 +#: ../../c-api/exceptions.rst:1257 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1248 +#: ../../c-api/exceptions.rst:1259 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1250 +#: ../../c-api/exceptions.rst:1261 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1252 +#: ../../c-api/exceptions.rst:1263 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`。" -#: ../../c-api/exceptions.rst:1255 +#: ../../c-api/exceptions.rst:1266 msgid ":c:data:`PyExc_EncodingWarning`." msgstr ":c:data:`PyExc_EncodingWarning`。" -#: ../../c-api/exceptions.rst:1260 +#: ../../c-api/exceptions.rst:1271 msgid "Tracebacks" msgstr "" -#: ../../c-api/exceptions.rst:1264 +#: ../../c-api/exceptions.rst:1275 msgid "" "Type object for traceback objects. This is available as :class:`types." "TracebackType` in the Python layer." msgstr "" -#: ../../c-api/exceptions.rst:1270 +#: ../../c-api/exceptions.rst:1281 msgid "" "Return true if *op* is a traceback object, false otherwise. This function " "does not account for subtypes." msgstr "" -#: ../../c-api/exceptions.rst:1276 +#: ../../c-api/exceptions.rst:1287 msgid "" "Replace the :attr:`~BaseException.__traceback__` attribute on the current " "exception with a new traceback prepending *f* to the existing chain." msgstr "" -#: ../../c-api/exceptions.rst:1279 +#: ../../c-api/exceptions.rst:1290 msgid "Calling this function without an exception set is undefined behavior." msgstr "" -#: ../../c-api/exceptions.rst:1281 ../../c-api/exceptions.rst:1289 +#: ../../c-api/exceptions.rst:1292 ../../c-api/exceptions.rst:1300 msgid "" "This function returns ``0`` on success, and returns ``-1`` with an exception " "set on failure." msgstr "" -#: ../../c-api/exceptions.rst:1287 +#: ../../c-api/exceptions.rst:1298 msgid "Write the traceback *tb* into the file *f*." msgstr "" diff --git a/c-api/function.po b/c-api/function.po index dd441c9f9b0..a5f9f3a67fb 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-11-10 00:16+0000\n" "PO-Revision-Date: 2022-11-12 15:45+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,8 +125,8 @@ msgid "" msgstr "" "設定函式物件 *op* 的引數預設值。*defaults* 必須是 ``Py_None`` 或一個 tuple。" -#: ../../c-api/function.rst:86 ../../c-api/function.rst:116 -#: ../../c-api/function.rst:130 +#: ../../c-api/function.rst:86 ../../c-api/function.rst:125 +#: ../../c-api/function.rst:139 msgid "Raises :exc:`SystemError` and returns ``-1`` on failure." msgstr "引發 :exc:`SystemError` 且在失敗時回傳 ``-1``。" @@ -138,7 +138,8 @@ msgstr "為一個給定的函式物件 *func* 設定 vectorcall 欄位。" msgid "" "Warning: extensions using this API must preserve the behavior of the " "unaltered (default) vectorcall function!" -msgstr "警告:使用此 API 的擴充套件必須保留未更改(預設)vectorcall 函式的行為!" +msgstr "" +"警告:使用此 API 的擴充套件必須保留未更改(預設)vectorcall 函式的行為!" #: ../../c-api/function.rst:101 msgid "" @@ -149,6 +150,21 @@ msgstr "" "``NULL``。" #: ../../c-api/function.rst:107 +#, fuzzy +msgid "" +"Set the keyword-only argument default values of the function object *op*. " +"*defaults* must be a dictionary of keyword-only arguments or ``Py_None``." +msgstr "" +"回傳函式物件 *op* 的僅限關鍵字引數預設值,這可以是一個含有多個引數的字典或 " +"``NULL``。" + +#: ../../c-api/function.rst:110 +msgid "" +"This function returns ``0`` on success, and returns ``-1`` with an exception " +"set on failure." +msgstr "" + +#: ../../c-api/function.rst:116 msgid "" "Return the closure associated with the function object *op*. This can be " "``NULL`` or a tuple of cell objects." @@ -156,7 +172,7 @@ msgstr "" "回傳與函式物件 *op* 相關聯的閉包,這可以是個 ``NULL`` 或是一個包含 cell 物件" "的 tuple。" -#: ../../c-api/function.rst:113 +#: ../../c-api/function.rst:122 msgid "" "Set the closure associated with the function object *op*. *closure* must be " "``Py_None`` or a tuple of cell objects." @@ -164,27 +180,27 @@ msgstr "" "設定與函式物件 *op* 相關聯的閉包,*closure* 必須是 ``Py_None`` 或是一個包含 " "cell 物件的 tuple。" -#: ../../c-api/function.rst:121 +#: ../../c-api/function.rst:130 msgid "" "Return the annotations of the function object *op*. This can be a mutable " "dictionary or ``NULL``." msgstr "" "回傳函式物件 *op* 的標註,這可以是一個可變動的 (mutable) 字典或 ``NULL``。" -#: ../../c-api/function.rst:127 +#: ../../c-api/function.rst:136 msgid "" "Set the annotations for the function object *op*. *annotations* must be a " "dictionary or ``Py_None``." msgstr "設定函式物件 *op* 的標註,*annotations* 必須是一個字典或 ``Py_None``。" -#: ../../c-api/function.rst:141 +#: ../../c-api/function.rst:150 msgid "" "These functions are similar to their ``PyFunction_Get*`` counterparts, but " "do not do type checking. Passing anything other than an instance of :c:data:" "`PyFunction_Type` is undefined behavior." msgstr "" -#: ../../c-api/function.rst:148 +#: ../../c-api/function.rst:157 msgid "" "Register *callback* as a function watcher for the current interpreter. " "Return an ID which may be passed to :c:func:`PyFunction_ClearWatcher`. In " @@ -192,7 +208,7 @@ msgid "" "exception." msgstr "" -#: ../../c-api/function.rst:158 +#: ../../c-api/function.rst:167 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyFunction_AddWatcher` for the current interpreter. Return ``0`` on " @@ -200,35 +216,35 @@ msgid "" "*watcher_id* was never registered.)" msgstr "" -#: ../../c-api/function.rst:168 +#: ../../c-api/function.rst:177 msgid "Enumeration of possible function watcher events:" msgstr "" -#: ../../c-api/function.rst:170 +#: ../../c-api/function.rst:179 msgid "``PyFunction_EVENT_CREATE``" msgstr "``PyFunction_EVENT_CREATE``" -#: ../../c-api/function.rst:171 +#: ../../c-api/function.rst:180 msgid "``PyFunction_EVENT_DESTROY``" msgstr "``PyFunction_EVENT_DESTROY``" -#: ../../c-api/function.rst:172 +#: ../../c-api/function.rst:181 msgid "``PyFunction_EVENT_MODIFY_CODE``" msgstr "``PyFunction_EVENT_MODIFY_CODE``" -#: ../../c-api/function.rst:173 +#: ../../c-api/function.rst:182 msgid "``PyFunction_EVENT_MODIFY_DEFAULTS``" msgstr "``PyFunction_EVENT_MODIFY_DEFAULTS``" -#: ../../c-api/function.rst:174 +#: ../../c-api/function.rst:183 msgid "``PyFunction_EVENT_MODIFY_KWDEFAULTS``" msgstr "``PyFunction_EVENT_MODIFY_KWDEFAULTS``" -#: ../../c-api/function.rst:181 +#: ../../c-api/function.rst:190 msgid "Type of a function watcher callback function." msgstr "" -#: ../../c-api/function.rst:183 +#: ../../c-api/function.rst:192 msgid "" "If *event* is ``PyFunction_EVENT_CREATE`` or ``PyFunction_EVENT_DESTROY`` " "then *new_value* will be ``NULL``. Otherwise, *new_value* will hold a :term:" @@ -236,13 +252,13 @@ msgid "" "for the attribute that is being modified." msgstr "" -#: ../../c-api/function.rst:188 +#: ../../c-api/function.rst:197 msgid "" "The callback may inspect but must not modify *func*; doing so could have " "unpredictable effects, including infinite recursion." msgstr "" -#: ../../c-api/function.rst:191 +#: ../../c-api/function.rst:200 msgid "" "If *event* is ``PyFunction_EVENT_CREATE``, then the callback is invoked " "after *func* has been fully initialized. Otherwise, the callback is invoked " @@ -254,7 +270,7 @@ msgid "" "semantics of the Python code being executed." msgstr "" -#: ../../c-api/function.rst:200 +#: ../../c-api/function.rst:209 msgid "" "If *event* is ``PyFunction_EVENT_DESTROY``, Taking a reference in the " "callback to the about-to-be-destroyed function will resurrect it, preventing " @@ -262,14 +278,14 @@ msgid "" "later, any watcher callbacks active at that time will be called again." msgstr "" -#: ../../c-api/function.rst:205 +#: ../../c-api/function.rst:214 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/function.rst:209 +#: ../../c-api/function.rst:218 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " diff --git a/library/dis.po b/library/dis.po index 03384ac2f9e..187ceb7964f 100644 --- a/library/dis.po +++ b/library/dis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-30 00:13+0000\n" +"POT-Creation-Date: 2025-11-10 00:16+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,8 +114,7 @@ msgstr "" msgid "" "the following command can be used to display the disassembly of :func:`!" "myfunc`:" -msgstr "" -"可以使用以下指令來顯示 :func:`!myfunc` 的反組譯:" +msgstr "可以使用以下指令來顯示 :func:`!myfunc` 的反組譯:" #: ../../library/dis.rst:73 msgid "" @@ -1149,7 +1148,7 @@ msgid "" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1022 ../../library/dis.rst:1764 +#: ../../library/dis.rst:1022 ../../library/dis.rst:1768 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." @@ -1870,24 +1869,33 @@ msgstr "" msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1684 +#: ../../library/dis.rst:1676 +msgid "``0x10`` the :term:`annotate function` for the function object" +msgstr "" + +#: ../../library/dis.rst:1680 +msgid "" +"Added ``0x10`` to indicate the annotate function for the function object." +msgstr "" + +#: ../../library/dis.rst:1688 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1686 +#: ../../library/dis.rst:1690 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" "STACK.append(slice(start, end))" msgstr "" -#: ../../library/dis.rst:1690 +#: ../../library/dis.rst:1694 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1692 +#: ../../library/dis.rst:1696 msgid "" "step = STACK.pop()\n" "end = STACK.pop()\n" @@ -1899,11 +1907,11 @@ msgstr "" "start = STACK.pop()\n" "STACK.append(slice(start, end, step))" -#: ../../library/dis.rst:1697 +#: ../../library/dis.rst:1701 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1702 +#: ../../library/dis.rst:1706 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1911,11 +1919,11 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1710 +#: ../../library/dis.rst:1714 msgid "Convert value to a string, depending on ``oparg``::" msgstr "" -#: ../../library/dis.rst:1712 +#: ../../library/dis.rst:1716 msgid "" "value = STACK.pop()\n" "result = func(value)\n" @@ -1925,28 +1933,28 @@ msgstr "" "result = func(value)\n" "STACK.append(result)" -#: ../../library/dis.rst:1716 +#: ../../library/dis.rst:1720 msgid "``oparg == 1``: call :func:`str` on *value*" msgstr "" -#: ../../library/dis.rst:1717 +#: ../../library/dis.rst:1721 msgid "``oparg == 2``: call :func:`repr` on *value*" msgstr "" -#: ../../library/dis.rst:1718 +#: ../../library/dis.rst:1722 msgid "``oparg == 3``: call :func:`ascii` on *value*" msgstr "" -#: ../../library/dis.rst:1720 ../../library/dis.rst:1733 -#: ../../library/dis.rst:1746 +#: ../../library/dis.rst:1724 ../../library/dis.rst:1737 +#: ../../library/dis.rst:1750 msgid "Used for implementing formatted string literals (f-strings)." msgstr "" -#: ../../library/dis.rst:1727 +#: ../../library/dis.rst:1731 msgid "Formats the value on top of stack::" msgstr "" -#: ../../library/dis.rst:1729 +#: ../../library/dis.rst:1733 msgid "" "value = STACK.pop()\n" "result = value.__format__(\"\")\n" @@ -1956,11 +1964,11 @@ msgstr "" "result = value.__format__(\"\")\n" "STACK.append(result)" -#: ../../library/dis.rst:1739 +#: ../../library/dis.rst:1743 msgid "Formats the given value with the given format spec::" msgstr "" -#: ../../library/dis.rst:1741 +#: ../../library/dis.rst:1745 msgid "" "spec = STACK.pop()\n" "value = STACK.pop()\n" @@ -1972,14 +1980,14 @@ msgstr "" "result = value.__format__(spec)\n" "STACK.append(result)" -#: ../../library/dis.rst:1753 +#: ../../library/dis.rst:1757 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1757 +#: ../../library/dis.rst:1761 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1987,219 +1995,219 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1771 +#: ../../library/dis.rst:1775 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1773 +#: ../../library/dis.rst:1777 msgid "" "The ``context`` operand consists of two parts. The lowest two bits indicate " "where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1776 +#: ../../library/dis.rst:1780 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1778 +#: ../../library/dis.rst:1782 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1779 +#: ../../library/dis.rst:1783 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1780 +#: ../../library/dis.rst:1784 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1782 +#: ../../library/dis.rst:1786 msgid "" "The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " "otherwise." msgstr "" -#: ../../library/dis.rst:1787 +#: ../../library/dis.rst:1791 msgid "The oparg value changed to include information about except-depth" msgstr "" -#: ../../library/dis.rst:1793 +#: ../../library/dis.rst:1797 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1802 +#: ../../library/dis.rst:1806 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1805 +#: ../../library/dis.rst:1809 msgid "" "If the call raises :exc:`StopIteration`, pop the top value from the stack, " "push the exception's ``value`` attribute, and increment the bytecode counter " "by *delta*." msgstr "" -#: ../../library/dis.rst:1814 +#: ../../library/dis.rst:1818 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1818 +#: ../../library/dis.rst:1822 msgid "" "If your application uses pseudo instructions or specialized instructions, " "use the :data:`hasarg` collection instead." msgstr "" -#: ../../library/dis.rst:1821 +#: ../../library/dis.rst:1825 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1825 +#: ../../library/dis.rst:1829 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1830 +#: ../../library/dis.rst:1834 msgid "Use :data:`hasarg` instead." msgstr "" -#: ../../library/dis.rst:1835 +#: ../../library/dis.rst:1839 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is not performance critical." msgstr "" -#: ../../library/dis.rst:1839 ../../library/dis.rst:1893 +#: ../../library/dis.rst:1843 ../../library/dis.rst:1897 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1842 ../../library/dis.rst:1896 +#: ../../library/dis.rst:1846 ../../library/dis.rst:1900 msgid "Operand" msgstr "運算元" -#: ../../library/dis.rst:1842 ../../library/dis.rst:1896 +#: ../../library/dis.rst:1846 ../../library/dis.rst:1900 msgid "Description" msgstr "描述" -#: ../../library/dis.rst:1844 +#: ../../library/dis.rst:1848 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1844 ../../library/dis.rst:1898 +#: ../../library/dis.rst:1848 ../../library/dis.rst:1902 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1846 +#: ../../library/dis.rst:1850 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1846 +#: ../../library/dis.rst:1850 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1849 +#: ../../library/dis.rst:1853 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1849 +#: ../../library/dis.rst:1853 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1852 +#: ../../library/dis.rst:1856 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1852 +#: ../../library/dis.rst:1856 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1855 +#: ../../library/dis.rst:1859 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1855 +#: ../../library/dis.rst:1859 msgid "Wraps an async generator value" msgstr "" -#: ../../library/dis.rst:1857 +#: ../../library/dis.rst:1861 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1857 +#: ../../library/dis.rst:1861 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1860 +#: ../../library/dis.rst:1864 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1860 +#: ../../library/dis.rst:1864 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1862 +#: ../../library/dis.rst:1866 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1862 +#: ../../library/dis.rst:1866 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1864 +#: ../../library/dis.rst:1868 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1864 +#: ../../library/dis.rst:1868 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1867 +#: ../../library/dis.rst:1871 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1867 +#: ../../library/dis.rst:1871 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1870 +#: ../../library/dis.rst:1874 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1870 +#: ../../library/dis.rst:1874 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1873 +#: ../../library/dis.rst:1877 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1873 +#: ../../library/dis.rst:1877 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1885 +#: ../../library/dis.rst:1889 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1888 +#: ../../library/dis.rst:1892 msgid "" "arg2 = STACK.pop()\n" "arg1 = STACK.pop()\n" @@ -2211,43 +2219,43 @@ msgstr "" "result = intrinsic2(arg1, arg2)\n" "STACK.append(result)" -#: ../../library/dis.rst:1898 +#: ../../library/dis.rst:1902 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1900 +#: ../../library/dis.rst:1904 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1900 +#: ../../library/dis.rst:1904 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1904 +#: ../../library/dis.rst:1908 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1904 +#: ../../library/dis.rst:1908 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1907 +#: ../../library/dis.rst:1911 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1907 +#: ../../library/dis.rst:1911 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1911 +#: ../../library/dis.rst:1915 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1911 +#: ../../library/dis.rst:1915 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1920 +#: ../../library/dis.rst:1924 msgid "" "Performs special method lookup on ``STACK[-1]``. If ``type(STACK[-1])." "__xxx__`` is a method, leave ``type(STACK[-1]).__xxx__; STACK[-1]`` on the " @@ -2255,25 +2263,25 @@ msgid "" "__xxx__; NULL`` on the stack." msgstr "" -#: ../../library/dis.rst:1929 +#: ../../library/dis.rst:1933 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1931 +#: ../../library/dis.rst:1935 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1936 +#: ../../library/dis.rst:1940 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1943 +#: ../../library/dis.rst:1947 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -2282,96 +2290,96 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1952 +#: ../../library/dis.rst:1956 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1956 +#: ../../library/dis.rst:1960 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1963 +#: ../../library/dis.rst:1967 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1969 +#: ../../library/dis.rst:1973 msgid "" "Works as :opcode:`LOAD_CONST`, but is more efficient for immortal objects." msgstr "" -#: ../../library/dis.rst:1975 +#: ../../library/dis.rst:1979 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1981 +#: ../../library/dis.rst:1985 msgid "" "Conditional jumps which do not impact the stack. Replaced by the sequence " "``COPY 1``, ``TO_BOOL``, ``POP_JUMP_IF_TRUE/FALSE``." msgstr "" -#: ../../library/dis.rst:1986 +#: ../../library/dis.rst:1990 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1989 +#: ../../library/dis.rst:1993 msgid "" "Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." msgstr "" -#: ../../library/dis.rst:1991 +#: ../../library/dis.rst:1995 msgid "This opcode is now a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1998 +#: ../../library/dis.rst:2002 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:2000 +#: ../../library/dis.rst:2004 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:2003 +#: ../../library/dis.rst:2007 msgid "" "The collections now contain pseudo instructions and instrumented " "instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " "and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:2010 +#: ../../library/dis.rst:2014 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:2015 +#: ../../library/dis.rst:2019 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:2020 +#: ../../library/dis.rst:2024 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:2025 +#: ../../library/dis.rst:2029 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:2032 +#: ../../library/dis.rst:2036 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:2037 +#: ../../library/dis.rst:2041 msgid "" "Sequence of bytecodes that access a :term:`free (closure) variable `. 'free' in this context refers to names in the current scope that " @@ -2380,46 +2388,46 @@ msgid "" "scopes." msgstr "" -#: ../../library/dis.rst:2045 +#: ../../library/dis.rst:2049 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:2050 +#: ../../library/dis.rst:2054 msgid "Sequence of bytecodes that have a jump target. All jumps are relative." msgstr "" -#: ../../library/dis.rst:2057 +#: ../../library/dis.rst:2061 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:2062 +#: ../../library/dis.rst:2066 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:2066 +#: ../../library/dis.rst:2070 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:2073 +#: ../../library/dis.rst:2077 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:2075 +#: ../../library/dis.rst:2079 msgid "All jumps are now relative. Use :data:`hasjump`." msgstr "" -#: ../../library/dis.rst:2081 +#: ../../library/dis.rst:2085 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:2083 +#: ../../library/dis.rst:2087 msgid "All jumps are now relative. This list is empty." msgstr "" -#: ../../library/dis.rst:1682 +#: ../../library/dis.rst:1686 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1682 +#: ../../library/dis.rst:1686 msgid "slice" msgstr "slice(切片)" diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index 3cb7515ac22..715b5f2f9ff 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-11-10 00:16+0000\n" "PO-Revision-Date: 2024-05-06 08:22+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -75,9 +75,8 @@ msgid "" "with the correct arguments." msgstr "" "一旦 mock 被呼叫,它的 :attr:`~Mock.called` 屬性將被設定為 ``True``。更重要的" -"是,我們可以使用 :meth:`~Mock.assert_called_with` " -"或 :meth:`~Mock.assert_called_once_with` 方法來檢查它是否被使用正確的引數來呼" -"叫。" +"是,我們可以使用 :meth:`~Mock.assert_called_with` 或 :meth:`~Mock." +"assert_called_once_with` 方法來檢查它是否被使用正確的引數來呼叫。" #: ../../library/unittest.mock-examples.rst:59 msgid "" @@ -122,12 +121,12 @@ msgstr "" msgid "" "We don't have to do any work to provide the 'close' method on our mock. " "Accessing close creates it. So, if 'close' hasn't already been called then " -"accessing it in the test will create it, " -"but :meth:`~Mock.assert_called_with` will raise a failure exception." +"accessing it in the test will create it, but :meth:`~Mock." +"assert_called_with` will raise a failure exception." msgstr "" "我們不必做任何額外的事情來為 mock 提供 'close' 方法,存取 close 會建立它。因" -"此,如果 'close' 並未被呼叫過,在測試中存取 'close' 就會建立它," -"但 :meth:`~Mock.assert_called_with` 就會引發一個失敗的例外。" +"此,如果 'close' 並未被呼叫過,在測試中存取 'close' 就會建立它,但 :meth:" +"`~Mock.assert_called_with` 就會引發一個失敗的例外。" #: ../../library/unittest.mock-examples.rst:106 msgid "Mocking Classes" @@ -149,8 +148,8 @@ msgid "" "In the example below we have a function ``some_function`` that instantiates " "``Foo`` and calls a method on it. The call to :func:`patch` replaces the " "class ``Foo`` with a mock. The ``Foo`` instance is the result of calling the " -"mock, so it is configured by modifying the " -"mock :attr:`~Mock.return_value`. ::" +"mock, so it is configured by modifying the mock :attr:`~Mock." +"return_value`. ::" msgstr "" "在下面的範例中,我們有一個函式 ``some_function``,它實例化 ``Foo`` 並呼叫它的" "方法。對 :func:`patch` 的呼叫將類別 ``Foo`` 替換為一個 mock。``Foo`` 實例是呼" @@ -198,9 +197,9 @@ msgstr "追蹤所有呼叫" #: ../../library/unittest.mock-examples.rst:146 msgid "" -"Often you want to track more than a single call to a method. " -"The :attr:`~Mock.mock_calls` attribute records all calls to child attributes " -"of the mock - and also to their children." +"Often you want to track more than a single call to a method. The :attr:" +"`~Mock.mock_calls` attribute records all calls to child attributes of the " +"mock - and also to their children." msgstr "" "通常你會想要追蹤對一個方法的多個呼叫。:attr:`~Mock.mock_calls` 屬性記錄對 " "mock 的子屬性以及其子屬性的所有呼叫。" @@ -257,9 +256,9 @@ msgid "" "``mock.connection.cursor().execute(\"SELECT 1\")``. If we wanted this call " "to return a list, then we have to configure the result of the nested call." msgstr "" -"有時你想要 mock 更複雜的情況,例如 " -"``mock.connection.cursor().execute(\"SELECT 1\")``。如果我們希望此呼叫回傳一" -"個串列,那麼我們就必須配置巢狀呼叫的結果。" +"有時你想要 mock 更複雜的情況,例如 ``mock.connection.cursor()." +"execute(\"SELECT 1\")``。如果我們希望此呼叫回傳一個串列,那麼我們就必須配置巢" +"狀呼叫的結果。" #: ../../library/unittest.mock-examples.rst:214 msgid "" @@ -323,10 +322,10 @@ msgstr "Mock 非同步可疊代物件" #: ../../library/unittest.mock-examples.rst:283 msgid "" -"Since Python 3.8, ``AsyncMock`` and ``MagicMock`` have support to " -"mock :ref:`async-iterators` through ``__aiter__``. " -"The :attr:`~Mock.return_value` attribute of ``__aiter__`` can be used to set " -"the return values to be used for iteration." +"Since Python 3.8, ``AsyncMock`` and ``MagicMock`` have support to mock :ref:" +"`async-iterators` through ``__aiter__``. The :attr:`~Mock.return_value` " +"attribute of ``__aiter__`` can be used to set the return values to be used " +"for iteration." msgstr "" "從 Python 3.8 開始,``AsyncMock`` 和 ``MagicMock`` 支援透過 ``__aiter__`` 來 " "mock :ref:`async-iterators`。``__aiter__`` 的 :attr:`~Mock.return_value` 屬性" @@ -338,10 +337,10 @@ msgstr "Mock 非同步情境管理器" #: ../../library/unittest.mock-examples.rst:300 msgid "" -"Since Python 3.8, ``AsyncMock`` and ``MagicMock`` have support to " -"mock :ref:`async-context-managers` through ``__aenter__`` and ``__aexit__``. " -"By default, ``__aenter__`` and ``__aexit__`` are ``AsyncMock`` instances " -"that return an async function." +"Since Python 3.8, ``AsyncMock`` and ``MagicMock`` have support to mock :ref:" +"`async-context-managers` through ``__aenter__`` and ``__aexit__``. By " +"default, ``__aenter__`` and ``__aexit__`` are ``AsyncMock`` instances that " +"return an async function." msgstr "" "從 Python 3.8 開始,``AsyncMock`` 和 ``MagicMock`` 支援透過 ``__aenter__`` " "和 ``__aexit__`` 來 mock :ref:`async-context-managers`。預設情況下," @@ -427,10 +426,9 @@ msgstr "使用 side_effect 回傳各別檔案內容" #: ../../library/unittest.mock-examples.rst:366 msgid "" -":func:`mock_open` is used to patch :func:`open` " -"method. :attr:`~Mock.side_effect` can be used to return a new Mock object " -"per call. This can be used to return different contents per file stored in a " -"dictionary::" +":func:`mock_open` is used to patch :func:`open` method. :attr:`~Mock." +"side_effect` can be used to return a new Mock object per call. This can be " +"used to return different contents per file stored in a dictionary::" msgstr "" ":func:`mock_open` 是用於 patch :func:`open` 方法。:attr:`~Mock.side_effect` " "可以用來在每次呼叫回傳一個新的 mock 物件。這可以用於回傳儲存在字典中的各別檔" @@ -501,19 +499,19 @@ msgstr "" #: ../../library/unittest.mock-examples.rst:404 msgid "" -"mock provides three convenient decorators for " -"this: :func:`patch`, :func:`patch.object` and :func:`patch.dict`. ``patch`` " -"takes a single string, of the form ``package.module.Class.attribute`` to " -"specify the attribute you are patching. It also optionally takes a value " -"that you want the attribute (or class or whatever) to be replaced with. " -"'patch.object' takes an object and the name of the attribute you would like " -"patched, plus optionally the value to patch it with." +"mock provides three convenient decorators for this: :func:`patch`, :func:" +"`patch.object` and :func:`patch.dict`. ``patch`` takes a single string, of " +"the form ``package.module.Class.attribute`` to specify the attribute you are " +"patching. It also optionally takes a value that you want the attribute (or " +"class or whatever) to be replaced with. 'patch.object' takes an object and " +"the name of the attribute you would like patched, plus optionally the value " +"to patch it with." msgstr "" -"mock 為此提供了三個方便的裝飾器::func:`patch`、:func:`patch.object` " -"和 :func:`patch.dict`。``patch`` 接受單一字串,格式為 " -"``package.module.Class.attribute``,用來指定要 patch 的屬性。同時它也可以接受" -"你想要替換的屬性(或類別或其他)的值。``patch.object`` 接受一個物件和你想要 " -"patch 的屬性的名稱,同時也可以接受要 patch 的值。" +"mock 為此提供了三個方便的裝飾器::func:`patch`、:func:`patch.object` 和 :" +"func:`patch.dict`。``patch`` 接受單一字串,格式為 ``package.module.Class." +"attribute``,用來指定要 patch 的屬性。同時它也可以接受你想要替換的屬性(或類" +"別或其他)的值。``patch.object`` 接受一個物件和你想要 patch 的屬性的名稱,同" +"時也可以接受要 patch 的值。" #: ../../library/unittest.mock-examples.rst:412 msgid "``patch.object``::" @@ -553,11 +551,11 @@ msgstr "" #: ../../library/unittest.mock-examples.rst:429 msgid "" -"If you are patching a module (including :mod:`builtins`) then " -"use :func:`patch` instead of :func:`patch.object`:" +"If you are patching a module (including :mod:`builtins`) then use :func:" +"`patch` instead of :func:`patch.object`:" msgstr "" -"如果你要 patch 一個模組(包括 :mod:`builtins`),請使用 :func:`patch` 而" -"非 :func:`patch.object`:" +"如果你要 patch 一個模組(包括 :mod:`builtins`),請使用 :func:`patch` 而非 :" +"func:`patch.object`:" #: ../../library/unittest.mock-examples.rst:439 msgid "" @@ -744,17 +742,16 @@ msgstr "" #: ../../library/unittest.mock-examples.rst:573 msgid "" -"mock_backend.get_endpoint.return_value.create_call.return_value.start_call.return_value " -"= mock_response" +"mock_backend.get_endpoint.return_value.create_call.return_value.start_call." +"return_value = mock_response" msgstr "" -"mock_backend.get_endpoint.return_value.create_call.return_value.start_call.return_value " -"= mock_response" +"mock_backend.get_endpoint.return_value.create_call.return_value.start_call." +"return_value = mock_response" #: ../../library/unittest.mock-examples.rst:575 msgid "" -"We can do that in a slightly nicer way using " -"the :meth:`~Mock.configure_mock` method to directly set the return value for " -"us::" +"We can do that in a slightly nicer way using the :meth:`~Mock." +"configure_mock` method to directly set the return value for us::" msgstr "" "我們可以使用 :meth:`~Mock.configure_mock` 方法來以稍微好一點的方式為我們直接" "設定回傳值: ::" @@ -764,17 +761,15 @@ msgid "" ">>> something = Something()\n" ">>> mock_response = Mock(spec=open)\n" ">>> mock_backend = Mock()\n" -">>> config = " -"{'get_endpoint.return_value.create_call.return_value.start_call.return_value': " -"mock_response}\n" +">>> config = {'get_endpoint.return_value.create_call.return_value.start_call." +"return_value': mock_response}\n" ">>> mock_backend.configure_mock(**config)" msgstr "" ">>> something = Something()\n" ">>> mock_response = Mock(spec=open)\n" ">>> mock_backend = Mock()\n" -">>> config = " -"{'get_endpoint.return_value.create_call.return_value.start_call.return_value': " -"mock_response}\n" +">>> config = {'get_endpoint.return_value.create_call.return_value.start_call." +"return_value': mock_response}\n" ">>> mock_backend.configure_mock(**config)" #: ../../library/unittest.mock-examples.rst:584 @@ -806,13 +801,13 @@ msgstr "" #: ../../library/unittest.mock-examples.rst:595 msgid "" -">>> chained = call.get_endpoint('foobar').create_call('spam', " -"'eggs').start_call()\n" +">>> chained = call.get_endpoint('foobar').create_call('spam', 'eggs')." +"start_call()\n" ">>> call_list = chained.call_list()\n" ">>> assert mock_backend.mock_calls == call_list" msgstr "" -">>> chained = call.get_endpoint('foobar').create_call('spam', " -"'eggs').start_call()\n" +">>> chained = call.get_endpoint('foobar').create_call('spam', 'eggs')." +"start_call()\n" ">>> call_list = chained.call_list()\n" ">>> assert mock_backend.mock_calls == call_list" @@ -821,23 +816,25 @@ msgid "Partial mocking" msgstr "部分 mocking" #: ../../library/unittest.mock-examples.rst:603 +#, fuzzy msgid "" -"In some tests I wanted to mock out a call to :meth:`datetime.date.today` to " -"return a known date, but I didn't want to prevent the code under test from " -"creating new date objects. Unfortunately :class:`datetime.date` is written " -"in C, and so I couldn't just monkey-patch out the " -"static :meth:`datetime.date.today` method." +"For some tests, you may want to mock out a call to :meth:`datetime.date." +"today` to return a known date, but don't want to prevent the code under test " +"from creating new date objects. Unfortunately :class:`datetime.date` is " +"written in C, so you cannot just monkey-patch out the static :meth:`datetime." +"date.today` method." msgstr "" "在某些測試中,我們會想 mock 對 :meth:`datetime.date.today` 的呼叫以回傳一個已" -"知日期,但我不想阻止測試中的程式碼建立新的日期物件。不幸的" -"是 :class:`datetime.date` 是用 C 語言寫的,所以們我不能 monkey patch 靜態" -"的 :meth:`datetime.date.today` 方法。" +"知日期,但我不想阻止測試中的程式碼建立新的日期物件。不幸的是 :class:" +"`datetime.date` 是用 C 語言寫的,所以們我不能 monkey patch 靜態的 :meth:" +"`datetime.date.today` 方法。" #: ../../library/unittest.mock-examples.rst:608 +#, fuzzy msgid "" -"I found a simple way of doing this that involved effectively wrapping the " -"date class with a mock, but passing through calls to the constructor to the " -"real class (and returning real instances)." +"Instead, you can effectively wrap the date class with a mock, while passing " +"through calls to the constructor to the real class (and returning real " +"instances)." msgstr "" "我們找到了一種簡單的方法來做到這一點,其用 mock 有效地包裝日期類別,但將對建" "構函式的呼叫傳遞給真實的類別(並返回真實的實例)。" @@ -907,9 +904,9 @@ msgid "" "is discussed in `this blog entry `_." msgstr "" -"處理 mock 日期或其他內建類別的另一種方法在 `這個 blog `_ 中討論。" +"處理 mock 日期或其他內建類別的另一種方法在 `這個 blog `_ 中" +"討論。" #: ../../library/unittest.mock-examples.rst:643 msgid "Mocking a Generator Method" @@ -927,8 +924,8 @@ msgstr "" msgid "" "A generator method / function is called to return the generator object. It " "is the generator object that is then iterated over. The protocol method for " -"iteration is :meth:`~container.__iter__`, so we can mock this using " -"a :class:`MagicMock`." +"iteration is :meth:`~container.__iter__`, so we can mock this using a :class:" +"`MagicMock`." msgstr "" "產生器方法 / 函式會被呼叫以回傳產生器物件。之後此產生器會進行疊代。疊代的協定" "方法是 :meth:`~container.__iter__`,所以我們可以使用 :class:`MagicMock` 來 " @@ -954,16 +951,16 @@ msgstr "" #: ../../library/unittest.mock-examples.rst:675 msgid "" -"There are also generator expressions and more `advanced uses `_ of generators, but we aren't " -"concerned about them here. A very good introduction to generators and how " -"powerful they are is: `Generator Tricks for Systems Programmers `_." +"There are also generator expressions and more `advanced uses `_ of generators, but we aren't concerned " +"about them here. A very good introduction to generators and how powerful " +"they are is: `Generator Tricks for Systems Programmers `_." msgstr "" "還有關於產生器運算式及產生器的更多 `進階用法 `_ ,但我們在這裡不考慮它們。一個關於產生器及其強大功能" -"的優良說明是:`Generator Tricks for Systems Programmers `_。" +"的優良說明是:`Generator Tricks for Systems Programmers `_。" #: ../../library/unittest.mock-examples.rst:683 msgid "Applying the same patch to every test method" @@ -1060,8 +1057,8 @@ msgstr "" msgid "" "If you use this technique you must ensure that the patching is \"undone\" by " "calling ``stop``. This can be fiddlier than you might think, because if an " -"exception is raised in the setUp then tearDown is not " -"called. :meth:`unittest.TestCase.addCleanup` makes this easier::" +"exception is raised in the setUp then tearDown is not called. :meth:" +"`unittest.TestCase.addCleanup` makes this easier::" msgstr "" "如果你使用這個技巧,你必須確保透過呼叫 ``stop`` 來 \"取消\" patch。這可能會比" "你想像的還要複雜一點,因為如果有例外在 ``setUp`` 中被引發,則 ``tearDown`` 就" @@ -1096,17 +1093,18 @@ msgid "Mocking Unbound Methods" msgstr "Mock Unbound Methods (未繫結方法)" #: ../../library/unittest.mock-examples.rst:746 -msgid "" -"Whilst writing tests today I needed to patch an *unbound method* (patching " -"the method on the class rather than on the instance). I needed self to be " -"passed in as the first argument because I want to make asserts about which " -"objects were calling this particular method. The issue is that you can't " -"patch with a mock for this, because if you replace an unbound method with a " -"mock it doesn't become a bound method when fetched from the instance, and so " -"it doesn't get self passed in. The workaround is to patch the unbound method " -"with a real function instead. The :func:`patch` decorator makes it so simple " -"to patch out methods with a mock that having to create a real function " -"becomes a nuisance." +#, fuzzy +msgid "" +"Sometimes a test needs to patch an *unbound method*, which means patching " +"the method on the class rather than on the instance. In order to make " +"assertions about which objects were calling this particular method, you need " +"to pass ``self`` as the first argument. The issue is that you can't patch " +"with a mock for this, because if you replace an unbound method with a mock " +"it doesn't become a bound method when fetched from the instance, and so it " +"doesn't get ``self`` passed in. The workaround is to patch the unbound " +"method with a real function instead. The :func:`patch` decorator makes it so " +"simple to patch out methods with a mock that having to create a real " +"function becomes a nuisance." msgstr "" "在撰寫測試時,當我們需要 patch 一個\\ *未繫結方法*\\(patch 類別上的方法而不" "是實例上的方法)。我們需要將 self 作為第一個引數傳入,因為我們想斷言哪些物件" @@ -1116,7 +1114,8 @@ msgstr "" "用 mock 來 patch out 方法是如此的簡單,以至於建立一個真正的函式相對變得很麻" "煩。" -#: ../../library/unittest.mock-examples.rst:757 +#: ../../library/unittest.mock-examples.rst:756 +#, fuzzy msgid "" "If you pass ``autospec=True`` to patch then it does the patching with a " "*real* function object. This function object has the same signature as the " @@ -1125,7 +1124,7 @@ msgid "" "though, is that if you use it to patch out an unbound method on a class the " "mocked function will be turned into a bound method if it is fetched from an " "instance. It will have ``self`` passed in as the first argument, which is " -"exactly what I wanted:" +"exactly what was needed:" msgstr "" "如果你將 ``autospec=True`` 傳遞給 patch,那麼它會使用\\ *真的*\\ 函式物件來進" "行 patch。此函式物件與它所替換的函式物件具有相同的簽名,但實際上委託給 mock。" @@ -1133,7 +1132,7 @@ msgstr "" "patch 類別上的未繫結方法,則從實例取得的 mock 函式將轉換為繫結方法。``self`` " "會作為其第一個引數傳入,而這正是我們想要的:" -#: ../../library/unittest.mock-examples.rst:778 +#: ../../library/unittest.mock-examples.rst:777 msgid "" "If we don't use ``autospec=True`` then the unbound method is patched out " "with a Mock instance instead, and isn't called with ``self``." @@ -1141,37 +1140,37 @@ msgstr "" "如果我們不使用 ``autospec=True``,那麼未繫結方法將使用一個 Mock 實例 patch " "out,並且不被使用 ``self`` 進行呼叫。" -#: ../../library/unittest.mock-examples.rst:783 +#: ../../library/unittest.mock-examples.rst:782 msgid "Checking multiple calls with mock" msgstr "使用 mock 檢查多個呼叫" -#: ../../library/unittest.mock-examples.rst:785 +#: ../../library/unittest.mock-examples.rst:784 msgid "" "mock has a nice API for making assertions about how your mock objects are " "used." msgstr "mock 有很好的 API,用於對 mock 物件的使用方式做出斷言。" -#: ../../library/unittest.mock-examples.rst:792 +#: ../../library/unittest.mock-examples.rst:791 msgid "" -"If your mock is only being called once you can use " -"the :meth:`~Mock.assert_called_once_with` method that also asserts that " -"the :attr:`~Mock.call_count` is one." +"If your mock is only being called once you can use the :meth:`~Mock." +"assert_called_once_with` method that also asserts that the :attr:`~Mock." +"call_count` is one." msgstr "" "如果你的 mock 只被呼叫一次,你可以使用 :meth:`~Mock.assert_called_once_with` " "方法,其也斷言 :attr:`~Mock.call_count` 是1。" -#: ../../library/unittest.mock-examples.rst:804 +#: ../../library/unittest.mock-examples.rst:803 msgid "" "Both ``assert_called_with`` and ``assert_called_once_with`` make assertions " "about the *most recent* call. If your mock is going to be called several " -"times, and you want to make assertions about *all* those calls you can " -"use :attr:`~Mock.call_args_list`:" +"times, and you want to make assertions about *all* those calls you can use :" +"attr:`~Mock.call_args_list`:" msgstr "" "``assert_called_with`` 和 ``assert_called_once_with`` 都對\\ *最近一次*\\ 的" "呼叫做出斷言。如果你的 mock 將被多次呼叫,並且你想要對\\ *所有*\\ 這些呼叫進" "行斷言,你可以使用 :attr:`~Mock.call_args_list`:" -#: ../../library/unittest.mock-examples.rst:816 +#: ../../library/unittest.mock-examples.rst:815 msgid "" "The :data:`call` helper makes it easy to make assertions about these calls. " "You can build up a list of expected calls and compare it to " @@ -1182,11 +1181,11 @@ msgstr "" "將其與 ``call_args_list`` 進行比較。這看起來與 ``call_args_list`` 的 repr 非" "常相似:" -#: ../../library/unittest.mock-examples.rst:826 +#: ../../library/unittest.mock-examples.rst:825 msgid "Coping with mutable arguments" msgstr "應對可變引數" -#: ../../library/unittest.mock-examples.rst:828 +#: ../../library/unittest.mock-examples.rst:827 msgid "" "Another situation is rare, but can bite you, is when your mock is called " "with mutable arguments. ``call_args`` and ``call_args_list`` store " @@ -1198,13 +1197,13 @@ msgstr "" "``call_args`` 和 ``call_args_list`` 儲存對引數的\\ *參照*。如果引數被測試中的" "程式碼改變,那麼你將無法再對 mock 被呼叫時的值進行斷言。" -#: ../../library/unittest.mock-examples.rst:833 +#: ../../library/unittest.mock-examples.rst:832 msgid "" "Here's some example code that shows the problem. Imagine the following " "functions defined in 'mymodule'::" msgstr "這是一些秀出問題的程式碼範例。 想像 'mymodule' 中定義以下函式: ::" -#: ../../library/unittest.mock-examples.rst:836 +#: ../../library/unittest.mock-examples.rst:835 msgid "" "def frob(val):\n" " pass\n" @@ -1215,14 +1214,14 @@ msgid "" " val.clear()" msgstr "" -#: ../../library/unittest.mock-examples.rst:844 +#: ../../library/unittest.mock-examples.rst:843 msgid "" "When we try to test that ``grob`` calls ``frob`` with the correct argument " "look what happens::" msgstr "" "當我們嘗試測試 ``grob`` 使用正確的引數呼叫 ``frob`` 時,看看會發生什麼: ::" -#: ../../library/unittest.mock-examples.rst:847 +#: ../../library/unittest.mock-examples.rst:846 msgid "" ">>> with patch('mymodule.frob') as mock_frob:\n" "... val = {6}\n" @@ -1248,7 +1247,7 @@ msgstr "" "AssertionError: Expected: (({6},), {})\n" "Called with: ((set(),), {})" -#: ../../library/unittest.mock-examples.rst:859 +#: ../../library/unittest.mock-examples.rst:858 msgid "" "One possibility would be for mock to copy the arguments you pass in. This " "could then cause problems if you do assertions that rely on object identity " @@ -1257,7 +1256,7 @@ msgstr "" "一種可能是讓 mock 複製你傳入的引數。如果你進行的斷言依賴於物件識別性來確定相" "等性,這就可能導致問題。" -#: ../../library/unittest.mock-examples.rst:863 +#: ../../library/unittest.mock-examples.rst:862 msgid "" "Here's one solution that uses the :attr:`~Mock.side_effect` functionality. " "If you provide a ``side_effect`` function for a mock then ``side_effect`` " @@ -1273,7 +1272,7 @@ msgstr "" "* mock 來儲存引數,以便我們可以使用 mock 方法來執行斷言。同樣的,有一個輔助函" "式為我們設定了這些。: ::" -#: ../../library/unittest.mock-examples.rst:871 +#: ../../library/unittest.mock-examples.rst:870 msgid "" ">>> from copy import deepcopy\n" ">>> from unittest.mock import Mock, patch, DEFAULT\n" @@ -1317,7 +1316,7 @@ msgstr "" ">>> new_mock.call_args\n" "call({6})" -#: ../../library/unittest.mock-examples.rst:892 +#: ../../library/unittest.mock-examples.rst:891 msgid "" "``copy_call_args`` is called with the mock that will be called. It returns a " "new mock that we do the assertion on. The ``side_effect`` function makes a " @@ -1327,7 +1326,7 @@ msgstr "" "言的新的 mock。``side_effect`` 函式建立引數們的副本,並用該副本呼叫我們的 " "``new_mock``。" -#: ../../library/unittest.mock-examples.rst:898 +#: ../../library/unittest.mock-examples.rst:897 msgid "" "If your mock is only going to be used once there is an easier way of " "checking arguments at the point they are called. You can simply do the " @@ -1336,16 +1335,16 @@ msgstr "" "如果你的 mock 只會被使用一次,則有一種更簡單的方法可以在呼叫引數時檢查它們。" "你可以簡單地在 ``side_effect`` 函式內進行檢查。" -#: ../../library/unittest.mock-examples.rst:912 +#: ../../library/unittest.mock-examples.rst:911 msgid "" -"An alternative approach is to create a subclass of :class:`Mock` " -"or :class:`MagicMock` that copies (using :func:`copy.deepcopy`) the " -"arguments. Here's an example implementation:" +"An alternative approach is to create a subclass of :class:`Mock` or :class:" +"`MagicMock` that copies (using :func:`copy.deepcopy`) the arguments. Here's " +"an example implementation:" msgstr "" -"另一種方法是建立 :class:`Mock` 或 :class:`MagicMock` 的子類別來複製(使" -"用 :func:`copy.deepcopy`\\ )引數。這是一個實作的例子:" +"另一種方法是建立 :class:`Mock` 或 :class:`MagicMock` 的子類別來複製(使用 :" +"func:`copy.deepcopy`\\ )引數。這是一個實作的例子:" -#: ../../library/unittest.mock-examples.rst:937 +#: ../../library/unittest.mock-examples.rst:936 msgid "" "When you subclass ``Mock`` or ``MagicMock`` all dynamically created " "attributes, and the ``return_value`` will use your subclass automatically. " @@ -1356,11 +1355,11 @@ msgstr "" "``return_value`` 會自動使用你的子類別。這代表著 ``CopyingMock`` 的所有子代 " "(child) 也會具有 ``CopyingMock`` 型別。" -#: ../../library/unittest.mock-examples.rst:943 +#: ../../library/unittest.mock-examples.rst:942 msgid "Nesting Patches" msgstr "巢狀使用 Patch" -#: ../../library/unittest.mock-examples.rst:945 +#: ../../library/unittest.mock-examples.rst:944 msgid "" "Using patch as a context manager is nice, but if you do multiple patches you " "can end up with nested with statements indenting further and further to the " @@ -1369,7 +1368,7 @@ msgstr "" "將 patch 作為情境管理器使用很好,但是如果你使用複數個 patch,你最終可能會得到" "巢狀的 with 陳述式,並且越來越向右縮排: ::" -#: ../../library/unittest.mock-examples.rst:949 +#: ../../library/unittest.mock-examples.rst:948 msgid "" ">>> class MyTest(unittest.TestCase):\n" "...\n" @@ -1399,7 +1398,7 @@ msgstr "" ">>> MyTest('test_foo').test_foo()\n" ">>> assert mymodule.Foo is original" -#: ../../library/unittest.mock-examples.rst:963 +#: ../../library/unittest.mock-examples.rst:962 msgid "" "With unittest ``cleanup`` functions and the :ref:`start-and-stop` we can " "achieve the same effect without the nested indentation. A simple helper " @@ -1410,7 +1409,7 @@ msgstr "" "同的效果,而不會出現因巢狀導致的縮排。一個簡單的輔助方法 ``create_patch`` 會" "將 patch 放置到位並為我們回傳被建立的 mock: ::" -#: ../../library/unittest.mock-examples.rst:968 +#: ../../library/unittest.mock-examples.rst:967 msgid "" ">>> class MyTest(unittest.TestCase):\n" "...\n" @@ -1454,11 +1453,11 @@ msgstr "" ">>> MyTest('test_foo').run()\n" ">>> assert mymodule.Foo is original" -#: ../../library/unittest.mock-examples.rst:991 +#: ../../library/unittest.mock-examples.rst:990 msgid "Mocking a dictionary with MagicMock" msgstr "使用 MagicMock 來 mock 字典" -#: ../../library/unittest.mock-examples.rst:993 +#: ../../library/unittest.mock-examples.rst:992 msgid "" "You may want to mock a dictionary, or other container object, recording all " "access to it whilst having it still behave like a dictionary." @@ -1466,37 +1465,36 @@ msgstr "" "你可能會想要 mock 字典或其他容器物件,記錄對它的所有存取,同時讓它仍然像字典" "一樣運作。" -#: ../../library/unittest.mock-examples.rst:996 +#: ../../library/unittest.mock-examples.rst:995 msgid "" "We can do this with :class:`MagicMock`, which will behave like a dictionary, " "and using :data:`~Mock.side_effect` to delegate dictionary access to a real " "underlying dictionary that is under our control." msgstr "" -"我們可以使用 :class:`MagicMock` 來做到這一點,它的行為會與字典一致,並使" -"用 :data:`~Mock.side_effect` 將字典存取委託給我們控制下的真實底層字典。" +"我們可以使用 :class:`MagicMock` 來做到這一點,它的行為會與字典一致,並使用 :" +"data:`~Mock.side_effect` 將字典存取委託給我們控制下的真實底層字典。" -#: ../../library/unittest.mock-examples.rst:1000 +#: ../../library/unittest.mock-examples.rst:999 msgid "" "When the :meth:`~object.__getitem__` and :meth:`~object.__setitem__` methods " "of our ``MagicMock`` are called (normal dictionary access) then " "``side_effect`` is called with the key (and in the case of ``__setitem__`` " "the value too). We can also control what is returned." msgstr "" -"當 ``MagicMock`` 的 :meth:`~object.__getitem__` " -"和 :meth:`~object.__setitem__` 方法被呼叫時(一般的字典存取), " -"``side_effect`` 會被使用鍵 (key) 來呼叫 (在 ``__setitem__`` 的情況也會使用" -"值 (value))。我們也可以控制回傳的內容。" +"當 ``MagicMock`` 的 :meth:`~object.__getitem__` 和 :meth:`~object." +"__setitem__` 方法被呼叫時(一般的字典存取), ``side_effect`` 會被使用鍵 " +"(key) 來呼叫 (在 ``__setitem__`` 的情況也會使用值 (value))。我們也可以控制" +"回傳的內容。" -#: ../../library/unittest.mock-examples.rst:1005 +#: ../../library/unittest.mock-examples.rst:1004 msgid "" -"After the ``MagicMock`` has been used we can use attributes " -"like :data:`~Mock.call_args_list` to assert about how the dictionary was " -"used:" +"After the ``MagicMock`` has been used we can use attributes like :data:" +"`~Mock.call_args_list` to assert about how the dictionary was used:" msgstr "" "使用 ``MagicMock`` 後,我們可以使用諸如 :data:`~Mock.call_args_list` 之類的屬" "性來斷言字典被使用的方式:" -#: ../../library/unittest.mock-examples.rst:1021 +#: ../../library/unittest.mock-examples.rst:1020 msgid "" "An alternative to using ``MagicMock`` is to use ``Mock`` and *only* provide " "the magic methods you specifically want:" @@ -1504,7 +1502,7 @@ msgstr "" "不使用 ``MagicMock`` 的替代方案是使用 ``Mock`` 並且\\ *只*\\ 提供你特別想要的" "魔術方法:" -#: ../../library/unittest.mock-examples.rst:1028 +#: ../../library/unittest.mock-examples.rst:1027 msgid "" "A *third* option is to use ``MagicMock`` but passing in ``dict`` as the " "*spec* (or *spec_set*) argument so that the ``MagicMock`` created only has " @@ -1513,7 +1511,7 @@ msgstr "" "*第三個*\\ 選擇是使用 ``MagicMock``,但傳入 ``dict`` 作為 *spec* (或 " "*spec_set*\\ )引數,以使被建立的 ``MagicMock`` 僅具有字典可用的魔術方法:" -#: ../../library/unittest.mock-examples.rst:1036 +#: ../../library/unittest.mock-examples.rst:1035 msgid "" "With these side effect functions in place, the ``mock`` will behave like a " "normal dictionary but recording the access. It even raises a :exc:`KeyError` " @@ -1522,17 +1520,17 @@ msgstr "" "有了這些 side effect 函式,``mock`` 會像一般的字典一樣運作,但會記錄存取。如" "果你嘗試存取不存在的鍵,它甚至會引發一個 :exc:`KeyError`。" -#: ../../library/unittest.mock-examples.rst:1055 +#: ../../library/unittest.mock-examples.rst:1054 msgid "" "After it has been used you can make assertions about the access using the " "normal mock methods and attributes:" msgstr "在上述方式被使用後,你就可以使用普通的 mock 方法和屬性對存取進行斷言:" -#: ../../library/unittest.mock-examples.rst:1067 +#: ../../library/unittest.mock-examples.rst:1066 msgid "Mock subclasses and their attributes" msgstr "Mock 子類別及其屬性" -#: ../../library/unittest.mock-examples.rst:1069 +#: ../../library/unittest.mock-examples.rst:1068 msgid "" "There are various reasons why you might want to subclass :class:`Mock`. One " "reason might be to add helper methods. Here's a silly example:" @@ -1540,7 +1538,7 @@ msgstr "" "你會想子類別化 :class:`Mock` 的原因可能有很多種。其中之一是增加輔助方法。以下" "是一個有點笨的例子:" -#: ../../library/unittest.mock-examples.rst:1085 +#: ../../library/unittest.mock-examples.rst:1084 msgid "" "The standard behaviour for ``Mock`` instances is that attributes and the " "return value mocks are of the same type as the mock they are accessed on. " @@ -1554,20 +1552,19 @@ msgstr "" "``MagicMocks`` [#]_。因此,如果你要子類別化以新增輔助方法,那麼它們也可用於子" "類別實例的屬性 mock 和回傳值 mock。" -#: ../../library/unittest.mock-examples.rst:1101 +#: ../../library/unittest.mock-examples.rst:1100 msgid "" -"Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created " -"a `Twisted adaptor `_. Having this applied to attributes too " -"actually causes errors." +"Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted " +"adaptor `_. Having this applied to attributes too actually causes errors." msgstr "" "有時候這很不方便。例如,`有一個使用者 `_\\ 正在子類別化 mock 以建立 `Twisted adaptor `_。將其應用" "於屬性實際上會導致錯誤。" -#: ../../library/unittest.mock-examples.rst:1107 +#: ../../library/unittest.mock-examples.rst:1106 msgid "" "``Mock`` (in all its flavours) uses a method called ``_get_child_mock`` to " "create these \"sub-mocks\" for attributes and return values. You can prevent " @@ -1579,7 +1576,7 @@ msgstr "" "建立這些 \"子 mock\"。你可以透過置換此方法來防止你的子類別被用為屬性。其簽名" "是取用任意的關鍵字引數(``**kwargs``\\ ),然後將其傳遞給 mock 建構函式:" -#: ../../library/unittest.mock-examples.rst:1124 +#: ../../library/unittest.mock-examples.rst:1123 msgid "" "An exception to this rule are the non-callable mocks. Attributes use the " "callable variant because otherwise non-callable mocks couldn't have callable " @@ -1588,11 +1585,11 @@ msgstr "" "此規則的例外是非可呼叫物件的 mock。屬性使用可呼叫物件的變體,否則非可呼叫物件" "的 mock 無法具有可呼叫的方法。" -#: ../../library/unittest.mock-examples.rst:1130 +#: ../../library/unittest.mock-examples.rst:1129 msgid "Mocking imports with patch.dict" msgstr "使用 patch.dict 來 mock import" -#: ../../library/unittest.mock-examples.rst:1132 +#: ../../library/unittest.mock-examples.rst:1131 msgid "" "One situation where mocking can be hard is where you have a local import " "inside a function. These are harder to mock because they aren't using an " @@ -1601,7 +1598,7 @@ msgstr "" "可能會讓 mock 很困難的一種情況是在函式內部進行區域 import。這些狀況會更難進" "行 mock,因為它們沒有使用我們可以 patch out 的模組命名空間中的物件。" -#: ../../library/unittest.mock-examples.rst:1136 +#: ../../library/unittest.mock-examples.rst:1135 msgid "" "Generally local imports are to be avoided. They are sometimes done to " "prevent circular dependencies, for which there is *usually* a much better " @@ -1616,7 +1613,7 @@ msgstr "" "件的區域 import 更好的方式來解決(例如將模組儲存為類別或模組屬性,並且僅在第" "一次使用時進行 import)。" -#: ../../library/unittest.mock-examples.rst:1143 +#: ../../library/unittest.mock-examples.rst:1142 msgid "" "That aside there is a way to use ``mock`` to affect the results of an " "import. Importing fetches an *object* from the :data:`sys.modules` " @@ -1625,13 +1622,12 @@ msgid "" "in ``sys.modules``, so usually when you import something you get a module " "back. This need not be the case however." msgstr "" -"除此之外,還有一種方法可以使用 ``mock`` 來影響 import 的結果。Import 會" -"從 :data:`sys.modules` 字典中取得一個\\ *物件*。請注意,它會取得一個\\ *物件" -"*,而該物件不需要是一個模組。初次 import 模組會導致模組物件被放入 " -"``sys.modules`` 中,因此通常當你 import 某些東西時,你會得到一個模組。但並非" -"一定要如此。" +"除此之外,還有一種方法可以使用 ``mock`` 來影響 import 的結果。Import 會從 :" +"data:`sys.modules` 字典中取得一個\\ *物件*。請注意,它會取得一個\\ *物件*,而" +"該物件不需要是一個模組。初次 import 模組會導致模組物件被放入 ``sys.modules`` " +"中,因此通常當你 import 某些東西時,你會得到一個模組。但並非一定要如此。" -#: ../../library/unittest.mock-examples.rst:1150 +#: ../../library/unittest.mock-examples.rst:1149 msgid "" "This means you can use :func:`patch.dict` to *temporarily* put a mock in " "place in :data:`sys.modules`. Any imports whilst this patch is active will " @@ -1644,11 +1640,11 @@ msgstr "" "成時(被裝飾的函式結束、with 陳述式主體完成或 ``patcher.stop()`` 被呼叫),那" "麼之前在 ``sys.modules`` 中的任何內容都會被安全地復原。" -#: ../../library/unittest.mock-examples.rst:1156 +#: ../../library/unittest.mock-examples.rst:1155 msgid "Here's an example that mocks out the 'fooble' module." msgstr "下面是一個 mock out 'fooble' 模組的例子。" -#: ../../library/unittest.mock-examples.rst:1168 +#: ../../library/unittest.mock-examples.rst:1167 msgid "" "As you can see the ``import fooble`` succeeds, but on exit there is no " "'fooble' left in :data:`sys.modules`." @@ -1656,19 +1652,19 @@ msgstr "" "如你所見,``import fooble`` 成功了,但在離開之後,:data:`sys.modules` 中就沒" "有 'fooble' 了。" -#: ../../library/unittest.mock-examples.rst:1171 +#: ../../library/unittest.mock-examples.rst:1170 msgid "This also works for the ``from module import name`` form:" msgstr "這也適用於 ``from module import name`` 形式:" -#: ../../library/unittest.mock-examples.rst:1181 +#: ../../library/unittest.mock-examples.rst:1180 msgid "With slightly more work you can also mock package imports:" msgstr "透過稍微多一點的處理,你也可以 mock 套件的引入:" -#: ../../library/unittest.mock-examples.rst:1194 +#: ../../library/unittest.mock-examples.rst:1193 msgid "Tracking order of calls and less verbose call assertions" msgstr "追蹤呼叫順序與更簡潔的呼叫斷言" -#: ../../library/unittest.mock-examples.rst:1196 +#: ../../library/unittest.mock-examples.rst:1195 msgid "" "The :class:`Mock` class allows you to track the *order* of method calls on " "your mock objects through the :attr:`~Mock.method_calls` attribute. This " @@ -1679,7 +1675,7 @@ msgstr "" "上方法呼叫的\\ *順序*。這不會讓你可以追蹤不同的 mock 物件之間的呼叫順序,然而" "我們可以使用 :attr:`~Mock.mock_calls` 來達到相同的效果。" -#: ../../library/unittest.mock-examples.rst:1201 +#: ../../library/unittest.mock-examples.rst:1200 msgid "" "Because mocks track calls to child mocks in ``mock_calls``, and accessing an " "arbitrary attribute of a mock creates a child mock, we can create our " @@ -1690,7 +1686,7 @@ msgstr "" "會建立一個子 mock,所以我們可以從父 mock 建立不同的 mock。之後對這些子 mock " "的呼叫將依序全部記錄在父 mock 的 ``mock_calls`` 中:" -#: ../../library/unittest.mock-examples.rst:1218 +#: ../../library/unittest.mock-examples.rst:1217 msgid "" "We can then assert about the calls, including the order, by comparing with " "the ``mock_calls`` attribute on the manager mock:" @@ -1698,17 +1694,17 @@ msgstr "" "之後我們可以透過與管理器 (manager) mock 上的 ``mock_calls`` 屬性進行比較來斷" "言呼叫及其順序:" -#: ../../library/unittest.mock-examples.rst:1225 +#: ../../library/unittest.mock-examples.rst:1224 msgid "" "If ``patch`` is creating, and putting in place, your mocks then you can " "attach them to a manager mock using the :meth:`~Mock.attach_mock` method. " "After attaching calls will be recorded in ``mock_calls`` of the manager. ::" msgstr "" -"如果 ``patch`` 正在被建立並放置為你的 mock,那麼你可以使" -"用 :meth:`~Mock.attach_mock` 方法將它們附加到管理器 mock。附加之後,呼叫將被" -"記錄在管理器的 ``mock_calls`` 中。: ::" +"如果 ``patch`` 正在被建立並放置為你的 mock,那麼你可以使用 :meth:`~Mock." +"attach_mock` 方法將它們附加到管理器 mock。附加之後,呼叫將被記錄在管理器的 " +"``mock_calls`` 中。: ::" -#: ../../library/unittest.mock-examples.rst:1229 +#: ../../library/unittest.mock-examples.rst:1228 msgid "" ">>> manager = MagicMock()\n" ">>> with patch('mymodule.Class1') as MockClass1:\n" @@ -1740,20 +1736,19 @@ msgstr "" "call.MockClass2(),\n" "call.MockClass2().bar()]" -#: ../../library/unittest.mock-examples.rst:1244 +#: ../../library/unittest.mock-examples.rst:1243 msgid "" "If many calls have been made, but you're only interested in a particular " -"sequence of them then an alternative is to use " -"the :meth:`~Mock.assert_has_calls` method. This takes a list of calls " -"(constructed with the :data:`call` object). If that sequence of calls are " -"in :attr:`~Mock.mock_calls` then the assert succeeds." +"sequence of them then an alternative is to use the :meth:`~Mock." +"assert_has_calls` method. This takes a list of calls (constructed with the :" +"data:`call` object). If that sequence of calls are in :attr:`~Mock." +"mock_calls` then the assert succeeds." msgstr "" -"如果進行了多次呼叫,但你只對其中特定呼叫的序列感興趣,則可以使" -"用 :meth:`~Mock.assert_has_calls` 方法。這需要一個呼叫串列(使" -"用 :data:`call` 物件建構)。如果該呼叫序列位於 :attr:`~Mock.mock_calls` 中," -"則斷言成功。" +"如果進行了多次呼叫,但你只對其中特定呼叫的序列感興趣,則可以使用 :meth:" +"`~Mock.assert_has_calls` 方法。這需要一個呼叫串列(使用 :data:`call` 物件建" +"構)。如果該呼叫序列位於 :attr:`~Mock.mock_calls` 中,則斷言成功。" -#: ../../library/unittest.mock-examples.rst:1258 +#: ../../library/unittest.mock-examples.rst:1257 msgid "" "Even though the chained call ``m.one().two().three()`` aren't the only calls " "that have been made to the mock, the assert still succeeds." @@ -1761,7 +1756,7 @@ msgstr "" "儘管鍊接呼叫 ``m.one().two().three()`` 並不是對 mock 進行的唯一呼叫,斷言仍會" "成功。" -#: ../../library/unittest.mock-examples.rst:1261 +#: ../../library/unittest.mock-examples.rst:1260 msgid "" "Sometimes a mock may have several calls made to it, and you are only " "interested in asserting about *some* of those calls. You may not even care " @@ -1772,11 +1767,11 @@ msgstr "" "你甚至可能不關心順序。在這種情況下,你可以將 ``any_order=True`` 傳遞給 " "``assert_has_calls``:" -#: ../../library/unittest.mock-examples.rst:1273 +#: ../../library/unittest.mock-examples.rst:1272 msgid "More complex argument matching" msgstr "更複雜的引數匹配" -#: ../../library/unittest.mock-examples.rst:1275 +#: ../../library/unittest.mock-examples.rst:1274 msgid "" "Using the same basic concept as :data:`ANY` we can implement matchers to do " "more complex assertions on objects used as arguments to mocks." @@ -1784,7 +1779,7 @@ msgstr "" "使用與 :data:`ANY` 相同的基本概念,我們可以實作匹配器 (matcher),對用來作為 " "mock 引數的物件進行更複雜的斷言。" -#: ../../library/unittest.mock-examples.rst:1278 +#: ../../library/unittest.mock-examples.rst:1277 msgid "" "Suppose we expect some object to be passed to a mock that by default " "compares equal based on object identity (which is the Python default for " @@ -1794,33 +1789,33 @@ msgid "" "attributes for us." msgstr "" "假設我們預期某個物件會被傳進 mock,預設情況下,該 mock 會根據物件識別性進行相" -"等比較(對使用者定義類別的 Python 預設行為)。要使" -"用 :meth:`~Mock.assert_called_with`,我們需要傳入完全相同的物件。如果我們只對" -"該物件的某些屬性感興趣,那麼我們可以建立一個匹配器來為我們檢查這些屬性。" +"等比較(對使用者定義類別的 Python 預設行為)。要使用 :meth:`~Mock." +"assert_called_with`,我們需要傳入完全相同的物件。如果我們只對該物件的某些屬性" +"感興趣,那麼我們可以建立一個匹配器來為我們檢查這些屬性。" -#: ../../library/unittest.mock-examples.rst:1285 +#: ../../library/unittest.mock-examples.rst:1284 msgid "" "You can see in this example how a 'standard' call to ``assert_called_with`` " "isn't sufficient:" msgstr "" "你可以在這個範例中看到對 ``assert_called_with`` 的一個「標準」呼叫是不夠的:" -#: ../../library/unittest.mock-examples.rst:1301 +#: ../../library/unittest.mock-examples.rst:1300 msgid "" "A comparison function for our ``Foo`` class might look something like this:" msgstr "對我們的 ``Foo`` 類別的比較函式看起來可能會像這樣:" -#: ../../library/unittest.mock-examples.rst:1313 +#: ../../library/unittest.mock-examples.rst:1312 msgid "" "And a matcher object that can use comparison functions like this for its " "equality operation would look something like this:" msgstr "而可以使用像這樣的比較函式進行其相等性運算的匹配器物件會長得像這樣:" -#: ../../library/unittest.mock-examples.rst:1324 +#: ../../library/unittest.mock-examples.rst:1323 msgid "Putting all this together:" msgstr "把這些都放在一起:" -#: ../../library/unittest.mock-examples.rst:1329 +#: ../../library/unittest.mock-examples.rst:1328 msgid "" "The ``Matcher`` is instantiated with our compare function and the ``Foo`` " "object we want to compare against. In ``assert_called_with`` the ``Matcher`` " @@ -1832,28 +1827,27 @@ msgstr "" "``Matcher`` 是用我們想要比較的 ``Foo`` 物件和比較函式實例化的。在 " "``assert_called_with`` 中,``Matcher`` 相等方法將被呼叫,它將呼叫 mock 時傳入" "的物件與我們建立匹配器時傳入的物件進行比較。如果它們匹配,則 " -"``assert_called_with`` 會通過,如果它們不匹配,則會引" -"發 :exc:`AssertionError`:" +"``assert_called_with`` 會通過,如果它們不匹配,則會引發 :exc:" +"`AssertionError`:" -#: ../../library/unittest.mock-examples.rst:1342 +#: ../../library/unittest.mock-examples.rst:1341 msgid "" -"With a bit of tweaking you could have the comparison function raise " -"the :exc:`AssertionError` directly and provide a more useful failure message." +"With a bit of tweaking you could have the comparison function raise the :exc:" +"`AssertionError` directly and provide a more useful failure message." msgstr "" "透過一些調整,你可以讓比較函式直接引發 :exc:`AssertionError` 並提供更有用的失" "敗訊息。" -#: ../../library/unittest.mock-examples.rst:1345 +#: ../../library/unittest.mock-examples.rst:1344 msgid "" "As of version 1.5, the Python testing library `PyHamcrest `_ provides similar functionality, that may be " -"useful here, in the form of its equality matcher " -"(`hamcrest.library.integration.match_equality `_)." -msgstr "" -"從版本 1.5 開始,Python 測試函式庫 `PyHamcrest `_ 以其相等匹配器的形式,提供了類似的功能,在這裡" -"可能是有用的 (\\ `hamcrest.library.integration.match_equality `_\\ )。" +"useful here, in the form of its equality matcher (`hamcrest.library." +"integration.match_equality `_)." +msgstr "" +"從版本 1.5 開始,Python 測試函式庫 `PyHamcrest `_ 以其相等匹配器的形式,提供了類似的功能,在這裡可能是有用" +"的 (\\ `hamcrest.library.integration.match_equality `_\\ )。" From 8e2dba3728f63c8355d0ddfb5aaa257a64847e71 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 10 Nov 2025 02:54:13 +0000 Subject: [PATCH 5/9] sync with cpython b5ae8082 --- c-api/conversion.po | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/c-api/conversion.po b/c-api/conversion.po index 0bf7140fa97..858dfa01723 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-03 00:16+0000\n" +"POT-Creation-Date: 2025-11-10 02:52+0000\n" "PO-Revision-Date: 2023-12-11 18:26+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -101,8 +101,8 @@ msgid "" "``'\\0'`` in this case too, but the rest of *str* is undefined. The exact " "cause of the error depends on the underlying platform." msgstr "" -"當 ``rv < 0`` 時,代表輸出的轉換失敗,且在這種情況下 ``str[size-1]`` " -"也是 ``'\\0'``,但 *str* 的其餘部分未定義。錯誤的確切原因取決於底層平台。" +"當 ``rv < 0`` 時,代表輸出的轉換失敗,且在這種情況下 ``str[size-1]`` 也是 " +"``'\\0'``,但 *str* 的其餘部分未定義。錯誤的確切原因取決於底層平台。" #: ../../c-api/conversion.rst:49 msgid "" @@ -232,35 +232,39 @@ msgstr "" "``'r'`` 格式碼指定標準 :func:`repr` 格式。" #: ../../c-api/conversion.rst:131 -msgid "" -"*flags* can be zero or more of the values ``Py_DTSF_SIGN``, " -"``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:" +#, fuzzy +msgid "*flags* can be zero or more of the following values or-ed together:" msgstr "" "*flags* 可以是零個或多個值 ``Py_DTSF_SIGN``、``Py_DTSF_ADD_DOT_0`` 或 " "``Py_DTSF_ALT``,會被聯集在一起:" -#: ../../c-api/conversion.rst:134 +#: ../../c-api/conversion.rst:135 +#, fuzzy msgid "" -"``Py_DTSF_SIGN`` means to always precede the returned string with a sign " -"character, even if *val* is non-negative." +"Always precede the returned string with a sign character, even if *val* is " +"non-negative." msgstr "" "``Py_DTSF_SIGN`` 代表總是在回傳的字串前面加上符號字元,即使 *val* 非負數。" -#: ../../c-api/conversion.rst:137 -msgid "" -"``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look " -"like an integer." +#: ../../c-api/conversion.rst:140 +#, fuzzy +msgid "Ensure that the returned string will not look like an integer." msgstr "``Py_DTSF_ADD_DOT_0`` 代表確保回傳的字串看起來不會像整數。" -#: ../../c-api/conversion.rst:140 +#: ../../c-api/conversion.rst:144 +#, fuzzy msgid "" -"``Py_DTSF_ALT`` means to apply \"alternate\" formatting rules. See the " -"documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details." +"Apply \"alternate\" formatting rules. See the documentation for the :c:func:" +"`PyOS_snprintf` ``'#'`` specifier for details." msgstr "" "``Py_DTSF_ALT`` 代表要套用「備用的 (alternate)」格式化規則。有關詳細資訊,請" "參閱 :c:func:`PyOS_snprintf` ``'#'`` 的文件。" -#: ../../c-api/conversion.rst:144 +#: ../../c-api/conversion.rst:150 +msgid "Negative zero is converted to positive zero." +msgstr "" + +#: ../../c-api/conversion.rst:154 msgid "" "If *ptype* is non-``NULL``, then the value it points to will be set to one " "of ``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying " @@ -271,7 +275,7 @@ msgstr "" "``Py_DTST_INFINITE`` 或 ``Py_DTST_NAN`` 其中之一,分別代表 *val* 是有限數、無" "限數或非數。" -#: ../../c-api/conversion.rst:148 +#: ../../c-api/conversion.rst:158 msgid "" "The return value is a pointer to *buffer* with the converted string or " "``NULL`` if the conversion failed. The caller is responsible for freeing the " @@ -280,7 +284,7 @@ msgstr "" "回傳值是指向 *buffer* 的指標,其中包含轉換後的字串,如果轉換失敗則回傳 " "``NULL``。呼叫者負責透過呼叫 :c:func:`PyMem_Free` 來釋放回傳的字串。" -#: ../../c-api/conversion.rst:157 +#: ../../c-api/conversion.rst:167 msgid "" "Case insensitive comparison of strings. The function works almost " "identically to :c:func:`!strcmp` except that it ignores the case." @@ -288,7 +292,7 @@ msgstr "" "不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strcmp` 相同,只是它忽" "略大小寫。" -#: ../../c-api/conversion.rst:163 +#: ../../c-api/conversion.rst:173 msgid "" "Case insensitive comparison of strings. The function works almost " "identically to :c:func:`!strncmp` except that it ignores the case." From c2ceae30e3257070b4090953f1fcabfe6e6c8040 Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Mon, 10 Nov 2025 11:37:16 +0800 Subject: [PATCH 6/9] fix: resolve fuzzy entries --- c-api/allocation.po | 27 ++--- c-api/buffer.po | 14 +-- c-api/concrete.po | 2 +- c-api/conversion.po | 29 +++--- c-api/curses.po | 50 +++++++--- c-api/descriptor.po | 2 +- c-api/exceptions.po | 4 +- c-api/function.po | 6 +- c-api/hash.po | 24 ++--- c-api/intro.po | 91 ++++++++++++++--- c-api/type.po | 2 +- c-api/veryhigh.po | 12 +-- howto/logging-cookbook.po | 202 ++++++++++++++++++++++++++++++++++++++ howto/logging.po | 23 +++++ howto/regex.po | 2 +- howto/remote_debugging.po | 2 +- library/asyncio-dev.po | 9 ++ library/atexit.po | 5 + library/compileall.po | 11 +++ library/csv.po | 4 + library/datetime.po | 2 +- library/devmode.po | 20 ++++ library/lzma.po | 4 + library/os.po | 8 ++ library/sys.po | 5 +- library/time.po | 7 +- library/xmlrpc.client.po | 14 +++ whatsnew/2.3.po | 19 ++++ whatsnew/2.4.po | 4 + whatsnew/3.14.po | 16 ++- 30 files changed, 517 insertions(+), 103 deletions(-) diff --git a/c-api/allocation.po b/c-api/allocation.po index cd511b78abf..616ca9afcfc 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -215,7 +215,7 @@ msgstr "分配記憶體和建立擴充模組。" #: ../../c-api/allocation.rst:157 msgid "Deprecated aliases" -msgstr "" +msgstr "被棄用的別名" #: ../../c-api/allocation.rst:159 msgid "" @@ -225,41 +225,32 @@ msgstr "" #: ../../c-api/allocation.rst:167 msgid "Deprecated alias" -msgstr "" +msgstr "已棄用的別名" #: ../../c-api/allocation.rst:168 msgid "Function" -msgstr "" +msgstr "函式" #: ../../c-api/allocation.rst:170 -#, fuzzy msgid ":c:macro:`PyObject_New`" -msgstr ":c:macro:`PyObject_GC_New`" +msgstr ":c:macro:`PyObject_New`" #: ../../c-api/allocation.rst:172 -#, fuzzy msgid ":c:macro:`PyObject_NewVar`" -msgstr ":c:macro:`PyObject_GC_NewVar`" +msgstr ":c:macro:`PyObject_NewVar`" #: ../../c-api/allocation.rst:174 -#, fuzzy msgid ":c:func:`PyObject_Init`" -msgstr ":c:func:`PyObject_Free`" +msgstr ":c:func:`PyObject_Init`" #: ../../c-api/allocation.rst:176 -#, fuzzy msgid ":c:func:`PyObject_InitVar`" -msgstr ":c:func:`PyObject_Free`" +msgstr ":c:func:`PyObject_InitVar`" #: ../../c-api/allocation.rst:178 -#, fuzzy msgid ":c:func:`PyObject_Malloc`" -msgstr ":c:func:`PyObject_Free`" +msgstr ":c:func:`PyObject_Malloc`" #: ../../c-api/allocation.rst:180 -#, fuzzy msgid ":c:func:`PyObject_Realloc`" -msgstr ":c:func:`PyObject_Free`" - -#~ msgid "Same as :c:func:`PyObject_Free`." -#~ msgstr "和 :c:func:`PyObject_Free` 相同。" +msgstr ":c:func:`PyObject_Realloc`" diff --git a/c-api/buffer.po b/c-api/buffer.po index c53ee22c8ef..4bf453e92e2 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -87,7 +87,7 @@ msgstr "" #: ../../c-api/buffer.rst:58 msgid "call :c:func:`PyObject_GetBuffer` with the right parameters;" -msgstr "" +msgstr "以適當的參數呼叫 :c:func:`PyObject_GetBuffer`;" #: ../../c-api/buffer.rst:60 msgid "" @@ -110,7 +110,7 @@ msgstr "" #: ../../c-api/buffer.rst:75 msgid "Buffer structure" -msgstr "" +msgstr "緩衝區結構" #: ../../c-api/buffer.rst:77 msgid "" @@ -228,7 +228,7 @@ msgstr "" #: ../../c-api/buffer.rst:162 msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag." -msgstr "" +msgstr "此欄位受 :c:macro:`PyBUF_FORMAT` 旗標控制。" #: ../../c-api/buffer.rst:166 msgid "" @@ -363,7 +363,7 @@ msgstr "" #: ../../c-api/buffer.rst:266 msgid "This is a :term:`soft deprecated` alias to :c:macro:`PyBUF_WRITABLE`." -msgstr "" +msgstr "這是 :c:macro:`PyBUF_WRITABLE` 的\\ :term:`軟性棄用 `\\ 別名。" #: ../../c-api/buffer.rst:270 msgid "" @@ -522,7 +522,7 @@ msgstr "" #: ../../c-api/buffer.rst:366 msgid "NumPy-style: shape and strides" -msgstr "" +msgstr "NumPy 風格:形狀與步幅" #: ../../c-api/buffer.rst:368 msgid "" @@ -644,7 +644,7 @@ msgstr "" #: ../../c-api/buffer.rst:449 msgid "Buffer-related functions" -msgstr "" +msgstr "與緩衝相關的函式" #: ../../c-api/buffer.rst:453 msgid "" @@ -726,7 +726,7 @@ msgstr "" #: ../../c-api/buffer.rst:521 msgid "This function fails if *len* != *src->len*." -msgstr "" +msgstr "此函式在 *len* != *src->len* 時失敗。" #: ../../c-api/buffer.rst:526 msgid "" diff --git a/c-api/concrete.po b/c-api/concrete.po index 72c16ef7695..2f3d0f3feb5 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -88,7 +88,7 @@ msgstr "其他物件" #: ../../c-api/concrete.rst:122 msgid "C API for extension modules" -msgstr "" +msgstr "擴充模組的 C API" #: ../../c-api/concrete.rst:43 ../../c-api/concrete.rst:58 #: ../../c-api/concrete.rst:80 diff --git a/c-api/conversion.po b/c-api/conversion.po index 858dfa01723..1ff9a85adfe 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -116,6 +116,8 @@ msgid "" "long` value according to the given ``base``, which must be between ``2`` and " "``36`` inclusive, or be the special value ``0``." msgstr "" +"將字串 ``str`` 的初始部分根據給定的 ``base`` 轉換為 :c:expr:`unsigned long` 值," +"底 (base) 必須介於 ``2`` 到 ``36``\\ (包含)之間,或為特殊值 ``0``。" #: ../../c-api/conversion.rst:57 msgid "" @@ -125,6 +127,9 @@ msgid "" "(inclusive). If ``ptr`` is non-``NULL`` it will contain a pointer to the " "end of the scan." msgstr "" +"忽略前導空白和字元大小寫。如果 ``base`` 為零,則會尋找前導的 ``0b``、" +"``0o`` 或 ``0x`` 來判斷使用哪個進位。如果這些前綴不存在,則預設為 ``10``。" +"底必須為 0 或介於 2 到 36(包含)之間。如果 ``ptr`` 為非 ``NULL``,它將包含指向掃描結束處的指標。" #: ../../c-api/conversion.rst:63 msgid "" @@ -133,6 +138,8 @@ msgid "" "macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0`` is " "returned." msgstr "" +"如果轉換後的值超出對應回傳型別的範圍,則會發生範圍錯誤(:c:data:`errno` " +"會被設定為 :c:macro:`!ERANGE`)並回傳 :c:macro:`!ULONG_MAX`。如果無法執行任何轉換,則回傳 ``0``。" #: ../../c-api/conversion.rst:68 msgid "See also the Unix man page :manpage:`strtoul(3)`." @@ -144,12 +151,15 @@ msgid "" "according to the given ``base``, which must be between ``2`` and ``36`` " "inclusive, or be the special value ``0``." msgstr "" +"將字串 ``str`` 的初始部分根據給定的 ``base`` 轉換為 :c:expr:`long` 值,底 " +"必須介於 ``2`` 到 ``36``(包含)之間,或為特殊值 ``0``。" #: ../../c-api/conversion.rst:79 msgid "" "Same as :c:func:`PyOS_strtoul`, but return a :c:expr:`long` value instead " "and :c:macro:`LONG_MAX` on overflows." msgstr "" +"與 :c:func:`PyOS_strtoul` 相同,但回傳 :c:expr:`long` 值,並在溢位時回傳 :c:macro:`LONG_MAX`。" #: ../../c-api/conversion.rst:82 msgid "See also the Unix man page :manpage:`strtol(3)`." @@ -232,37 +242,28 @@ msgstr "" "``'r'`` 格式碼指定標準 :func:`repr` 格式。" #: ../../c-api/conversion.rst:131 -#, fuzzy msgid "*flags* can be zero or more of the following values or-ed together:" -msgstr "" -"*flags* 可以是零個或多個值 ``Py_DTSF_SIGN``、``Py_DTSF_ADD_DOT_0`` 或 " -"``Py_DTSF_ALT``,會被聯集在一起:" +msgstr "*flags* 可以是零個或多個以下的值被聯集在一起:" #: ../../c-api/conversion.rst:135 -#, fuzzy msgid "" "Always precede the returned string with a sign character, even if *val* is " "non-negative." -msgstr "" -"``Py_DTSF_SIGN`` 代表總是在回傳的字串前面加上符號字元,即使 *val* 非負數。" +msgstr "總是在回傳的字串前面加上正負號字元 (sign character),即使 *val* 非負數。" #: ../../c-api/conversion.rst:140 -#, fuzzy msgid "Ensure that the returned string will not look like an integer." -msgstr "``Py_DTSF_ADD_DOT_0`` 代表確保回傳的字串看起來不會像整數。" +msgstr "確保回傳的字串看起來不會像整數。" #: ../../c-api/conversion.rst:144 -#, fuzzy msgid "" "Apply \"alternate\" formatting rules. See the documentation for the :c:func:" "`PyOS_snprintf` ``'#'`` specifier for details." -msgstr "" -"``Py_DTSF_ALT`` 代表要套用「備用的 (alternate)」格式化規則。有關詳細資訊,請" -"參閱 :c:func:`PyOS_snprintf` ``'#'`` 的文件。" +msgstr "套用「備用的 (alternate)」格式化規則。有關詳細資訊,請參閱 :c:func:`PyOS_snprintf` ``'#'`` 的文件。" #: ../../c-api/conversion.rst:150 msgid "Negative zero is converted to positive zero." -msgstr "" +msgstr "負零會被轉換為正零。" #: ../../c-api/conversion.rst:154 msgid "" diff --git a/c-api/curses.po b/c-api/curses.po index e7b2bb26530..f6f79465f3f 100644 --- a/c-api/curses.po +++ b/c-api/curses.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001 Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -19,7 +18,7 @@ msgstr "" #: ../../c-api/curses.rst:4 msgid "Curses C API" -msgstr "" +msgstr "Curses C API" #: ../../c-api/curses.rst:6 msgid "" @@ -29,6 +28,10 @@ msgid "" "usually as part of the module initialisation function, to populate :c:var:" "`PyCurses_API`." msgstr "" +":mod:`curses` 為擴充模組公開了一個小型的 C 介面。使用者必須包含標頭檔 " +":file:`py_curses.h`\\ (此檔案不會由 :file:`Python.h` 預設包含),並且必須觸發 " +":c:func:`import_curses` 以填充 (populate) :c:var:`PyCurses_API`,通常是作為" +"模組初始化函式的一部分。" #: ../../c-api/curses.rst:14 msgid "" @@ -39,7 +42,7 @@ msgstr "" #: ../../c-api/curses.rst:19 msgid "" "Import the curses C API. The macro does not need a semi-colon to be called." -msgstr "" +msgstr "引入 curses C API。呼叫此巨集不需要寫分號。" #: ../../c-api/curses.rst:21 msgid "On success, populate the :c:var:`PyCurses_API` pointer." @@ -56,6 +59,8 @@ msgid "" "import_curses(); // semi-colon is optional but recommended\n" "if (PyErr_Occurred()) { /* cleanup */ }" msgstr "" +"import_curses(); // 建議要寫分號但非必要\n" +"if (PyErr_Occurred()) { /* 清理 */ }" #: ../../c-api/curses.rst:34 msgid "" @@ -72,6 +77,8 @@ msgid "" "``PyCurses_API[1]``, ``PyCurses_API[2]``, and ``PyCurses_API[3]`` are " "pointers to predicate functions of type ``int (*)(void)``." msgstr "" +"``PyCurses_API[1]``、``PyCurses_API[2]`` 和 ``PyCurses_API[3]`` 是指向 " +"型別為 ``int (*)(void)`` 的謂詞函式 (predicate functions) 的指標。" #: ../../c-api/curses.rst:42 msgid "" @@ -107,7 +114,7 @@ msgstr "" #: ../../c-api/curses.rst:69 msgid "" "Return true if *op* is a :class:`curses.window` instance, false otherwise." -msgstr "" +msgstr "如果 *op* 是 :class:`curses.window` 實例則回傳 true,否則回傳 false。" #: ../../c-api/curses.rst:72 msgid "" @@ -118,12 +125,12 @@ msgstr "" #: ../../c-api/curses.rst:78 msgid "Macro checking if :func:`curses.setupterm` has been called." -msgstr "" +msgstr "如果已呼叫 :func:`curses.setupterm`,則為巨集檢查。" #: ../../c-api/curses.rst:80 ../../c-api/curses.rst:97 #: ../../c-api/curses.rst:114 msgid "The macro expansion is roughly equivalent to:" -msgstr "" +msgstr "巨集展開大致相當於:" #: ../../c-api/curses.rst:82 msgid "" @@ -135,10 +142,17 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_setupterm_called = (predicate_t)PyCurses_API[1];\n" +" if (!was_setupterm_called()) {\n" +" return NULL;\n" +" }\n" +"}" #: ../../c-api/curses.rst:95 msgid "Macro checking if :func:`curses.initscr` has been called." -msgstr "" +msgstr "如果已呼叫 :func:`curses.initscr`,則為巨集檢查。" #: ../../c-api/curses.rst:99 msgid "" @@ -150,10 +164,17 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_initscr_called = (predicate_t)PyCurses_API[2];\n" +" if (!was_initscr_called()) {\n" +" return NULL;\n" +" }\n" +"}" #: ../../c-api/curses.rst:112 msgid "Macro checking if :func:`curses.start_color` has been called." -msgstr "" +msgstr "如果已呼叫 :func:`curses.start_color`,則為巨集檢查。" #: ../../c-api/curses.rst:116 msgid "" @@ -165,16 +186,23 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_start_color_called = (predicate_t)PyCurses_API[3];\n" +" if (!was_start_color_called()) {\n" +" return NULL;\n" +" }\n" +"}" #: ../../c-api/curses.rst:128 msgid "Internal data" -msgstr "" +msgstr "內部資料" #: ../../c-api/curses.rst:130 msgid "" "The following objects are exposed by the C API but should be considered " "internal-only." -msgstr "" +msgstr "以下物件由 C API 所公開,但應視為僅供內部使用。" #: ../../c-api/curses.rst:135 msgid "Name of the curses capsule to pass to :c:func:`PyCapsule_Import`." @@ -182,4 +210,4 @@ msgstr "" #: ../../c-api/curses.rst:137 msgid "Internal usage only. Use :c:macro:`import_curses` instead." -msgstr "" +msgstr "僅供內部使用。請改用 :c:macro:`import_curses`。" diff --git a/c-api/descriptor.po b/c-api/descriptor.po index 6f2795117b5..aac05cf760c 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -48,7 +48,7 @@ msgstr "" #: ../../c-api/descriptor.rst:44 msgid "Built-in descriptors" -msgstr "" +msgstr "內建描述器" #: ../../c-api/descriptor.rst:48 msgid "" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 744d8b49c21..926a9587715 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -157,7 +157,7 @@ msgstr "" #: ../../c-api/exceptions.rst:123 msgid "Raising exceptions" -msgstr "" +msgstr "引發例外" #: ../../c-api/exceptions.rst:125 msgid "" @@ -367,7 +367,7 @@ msgstr "" #: ../../c-api/exceptions.rst:352 msgid "Issuing warnings" -msgstr "" +msgstr "發出警告" #: ../../c-api/exceptions.rst:354 msgid "" diff --git a/c-api/function.po b/c-api/function.po index a5f9f3a67fb..61b434d12ad 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -150,19 +150,17 @@ msgstr "" "``NULL``。" #: ../../c-api/function.rst:107 -#, fuzzy msgid "" "Set the keyword-only argument default values of the function object *op*. " "*defaults* must be a dictionary of keyword-only arguments or ``Py_None``." msgstr "" -"回傳函式物件 *op* 的僅限關鍵字引數預設值,這可以是一個含有多個引數的字典或 " -"``NULL``。" +"設定函式物件 *op* 的僅限關鍵字引數預設值。*defaults* 必須是僅限關鍵字引數的字典或 ``Py_None``。" #: ../../c-api/function.rst:110 msgid "" "This function returns ``0`` on success, and returns ``-1`` with an exception " "set on failure." -msgstr "" +msgstr "此函式在成功時回傳 ``0``,在失敗時回傳 ``-1`` 且設定一個例外。" #: ../../c-api/function.rst:116 msgid "" diff --git a/c-api/hash.po b/c-api/hash.po index 020fd33cf32..7ec708bf846 100644 --- a/c-api/hash.po +++ b/c-api/hash.po @@ -42,7 +42,7 @@ msgstr "" #: ../../c-api/hash.rst:27 msgid "The algorithm name is exposed by :data:`sys.hash_info.algorithm`." -msgstr "" +msgstr "演算式名稱由 :data:`sys.hash_info.algorithm` 公開。" #: ../../c-api/hash.rst:36 msgid "" @@ -53,11 +53,11 @@ msgstr "" #: ../../c-api/hash.rst:40 msgid "Add :c:macro:`!Py_HASH_FNV` and :c:macro:`!Py_HASH_SIPHASH24`." -msgstr "" +msgstr "新增 :c:macro:`!Py_HASH_FNV` 和 :c:macro:`!Py_HASH_SIPHASH24`。" #: ../../c-api/hash.rst:43 msgid "Add :c:macro:`!Py_HASH_SIPHASH13`." -msgstr "" +msgstr "新增 :c:macro:`!Py_HASH_SIPHASH13`。" #: ../../c-api/hash.rst:49 msgid "" @@ -67,12 +67,12 @@ msgstr "" #: ../../c-api/hash.rst:52 msgid "A :c:macro:`!Py_HASH_CUTOFF` of 0 disables the optimization." -msgstr "" +msgstr "將 :c:macro:`!Py_HASH_CUTOFF` 設為 0 可停用此最佳化。" #: ../../c-api/hash.rst:53 msgid "" ":c:macro:`!Py_HASH_CUTOFF` must be non-negative and less or equal than 7." -msgstr "" +msgstr ":c:macro:`!Py_HASH_CUTOFF` 必須為非負且小於或等於 7。" #: ../../c-api/hash.rst:55 msgid "" @@ -83,7 +83,7 @@ msgstr "" #: ../../c-api/hash.rst:59 msgid "This corresponds to the :data:`sys.hash_info.cutoff` constant." -msgstr "" +msgstr "這對應到 :data:`sys.hash_info.cutoff` 常數。" #: ../../c-api/hash.rst:66 msgid "" @@ -95,7 +95,7 @@ msgstr "" #: ../../c-api/hash.rst:69 msgid "This corresponds to the :data:`sys.hash_info.modulus` constant." -msgstr "" +msgstr "這對應到 :data:`sys.hash_info.modulus` 常數。" #: ../../c-api/hash.rst:76 msgid "The exponent ``n`` of ``P`` in :c:macro:`PyHASH_MODULUS`." @@ -111,7 +111,7 @@ msgstr "正無窮大回傳的雜湊值。" #: ../../c-api/hash.rst:92 msgid "This corresponds to the :data:`sys.hash_info.inf` constant." -msgstr "" +msgstr "這對應到 :data:`sys.hash_info.inf` 常數。" #: ../../c-api/hash.rst:99 msgid "The multiplier used for the imaginary part of a complex number." @@ -119,7 +119,7 @@ msgstr "用於複數虛數部分的乘數。" #: ../../c-api/hash.rst:101 msgid "This corresponds to the :data:`sys.hash_info.imag` constant." -msgstr "" +msgstr "這對應到 :data:`sys.hash_info.imag` 常數。" #: ../../c-api/hash.rst:108 msgid "Hash function definition used by :c:func:`PyHash_GetFuncDef`." @@ -135,7 +135,7 @@ msgstr "雜湊函式名稱(UTF-8 編碼字串)。" #: ../../c-api/hash.rst:118 msgid "This corresponds to the :data:`sys.hash_info.algorithm` constant." -msgstr "" +msgstr "這對應到 :data:`sys.hash_info.algorithm` 常數。" #: ../../c-api/hash.rst:122 msgid "Internal size of the hash value in bits." @@ -143,7 +143,7 @@ msgstr "雜湊值的內部大小(以位元為單位)。" #: ../../c-api/hash.rst:124 msgid "This corresponds to the :data:`sys.hash_info.hash_bits` constant." -msgstr "" +msgstr "這對應到 :data:`sys.hash_info.hash_bits` 常數。" #: ../../c-api/hash.rst:128 msgid "Size of seed input in bits." @@ -151,7 +151,7 @@ msgstr "Seed 輸入的大小(以位元為單位)。" #: ../../c-api/hash.rst:130 msgid "This corresponds to the :data:`sys.hash_info.seed_bits` constant." -msgstr "" +msgstr "這對應到 :data:`sys.hash_info.seed_bits` 常數。" #: ../../c-api/hash.rst:137 msgid "Get the hash function definition." diff --git a/c-api/intro.po b/c-api/intro.po index cae67c2de94..6d334c74e30 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -395,13 +395,12 @@ msgstr "" #: ../../c-api/intro.rst:241 ../../c-api/intro.rst:252 #: ../../c-api/intro.rst:297 -#, fuzzy msgid "For example::" msgstr "範例: ::" #: ../../c-api/intro.rst:243 msgid "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" -msgstr "" +msgstr "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" #: ../../c-api/intro.rst:249 msgid "" @@ -415,14 +414,15 @@ msgid "" "#define foo_to_char(foo) \\\n" " ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" msgstr "" +"#define foo_to_char(foo) \\\n" +" ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" #: ../../c-api/intro.rst:261 -#, fuzzy msgid "" "Creates a variable with name *name* that can be used in docstrings. If " "Python is built without docstrings, the value will be empty." msgstr "" -"建立一個名為 ``name`` 的變數,可以在文件字串中使用。如果 Python 是在沒有文件" +"建立一個名為 *name* 的變數,可以在文件字串中使用。如果 Python 是在沒有文件" "字串的情況下建置,則該值將為空。" #: ../../c-api/intro.rst:264 @@ -443,6 +443,13 @@ msgid "" " // ...\n" "}" msgstr "" +"PyDoc_STRVAR(pop_doc, \"Remove and return the rightmost element.\");\n" +"\n" +"static PyMethodDef deque_methods[] = {\n" +" // ...\n" +" {\"pop\", (PyCFunction)deque_pop, METH_NOARGS, pop_doc},\n" +" // ...\n" +"}" #: ../../c-api/intro.rst:279 msgid "" @@ -466,6 +473,11 @@ msgid "" " {NULL, NULL}\n" "};" msgstr "" +"static PyMethodDef pysqlite_row_methods[] = {\n" +" {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" +" PyDoc_STR(\"Returns the keys of the row.\")},\n" +" {NULL, NULL}\n" +"};" #: ../../c-api/intro.rst:295 msgid "Declares a static character array variable with the given name *name*." @@ -478,6 +490,10 @@ msgid "" " \"to the tropics and subtropics of the " "Eastern Hemisphere.\");" msgstr "" +"PyDoc_VAR(python_doc) = PyDoc_STR(\"A genus of constricting snakes in the " +"Pythonidae family native \"\n" +" \"to the tropics and subtropics of the " +"Eastern Hemisphere.\");" #: ../../c-api/intro.rst:306 msgid "Objects, Types and Reference Counts" @@ -890,6 +906,27 @@ msgid "" " return total;\n" "}" msgstr "" +"long\n" +"sum_list(PyObject *list)\n" +"{\n" +" Py_ssize_t i, n;\n" +" long total = 0, value;\n" +" PyObject *item;\n" +"\n" +" n = PyList_Size(list);\n" +" if (n < 0)\n" +" return -1; /* 不是 list */\n" +" for (i = 0; i < n; i++) {\n" +" item = PyList_GetItem(list, i); /* 不會失敗 */\n" +" if (!PyLong_Check(item)) continue; /* 跳過非整數 */\n" +" value = PyLong_AsLong(item);\n" +" if (value == -1 && PyErr_Occurred())\n" +" /* 整數太大,無法放入 C long,退出 */\n" +" return -1;\n" +" total += value;\n" +" }\n" +" return total;\n" +"}" #: ../../c-api/intro.rst:547 msgid "" @@ -921,6 +958,33 @@ msgid "" " return total;\n" "}" msgstr "" +"long\n" +"sum_sequence(PyObject *sequence)\n" +"{\n" +" Py_ssize_t i, n;\n" +" long total = 0, value;\n" +" PyObject *item;\n" +" n = PySequence_Length(sequence);\n" +" if (n < 0)\n" +" return -1; /* 沒有長度 */\n" +" for (i = 0; i < n; i++) {\n" +" item = PySequence_GetItem(sequence, i);\n" +" if (item == NULL)\n" +" return -1; /* 不是序列或其他錯誤 */\n" +" if (PyLong_Check(item)) {\n" +" value = PyLong_AsLong(item);\n" +" Py_DECREF(item);\n" +" if (value == -1 && PyErr_Occurred())\n" +" /* 整數太大,無法放入 C long,退出 */\n" +" return -1;\n" +" total += value;\n" +" }\n" +" else {\n" +" Py_DECREF(item); /* 丟棄參照所有權 */\n" +" }\n" +" }\n" +" return total;\n" +"}" #: ../../c-api/intro.rst:581 msgid "Types" @@ -1345,45 +1409,46 @@ msgstr "" #: ../../c-api/intro.rst:862 msgid "Recommended third party tools" -msgstr "" +msgstr "建議的第三方工具" #: ../../c-api/intro.rst:864 msgid "" "The following third party tools offer both simpler and more sophisticated " "approaches to creating C, C++ and Rust extensions for Python:" msgstr "" +"以下第三方工具提供了更簡單且更細緻的方法來為 Python 建立 C、C++ 和 Rust 擴充模組:" #: ../../c-api/intro.rst:867 msgid "`Cython `_" -msgstr "" +msgstr "`Cython `_" #: ../../c-api/intro.rst:868 msgid "`cffi `_" -msgstr "" +msgstr "`cffi `_" #: ../../c-api/intro.rst:869 msgid "`HPy `_" -msgstr "" +msgstr "`HPy `_" #: ../../c-api/intro.rst:870 msgid "`nanobind `_ (C++)" -msgstr "" +msgstr "`nanobind `_ (C++)" #: ../../c-api/intro.rst:871 msgid "`Numba `_" -msgstr "" +msgstr "`Numba `_" #: ../../c-api/intro.rst:872 msgid "`pybind11 `_ (C++)" -msgstr "" +msgstr "`pybind11 `_ (C++)" #: ../../c-api/intro.rst:873 msgid "`PyO3 `_ (Rust)" -msgstr "" +msgstr "`PyO3 `_ (Rust)" #: ../../c-api/intro.rst:874 msgid "`SWIG `_" -msgstr "" +msgstr "`SWIG `_" #: ../../c-api/intro.rst:876 msgid "" diff --git a/c-api/type.po b/c-api/type.po index d83b5ad7cfc..d0ee103697a 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -726,7 +726,7 @@ msgstr "" #: ../../c-api/type.rst:601 msgid "``Py_tp_doc``" -msgstr "" +msgstr "``Py_tp_doc``" #: ../../c-api/type.rst:602 msgid "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 472dd865778..21e6f522d7e 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -352,7 +352,7 @@ msgstr "" #: ../../c-api/veryhigh.rst:313 msgid "Compiler flags." -msgstr "" +msgstr "編譯器旗標。" #: ../../c-api/veryhigh.rst:317 msgid "" @@ -372,7 +372,7 @@ msgstr "新增 *cf_feature_version* 欄位。" #: ../../c-api/veryhigh.rst:326 msgid "The available compiler flags are accessible as macros:" -msgstr "" +msgstr "可用的編譯器旗標可透過巨集存取:" #: ../../c-api/veryhigh.rst:335 msgid "" @@ -390,7 +390,7 @@ msgstr "" #: ../../c-api/veryhigh.rst:348 msgid "Available start symbols" -msgstr "" +msgstr "可用的起始符號" #: ../../c-api/veryhigh.rst:355 msgid "" @@ -421,15 +421,15 @@ msgstr "" #: ../../c-api/veryhigh.rst:385 msgid "This requires the :c:macro:`PyCF_ONLY_AST` flag to be set." -msgstr "" +msgstr "這需要設定 :c:macro:`PyCF_ONLY_AST` 旗標。" #: ../../c-api/veryhigh.rst:388 msgid ":py:class:`ast.FunctionType`" -msgstr "" +msgstr ":py:class:`ast.FunctionType`" #: ../../c-api/veryhigh.rst:389 msgid ":pep:`484`" -msgstr "" +msgstr ":pep:`484`" #: ../../c-api/veryhigh.rst:353 ../../c-api/veryhigh.rst:361 #: ../../c-api/veryhigh.rst:370 ../../c-api/veryhigh.rst:379 diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index a29aa388d37..e0640a56fc3 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -4327,6 +4327,11 @@ msgid "" "class UTCFormatter(logging.Formatter):\n" " converter = time.gmtime" msgstr "" +"import logging\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime" #: ../../howto/logging-cookbook.rst:3272 msgid "" @@ -4376,6 +4381,43 @@ msgid "" " logging.config.dictConfig(LOGGING)\n" " logging.warning('The local time is %s', time.asctime())" msgstr "" +"import logging\n" +"import logging.config\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'utc': {\n" +" '()': UTCFormatter,\n" +" 'format': '%(asctime)s %(message)s',\n" +" },\n" +" 'local': {\n" +" 'format': '%(asctime)s %(message)s',\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console1': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'utc',\n" +" },\n" +" 'console2': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'local',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console1', 'console2'],\n" +" }\n" +"}\n" +"\n" +"if __name__ == '__main__':\n" +" logging.config.dictConfig(LOGGING)\n" +" logging.warning('The local time is %s', time.asctime())" #: ../../howto/logging-cookbook.rst:3315 msgid "When this script is run, it should print something like:" @@ -4472,6 +4514,22 @@ msgid "" " logger.info('6. This should appear just once on stderr.')\n" " logger.debug('7. This should not appear.')" msgstr "" +"if __name__ == '__main__':\n" +" logger = logging.getLogger('foo')\n" +" logger.addHandler(logging.StreamHandler())\n" +" logger.setLevel(logging.INFO)\n" +" logger.info('1. This should appear just once on stderr.')\n" +" logger.debug('2. This should not appear.')\n" +" with LoggingContext(logger, level=logging.DEBUG):\n" +" logger.debug('3. This should appear once on stderr.')\n" +" logger.debug('4. This should not appear.')\n" +" h = logging.StreamHandler(sys.stdout)\n" +" with LoggingContext(logger, level=logging.DEBUG, handler=h, " +"close=True):\n" +" logger.debug('5. This should appear twice - once on stderr and once " +"on stdout.')\n" +" logger.info('6. This should appear just once on stderr.')\n" +" logger.debug('7. This should not appear.')" #: ../../howto/logging-cookbook.rst:3388 msgid "" @@ -4499,6 +4557,12 @@ msgid "" "5. This should appear twice - once on stderr and once on stdout.\n" "6. This should appear just once on stderr." msgstr "" +"$ python logctx.py\n" +"1. This should appear just once on stderr.\n" +"3. This should appear once on stderr.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"6. This should appear just once on stderr." #: ../../howto/logging-cookbook.rst:3409 msgid "" @@ -4524,6 +4588,11 @@ msgid "" "5. This should appear twice - once on stderr and once on stdout.\n" "6. This should appear just once on stderr." msgstr "" +"$ python logctx.py >/dev/null\n" +"1. This should appear just once on stderr.\n" +"3. This should appear once on stderr.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"6. This should appear just once on stderr." #: ../../howto/logging-cookbook.rst:3427 msgid "" @@ -4636,6 +4705,15 @@ msgid "" " # actually do the command processing here ...\n" " logger.info('Started the \\'%s\\' service.', options.name)" msgstr "" +"# start.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" logger.debug('About to start %s', options.name)\n" +" # 在這裡實際執行命令處理 ...\n" +" logger.info('Started the \\'%s\\' service.', options.name)" #: ../../howto/logging-cookbook.rst:3508 msgid "and thus for stopping::" @@ -4662,6 +4740,24 @@ msgid "" " # actually do the command processing here ...\n" " logger.info('Stopped the %s service%s.', services, plural)" msgstr "" +"# stop.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" n = len(options.names)\n" +" if n == 1:\n" +" plural = ''\n" +" services = '\\'%s\\'' % options.names[0]\n" +" else:\n" +" plural = 's'\n" +" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" +" i = services.rfind(', ')\n" +" services = services[:i] + ' and ' + services[i + 2:]\n" +" logger.debug('About to stop %s', services)\n" +" # 在這裡實際執行命令處理 ...\n" +" logger.info('Stopped the %s service%s.', services, plural)" #: ../../howto/logging-cookbook.rst:3529 msgid "and similarly for restarting::" @@ -4688,6 +4784,24 @@ msgid "" " # actually do the command processing here ...\n" " logger.info('Restarted the %s service%s.', services, plural)" msgstr "" +"# restart.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" n = len(options.names)\n" +" if n == 1:\n" +" plural = ''\n" +" services = '\\'%s\\'' % options.names[0]\n" +" else:\n" +" plural = 's'\n" +" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" +" i = services.rfind(', ')\n" +" services = services[:i] + ' and ' + services[i + 2:]\n" +" logger.debug('About to restart %s', services)\n" +" # 在這裡實際執行命令處理 ...\n" +" logger.info('Restarted the %s service%s.', services, plural)" #: ../../howto/logging-cookbook.rst:3550 msgid "" @@ -4706,6 +4820,14 @@ msgid "" "$ python app.py restart foo bar baz\n" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" +"$ python app.py start foo\n" +"INFO start Started the 'foo' service.\n" +"\n" +"$ python app.py stop foo bar\n" +"INFO stop Stopped the 'foo' and 'bar' services.\n" +"\n" +"$ python app.py restart foo bar baz\n" +"INFO restart Restarted the 'foo', 'bar' and 'baz' services." #: ../../howto/logging-cookbook.rst:3563 msgid "" @@ -4733,6 +4855,17 @@ msgid "" "DEBUG restart About to restart 'foo', 'bar' and 'baz'\n" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" +"$ python app.py --log-level DEBUG start foo\n" +"DEBUG start About to start foo\n" +"INFO start Started the 'foo' service.\n" +"\n" +"$ python app.py --log-level DEBUG stop foo bar\n" +"DEBUG stop About to stop 'foo' and 'bar'\n" +"INFO stop Stopped the 'foo' and 'bar' services.\n" +"\n" +"$ python app.py --log-level DEBUG restart foo bar baz\n" +"DEBUG restart About to restart 'foo', 'bar' and 'baz'\n" +"INFO restart Restarted the 'foo', 'bar' and 'baz' services." #: ../../howto/logging-cookbook.rst:3583 msgid "And if we want less:" @@ -4744,6 +4877,9 @@ msgid "" "$ python app.py --log-level WARNING stop foo bar\n" "$ python app.py --log-level WARNING restart foo bar baz" msgstr "" +"$ python app.py --log-level WARNING start foo\n" +"$ python app.py --log-level WARNING stop foo bar\n" +"$ python app.py --log-level WARNING restart foo bar baz" #: ../../howto/logging-cookbook.rst:3591 msgid "" @@ -5279,6 +5415,8 @@ msgid "" "sys.stderr = LoggerWriter(logger, logging.WARNING)\n" "1 / 0" msgstr "" +"sys.stderr = LoggerWriter(logger, logging.WARNING)\n" +"1 / 0" #: ../../howto/logging-cookbook.rst:4026 msgid "then running the script results in" @@ -5302,6 +5440,21 @@ msgid "" "WARNING:demo::\n" "WARNING:demo:division by zero" msgstr "" +"WARNING:demo:Traceback (most recent call last):\n" +"\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 53, " +"in \n" +"\n" +"WARNING:demo:\n" +"WARNING:demo:main()\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 49, " +"in main\n" +"\n" +"WARNING:demo:\n" +"WARNING:demo:1 / 0\n" +"WARNING:demo:ZeroDivisionError\n" +"WARNING:demo::\n" +"WARNING:demo:division by zero" #: ../../howto/logging-cookbook.rst:4044 msgid "" @@ -5434,6 +5587,24 @@ msgid "" " logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled " "again')" msgstr "" +"import logging\n" +"\n" +"from mymixins import MultilineMixin\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"class StreamHandler(MultilineMixin, logging.StreamHandler):\n" +" pass\n" +"\n" +"if __name__ == '__main__':\n" +" logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %" +"(levelname)-9s %(message)s',\n" +" handlers = [StreamHandler()])\n" +" logger.debug('Single line')\n" +" logger.debug('Multiple lines:\\nfool me once ...')\n" +" logger.debug('Another single line')\n" +" logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled " +"again')" #: ../../howto/logging-cookbook.rst:4131 msgid "The script, when run, prints something like:" @@ -5449,6 +5620,13 @@ msgid "" "2025-07-02 13:54:47,234 DEBUG fool me ...\n" "2025-07-02 13:54:47,234 DEBUG can't get fooled again" msgstr "" +"2025-07-02 13:54:47,234 DEBUG Single line\n" +"2025-07-02 13:54:47,234 DEBUG Multiple lines:\n" +"2025-07-02 13:54:47,234 DEBUG fool me once ...\n" +"2025-07-02 13:54:47,234 DEBUG Another single line\n" +"2025-07-02 13:54:47,234 DEBUG Multiple lines:\n" +"2025-07-02 13:54:47,234 DEBUG fool me ...\n" +"2025-07-02 13:54:47,234 DEBUG can't get fooled again" #: ../../howto/logging-cookbook.rst:4143 msgid "" @@ -5479,6 +5657,25 @@ msgid "" " logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled " "again')" msgstr "" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"class EscapingFormatter(logging.Formatter):\n" +" def format(self, record):\n" +" s = super().format(record)\n" +" return s.replace('\\n', r'\\n')\n" +"\n" +"if __name__ == '__main__':\n" +" h = logging.StreamHandler()\n" +" h.setFormatter(EscapingFormatter('%(asctime)s %(levelname)-9s %" +"(message)s'))\n" +" logging.basicConfig(level=logging.DEBUG, handlers = [h])\n" +" logger.debug('Single line')\n" +" logger.debug('Multiple lines:\\nfool me once ...')\n" +" logger.debug('Another single line')\n" +" logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled " +"again')" #: ../../howto/logging-cookbook.rst:4167 msgid "" @@ -5494,6 +5691,11 @@ msgid "" "2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me ...\\ncan't get " "fooled again" msgstr "" +"2025-07-09 06:47:33,783 DEBUG Single line\n" +"2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me once ...\n" +"2025-07-09 06:47:33,783 DEBUG Another single line\n" +"2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me ...\\ncan't get " +"fooled again" #: ../../howto/logging-cookbook.rst:4177 msgid "" diff --git a/howto/logging.po b/howto/logging.po index 95d042135d8..9337a55f282 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -282,6 +282,14 @@ msgid "" "logger.warning('And this, too')\n" "logger.error('And non-ASCII stuff, too, like Øresund and Malmö')" msgstr "" +"import logging\n" +"logger = logging.getLogger(__name__)\n" +"logging.basicConfig(filename='example.log', encoding='utf-8', " +"level=logging.DEBUG)\n" +"logger.debug('This message should go to the log file')\n" +"logger.info('So should this')\n" +"logger.warning('And this, too')\n" +"logger.error('And non-ASCII stuff, too, like Øresund and Malmö')" #: ../../howto/logging.rst:151 msgid "" @@ -434,6 +442,12 @@ msgid "" "logging.info('So should this')\n" "logging.warning('And this, too')" msgstr "" +"import logging\n" +"logging.basicConfig(format='%(levelname)s:%(message)s', " +"level=logging.DEBUG)\n" +"logging.debug('This message should appear on the console')\n" +"logging.info('So should this')\n" +"logging.warning('And this, too')" #: ../../howto/logging.rst:245 msgid "which would print:" @@ -472,6 +486,9 @@ msgid "" "logging.basicConfig(format='%(asctime)s %(message)s')\n" "logging.warning('is when this event was logged.')" msgstr "" +"import logging\n" +"logging.basicConfig(format='%(asctime)s %(message)s')\n" +"logging.warning('is when this event was logged.')" #: ../../howto/logging.rst:271 msgid "which should print something like this:" @@ -495,6 +512,10 @@ msgid "" "%M:%S %p')\n" "logging.warning('is when this event was logged.')" msgstr "" +"import logging\n" +"logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:" +"%M:%S %p')\n" +"logging.warning('is when this event was logged.')" #: ../../howto/logging.rst:285 msgid "which would display something like this:" @@ -1237,6 +1258,8 @@ msgid "" "import logging\n" "logging.getLogger('foo').addHandler(logging.NullHandler())" msgstr "" +"import logging\n" +"logging.getLogger('foo').addHandler(logging.NullHandler())" #: ../../howto/logging.rst:844 msgid "" diff --git a/howto/regex.po b/howto/regex.po index eaf264222e5..2cca8be49de 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -1319,7 +1319,7 @@ msgstr "" #: ../../howto/regex.rst:741 msgid "``\\z``" -msgstr "" +msgstr "``\\z``" #: ../../howto/regex.rst:742 msgid "Matches only at the end of the string." diff --git a/howto/remote_debugging.po b/howto/remote_debugging.po index 32a5a54f6e6..80514a6d582 100644 --- a/howto/remote_debugging.po +++ b/howto/remote_debugging.po @@ -62,7 +62,7 @@ msgstr "" #: ../../howto/remote_debugging.rst:30 msgid "``echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope``" -msgstr "" +msgstr "``echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope``" #: ../../howto/remote_debugging.rst:34 msgid "" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 38c77951476..df22955bfb3 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -312,6 +312,15 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def test():\n" +" print(\"never scheduled\")\n" +"\n" +"async def main():\n" +" test()\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-dev.rst:174 ../../library/asyncio-dev.rst:219 msgid "Output::" diff --git a/library/atexit.po b/library/atexit.po index 50b7c2cd2f6..2ad3f8cf563 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -235,6 +235,11 @@ msgid "" "def goodbye():\n" " print('You are now leaving the Python sector.')" msgstr "" +"import atexit\n" +"\n" +"@atexit.register\n" +"def goodbye():\n" +" print('You are now leaving the Python sector.')" #: ../../library/atexit.rst:127 msgid "This only works with functions that can be called without arguments." diff --git a/library/compileall.po b/library/compileall.po index c15b01fef67..221b9ee0d56 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -416,6 +416,17 @@ msgid "" "import pathlib\n" "compileall.compile_dir(pathlib.Path('Lib/'), force=True)" msgstr "" +"import compileall\n" +"\n" +"compileall.compile_dir('Lib/', force=True)\n" +"\n" +"# 執行相同的編譯,但排除 .svn 目錄中的檔案。\n" +"import re\n" +"compileall.compile_dir('Lib/', rx=re.compile(r'[/\\\\][.]svn'), force=True)\n" +"\n" +"# pathlib.Path 物件也可以使用。\n" +"import pathlib\n" +"compileall.compile_dir(pathlib.Path('Lib/'), force=True)" #: ../../library/compileall.rst:347 msgid "Module :mod:`py_compile`" diff --git a/library/csv.po b/library/csv.po index 377a9de593b..f4389ce3d9d 100644 --- a/library/csv.po +++ b/library/csv.po @@ -931,6 +931,10 @@ msgid "" " writer = csv.writer(f)\n" " writer.writerows(someiterable)" msgstr "" +"import csv\n" +"with open('some.csv', 'w', newline='') as f:\n" +" writer = csv.writer(f)\n" +" writer.writerows(someiterable)" #: ../../library/csv.rst:597 msgid "" diff --git a/library/datetime.po b/library/datetime.po index b564fbec70a..6c59ba6af81 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -858,7 +858,7 @@ msgstr "``1 <= month <= 12``" #: ../../library/datetime.rst:507 msgid "``1 <= day <= number of days in the given month and year``" -msgstr "" +msgstr "``1 <= day <= 該年該月的天數``" #: ../../library/datetime.rst:509 ../../library/datetime.rst:932 msgid "" diff --git a/library/devmode.po b/library/devmode.po index 9fc4d2e6bd4..3d05d82aac6 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -279,6 +279,16 @@ msgid "" "if __name__ == \"__main__\":\n" " main()" msgstr "" +"import sys\n" +"\n" +"def main():\n" +" fp = open(sys.argv[1])\n" +" nlines = len(fp.readlines())\n" +" print(nlines)\n" +" # The file is closed implicitly\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" #: ../../library/devmode.rst:127 msgid "" @@ -399,6 +409,16 @@ msgid "" "\n" "main()" msgstr "" +"import os\n" +"\n" +"def main():\n" +" fp = open(__file__)\n" +" firstline = fp.readline()\n" +" print(firstline.rstrip())\n" +" os.close(fp.fileno())\n" +" # 檔案是隱式關閉的\n" +"\n" +"main()" #: ../../library/devmode.rst:190 msgid "By default, Python does not emit any warning:" diff --git a/library/lzma.po b/library/lzma.po index f7ff47f4513..396f3c40431 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -643,6 +643,10 @@ msgid "" "with lzma.open(\"file.xz\", \"w\") as f:\n" " f.write(data)" msgstr "" +"import lzma\n" +"data = b\"Insert Data Here\"\n" +"with lzma.open(\"file.xz\", \"w\") as f:\n" +" f.write(data)" #: ../../library/lzma.rst:418 msgid "Compressing data in memory::" diff --git a/library/os.po b/library/os.po index 838f674f423..b68f6ab61d4 100644 --- a/library/os.po +++ b/library/os.po @@ -4210,6 +4210,14 @@ msgid "" " if '__pycache__' in dirs:\n" " dirs.remove('__pycache__') # don't visit __pycache__ directories" msgstr "" +"import os\n" +"from os.path import join, getsize\n" +"for root, dirs, files in os.walk('python/Lib/xml'):\n" +" print(root, \"consumes\", end=\" \")\n" +" print(sum(getsize(join(root, name)) for name in files), end=\" \")\n" +" print(\"bytes in\", len(files), \"non-directory files\")\n" +" if '__pycache__' in dirs:\n" +" dirs.remove('__pycache__') # don't visit __pycache__ directories" #: ../../library/os.rst:3711 msgid "" diff --git a/library/sys.po b/library/sys.po index 4b6bbf70e85..59747a073eb 100644 --- a/library/sys.po +++ b/library/sys.po @@ -741,7 +741,7 @@ msgstr ":option:`-X warn_default_encoding <-X>`" #: ../../library/sys.rst:599 msgid ":option:`-X gil <-X>` and :envvar:`PYTHON_GIL`" -msgstr "" +msgstr ":option:`-X gil <-X>` 和 :envvar:`PYTHON_GIL`" #: ../../library/sys.rst:602 msgid "" @@ -1436,9 +1436,8 @@ msgid "Cutoff for small string DJBX33A optimization in range ``[1, cutoff)``." msgstr "" #: ../../library/sys.rst:1139 -#, fuzzy msgid "Added *algorithm*, *hash_bits*, *seed_bits*, and *cutoff*." -msgstr "新增 *algorithm*、*hash_bits* 與 *seed_bits*" +msgstr "新增 *algorithm*、*hash_bits*、*seed_bits* 與 *cutoff*。" #: ../../library/sys.rst:1145 msgid "" diff --git a/library/time.po b/library/time.po index 45c42ebc429..addd4cbbcdf 100644 --- a/library/time.po +++ b/library/time.po @@ -613,7 +613,6 @@ msgid "Windows implementation" msgstr "Windows 實作" #: ../../library/time.rst:396 -#, fuzzy msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " "time slice to any other thread that is ready to run. If there are no other " @@ -625,9 +624,9 @@ msgid "" msgstr "" "在 Windows 上,如果 *secs* 為零,則執行緒將其剩餘的時間片段讓給任何準備運行的" "其他執行緒。如果沒有其他執行緒準備運行,該函式將立即回傳,而執行緒會繼續執" -"行。在 Windows 8.1 及更新的版本中,此實作使用\\ `高解析度計時器 `_,其解析度為 100 奈秒。如果 *secs* 為零,則使用 ``Sleep(0)``。" +"行。在 Windows 10 及更新的版本中,此實作使用\\ `高解析度計時器 `_" +",其解析度為 100 奈秒。如果 *secs* 為零,則使用 ``Sleep(0)``。" #: ../../library/time.rst:405 msgid "Unix implementation" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index ac88776b2ad..c9194b14501 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -405,6 +405,11 @@ msgid "" " print(\"3 is even: %s\" % str(proxy.is_even(3)))\n" " print(\"100 is even: %s\" % str(proxy.is_even(100)))" msgstr "" +"import xmlrpc.client\n" +"\n" +"with xmlrpc.client.ServerProxy(\"http://localhost:8000/\") as proxy:\n" +" print(\"3 is even: %s\" % str(proxy.is_even(3)))\n" +" print(\"100 is even: %s\" % str(proxy.is_even(100)))" #: ../../library/xmlrpc.client.rst:252 msgid "DateTime Objects" @@ -636,6 +641,15 @@ msgid "" " print(\"Fault code: %d\" % err.faultCode)\n" " print(\"Fault string: %s\" % err.faultString)" msgstr "" +"import xmlrpc.client\n" +"\n" +"proxy = xmlrpc.client.ServerProxy(\"http://localhost:8000/\")\n" +"try:\n" +" proxy.add(2, 5)\n" +"except xmlrpc.client.Fault as err:\n" +" print(\"A fault occurred\")\n" +" print(\"Fault code: %d\" % err.faultCode)\n" +" print(\"Fault string: %s\" % err.faultString)" #: ../../library/xmlrpc.client.rst:418 msgid "ProtocolError Objects" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index b45cc1bca84..4093dc22838 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -722,6 +722,13 @@ msgid "" "logging.error('Error occurred')\n" "logging.critical('Critical error -- shutting down')" msgstr "" +"import logging\n" +"\n" +"logging.debug('Debugging information')\n" +"logging.info('Informational message')\n" +"logging.warning('Warning:config file %s not found', 'server.conf')\n" +"logging.error('Error occurred')\n" +"logging.critical('Critical error -- shutting down')" #: ../../whatsnew/2.3.rst:475 ../../whatsnew/2.3.rst:500 msgid "This produces the following output::" @@ -2580,6 +2587,8 @@ msgid "" "import Tkinter\n" "Tkinter.wantobjects = 0" msgstr "" +"import Tkinter\n" +"Tkinter.wantobjects = 0" #: ../../whatsnew/2.3.rst:1590 msgid "Any breakage caused by this change should be reported as a bug." @@ -2823,6 +2832,16 @@ msgid "" " action='store', type='int', dest='length',\n" " help='set maximum length of output')" msgstr "" +"import sys\n" +"from optparse import OptionParser\n" +"\n" +"op = OptionParser()\n" +"op.add_option('-i', '--input',\n" +" action='store', type='string', dest='input',\n" +" help='set input filename')\n" +"op.add_option('-l', '--length',\n" +" action='store', type='int', dest='length',\n" +" help='set maximum length of output')" #: ../../whatsnew/2.3.rst:1756 msgid "" diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index d5d47990ebf..199b8b2da95 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -1971,6 +1971,10 @@ msgid "" " level=0, # Log all messages\n" " format='%(levelname):%(process):%(thread):%(message)')" msgstr "" +"import logging\n" +"logging.basicConfig(filename='/var/log/application.log',\n" +" level=0, # Log all messages\n" +" format='%(levelname):%(process):%(thread):%(message)')" #: ../../whatsnew/2.4.rst:1181 msgid "" diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index ea23b396105..9e939d1eb8a 100644 --- a/whatsnew/3.14.po +++ b/whatsnew/3.14.po @@ -158,15 +158,15 @@ msgstr "" #: ../../whatsnew/3.14.rst:123 msgid "C API improvements:" -msgstr "" +msgstr "C API 改進:" #: ../../whatsnew/3.14.rst:125 msgid ":pep:`741`: :ref:`Python configuration C API `" -msgstr "" +msgstr ":pep:`741`: :ref:`Python 配置 C API `" #: ../../whatsnew/3.14.rst:127 msgid "Platform support:" -msgstr "" +msgstr "平台支援:" #: ../../whatsnew/3.14.rst:129 msgid "" @@ -607,6 +607,16 @@ msgid "" "print('Behold! An offering:')\n" "sys.remote_exec(1234, script_path)" msgstr "" +"import sys\n" +"from tempfile import NamedTemporaryFile\n" +"\n" +"with NamedTemporaryFile(mode='w', suffix='.py', delete=False) as f:\n" +" script_path = f.name\n" +" f.write(f'import my_debugger; my_debugger.connect({os.getpid()})')\n" +"\n" +"# 在 PID 1234 的行程中執行\n" +"print('Behold! An offering:')\n" +"sys.remote_exec(1234, script_path)" #: ../../whatsnew/3.14.rst:418 msgid "" From 3a4c91a7dd28f1a42947622ef3c17fca66eb93ce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 10 Nov 2025 16:46:30 +0000 Subject: [PATCH 7/9] sync with cpython 63a3737c --- c-api/conversion.po | 86 ++- glossary.po | 311 +++++---- library/bz2.po | 144 ++-- library/compression.zstd.po | 542 +++++++-------- library/ctypes.po | 1296 ++++++++++++++++++----------------- library/curses.po | 982 +++++++++++++------------- library/ensurepip.po | 82 ++- library/functions.po | 4 +- library/gzip.po | 208 +++--- library/idle.po | 580 ++++++++-------- library/locale.po | 6 +- library/lzma.po | 232 ++++--- library/msvcrt.po | 88 +-- library/readline.po | 153 +++-- library/sqlite3.po | 958 +++++++++++++------------- library/ssl.po | 1109 +++++++++++++++--------------- library/tarfile.po | 988 +++++++++++++------------- library/tkinter.po | 653 +++++++++--------- library/turtle.po | 1230 ++++++++++++++++----------------- library/winreg.po | 388 +++++------ library/winsound.po | 126 ++-- library/zipfile.po | 435 ++++++------ library/zlib.po | 247 +++---- sphinx.po | 63 +- using/configure.po | 1177 +++++++++++++++++-------------- using/unix.po | 96 +-- whatsnew/2.7.po | 256 +++---- 27 files changed, 6425 insertions(+), 6015 deletions(-) diff --git a/c-api/conversion.po b/c-api/conversion.po index 1ff9a85adfe..cab844cdbc4 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 02:52+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2023-12-11 18:26+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -116,8 +116,8 @@ msgid "" "long` value according to the given ``base``, which must be between ``2`` and " "``36`` inclusive, or be the special value ``0``." msgstr "" -"將字串 ``str`` 的初始部分根據給定的 ``base`` 轉換為 :c:expr:`unsigned long` 值," -"底 (base) 必須介於 ``2`` 到 ``36``\\ (包含)之間,或為特殊值 ``0``。" +"將字串 ``str`` 的初始部分根據給定的 ``base`` 轉換為 :c:expr:`unsigned long` " +"值,底 (base) 必須介於 ``2`` 到 ``36``\\ (包含)之間,或為特殊值 ``0``。" #: ../../c-api/conversion.rst:57 msgid "" @@ -127,9 +127,10 @@ msgid "" "(inclusive). If ``ptr`` is non-``NULL`` it will contain a pointer to the " "end of the scan." msgstr "" -"忽略前導空白和字元大小寫。如果 ``base`` 為零,則會尋找前導的 ``0b``、" -"``0o`` 或 ``0x`` 來判斷使用哪個進位。如果這些前綴不存在,則預設為 ``10``。" -"底必須為 0 或介於 2 到 36(包含)之間。如果 ``ptr`` 為非 ``NULL``,它將包含指向掃描結束處的指標。" +"忽略前導空白和字元大小寫。如果 ``base`` 為零,則會尋找前導的 ``0b``、``0o`` " +"或 ``0x`` 來判斷使用哪個進位。如果這些前綴不存在,則預設為 ``10``。底必須為 " +"0 或介於 2 到 36(包含)之間。如果 ``ptr`` 為非 ``NULL``,它將包含指向掃描結" +"束處的指標。" #: ../../c-api/conversion.rst:63 msgid "" @@ -138,8 +139,9 @@ msgid "" "macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0`` is " "returned." msgstr "" -"如果轉換後的值超出對應回傳型別的範圍,則會發生範圍錯誤(:c:data:`errno` " -"會被設定為 :c:macro:`!ERANGE`)並回傳 :c:macro:`!ULONG_MAX`。如果無法執行任何轉換,則回傳 ``0``。" +"如果轉換後的值超出對應回傳型別的範圍,則會發生範圍錯誤(:c:data:`errno` 會被" +"設定為 :c:macro:`!ERANGE`)並回傳 :c:macro:`!ULONG_MAX`。如果無法執行任何轉" +"換,則回傳 ``0``。" #: ../../c-api/conversion.rst:68 msgid "See also the Unix man page :manpage:`strtoul(3)`." @@ -151,15 +153,16 @@ msgid "" "according to the given ``base``, which must be between ``2`` and ``36`` " "inclusive, or be the special value ``0``." msgstr "" -"將字串 ``str`` 的初始部分根據給定的 ``base`` 轉換為 :c:expr:`long` 值,底 " -"必須介於 ``2`` 到 ``36``(包含)之間,或為特殊值 ``0``。" +"將字串 ``str`` 的初始部分根據給定的 ``base`` 轉換為 :c:expr:`long` 值,底 必" +"須介於 ``2`` 到 ``36``(包含)之間,或為特殊值 ``0``。" #: ../../c-api/conversion.rst:79 msgid "" "Same as :c:func:`PyOS_strtoul`, but return a :c:expr:`long` value instead " "and :c:macro:`LONG_MAX` on overflows." msgstr "" -"與 :c:func:`PyOS_strtoul` 相同,但回傳 :c:expr:`long` 值,並在溢位時回傳 :c:macro:`LONG_MAX`。" +"與 :c:func:`PyOS_strtoul` 相同,但回傳 :c:expr:`long` 值,並在溢位時回傳 :c:" +"macro:`LONG_MAX`。" #: ../../c-api/conversion.rst:82 msgid "See also the Unix man page :manpage:`strtol(3)`." @@ -249,7 +252,8 @@ msgstr "*flags* 可以是零個或多個以下的值被聯集在一起:" msgid "" "Always precede the returned string with a sign character, even if *val* is " "non-negative." -msgstr "總是在回傳的字串前面加上正負號字元 (sign character),即使 *val* 非負數。" +msgstr "" +"總是在回傳的字串前面加上正負號字元 (sign character),即使 *val* 非負數。" #: ../../c-api/conversion.rst:140 msgid "Ensure that the returned string will not look like an integer." @@ -259,7 +263,9 @@ msgstr "確保回傳的字串看起來不會像整數。" msgid "" "Apply \"alternate\" formatting rules. See the documentation for the :c:func:" "`PyOS_snprintf` ``'#'`` specifier for details." -msgstr "套用「備用的 (alternate)」格式化規則。有關詳細資訊,請參閱 :c:func:`PyOS_snprintf` ``'#'`` 的文件。" +msgstr "" +"套用「備用的 (alternate)」格式化規則。有關詳細資訊,請參閱 :c:func:" +"`PyOS_snprintf` ``'#'`` 的文件。" #: ../../c-api/conversion.rst:150 msgid "Negative zero is converted to positive zero." @@ -300,3 +306,57 @@ msgid "" msgstr "" "不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strncmp` 相同,只是它" "忽略大小寫。" + +#: ../../c-api/conversion.rst:178 +msgid "Character classification and conversion" +msgstr "" + +#: ../../c-api/conversion.rst:180 +msgid "" +"The following macros provide locale-independent (unlike the C standard " +"library ``ctype.h``) character classification and conversion. The argument " +"must be a signed or unsigned :c:expr:`char`." +msgstr "" + +#: ../../c-api/conversion.rst:187 +msgid "Return true if the character *c* is an alphanumeric character." +msgstr "" + +#: ../../c-api/conversion.rst:192 +msgid "" +"Return true if the character *c* is an alphabetic character (``a-z`` and ``A-" +"Z``)." +msgstr "" + +#: ../../c-api/conversion.rst:197 +msgid "Return true if the character *c* is a decimal digit (``0-9``)." +msgstr "" + +#: ../../c-api/conversion.rst:202 +msgid "Return true if the character *c* is a lowercase ASCII letter (``a-z``)." +msgstr "" + +#: ../../c-api/conversion.rst:207 +msgid "" +"Return true if the character *c* is an uppercase ASCII letter (``A-Z``)." +msgstr "" + +#: ../../c-api/conversion.rst:212 +msgid "" +"Return true if the character *c* is a whitespace character (space, tab, " +"carriage return, newline, vertical tab, or form feed)." +msgstr "" + +#: ../../c-api/conversion.rst:218 +msgid "" +"Return true if the character *c* is a hexadecimal digit (``0-9``, ``a-f``, " +"and ``A-F``)." +msgstr "" + +#: ../../c-api/conversion.rst:224 +msgid "Return the lowercase equivalent of the character *c*." +msgstr "" + +#: ../../c-api/conversion.rst:229 +msgid "Return the uppercase equivalent of the character *c*." +msgstr "" diff --git a/glossary.po b/glossary.po index 9bb349a099a..676ace2fe06 100644 --- a/glossary.po +++ b/glossary.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1850,7 +1850,7 @@ msgstr "" msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:824 ../../glossary.rst:1139 +#: ../../glossary.rst:824 ../../glossary.rst:1148 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" @@ -2069,7 +2069,7 @@ msgstr "" msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:884 ../../glossary.rst:916 ../../glossary.rst:1290 +#: ../../glossary.rst:884 ../../glossary.rst:916 ../../glossary.rst:1299 msgid "method" msgstr "method(方法)" @@ -2327,10 +2327,29 @@ msgid "" msgstr "" #: ../../glossary.rst:1027 +#, fuzzy +msgid "optional module" +msgstr "extension module(擴充模組)" + +#: ../../glossary.rst:1029 +msgid "" +"An :term:`extension module` that is part of the :term:`standard library`, " +"but may be absent in some builds of :term:`CPython`, usually due to missing " +"third-party libraries or because the module is not available for a given " +"platform." +msgstr "" + +#: ../../glossary.rst:1034 +msgid "" +"See :ref:`optional-module-requirements` for a list of optional modules that " +"require third-party libraries." +msgstr "" + +#: ../../glossary.rst:1036 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:1029 +#: ../../glossary.rst:1038 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2340,17 +2359,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:1033 +#: ../../glossary.rst:1042 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:1034 +#: ../../glossary.rst:1043 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:1036 +#: ../../glossary.rst:1045 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2360,7 +2379,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:1040 +#: ../../glossary.rst:1049 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2371,11 +2390,11 @@ msgstr "" "置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:1045 +#: ../../glossary.rst:1054 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:1049 +#: ../../glossary.rst:1058 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2386,11 +2405,11 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:1054 +#: ../../glossary.rst:1063 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: ../../glossary.rst:1058 +#: ../../glossary.rst:1067 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2403,11 +2422,11 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:1064 +#: ../../glossary.rst:1073 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: ../../glossary.rst:1066 +#: ../../glossary.rst:1075 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2419,11 +2438,11 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:1072 +#: ../../glossary.rst:1081 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: ../../glossary.rst:1074 +#: ../../glossary.rst:1083 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2434,14 +2453,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:1080 +#: ../../glossary.rst:1089 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:1083 +#: ../../glossary.rst:1092 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2452,11 +2471,11 @@ msgstr "" "參數之間的差異 `、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:1087 +#: ../../glossary.rst:1096 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:1089 +#: ../../glossary.rst:1098 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2464,11 +2483,11 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:1091 +#: ../../glossary.rst:1100 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:1093 +#: ../../glossary.rst:1102 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2478,7 +2497,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:1097 +#: ../../glossary.rst:1106 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2486,11 +2505,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`。" -#: ../../glossary.rst:1099 +#: ../../glossary.rst:1108 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:1101 +#: ../../glossary.rst:1110 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2500,11 +2519,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1113 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:1106 +#: ../../glossary.rst:1115 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2512,11 +2531,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:1108 +#: ../../glossary.rst:1117 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:1110 +#: ../../glossary.rst:1119 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2534,11 +2553,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:1118 +#: ../../glossary.rst:1127 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1120 +#: ../../glossary.rst:1129 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2549,7 +2568,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:1126 +#: ../../glossary.rst:1135 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2561,15 +2580,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:1132 +#: ../../glossary.rst:1141 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:1133 +#: ../../glossary.rst:1142 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:1135 +#: ../../glossary.rst:1144 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2577,15 +2596,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:1137 +#: ../../glossary.rst:1146 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:1140 +#: ../../glossary.rst:1149 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:1142 +#: ../../glossary.rst:1151 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2601,7 +2620,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1151 +#: ../../glossary.rst:1160 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2610,7 +2629,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1155 +#: ../../glossary.rst:1164 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2619,19 +2638,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1158 +#: ../../glossary.rst:1167 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:1169 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1161 +#: ../../glossary.rst:1170 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1163 +#: ../../glossary.rst:1172 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2640,11 +2659,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1175 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1168 +#: ../../glossary.rst:1177 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2658,7 +2677,7 @@ msgstr "" "keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" "這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1175 +#: ../../glossary.rst:1184 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2666,11 +2685,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: ../../glossary.rst:1178 +#: ../../glossary.rst:1187 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1180 +#: ../../glossary.rst:1189 msgid "" "for piece in food:\n" " print(piece)" @@ -2678,11 +2697,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: ../../glossary.rst:1182 +#: ../../glossary.rst:1191 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1184 +#: ../../glossary.rst:1193 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2693,7 +2712,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1189 +#: ../../glossary.rst:1198 msgid "" ">>> class C:\n" "... class D:\n" @@ -2719,7 +2738,7 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../glossary.rst:1201 +#: ../../glossary.rst:1210 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2728,7 +2747,7 @@ msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1205 +#: ../../glossary.rst:1214 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2738,11 +2757,11 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: ../../glossary.rst:1208 +#: ../../glossary.rst:1217 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1210 +#: ../../glossary.rst:1219 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Some objects are :term:`immortal` " @@ -2758,7 +2777,7 @@ msgstr "" "看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :" "func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1219 +#: ../../glossary.rst:1228 msgid "" "In :term:`CPython`, reference counts are not considered to be stable or well-" "defined values; the number of references to an object, and how that number " @@ -2767,11 +2786,11 @@ msgstr "" "在 :term:`CPython` 中,參照計數不被視為穩定或明確定義的值;對物件的參照數量," "以及該數量如何受到 Python 程式碼的影響,在不同版本之間可能會有所不同。" -#: ../../glossary.rst:1223 +#: ../../glossary.rst:1232 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1225 +#: ../../glossary.rst:1234 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2779,15 +2798,15 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1228 +#: ../../glossary.rst:1237 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1229 +#: ../../glossary.rst:1238 msgid "REPL" msgstr "REPL" -#: ../../glossary.rst:1231 +#: ../../glossary.rst:1240 msgid "" "An acronym for the \"read–eval–print loop\", another name for the :term:" "`interactive` interpreter shell." @@ -2795,11 +2814,11 @@ msgstr "" "「read-eval-print 迴圈 (read–eval–print loop)」的縮寫,是\\ :term:`互動式 " "`\\ 直譯器 shell 的另一個名稱。" -#: ../../glossary.rst:1233 +#: ../../glossary.rst:1242 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1235 +#: ../../glossary.rst:1244 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2812,11 +2831,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1240 +#: ../../glossary.rst:1249 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1242 +#: ../../glossary.rst:1251 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`~object.__getitem__` special method and defines a :" @@ -2835,7 +2854,7 @@ msgstr "" "為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` 鍵," "而不是整數。" -#: ../../glossary.rst:1251 +#: ../../glossary.rst:1260 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" @@ -2852,11 +2871,11 @@ msgstr "" "別,可以使用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文" "件,請見\\ :ref:`常見序列操作 `。" -#: ../../glossary.rst:1261 +#: ../../glossary.rst:1270 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1263 +#: ../../glossary.rst:1272 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2867,11 +2886,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1267 +#: ../../glossary.rst:1276 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1269 +#: ../../glossary.rst:1278 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2879,11 +2898,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1271 +#: ../../glossary.rst:1280 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1273 +#: ../../glossary.rst:1282 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2895,11 +2914,11 @@ msgstr "" "之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1277 +#: ../../glossary.rst:1286 msgid "soft deprecated" msgstr "soft deprecated(軟性棄用)" -#: ../../glossary.rst:1279 +#: ../../glossary.rst:1288 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " @@ -2908,13 +2927,13 @@ msgstr "" "被軟性棄用的 API 代表不應再用於新程式碼中,但在現有程式碼中繼續使用它仍會是安" "全的。API 仍會以文件記錄並會被測試,但不會被繼續改進。" -#: ../../glossary.rst:1283 +#: ../../glossary.rst:1292 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." msgstr "與正常棄用不同,軟性棄用沒有刪除 API 的規劃,也不會發出警告。" -#: ../../glossary.rst:1286 +#: ../../glossary.rst:1295 msgid "" "See `PEP 387: Soft Deprecation `_." @@ -2922,11 +2941,11 @@ msgstr "" "請參閱 `PEP 387:軟性棄用 `_。" -#: ../../glossary.rst:1288 +#: ../../glossary.rst:1297 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1292 +#: ../../glossary.rst:1301 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2937,11 +2956,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1296 +#: ../../glossary.rst:1305 msgid "standard library" msgstr "標準函式庫" -#: ../../glossary.rst:1298 +#: ../../glossary.rst:1307 msgid "" "The collection of :term:`packages `, :term:`modules ` and :" "term:`extension modules ` distributed as a part of the " @@ -2954,7 +2973,7 @@ msgstr "" "行。該集合的成員可能會因平台、可用的系統函式庫或其他條件而有所不同。相關文件" "可以在 :ref:`library-index` 中找到。" -#: ../../glossary.rst:1304 +#: ../../glossary.rst:1313 msgid "" "See also :data:`sys.stdlib_module_names` for a list of all possible standard " "library module names." @@ -2962,11 +2981,11 @@ msgstr "" "請參閱 :data:`sys.stdlib_module_names` 以取得所有可能的標準函式庫模組名稱的列" "表。" -#: ../../glossary.rst:1306 +#: ../../glossary.rst:1315 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1308 +#: ../../glossary.rst:1317 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2976,11 +2995,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" "`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1311 +#: ../../glossary.rst:1320 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1313 +#: ../../glossary.rst:1322 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints ` and the :" @@ -2990,19 +3009,19 @@ msgstr "" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1316 +#: ../../glossary.rst:1325 msgid "stdlib" msgstr "stdlib(標準函式庫)" -#: ../../glossary.rst:1318 +#: ../../glossary.rst:1327 msgid "An abbreviation of :term:`standard library`." msgstr ":term:`standard library` 的縮寫。" -#: ../../glossary.rst:1319 +#: ../../glossary.rst:1328 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1321 +#: ../../glossary.rst:1330 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -3013,7 +3032,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1327 +#: ../../glossary.rst:1336 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -3023,19 +3042,19 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1332 +#: ../../glossary.rst:1341 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1333 +#: ../../glossary.rst:1342 msgid "t-string" msgstr "t-string(t 字串)" -#: ../../glossary.rst:1334 +#: ../../glossary.rst:1343 msgid "t-strings" msgstr "t-strings(t 字串)" -#: ../../glossary.rst:1336 +#: ../../glossary.rst:1345 msgid "" "String literals prefixed with ``t`` or ``T`` are commonly called \"t-" "strings\" which is short for :ref:`template string literals `." @@ -3043,11 +3062,11 @@ msgstr "" "以 ``t`` 或 ``T`` 為前綴的字串文本通常被稱為「t 字串」,它是\\ :ref:`模板化的" "字串文本 `\\ 的縮寫。" -#: ../../glossary.rst:1339 +#: ../../glossary.rst:1348 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1341 +#: ../../glossary.rst:1350 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -3057,7 +3076,7 @@ msgstr "" "``U+0000`` -- ``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一" "個位元組序列。" -#: ../../glossary.rst:1345 +#: ../../glossary.rst:1354 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -3065,7 +3084,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1348 +#: ../../glossary.rst:1357 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -3073,11 +3092,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1351 +#: ../../glossary.rst:1360 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1353 +#: ../../glossary.rst:1362 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -3091,7 +3110,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1360 +#: ../../glossary.rst:1369 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -3099,32 +3118,32 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1362 +#: ../../glossary.rst:1371 msgid "thread state" msgstr "" -#: ../../glossary.rst:1365 +#: ../../glossary.rst:1374 msgid "" "The information used by the :term:`CPython` runtime to run in an OS thread. " "For example, this includes the current exception, if any, and the state of " "the bytecode interpreter." msgstr "" -#: ../../glossary.rst:1369 +#: ../../glossary.rst:1378 msgid "" "Each thread state is bound to a single OS thread, but threads may have many " "thread states available. At most, one of them may be :term:`attached " "` at once." msgstr "" -#: ../../glossary.rst:1373 +#: ../../glossary.rst:1382 msgid "" "An :term:`attached thread state` is required to call most of Python's C API, " "unless a function explicitly documents otherwise. The bytecode interpreter " "only runs under an attached thread state." msgstr "" -#: ../../glossary.rst:1377 +#: ../../glossary.rst:1386 msgid "" "Each thread state belongs to a single interpreter, but each interpreter may " "have many thread states, including multiple for the same OS thread. Thread " @@ -3133,17 +3152,17 @@ msgid "" "given moment." msgstr "" -#: ../../glossary.rst:1383 +#: ../../glossary.rst:1392 msgid "" "See :ref:`Thread State and the Global Interpreter Lock ` for more " "information." msgstr "" -#: ../../glossary.rst:1385 +#: ../../glossary.rst:1394 msgid "token" msgstr "token" -#: ../../glossary.rst:1388 +#: ../../glossary.rst:1397 msgid "" "A small unit of source code, generated by the :ref:`lexical analyzer " "` (also called the *tokenizer*). Names, numbers, strings, " @@ -3152,7 +3171,7 @@ msgstr "" "原始碼的小單位,由 :ref:`詞法分析器 ` (也稱為 *tokenizer*)產生。名" "稱、數字、字串、運算子、換行符號等都以 token 表示。" -#: ../../glossary.rst:1393 +#: ../../glossary.rst:1402 msgid "" "The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:" "`token` module contains information on the various types of tokens." @@ -3160,11 +3179,11 @@ msgstr "" ":mod:`tokenize` 模組公開了 Python 的詞法分析器。:mod:`token` 模組包含各種 " "token 類型的資訊。" -#: ../../glossary.rst:1396 +#: ../../glossary.rst:1405 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1398 +#: ../../glossary.rst:1407 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -3179,11 +3198,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1405 +#: ../../glossary.rst:1414 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1407 +#: ../../glossary.rst:1416 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~object." @@ -3193,22 +3212,22 @@ msgstr "" "件的型別可以用它的 :attr:`~object.__class__` 屬性來存取,或以 ``type(obj)`` " "來檢索。" -#: ../../glossary.rst:1411 +#: ../../glossary.rst:1420 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1413 +#: ../../glossary.rst:1422 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1415 +#: ../../glossary.rst:1424 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1418 +#: ../../glossary.rst:1427 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -3218,11 +3237,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1422 +#: ../../glossary.rst:1431 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1424 +#: ../../glossary.rst:1433 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -3234,15 +3253,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1429 ../../glossary.rst:1443 +#: ../../glossary.rst:1438 ../../glossary.rst:1452 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1430 +#: ../../glossary.rst:1439 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1432 +#: ../../glossary.rst:1441 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -3250,7 +3269,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1435 +#: ../../glossary.rst:1444 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -3260,7 +3279,7 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1439 +#: ../../glossary.rst:1448 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -3268,11 +3287,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1444 +#: ../../glossary.rst:1453 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1446 +#: ../../glossary.rst:1455 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -3285,20 +3304,20 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1451 +#: ../../glossary.rst:1460 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1453 +#: ../../glossary.rst:1462 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1455 +#: ../../glossary.rst:1464 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1457 +#: ../../glossary.rst:1466 msgid "" "class C:\n" " field: 'annotation'" @@ -3306,7 +3325,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1460 +#: ../../glossary.rst:1469 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -3314,15 +3333,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1464 +#: ../../glossary.rst:1473 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1466 +#: ../../glossary.rst:1475 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1468 +#: ../../glossary.rst:1477 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3331,11 +3350,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1472 +#: ../../glossary.rst:1481 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1474 +#: ../../glossary.rst:1483 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3346,15 +3365,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1479 +#: ../../glossary.rst:1488 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1480 +#: ../../glossary.rst:1489 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1482 +#: ../../glossary.rst:1491 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -3362,22 +3381,22 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1484 +#: ../../glossary.rst:1493 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../glossary.rst:1486 +#: ../../glossary.rst:1495 msgid "" "A light-hearted way to refer to the :ref:`assignment expression ` operator ``:=`` because it looks a bit like a walrus if you " "turn your head." msgstr "" -#: ../../glossary.rst:1489 +#: ../../glossary.rst:1498 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1491 +#: ../../glossary.rst:1500 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3406,7 +3425,7 @@ msgstr "Fortran contiguous(Fortran 連續的)" msgid "magic" msgstr "magic" -#: ../../glossary.rst:1290 +#: ../../glossary.rst:1299 msgid "special" msgstr "special" diff --git a/library/bz2.po b/library/bz2.po index 80e47865d88..b676e2bdcaf 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,37 +53,45 @@ msgid "" "(de)compression." msgstr "" -#: ../../library/bz2.rst:30 +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/bz2.rst:32 msgid "(De)compression of files" msgstr "" -#: ../../library/bz2.rst:34 +#: ../../library/bz2.rst:36 msgid "" "Open a bzip2-compressed file in binary or text mode, returning a :term:`file " "object`." msgstr "" -#: ../../library/bz2.rst:37 +#: ../../library/bz2.rst:39 msgid "" "As with the constructor for :class:`BZ2File`, the *filename* argument can be " "an actual filename (a :class:`str` or :class:`bytes` object), or an existing " "file object to read from or write to." msgstr "" -#: ../../library/bz2.rst:41 +#: ../../library/bz2.rst:43 msgid "" "The *mode* argument can be any of ``'r'``, ``'rb'``, ``'w'``, ``'wb'``, " "``'x'``, ``'xb'``, ``'a'`` or ``'ab'`` for binary mode, or ``'rt'``, " "``'wt'``, ``'xt'``, or ``'at'`` for text mode. The default is ``'rb'``." msgstr "" -#: ../../library/bz2.rst:45 +#: ../../library/bz2.rst:47 msgid "" "The *compresslevel* argument is an integer from 1 to 9, as for the :class:" "`BZ2File` constructor." msgstr "" -#: ../../library/bz2.rst:48 +#: ../../library/bz2.rst:50 msgid "" "For binary mode, this function is equivalent to the :class:`BZ2File` " "constructor: ``BZ2File(filename, mode, compresslevel=compresslevel)``. In " @@ -91,33 +99,33 @@ msgid "" "provided." msgstr "" -#: ../../library/bz2.rst:53 +#: ../../library/bz2.rst:55 msgid "" "For text mode, a :class:`BZ2File` object is created, and wrapped in an :" "class:`io.TextIOWrapper` instance with the specified encoding, error " "handling behavior, and line ending(s)." msgstr "" -#: ../../library/bz2.rst:59 ../../library/bz2.rst:175 +#: ../../library/bz2.rst:61 ../../library/bz2.rst:177 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/bz2.rst:62 ../../library/bz2.rst:182 +#: ../../library/bz2.rst:64 ../../library/bz2.rst:184 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/bz2.rst:68 +#: ../../library/bz2.rst:70 msgid "Open a bzip2-compressed file in binary mode." msgstr "" -#: ../../library/bz2.rst:70 +#: ../../library/bz2.rst:72 msgid "" "If *filename* is a :class:`str` or :class:`bytes` object, open the named " "file directly. Otherwise, *filename* should be a :term:`file object`, which " "will be used to read or write the compressed data." msgstr "" -#: ../../library/bz2.rst:74 +#: ../../library/bz2.rst:76 msgid "" "The *mode* argument can be either ``'r'`` for reading (default), ``'w'`` for " "overwriting, ``'x'`` for exclusive creation, or ``'a'`` for appending. These " @@ -125,44 +133,44 @@ msgid "" "respectively." msgstr "" -#: ../../library/bz2.rst:79 +#: ../../library/bz2.rst:81 msgid "" "If *filename* is a file object (rather than an actual file name), a mode of " "``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." msgstr "" -#: ../../library/bz2.rst:82 +#: ../../library/bz2.rst:84 msgid "" "If *mode* is ``'w'`` or ``'a'``, *compresslevel* can be an integer between " "``1`` and ``9`` specifying the level of compression: ``1`` produces the " "least compression, and ``9`` (default) produces the most compression." msgstr "" -#: ../../library/bz2.rst:86 +#: ../../library/bz2.rst:88 msgid "" "If *mode* is ``'r'``, the input file may be the concatenation of multiple " "compressed streams." msgstr "" -#: ../../library/bz2.rst:89 +#: ../../library/bz2.rst:91 msgid "" ":class:`BZ2File` provides all of the members specified by the :class:`io." "BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io." "IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." msgstr "" -#: ../../library/bz2.rst:94 +#: ../../library/bz2.rst:96 msgid ":class:`BZ2File` also provides the following methods and attributes:" msgstr ":class:`BZ2File` 也提供了以下方法和屬性:" -#: ../../library/bz2.rst:98 +#: ../../library/bz2.rst:100 msgid "" "Return buffered data without advancing the file position. At least one byte " "of data will be returned (unless at EOF). The exact number of bytes returned " "is unspecified." msgstr "" -#: ../../library/bz2.rst:102 +#: ../../library/bz2.rst:104 msgid "" "While calling :meth:`peek` does not change the file position of the :class:" "`BZ2File`, it may change the position of the underlying file object (e.g. if " @@ -170,138 +178,138 @@ msgid "" "*filename*)." msgstr "" -#: ../../library/bz2.rst:111 +#: ../../library/bz2.rst:113 msgid "Return the file descriptor for the underlying file." msgstr "" -#: ../../library/bz2.rst:117 +#: ../../library/bz2.rst:119 msgid "Return whether the file was opened for reading." msgstr "" -#: ../../library/bz2.rst:123 +#: ../../library/bz2.rst:125 msgid "Return whether the file supports seeking." msgstr "" -#: ../../library/bz2.rst:129 +#: ../../library/bz2.rst:131 msgid "Return whether the file was opened for writing." msgstr "" -#: ../../library/bz2.rst:135 +#: ../../library/bz2.rst:137 msgid "" "Read up to *size* uncompressed bytes, while trying to avoid making multiple " "reads from the underlying stream. Reads up to a buffer's worth of data if " "size is negative." msgstr "" -#: ../../library/bz2.rst:139 +#: ../../library/bz2.rst:141 msgid "Returns ``b''`` if the file is at EOF." msgstr "" -#: ../../library/bz2.rst:145 +#: ../../library/bz2.rst:147 msgid "Read bytes into *b*." msgstr "" -#: ../../library/bz2.rst:147 +#: ../../library/bz2.rst:149 msgid "Returns the number of bytes read (0 for EOF)." msgstr "" -#: ../../library/bz2.rst:153 +#: ../../library/bz2.rst:155 msgid "``'rb'`` for reading and ``'wb'`` for writing." msgstr "" -#: ../../library/bz2.rst:159 +#: ../../library/bz2.rst:161 msgid "" "The bzip2 file name. Equivalent to the :attr:`~io.FileIO.name` attribute of " "the underlying :term:`file object`." msgstr "" -#: ../../library/bz2.rst:165 +#: ../../library/bz2.rst:167 msgid "Support for the :keyword:`with` statement was added." msgstr "" -#: ../../library/bz2.rst:168 +#: ../../library/bz2.rst:170 msgid "" "Support was added for *filename* being a :term:`file object` instead of an " "actual filename." msgstr "" -#: ../../library/bz2.rst:172 +#: ../../library/bz2.rst:174 msgid "" "The ``'a'`` (append) mode was added, along with support for reading multi-" "stream files." msgstr "" -#: ../../library/bz2.rst:178 +#: ../../library/bz2.rst:180 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." msgstr "" -#: ../../library/bz2.rst:185 +#: ../../library/bz2.rst:187 msgid "" "The *buffering* parameter has been removed. It was ignored and deprecated " "since Python 3.0. Pass an open file object to control how the file is opened." msgstr "" -#: ../../library/bz2.rst:190 +#: ../../library/bz2.rst:192 msgid "The *compresslevel* parameter became keyword-only." msgstr "" -#: ../../library/bz2.rst:192 +#: ../../library/bz2.rst:194 msgid "" "This class is thread unsafe in the face of multiple simultaneous readers or " "writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` " "have always been." msgstr "" -#: ../../library/bz2.rst:199 +#: ../../library/bz2.rst:201 msgid "Incremental (de)compression" msgstr "" -#: ../../library/bz2.rst:203 +#: ../../library/bz2.rst:205 msgid "" "Create a new compressor object. This object may be used to compress data " "incrementally. For one-shot compression, use the :func:`compress` function " "instead." msgstr "" -#: ../../library/bz2.rst:207 ../../library/bz2.rst:295 +#: ../../library/bz2.rst:209 ../../library/bz2.rst:297 msgid "" "*compresslevel*, if given, must be an integer between ``1`` and ``9``. The " "default is ``9``." msgstr "" -#: ../../library/bz2.rst:212 +#: ../../library/bz2.rst:214 msgid "" "Provide data to the compressor object. Returns a chunk of compressed data if " "possible, or an empty byte string otherwise." msgstr "" -#: ../../library/bz2.rst:215 +#: ../../library/bz2.rst:217 msgid "" "When you have finished providing data to the compressor, call the :meth:" "`flush` method to finish the compression process." msgstr "" -#: ../../library/bz2.rst:221 +#: ../../library/bz2.rst:223 msgid "" "Finish the compression process. Returns the compressed data left in internal " "buffers." msgstr "" -#: ../../library/bz2.rst:224 +#: ../../library/bz2.rst:226 msgid "" "The compressor object may not be used after this method has been called." msgstr "" -#: ../../library/bz2.rst:229 +#: ../../library/bz2.rst:231 msgid "" "Create a new decompressor object. This object may be used to decompress data " "incrementally. For one-shot compression, use the :func:`decompress` function " "instead." msgstr "" -#: ../../library/bz2.rst:234 +#: ../../library/bz2.rst:236 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " @@ -309,7 +317,7 @@ msgid "" "must use a new decompressor for each stream." msgstr "" -#: ../../library/bz2.rst:241 +#: ../../library/bz2.rst:243 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -317,7 +325,7 @@ msgid "" "output of any previous calls to :meth:`decompress`." msgstr "" -#: ../../library/bz2.rst:247 +#: ../../library/bz2.rst:249 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -326,99 +334,99 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: ../../library/bz2.rst:254 +#: ../../library/bz2.rst:256 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: ../../library/bz2.rst:259 +#: ../../library/bz2.rst:261 msgid "" "Attempting to decompress data after the end of stream is reached raises an :" "exc:`EOFError`. Any data found after the end of the stream is ignored and " "saved in the :attr:`~.unused_data` attribute." msgstr "" -#: ../../library/bz2.rst:263 +#: ../../library/bz2.rst:265 msgid "Added the *max_length* parameter." msgstr "新增 *max_length* 參數。" -#: ../../library/bz2.rst:268 +#: ../../library/bz2.rst:270 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: ../../library/bz2.rst:275 +#: ../../library/bz2.rst:277 msgid "Data found after the end of the compressed stream." msgstr "" -#: ../../library/bz2.rst:277 +#: ../../library/bz2.rst:279 msgid "" "If this attribute is accessed before the end of the stream has been reached, " "its value will be ``b''``." msgstr "" -#: ../../library/bz2.rst:282 +#: ../../library/bz2.rst:284 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." msgstr "" -#: ../../library/bz2.rst:289 +#: ../../library/bz2.rst:291 msgid "One-shot (de)compression" msgstr "" -#: ../../library/bz2.rst:293 +#: ../../library/bz2.rst:295 msgid "Compress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:298 +#: ../../library/bz2.rst:300 msgid "For incremental compression, use a :class:`BZ2Compressor` instead." msgstr "" -#: ../../library/bz2.rst:303 +#: ../../library/bz2.rst:305 msgid "Decompress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:305 +#: ../../library/bz2.rst:307 msgid "" "If *data* is the concatenation of multiple compressed streams, decompress " "all of the streams." msgstr "" -#: ../../library/bz2.rst:308 +#: ../../library/bz2.rst:310 msgid "For incremental decompression, use a :class:`BZ2Decompressor` instead." msgstr "" -#: ../../library/bz2.rst:310 +#: ../../library/bz2.rst:312 msgid "Support for multi-stream inputs was added." msgstr "" -#: ../../library/bz2.rst:316 +#: ../../library/bz2.rst:318 msgid "Examples of usage" msgstr "用法範例" -#: ../../library/bz2.rst:318 +#: ../../library/bz2.rst:320 msgid "Below are some examples of typical usage of the :mod:`bz2` module." msgstr "" -#: ../../library/bz2.rst:320 +#: ../../library/bz2.rst:322 msgid "" "Using :func:`compress` and :func:`decompress` to demonstrate round-trip " "compression:" msgstr "" -#: ../../library/bz2.rst:338 +#: ../../library/bz2.rst:340 msgid "Using :class:`BZ2Compressor` for incremental compression:" msgstr "" -#: ../../library/bz2.rst:356 +#: ../../library/bz2.rst:358 msgid "" "The example above uses a very \"nonrandom\" stream of data (a stream of " "``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, " "repetitive data usually yields a high compression ratio." msgstr "" -#: ../../library/bz2.rst:360 +#: ../../library/bz2.rst:362 msgid "Writing and reading a bzip2-compressed file in binary mode:" msgstr "" diff --git a/library/compression.zstd.po b/library/compression.zstd.po index c6dcd7a7a93..03ce8321f4b 100644 --- a/library/compression.zstd.po +++ b/library/compression.zstd.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-11-10 16:45+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,8 +19,7 @@ msgstr "" #: ../../library/compression.zstd.rst:2 msgid "" ":mod:`!compression.zstd` --- Compression compatible with the Zstandard format" -msgstr "" -":mod:`!compression.zstd` --- 與 Zstandard 格式相容的壓縮" +msgstr ":mod:`!compression.zstd` --- 與 Zstandard 格式相容的壓縮" #: ../../library/compression.zstd.rst:10 msgid "**Source code:** :source:`Lib/compression/zstd/__init__.py`" @@ -62,46 +61,53 @@ msgstr "" #: ../../library/compression.zstd.rst:31 msgid "" -"The :func:`train_dict` and :func:`finalize_dict` functions and " -"the :class:`ZstdDict` class to train and manage Zstandard dictionaries." +"The :func:`train_dict` and :func:`finalize_dict` functions and the :class:" +"`ZstdDict` class to train and manage Zstandard dictionaries." msgstr "" #: ../../library/compression.zstd.rst:33 msgid "" -"The :class:`CompressionParameter`, :class:`DecompressionParameter`, " -"and :class:`Strategy` classes for setting advanced (de)compression " -"parameters." +"The :class:`CompressionParameter`, :class:`DecompressionParameter`, and :" +"class:`Strategy` classes for setting advanced (de)compression parameters." +msgstr "" + +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." msgstr "" -#: ../../library/compression.zstd.rst:38 +#: ../../library/compression.zstd.rst:40 msgid "Exceptions" msgstr "例外" -#: ../../library/compression.zstd.rst:42 +#: ../../library/compression.zstd.rst:44 msgid "" "This exception is raised when an error occurs during compression or " "decompression, or while initializing the (de)compressor state." msgstr "" -#: ../../library/compression.zstd.rst:47 +#: ../../library/compression.zstd.rst:49 msgid "Reading and writing compressed files" msgstr "" -#: ../../library/compression.zstd.rst:52 +#: ../../library/compression.zstd.rst:54 msgid "" -"Open a Zstandard-compressed file in binary or text mode, returning " -"a :term:`file object`." +"Open a Zstandard-compressed file in binary or text mode, returning a :term:" +"`file object`." msgstr "" -#: ../../library/compression.zstd.rst:55 +#: ../../library/compression.zstd.rst:57 msgid "" -"The *file* argument can be either a file name (given as " -"a :class:`str`, :class:`bytes` or :term:`path-like ` " -"object), in which case the named file is opened, or it can be an existing " -"file object to read from or write to." +"The *file* argument can be either a file name (given as a :class:`str`, :" +"class:`bytes` or :term:`path-like ` object), in which case " +"the named file is opened, or it can be an existing file object to read from " +"or write to." msgstr "" -#: ../../library/compression.zstd.rst:60 +#: ../../library/compression.zstd.rst:62 msgid "" "The mode argument can be either ``'rb'`` for reading (default), ``'wb'`` for " "overwriting, ``'ab'`` for appending, or ``'xb'`` for exclusive creation. " @@ -110,54 +116,54 @@ msgid "" "``'at'``, and ``'xt'`` respectively." msgstr "" -#: ../../library/compression.zstd.rst:66 ../../library/compression.zstd.rst:110 +#: ../../library/compression.zstd.rst:68 ../../library/compression.zstd.rst:112 msgid "" "When reading, the *options* argument can be a dictionary providing advanced " "decompression parameters; see :class:`DecompressionParameter` for detailed " -"information about supported parameters. The *zstd_dict* argument is " -"a :class:`ZstdDict` instance to be used during decompression. When reading, " -"if the *level* argument is not None, a :exc:`!TypeError` will be raised." +"information about supported parameters. The *zstd_dict* argument is a :class:" +"`ZstdDict` instance to be used during decompression. When reading, if the " +"*level* argument is not None, a :exc:`!TypeError` will be raised." msgstr "" -#: ../../library/compression.zstd.rst:73 +#: ../../library/compression.zstd.rst:75 msgid "" "When writing, the *options* argument can be a dictionary providing advanced " "decompression 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:`ZstdDict` instance to be used during compression." +"or *options* may be non-None. The *zstd_dict* argument is a :class:" +"`ZstdDict` instance to be used during compression." msgstr "" -#: ../../library/compression.zstd.rst:81 +#: ../../library/compression.zstd.rst:83 msgid "" "In binary mode, this function is equivalent to the :class:`ZstdFile` " "constructor: ``ZstdFile(file, mode, ...)``. In this case, the *encoding*, " "*errors*, and *newline* parameters must not be provided." msgstr "" -#: ../../library/compression.zstd.rst:85 +#: ../../library/compression.zstd.rst:87 msgid "" -"In text mode, a :class:`ZstdFile` object is created, and wrapped in " -"an :class:`io.TextIOWrapper` instance with the specified encoding, error " +"In text mode, a :class:`ZstdFile` object is created, and wrapped in an :" +"class:`io.TextIOWrapper` instance with the specified encoding, error " "handling behavior, and line endings." msgstr "" -#: ../../library/compression.zstd.rst:93 +#: ../../library/compression.zstd.rst:95 msgid "Open a Zstandard-compressed file in binary mode." msgstr "" -#: ../../library/compression.zstd.rst:95 +#: ../../library/compression.zstd.rst:97 msgid "" "A :class:`ZstdFile` can wrap an already-open :term:`file object`, or operate " "directly on a named file. The *file* argument specifies either the file " -"object to wrap, or the name of the file to open (as " -"a :class:`str`, :class:`bytes` or :term:`path-like ` " -"object). If wrapping an existing file object, the wrapped file will not be " -"closed when the :class:`ZstdFile` is closed." +"object to wrap, or the name of the file to open (as a :class:`str`, :class:" +"`bytes` or :term:`path-like ` object). If wrapping an " +"existing file object, the wrapped file will not be closed when the :class:" +"`ZstdFile` is closed." msgstr "" -#: ../../library/compression.zstd.rst:102 +#: ../../library/compression.zstd.rst:104 msgid "" "The *mode* argument can be either ``'rb'`` for reading (default), ``'wb'`` " "for overwriting, ``'xb'`` for exclusive creation, or ``'ab'`` for appending. " @@ -165,13 +171,13 @@ msgid "" "respectively." msgstr "" -#: ../../library/compression.zstd.rst:107 +#: ../../library/compression.zstd.rst:109 msgid "" "If *file* is a file object (rather than an actual file name), a mode of " "``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." msgstr "" -#: ../../library/compression.zstd.rst:117 +#: ../../library/compression.zstd.rst:119 msgid "" "When writing, the *options* argument can be a dictionary providing advanced " "decompression parameters; see :class:`CompressionParameter` for detailed " @@ -181,89 +187,87 @@ msgid "" "instance to be used during compression." msgstr "" -#: ../../library/compression.zstd.rst:125 +#: ../../library/compression.zstd.rst:127 msgid "" -":class:`!ZstdFile` supports all the members specified " -"by :class:`io.BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` " -"and :meth:`~io.IOBase.truncate`. Iteration and the :keyword:`with` statement " -"are supported." +":class:`!ZstdFile` supports all the members specified by :class:`io." +"BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io." +"IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." msgstr "" -#: ../../library/compression.zstd.rst:130 +#: ../../library/compression.zstd.rst:132 msgid "The following method and attributes are also provided:" msgstr "" -#: ../../library/compression.zstd.rst:134 +#: ../../library/compression.zstd.rst:136 msgid "" "Return buffered data without advancing the file position. At least one byte " "of data will be returned, unless EOF has been reached. The exact number of " "bytes returned is unspecified (the *size* argument is ignored)." msgstr "" -#: ../../library/compression.zstd.rst:138 +#: ../../library/compression.zstd.rst:140 msgid "" -"While calling :meth:`peek` does not change the file position of " -"the :class:`ZstdFile`, it may change the position of the underlying file " -"object (for example, if the :class:`ZstdFile` was constructed by passing a " -"file object for *file*)." +"While calling :meth:`peek` does not change the file position of the :class:" +"`ZstdFile`, it may change the position of the underlying file object (for " +"example, if the :class:`ZstdFile` was constructed by passing a file object " +"for *file*)." msgstr "" -#: ../../library/compression.zstd.rst:145 +#: ../../library/compression.zstd.rst:147 msgid "``'rb'`` for reading and ``'wb'`` for writing." msgstr "" -#: ../../library/compression.zstd.rst:149 +#: ../../library/compression.zstd.rst:151 msgid "" "The name of the Zstandard file. Equivalent to the :attr:`~io.FileIO.name` " "attribute of the underlying :term:`file object`." msgstr "" -#: ../../library/compression.zstd.rst:154 +#: ../../library/compression.zstd.rst:156 msgid "Compressing and decompressing data in memory" msgstr "" -#: ../../library/compression.zstd.rst:158 +#: ../../library/compression.zstd.rst:160 msgid "" "Compress *data* (a :term:`bytes-like object`), returning the compressed data " "as a :class:`bytes` object." msgstr "" -#: ../../library/compression.zstd.rst:161 -#: ../../library/compression.zstd.rst:205 +#: ../../library/compression.zstd.rst:163 +#: ../../library/compression.zstd.rst:207 msgid "" "The *level* argument is an integer controlling the level of compression. " -"*level* is an alternative to " -"setting :attr:`CompressionParameter.compression_level` in *options*. " -"Use :meth:`~CompressionParameter.bounds` " +"*level* is an alternative to setting :attr:`CompressionParameter." +"compression_level` in *options*. Use :meth:`~CompressionParameter.bounds` " "on :attr:`~CompressionParameter.compression_level` to get the values that " "can be passed for *level*. If advanced compression options are needed, the " "*level* argument must be omitted and in the *options* dictionary the :attr:`!" "CompressionParameter.compression_level` parameter should be set." msgstr "" -#: ../../library/compression.zstd.rst:170 -#: ../../library/compression.zstd.rst:214 +#: ../../library/compression.zstd.rst:172 +#: ../../library/compression.zstd.rst:216 msgid "" "The *options* argument is a Python dictionary containing advanced " "compression parameters. The valid keys and values for compression parameters " "are documented as part of the :class:`CompressionParameter` documentation." msgstr "" -#: ../../library/compression.zstd.rst:174 +#: ../../library/compression.zstd.rst:176 msgid "" "The *zstd_dict* argument is an instance of :class:`ZstdDict` containing " -"trained data to improve compression efficiency. The " -"function :func:`train_dict` can be used to generate a Zstandard dictionary." +"trained data to improve compression efficiency. The function :func:" +"`train_dict` can be used to generate a Zstandard dictionary." msgstr "" -#: ../../library/compression.zstd.rst:181 +#: ../../library/compression.zstd.rst:183 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning the uncompressed " "data as a :class:`bytes` object." msgstr "" -#: ../../library/compression.zstd.rst:184 -#: ../../library/compression.zstd.rst:306 +#: ../../library/compression.zstd.rst:186 +#: ../../library/compression.zstd.rst:308 msgid "" "The *options* argument is a Python dictionary containing advanced " "decompression parameters. The valid keys and values for compression " @@ -271,39 +275,39 @@ msgid "" "documentation." msgstr "" -#: ../../library/compression.zstd.rst:189 -#: ../../library/compression.zstd.rst:311 +#: ../../library/compression.zstd.rst:191 +#: ../../library/compression.zstd.rst:313 msgid "" "The *zstd_dict* argument is an instance of :class:`ZstdDict` containing " "trained data used during compression. This must be the same Zstandard " "dictionary used during compression." msgstr "" -#: ../../library/compression.zstd.rst:193 +#: ../../library/compression.zstd.rst:195 msgid "" "If *data* is the concatenation of multiple distinct compressed frames, " "decompress all of these frames, and return the concatenation of the results." msgstr "" -#: ../../library/compression.zstd.rst:199 +#: ../../library/compression.zstd.rst:201 msgid "" "Create a compressor object, which can be used to compress data incrementally." msgstr "" -#: ../../library/compression.zstd.rst:202 +#: ../../library/compression.zstd.rst:204 msgid "" "For a more convenient way of compressing a single chunk of data, see the " "module-level function :func:`compress`." msgstr "" -#: ../../library/compression.zstd.rst:218 +#: ../../library/compression.zstd.rst:220 msgid "" "The *zstd_dict* argument is an optional instance of :class:`ZstdDict` " -"containing trained data to improve compression efficiency. The " -"function :func:`train_dict` can be used to generate a Zstandard dictionary." +"containing trained data to improve compression efficiency. The function :" +"func:`train_dict` can be used to generate a Zstandard dictionary." msgstr "" -#: ../../library/compression.zstd.rst:225 +#: ../../library/compression.zstd.rst:227 msgid "" "Compress *data* (a :term:`bytes-like object`), returning a :class:`bytes` " "object with compressed data if possible, or otherwise an empty :class:`!" @@ -312,13 +316,13 @@ msgid "" "concatenated with the output of any previous calls to :meth:`~.compress`." msgstr "" -#: ../../library/compression.zstd.rst:232 +#: ../../library/compression.zstd.rst:234 msgid "" -"The *mode* argument is a :class:`ZstdCompressor` attribute, " -"either :attr:`~.CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." +"The *mode* argument is a :class:`ZstdCompressor` attribute, either :attr:`~." +"CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." msgstr "" -#: ../../library/compression.zstd.rst:236 +#: ../../library/compression.zstd.rst:238 msgid "" "When all data has been provided to the compressor, call the :meth:`~.flush` " "method to finish the compression process. If :meth:`~.compress` is called " @@ -326,19 +330,19 @@ msgid "" "called, as it would write out a new empty frame." msgstr "" -#: ../../library/compression.zstd.rst:244 +#: ../../library/compression.zstd.rst:246 msgid "" "Finish the compression process, returning a :class:`bytes` object containing " "any data stored in the compressor's internal buffers." msgstr "" -#: ../../library/compression.zstd.rst:247 +#: ../../library/compression.zstd.rst:249 msgid "" -"The *mode* argument is a :class:`ZstdCompressor` attribute, " -"either :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." +"The *mode* argument is a :class:`ZstdCompressor` attribute, either :attr:`~." +"FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." msgstr "" -#: ../../library/compression.zstd.rst:252 +#: ../../library/compression.zstd.rst:254 msgid "" "Specify the amount of uncompressed data *size* that will be provided for the " "next frame. *size* will be written into the frame header of the next frame " @@ -349,7 +353,7 @@ msgid "" "compression levels." msgstr "" -#: ../../library/compression.zstd.rst:260 +#: ../../library/compression.zstd.rst:262 msgid "" "If :attr:`last_mode` is not :attr:`FLUSH_FRAME`, a :exc:`ValueError` is " "raised as the compressor is not at the start of a frame. If the pledged size " @@ -358,63 +362,63 @@ msgid "" "the last chunk of data may be lost." msgstr "" -#: ../../library/compression.zstd.rst:267 +#: ../../library/compression.zstd.rst:269 msgid "" -"After :meth:`flush` or :meth:`.compress` are called with " -"mode :attr:`FLUSH_FRAME`, the next frame will not include the frame size " -"into the header unless :meth:`!set_pledged_input_size` is called again." +"After :meth:`flush` or :meth:`.compress` are called with mode :attr:" +"`FLUSH_FRAME`, the next frame will not include the frame size into the " +"header unless :meth:`!set_pledged_input_size` is called again." msgstr "" -#: ../../library/compression.zstd.rst:273 +#: ../../library/compression.zstd.rst:275 msgid "" "Collect more data for compression, which may or may not generate output " "immediately. This mode optimizes the compression ratio by maximizing the " "amount of data per block and frame." msgstr "" -#: ../../library/compression.zstd.rst:279 +#: ../../library/compression.zstd.rst:281 msgid "" "Complete and write a block to the data stream. The data returned so far can " "be immediately decompressed. Past data can still be referenced in future " "blocks generated by calls to :meth:`~.compress`, improving compression." msgstr "" -#: ../../library/compression.zstd.rst:286 +#: ../../library/compression.zstd.rst:288 msgid "" "Complete and write out a frame. Future data provided to :meth:`~.compress` " "will be written into a new frame and *cannot* reference past data." msgstr "" -#: ../../library/compression.zstd.rst:292 +#: ../../library/compression.zstd.rst:294 msgid "" "The last mode passed to either :meth:`~.compress` or :meth:`~.flush`. The " -"value can be one of :attr:`~.CONTINUE`, :attr:`~.FLUSH_BLOCK`, " -"or :attr:`~.FLUSH_FRAME`. The initial value is :attr:`~.FLUSH_FRAME`, " -"signifying that the compressor is at the start of a new frame." +"value can be one of :attr:`~.CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~." +"FLUSH_FRAME`. The initial value is :attr:`~.FLUSH_FRAME`, signifying that " +"the compressor is at the start of a new frame." msgstr "" -#: ../../library/compression.zstd.rst:300 +#: ../../library/compression.zstd.rst:302 msgid "" "Create a decompressor object, which can be used to decompress data " "incrementally." msgstr "" -#: ../../library/compression.zstd.rst:303 +#: ../../library/compression.zstd.rst:305 msgid "" "For a more convenient way of decompressing an entire compressed stream at " "once, see the module-level function :func:`decompress`." msgstr "" -#: ../../library/compression.zstd.rst:316 +#: ../../library/compression.zstd.rst:318 msgid "" "This class does not transparently handle inputs containing multiple " -"compressed frames, unlike the :func:`decompress` function " -"and :class:`ZstdFile` class. To decompress a multi-frame input, you should " -"use :func:`decompress`, :class:`ZstdFile` if working with a :term:`file " -"object`, or multiple :class:`!ZstdDecompressor` instances." +"compressed frames, unlike the :func:`decompress` function and :class:" +"`ZstdFile` class. To decompress a multi-frame input, you should use :func:" +"`decompress`, :class:`ZstdFile` if working with a :term:`file object`, or " +"multiple :class:`!ZstdDecompressor` instances." msgstr "" -#: ../../library/compression.zstd.rst:324 +#: ../../library/compression.zstd.rst:326 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -422,7 +426,7 @@ msgid "" "output of any previous calls to :meth:`!decompress`." msgstr "" -#: ../../library/compression.zstd.rst:330 +#: ../../library/compression.zstd.rst:332 msgid "" "If *max_length* is non-negative, the method returns at most *max_length* " "bytes of decompressed data. If this limit is reached and further output can " @@ -431,43 +435,43 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: ../../library/compression.zstd.rst:337 +#: ../../library/compression.zstd.rst:339 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: ../../library/compression.zstd.rst:342 +#: ../../library/compression.zstd.rst:344 msgid "" -"Attempting to decompress data after the end of a frame will raise " -"a :exc:`ZstdError`. Any data found after the end of the frame is ignored and " -"saved in the :attr:`~.unused_data` attribute." +"Attempting to decompress data after the end of a frame will raise a :exc:" +"`ZstdError`. Any data found after the end of the frame is ignored and saved " +"in the :attr:`~.unused_data` attribute." msgstr "" -#: ../../library/compression.zstd.rst:348 +#: ../../library/compression.zstd.rst:350 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: ../../library/compression.zstd.rst:352 +#: ../../library/compression.zstd.rst:354 msgid "Data found after the end of the compressed stream." msgstr "" -#: ../../library/compression.zstd.rst:354 +#: ../../library/compression.zstd.rst:356 msgid "Before the end of the stream is reached, this will be ``b''``." msgstr "" -#: ../../library/compression.zstd.rst:358 +#: ../../library/compression.zstd.rst:360 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new compressed input." msgstr "" -#: ../../library/compression.zstd.rst:363 +#: ../../library/compression.zstd.rst:365 msgid "Zstandard dictionaries" msgstr "Zstandard 字典" -#: ../../library/compression.zstd.rst:368 +#: ../../library/compression.zstd.rst:370 msgid "" "Train a Zstandard dictionary, returning a :class:`ZstdDict` instance. " "Zstandard dictionaries enable more efficient compression of smaller sizes of " @@ -477,13 +481,13 @@ msgid "" "significantly." msgstr "" -#: ../../library/compression.zstd.rst:375 +#: ../../library/compression.zstd.rst:377 msgid "" "The *samples* argument (an iterable of :class:`bytes` objects), is the " "population of samples used to train the Zstandard dictionary." msgstr "" -#: ../../library/compression.zstd.rst:378 +#: ../../library/compression.zstd.rst:380 msgid "" "The *dict_size* argument, an integer, is the maximum size (in bytes) the " "Zstandard dictionary should be. The Zstandard documentation suggests an " @@ -493,7 +497,7 @@ msgid "" "faster compression, but reduce the compression ratio." msgstr "" -#: ../../library/compression.zstd.rst:388 +#: ../../library/compression.zstd.rst:390 msgid "" "An advanced function for converting a \"raw content\" Zstandard dictionary " "into a regular Zstandard dictionary. \"Raw content\" dictionaries are a " @@ -501,26 +505,26 @@ msgid "" "Zstandard dictionary." msgstr "" -#: ../../library/compression.zstd.rst:393 +#: ../../library/compression.zstd.rst:395 msgid "" -"The *zstd_dict* argument is a :class:`ZstdDict` instance with " -"the :attr:`~ZstdDict.dict_content` containing the raw dictionary contents." +"The *zstd_dict* argument is a :class:`ZstdDict` instance with the :attr:" +"`~ZstdDict.dict_content` containing the raw dictionary contents." msgstr "" -#: ../../library/compression.zstd.rst:396 +#: ../../library/compression.zstd.rst:398 msgid "" "The *samples* argument (an iterable of :class:`bytes` objects), contains " "sample data for generating the Zstandard dictionary." msgstr "" -#: ../../library/compression.zstd.rst:399 +#: ../../library/compression.zstd.rst:401 msgid "" "The *dict_size* argument, an integer, is the maximum size (in bytes) the " "Zstandard dictionary should be. See :func:`train_dict` for suggestions on " "the maximum dictionary size." msgstr "" -#: ../../library/compression.zstd.rst:403 +#: ../../library/compression.zstd.rst:405 msgid "" "The *level* argument (an integer) is the compression level expected to be " "passed to the compressors using this dictionary. The dictionary information " @@ -528,20 +532,20 @@ msgid "" "level can make compression more efficient." msgstr "" -#: ../../library/compression.zstd.rst:411 +#: ../../library/compression.zstd.rst:413 msgid "" "A wrapper around Zstandard dictionaries. Dictionaries can be used to improve " "the compression of many small chunks of data. Use :func:`train_dict` if you " "need to train a new dictionary from sample data." msgstr "" -#: ../../library/compression.zstd.rst:415 +#: ../../library/compression.zstd.rst:417 msgid "" "The *dict_content* argument (a :term:`bytes-like object`), is the already " "trained dictionary information." msgstr "" -#: ../../library/compression.zstd.rst:418 +#: ../../library/compression.zstd.rst:420 msgid "" "The *is_raw* argument, a boolean, is an advanced parameter controlling the " "meaning of *dict_content*. ``True`` means *dict_content* is a \"raw " @@ -551,7 +555,7 @@ msgid "" "CLI." msgstr "" -#: ../../library/compression.zstd.rst:424 +#: ../../library/compression.zstd.rst:426 msgid "" "When passing a :class:`!ZstdDict` to a function, the :attr:`!" "as_digested_dict` and :attr:`!as_undigested_dict` attributes can control how " @@ -563,25 +567,25 @@ msgid "" "dictionary." msgstr "" -#: ../../library/compression.zstd.rst:433 +#: ../../library/compression.zstd.rst:435 msgid "Difference for compression" msgstr "" -#: ../../library/compression.zstd.rst:438 +#: ../../library/compression.zstd.rst:440 msgid "Digested dictionary" msgstr "" -#: ../../library/compression.zstd.rst:439 +#: ../../library/compression.zstd.rst:441 msgid "Undigested dictionary" msgstr "" -#: ../../library/compression.zstd.rst:440 +#: ../../library/compression.zstd.rst:442 msgid "" "Advanced parameters of the compressor which may be overridden by the " "dictionary's parameters" msgstr "" -#: ../../library/compression.zstd.rst:442 +#: ../../library/compression.zstd.rst:444 msgid "" "``window_log``, ``hash_log``, ``chain_log``, ``search_log``, ``min_match``, " "``target_length``, ``strategy``, ``enable_long_distance_matching``, " @@ -589,134 +593,134 @@ msgid "" "``ldm_hash_rate_log``, and some non-public parameters." msgstr "" -#: ../../library/compression.zstd.rst:447 +#: ../../library/compression.zstd.rst:449 msgid "None" msgstr "" -#: ../../library/compression.zstd.rst:448 +#: ../../library/compression.zstd.rst:450 msgid ":class:`!ZstdDict` internally caches the dictionary" msgstr "" -#: ../../library/compression.zstd.rst:449 +#: ../../library/compression.zstd.rst:451 msgid "" "Yes. It's faster when loading a digested dictionary again with the same " "compression level." msgstr "" -#: ../../library/compression.zstd.rst:451 +#: ../../library/compression.zstd.rst:453 msgid "" "No. If you wish to load an undigested dictionary multiple times, consider " "reusing a compressor object." msgstr "" -#: ../../library/compression.zstd.rst:454 +#: ../../library/compression.zstd.rst:456 msgid "" "If passing a :class:`!ZstdDict` without any attribute, an undigested " "dictionary is passed by default when compressing and a digested dictionary " "is generated if necessary and passed by default when decompressing." msgstr "" -#: ../../library/compression.zstd.rst:460 +#: ../../library/compression.zstd.rst:462 msgid "" "The content of the Zstandard dictionary, a ``bytes`` object. It's the same " "as the *dict_content* argument in the ``__init__`` method. It can be used " "with other programs, such as the ``zstd`` CLI program." msgstr "" -#: ../../library/compression.zstd.rst:466 +#: ../../library/compression.zstd.rst:468 msgid "Identifier of the Zstandard dictionary, a non-negative int value." msgstr "" -#: ../../library/compression.zstd.rst:468 +#: ../../library/compression.zstd.rst:470 msgid "" "Non-zero means the dictionary is ordinary, created by Zstandard functions " "and following the Zstandard format." msgstr "" -#: ../../library/compression.zstd.rst:471 +#: ../../library/compression.zstd.rst:473 msgid "" "``0`` means a \"raw content\" dictionary, free of any format restriction, " "used for advanced users." msgstr "" -#: ../../library/compression.zstd.rst:476 +#: ../../library/compression.zstd.rst:478 msgid "" "The meaning of ``0`` for :attr:`!ZstdDict.dict_id` is different from the " "``dictionary_id`` attribute to the :func:`get_frame_info` function." msgstr "" -#: ../../library/compression.zstd.rst:482 +#: ../../library/compression.zstd.rst:484 msgid "Load as a digested dictionary." msgstr "" -#: ../../library/compression.zstd.rst:486 +#: ../../library/compression.zstd.rst:488 msgid "Load as an undigested dictionary." msgstr "" -#: ../../library/compression.zstd.rst:490 +#: ../../library/compression.zstd.rst:492 msgid "Advanced parameter control" msgstr "" -#: ../../library/compression.zstd.rst:494 +#: ../../library/compression.zstd.rst:496 msgid "" "An :class:`~enum.IntEnum` containing the advanced compression parameter keys " "that can be used when compressing data." msgstr "" -#: ../../library/compression.zstd.rst:497 -#: ../../library/compression.zstd.rst:731 +#: ../../library/compression.zstd.rst:499 +#: ../../library/compression.zstd.rst:733 msgid "" "The :meth:`~.bounds` method can be used on any attribute to get the valid " "values for that parameter." msgstr "" -#: ../../library/compression.zstd.rst:500 +#: ../../library/compression.zstd.rst:502 msgid "" "Parameters are optional; any omitted parameter will have it's value selected " "automatically." msgstr "" -#: ../../library/compression.zstd.rst:503 +#: ../../library/compression.zstd.rst:505 msgid "" "Example getting the lower and upper bound of :attr:`~.compression_level`::" msgstr "" -#: ../../library/compression.zstd.rst:505 +#: ../../library/compression.zstd.rst:507 msgid "lower, upper = CompressionParameter.compression_level.bounds()" msgstr "" -#: ../../library/compression.zstd.rst:507 +#: ../../library/compression.zstd.rst:509 msgid "Example setting the :attr:`~.window_log` to the maximum size::" msgstr "" -#: ../../library/compression.zstd.rst:509 +#: ../../library/compression.zstd.rst:511 msgid "" "_lower, upper = CompressionParameter.window_log.bounds()\n" "options = {CompressionParameter.window_log: upper}\n" "compress(b'venezuelan beaver cheese', options=options)" msgstr "" -#: ../../library/compression.zstd.rst:515 +#: ../../library/compression.zstd.rst:517 msgid "" "Return the tuple of int bounds, ``(lower, upper)``, of a compression " "parameter. This method should be called on the attribute you wish to " -"retrieve the bounds of. For example, to get the valid values " -"for :attr:`~.compression_level`, one may check the result of " -"``CompressionParameter.compression_level.bounds()``." +"retrieve the bounds of. For example, to get the valid values for :attr:`~." +"compression_level`, one may check the result of ``CompressionParameter." +"compression_level.bounds()``." msgstr "" -#: ../../library/compression.zstd.rst:521 -#: ../../library/compression.zstd.rst:749 +#: ../../library/compression.zstd.rst:523 +#: ../../library/compression.zstd.rst:751 msgid "Both the lower and upper bounds are inclusive." msgstr "" -#: ../../library/compression.zstd.rst:525 +#: ../../library/compression.zstd.rst:527 msgid "" "A high-level means of setting other compression parameters that affect the " "speed and ratio of compressing data." msgstr "" -#: ../../library/compression.zstd.rst:528 +#: ../../library/compression.zstd.rst:530 msgid "" "Regular compression levels are greater than ``0``. Values greater than " "``20`` are considered \"ultra\" compression and require more memory than " @@ -724,11 +728,11 @@ msgid "" "for worse compression ratios." msgstr "" -#: ../../library/compression.zstd.rst:533 +#: ../../library/compression.zstd.rst:535 msgid "Setting the level to zero uses :attr:`COMPRESSION_LEVEL_DEFAULT`." msgstr "" -#: ../../library/compression.zstd.rst:537 +#: ../../library/compression.zstd.rst:539 msgid "" "Maximum allowed back-reference distance the compressor can use when " "compressing data, expressed as power of two, ``1 << window_log`` bytes. This " @@ -736,22 +740,22 @@ msgid "" "require more memory but gain better compression values." msgstr "" -#: ../../library/compression.zstd.rst:542 -#: ../../library/compression.zstd.rst:551 -#: ../../library/compression.zstd.rst:562 -#: ../../library/compression.zstd.rst:570 -#: ../../library/compression.zstd.rst:581 -#: ../../library/compression.zstd.rst:596 -#: ../../library/compression.zstd.rst:627 -#: ../../library/compression.zstd.rst:634 -#: ../../library/compression.zstd.rst:642 -#: ../../library/compression.zstd.rst:650 -#: ../../library/compression.zstd.rst:709 -#: ../../library/compression.zstd.rst:758 +#: ../../library/compression.zstd.rst:544 +#: ../../library/compression.zstd.rst:553 +#: ../../library/compression.zstd.rst:564 +#: ../../library/compression.zstd.rst:572 +#: ../../library/compression.zstd.rst:583 +#: ../../library/compression.zstd.rst:598 +#: ../../library/compression.zstd.rst:629 +#: ../../library/compression.zstd.rst:636 +#: ../../library/compression.zstd.rst:644 +#: ../../library/compression.zstd.rst:652 +#: ../../library/compression.zstd.rst:711 +#: ../../library/compression.zstd.rst:760 msgid "A value of zero causes the value to be selected automatically." msgstr "" -#: ../../library/compression.zstd.rst:546 +#: ../../library/compression.zstd.rst:548 msgid "" "Size of the initial probe table, as a power of two. The resulting memory " "usage is ``1 << (hash_log+2)`` bytes. Larger tables improve compression " @@ -759,24 +763,23 @@ msgid "" "speed of strategies > :attr:`~Strategy.dfast`." msgstr "" -#: ../../library/compression.zstd.rst:555 +#: ../../library/compression.zstd.rst:557 msgid "" "Size of the multi-probe search table, as a power of two. The resulting " "memory usage is ``1 << (chain_log+2)`` bytes. Larger tables result in better " -"and slower compression. This parameter has no effect for " -"the :attr:`~Strategy.fast` strategy. It's still useful when " -"using :attr:`~Strategy.dfast` strategy, in which case it defines a secondary " -"probe table." +"and slower compression. This parameter has no effect for the :attr:" +"`~Strategy.fast` strategy. It's still useful when using :attr:`~Strategy." +"dfast` strategy, in which case it defines a secondary probe table." msgstr "" -#: ../../library/compression.zstd.rst:566 +#: ../../library/compression.zstd.rst:568 msgid "" "Number of search attempts, as a power of two. More attempts result in better " "and slower compression. This parameter is useless for :attr:`~Strategy.fast` " "and :attr:`~Strategy.dfast` strategies." msgstr "" -#: ../../library/compression.zstd.rst:574 +#: ../../library/compression.zstd.rst:576 msgid "" "Minimum size of searched matches. Larger values increase compression and " "decompression speed, but decrease ratio. Note that Zstandard can still find " @@ -786,172 +789,171 @@ msgid "" "effective maximum is ``6``." msgstr "" -#: ../../library/compression.zstd.rst:585 +#: ../../library/compression.zstd.rst:587 msgid "The impact of this field depends on the selected :class:`Strategy`." msgstr "" -#: ../../library/compression.zstd.rst:587 +#: ../../library/compression.zstd.rst:589 msgid "" -"For strategies :attr:`~Strategy.btopt`, :attr:`~Strategy.btultra` " -"and :attr:`~Strategy.btultra2`, the value is the length of a match " -"considered \"good enough\" to stop searching. Larger values make compression " -"ratios better, but compresses slower." +"For strategies :attr:`~Strategy.btopt`, :attr:`~Strategy.btultra` and :attr:" +"`~Strategy.btultra2`, the value is the length of a match considered \"good " +"enough\" to stop searching. Larger values make compression ratios better, " +"but compresses slower." msgstr "" -#: ../../library/compression.zstd.rst:592 +#: ../../library/compression.zstd.rst:594 msgid "" "For strategy :attr:`~Strategy.fast`, it is the distance between match " "sampling. Larger values make compression faster, but with a worse " "compression ratio." msgstr "" -#: ../../library/compression.zstd.rst:600 +#: ../../library/compression.zstd.rst:602 msgid "" "The higher the value of selected strategy, the more complex the compression " "technique used by zstd, resulting in higher compression ratios but slower " "compression." msgstr "" -#: ../../library/compression.zstd.rst:604 +#: ../../library/compression.zstd.rst:606 msgid ":class:`Strategy`" msgstr ":class:`Strategy`" -#: ../../library/compression.zstd.rst:608 +#: ../../library/compression.zstd.rst:610 msgid "" "Long distance matching can be used to improve compression for large inputs " "by finding large matches at greater distances. It increases memory usage and " "window size." msgstr "" -#: ../../library/compression.zstd.rst:612 +#: ../../library/compression.zstd.rst:614 msgid "" "``True`` or ``1`` enable long distance matching while ``False`` or ``0`` " "disable it." msgstr "" -#: ../../library/compression.zstd.rst:615 +#: ../../library/compression.zstd.rst:617 msgid "" -"Enabling this parameter increases " -"default :attr:`~CompressionParameter.window_log` to 128 MiB except when " -"expressly set to a different value. This setting is enabled by default " -"if :attr:`!window_log` >= 128 MiB and the compression strategy " -">= :attr:`~Strategy.btopt` (compression level 16+)." +"Enabling this parameter increases default :attr:`~CompressionParameter." +"window_log` to 128 MiB except when expressly set to a different value. This " +"setting is enabled by default if :attr:`!window_log` >= 128 MiB and the " +"compression strategy >= :attr:`~Strategy.btopt` (compression level 16+)." msgstr "" -#: ../../library/compression.zstd.rst:623 +#: ../../library/compression.zstd.rst:625 msgid "" "Size of the table for long distance matching, as a power of two. Larger " "values increase memory usage and compression ratio, but decrease compression " "speed." msgstr "" -#: ../../library/compression.zstd.rst:631 +#: ../../library/compression.zstd.rst:633 msgid "" "Minimum match size for long distance matcher. Larger or too small values can " "often decrease the compression ratio." msgstr "" -#: ../../library/compression.zstd.rst:638 +#: ../../library/compression.zstd.rst:640 msgid "" "Log size of each bucket in the long distance matcher hash table for " "collision resolution. Larger values improve collision resolution but " "decrease compression speed." msgstr "" -#: ../../library/compression.zstd.rst:646 +#: ../../library/compression.zstd.rst:648 msgid "" "Frequency of inserting/looking up entries into the long distance matcher " "hash table. Larger values improve compression speed. Deviating far from the " "default value will likely result in a compression ratio decrease." msgstr "" -#: ../../library/compression.zstd.rst:654 +#: ../../library/compression.zstd.rst:656 msgid "" "Write the size of the data to be compressed into the Zstandard frame header " "when known prior to compressing." msgstr "" -#: ../../library/compression.zstd.rst:657 +#: ../../library/compression.zstd.rst:659 msgid "This flag only takes effect under the following scenarios:" msgstr "" -#: ../../library/compression.zstd.rst:659 +#: ../../library/compression.zstd.rst:661 msgid "Calling :func:`compress` for one-shot compression" msgstr "" -#: ../../library/compression.zstd.rst:660 +#: ../../library/compression.zstd.rst:662 msgid "" -"Providing all of the data to be compressed in the frame in a " -"single :meth:`ZstdCompressor.compress` call, with " -"the :attr:`ZstdCompressor.FLUSH_FRAME` mode." +"Providing all of the data to be compressed in the frame in a single :meth:" +"`ZstdCompressor.compress` call, with the :attr:`ZstdCompressor.FLUSH_FRAME` " +"mode." msgstr "" -#: ../../library/compression.zstd.rst:663 +#: ../../library/compression.zstd.rst:665 msgid "" "Calling :meth:`ZstdCompressor.set_pledged_input_size` with the exact amount " -"of data that will be provided to the compressor prior to any calls " -"to :meth:`ZstdCompressor.compress` for the current frame. :meth:`!" -"ZstdCompressor.set_pledged_input_size` must be called for each new frame." +"of data that will be provided to the compressor prior to any calls to :meth:" +"`ZstdCompressor.compress` for the current frame. :meth:`!ZstdCompressor." +"set_pledged_input_size` must be called for each new frame." msgstr "" -#: ../../library/compression.zstd.rst:669 +#: ../../library/compression.zstd.rst:671 msgid "" "All other compression calls may not write the size information into the " "frame header." msgstr "" -#: ../../library/compression.zstd.rst:672 +#: ../../library/compression.zstd.rst:674 msgid "" "``True`` or ``1`` enable the content size flag while ``False`` or ``0`` " "disable it." msgstr "" -#: ../../library/compression.zstd.rst:677 +#: ../../library/compression.zstd.rst:679 msgid "" "A four-byte checksum using XXHash64 of the uncompressed content is written " "at the end of each frame. Zstandard's decompression code verifies the " "checksum. If there is a mismatch a :class:`ZstdError` exception is raised." msgstr "" -#: ../../library/compression.zstd.rst:682 +#: ../../library/compression.zstd.rst:684 msgid "" "``True`` or ``1`` enable checksum generation while ``False`` or ``0`` " "disable it." msgstr "" -#: ../../library/compression.zstd.rst:687 +#: ../../library/compression.zstd.rst:689 msgid "" "When compressing with a :class:`ZstdDict`, the dictionary's ID is written " "into the frame header." msgstr "" -#: ../../library/compression.zstd.rst:690 +#: ../../library/compression.zstd.rst:692 msgid "" "``True`` or ``1`` enable storing the dictionary ID while ``False`` or ``0`` " "disable it." msgstr "" -#: ../../library/compression.zstd.rst:695 +#: ../../library/compression.zstd.rst:697 msgid "" -"Select how many threads will be spawned to compress in parallel. " -"When :attr:`!nb_workers` > 0, enables multi-threaded compression, a value of " -"``1`` means \"one-thread multi-threaded mode\". More workers improve speed, " -"but also increase memory usage and slightly reduce compression ratio." +"Select how many threads will be spawned to compress in parallel. When :attr:" +"`!nb_workers` > 0, enables multi-threaded compression, a value of ``1`` " +"means \"one-thread multi-threaded mode\". More workers improve speed, but " +"also increase memory usage and slightly reduce compression ratio." msgstr "" -#: ../../library/compression.zstd.rst:700 +#: ../../library/compression.zstd.rst:702 msgid "A value of zero disables multi-threading." msgstr "" -#: ../../library/compression.zstd.rst:704 +#: ../../library/compression.zstd.rst:706 msgid "" -"Size of a compression job, in bytes. This value is enforced only " -"when :attr:`~CompressionParameter.nb_workers` >= 1. Each compression job is " -"completed in parallel, so this value can indirectly impact the number of " -"active threads." +"Size of a compression job, in bytes. This value is enforced only when :attr:" +"`~CompressionParameter.nb_workers` >= 1. Each compression job is completed " +"in parallel, so this value can indirectly impact the number of active " +"threads." msgstr "" -#: ../../library/compression.zstd.rst:713 +#: ../../library/compression.zstd.rst:715 msgid "" "Sets how much data is reloaded from previous jobs (threads) for new jobs to " "be used by the look behind window during compression. This value is only " @@ -959,36 +961,36 @@ msgid "" "vary from 0 to 9." msgstr "" -#: ../../library/compression.zstd.rst:718 +#: ../../library/compression.zstd.rst:720 msgid "0 means dynamically set the overlap amount" msgstr "" -#: ../../library/compression.zstd.rst:719 +#: ../../library/compression.zstd.rst:721 msgid "1 means no overlap" msgstr "" -#: ../../library/compression.zstd.rst:720 +#: ../../library/compression.zstd.rst:722 msgid "9 means use a full window size from the previous job" msgstr "" -#: ../../library/compression.zstd.rst:722 +#: ../../library/compression.zstd.rst:724 msgid "" "Each increment halves/doubles the overlap size. \"8\" means an overlap of " "``window_size/2``, \"7\" means an overlap of ``window_size/4``, etc." msgstr "" -#: ../../library/compression.zstd.rst:727 +#: ../../library/compression.zstd.rst:729 msgid "" "An :class:`~enum.IntEnum` containing the advanced decompression parameter " "keys that can be used when decompressing data. Parameters are optional; any " "omitted parameter will have it's value selected automatically." msgstr "" -#: ../../library/compression.zstd.rst:734 +#: ../../library/compression.zstd.rst:736 msgid "Example setting the :attr:`~.window_log_max` to the maximum size::" msgstr "" -#: ../../library/compression.zstd.rst:736 +#: ../../library/compression.zstd.rst:738 msgid "" "data = compress(b'Some very long buffer of bytes...')\n" "\n" @@ -1004,14 +1006,14 @@ msgstr "" "options = {DecompressionParameter.window_log_max: upper}\n" "decompress(data, options=options)" -#: ../../library/compression.zstd.rst:745 +#: ../../library/compression.zstd.rst:747 msgid "" "Return the tuple of int bounds, ``(lower, upper)``, of a decompression " "parameter. This method should be called on the attribute you wish to " "retrieve the bounds of." msgstr "" -#: ../../library/compression.zstd.rst:753 +#: ../../library/compression.zstd.rst:755 msgid "" "The base-two logarithm of the maximum size of the window used during " "decompression. This can be useful to limit the amount of memory used when " @@ -1019,42 +1021,42 @@ msgid "" "decompression." msgstr "" -#: ../../library/compression.zstd.rst:763 +#: ../../library/compression.zstd.rst:765 msgid "" "An :class:`~enum.IntEnum` containing strategies for compression. Higher-" "numbered strategies correspond to more complex and slower compression." msgstr "" -#: ../../library/compression.zstd.rst:769 +#: ../../library/compression.zstd.rst:771 msgid "" "The values of attributes of :class:`!Strategy` are not necessarily stable " "across zstd versions. Only the ordering of the attributes may be relied " "upon. The attributes are listed below in order." msgstr "" -#: ../../library/compression.zstd.rst:773 +#: ../../library/compression.zstd.rst:775 msgid "The following strategies are available:" msgstr "" -#: ../../library/compression.zstd.rst:795 +#: ../../library/compression.zstd.rst:797 msgid "Miscellaneous" msgstr "" -#: ../../library/compression.zstd.rst:799 +#: ../../library/compression.zstd.rst:801 msgid "" "Retrieve a :class:`FrameInfo` object containing metadata about a Zstandard " "frame. Frames contain metadata related to the compressed data they hold." msgstr "" -#: ../../library/compression.zstd.rst:805 +#: ../../library/compression.zstd.rst:807 msgid "Metadata related to a Zstandard frame." msgstr "" -#: ../../library/compression.zstd.rst:809 +#: ../../library/compression.zstd.rst:811 msgid "The size of the decompressed contents of the frame." msgstr "" -#: ../../library/compression.zstd.rst:813 +#: ../../library/compression.zstd.rst:815 msgid "" "An integer representing the Zstandard dictionary ID needed for decompressing " "the frame. ``0`` means the dictionary ID was not recorded in the frame " @@ -1062,25 +1064,25 @@ msgid "" "ID of a required dictionary was not recorded." msgstr "" -#: ../../library/compression.zstd.rst:821 +#: ../../library/compression.zstd.rst:823 msgid "The default compression level for Zstandard: ``3``." msgstr "" -#: ../../library/compression.zstd.rst:826 +#: ../../library/compression.zstd.rst:828 msgid "" "Version number of the runtime zstd library as a tuple of integers (major, " "minor, release)." msgstr "" -#: ../../library/compression.zstd.rst:831 +#: ../../library/compression.zstd.rst:833 msgid "Examples" msgstr "範例" -#: ../../library/compression.zstd.rst:833 +#: ../../library/compression.zstd.rst:835 msgid "Reading in a compressed file:" msgstr "讀取壓縮檔案:" -#: ../../library/compression.zstd.rst:835 +#: ../../library/compression.zstd.rst:837 msgid "" "from compression import zstd\n" "\n" @@ -1092,11 +1094,11 @@ msgstr "" "with zstd.open(\"file.zst\") as f:\n" " file_content = f.read()" -#: ../../library/compression.zstd.rst:842 +#: ../../library/compression.zstd.rst:844 msgid "Creating a compressed file:" msgstr "" -#: ../../library/compression.zstd.rst:844 +#: ../../library/compression.zstd.rst:846 msgid "" "from compression import zstd\n" "\n" @@ -1110,11 +1112,11 @@ msgstr "" "with zstd.open(\"file.zst\", \"w\") as f:\n" " f.write(data)" -#: ../../library/compression.zstd.rst:852 +#: ../../library/compression.zstd.rst:854 msgid "Compressing data in memory:" msgstr "" -#: ../../library/compression.zstd.rst:854 +#: ../../library/compression.zstd.rst:856 msgid "" "from compression import zstd\n" "\n" @@ -1126,11 +1128,11 @@ msgstr "" "data_in = b\"Insert Data Here\"\n" "data_out = zstd.compress(data_in)" -#: ../../library/compression.zstd.rst:861 +#: ../../library/compression.zstd.rst:863 msgid "Incremental compression:" msgstr "" -#: ../../library/compression.zstd.rst:863 +#: ../../library/compression.zstd.rst:865 msgid "" "from compression import zstd\n" "\n" @@ -1152,11 +1154,11 @@ msgstr "" "# Concatenate all the partial results:\n" "result = b\"\".join([out1, out2, out3, out4])" -#: ../../library/compression.zstd.rst:875 +#: ../../library/compression.zstd.rst:877 msgid "Writing compressed data to an already-open file:" msgstr "" -#: ../../library/compression.zstd.rst:877 +#: ../../library/compression.zstd.rst:879 msgid "" "from compression import zstd\n" "\n" @@ -1174,11 +1176,11 @@ msgstr "" " zstf.write(b\"This *will* be compressed\\n\")\n" " f.write(b\"Not compressed\\n\")" -#: ../../library/compression.zstd.rst:887 +#: ../../library/compression.zstd.rst:889 msgid "Creating a compressed file using compression parameters:" msgstr "" -#: ../../library/compression.zstd.rst:889 +#: ../../library/compression.zstd.rst:891 msgid "" "from compression import zstd\n" "\n" diff --git a/library/ctypes.po b/library/ctypes.po index 6098fb15ff9..4c5f26f403b 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -6,7 +6,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-11-10 16:45+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,18 +33,26 @@ msgid "" "libraries. It can be used to wrap these libraries in pure Python." msgstr "" -#: ../../library/ctypes.rst:21 +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/ctypes.rst:23 msgid "ctypes tutorial" msgstr "ctypes 教學" -#: ../../library/ctypes.rst:23 +#: ../../library/ctypes.rst:25 msgid "" "Note: The code samples in this tutorial use :mod:`doctest` to make sure that " "they actually work. Since some code samples behave differently under Linux, " "Windows, or macOS, they contain doctest directives in comments." msgstr "" -#: ../../library/ctypes.rst:27 +#: ../../library/ctypes.rst:29 msgid "" "Note: Some code samples reference the ctypes :class:`c_int` type. On " "platforms where ``sizeof(long) == sizeof(int)`` it is an alias to :class:" @@ -52,17 +60,17 @@ msgid "" "you would expect :class:`c_int` --- they are actually the same type." msgstr "" -#: ../../library/ctypes.rst:35 +#: ../../library/ctypes.rst:37 msgid "Loading dynamic link libraries" msgstr "" -#: ../../library/ctypes.rst:37 +#: ../../library/ctypes.rst:39 msgid "" ":mod:`ctypes` exports the *cdll*, and on Windows *windll* and *oledll* " "objects, for loading dynamic link libraries." msgstr "" -#: ../../library/ctypes.rst:40 +#: ../../library/ctypes.rst:42 msgid "" "You load libraries by accessing them as attributes of these objects. *cdll* " "loads libraries which export functions using the standard ``cdecl`` calling " @@ -73,20 +81,20 @@ msgid "" "when the function call fails." msgstr "" -#: ../../library/ctypes.rst:48 +#: ../../library/ctypes.rst:50 msgid "" "Windows errors used to raise :exc:`WindowsError`, which is now an alias of :" "exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:53 +#: ../../library/ctypes.rst:55 msgid "" "Here are some examples for Windows. Note that ``msvcrt`` is the MS standard " "C library containing most standard C functions, and uses the ``cdecl`` " "calling convention::" msgstr "" -#: ../../library/ctypes.rst:57 +#: ../../library/ctypes.rst:59 msgid "" ">>> from ctypes import *\n" ">>> print(windll.kernel32)\n" @@ -104,11 +112,11 @@ msgstr "" ">>> libc = cdll.msvcrt\n" ">>>" -#: ../../library/ctypes.rst:65 +#: ../../library/ctypes.rst:67 msgid "Windows appends the usual ``.dll`` file suffix automatically." msgstr "" -#: ../../library/ctypes.rst:68 +#: ../../library/ctypes.rst:70 msgid "" "Accessing the standard C library through ``cdll.msvcrt`` will use an " "outdated version of the library that may be incompatible with the one being " @@ -116,7 +124,7 @@ msgid "" "import and use the ``msvcrt`` module." msgstr "" -#: ../../library/ctypes.rst:73 +#: ../../library/ctypes.rst:75 msgid "" "On Linux, it is required to specify the filename *including* the extension " "to load a library, so attribute access can not be used to load libraries. " @@ -125,7 +133,7 @@ msgid "" "CDLL by calling the constructor::" msgstr "" -#: ../../library/ctypes.rst:79 +#: ../../library/ctypes.rst:81 msgid "" ">>> cdll.LoadLibrary(\"libc.so.6\")\n" "\n" @@ -141,15 +149,15 @@ msgstr "" "\n" ">>>" -#: ../../library/ctypes.rst:92 +#: ../../library/ctypes.rst:94 msgid "Accessing functions from loaded dlls" msgstr "" -#: ../../library/ctypes.rst:94 +#: ../../library/ctypes.rst:96 msgid "Functions are accessed as attributes of dll objects::" msgstr "" -#: ../../library/ctypes.rst:96 +#: ../../library/ctypes.rst:98 msgid "" ">>> libc.printf\n" "<_FuncPtr object at 0x...>\n" @@ -175,7 +183,7 @@ msgstr "" "AttributeError: function 'MyOwnFunction' not found\n" ">>>" -#: ../../library/ctypes.rst:108 +#: ../../library/ctypes.rst:110 msgid "" "Note that win32 system dlls like ``kernel32`` and ``user32`` often export " "ANSI as well as UNICODE versions of a function. The UNICODE version is " @@ -186,7 +194,7 @@ msgid "" "``GetModuleHandle`` depending on whether UNICODE is defined or not::" msgstr "" -#: ../../library/ctypes.rst:116 +#: ../../library/ctypes.rst:118 msgid "" "/* ANSI version */\n" "HMODULE GetModuleHandleA(LPCSTR lpModuleName);\n" @@ -198,21 +206,21 @@ msgstr "" "/* UNICODE 版本 */\n" "HMODULE GetModuleHandleW(LPCWSTR lpModuleName);" -#: ../../library/ctypes.rst:121 +#: ../../library/ctypes.rst:123 msgid "" "*windll* does not try to select one of them by magic, you must access the " "version you need by specifying ``GetModuleHandleA`` or ``GetModuleHandleW`` " "explicitly, and then call it with bytes or string objects respectively." msgstr "" -#: ../../library/ctypes.rst:125 +#: ../../library/ctypes.rst:127 msgid "" "Sometimes, dlls export functions with names which aren't valid Python " "identifiers, like ``\"??2@YAPAXI@Z\"``. In this case you have to use :func:" "`getattr` to retrieve the function::" msgstr "" -#: ../../library/ctypes.rst:129 +#: ../../library/ctypes.rst:131 msgid "" ">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\")\n" "<_FuncPtr object at 0x...>\n" @@ -222,14 +230,14 @@ msgstr "" "<_FuncPtr object at 0x...>\n" ">>>" -#: ../../library/ctypes.rst:133 +#: ../../library/ctypes.rst:135 msgid "" "On Windows, some dlls export functions not by name but by ordinal. These " "functions can be accessed by indexing the dll object with the ordinal " "number::" msgstr "" -#: ../../library/ctypes.rst:136 +#: ../../library/ctypes.rst:138 msgid "" ">>> cdll.kernel32[1]\n" "<_FuncPtr object at 0x...>\n" @@ -251,18 +259,18 @@ msgstr "" "AttributeError: function ordinal 0 not found\n" ">>>" -#: ../../library/ctypes.rst:150 +#: ../../library/ctypes.rst:152 msgid "Calling functions" msgstr "呼叫函式" -#: ../../library/ctypes.rst:152 +#: ../../library/ctypes.rst:154 msgid "" "You can call these functions like any other Python callable. This example " "uses the ``rand()`` function, which takes no arguments and returns a pseudo-" "random integer::" msgstr "" -#: ../../library/ctypes.rst:155 +#: ../../library/ctypes.rst:157 msgid "" ">>> print(libc.rand())\n" "1804289383" @@ -270,14 +278,14 @@ msgstr "" ">>> print(libc.rand())\n" "1804289383" -#: ../../library/ctypes.rst:158 +#: ../../library/ctypes.rst:160 msgid "" "On Windows, you can call the ``GetModuleHandleA()`` function, which returns " "a win32 module handle (passing ``None`` as single argument to call it with a " "``NULL`` pointer)::" msgstr "" -#: ../../library/ctypes.rst:161 +#: ../../library/ctypes.rst:163 msgid "" ">>> print(hex(windll.kernel32.GetModuleHandleA(None)))\n" "0x1d000000\n" @@ -287,13 +295,13 @@ msgstr "" "0x1d000000\n" ">>>" -#: ../../library/ctypes.rst:165 +#: ../../library/ctypes.rst:167 msgid "" ":exc:`ValueError` is raised when you call an ``stdcall`` function with the " "``cdecl`` calling convention, or vice versa::" msgstr "" -#: ../../library/ctypes.rst:168 +#: ../../library/ctypes.rst:170 msgid "" ">>> cdll.kernel32.GetModuleHandleA(None)\n" "Traceback (most recent call last):\n" @@ -323,20 +331,20 @@ msgstr "" "excess)\n" ">>>" -#: ../../library/ctypes.rst:180 +#: ../../library/ctypes.rst:182 msgid "" "To find out the correct calling convention you have to look into the C " "header file or the documentation for the function you want to call." msgstr "" -#: ../../library/ctypes.rst:183 +#: ../../library/ctypes.rst:185 msgid "" "On Windows, :mod:`ctypes` uses win32 structured exception handling to " "prevent crashes from general protection faults when functions are called " "with invalid argument values::" msgstr "" -#: ../../library/ctypes.rst:187 +#: ../../library/ctypes.rst:189 msgid "" ">>> windll.kernel32.GetModuleHandleA(32)\n" "Traceback (most recent call last):\n" @@ -350,7 +358,7 @@ msgstr "" "OSError: exception: access violation reading 0x00000020\n" ">>>" -#: ../../library/ctypes.rst:193 +#: ../../library/ctypes.rst:195 msgid "" "There are, however, enough ways to crash Python with :mod:`ctypes`, so you " "should be careful anyway. The :mod:`faulthandler` module can be helpful in " @@ -358,7 +366,7 @@ msgid "" "library calls)." msgstr "" -#: ../../library/ctypes.rst:198 +#: ../../library/ctypes.rst:200 msgid "" "``None``, integers, bytes objects and (unicode) strings are the only native " "Python objects that can directly be used as parameters in these function " @@ -369,358 +377,358 @@ msgid "" "the C type." msgstr "" -#: ../../library/ctypes.rst:205 +#: ../../library/ctypes.rst:207 msgid "" "Before we move on calling functions with other parameter types, we have to " "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2426 +#: ../../library/ctypes.rst:214 ../../library/ctypes.rst:2428 msgid "Fundamental data types" msgstr "" -#: ../../library/ctypes.rst:214 +#: ../../library/ctypes.rst:216 msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" msgstr "" -#: ../../library/ctypes.rst:217 ../../library/ctypes.rst:289 +#: ../../library/ctypes.rst:219 ../../library/ctypes.rst:291 msgid "ctypes type" msgstr "ctypes 型別" -#: ../../library/ctypes.rst:217 ../../library/ctypes.rst:289 +#: ../../library/ctypes.rst:219 ../../library/ctypes.rst:291 msgid "C type" msgstr "C 型別" -#: ../../library/ctypes.rst:217 ../../library/ctypes.rst:289 +#: ../../library/ctypes.rst:219 ../../library/ctypes.rst:291 msgid "Python type" msgstr "Python 型別" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:221 msgid ":class:`c_bool`" msgstr ":class:`c_bool`" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:221 msgid ":c:expr:`_Bool`" msgstr ":c:expr:`_Bool`" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:221 msgid "bool (1)" msgstr "bool (1)" -#: ../../library/ctypes.rst:221 +#: ../../library/ctypes.rst:223 msgid ":class:`c_char`" msgstr ":class:`c_char`" -#: ../../library/ctypes.rst:221 ../../library/ctypes.rst:225 +#: ../../library/ctypes.rst:223 ../../library/ctypes.rst:227 msgid ":c:expr:`char`" msgstr ":c:expr:`char`" -#: ../../library/ctypes.rst:221 +#: ../../library/ctypes.rst:223 msgid "1-character bytes object" msgstr "" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:225 msgid ":class:`c_wchar`" msgstr ":class:`c_wchar`" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:225 msgid ":c:type:`wchar_t`" msgstr ":c:type:`wchar_t`" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:225 msgid "1-character string" msgstr "" -#: ../../library/ctypes.rst:225 +#: ../../library/ctypes.rst:227 msgid ":class:`c_byte`" msgstr ":class:`c_byte`" -#: ../../library/ctypes.rst:225 ../../library/ctypes.rst:227 -#: ../../library/ctypes.rst:229 ../../library/ctypes.rst:231 -#: ../../library/ctypes.rst:233 ../../library/ctypes.rst:235 -#: ../../library/ctypes.rst:237 ../../library/ctypes.rst:239 -#: ../../library/ctypes.rst:241 ../../library/ctypes.rst:243 -#: ../../library/ctypes.rst:245 ../../library/ctypes.rst:247 -#: ../../library/ctypes.rst:249 ../../library/ctypes.rst:251 -#: ../../library/ctypes.rst:253 ../../library/ctypes.rst:255 -#: ../../library/ctypes.rst:257 ../../library/ctypes.rst:259 -#: ../../library/ctypes.rst:262 ../../library/ctypes.rst:264 -#: ../../library/ctypes.rst:267 +#: ../../library/ctypes.rst:227 ../../library/ctypes.rst:229 +#: ../../library/ctypes.rst:231 ../../library/ctypes.rst:233 +#: ../../library/ctypes.rst:235 ../../library/ctypes.rst:237 +#: ../../library/ctypes.rst:239 ../../library/ctypes.rst:241 +#: ../../library/ctypes.rst:243 ../../library/ctypes.rst:245 +#: ../../library/ctypes.rst:247 ../../library/ctypes.rst:249 +#: ../../library/ctypes.rst:251 ../../library/ctypes.rst:253 +#: ../../library/ctypes.rst:255 ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:259 ../../library/ctypes.rst:261 +#: ../../library/ctypes.rst:264 ../../library/ctypes.rst:266 +#: ../../library/ctypes.rst:269 msgid "int" msgstr "int" -#: ../../library/ctypes.rst:227 +#: ../../library/ctypes.rst:229 msgid ":class:`c_ubyte`" msgstr ":class:`c_ubyte`" -#: ../../library/ctypes.rst:227 +#: ../../library/ctypes.rst:229 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../library/ctypes.rst:229 +#: ../../library/ctypes.rst:231 msgid ":class:`c_short`" msgstr ":class:`c_short`" -#: ../../library/ctypes.rst:229 +#: ../../library/ctypes.rst:231 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../library/ctypes.rst:231 +#: ../../library/ctypes.rst:233 msgid ":class:`c_ushort`" msgstr ":class:`c_ushort`" -#: ../../library/ctypes.rst:231 +#: ../../library/ctypes.rst:233 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../library/ctypes.rst:233 +#: ../../library/ctypes.rst:235 msgid ":class:`c_int`" msgstr ":class:`c_int`" -#: ../../library/ctypes.rst:233 +#: ../../library/ctypes.rst:235 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../library/ctypes.rst:235 +#: ../../library/ctypes.rst:237 msgid ":class:`c_int8`" msgstr ":class:`c_int8`" -#: ../../library/ctypes.rst:235 +#: ../../library/ctypes.rst:237 msgid ":c:type:`int8_t`" msgstr ":c:type:`int8_t`" -#: ../../library/ctypes.rst:237 +#: ../../library/ctypes.rst:239 msgid ":class:`c_int16`" msgstr ":class:`c_int16`" -#: ../../library/ctypes.rst:237 +#: ../../library/ctypes.rst:239 msgid ":c:type:`int16_t`" msgstr ":c:type:`int16_t`" -#: ../../library/ctypes.rst:239 +#: ../../library/ctypes.rst:241 msgid ":class:`c_int32`" msgstr ":class:`c_int32`" -#: ../../library/ctypes.rst:239 +#: ../../library/ctypes.rst:241 msgid ":c:type:`int32_t`" msgstr ":c:type:`int32_t`" -#: ../../library/ctypes.rst:241 +#: ../../library/ctypes.rst:243 msgid ":class:`c_int64`" msgstr ":class:`c_int64`" -#: ../../library/ctypes.rst:241 +#: ../../library/ctypes.rst:243 msgid ":c:type:`int64_t`" msgstr ":c:type:`int64_t`" -#: ../../library/ctypes.rst:243 +#: ../../library/ctypes.rst:245 msgid ":class:`c_uint`" msgstr ":class:`c_uint`" -#: ../../library/ctypes.rst:243 +#: ../../library/ctypes.rst:245 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../library/ctypes.rst:245 +#: ../../library/ctypes.rst:247 msgid ":class:`c_uint8`" msgstr ":class:`c_uint8`" -#: ../../library/ctypes.rst:245 +#: ../../library/ctypes.rst:247 msgid ":c:type:`uint8_t`" msgstr ":c:type:`uint8_t`" -#: ../../library/ctypes.rst:247 +#: ../../library/ctypes.rst:249 msgid ":class:`c_uint16`" msgstr ":class:`c_uint16`" -#: ../../library/ctypes.rst:247 +#: ../../library/ctypes.rst:249 msgid ":c:type:`uint16_t`" msgstr ":c:type:`uint16_t`" -#: ../../library/ctypes.rst:249 +#: ../../library/ctypes.rst:251 msgid ":class:`c_uint32`" msgstr ":class:`c_uint32`" -#: ../../library/ctypes.rst:249 +#: ../../library/ctypes.rst:251 msgid ":c:type:`uint32_t`" msgstr ":c:type:`uint32_t`" -#: ../../library/ctypes.rst:251 +#: ../../library/ctypes.rst:253 msgid ":class:`c_uint64`" msgstr ":class:`c_uint64`" -#: ../../library/ctypes.rst:251 +#: ../../library/ctypes.rst:253 msgid ":c:type:`uint64_t`" msgstr ":c:type:`uint64_t`" -#: ../../library/ctypes.rst:253 +#: ../../library/ctypes.rst:255 msgid ":class:`c_long`" msgstr ":class:`c_long`" -#: ../../library/ctypes.rst:253 +#: ../../library/ctypes.rst:255 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../library/ctypes.rst:255 +#: ../../library/ctypes.rst:257 msgid ":class:`c_ulong`" msgstr ":class:`c_ulong`" -#: ../../library/ctypes.rst:255 +#: ../../library/ctypes.rst:257 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:259 msgid ":class:`c_longlong`" msgstr ":class:`c_longlong`" -#: ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:259 msgid ":c:expr:`__int64` or :c:expr:`long long`" msgstr ":c:expr:`__int64` 或 :c:expr:`long long`" -#: ../../library/ctypes.rst:259 +#: ../../library/ctypes.rst:261 msgid ":class:`c_ulonglong`" msgstr ":class:`c_ulonglong`" -#: ../../library/ctypes.rst:259 +#: ../../library/ctypes.rst:261 msgid ":c:expr:`unsigned __int64` or :c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned __int64` 或 :c:expr:`unsigned long long`" -#: ../../library/ctypes.rst:262 +#: ../../library/ctypes.rst:264 msgid ":class:`c_size_t`" msgstr ":class:`c_size_t`" -#: ../../library/ctypes.rst:262 +#: ../../library/ctypes.rst:264 msgid ":c:type:`size_t`" msgstr ":c:type:`size_t`" -#: ../../library/ctypes.rst:264 +#: ../../library/ctypes.rst:266 msgid ":class:`c_ssize_t`" msgstr ":class:`c_ssize_t`" -#: ../../library/ctypes.rst:264 +#: ../../library/ctypes.rst:266 msgid ":c:type:`ssize_t` or :c:expr:`Py_ssize_t`" msgstr ":c:type:`ssize_t` 或 :c:expr:`Py_ssize_t`" -#: ../../library/ctypes.rst:267 +#: ../../library/ctypes.rst:269 msgid ":class:`c_time_t`" msgstr ":class:`c_time_t`" -#: ../../library/ctypes.rst:267 +#: ../../library/ctypes.rst:269 msgid ":c:type:`time_t`" msgstr ":c:type:`time_t`" -#: ../../library/ctypes.rst:269 +#: ../../library/ctypes.rst:271 msgid ":class:`c_float`" msgstr ":class:`c_float`" -#: ../../library/ctypes.rst:269 +#: ../../library/ctypes.rst:271 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../library/ctypes.rst:269 ../../library/ctypes.rst:271 -#: ../../library/ctypes.rst:273 +#: ../../library/ctypes.rst:271 ../../library/ctypes.rst:273 +#: ../../library/ctypes.rst:275 msgid "float" msgstr "float" -#: ../../library/ctypes.rst:271 +#: ../../library/ctypes.rst:273 msgid ":class:`c_double`" msgstr ":class:`c_double`" -#: ../../library/ctypes.rst:271 +#: ../../library/ctypes.rst:273 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../library/ctypes.rst:273 +#: ../../library/ctypes.rst:275 msgid ":class:`c_longdouble`" msgstr ":class:`c_longdouble`" -#: ../../library/ctypes.rst:273 +#: ../../library/ctypes.rst:275 msgid ":c:expr:`long double`" msgstr ":c:expr:`long double`" -#: ../../library/ctypes.rst:275 +#: ../../library/ctypes.rst:277 msgid ":class:`c_char_p`" msgstr ":class:`c_char_p`" -#: ../../library/ctypes.rst:275 +#: ../../library/ctypes.rst:277 msgid ":c:expr:`char *` (NUL terminated)" msgstr "" -#: ../../library/ctypes.rst:275 +#: ../../library/ctypes.rst:277 msgid "bytes object or ``None``" msgstr "位元組物件或 ``None``" -#: ../../library/ctypes.rst:277 +#: ../../library/ctypes.rst:279 msgid ":class:`c_wchar_p`" msgstr ":class:`c_wchar_p`" -#: ../../library/ctypes.rst:277 +#: ../../library/ctypes.rst:279 msgid ":c:expr:`wchar_t *` (NUL terminated)" msgstr "" -#: ../../library/ctypes.rst:277 +#: ../../library/ctypes.rst:279 msgid "string or ``None``" msgstr "字串或 ``None``" -#: ../../library/ctypes.rst:279 +#: ../../library/ctypes.rst:281 msgid ":class:`c_void_p`" msgstr ":class:`c_void_p`" -#: ../../library/ctypes.rst:279 +#: ../../library/ctypes.rst:281 msgid ":c:expr:`void *`" msgstr ":c:expr:`void *`" -#: ../../library/ctypes.rst:279 +#: ../../library/ctypes.rst:281 msgid "int or ``None``" msgstr "" -#: ../../library/ctypes.rst:283 +#: ../../library/ctypes.rst:285 msgid "The constructor accepts any object with a truth value." msgstr "" -#: ../../library/ctypes.rst:285 +#: ../../library/ctypes.rst:287 msgid "" "Additionally, if IEC 60559 compatible complex arithmetic (Annex G) is " "supported in both C and ``libffi``, the following complex types are " "available:" msgstr "" -#: ../../library/ctypes.rst:291 +#: ../../library/ctypes.rst:293 msgid ":class:`c_float_complex`" msgstr ":class:`c_float_complex`" -#: ../../library/ctypes.rst:291 +#: ../../library/ctypes.rst:293 msgid ":c:expr:`float complex`" msgstr ":c:expr:`float complex`" -#: ../../library/ctypes.rst:291 ../../library/ctypes.rst:293 -#: ../../library/ctypes.rst:295 +#: ../../library/ctypes.rst:293 ../../library/ctypes.rst:295 +#: ../../library/ctypes.rst:297 msgid "complex" msgstr "" -#: ../../library/ctypes.rst:293 +#: ../../library/ctypes.rst:295 msgid ":class:`c_double_complex`" msgstr ":class:`c_double_complex`" -#: ../../library/ctypes.rst:293 +#: ../../library/ctypes.rst:295 msgid ":c:expr:`double complex`" msgstr ":c:expr:`double complex`" -#: ../../library/ctypes.rst:295 +#: ../../library/ctypes.rst:297 msgid ":class:`c_longdouble_complex`" msgstr ":class:`c_longdouble_complex`" -#: ../../library/ctypes.rst:295 +#: ../../library/ctypes.rst:297 msgid ":c:expr:`long double complex`" msgstr ":c:expr:`long double complex`" -#: ../../library/ctypes.rst:299 +#: ../../library/ctypes.rst:301 msgid "" "All these types can be created by calling them with an optional initializer " "of the correct type and value::" msgstr "" -#: ../../library/ctypes.rst:302 +#: ../../library/ctypes.rst:304 msgid "" ">>> c_int()\n" "c_long(0)\n" @@ -738,12 +746,12 @@ msgstr "" "c_ushort(65533)\n" ">>>" -#: ../../library/ctypes.rst:310 +#: ../../library/ctypes.rst:312 msgid "" "Since these types are mutable, their value can also be changed afterwards::" msgstr "" -#: ../../library/ctypes.rst:312 +#: ../../library/ctypes.rst:314 msgid "" ">>> i = c_int(42)\n" ">>> print(i)\n" @@ -765,7 +773,7 @@ msgstr "" "-99\n" ">>>" -#: ../../library/ctypes.rst:322 +#: ../../library/ctypes.rst:324 msgid "" "Assigning a new value to instances of the pointer types :class:`c_char_p`, :" "class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " @@ -773,7 +781,7 @@ msgid "" "Python string objects are immutable)::" msgstr "" -#: ../../library/ctypes.rst:327 +#: ../../library/ctypes.rst:329 msgid "" ">>> s = \"Hello, World\"\n" ">>> c_s = c_wchar_p(s)\n" @@ -805,7 +813,7 @@ msgstr "" "Hello, World\n" ">>>" -#: ../../library/ctypes.rst:342 +#: ../../library/ctypes.rst:344 msgid "" "You should be careful, however, not to pass them to functions expecting " "pointers to mutable memory. If you need mutable memory blocks, ctypes has a :" @@ -815,7 +823,7 @@ msgid "" "``value`` property::" msgstr "" -#: ../../library/ctypes.rst:349 +#: ../../library/ctypes.rst:351 msgid "" ">>> from ctypes import *\n" ">>> p = create_string_buffer(3) # create a 3 byte buffer, " @@ -837,7 +845,7 @@ msgid "" ">>>" msgstr "" -#: ../../library/ctypes.rst:366 +#: ../../library/ctypes.rst:368 msgid "" "The :func:`create_string_buffer` function replaces the old :func:`!c_buffer` " "function (which is still available as an alias). To create a mutable memory " @@ -845,18 +853,18 @@ msgid "" "the :func:`create_unicode_buffer` function." msgstr "" -#: ../../library/ctypes.rst:375 +#: ../../library/ctypes.rst:377 msgid "Calling functions, continued" msgstr "" -#: ../../library/ctypes.rst:377 +#: ../../library/ctypes.rst:379 msgid "" "Note that printf prints to the real standard output channel, *not* to :data:" "`sys.stdout`, so these examples will only work at the console prompt, not " "from within *IDLE* or *PythonWin*::" msgstr "" -#: ../../library/ctypes.rst:381 +#: ../../library/ctypes.rst:383 msgid "" ">>> printf = libc.printf\n" ">>> printf(b\"Hello, %s\\n\", b\"World!\")\n" @@ -892,14 +900,14 @@ msgstr "" "parameter 2\n" ">>>" -#: ../../library/ctypes.rst:397 +#: ../../library/ctypes.rst:399 msgid "" "As has been mentioned before, all Python types except integers, strings, and " "bytes objects have to be wrapped in their corresponding :mod:`ctypes` type, " "so that they can be converted to the required C data type::" msgstr "" -#: ../../library/ctypes.rst:401 +#: ../../library/ctypes.rst:403 msgid "" ">>> printf(b\"An int %d, a double %f\\n\", 1234, c_double(3.14))\n" "An int 1234, a double 3.140000\n" @@ -911,11 +919,11 @@ msgstr "" "31\n" ">>>" -#: ../../library/ctypes.rst:409 +#: ../../library/ctypes.rst:411 msgid "Calling variadic functions" msgstr "" -#: ../../library/ctypes.rst:411 +#: ../../library/ctypes.rst:413 msgid "" "On a lot of platforms calling variadic functions through ctypes is exactly " "the same as calling functions with a fixed number of parameters. On some " @@ -924,27 +932,27 @@ msgid "" "functions." msgstr "" -#: ../../library/ctypes.rst:416 +#: ../../library/ctypes.rst:418 msgid "" "On those platforms it is required to specify the :attr:`~_CFuncPtr.argtypes` " "attribute for the regular, non-variadic, function arguments:" msgstr "" -#: ../../library/ctypes.rst:419 +#: ../../library/ctypes.rst:421 msgid "libc.printf.argtypes = [ctypes.c_char_p]" msgstr "libc.printf.argtypes = [ctypes.c_char_p]" -#: ../../library/ctypes.rst:423 +#: ../../library/ctypes.rst:425 msgid "" "Because specifying the attribute does not inhibit portability it is advised " "to always specify :attr:`~_CFuncPtr.argtypes` for all variadic functions." msgstr "" -#: ../../library/ctypes.rst:430 +#: ../../library/ctypes.rst:432 msgid "Calling functions with your own custom data types" msgstr "" -#: ../../library/ctypes.rst:432 +#: ../../library/ctypes.rst:434 msgid "" "You can also customize :mod:`ctypes` argument conversion to allow instances " "of your own classes be used as function arguments. :mod:`ctypes` looks for " @@ -953,7 +961,7 @@ msgid "" "or an object with an :attr:`!_as_parameter_` attribute::" msgstr "" -#: ../../library/ctypes.rst:438 +#: ../../library/ctypes.rst:440 msgid "" ">>> class Bottles:\n" "... def __init__(self, number):\n" @@ -975,24 +983,24 @@ msgstr "" "19\n" ">>>" -#: ../../library/ctypes.rst:448 +#: ../../library/ctypes.rst:450 msgid "" "If you don't want to store the instance's data in the :attr:`!" "_as_parameter_` instance variable, you could define a :class:`property` " "which makes the attribute available on request." msgstr "" -#: ../../library/ctypes.rst:456 +#: ../../library/ctypes.rst:458 msgid "Specifying the required argument types (function prototypes)" msgstr "" -#: ../../library/ctypes.rst:458 +#: ../../library/ctypes.rst:460 msgid "" "It is possible to specify the required argument types of functions exported " "from DLLs by setting the :attr:`~_CFuncPtr.argtypes` attribute." msgstr "" -#: ../../library/ctypes.rst:461 +#: ../../library/ctypes.rst:463 msgid "" ":attr:`~_CFuncPtr.argtypes` must be a sequence of C data types (the :func:`!" "printf` function is probably not a good example here, because it takes a " @@ -1001,7 +1009,7 @@ msgid "" "feature)::" msgstr "" -#: ../../library/ctypes.rst:466 +#: ../../library/ctypes.rst:468 msgid "" ">>> printf.argtypes = [c_char_p, c_char_p, c_int, c_double]\n" ">>> printf(b\"String '%s', Int %d, Double %f\\n\", b\"Hi\", 10, 2.2)\n" @@ -1015,14 +1023,14 @@ msgstr "" "37\n" ">>>" -#: ../../library/ctypes.rst:472 +#: ../../library/ctypes.rst:474 msgid "" "Specifying a format protects against incompatible argument types (just as a " "prototype for a C function), and tries to convert the arguments to valid " "types::" msgstr "" -#: ../../library/ctypes.rst:475 +#: ../../library/ctypes.rst:477 msgid "" ">>> printf(b\"%d %d %d\", 1, 2, 3)\n" "Traceback (most recent call last):\n" @@ -1044,7 +1052,7 @@ msgstr "" "13\n" ">>>" -#: ../../library/ctypes.rst:484 +#: ../../library/ctypes.rst:486 msgid "" "If you have defined your own classes which you pass to function calls, you " "have to implement a :meth:`~_CData.from_param` class method for them to be " @@ -1058,43 +1066,43 @@ msgid "" "_as_parameter_` attribute." msgstr "" -#: ../../library/ctypes.rst:498 +#: ../../library/ctypes.rst:500 msgid "Return types" msgstr "" -#: ../../library/ctypes.rst:508 +#: ../../library/ctypes.rst:510 msgid "" "By default functions are assumed to return the C :c:expr:`int` type. Other " "return types can be specified by setting the :attr:`~_CFuncPtr.restype` " "attribute of the function object." msgstr "" -#: ../../library/ctypes.rst:512 +#: ../../library/ctypes.rst:514 msgid "" "The C prototype of :c:func:`time` is ``time_t time(time_t *)``. Because :c:" "type:`time_t` might be of a different type than the default return type :c:" "expr:`int`, you should specify the :attr:`!restype` attribute::" msgstr "" -#: ../../library/ctypes.rst:516 +#: ../../library/ctypes.rst:518 msgid ">>> libc.time.restype = c_time_t" msgstr ">>> libc.time.restype = c_time_t" -#: ../../library/ctypes.rst:518 +#: ../../library/ctypes.rst:520 msgid "The argument types can be specified using :attr:`~_CFuncPtr.argtypes`::" msgstr "" -#: ../../library/ctypes.rst:520 +#: ../../library/ctypes.rst:522 msgid ">>> libc.time.argtypes = (POINTER(c_time_t),)" msgstr ">>> libc.time.argtypes = (POINTER(c_time_t),)" -#: ../../library/ctypes.rst:522 +#: ../../library/ctypes.rst:524 msgid "" "To call the function with a ``NULL`` pointer as first argument, use " "``None``::" msgstr "" -#: ../../library/ctypes.rst:524 +#: ../../library/ctypes.rst:526 msgid "" ">>> print(libc.time(None))\n" "1150640792" @@ -1102,13 +1110,13 @@ msgstr "" ">>> print(libc.time(None))\n" "1150640792" -#: ../../library/ctypes.rst:527 +#: ../../library/ctypes.rst:529 msgid "" "Here is a more advanced example, it uses the :func:`!strchr` function, which " "expects a string pointer and a char, and returns a pointer to a string::" msgstr "" -#: ../../library/ctypes.rst:530 +#: ../../library/ctypes.rst:532 msgid "" ">>> strchr = libc.strchr\n" ">>> strchr(b\"abcdef\", ord(\"d\"))\n" @@ -1130,14 +1138,14 @@ msgstr "" "None\n" ">>>" -#: ../../library/ctypes.rst:540 +#: ../../library/ctypes.rst:542 msgid "" "If you want to avoid the :func:`ord(\"x\") ` calls above, you can set " "the :attr:`~_CFuncPtr.argtypes` attribute, and the second argument will be " "converted from a single character Python bytes object into a C char:" msgstr "" -#: ../../library/ctypes.rst:544 +#: ../../library/ctypes.rst:546 msgid "" ">>> strchr.restype = c_char_p\n" ">>> strchr.argtypes = [c_char_p, c_char]\n" @@ -1167,7 +1175,7 @@ msgstr "" "b'def'\n" ">>>" -#: ../../library/ctypes.rst:559 +#: ../../library/ctypes.rst:561 msgid "" "You can also use a callable Python object (a function or a class for " "example) as the :attr:`~_CFuncPtr.restype` attribute, if the foreign " @@ -1177,7 +1185,7 @@ msgid "" "values and automatically raise an exception::" msgstr "" -#: ../../library/ctypes.rst:565 +#: ../../library/ctypes.rst:567 msgid "" ">>> GetModuleHandle = windll.kernel32.GetModuleHandleA\n" ">>> def ValidHandle(value):\n" @@ -1213,7 +1221,7 @@ msgstr "" "OSError: [Errno 126] The specified module could not be found.\n" ">>>" -#: ../../library/ctypes.rst:582 +#: ../../library/ctypes.rst:584 msgid "" "``WinError`` is a function which will call Windows ``FormatMessage()`` api " "to get the string representation of an error code, and *returns* an " @@ -1221,18 +1229,18 @@ msgid "" "used, it calls :func:`GetLastError` to retrieve it." msgstr "" -#: ../../library/ctypes.rst:587 +#: ../../library/ctypes.rst:589 msgid "" "Please note that a much more powerful error checking mechanism is available " "through the :attr:`~_CFuncPtr.errcheck` attribute; see the reference manual " "for details." msgstr "" -#: ../../library/ctypes.rst:595 +#: ../../library/ctypes.rst:597 msgid "Passing pointers (or: passing parameters by reference)" msgstr "" -#: ../../library/ctypes.rst:597 +#: ../../library/ctypes.rst:599 msgid "" "Sometimes a C api function expects a *pointer* to a data type as parameter, " "probably to write into the corresponding location, or if the data is too " @@ -1240,7 +1248,7 @@ msgid "" "reference*." msgstr "" -#: ../../library/ctypes.rst:601 +#: ../../library/ctypes.rst:603 msgid "" ":mod:`ctypes` exports the :func:`byref` function which is used to pass " "parameters by reference. The same effect can be achieved with the :func:" @@ -1249,7 +1257,7 @@ msgid "" "you don't need the pointer object in Python itself::" msgstr "" -#: ../../library/ctypes.rst:607 +#: ../../library/ctypes.rst:609 msgid "" ">>> i = c_int()\n" ">>> f = c_float()\n" @@ -1275,11 +1283,11 @@ msgstr "" "1 3.1400001049 b'Hello'\n" ">>>" -#: ../../library/ctypes.rst:623 +#: ../../library/ctypes.rst:625 msgid "Structures and unions" msgstr "" -#: ../../library/ctypes.rst:625 +#: ../../library/ctypes.rst:627 msgid "" "Structures and unions must derive from the :class:`Structure` and :class:" "`Union` base classes which are defined in the :mod:`ctypes` module. Each " @@ -1288,20 +1296,20 @@ msgid "" "*field type*." msgstr "" -#: ../../library/ctypes.rst:630 +#: ../../library/ctypes.rst:632 msgid "" "The field type must be a :mod:`ctypes` type like :class:`c_int`, or any " "other derived :mod:`ctypes` type: structure, union, array, pointer." msgstr "" -#: ../../library/ctypes.rst:633 +#: ../../library/ctypes.rst:635 msgid "" "Here is a simple example of a POINT structure, which contains two integers " "named *x* and *y*, and also shows how to initialize a structure in the " "constructor::" msgstr "" -#: ../../library/ctypes.rst:636 +#: ../../library/ctypes.rst:638 msgid "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" @@ -1337,19 +1345,19 @@ msgstr "" "TypeError: too many initializers\n" ">>>" -#: ../../library/ctypes.rst:653 +#: ../../library/ctypes.rst:655 msgid "" "You can, however, build much more complicated structures. A structure can " "itself contain other structures by using a structure as a field type." msgstr "" -#: ../../library/ctypes.rst:656 +#: ../../library/ctypes.rst:658 msgid "" "Here is a RECT structure which contains two POINTs named *upperleft* and " "*lowerright*::" msgstr "" -#: ../../library/ctypes.rst:659 +#: ../../library/ctypes.rst:661 msgid "" ">>> class RECT(Structure):\n" "... _fields_ = [(\"upperleft\", POINT),\n" @@ -1373,13 +1381,13 @@ msgstr "" "0 0\n" ">>>" -#: ../../library/ctypes.rst:670 +#: ../../library/ctypes.rst:672 msgid "" "Nested structures can also be initialized in the constructor in several " "ways::" msgstr "" -#: ../../library/ctypes.rst:672 +#: ../../library/ctypes.rst:674 msgid "" ">>> r = RECT(POINT(1, 2), POINT(3, 4))\n" ">>> r = RECT((1, 2), (3, 4))" @@ -1387,14 +1395,14 @@ msgstr "" ">>> r = RECT(POINT(1, 2), POINT(3, 4))\n" ">>> r = RECT((1, 2), (3, 4))" -#: ../../library/ctypes.rst:675 +#: ../../library/ctypes.rst:677 msgid "" "Field :term:`descriptor`\\s can be retrieved from the *class*, they are " "useful for debugging because they can provide useful information. See :class:" "`CField`::" msgstr "" -#: ../../library/ctypes.rst:679 +#: ../../library/ctypes.rst:681 msgid "" ">>> POINT.x\n" "\n" @@ -1408,7 +1416,7 @@ msgstr "" "\n" ">>>" -#: ../../library/ctypes.rst:690 +#: ../../library/ctypes.rst:692 msgid "" ":mod:`ctypes` does not support passing unions or structures with bit-fields " "to functions by value. While this may work on 32-bit x86, it's not " @@ -1416,11 +1424,11 @@ msgid "" "structures with bit-fields should always be passed to functions by pointer." msgstr "" -#: ../../library/ctypes.rst:696 +#: ../../library/ctypes.rst:698 msgid "Structure/union layout, alignment and byte order" msgstr "" -#: ../../library/ctypes.rst:698 +#: ../../library/ctypes.rst:700 msgid "" "By default, Structure and Union fields are laid out in the same way the C " "compiler does it. It is possible to override this behavior entirely by " @@ -1428,7 +1436,7 @@ msgid "" "definition; see the attribute documentation for details." msgstr "" -#: ../../library/ctypes.rst:703 +#: ../../library/ctypes.rst:705 msgid "" "It is possible to specify the maximum alignment for the fields and/or for " "the structure itself by setting the class attributes :attr:`~Structure." @@ -1436,7 +1444,7 @@ msgid "" "documentation for details." msgstr "" -#: ../../library/ctypes.rst:708 +#: ../../library/ctypes.rst:710 msgid "" ":mod:`ctypes` uses the native byte order for Structures and Unions. To " "build structures with non-native byte order, you can use one of the :class:" @@ -1445,18 +1453,18 @@ msgid "" "classes cannot contain pointer fields." msgstr "" -#: ../../library/ctypes.rst:718 +#: ../../library/ctypes.rst:720 msgid "Bit fields in structures and unions" msgstr "" -#: ../../library/ctypes.rst:720 +#: ../../library/ctypes.rst:722 msgid "" "It is possible to create structures and unions containing bit fields. Bit " "fields are only possible for integer fields, the bit width is specified as " "the third item in the :attr:`~Structure._fields_` tuples::" msgstr "" -#: ../../library/ctypes.rst:724 +#: ../../library/ctypes.rst:726 msgid "" ">>> class Int(Structure):\n" "... _fields_ = [(\"first_16\", c_int, 16),\n" @@ -1476,7 +1484,7 @@ msgstr "" ">>> print(Int.second_16)\n" "" -#: ../../library/ctypes.rst:733 +#: ../../library/ctypes.rst:735 msgid "" "It is important to note that bit field allocation and layout in memory are " "not defined as a C standard; their implementation is compiler-specific. By " @@ -1485,33 +1493,33 @@ msgid "" "details on the default behavior and how to change it." msgstr "" -#: ../../library/ctypes.rst:744 +#: ../../library/ctypes.rst:746 msgid "Arrays" msgstr "" -#: ../../library/ctypes.rst:746 +#: ../../library/ctypes.rst:748 msgid "" "Arrays are sequences, containing a fixed number of instances of the same " "type." msgstr "" -#: ../../library/ctypes.rst:748 +#: ../../library/ctypes.rst:750 msgid "" "The recommended way to create array types is by multiplying a data type with " "a positive integer::" msgstr "" -#: ../../library/ctypes.rst:751 +#: ../../library/ctypes.rst:753 msgid "TenPointsArrayType = POINT * 10" msgstr "" -#: ../../library/ctypes.rst:753 +#: ../../library/ctypes.rst:755 msgid "" "Here is an example of a somewhat artificial data type, a structure " "containing 4 POINTs among other stuff::" msgstr "" -#: ../../library/ctypes.rst:756 +#: ../../library/ctypes.rst:758 msgid "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" @@ -1539,11 +1547,11 @@ msgstr "" "4\n" ">>>" -#: ../../library/ctypes.rst:769 +#: ../../library/ctypes.rst:771 msgid "Instances are created in the usual way, by calling the class::" msgstr "" -#: ../../library/ctypes.rst:771 +#: ../../library/ctypes.rst:773 msgid "" "arr = TenPointsArrayType()\n" "for pt in arr:\n" @@ -1553,17 +1561,17 @@ msgstr "" "for pt in arr:\n" " print(pt.x, pt.y)" -#: ../../library/ctypes.rst:775 +#: ../../library/ctypes.rst:777 msgid "" "The above code print a series of ``0 0`` lines, because the array contents " "is initialized to zeros." msgstr "" -#: ../../library/ctypes.rst:778 +#: ../../library/ctypes.rst:780 msgid "Initializers of the correct type can also be specified::" msgstr "" -#: ../../library/ctypes.rst:780 +#: ../../library/ctypes.rst:782 msgid "" ">>> from ctypes import *\n" ">>> TenIntegers = c_int * 10\n" @@ -1585,17 +1593,17 @@ msgstr "" "1 2 3 4 5 6 7 8 9 10\n" ">>>" -#: ../../library/ctypes.rst:794 +#: ../../library/ctypes.rst:796 msgid "Pointers" msgstr "指標" -#: ../../library/ctypes.rst:796 +#: ../../library/ctypes.rst:798 msgid "" "Pointer instances are created by calling the :func:`pointer` function on a :" "mod:`ctypes` type::" msgstr "" -#: ../../library/ctypes.rst:799 +#: ../../library/ctypes.rst:801 msgid "" ">>> from ctypes import *\n" ">>> i = c_int(42)\n" @@ -1607,13 +1615,13 @@ msgstr "" ">>> pi = pointer(i)\n" ">>>" -#: ../../library/ctypes.rst:804 +#: ../../library/ctypes.rst:806 msgid "" "Pointer instances have a :attr:`~_Pointer.contents` attribute which returns " "the object to which the pointer points, the ``i`` object above::" msgstr "" -#: ../../library/ctypes.rst:807 +#: ../../library/ctypes.rst:809 msgid "" ">>> pi.contents\n" "c_long(42)\n" @@ -1623,13 +1631,13 @@ msgstr "" "c_long(42)\n" ">>>" -#: ../../library/ctypes.rst:811 +#: ../../library/ctypes.rst:813 msgid "" "Note that :mod:`ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" msgstr "" -#: ../../library/ctypes.rst:814 +#: ../../library/ctypes.rst:816 msgid "" ">>> pi.contents is i\n" "False\n" @@ -1643,14 +1651,14 @@ msgstr "" "False\n" ">>>" -#: ../../library/ctypes.rst:820 +#: ../../library/ctypes.rst:822 msgid "" "Assigning another :class:`c_int` instance to the pointer's contents " "attribute would cause the pointer to point to the memory location where this " "is stored::" msgstr "" -#: ../../library/ctypes.rst:823 +#: ../../library/ctypes.rst:825 msgid "" ">>> i = c_int(99)\n" ">>> pi.contents = i\n" @@ -1664,11 +1672,11 @@ msgstr "" "c_long(99)\n" ">>>" -#: ../../library/ctypes.rst:832 +#: ../../library/ctypes.rst:834 msgid "Pointer instances can also be indexed with integers::" msgstr "" -#: ../../library/ctypes.rst:834 +#: ../../library/ctypes.rst:836 msgid "" ">>> pi[0]\n" "99\n" @@ -1678,11 +1686,11 @@ msgstr "" "99\n" ">>>" -#: ../../library/ctypes.rst:838 +#: ../../library/ctypes.rst:840 msgid "Assigning to an integer index changes the pointed to value::" msgstr "" -#: ../../library/ctypes.rst:840 +#: ../../library/ctypes.rst:842 msgid "" ">>> print(i)\n" "c_long(99)\n" @@ -1698,7 +1706,7 @@ msgstr "" "c_long(22)\n" ">>>" -#: ../../library/ctypes.rst:847 +#: ../../library/ctypes.rst:849 msgid "" "It is also possible to use indexes different from 0, but you must know what " "you're doing, just as in C: You can access or change arbitrary memory " @@ -1707,7 +1715,7 @@ msgid "" "instead of a single item." msgstr "" -#: ../../library/ctypes.rst:853 +#: ../../library/ctypes.rst:855 msgid "" "Behind the scenes, the :func:`pointer` function does more than simply create " "pointer instances, it has to create pointer *types* first. This is done with " @@ -1715,7 +1723,7 @@ msgid "" "returns a new type::" msgstr "" -#: ../../library/ctypes.rst:858 +#: ../../library/ctypes.rst:860 msgid "" ">>> PI = POINTER(c_int)\n" ">>> PI\n" @@ -1739,13 +1747,13 @@ msgstr "" "\n" ">>>" -#: ../../library/ctypes.rst:869 +#: ../../library/ctypes.rst:871 msgid "" "Calling the pointer type without an argument creates a ``NULL`` pointer. " "``NULL`` pointers have a ``False`` boolean value::" msgstr "" -#: ../../library/ctypes.rst:872 +#: ../../library/ctypes.rst:874 msgid "" ">>> null_ptr = POINTER(c_int)()\n" ">>> print(bool(null_ptr))\n" @@ -1757,13 +1765,13 @@ msgstr "" "False\n" ">>>" -#: ../../library/ctypes.rst:877 +#: ../../library/ctypes.rst:879 msgid "" ":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" msgstr "" -#: ../../library/ctypes.rst:880 +#: ../../library/ctypes.rst:882 msgid "" ">>> null_ptr[0]\n" "Traceback (most recent call last):\n" @@ -1789,18 +1797,18 @@ msgstr "" "ValueError: NULL pointer access\n" ">>>" -#: ../../library/ctypes.rst:895 +#: ../../library/ctypes.rst:897 msgid "Thread safety without the GIL" msgstr "" -#: ../../library/ctypes.rst:897 +#: ../../library/ctypes.rst:899 msgid "" "From Python 3.13 onward, the :term:`GIL` can be disabled on :term:`free " "threaded ` builds. In ctypes, reads and writes to a single " "object concurrently is safe, but not across multiple objects:" msgstr "" -#: ../../library/ctypes.rst:900 +#: ../../library/ctypes.rst:902 msgid "" ">>> number = c_int(42)\n" ">>> pointer_a = pointer(number)\n" @@ -1810,7 +1818,7 @@ msgstr "" ">>> pointer_a = pointer(number)\n" ">>> pointer_b = pointer(number)" -#: ../../library/ctypes.rst:906 +#: ../../library/ctypes.rst:908 msgid "" "In the above, it's only safe for one object to read and write to the address " "at once if the GIL is disabled. So, ``pointer_a`` can be shared and written " @@ -1819,7 +1827,7 @@ msgid "" "Lock` to synchronize access to memory:" msgstr "" -#: ../../library/ctypes.rst:911 +#: ../../library/ctypes.rst:913 msgid "" ">>> import threading\n" ">>> lock = threading.Lock()\n" @@ -1839,11 +1847,11 @@ msgstr "" ">>> with lock:\n" "... pointer_b.contents = 42" -#: ../../library/ctypes.rst:926 +#: ../../library/ctypes.rst:928 msgid "Type conversions" msgstr "" -#: ../../library/ctypes.rst:928 +#: ../../library/ctypes.rst:930 msgid "" "Usually, ctypes does strict type checking. This means, if you have " "``POINTER(c_int)`` in the :attr:`~_CFuncPtr.argtypes` list of a function or " @@ -1854,7 +1862,7 @@ msgid "" "ctypes accepts an array of c_int::" msgstr "" -#: ../../library/ctypes.rst:935 +#: ../../library/ctypes.rst:937 msgid "" ">>> class Bar(Structure):\n" "... _fields_ = [(\"count\", c_int), (\"values\", POINTER(c_int))]\n" @@ -1884,7 +1892,7 @@ msgstr "" "3\n" ">>>" -#: ../../library/ctypes.rst:949 +#: ../../library/ctypes.rst:951 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " "type (such as ``POINTER(c_int)``) in :attr:`~_CFuncPtr.argtypes`, an object " @@ -1893,11 +1901,11 @@ msgid "" "automatically." msgstr "" -#: ../../library/ctypes.rst:954 +#: ../../library/ctypes.rst:956 msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" msgstr "" -#: ../../library/ctypes.rst:956 +#: ../../library/ctypes.rst:958 msgid "" ">>> bar.values = None\n" ">>>" @@ -1905,7 +1913,7 @@ msgstr "" ">>> bar.values = None\n" ">>>" -#: ../../library/ctypes.rst:961 +#: ../../library/ctypes.rst:963 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " "type into another type. :mod:`ctypes` provides a :func:`cast` function " @@ -1914,7 +1922,7 @@ msgid "" "``values`` field, but not instances of other types::" msgstr "" -#: ../../library/ctypes.rst:967 +#: ../../library/ctypes.rst:969 msgid "" ">>> bar.values = (c_byte * 4)()\n" "Traceback (most recent call last):\n" @@ -1930,11 +1938,11 @@ msgstr "" "instance\n" ">>>" -#: ../../library/ctypes.rst:973 +#: ../../library/ctypes.rst:975 msgid "For these cases, the :func:`cast` function is handy." msgstr "" -#: ../../library/ctypes.rst:975 +#: ../../library/ctypes.rst:977 msgid "" "The :func:`cast` function can be used to cast a ctypes instance into a " "pointer to a different ctypes data type. :func:`cast` takes two parameters, " @@ -1943,7 +1951,7 @@ msgid "" "references the same memory block as the first argument::" msgstr "" -#: ../../library/ctypes.rst:981 +#: ../../library/ctypes.rst:983 msgid "" ">>> a = (c_byte * 4)()\n" ">>> cast(a, POINTER(c_int))\n" @@ -1955,13 +1963,13 @@ msgstr "" "\n" ">>>" -#: ../../library/ctypes.rst:986 +#: ../../library/ctypes.rst:988 msgid "" "So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` " "the structure::" msgstr "" -#: ../../library/ctypes.rst:989 +#: ../../library/ctypes.rst:991 msgid "" ">>> bar = Bar()\n" ">>> bar.values = cast((c_byte * 4)(), POINTER(c_int))\n" @@ -1975,18 +1983,18 @@ msgstr "" "0\n" ">>>" -#: ../../library/ctypes.rst:999 +#: ../../library/ctypes.rst:1001 msgid "Incomplete Types" msgstr "" -#: ../../library/ctypes.rst:1001 +#: ../../library/ctypes.rst:1003 msgid "" "*Incomplete Types* are structures, unions or arrays whose members are not " "yet specified. In C, they are specified by forward declarations, which are " "defined later::" msgstr "" -#: ../../library/ctypes.rst:1005 +#: ../../library/ctypes.rst:1007 msgid "" "struct cell; /* forward declaration */\n" "\n" @@ -1996,13 +2004,13 @@ msgid "" "};" msgstr "" -#: ../../library/ctypes.rst:1012 +#: ../../library/ctypes.rst:1014 msgid "" "The straightforward translation into ctypes code would be this, but it does " "not work::" msgstr "" -#: ../../library/ctypes.rst:1015 +#: ../../library/ctypes.rst:1017 msgid "" ">>> class cell(Structure):\n" "... _fields_ = [(\"name\", c_char_p),\n" @@ -2024,14 +2032,14 @@ msgstr "" "NameError: name 'cell' is not defined\n" ">>>" -#: ../../library/ctypes.rst:1025 +#: ../../library/ctypes.rst:1027 msgid "" "because the new ``class cell`` is not available in the class statement " "itself. In :mod:`ctypes`, we can define the ``cell`` class and set the :attr:" "`~Structure._fields_` attribute later, after the class statement::" msgstr "" -#: ../../library/ctypes.rst:1029 +#: ../../library/ctypes.rst:1031 msgid "" ">>> from ctypes import *\n" ">>> class cell(Structure):\n" @@ -2049,13 +2057,13 @@ msgstr "" "... (\"next\", POINTER(cell))]\n" ">>>" -#: ../../library/ctypes.rst:1037 +#: ../../library/ctypes.rst:1039 msgid "" "Let's try it. We create two instances of ``cell``, and let them point to " "each other, and finally follow the pointer chain a few times::" msgstr "" -#: ../../library/ctypes.rst:1040 +#: ../../library/ctypes.rst:1042 msgid "" ">>> c1 = cell()\n" ">>> c1.name = b\"foo\"\n" @@ -2085,24 +2093,24 @@ msgstr "" "foo bar foo bar foo bar foo bar\n" ">>>" -#: ../../library/ctypes.rst:1058 +#: ../../library/ctypes.rst:1060 msgid "Callback functions" msgstr "回呼函式" -#: ../../library/ctypes.rst:1060 +#: ../../library/ctypes.rst:1062 msgid "" ":mod:`ctypes` allows creating C callable function pointers from Python " "callables. These are sometimes called *callback functions*." msgstr "" -#: ../../library/ctypes.rst:1063 +#: ../../library/ctypes.rst:1065 msgid "" "First, you must create a class for the callback function. The class knows " "the calling convention, the return type, and the number and types of " "arguments this function will receive." msgstr "" -#: ../../library/ctypes.rst:1067 +#: ../../library/ctypes.rst:1069 msgid "" "The :func:`CFUNCTYPE` factory function creates types for callback functions " "using the ``cdecl`` calling convention. On Windows, the :func:`WINFUNCTYPE` " @@ -2110,21 +2118,21 @@ msgid "" "calling convention." msgstr "" -#: ../../library/ctypes.rst:1072 +#: ../../library/ctypes.rst:1074 msgid "" "Both of these factory functions are called with the result type as first " "argument, and the callback functions expected argument types as the " "remaining arguments." msgstr "" -#: ../../library/ctypes.rst:1076 +#: ../../library/ctypes.rst:1078 msgid "" "I will present an example here which uses the standard C library's :c:func:`!" "qsort` function, that is used to sort items with the help of a callback " "function. :c:func:`!qsort` will be used to sort an array of integers::" msgstr "" -#: ../../library/ctypes.rst:1080 +#: ../../library/ctypes.rst:1082 msgid "" ">>> IntArray5 = c_int * 5\n" ">>> ia = IntArray5(5, 1, 7, 33, 99)\n" @@ -2138,7 +2146,7 @@ msgstr "" ">>> qsort.restype = None\n" ">>>" -#: ../../library/ctypes.rst:1086 +#: ../../library/ctypes.rst:1088 msgid "" ":func:`!qsort` must be called with a pointer to the data to sort, the number " "of items in the data array, the size of one item, and a pointer to the " @@ -2148,13 +2156,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/ctypes.rst:1092 +#: ../../library/ctypes.rst:1094 msgid "" "So our callback function receives pointers to integers, and must return an " "integer. First we create the ``type`` for the callback function::" msgstr "" -#: ../../library/ctypes.rst:1095 +#: ../../library/ctypes.rst:1097 msgid "" ">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" ">>>" @@ -2162,13 +2170,13 @@ msgstr "" ">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" ">>>" -#: ../../library/ctypes.rst:1098 +#: ../../library/ctypes.rst:1100 msgid "" "To get started, here is a simple callback that shows the values it gets " "passed::" msgstr "" -#: ../../library/ctypes.rst:1101 +#: ../../library/ctypes.rst:1103 msgid "" ">>> def py_cmp_func(a, b):\n" "... print(\"py_cmp_func\", a[0], b[0])\n" @@ -2184,11 +2192,11 @@ msgstr "" ">>> cmp_func = CMPFUNC(py_cmp_func)\n" ">>>" -#: ../../library/ctypes.rst:1108 +#: ../../library/ctypes.rst:1110 msgid "The result::" msgstr "結果為: ::" -#: ../../library/ctypes.rst:1110 +#: ../../library/ctypes.rst:1112 msgid "" ">>> qsort(ia, len(ia), sizeof(c_int), cmp_func)\n" "py_cmp_func 5 1\n" @@ -2206,11 +2214,11 @@ msgstr "" "py_cmp_func 1 7\n" ">>>" -#: ../../library/ctypes.rst:1118 +#: ../../library/ctypes.rst:1120 msgid "Now we can actually compare the two items and return a useful result::" msgstr "" -#: ../../library/ctypes.rst:1120 +#: ../../library/ctypes.rst:1122 msgid "" ">>> def py_cmp_func(a, b):\n" "... print(\"py_cmp_func\", a[0], b[0])\n" @@ -2238,11 +2246,11 @@ msgstr "" "py_cmp_func 5 7\n" ">>>" -#: ../../library/ctypes.rst:1133 +#: ../../library/ctypes.rst:1135 msgid "As we can easily check, our array is sorted now::" msgstr "" -#: ../../library/ctypes.rst:1135 +#: ../../library/ctypes.rst:1137 msgid "" ">>> for i in ia: print(i, end=\" \")\n" "...\n" @@ -2254,13 +2262,13 @@ msgstr "" "1 5 7 33 99\n" ">>>" -#: ../../library/ctypes.rst:1140 +#: ../../library/ctypes.rst:1142 msgid "" "The function factories can be used as decorator factories, so we may as well " "write::" msgstr "" -#: ../../library/ctypes.rst:1143 +#: ../../library/ctypes.rst:1145 msgid "" ">>> @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" "... def py_cmp_func(a, b):\n" @@ -2288,14 +2296,14 @@ msgstr "" "py_cmp_func 5 7\n" ">>>" -#: ../../library/ctypes.rst:1158 +#: ../../library/ctypes.rst:1160 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " "are used from C code. :mod:`ctypes` doesn't, and if you don't, they may be " "garbage collected, crashing your program when a callback is made." msgstr "" -#: ../../library/ctypes.rst:1162 +#: ../../library/ctypes.rst:1164 msgid "" "Also, note that if the callback function is called in a thread created " "outside of Python's control (e.g. by the foreign code that calls the " @@ -2305,25 +2313,25 @@ msgid "" "even when those calls are made from the same C thread." msgstr "" -#: ../../library/ctypes.rst:1172 +#: ../../library/ctypes.rst:1174 msgid "Accessing values exported from dlls" msgstr "" -#: ../../library/ctypes.rst:1174 +#: ../../library/ctypes.rst:1176 msgid "" "Some shared libraries not only export functions, they also export variables. " "An example in the Python library itself is the :c:data:`Py_Version`, Python " "runtime version number encoded in a single constant integer." msgstr "" -#: ../../library/ctypes.rst:1178 +#: ../../library/ctypes.rst:1180 msgid "" ":mod:`ctypes` can access values like this with the :meth:`~_CData.in_dll` " "class methods of the type. *pythonapi* is a predefined symbol giving access " "to the Python C api::" msgstr "" -#: ../../library/ctypes.rst:1182 +#: ../../library/ctypes.rst:1184 msgid "" ">>> version = ctypes.c_int.in_dll(ctypes.pythonapi, \"Py_Version\")\n" ">>> print(hex(version.value))\n" @@ -2333,17 +2341,17 @@ msgstr "" ">>> print(hex(version.value))\n" "0x30c00a0" -#: ../../library/ctypes.rst:1186 +#: ../../library/ctypes.rst:1188 msgid "" "An extended example which also demonstrates the use of pointers accesses " "the :c:data:`PyImport_FrozenModules` pointer exported by Python." msgstr "" -#: ../../library/ctypes.rst:1189 +#: ../../library/ctypes.rst:1191 msgid "Quoting the docs for that value:" msgstr "" -#: ../../library/ctypes.rst:1191 +#: ../../library/ctypes.rst:1193 msgid "" "This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " @@ -2352,13 +2360,13 @@ msgid "" "frozen modules." msgstr "" -#: ../../library/ctypes.rst:1196 +#: ../../library/ctypes.rst:1198 msgid "" "So manipulating this pointer could even prove useful. To restrict the " "example size, we show only how this table can be read with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1199 +#: ../../library/ctypes.rst:1201 msgid "" ">>> from ctypes import *\n" ">>>\n" @@ -2382,13 +2390,13 @@ msgstr "" "...\n" ">>>" -#: ../../library/ctypes.rst:1210 +#: ../../library/ctypes.rst:1212 msgid "" "We have defined the :c:struct:`_frozen` data type, so we can get the pointer " "to the table::" msgstr "" -#: ../../library/ctypes.rst:1213 +#: ../../library/ctypes.rst:1215 msgid "" ">>> FrozenTable = POINTER(struct_frozen)\n" ">>> table = FrozenTable.in_dll(pythonapi, \"_PyImport_FrozenBootstrap\")\n" @@ -2398,7 +2406,7 @@ msgstr "" ">>> table = FrozenTable.in_dll(pythonapi, \"_PyImport_FrozenBootstrap\")\n" ">>>" -#: ../../library/ctypes.rst:1217 +#: ../../library/ctypes.rst:1219 msgid "" "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " "we can iterate over it, but we just have to make sure that our loop " @@ -2407,7 +2415,7 @@ msgid "" "the loop when we hit the ``NULL`` entry::" msgstr "" -#: ../../library/ctypes.rst:1223 +#: ../../library/ctypes.rst:1225 msgid "" ">>> for item in table:\n" "... if item.name is None:\n" @@ -2429,28 +2437,28 @@ msgstr "" "zipimport 12345\n" ">>>" -#: ../../library/ctypes.rst:1233 +#: ../../library/ctypes.rst:1235 msgid "" "The fact that standard Python has a frozen module and a frozen package " "(indicated by the negative ``size`` member) is not well known, it is only " "used for testing. Try it out with ``import __hello__`` for example." msgstr "" -#: ../../library/ctypes.rst:1241 +#: ../../library/ctypes.rst:1243 msgid "Surprises" msgstr "" -#: ../../library/ctypes.rst:1243 +#: ../../library/ctypes.rst:1245 msgid "" "There are some edges in :mod:`ctypes` where you might expect something other " "than what actually happens." msgstr "" -#: ../../library/ctypes.rst:1246 +#: ../../library/ctypes.rst:1248 msgid "Consider the following example::" msgstr "" -#: ../../library/ctypes.rst:1248 +#: ../../library/ctypes.rst:1250 msgid "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" @@ -2488,13 +2496,13 @@ msgstr "" "3 4 3 4\n" ">>>" -#: ../../library/ctypes.rst:1266 +#: ../../library/ctypes.rst:1268 msgid "" "Hm. We certainly expected the last statement to print ``3 4 1 2``. What " "happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" msgstr "" -#: ../../library/ctypes.rst:1269 +#: ../../library/ctypes.rst:1271 msgid "" ">>> temp0, temp1 = rc.b, rc.a\n" ">>> rc.a = temp0\n" @@ -2506,7 +2514,7 @@ msgstr "" ">>> rc.b = temp1\n" ">>>" -#: ../../library/ctypes.rst:1274 +#: ../../library/ctypes.rst:1276 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " "buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " @@ -2515,20 +2523,20 @@ msgid "" "have the expected effect." msgstr "" -#: ../../library/ctypes.rst:1280 +#: ../../library/ctypes.rst:1282 msgid "" "Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays " "doesn't *copy* the sub-object, instead it retrieves a wrapper object " "accessing the root-object's underlying buffer." msgstr "" -#: ../../library/ctypes.rst:1284 +#: ../../library/ctypes.rst:1286 msgid "" "Another example that may behave differently from what one would expect is " "this::" msgstr "" -#: ../../library/ctypes.rst:1286 +#: ../../library/ctypes.rst:1288 msgid "" ">>> s = c_char_p()\n" ">>> s.value = b\"abc def ghi\"\n" @@ -2546,13 +2554,13 @@ msgstr "" "False\n" ">>>" -#: ../../library/ctypes.rst:1296 +#: ../../library/ctypes.rst:1298 msgid "" "Objects instantiated from :class:`c_char_p` can only have their value set to " "bytes or integers." msgstr "" -#: ../../library/ctypes.rst:1299 +#: ../../library/ctypes.rst:1301 msgid "" "Why is it printing ``False``? ctypes instances are objects containing a " "memory block plus some :term:`descriptor`\\s accessing the contents of the " @@ -2561,16 +2569,16 @@ msgid "" "the contents again constructs a new Python object each time!" msgstr "" -#: ../../library/ctypes.rst:1309 +#: ../../library/ctypes.rst:1311 msgid "Variable-sized data types" msgstr "" -#: ../../library/ctypes.rst:1311 +#: ../../library/ctypes.rst:1313 msgid "" ":mod:`ctypes` provides some support for variable-sized arrays and structures." msgstr "" -#: ../../library/ctypes.rst:1313 +#: ../../library/ctypes.rst:1315 msgid "" "The :func:`resize` function can be used to resize the memory buffer of an " "existing ctypes object. The function takes the object as first argument, " @@ -2579,7 +2587,7 @@ msgid "" "objects type, a :exc:`ValueError` is raised if this is tried::" msgstr "" -#: ../../library/ctypes.rst:1319 +#: ../../library/ctypes.rst:1321 msgid "" ">>> short_array = (c_short * 4)()\n" ">>> print(sizeof(short_array))\n" @@ -2609,14 +2617,14 @@ msgstr "" "8\n" ">>>" -#: ../../library/ctypes.rst:1333 +#: ../../library/ctypes.rst:1335 msgid "" "This is nice and fine, but how would one access the additional elements " "contained in this array? Since the type still only knows about 4 elements, " "we get errors accessing other elements::" msgstr "" -#: ../../library/ctypes.rst:1337 +#: ../../library/ctypes.rst:1339 msgid "" ">>> short_array[:]\n" "[0, 0, 0, 0]\n" @@ -2634,28 +2642,28 @@ msgstr "" "IndexError: invalid index\n" ">>>" -#: ../../library/ctypes.rst:1345 +#: ../../library/ctypes.rst:1347 msgid "" "Another way to use variable-sized data types with :mod:`ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " "required size is already known, on a case by case basis." msgstr "" -#: ../../library/ctypes.rst:1353 +#: ../../library/ctypes.rst:1355 msgid "ctypes reference" msgstr "" -#: ../../library/ctypes.rst:1359 +#: ../../library/ctypes.rst:1361 msgid "Finding shared libraries" msgstr "" -#: ../../library/ctypes.rst:1361 +#: ../../library/ctypes.rst:1363 msgid "" "When programming in a compiled language, shared libraries are accessed when " "compiling/linking a program, and when the program is run." msgstr "" -#: ../../library/ctypes.rst:1364 +#: ../../library/ctypes.rst:1366 msgid "" "The purpose of the :func:`~ctypes.util.find_library` function is to locate a " "library in a way similar to what the compiler or runtime loader does (on " @@ -2664,13 +2672,13 @@ msgid "" "and call the runtime loader directly." msgstr "" -#: ../../library/ctypes.rst:1370 +#: ../../library/ctypes.rst:1372 msgid "" "The :mod:`!ctypes.util` module provides a function which can help to " "determine the library to load." msgstr "" -#: ../../library/ctypes.rst:1378 +#: ../../library/ctypes.rst:1380 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version " @@ -2678,29 +2686,29 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1383 ../../library/ctypes.rst:2131 +#: ../../library/ctypes.rst:1385 ../../library/ctypes.rst:2133 msgid "The exact functionality is system dependent." msgstr "" -#: ../../library/ctypes.rst:1385 +#: ../../library/ctypes.rst:1387 msgid "" "On Linux, :func:`~ctypes.util.find_library` tries to run external programs " "(``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library " "file. It returns the filename of the library file." msgstr "" -#: ../../library/ctypes.rst:1389 +#: ../../library/ctypes.rst:1391 msgid "" "On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used " "when searching for libraries, if a library cannot be found by any other " "means." msgstr "" -#: ../../library/ctypes.rst:1393 +#: ../../library/ctypes.rst:1395 msgid "Here are some examples::" msgstr "以下是一些範例: ::" -#: ../../library/ctypes.rst:1395 +#: ../../library/ctypes.rst:1397 msgid "" ">>> from ctypes.util import find_library\n" ">>> find_library(\"m\")\n" @@ -2720,14 +2728,14 @@ msgstr "" "'libbz2.so.1.0'\n" ">>>" -#: ../../library/ctypes.rst:1404 +#: ../../library/ctypes.rst:1406 msgid "" "On macOS and Android, :func:`~ctypes.util.find_library` uses the system's " "standard naming schemes and paths to locate the library, and returns a full " "pathname if successful::" msgstr "" -#: ../../library/ctypes.rst:1408 +#: ../../library/ctypes.rst:1410 msgid "" ">>> from ctypes.util import find_library\n" ">>> find_library(\"c\")\n" @@ -2751,7 +2759,7 @@ msgstr "" "'/System/Library/Frameworks/AGL.framework/AGL'\n" ">>>" -#: ../../library/ctypes.rst:1419 +#: ../../library/ctypes.rst:1421 msgid "" "On Windows, :func:`~ctypes.util.find_library` searches along the system " "search path, and returns the full pathname, but since there is no predefined " @@ -2759,7 +2767,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/ctypes.rst:1423 +#: ../../library/ctypes.rst:1425 msgid "" "If wrapping a shared library with :mod:`ctypes`, it *may* be better to " "determine the shared library name at development time, and hardcode that " @@ -2767,18 +2775,18 @@ msgid "" "to locate the library at runtime." msgstr "" -#: ../../library/ctypes.rst:1431 +#: ../../library/ctypes.rst:1433 msgid "Listing loaded shared libraries" msgstr "" -#: ../../library/ctypes.rst:1433 +#: ../../library/ctypes.rst:1435 msgid "" "When writing code that relies on code loaded from shared libraries, it can " "be useful to know which shared libraries have already been loaded into the " "current process." msgstr "" -#: ../../library/ctypes.rst:1437 +#: ../../library/ctypes.rst:1439 msgid "" "The :mod:`!ctypes.util` module provides the :func:`~ctypes.util.dllist` " "function, which calls the different APIs provided by the various platforms " @@ -2786,7 +2794,7 @@ msgid "" "current process." msgstr "" -#: ../../library/ctypes.rst:1441 +#: ../../library/ctypes.rst:1443 msgid "" "The exact output of this function will be system dependent. On most " "platforms, the first entry of this list represents the current process " @@ -2794,7 +2802,7 @@ msgid "" "return may look like::" msgstr "" -#: ../../library/ctypes.rst:1446 +#: ../../library/ctypes.rst:1448 msgid "" ">>> from ctypes.util import dllist\n" ">>> dllist()\n" @@ -2806,24 +2814,24 @@ msgstr "" "['', 'linux-vdso.so.1', '/lib/x86_64-linux-gnu/libm.so.6', '/lib/x86_64-" "linux-gnu/libc.so.6', ... ]" -#: ../../library/ctypes.rst:1453 +#: ../../library/ctypes.rst:1455 msgid "Loading shared libraries" msgstr "" -#: ../../library/ctypes.rst:1455 +#: ../../library/ctypes.rst:1457 msgid "" "There are several ways to load shared libraries into the Python process. " "One way is to instantiate one of the following classes:" msgstr "" -#: ../../library/ctypes.rst:1461 +#: ../../library/ctypes.rst:1463 msgid "" "Instances of this class represent loaded shared libraries. Functions in " "these libraries use the standard C calling convention, and are assumed to " "return :c:expr:`int`." msgstr "" -#: ../../library/ctypes.rst:1465 +#: ../../library/ctypes.rst:1467 msgid "" "On Windows creating a :class:`CDLL` instance may fail even if the DLL name " "exists. When a dependent DLL of the loaded DLL is not found, a :exc:" @@ -2835,18 +2843,18 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1477 ../../library/ctypes.rst:1502 -#: ../../library/ctypes.rst:1515 ../../library/ctypes.rst:1533 +#: ../../library/ctypes.rst:1479 ../../library/ctypes.rst:1504 +#: ../../library/ctypes.rst:1517 ../../library/ctypes.rst:1535 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" -#: ../../library/ctypes.rst:1481 +#: ../../library/ctypes.rst:1483 msgid "" "`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." msgstr "" -#: ../../library/ctypes.rst:1487 +#: ../../library/ctypes.rst:1489 msgid "" "Instances of this class represent loaded shared libraries, functions in " "these libraries use the ``stdcall`` calling convention, and are assumed to " @@ -2856,38 +2864,38 @@ msgid "" "a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1494 ../../library/ctypes.rst:1511 -#: ../../library/ctypes.rst:1655 ../../library/ctypes.rst:1663 -#: ../../library/ctypes.rst:1835 ../../library/ctypes.rst:1887 -#: ../../library/ctypes.rst:2039 ../../library/ctypes.rst:2111 -#: ../../library/ctypes.rst:2120 ../../library/ctypes.rst:2145 -#: ../../library/ctypes.rst:2159 ../../library/ctypes.rst:2168 -#: ../../library/ctypes.rst:2177 ../../library/ctypes.rst:2192 -#: ../../library/ctypes.rst:2259 ../../library/ctypes.rst:2286 -#: ../../library/ctypes.rst:2686 ../../library/ctypes.rst:3104 +#: ../../library/ctypes.rst:1496 ../../library/ctypes.rst:1513 +#: ../../library/ctypes.rst:1657 ../../library/ctypes.rst:1665 +#: ../../library/ctypes.rst:1837 ../../library/ctypes.rst:1889 +#: ../../library/ctypes.rst:2041 ../../library/ctypes.rst:2113 +#: ../../library/ctypes.rst:2122 ../../library/ctypes.rst:2147 +#: ../../library/ctypes.rst:2161 ../../library/ctypes.rst:2170 +#: ../../library/ctypes.rst:2179 ../../library/ctypes.rst:2194 +#: ../../library/ctypes.rst:2261 ../../library/ctypes.rst:2288 +#: ../../library/ctypes.rst:2688 ../../library/ctypes.rst:3106 msgid "Availability" msgstr "可用性" -#: ../../library/ctypes.rst:1496 +#: ../../library/ctypes.rst:1498 msgid "" ":exc:`WindowsError` used to be raised, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/ctypes.rst:1507 +#: ../../library/ctypes.rst:1509 msgid "" "Instances of this class represent loaded shared libraries, functions in " "these libraries use the ``stdcall`` calling convention, and are assumed to " "return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1518 +#: ../../library/ctypes.rst:1520 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1524 +#: ../../library/ctypes.rst:1526 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -2895,11 +2903,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1529 +#: ../../library/ctypes.rst:1531 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1535 +#: ../../library/ctypes.rst:1537 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " @@ -2909,7 +2917,7 @@ msgid "" "the process, and to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1542 +#: ../../library/ctypes.rst:1544 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -2917,7 +2925,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1547 +#: ../../library/ctypes.rst:1549 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:" @@ -2927,14 +2935,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1554 +#: ../../library/ctypes.rst:1556 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " "private copy to a new value and returns the former value." msgstr "" -#: ../../library/ctypes.rst:1558 +#: ../../library/ctypes.rst:1560 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" @@ -2943,7 +2951,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1564 +#: ../../library/ctypes.rst:1566 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -2953,29 +2961,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1571 +#: ../../library/ctypes.rst:1573 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1578 +#: ../../library/ctypes.rst:1580 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." msgstr "" -#: ../../library/ctypes.rst:1585 +#: ../../library/ctypes.rst:1587 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." msgstr "" -#: ../../library/ctypes.rst:1592 +#: ../../library/ctypes.rst:1594 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." msgstr "" -#: ../../library/ctypes.rst:1595 +#: ../../library/ctypes.rst:1597 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -2984,7 +2992,7 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1601 +#: ../../library/ctypes.rst:1603 msgid "" ">>> from ctypes import CDLL\n" ">>> libc = CDLL(\"libc.so.6\") # On Linux\n" @@ -3000,21 +3008,21 @@ msgstr "" ">>> libc['time'] == libc['time']\n" "False" -#: ../../library/ctypes.rst:1608 +#: ../../library/ctypes.rst:1610 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1614 +#: ../../library/ctypes.rst:1616 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1619 +#: ../../library/ctypes.rst:1621 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1621 +#: ../../library/ctypes.rst:1623 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -3022,13 +3030,13 @@ msgid "" "library as attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1629 +#: ../../library/ctypes.rst:1631 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: ../../library/ctypes.rst:1632 +#: ../../library/ctypes.rst:1634 msgid "" ":meth:`!__getattr__` has special behavior: It allows loading a shared " "library by accessing it as attribute of a library loader instance. The " @@ -3036,39 +3044,39 @@ msgid "" "each time." msgstr "" -#: ../../library/ctypes.rst:1638 +#: ../../library/ctypes.rst:1640 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." msgstr "" -#: ../../library/ctypes.rst:1642 +#: ../../library/ctypes.rst:1644 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1647 +#: ../../library/ctypes.rst:1649 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1653 +#: ../../library/ctypes.rst:1655 msgid "Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1661 +#: ../../library/ctypes.rst:1663 msgid "Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1669 +#: ../../library/ctypes.rst:1671 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1672 +#: ../../library/ctypes.rst:1674 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1678 +#: ../../library/ctypes.rst:1680 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:expr:" @@ -3076,32 +3084,32 @@ msgid "" "correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1683 ../../library/ctypes.rst:1685 +#: ../../library/ctypes.rst:1685 ../../library/ctypes.rst:1687 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: ../../library/ctypes.rst:1689 ../../library/ctypes.rst:1691 +#: ../../library/ctypes.rst:1691 ../../library/ctypes.rst:1693 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1695 ../../library/ctypes.rst:1697 +#: ../../library/ctypes.rst:1697 ../../library/ctypes.rst:1699 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: ../../library/ctypes.rst:1704 +#: ../../library/ctypes.rst:1706 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1706 +#: ../../library/ctypes.rst:1708 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -3110,13 +3118,13 @@ msgid "" "library loader." msgstr "" -#: ../../library/ctypes.rst:1711 +#: ../../library/ctypes.rst:1713 msgid "" "They are instances of a private local class :class:`!_FuncPtr` (not exposed " "in :mod:`!ctypes`) which inherits from the private :class:`_CFuncPtr` class:" msgstr "" -#: ../../library/ctypes.rst:1714 +#: ../../library/ctypes.rst:1716 msgid "" ">>> import ctypes\n" ">>> lib = ctypes.CDLL(None)\n" @@ -3132,29 +3140,29 @@ msgstr "" ">>> lib._FuncPtr is ctypes._CFuncPtr\n" "False" -#: ../../library/ctypes.rst:1725 +#: ../../library/ctypes.rst:1727 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1727 +#: ../../library/ctypes.rst:1729 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1730 +#: ../../library/ctypes.rst:1732 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1735 +#: ../../library/ctypes.rst:1737 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1738 +#: ../../library/ctypes.rst:1740 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " @@ -3164,7 +3172,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1747 +#: ../../library/ctypes.rst:1749 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -3173,7 +3181,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1753 +#: ../../library/ctypes.rst:1755 msgid "" "When a foreign function is called, each actual argument is passed to the :" "meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " @@ -3183,7 +3191,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1760 +#: ../../library/ctypes.rst:1762 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`~_CData.from_param` method which returns a " @@ -3191,38 +3199,38 @@ msgid "" "defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1767 +#: ../../library/ctypes.rst:1769 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: ../../library/ctypes.rst:1774 +#: ../../library/ctypes.rst:1776 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1777 +#: ../../library/ctypes.rst:1779 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: ../../library/ctypes.rst:1781 +#: ../../library/ctypes.rst:1783 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: ../../library/ctypes.rst:1785 +#: ../../library/ctypes.rst:1787 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: ../../library/ctypes.rst:1790 ../../library/ctypes.rst:1792 +#: ../../library/ctypes.rst:1792 ../../library/ctypes.rst:1794 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -3231,18 +3239,18 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1798 ../../library/ctypes.rst:1800 +#: ../../library/ctypes.rst:1800 ../../library/ctypes.rst:1802 msgid "" "Some ways to invoke foreign function calls as well as some of the functions " "in this module may raise an auditing event ``ctypes.call_function`` with " "arguments ``function pointer`` and ``arguments``." msgstr "" -#: ../../library/ctypes.rst:1807 +#: ../../library/ctypes.rst:1809 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1809 +#: ../../library/ctypes.rst:1811 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -3253,7 +3261,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1820 +#: ../../library/ctypes.rst:1822 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -3262,37 +3270,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1830 +#: ../../library/ctypes.rst:1832 msgid "" "The returned function prototype creates functions that use the ``stdcall`` " "calling convention. The function will release the GIL during the call. " "*use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: ../../library/ctypes.rst:1840 +#: ../../library/ctypes.rst:1842 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: ../../library/ctypes.rst:1843 +#: ../../library/ctypes.rst:1845 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " "call:" msgstr "" -#: ../../library/ctypes.rst:1850 +#: ../../library/ctypes.rst:1852 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1857 +#: ../../library/ctypes.rst:1859 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1864 +#: ../../library/ctypes.rst:1866 msgid "" "Returns a foreign function exported by a shared library. *func_spec* must be " "a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " @@ -3300,7 +3308,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1874 +#: ../../library/ctypes.rst:1876 msgid "" "Returns a foreign function that will call a COM method. *vtbl_index* is the " "index into the virtual function table, a small non-negative integer. *name* " @@ -3308,86 +3316,86 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1879 +#: ../../library/ctypes.rst:1881 msgid "" "If *iid* is not specified, an :exc:`OSError` is raised if the COM method " "call fails. If *iid* is specified, a :exc:`~ctypes.COMError` is raised " "instead." msgstr "" -#: ../../library/ctypes.rst:1883 +#: ../../library/ctypes.rst:1885 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " "specified in the :attr:`!argtypes` tuple." msgstr "" -#: ../../library/ctypes.rst:1890 +#: ../../library/ctypes.rst:1892 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1893 +#: ../../library/ctypes.rst:1895 msgid "" "*paramflags* must be a tuple of the same length as :attr:`~_CFuncPtr." "argtypes`." msgstr "" -#: ../../library/ctypes.rst:1895 +#: ../../library/ctypes.rst:1897 msgid "" "Each item in this tuple contains further information about a parameter, it " "must be a tuple containing one, two, or three items." msgstr "" -#: ../../library/ctypes.rst:1898 +#: ../../library/ctypes.rst:1900 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1901 +#: ../../library/ctypes.rst:1903 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1902 +#: ../../library/ctypes.rst:1904 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1904 +#: ../../library/ctypes.rst:1906 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1905 +#: ../../library/ctypes.rst:1907 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1907 +#: ../../library/ctypes.rst:1909 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1908 +#: ../../library/ctypes.rst:1910 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1910 +#: ../../library/ctypes.rst:1912 msgid "" "The optional second item is the parameter name as string. If this is " "specified, the foreign function can be called with named parameters." msgstr "" -#: ../../library/ctypes.rst:1913 +#: ../../library/ctypes.rst:1915 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1916 +#: ../../library/ctypes.rst:1918 msgid "" "The following example demonstrates how to wrap the Windows ``MessageBoxW`` " "function so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: ../../library/ctypes.rst:1920 +#: ../../library/ctypes.rst:1922 msgid "" "WINUSERAPI int WINAPI\n" "MessageBoxW(\n" @@ -3403,11 +3411,11 @@ msgstr "" " LPCWSTR lpCaption,\n" " UINT uType);" -#: ../../library/ctypes.rst:1927 ../../library/ctypes.rst:1950 +#: ../../library/ctypes.rst:1929 ../../library/ctypes.rst:1952 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1929 +#: ../../library/ctypes.rst:1931 msgid "" ">>> from ctypes import c_int, WINFUNCTYPE, windll\n" ">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" @@ -3423,11 +3431,11 @@ msgstr "" "\"Hello from ctypes\"), (1, \"flags\", 0)\n" ">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" -#: ../../library/ctypes.rst:1935 +#: ../../library/ctypes.rst:1937 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1937 +#: ../../library/ctypes.rst:1939 msgid "" ">>> MessageBox()\n" ">>> MessageBox(text=\"Spam, spam, spam\")\n" @@ -3437,7 +3445,7 @@ msgstr "" ">>> MessageBox(text=\"Spam, spam, spam\")\n" ">>> MessageBox(flags=2, text=\"foo bar\")" -#: ../../library/ctypes.rst:1941 +#: ../../library/ctypes.rst:1943 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -3445,7 +3453,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1945 +#: ../../library/ctypes.rst:1947 msgid "" "WINUSERAPI BOOL WINAPI\n" "GetWindowRect(\n" @@ -3457,7 +3465,7 @@ msgstr "" " HWND hWnd,\n" " LPRECT lpRect);" -#: ../../library/ctypes.rst:1952 +#: ../../library/ctypes.rst:1954 msgid "" ">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" ">>> from ctypes.wintypes import BOOL, HWND, RECT\n" @@ -3475,7 +3483,7 @@ msgstr "" "paramflags)\n" ">>>" -#: ../../library/ctypes.rst:1959 +#: ../../library/ctypes.rst:1961 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -3483,7 +3491,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1964 +#: ../../library/ctypes.rst:1966 msgid "" "Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " @@ -3492,7 +3500,7 @@ msgid "" "exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1969 +#: ../../library/ctypes.rst:1971 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3510,7 +3518,7 @@ msgstr "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -#: ../../library/ctypes.rst:1977 +#: ../../library/ctypes.rst:1979 msgid "" "If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`ctypes` continues the normal processing it does on " @@ -3519,7 +3527,7 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1983 +#: ../../library/ctypes.rst:1985 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3539,17 +3547,17 @@ msgstr "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -#: ../../library/ctypes.rst:1996 +#: ../../library/ctypes.rst:1998 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:2000 +#: ../../library/ctypes.rst:2002 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:2003 +#: ../../library/ctypes.rst:2005 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -3557,46 +3565,46 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:2008 +#: ../../library/ctypes.rst:2010 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:2014 +#: ../../library/ctypes.rst:2016 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: ../../library/ctypes.rst:2018 +#: ../../library/ctypes.rst:2020 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:2020 +#: ../../library/ctypes.rst:2022 msgid "(((char *)&obj) + offset)" msgstr "(((char *)&obj) + offset)" -#: ../../library/ctypes.rst:2022 +#: ../../library/ctypes.rst:2024 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: ../../library/ctypes.rst:2028 +#: ../../library/ctypes.rst:2030 msgid "" "Copies a COM pointer from *src* to *dst* and returns the Windows specific :c:" "type:`!HRESULT` value." msgstr "" -#: ../../library/ctypes.rst:2031 +#: ../../library/ctypes.rst:2033 msgid "" "If *src* is not ``NULL``, its ``AddRef`` method is called, incrementing the " "reference count." msgstr "" -#: ../../library/ctypes.rst:2034 +#: ../../library/ctypes.rst:2036 msgid "" "In contrast, the reference count of *dst* will not be decremented before " "assigning the new value. Unless *dst* is ``NULL``, the caller is responsible " @@ -3604,7 +3612,7 @@ msgid "" "necessary." msgstr "" -#: ../../library/ctypes.rst:2046 +#: ../../library/ctypes.rst:2048 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -3612,47 +3620,47 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:2055 +#: ../../library/ctypes.rst:2057 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:2058 +#: ../../library/ctypes.rst:2060 msgid "" "If *size* is given (and not ``None``), it must be an :class:`int`. It " "specifies the size of the returned array." msgstr "" -#: ../../library/ctypes.rst:2061 +#: ../../library/ctypes.rst:2063 msgid "" "If the *init* argument is given, it must be :class:`bytes`. It is used to " "initialize the array items. Bytes not initialized this way are set to zero " "(NUL)." msgstr "" -#: ../../library/ctypes.rst:2065 +#: ../../library/ctypes.rst:2067 msgid "" "If *size* is not given (or if it is ``None``), the buffer is made one " "element larger than *init*, effectively adding a NUL terminator." msgstr "" -#: ../../library/ctypes.rst:2068 +#: ../../library/ctypes.rst:2070 msgid "" "If both arguments are given, *size* must not be less than ``len(init)``." msgstr "如果兩個引數皆有提供,*size* 不得小於 ``len(init)``。" -#: ../../library/ctypes.rst:2072 +#: ../../library/ctypes.rst:2074 msgid "" "If *size* is equal to ``len(init)``, a NUL terminator is not added. Do not " "treat such a buffer as a C string." msgstr "" -#: ../../library/ctypes.rst:2075 +#: ../../library/ctypes.rst:2077 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/ctypes.rst:2077 +#: ../../library/ctypes.rst:2079 msgid "" ">>> bytes(create_string_buffer(2))\n" "b'\\x00\\x00'\n" @@ -3680,7 +3688,7 @@ msgstr "" " ...\n" "ValueError: byte string too long" -#: ../../library/ctypes.rst:2090 +#: ../../library/ctypes.rst:2092 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -3688,19 +3696,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:2096 +#: ../../library/ctypes.rst:2098 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:2099 +#: ../../library/ctypes.rst:2101 msgid "" "The function takes the same arguments as :func:`~create_string_buffer` " "except *init* must be a string and *size* counts :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:2102 +#: ../../library/ctypes.rst:2104 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -3708,21 +3716,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:2107 +#: ../../library/ctypes.rst:2109 msgid "" "This function is a hook which allows implementing in-process COM servers " "with ctypes. It is called from the DllCanUnloadNow function that the " "_ctypes extension dll exports." msgstr "" -#: ../../library/ctypes.rst:2116 +#: ../../library/ctypes.rst:2118 msgid "" "This function is a hook which allows implementing in-process COM servers " "with ctypes. It is called from the DllGetClassObject function that the " "``_ctypes`` extension dll exports." msgstr "" -#: ../../library/ctypes.rst:2126 +#: ../../library/ctypes.rst:2128 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -3730,21 +3738,21 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:2137 +#: ../../library/ctypes.rst:2139 msgid "" "Returns the filename of the VC runtime library used by Python, and by the " "extension modules. If the name of the library cannot be determined, " "``None`` is returned." msgstr "" -#: ../../library/ctypes.rst:2141 +#: ../../library/ctypes.rst:2143 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: ../../library/ctypes.rst:2151 +#: ../../library/ctypes.rst:2153 msgid "" "Try to provide a list of paths of the shared libraries loaded into the " "current process. These paths are not normalized or processed in any way. " @@ -3752,74 +3760,74 @@ msgid "" "The exact functionality is system dependent." msgstr "" -#: ../../library/ctypes.rst:2156 +#: ../../library/ctypes.rst:2158 msgid "" "On most platforms, the first element of the list represents the current " "executable file. It may be an empty string." msgstr "" -#: ../../library/ctypes.rst:2164 +#: ../../library/ctypes.rst:2166 msgid "" "Returns a textual description of the error code *code*. If no error code is " "specified, the last error code is used by calling the Windows API function :" "func:`GetLastError`." msgstr "" -#: ../../library/ctypes.rst:2173 +#: ../../library/ctypes.rst:2175 msgid "" "Returns the last error code set by Windows in the calling thread. This " "function calls the Windows ``GetLastError()`` function directly, it does not " "return the ctypes-private copy of the error code." msgstr "" -#: ../../library/ctypes.rst:2182 +#: ../../library/ctypes.rst:2184 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2185 +#: ../../library/ctypes.rst:2187 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2189 +#: ../../library/ctypes.rst:2191 msgid "" "Returns the current value of the ctypes-private copy of the system :data:`!" "LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2194 +#: ../../library/ctypes.rst:2196 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2199 +#: ../../library/ctypes.rst:2201 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: ../../library/ctypes.rst:2206 +#: ../../library/ctypes.rst:2208 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: ../../library/ctypes.rst:2213 +#: ../../library/ctypes.rst:2215 msgid "" "Create or return a ctypes pointer type. Pointer types are cached and reused " "internally, so calling this function repeatedly is cheap. *type* must be a " "ctypes type." msgstr "" -#: ../../library/ctypes.rst:2219 +#: ../../library/ctypes.rst:2221 msgid "" "The resulting pointer type is cached in the ``__pointer_type__`` attribute " "of *type*. It is possible to set this attribute before the first call to " @@ -3828,19 +3836,19 @@ msgid "" "relying on implementation details that may change in future Python versions." msgstr "" -#: ../../library/ctypes.rst:2230 +#: ../../library/ctypes.rst:2232 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2233 +#: ../../library/ctypes.rst:2235 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: ../../library/ctypes.rst:2239 +#: ../../library/ctypes.rst:2241 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -3848,13 +3856,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2247 +#: ../../library/ctypes.rst:2249 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:2250 +#: ../../library/ctypes.rst:2252 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -3862,14 +3870,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2255 +#: ../../library/ctypes.rst:2257 msgid "" "Sets the current value of the ctypes-private copy of the system :data:`!" "LastError` variable in the calling thread to *value* and return the previous " "value." msgstr "" -#: ../../library/ctypes.rst:2261 +#: ../../library/ctypes.rst:2263 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -3877,19 +3885,19 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_last_error``。" -#: ../../library/ctypes.rst:2266 +#: ../../library/ctypes.rst:2268 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: ../../library/ctypes.rst:2272 +#: ../../library/ctypes.rst:2274 msgid "" "Return the byte string at *void \\*ptr*. If *size* is specified, it is used " "as size, otherwise the string is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2276 +#: ../../library/ctypes.rst:2278 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``ptr``, ``size``." @@ -3897,7 +3905,7 @@ msgstr "" "引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` ``ctypes." "string_at``。" -#: ../../library/ctypes.rst:2281 +#: ../../library/ctypes.rst:2283 msgid "" "Creates an instance of :exc:`OSError`. If *code* is not specified, :func:" "`GetLastError` is called to determine the error code. If *descr* is not " @@ -3905,20 +3913,20 @@ msgid "" "error." msgstr "" -#: ../../library/ctypes.rst:2288 +#: ../../library/ctypes.rst:2290 msgid "" "An instance of :exc:`WindowsError` used to be created, which is now an alias " "of :exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:2295 +#: ../../library/ctypes.rst:2297 msgid "" "Return the wide-character string at *void \\*ptr*. If *size* is specified, " "it is used as the number of characters of the string, otherwise the string " "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2300 +#: ../../library/ctypes.rst:2302 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``ptr``, ``size``." @@ -3926,20 +3934,20 @@ msgstr "" "引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` ``ctypes." "wstring_at``。" -#: ../../library/ctypes.rst:2305 +#: ../../library/ctypes.rst:2307 msgid "" "Return a :class:`memoryview` object of length *size* that references memory " "starting at *void \\*ptr*." msgstr "" -#: ../../library/ctypes.rst:2308 +#: ../../library/ctypes.rst:2310 msgid "" "If *readonly* is true, the returned :class:`!memoryview` object can not be " "used to modify the underlying memory. (Changes made by other means will " "still be reflected in the returned object.)" msgstr "" -#: ../../library/ctypes.rst:2313 +#: ../../library/ctypes.rst:2315 msgid "" "This function is similar to :func:`string_at` with the key difference of not " "making a copy of the specified memory. It is a semantically equivalent (but " @@ -3949,7 +3957,7 @@ msgid "" "`~ctypes.byref` object.)" msgstr "" -#: ../../library/ctypes.rst:2320 +#: ../../library/ctypes.rst:2322 msgid "" "Raises an :ref:`auditing event ` ``ctypes.memoryview_at`` with " "arguments ``address``, ``size``, ``readonly``." @@ -3957,11 +3965,11 @@ msgstr "" "引發一個附帶引數 ``address``、``size`` 與 ``readonly`` 的\\ :ref:`稽核事件 " "` ``ctypes.memoryview_at``。" -#: ../../library/ctypes.rst:2328 +#: ../../library/ctypes.rst:2330 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2333 +#: ../../library/ctypes.rst:2335 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -3971,13 +3979,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2340 +#: ../../library/ctypes.rst:2342 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: ../../library/ctypes.rst:2345 +#: ../../library/ctypes.rst:2347 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -3986,7 +3994,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2351 ../../library/ctypes.rst:2361 +#: ../../library/ctypes.rst:2353 ../../library/ctypes.rst:2363 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -3994,7 +4002,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2355 +#: ../../library/ctypes.rst:2357 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -4002,19 +4010,19 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2365 +#: ../../library/ctypes.rst:2367 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2368 ../../library/ctypes.rst:2370 +#: ../../library/ctypes.rst:2370 ../../library/ctypes.rst:2372 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2376 +#: ../../library/ctypes.rst:2378 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " @@ -4022,36 +4030,36 @@ msgid "" "object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2381 +#: ../../library/ctypes.rst:2383 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: ../../library/ctypes.rst:2387 +#: ../../library/ctypes.rst:2389 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: ../../library/ctypes.rst:2391 +#: ../../library/ctypes.rst:2393 msgid "Common class variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2395 +#: ../../library/ctypes.rst:2397 msgid "" "The pointer type that was created by calling :func:`POINTER` for " "corresponding ctypes data type. If a pointer type was not yet created, the " "attribute is missing." msgstr "" -#: ../../library/ctypes.rst:2401 +#: ../../library/ctypes.rst:2403 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2405 +#: ../../library/ctypes.rst:2407 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -4059,13 +4067,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2412 +#: ../../library/ctypes.rst:2414 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2417 +#: ../../library/ctypes.rst:2419 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -4073,7 +4081,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2430 +#: ../../library/ctypes.rst:2432 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -4082,11 +4090,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2436 +#: ../../library/ctypes.rst:2438 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2440 +#: ../../library/ctypes.rst:2442 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -4094,7 +4102,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2445 +#: ../../library/ctypes.rst:2447 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -4102,7 +4110,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2451 +#: ../../library/ctypes.rst:2453 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -4112,7 +4120,7 @@ msgid "" "instance." msgstr "" -#: ../../library/ctypes.rst:2459 +#: ../../library/ctypes.rst:2461 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " @@ -4120,25 +4128,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2464 +#: ../../library/ctypes.rst:2466 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2468 +#: ../../library/ctypes.rst:2470 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2475 +#: ../../library/ctypes.rst:2477 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2482 +#: ../../library/ctypes.rst:2484 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -4146,204 +4154,204 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2490 +#: ../../library/ctypes.rst:2492 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2496 +#: ../../library/ctypes.rst:2498 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2502 +#: ../../library/ctypes.rst:2504 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2508 +#: ../../library/ctypes.rst:2510 msgid "" "Represents the C :c:expr:`double complex` datatype, if available. The " "constructor accepts an optional :class:`complex` initializer." msgstr "" -#: ../../library/ctypes.rst:2516 +#: ../../library/ctypes.rst:2518 msgid "" "Represents the C :c:expr:`float complex` datatype, if available. The " "constructor accepts an optional :class:`complex` initializer." msgstr "" -#: ../../library/ctypes.rst:2524 +#: ../../library/ctypes.rst:2526 msgid "" "Represents the C :c:expr:`long double complex` datatype, if available. The " "constructor accepts an optional :class:`complex` initializer." msgstr "" -#: ../../library/ctypes.rst:2532 +#: ../../library/ctypes.rst:2534 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2539 +#: ../../library/ctypes.rst:2541 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. It is an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2545 +#: ../../library/ctypes.rst:2547 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2551 +#: ../../library/ctypes.rst:2553 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2557 +#: ../../library/ctypes.rst:2559 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2563 +#: ../../library/ctypes.rst:2565 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2569 +#: ../../library/ctypes.rst:2571 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2575 +#: ../../library/ctypes.rst:2577 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2581 +#: ../../library/ctypes.rst:2583 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2586 +#: ../../library/ctypes.rst:2588 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2593 +#: ../../library/ctypes.rst:2595 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2600 +#: ../../library/ctypes.rst:2602 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2607 +#: ../../library/ctypes.rst:2609 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2614 +#: ../../library/ctypes.rst:2616 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. It is an alias for :" "class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2620 +#: ../../library/ctypes.rst:2622 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2626 +#: ../../library/ctypes.rst:2628 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2632 +#: ../../library/ctypes.rst:2634 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2638 +#: ../../library/ctypes.rst:2640 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2644 +#: ../../library/ctypes.rst:2646 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2650 +#: ../../library/ctypes.rst:2652 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2656 +#: ../../library/ctypes.rst:2658 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2662 +#: ../../library/ctypes.rst:2664 msgid "" "Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2669 +#: ../../library/ctypes.rst:2671 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2676 +#: ../../library/ctypes.rst:2678 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2683 +#: ../../library/ctypes.rst:2685 msgid "" "Represents a :c:type:`!HRESULT` value, which contains success or error " "information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2691 +#: ../../library/ctypes.rst:2693 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2694 +#: ../../library/ctypes.rst:2696 msgid ":class:`!py_object` is now a :term:`generic type`." msgstr "" -#: ../../library/ctypes.rst:2697 +#: ../../library/ctypes.rst:2699 msgid "" "The :mod:`!ctypes.wintypes` module provides quite some other Windows " "specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" @@ -4351,47 +4359,47 @@ msgid "" "are also defined." msgstr "" -#: ../../library/ctypes.rst:2705 +#: ../../library/ctypes.rst:2707 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2710 +#: ../../library/ctypes.rst:2712 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2712 +#: ../../library/ctypes.rst:2714 msgid "" "Unions share common attributes and behavior with structures; see :class:" "`Structure` documentation for details." msgstr "" -#: ../../library/ctypes.rst:2717 +#: ../../library/ctypes.rst:2719 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2723 +#: ../../library/ctypes.rst:2725 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2729 +#: ../../library/ctypes.rst:2731 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2734 +#: ../../library/ctypes.rst:2736 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2736 +#: ../../library/ctypes.rst:2738 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2742 +#: ../../library/ctypes.rst:2744 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2744 +#: ../../library/ctypes.rst:2746 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -4399,34 +4407,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2752 +#: ../../library/ctypes.rst:2754 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: ../../library/ctypes.rst:2756 +#: ../../library/ctypes.rst:2758 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: ../../library/ctypes.rst:2760 +#: ../../library/ctypes.rst:2762 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: ../../library/ctypes.rst:2763 +#: ../../library/ctypes.rst:2765 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: ../../library/ctypes.rst:2767 +#: ../../library/ctypes.rst:2769 msgid "" "class List(Structure):\n" " pass\n" @@ -4440,13 +4448,13 @@ msgstr "" " ...\n" " ]" -#: ../../library/ctypes.rst:2773 +#: ../../library/ctypes.rst:2775 msgid "" "The :attr:`!_fields_` class variable can only be set once. Later assignments " "will raise an :exc:`AttributeError`." msgstr "" -#: ../../library/ctypes.rst:2776 +#: ../../library/ctypes.rst:2778 msgid "" "Additionally, the :attr:`!_fields_` class variable must be defined before " "the structure or union type is first used: an instance or subclass is " @@ -4456,25 +4464,25 @@ msgid "" "fields, as if :attr:`!_fields_` was empty." msgstr "" -#: ../../library/ctypes.rst:2784 +#: ../../library/ctypes.rst:2786 msgid "" "Sub-subclasses of structure types inherit the fields of the base class plus " "the :attr:`_fields_` defined in the sub-subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2790 +#: ../../library/ctypes.rst:2792 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance." msgstr "" -#: ../../library/ctypes.rst:2793 +#: ../../library/ctypes.rst:2795 msgid "" "This is only implemented for the MSVC-compatible memory layout (see :attr:" "`_layout_`)." msgstr "" -#: ../../library/ctypes.rst:2796 +#: ../../library/ctypes.rst:2798 msgid "" "Setting :attr:`!_pack_` to 0 is the same as not setting it at all. " "Otherwise, the value must be a positive power of two. The effect is " @@ -4482,13 +4490,13 @@ msgid "" "larger *n* than what the compiler accepts." msgstr "" -#: ../../library/ctypes.rst:2801 +#: ../../library/ctypes.rst:2803 msgid "" ":attr:`!_pack_` must already be defined when :attr:`_fields_` is assigned, " "otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2806 +#: ../../library/ctypes.rst:2808 msgid "" "For historical reasons, if :attr:`!_pack_` is non-zero, the MSVC-compatible " "layout will be used by default. On non-Windows platforms, this default is " @@ -4496,57 +4504,57 @@ msgid "" "intended, set :attr:`~Structure._layout_` to ``'ms'`` explicitly." msgstr "" -#: ../../library/ctypes.rst:2815 +#: ../../library/ctypes.rst:2817 msgid "" "An optional small integer that allows increasing the alignment of the " "structure when being packed or unpacked to/from memory." msgstr "" -#: ../../library/ctypes.rst:2818 +#: ../../library/ctypes.rst:2820 msgid "" "The value must not be negative. The effect is equivalent to " "``__attribute__((aligned(N)))`` on GCC or ``#pragma align(N)`` on MSVC, " "except :mod:`ctypes` may allow values that the compiler would reject." msgstr "" -#: ../../library/ctypes.rst:2823 +#: ../../library/ctypes.rst:2825 msgid "" ":attr:`!_align_` can only *increase* a structure's alignment requirements. " "Setting it to 0 or 1 has no effect." msgstr "" -#: ../../library/ctypes.rst:2826 +#: ../../library/ctypes.rst:2828 msgid "" "Using values that are not powers of two is discouraged and may lead to " "surprising behavior." msgstr "" -#: ../../library/ctypes.rst:2829 +#: ../../library/ctypes.rst:2831 msgid "" ":attr:`!_align_` must already be defined when :attr:`_fields_` is assigned, " "otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2836 +#: ../../library/ctypes.rst:2838 msgid "" "An optional string naming the struct/union layout. It can currently be set " "to:" msgstr "" -#: ../../library/ctypes.rst:2839 +#: ../../library/ctypes.rst:2841 msgid "" "``\"ms\"``: the layout used by the Microsoft compiler (MSVC). On GCC and " "Clang, this layout can be selected with ``__attribute__((ms_struct))``." msgstr "" -#: ../../library/ctypes.rst:2842 +#: ../../library/ctypes.rst:2844 msgid "" "``\"gcc-sysv\"``: the layout used by GCC with the System V or “SysV-like” " "data model, as used on Linux and macOS. With this layout, :attr:`~Structure." "_pack_` must be unset or zero." msgstr "" -#: ../../library/ctypes.rst:2846 +#: ../../library/ctypes.rst:2848 msgid "" "If not set explicitly, ``ctypes`` will use a default that matches the " "platform conventions. This default may change in future Python releases (for " @@ -4554,34 +4562,34 @@ msgid "" "between similar platforms is found). Currently the default will be:" msgstr "" -#: ../../library/ctypes.rst:2852 +#: ../../library/ctypes.rst:2854 msgid "On Windows: ``\"ms\"``" msgstr "" -#: ../../library/ctypes.rst:2853 +#: ../../library/ctypes.rst:2855 msgid "" "When :attr:`~Structure._pack_` is specified: ``\"ms\"``. (This is " "deprecated; see :attr:`~Structure._pack_` documentation.)" msgstr "" -#: ../../library/ctypes.rst:2855 +#: ../../library/ctypes.rst:2857 msgid "Otherwise: ``\"gcc-sysv\"``" msgstr "" -#: ../../library/ctypes.rst:2857 +#: ../../library/ctypes.rst:2859 msgid "" ":attr:`!_layout_` must already be defined when :attr:`~Structure._fields_` " "is assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2864 +#: ../../library/ctypes.rst:2866 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2868 +#: ../../library/ctypes.rst:2870 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -4589,11 +4597,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2873 +#: ../../library/ctypes.rst:2875 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2875 +#: ../../library/ctypes.rst:2877 msgid "" "class _U(Union):\n" " _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" @@ -4615,7 +4623,7 @@ msgstr "" " _fields_ = [(\"u\", _U),\n" " (\"vt\", VARTYPE)]" -#: ../../library/ctypes.rst:2886 +#: ../../library/ctypes.rst:2888 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -4625,7 +4633,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2893 +#: ../../library/ctypes.rst:2895 msgid "" "td = TYPEDESC()\n" "td.vt = VT_PTR\n" @@ -4637,7 +4645,7 @@ msgstr "" "td.lptdesc = POINTER(some_type)\n" "td.u.lptdesc = POINTER(some_type)" -#: ../../library/ctypes.rst:2898 +#: ../../library/ctypes.rst:2900 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -4645,7 +4653,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2903 +#: ../../library/ctypes.rst:2905 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -4655,13 +4663,13 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2913 +#: ../../library/ctypes.rst:2915 msgid "" "Descriptor for fields of a :class:`Structure` and :class:`Union`. For " "example::" msgstr "" -#: ../../library/ctypes.rst:2916 +#: ../../library/ctypes.rst:2918 msgid "" ">>> class Color(Structure):\n" "... _fields_ = (\n" @@ -4703,100 +4711,100 @@ msgstr "" ">>> Color.blinking.bit_offset\n" "1" -#: ../../library/ctypes.rst:2936 +#: ../../library/ctypes.rst:2938 msgid "All attributes are read-only." msgstr "" -#: ../../library/ctypes.rst:2938 +#: ../../library/ctypes.rst:2940 msgid "" ":class:`!CField` objects are created via :attr:`~Structure._fields_`; do not " "instantiate the class directly." msgstr "" -#: ../../library/ctypes.rst:2943 +#: ../../library/ctypes.rst:2945 msgid "" "Previously, descriptors only had ``offset`` and ``size`` attributes and a " "readable string representation; the :class:`!CField` class was not available " "directly." msgstr "" -#: ../../library/ctypes.rst:2949 +#: ../../library/ctypes.rst:2951 msgid "Name of the field, as a string." msgstr "" -#: ../../library/ctypes.rst:2953 +#: ../../library/ctypes.rst:2955 msgid "Type of the field, as a :ref:`ctypes class `." msgstr "" -#: ../../library/ctypes.rst:2958 +#: ../../library/ctypes.rst:2960 msgid "Offset of the field, in bytes." msgstr "" -#: ../../library/ctypes.rst:2960 +#: ../../library/ctypes.rst:2962 msgid "" "For bitfields, this is the offset of the underlying byte-aligned *storage " "unit*; see :attr:`~CField.bit_offset`." msgstr "" -#: ../../library/ctypes.rst:2965 +#: ../../library/ctypes.rst:2967 msgid "Size of the field, in bytes." msgstr "" -#: ../../library/ctypes.rst:2967 +#: ../../library/ctypes.rst:2969 msgid "" "For bitfields, this is the size of the underlying *storage unit*. Typically, " "it has the same size as the bitfield's type." msgstr "" -#: ../../library/ctypes.rst:2972 +#: ../../library/ctypes.rst:2974 msgid "For non-bitfields, equivalent to :attr:`~CField.byte_size`." msgstr "" -#: ../../library/ctypes.rst:2974 +#: ../../library/ctypes.rst:2976 msgid "" "For bitfields, this contains a backwards-compatible bit-packed value that " "combines :attr:`~CField.bit_size` and :attr:`~CField.bit_offset`. Prefer " "using the explicit attributes instead." msgstr "" -#: ../../library/ctypes.rst:2981 +#: ../../library/ctypes.rst:2983 msgid "True if this is a bitfield." msgstr "" -#: ../../library/ctypes.rst:2986 +#: ../../library/ctypes.rst:2988 msgid "" "The location of a bitfield within its *storage unit*, that is, within :attr:" "`~CField.byte_size` bytes of memory starting at :attr:`~CField.byte_offset`." msgstr "" -#: ../../library/ctypes.rst:2990 +#: ../../library/ctypes.rst:2992 msgid "" "To get the field's value, read the storage unit as an integer, :ref:`shift " "left ` by :attr:`!bit_offset` and take the :attr:`!bit_size` least " "significant bits." msgstr "" -#: ../../library/ctypes.rst:2994 +#: ../../library/ctypes.rst:2996 msgid "" "For non-bitfields, :attr:`!bit_offset` is zero and :attr:`!bit_size` is " "equal to ``byte_size * 8``." msgstr "" -#: ../../library/ctypes.rst:2999 +#: ../../library/ctypes.rst:3001 msgid "" "True if this field is anonymous, that is, it contains nested sub-fields that " "should be merged into a containing structure or union." msgstr "" -#: ../../library/ctypes.rst:3006 +#: ../../library/ctypes.rst:3008 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:3010 +#: ../../library/ctypes.rst:3012 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:3012 +#: ../../library/ctypes.rst:3014 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -4806,46 +4814,46 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:3022 +#: ../../library/ctypes.rst:3024 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:3029 +#: ../../library/ctypes.rst:3031 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:3032 +#: ../../library/ctypes.rst:3034 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:3037 +#: ../../library/ctypes.rst:3039 msgid "" "Create an array. Equivalent to ``type * length``, where *type* is a :mod:" "`ctypes` data type and *length* an integer." msgstr "" -#: ../../library/ctypes.rst:3041 +#: ../../library/ctypes.rst:3043 msgid "" "This function is :term:`soft deprecated` in favor of multiplication. There " "are no plans to remove it." msgstr "" -#: ../../library/ctypes.rst:3047 +#: ../../library/ctypes.rst:3049 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:3049 +#: ../../library/ctypes.rst:3051 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:3053 +#: ../../library/ctypes.rst:3055 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -4854,43 +4862,43 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:3063 +#: ../../library/ctypes.rst:3065 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:3067 +#: ../../library/ctypes.rst:3069 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." msgstr "" -#: ../../library/ctypes.rst:3074 +#: ../../library/ctypes.rst:3076 msgid "Exceptions" msgstr "" -#: ../../library/ctypes.rst:3078 +#: ../../library/ctypes.rst:3080 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:3084 +#: ../../library/ctypes.rst:3086 msgid "This exception is raised when a COM method call failed." msgstr "" -#: ../../library/ctypes.rst:3088 +#: ../../library/ctypes.rst:3090 msgid "The integer value representing the error code." msgstr "" -#: ../../library/ctypes.rst:3092 +#: ../../library/ctypes.rst:3094 msgid "The error message." msgstr "" -#: ../../library/ctypes.rst:3096 +#: ../../library/ctypes.rst:3098 msgid "The 5-tuple ``(descr, source, helpfile, helpcontext, progid)``." msgstr "" -#: ../../library/ctypes.rst:3098 +#: ../../library/ctypes.rst:3100 msgid "" "*descr* is the textual description. *source* is the language-dependent " "``ProgID`` for the class or application that raised the error. *helpfile* " diff --git a/library/curses.po b/library/curses.po index e50f88eff94..c8b146785dd 100644 --- a/library/curses.po +++ b/library/curses.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-06 00:14+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,86 +51,94 @@ msgstr "" "此模組在\\ :ref:`行動平台 `\\ 或\\ :ref:`WebAssembly 平" "台 `\\ 上不支援。" -#: ../../library/curses.rst:28 +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/curses.rst:30 msgid "" "Whenever the documentation mentions a *character* it can be specified as an " "integer, a one-character Unicode string or a one-byte byte string." msgstr "" -#: ../../library/curses.rst:31 +#: ../../library/curses.rst:33 msgid "" "Whenever the documentation mentions a *character string* it can be specified " "as a Unicode string or a byte string." msgstr "" -#: ../../library/curses.rst:36 +#: ../../library/curses.rst:38 msgid "Module :mod:`curses.ascii`" msgstr ":mod:`curses.ascii` 模組" -#: ../../library/curses.rst:37 +#: ../../library/curses.rst:39 msgid "" "Utilities for working with ASCII characters, regardless of your locale " "settings." msgstr "" -#: ../../library/curses.rst:39 +#: ../../library/curses.rst:41 msgid "Module :mod:`curses.panel`" msgstr ":mod:`curses.panel` 模組" -#: ../../library/curses.rst:40 +#: ../../library/curses.rst:42 msgid "A panel stack extension that adds depth to curses windows." msgstr "" -#: ../../library/curses.rst:42 +#: ../../library/curses.rst:44 msgid "Module :mod:`curses.textpad`" msgstr ":mod:`curses.textpad` 模組" -#: ../../library/curses.rst:43 +#: ../../library/curses.rst:45 msgid "" "Editable text widget for curses supporting :program:`Emacs`\\ -like " "bindings." msgstr "" -#: ../../library/curses.rst:45 +#: ../../library/curses.rst:47 msgid ":ref:`curses-howto`" msgstr ":ref:`curses-howto`" -#: ../../library/curses.rst:46 +#: ../../library/curses.rst:48 msgid "" "Tutorial material on using curses with Python, by Andrew Kuchling and Eric " "Raymond." msgstr "" -#: ../../library/curses.rst:53 +#: ../../library/curses.rst:55 msgid "Functions" msgstr "函式" -#: ../../library/curses.rst:55 +#: ../../library/curses.rst:57 msgid "The module :mod:`curses` defines the following exception:" msgstr ":mod:`curses` 模組定義了以下例外:" -#: ../../library/curses.rst:60 +#: ../../library/curses.rst:62 msgid "Exception raised when a curses library function returns an error." msgstr "" -#: ../../library/curses.rst:64 +#: ../../library/curses.rst:66 msgid "" "Whenever *x* or *y* arguments to a function or a method are optional, they " "default to the current cursor location. Whenever *attr* is optional, it " "defaults to :const:`A_NORMAL`." msgstr "" -#: ../../library/curses.rst:68 +#: ../../library/curses.rst:70 msgid "The module :mod:`curses` defines the following functions:" msgstr ":mod:`curses` 模組定義了以下函式:" -#: ../../library/curses.rst:73 +#: ../../library/curses.rst:75 msgid "" "Allow use of default values for colors on terminals supporting this feature. " "Use this to support transparency in your application." msgstr "" -#: ../../library/curses.rst:76 +#: ../../library/curses.rst:78 msgid "" "Assign terminal default foreground/background colors to color number ``-1``. " "So ``init_pair(x, COLOR_RED, -1)`` will initialize pair *x* as red on " @@ -138,11 +146,11 @@ msgid "" "*x* as default foreground on blue." msgstr "" -#: ../../library/curses.rst:81 +#: ../../library/curses.rst:83 msgid "Change the definition of the color-pair ``0`` to ``(fg, bg)``." msgstr "" -#: ../../library/curses.rst:88 +#: ../../library/curses.rst:90 msgid "" "Return the output speed of the terminal in bits per second. On software " "terminal emulators it will have a fixed high value. Included for historical " @@ -150,17 +158,17 @@ msgid "" "and occasionally to change interfaces depending on the line speed." msgstr "" -#: ../../library/curses.rst:96 +#: ../../library/curses.rst:98 msgid "Emit a short attention sound." msgstr "" -#: ../../library/curses.rst:101 +#: ../../library/curses.rst:103 msgid "" "Return ``True`` or ``False``, depending on whether the programmer can change " "the colors displayed by the terminal." msgstr "" -#: ../../library/curses.rst:107 +#: ../../library/curses.rst:109 msgid "" "Enter cbreak mode. In cbreak mode (sometimes called \"rare\" mode) normal " "tty line buffering is turned off and characters are available to be read one " @@ -170,7 +178,7 @@ msgid "" "terminal in cbreak mode." msgstr "" -#: ../../library/curses.rst:116 +#: ../../library/curses.rst:118 msgid "" "Return the intensity of the red, green, and blue (RGB) components in the " "color *color_number*, which must be between ``0`` and ``COLORS - 1``. " @@ -179,7 +187,7 @@ msgid "" "component)." msgstr "" -#: ../../library/curses.rst:124 +#: ../../library/curses.rst:126 msgid "" "Return the attribute value for displaying text in the specified color pair. " "Only the first 256 color pairs are supported. This attribute value can be " @@ -188,7 +196,7 @@ msgid "" "function." msgstr "" -#: ../../library/curses.rst:133 +#: ../../library/curses.rst:135 msgid "" "Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, " "for invisible, normal, or very visible. If the terminal supports the " @@ -197,7 +205,7 @@ msgid "" "and the \"very visible\" mode is a block cursor." msgstr "" -#: ../../library/curses.rst:142 +#: ../../library/curses.rst:144 msgid "" "Save the current terminal mode as the \"program\" mode, the mode when the " "running program is using curses. (Its counterpart is the \"shell\" mode, " @@ -205,7 +213,7 @@ msgid "" "`reset_prog_mode` will restore this mode." msgstr "" -#: ../../library/curses.rst:150 +#: ../../library/curses.rst:152 msgid "" "Save the current terminal mode as the \"shell\" mode, the mode when the " "running program is not using curses. (Its counterpart is the \"program\" " @@ -213,11 +221,11 @@ msgid "" "func:`reset_shell_mode` will restore this mode." msgstr "" -#: ../../library/curses.rst:158 +#: ../../library/curses.rst:160 msgid "Insert an *ms* millisecond pause in output." msgstr "" -#: ../../library/curses.rst:163 +#: ../../library/curses.rst:165 msgid "" "Update the physical screen. The curses library keeps two data structures, " "one representing the current physical screen contents and a virtual screen " @@ -225,7 +233,7 @@ msgid "" "the physical screen to match the virtual screen." msgstr "" -#: ../../library/curses.rst:168 +#: ../../library/curses.rst:170 msgid "" "The virtual screen may be updated by a :meth:`~window.noutrefresh` call " "after write operations such as :meth:`~window.addstr` have been performed on " @@ -236,24 +244,24 @@ msgid "" "func:`!doupdate`." msgstr "" -#: ../../library/curses.rst:178 +#: ../../library/curses.rst:180 msgid "" "Enter echo mode. In echo mode, each character input is echoed to the screen " "as it is entered." msgstr "" -#: ../../library/curses.rst:184 +#: ../../library/curses.rst:186 msgid "De-initialize the library, and return terminal to normal status." msgstr "" -#: ../../library/curses.rst:189 +#: ../../library/curses.rst:191 msgid "" "Return the user's current erase character as a one-byte bytes object. Under " "Unix operating systems this is a property of the controlling tty of the " "curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:196 +#: ../../library/curses.rst:198 msgid "" "The :func:`.filter` routine, if used, must be called before :func:`initscr` " "is called. The effect is that, during those calls, :envvar:`LINES` is set " @@ -264,20 +272,20 @@ msgid "" "time line editing without touching the rest of the screen." msgstr "" -#: ../../library/curses.rst:206 +#: ../../library/curses.rst:208 msgid "" "Flash the screen. That is, change it to reverse-video and then change it " "back in a short interval. Some people prefer such as 'visible bell' to the " "audible attention signal produced by :func:`beep`." msgstr "" -#: ../../library/curses.rst:213 +#: ../../library/curses.rst:215 msgid "" "Flush all input buffers. This throws away any typeahead that has been " "typed by the user and has not yet been processed by the program." msgstr "" -#: ../../library/curses.rst:219 +#: ../../library/curses.rst:221 msgid "" "After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse " "event, this method should be called to retrieve the queued mouse event, " @@ -292,51 +300,51 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: ../../library/curses.rst:230 ../../library/curses.rst:1798 +#: ../../library/curses.rst:232 ../../library/curses.rst:1800 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." msgstr "" -#: ../../library/curses.rst:237 +#: ../../library/curses.rst:239 msgid "" "Return the current coordinates of the virtual screen cursor as a tuple ``(y, " "x)``. If :meth:`leaveok ` is currently ``True``, then " "return ``(-1, -1)``." msgstr "" -#: ../../library/curses.rst:243 +#: ../../library/curses.rst:245 msgid "" "Read window related data stored in the file by an earlier :func:`window." "putwin` call. The routine then creates and initializes a new window using " "that data, returning the new window object." msgstr "" -#: ../../library/curses.rst:250 +#: ../../library/curses.rst:252 msgid "" "Return ``True`` if the terminal can display colors; otherwise, return " "``False``." msgstr "" -#: ../../library/curses.rst:254 +#: ../../library/curses.rst:256 msgid "" "Return ``True`` if the module supports extended colors; otherwise, return " "``False``. Extended color support allows more than 256 color pairs for " "terminals that support more than 16 colors (e.g. xterm-256color)." msgstr "" -#: ../../library/curses.rst:258 +#: ../../library/curses.rst:260 msgid "Extended color support requires ncurses version 6.1 or later." msgstr "" -#: ../../library/curses.rst:264 +#: ../../library/curses.rst:266 msgid "" "Return ``True`` if the terminal has insert- and delete-character " "capabilities. This function is included for historical reasons only, as all " "modern software terminal emulators have such capabilities." msgstr "" -#: ../../library/curses.rst:271 +#: ../../library/curses.rst:273 msgid "" "Return ``True`` if the terminal has insert- and delete-line capabilities, or " "can simulate them using scrolling regions. This function is included for " @@ -344,13 +352,13 @@ msgid "" "capabilities." msgstr "" -#: ../../library/curses.rst:279 +#: ../../library/curses.rst:281 msgid "" "Take a key value *ch*, and return ``True`` if the current terminal type " "recognizes a key with that value." msgstr "" -#: ../../library/curses.rst:285 +#: ../../library/curses.rst:287 msgid "" "Used for half-delay mode, which is similar to cbreak mode in that characters " "typed by the user are immediately available to the program. However, after " @@ -359,7 +367,7 @@ msgid "" "``255``. Use :func:`nocbreak` to leave half-delay mode." msgstr "" -#: ../../library/curses.rst:294 +#: ../../library/curses.rst:296 msgid "" "Change the definition of a color, taking the number of the color to be " "changed followed by three RGB values (for the amounts of red, green, and " @@ -371,7 +379,7 @@ msgid "" "``True``." msgstr "" -#: ../../library/curses.rst:305 +#: ../../library/curses.rst:307 msgid "" "Change the definition of a color-pair. It takes three arguments: the number " "of the color-pair to be changed, the foreground color number, and the " @@ -385,31 +393,31 @@ msgid "" "definition." msgstr "" -#: ../../library/curses.rst:320 +#: ../../library/curses.rst:322 msgid "" "Initialize the library. Return a :ref:`window ` " "object which represents the whole screen." msgstr "" -#: ../../library/curses.rst:325 +#: ../../library/curses.rst:327 msgid "" "If there is an error opening the terminal, the underlying curses library may " "cause the interpreter to exit." msgstr "" -#: ../../library/curses.rst:331 +#: ../../library/curses.rst:333 msgid "" "Return ``True`` if :func:`resize_term` would modify the window structure, " "``False`` otherwise." msgstr "" -#: ../../library/curses.rst:337 +#: ../../library/curses.rst:339 msgid "" "Return ``True`` if :func:`endwin` has been called (that is, the curses " "library has been deinitialized)." msgstr "" -#: ../../library/curses.rst:343 +#: ../../library/curses.rst:345 msgid "" "Return the name of the key numbered *k* as a bytes object. The name of a " "key generating printable ASCII character is the key's character. The name " @@ -420,27 +428,27 @@ msgid "" "character." msgstr "" -#: ../../library/curses.rst:353 +#: ../../library/curses.rst:355 msgid "" "Return the user's current line kill character as a one-byte bytes object. " "Under Unix operating systems this is a property of the controlling tty of " "the curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:360 +#: ../../library/curses.rst:362 msgid "" "Return a bytes object containing the terminfo long name field describing the " "current terminal. The maximum length of a verbose description is 128 " "characters. It is defined only after the call to :func:`initscr`." msgstr "" -#: ../../library/curses.rst:367 +#: ../../library/curses.rst:369 msgid "" "If *flag* is ``True``, allow 8-bit characters to be input. If *flag* is " "``False``, allow only 7-bit chars." msgstr "" -#: ../../library/curses.rst:373 +#: ../../library/curses.rst:375 msgid "" "Set the maximum time in milliseconds that can elapse between press and " "release events in order for them to be recognized as a click, and return the " @@ -448,7 +456,7 @@ msgid "" "fifth of a second." msgstr "" -#: ../../library/curses.rst:380 +#: ../../library/curses.rst:382 msgid "" "Set the mouse events to be reported, and return a tuple ``(availmask, " "oldmask)``. *availmask* indicates which of the specified mouse events can " @@ -457,17 +465,17 @@ msgid "" "never called, no mouse events are ever reported." msgstr "" -#: ../../library/curses.rst:389 +#: ../../library/curses.rst:391 msgid "Sleep for *ms* milliseconds." msgstr "" -#: ../../library/curses.rst:394 +#: ../../library/curses.rst:396 msgid "" "Create and return a pointer to a new pad data structure with the given " "number of lines and columns. Return a pad as a window object." msgstr "" -#: ../../library/curses.rst:397 +#: ../../library/curses.rst:399 msgid "" "A pad is like a window, except that it is not restricted by the screen size, " "and is not necessarily associated with a particular part of the screen. " @@ -483,35 +491,35 @@ msgid "" "to be displayed." msgstr "" -#: ../../library/curses.rst:413 +#: ../../library/curses.rst:415 msgid "" "Return a new :ref:`window `, whose left-upper corner " "is at ``(begin_y, begin_x)``, and whose height/width is *nlines*/*ncols*." msgstr "" -#: ../../library/curses.rst:416 +#: ../../library/curses.rst:418 msgid "" "By default, the window will extend from the specified position to the lower " "right corner of the screen." msgstr "" -#: ../../library/curses.rst:422 +#: ../../library/curses.rst:424 msgid "" "Enter newline mode. This mode translates the return key into newline on " "input, and translates newline into return and line-feed on output. Newline " "mode is initially on." msgstr "" -#: ../../library/curses.rst:429 +#: ../../library/curses.rst:431 msgid "" "Leave cbreak mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: ../../library/curses.rst:434 +#: ../../library/curses.rst:436 msgid "Leave echo mode. Echoing of input characters is turned off." msgstr "" -#: ../../library/curses.rst:439 +#: ../../library/curses.rst:441 msgid "" "Leave newline mode. Disable translation of return into newline on input, " "and disable low-level translation of newline into newline/return on output " @@ -521,7 +529,7 @@ msgid "" "also, it will be able to detect the return key on input." msgstr "" -#: ../../library/curses.rst:449 +#: ../../library/curses.rst:451 msgid "" "When the :func:`!noqiflush` routine is used, normal flush of input and " "output queues associated with the ``INTR``, ``QUIT`` and ``SUSP`` characters " @@ -530,63 +538,63 @@ msgid "" "occurred, after the handler exits." msgstr "" -#: ../../library/curses.rst:457 +#: ../../library/curses.rst:459 msgid "Leave raw mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: ../../library/curses.rst:462 +#: ../../library/curses.rst:464 msgid "" "Return a tuple ``(fg, bg)`` containing the colors for the requested color " "pair. The value of *pair_number* must be between ``0`` and ``COLOR_PAIRS - " "1``." msgstr "" -#: ../../library/curses.rst:468 +#: ../../library/curses.rst:470 msgid "" "Return the number of the color-pair set by the attribute value *attr*. :func:" "`color_pair` is the counterpart to this function." msgstr "" -#: ../../library/curses.rst:474 +#: ../../library/curses.rst:476 msgid "" "Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " "terminfo capability for the current terminal. Note that the output of :func:" "`putp` always goes to standard output." msgstr "" -#: ../../library/curses.rst:481 +#: ../../library/curses.rst:483 msgid "" "If *flag* is ``False``, the effect is the same as calling :func:`noqiflush`. " "If *flag* is ``True``, or no argument is provided, the queues will be " "flushed when these control characters are read." msgstr "" -#: ../../library/curses.rst:488 +#: ../../library/curses.rst:490 msgid "" "Enter raw mode. In raw mode, normal line buffering and processing of " "interrupt, quit, suspend, and flow control keys are turned off; characters " "are presented to curses input functions one by one." msgstr "" -#: ../../library/curses.rst:495 +#: ../../library/curses.rst:497 msgid "" "Restore the terminal to \"program\" mode, as previously saved by :func:" "`def_prog_mode`." msgstr "" -#: ../../library/curses.rst:501 +#: ../../library/curses.rst:503 msgid "" "Restore the terminal to \"shell\" mode, as previously saved by :func:" "`def_shell_mode`." msgstr "" -#: ../../library/curses.rst:507 +#: ../../library/curses.rst:509 msgid "" "Restore the state of the terminal modes to what it was at the last call to :" "func:`savetty`." msgstr "" -#: ../../library/curses.rst:513 +#: ../../library/curses.rst:515 msgid "" "Backend function used by :func:`resizeterm`, performing most of the work; " "when resizing the windows, :func:`resize_term` blank-fills the areas that " @@ -596,47 +604,47 @@ msgid "" "to resize these without additional interaction with the application." msgstr "" -#: ../../library/curses.rst:523 +#: ../../library/curses.rst:525 msgid "" "Resize the standard and current windows to the specified dimensions, and " "adjusts other bookkeeping data used by the curses library that record the " "window dimensions (in particular the SIGWINCH handler)." msgstr "" -#: ../../library/curses.rst:530 +#: ../../library/curses.rst:532 msgid "" "Save the current state of the terminal modes in a buffer, usable by :func:" "`resetty`." msgstr "" -#: ../../library/curses.rst:535 +#: ../../library/curses.rst:537 msgid "Retrieves the value set by :func:`set_escdelay`." msgstr "" -#: ../../library/curses.rst:541 +#: ../../library/curses.rst:543 msgid "" "Sets the number of milliseconds to wait after reading an escape character, " "to distinguish between an individual escape character entered on the " "keyboard from escape sequences sent by cursor and function keys." msgstr "" -#: ../../library/curses.rst:549 +#: ../../library/curses.rst:551 msgid "Retrieves the value set by :func:`set_tabsize`." msgstr "" -#: ../../library/curses.rst:555 +#: ../../library/curses.rst:557 msgid "" "Sets the number of columns used by the curses library when converting a tab " "character to spaces as it adds the tab to a window." msgstr "" -#: ../../library/curses.rst:562 +#: ../../library/curses.rst:564 msgid "" "Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " "then :meth:`leaveok ` is set ``True``." msgstr "" -#: ../../library/curses.rst:568 +#: ../../library/curses.rst:570 msgid "" "Initialize the terminal. *term* is a string giving the terminal name, or " "``None``; if omitted or ``None``, the value of the :envvar:`TERM` " @@ -645,14 +653,14 @@ msgid "" "descriptor for ``sys.stdout`` will be used." msgstr "" -#: ../../library/curses.rst:577 +#: ../../library/curses.rst:579 msgid "" "Must be called if the programmer wants to use colors, and before any other " "color manipulation routine is called. It is good practice to call this " "routine right after :func:`initscr`." msgstr "" -#: ../../library/curses.rst:581 +#: ../../library/curses.rst:583 msgid "" ":func:`start_color` initializes eight basic colors (black, red, green, " "yellow, blue, magenta, cyan, and white), and two global variables in the :" @@ -662,20 +670,20 @@ msgid "" "terminal was just turned on." msgstr "" -#: ../../library/curses.rst:590 +#: ../../library/curses.rst:592 msgid "" "Return a logical OR of all video attributes supported by the terminal. This " "information is useful when a curses program needs complete control over the " "appearance of the screen." msgstr "" -#: ../../library/curses.rst:597 +#: ../../library/curses.rst:599 msgid "" "Return the value of the environment variable :envvar:`TERM`, as a bytes " "object, truncated to 14 characters." msgstr "" -#: ../../library/curses.rst:603 +#: ../../library/curses.rst:605 msgid "" "Return the value of the Boolean capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-1`` if " @@ -683,7 +691,7 @@ msgid "" "from the terminal description." msgstr "" -#: ../../library/curses.rst:611 +#: ../../library/curses.rst:613 msgid "" "Return the value of the numeric capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-2`` if " @@ -691,7 +699,7 @@ msgid "" "from the terminal description." msgstr "" -#: ../../library/curses.rst:619 +#: ../../library/curses.rst:621 msgid "" "Return the value of the string capability corresponding to the terminfo " "capability name *capname* as a bytes object. Return ``None`` if *capname* " @@ -699,7 +707,7 @@ msgid "" "terminal description." msgstr "" -#: ../../library/curses.rst:627 +#: ../../library/curses.rst:629 msgid "" "Instantiate the bytes object *str* with the supplied parameters, where *str* " "should be a parameterized string obtained from the terminfo database. E.g. " @@ -707,13 +715,13 @@ msgid "" "exact result depending on terminal type." msgstr "" -#: ../../library/curses.rst:635 +#: ../../library/curses.rst:637 msgid "" "Specify that the file descriptor *fd* be used for typeahead checking. If " "*fd* is ``-1``, then no typeahead checking is done." msgstr "" -#: ../../library/curses.rst:638 +#: ../../library/curses.rst:640 msgid "" "The curses library does \"line-breakout optimization\" by looking for " "typeahead periodically while updating the screen. If input is found, and it " @@ -723,7 +731,7 @@ msgid "" "typeahead checking." msgstr "" -#: ../../library/curses.rst:647 +#: ../../library/curses.rst:649 msgid "" "Return a bytes object which is a printable representation of the character " "*ch*. Control characters are represented as a caret followed by the " @@ -731,35 +739,35 @@ msgid "" "are." msgstr "" -#: ../../library/curses.rst:654 +#: ../../library/curses.rst:656 msgid "Push *ch* so the next :meth:`~window.getch` will return it." msgstr "" -#: ../../library/curses.rst:658 +#: ../../library/curses.rst:660 msgid "Only one *ch* can be pushed before :meth:`!getch` is called." msgstr "" -#: ../../library/curses.rst:663 +#: ../../library/curses.rst:665 msgid "" "Update the :const:`LINES` and :const:`COLS` module variables. Useful for " "detecting manual screen resize." msgstr "" -#: ../../library/curses.rst:671 +#: ../../library/curses.rst:673 msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." msgstr "" -#: ../../library/curses.rst:675 +#: ../../library/curses.rst:677 msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." msgstr "" -#: ../../library/curses.rst:682 +#: ../../library/curses.rst:684 msgid "" "Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " "state data with it." msgstr "" -#: ../../library/curses.rst:688 +#: ../../library/curses.rst:690 msgid "" "If used, this function should be called before :func:`initscr` or newterm " "are called. When *flag* is ``False``, the values of lines and columns " @@ -769,11 +777,11 @@ msgid "" "to use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." msgstr "" -#: ../../library/curses.rst:698 +#: ../../library/curses.rst:700 msgid "Equivalent to ``assume_default_colors(-1, -1)``." msgstr "" -#: ../../library/curses.rst:703 +#: ../../library/curses.rst:705 msgid "" "Initialize curses and call another callable object, *func*, which should be " "the rest of your curses-using application. If the application raises an " @@ -787,50 +795,50 @@ msgid "" "echo, and disables the terminal keypad." msgstr "" -#: ../../library/curses.rst:717 +#: ../../library/curses.rst:719 msgid "Window Objects" msgstr "" -#: ../../library/curses.rst:721 +#: ../../library/curses.rst:723 msgid "" "Window objects, as returned by :func:`initscr` and :func:`newwin` above, " "have the following methods and attributes:" msgstr "" -#: ../../library/curses.rst:728 +#: ../../library/curses.rst:730 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " "character previously painted at that location. By default, the character " "position and attributes are the current settings for the window object." msgstr "" -#: ../../library/curses.rst:734 +#: ../../library/curses.rst:736 msgid "" "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" -#: ../../library/curses.rst:742 +#: ../../library/curses.rst:744 msgid "" "Paint at most *n* characters of the character string *str* at ``(y, x)`` " "with attributes *attr*, overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:750 +#: ../../library/curses.rst:752 msgid "" "Paint the character string *str* at ``(y, x)`` with attributes *attr*, " "overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:755 +#: ../../library/curses.rst:757 msgid "" "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" -#: ../../library/curses.rst:759 +#: ../../library/curses.rst:761 msgid "" "A `bug in ncurses `_, the backend for " "this Python module, can cause SegFaults when resizing windows. This is fixed " @@ -840,44 +848,44 @@ msgid "" "line." msgstr "" -#: ../../library/curses.rst:769 +#: ../../library/curses.rst:771 msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:775 +#: ../../library/curses.rst:777 msgid "" "Add attribute *attr* to the \"background\" set applied to all writes to the " "current window." msgstr "" -#: ../../library/curses.rst:781 +#: ../../library/curses.rst:783 msgid "" "Set the \"background\" set of attributes to *attr*. This set is initially " "``0`` (no attributes)." msgstr "" -#: ../../library/curses.rst:787 +#: ../../library/curses.rst:789 msgid "" "Set the background property of the window to the character *ch*, with " "attributes *attr*. The change is then applied to every character position " "in that window:" msgstr "" -#: ../../library/curses.rst:791 +#: ../../library/curses.rst:793 msgid "" "The attribute of every character in the window is changed to the new " "background attribute." msgstr "" -#: ../../library/curses.rst:794 +#: ../../library/curses.rst:796 msgid "" "Wherever the former background character appears, it is changed to the new " "background character." msgstr "" -#: ../../library/curses.rst:800 +#: ../../library/curses.rst:802 msgid "" "Set the window's background. A window's background consists of a character " "and any combination of attributes. The attribute part of the background is " @@ -888,128 +896,128 @@ msgid "" "delete line/character operations." msgstr "" -#: ../../library/curses.rst:810 +#: ../../library/curses.rst:812 msgid "" "Draw a border around the edges of the window. Each parameter specifies the " "character to use for a specific part of the border; see the table below for " "more details." msgstr "" -#: ../../library/curses.rst:816 +#: ../../library/curses.rst:818 msgid "" "A ``0`` value for any parameter will cause the default character to be used " "for that parameter. Keyword parameters can *not* be used. The defaults are " "listed in this table:" msgstr "" -#: ../../library/curses.rst:821 +#: ../../library/curses.rst:823 msgid "Parameter" msgstr "參數" -#: ../../library/curses.rst:821 +#: ../../library/curses.rst:823 msgid "Description" msgstr "描述" -#: ../../library/curses.rst:821 +#: ../../library/curses.rst:823 msgid "Default value" msgstr "預設值" -#: ../../library/curses.rst:823 +#: ../../library/curses.rst:825 msgid "*ls*" msgstr "*ls*" -#: ../../library/curses.rst:823 +#: ../../library/curses.rst:825 msgid "Left side" msgstr "" -#: ../../library/curses.rst:823 ../../library/curses.rst:825 +#: ../../library/curses.rst:825 ../../library/curses.rst:827 msgid ":const:`ACS_VLINE`" msgstr ":const:`ACS_VLINE`" -#: ../../library/curses.rst:825 +#: ../../library/curses.rst:827 msgid "*rs*" msgstr "*rs*" -#: ../../library/curses.rst:825 +#: ../../library/curses.rst:827 msgid "Right side" msgstr "" -#: ../../library/curses.rst:827 +#: ../../library/curses.rst:829 msgid "*ts*" msgstr "*ts*" -#: ../../library/curses.rst:827 +#: ../../library/curses.rst:829 msgid "Top" msgstr "" -#: ../../library/curses.rst:827 ../../library/curses.rst:829 +#: ../../library/curses.rst:829 ../../library/curses.rst:831 msgid ":const:`ACS_HLINE`" msgstr ":const:`ACS_HLINE`" -#: ../../library/curses.rst:829 +#: ../../library/curses.rst:831 msgid "*bs*" msgstr "*bs*" -#: ../../library/curses.rst:829 +#: ../../library/curses.rst:831 msgid "Bottom" msgstr "" -#: ../../library/curses.rst:831 +#: ../../library/curses.rst:833 msgid "*tl*" msgstr "*tl*" -#: ../../library/curses.rst:831 +#: ../../library/curses.rst:833 msgid "Upper-left corner" msgstr "" -#: ../../library/curses.rst:831 +#: ../../library/curses.rst:833 msgid ":const:`ACS_ULCORNER`" msgstr ":const:`ACS_ULCORNER`" -#: ../../library/curses.rst:833 +#: ../../library/curses.rst:835 msgid "*tr*" msgstr "*tr*" -#: ../../library/curses.rst:833 +#: ../../library/curses.rst:835 msgid "Upper-right corner" msgstr "" -#: ../../library/curses.rst:833 +#: ../../library/curses.rst:835 msgid ":const:`ACS_URCORNER`" msgstr ":const:`ACS_URCORNER`" -#: ../../library/curses.rst:835 +#: ../../library/curses.rst:837 msgid "*bl*" msgstr "*bl*" -#: ../../library/curses.rst:835 +#: ../../library/curses.rst:837 msgid "Bottom-left corner" msgstr "" -#: ../../library/curses.rst:835 +#: ../../library/curses.rst:837 msgid ":const:`ACS_LLCORNER`" msgstr ":const:`ACS_LLCORNER`" -#: ../../library/curses.rst:837 +#: ../../library/curses.rst:839 msgid "*br*" msgstr "*br*" -#: ../../library/curses.rst:837 +#: ../../library/curses.rst:839 msgid "Bottom-right corner" msgstr "" -#: ../../library/curses.rst:837 +#: ../../library/curses.rst:839 msgid ":const:`ACS_LRCORNER`" msgstr ":const:`ACS_LRCORNER`" -#: ../../library/curses.rst:843 +#: ../../library/curses.rst:845 msgid "" "Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " "and *bs* are *horch*. The default corner characters are always used by this " "function." msgstr "" -#: ../../library/curses.rst:852 +#: ../../library/curses.rst:854 msgid "" "Set the attributes of *num* characters at the current cursor position, or at " "position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " @@ -1019,45 +1027,45 @@ msgid "" "be redisplayed by the next window refresh." msgstr "" -#: ../../library/curses.rst:862 +#: ../../library/curses.rst:864 msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " "next call to :meth:`refresh`." msgstr "" -#: ../../library/curses.rst:868 +#: ../../library/curses.rst:870 msgid "" "If *flag* is ``True``, the next call to :meth:`refresh` will clear the " "window completely." msgstr "" -#: ../../library/curses.rst:874 +#: ../../library/curses.rst:876 msgid "" "Erase from cursor to the end of the window: all lines below the cursor are " "deleted, and then the equivalent of :meth:`clrtoeol` is performed." msgstr "" -#: ../../library/curses.rst:880 +#: ../../library/curses.rst:882 msgid "Erase from cursor to the end of the line." msgstr "" -#: ../../library/curses.rst:885 +#: ../../library/curses.rst:887 msgid "" "Update the current cursor position of all the ancestors of the window to " "reflect the current cursor position of the window." msgstr "" -#: ../../library/curses.rst:891 +#: ../../library/curses.rst:893 msgid "Delete any character at ``(y, x)``." msgstr "" -#: ../../library/curses.rst:896 +#: ../../library/curses.rst:898 msgid "" "Delete the line under the cursor. All following lines are moved up by one " "line." msgstr "" -#: ../../library/curses.rst:902 +#: ../../library/curses.rst:904 msgid "" "An abbreviation for \"derive window\", :meth:`derwin` is the same as " "calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " @@ -1065,13 +1073,13 @@ msgid "" "a window object for the derived window." msgstr "" -#: ../../library/curses.rst:910 +#: ../../library/curses.rst:912 msgid "" "Add character *ch* with attribute *attr*, and immediately call :meth:" "`refresh` on the window." msgstr "" -#: ../../library/curses.rst:916 +#: ../../library/curses.rst:918 msgid "" "Test whether the given pair of screen-relative character-cell coordinates " "are enclosed by the given window, returning ``True`` or ``False``. It is " @@ -1079,11 +1087,11 @@ msgid "" "location of a mouse event." msgstr "" -#: ../../library/curses.rst:921 +#: ../../library/curses.rst:923 msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." msgstr "" -#: ../../library/curses.rst:927 +#: ../../library/curses.rst:929 msgid "" "Encoding used to encode method arguments (Unicode strings and characters). " "The encoding attribute is inherited from the parent window when a subwindow " @@ -1091,19 +1099,19 @@ msgid "" "locale encoding is used (see :func:`locale.getencoding`)." msgstr "" -#: ../../library/curses.rst:937 +#: ../../library/curses.rst:939 msgid "Clear the window." msgstr "清除視窗。" -#: ../../library/curses.rst:942 +#: ../../library/curses.rst:944 msgid "Return a tuple ``(y, x)`` of coordinates of upper-left corner." msgstr "回傳左上角的座標 ``(y, x)``。" -#: ../../library/curses.rst:947 +#: ../../library/curses.rst:949 msgid "Return the given window's current background character/attribute pair." msgstr "回傳給定視窗目前的背景字元/屬性對。" -#: ../../library/curses.rst:952 +#: ../../library/curses.rst:954 msgid "" "Get a character. Note that the integer returned does *not* have to be in " "ASCII range: function keys, keypad keys and so on are represented by numbers " @@ -1111,14 +1119,14 @@ msgid "" "otherwise wait until a key is pressed." msgstr "" -#: ../../library/curses.rst:960 +#: ../../library/curses.rst:962 msgid "" "Get a wide character. Return a character for most keys, or an integer for " "function keys, keypad keys, and other special keys. In no-delay mode, raise " "an exception if there is no input." msgstr "" -#: ../../library/curses.rst:969 +#: ../../library/curses.rst:971 msgid "" "Get a character, returning a string instead of an integer, as :meth:`getch` " "does. Function keys, keypad keys and other special keys return a multibyte " @@ -1126,40 +1134,40 @@ msgid "" "there is no input." msgstr "" -#: ../../library/curses.rst:977 +#: ../../library/curses.rst:979 msgid "Return a tuple ``(y, x)`` of the height and width of the window." msgstr "回傳視窗的高度和寬度的元組 ``(y, x)``。" -#: ../../library/curses.rst:982 +#: ../../library/curses.rst:984 msgid "" "Return the beginning coordinates of this window relative to its parent " "window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no " "parent." msgstr "" -#: ../../library/curses.rst:992 +#: ../../library/curses.rst:994 msgid "" "Read a bytes object from the user, with primitive line editing capacity. The " "maximum value for *n* is 2047." msgstr "" -#: ../../library/curses.rst:995 ../../library/curses.rst:1090 +#: ../../library/curses.rst:997 ../../library/curses.rst:1092 msgid "The maximum value for *n* was increased from 1023 to 2047." msgstr "" -#: ../../library/curses.rst:1001 +#: ../../library/curses.rst:1003 msgid "" "Return a tuple ``(y, x)`` of current cursor position relative to the " "window's upper-left corner." msgstr "" -#: ../../library/curses.rst:1008 +#: ../../library/curses.rst:1010 msgid "" "Display a horizontal line starting at ``(y, x)`` with length *n* consisting " "of the character *ch*." msgstr "" -#: ../../library/curses.rst:1014 +#: ../../library/curses.rst:1016 msgid "" "If *flag* is ``False``, curses no longer considers using the hardware insert/" "delete character feature of the terminal; if *flag* is ``True``, use of " @@ -1167,13 +1175,13 @@ msgid "" "initialized, use of character insert/delete is enabled by default." msgstr "" -#: ../../library/curses.rst:1022 +#: ../../library/curses.rst:1024 msgid "" "If *flag* is ``True``, :mod:`curses` will try and use hardware line editing " "facilities. Otherwise, line insertion/deletion are disabled." msgstr "" -#: ../../library/curses.rst:1028 +#: ../../library/curses.rst:1030 msgid "" "If *flag* is ``True``, any change in the window image automatically causes " "the window to be refreshed; you no longer have to call :meth:`refresh` " @@ -1181,19 +1189,19 @@ msgid "" "calls to wrefresh. This option is disabled by default." msgstr "" -#: ../../library/curses.rst:1036 +#: ../../library/curses.rst:1038 msgid "" "Return the character at the given position in the window. The bottom 8 bits " "are the character proper, and upper bits are the attributes." msgstr "" -#: ../../library/curses.rst:1043 +#: ../../library/curses.rst:1045 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line " "from position *x* right by one character." msgstr "" -#: ../../library/curses.rst:1049 +#: ../../library/curses.rst:1051 msgid "" "Insert *nlines* lines into the specified window above the current line. The " "*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " @@ -1202,13 +1210,13 @@ msgid "" "remains the same." msgstr "" -#: ../../library/curses.rst:1058 +#: ../../library/curses.rst:1060 msgid "" "Insert a blank line under the cursor. All following lines are moved down by " "one line." msgstr "" -#: ../../library/curses.rst:1065 +#: ../../library/curses.rst:1067 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor, up to *n* characters. If *n* is " @@ -1218,7 +1226,7 @@ msgid "" "if specified)." msgstr "" -#: ../../library/curses.rst:1075 +#: ../../library/curses.rst:1077 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor. All characters to the right of the " @@ -1227,7 +1235,7 @@ msgid "" "specified)." msgstr "" -#: ../../library/curses.rst:1084 +#: ../../library/curses.rst:1086 msgid "" "Return a bytes object of characters, extracted from the window starting at " "the current cursor position, or at *y*, *x* if specified. Attributes are " @@ -1236,76 +1244,76 @@ msgid "" "maximum value for *n* is 2047." msgstr "" -#: ../../library/curses.rst:1096 +#: ../../library/curses.rst:1098 msgid "" "Return ``True`` if the specified line was modified since the last call to :" "meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " "exception if *line* is not valid for the given window." msgstr "" -#: ../../library/curses.rst:1103 +#: ../../library/curses.rst:1105 msgid "" "Return ``True`` if the specified window was modified since the last call to :" "meth:`refresh`; otherwise return ``False``." msgstr "" -#: ../../library/curses.rst:1109 +#: ../../library/curses.rst:1111 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " "function keys) will be interpreted by :mod:`curses`. If *flag* is ``False``, " "escape sequences will be left as is in the input stream." msgstr "" -#: ../../library/curses.rst:1116 +#: ../../library/curses.rst:1118 msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " "being at \"cursor position.\" This reduces cursor movement where possible. " "If possible the cursor will be made invisible." msgstr "" -#: ../../library/curses.rst:1120 +#: ../../library/curses.rst:1122 msgid "" "If *flag* is ``False``, cursor will always be at \"cursor position\" after " "an update." msgstr "" -#: ../../library/curses.rst:1125 +#: ../../library/curses.rst:1127 msgid "Move cursor to ``(new_y, new_x)``." msgstr "移動游標到 ``(new_y, new_x)``。" -#: ../../library/curses.rst:1130 +#: ../../library/curses.rst:1132 msgid "" "Move the window inside its parent window. The screen-relative parameters of " "the window are not changed. This routine is used to display different parts " "of the parent window at the same physical position on the screen." msgstr "" -#: ../../library/curses.rst:1137 +#: ../../library/curses.rst:1139 msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1142 +#: ../../library/curses.rst:1144 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." msgstr "如果 *flag* 為 ``True``,則 :meth:`getch` 將為非阻塞的。" -#: ../../library/curses.rst:1147 +#: ../../library/curses.rst:1149 msgid "If *flag* is ``True``, escape sequences will not be timed out." msgstr "" -#: ../../library/curses.rst:1149 +#: ../../library/curses.rst:1151 msgid "" "If *flag* is ``False``, after a few milliseconds, an escape sequence will " "not be interpreted, and will be left in the input stream as is." msgstr "" -#: ../../library/curses.rst:1155 +#: ../../library/curses.rst:1157 msgid "" "Mark for refresh but wait. This function updates the data structure " "representing the desired state of the window, but does not force an update " "of the physical screen. To accomplish that, call :func:`doupdate`." msgstr "" -#: ../../library/curses.rst:1162 +#: ../../library/curses.rst:1164 msgid "" "Overlay the window on top of *destwin*. The windows need not be the same " "size, only the overlapping region is copied. This copy is non-destructive, " @@ -1313,7 +1321,7 @@ msgid "" "contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1167 +#: ../../library/curses.rst:1169 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overlay` can be used. *sminrow* and *smincol* are the upper-left " @@ -1321,7 +1329,7 @@ msgid "" "in the destination window." msgstr "" -#: ../../library/curses.rst:1175 +#: ../../library/curses.rst:1177 msgid "" "Overwrite the window on top of *destwin*. The windows need not be the same " "size, in which case only the overlapping region is copied. This copy is " @@ -1329,7 +1337,7 @@ msgid "" "the old contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1180 +#: ../../library/curses.rst:1182 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overwrite` can be used. *sminrow* and *smincol* are the upper-left " @@ -1337,31 +1345,31 @@ msgid "" "the destination window." msgstr "" -#: ../../library/curses.rst:1188 +#: ../../library/curses.rst:1190 msgid "" "Write all data associated with the window into the provided file object. " "This information can be later retrieved using the :func:`getwin` function." msgstr "" -#: ../../library/curses.rst:1194 +#: ../../library/curses.rst:1196 msgid "" "Indicate that the *num* screen lines, starting at line *beg*, are corrupted " "and should be completely redrawn on the next :meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1200 +#: ../../library/curses.rst:1202 msgid "" "Touch the entire window, causing it to be completely redrawn on the next :" "meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1206 +#: ../../library/curses.rst:1208 msgid "" "Update the display immediately (sync actual screen with previous drawing/" "deleting methods)." msgstr "" -#: ../../library/curses.rst:1209 +#: ../../library/curses.rst:1211 msgid "" "The 6 optional arguments can only be specified when the window is a pad " "created with :func:`newpad`. The additional parameters are needed to " @@ -1376,7 +1384,7 @@ msgid "" "*smincol* are treated as if they were zero." msgstr "" -#: ../../library/curses.rst:1223 +#: ../../library/curses.rst:1225 msgid "" "Reallocate storage for a curses window to adjust its dimensions to the " "specified values. If either dimension is larger than the current values, " @@ -1384,11 +1392,11 @@ msgid "" "rendition (as set by :meth:`bkgdset`) merged into them." msgstr "" -#: ../../library/curses.rst:1231 +#: ../../library/curses.rst:1233 msgid "Scroll the screen or scrolling region upward by *lines* lines." msgstr "" -#: ../../library/curses.rst:1236 +#: ../../library/curses.rst:1238 msgid "" "Control what happens when the cursor of a window is moved off the edge of " "the window or scrolling region, either as a result of a newline action on " @@ -1398,54 +1406,54 @@ msgid "" "scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." msgstr "" -#: ../../library/curses.rst:1246 +#: ../../library/curses.rst:1248 msgid "" "Set the scrolling region from line *top* to line *bottom*. All scrolling " "actions will take place in this region." msgstr "" -#: ../../library/curses.rst:1252 +#: ../../library/curses.rst:1254 msgid "" "Turn off the standout attribute. On some terminals this has the side effect " "of turning off all attributes." msgstr "" -#: ../../library/curses.rst:1258 +#: ../../library/curses.rst:1260 msgid "Turn on attribute *A_STANDOUT*." msgstr "" -#: ../../library/curses.rst:1264 ../../library/curses.rst:1271 +#: ../../library/curses.rst:1266 ../../library/curses.rst:1273 msgid "" "Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, " "and whose width/height is *ncols*/*nlines*." msgstr "" -#: ../../library/curses.rst:1274 +#: ../../library/curses.rst:1276 msgid "" "By default, the sub-window will extend from the specified position to the " "lower right corner of the window." msgstr "" -#: ../../library/curses.rst:1280 +#: ../../library/curses.rst:1282 msgid "" "Touch each location in the window that has been touched in any of its " "ancestor windows. This routine is called by :meth:`refresh`, so it should " "almost never be necessary to call it manually." msgstr "" -#: ../../library/curses.rst:1287 +#: ../../library/curses.rst:1289 msgid "" "If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " "there is a change in the window." msgstr "" -#: ../../library/curses.rst:1293 +#: ../../library/curses.rst:1295 msgid "" "Touch all locations in ancestors of the window that have been changed in " "the window." msgstr "" -#: ../../library/curses.rst:1299 +#: ../../library/curses.rst:1301 msgid "" "Set blocking or non-blocking read behavior for the window. If *delay* is " "negative, blocking read is used (which will wait indefinitely for input). " @@ -1455,7 +1463,7 @@ msgid "" "still no input at the end of that time." msgstr "" -#: ../../library/curses.rst:1309 +#: ../../library/curses.rst:1311 msgid "" "Pretend *count* lines have been changed, starting with line *start*. If " "*changed* is supplied, it specifies whether the affected lines are marked as " @@ -1463,49 +1471,49 @@ msgid "" "``=False``)." msgstr "" -#: ../../library/curses.rst:1316 +#: ../../library/curses.rst:1318 msgid "" "Pretend the whole window has been changed, for purposes of drawing " "optimizations." msgstr "" -#: ../../library/curses.rst:1322 +#: ../../library/curses.rst:1324 msgid "" "Mark all lines in the window as unchanged since the last call to :meth:" "`refresh`." msgstr "" -#: ../../library/curses.rst:1329 +#: ../../library/curses.rst:1331 msgid "" "Display a vertical line starting at ``(y, x)`` with length *n* consisting of " "the character *ch* with attributes *attr*." msgstr "" -#: ../../library/curses.rst:1334 +#: ../../library/curses.rst:1336 msgid "Constants" msgstr "" -#: ../../library/curses.rst:1336 +#: ../../library/curses.rst:1338 msgid "The :mod:`curses` module defines the following data members:" msgstr ":mod:`curses` 模組定義了以下資料成員:" -#: ../../library/curses.rst:1341 +#: ../../library/curses.rst:1343 msgid "" "Some curses routines that return an integer, such as :meth:`~window." "getch`, return :const:`ERR` upon failure." msgstr "" -#: ../../library/curses.rst:1347 +#: ../../library/curses.rst:1349 msgid "" "Some curses routines that return an integer, such as :func:`napms`, " "return :const:`OK` upon success." msgstr "" -#: ../../library/curses.rst:1353 +#: ../../library/curses.rst:1355 msgid "A bytes object representing the current version of the module." msgstr "" -#: ../../library/curses.rst:1358 +#: ../../library/curses.rst:1360 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " @@ -1513,536 +1521,536 @@ msgid "" "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" -#: ../../library/curses.rst:1363 +#: ../../library/curses.rst:1365 msgid "Availability: if the ncurses library is used." msgstr "" -#: ../../library/curses.rst:1369 +#: ../../library/curses.rst:1371 msgid "" "The maximum number of colors the terminal can support. It is defined only " "after the call to :func:`start_color`." msgstr "" -#: ../../library/curses.rst:1374 +#: ../../library/curses.rst:1376 msgid "" "The maximum number of color pairs the terminal can support. It is defined " "only after the call to :func:`start_color`." msgstr "" -#: ../../library/curses.rst:1379 +#: ../../library/curses.rst:1381 msgid "" "The width of the screen, i.e., the number of columns. It is defined only " "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" -#: ../../library/curses.rst:1386 +#: ../../library/curses.rst:1388 msgid "" "The height of the screen, i.e., the number of lines. It is defined only " "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" -#: ../../library/curses.rst:1392 +#: ../../library/curses.rst:1394 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: ../../library/curses.rst:1396 +#: ../../library/curses.rst:1398 msgid "Attribute" msgstr "" -#: ../../library/curses.rst:1396 ../../library/curses.rst:1441 -#: ../../library/curses.rst:1687 ../../library/curses.rst:1779 +#: ../../library/curses.rst:1398 ../../library/curses.rst:1443 +#: ../../library/curses.rst:1689 ../../library/curses.rst:1781 msgid "Meaning" msgstr "含義" -#: ../../library/curses.rst:1398 +#: ../../library/curses.rst:1400 msgid "Alternate character set mode" msgstr "" -#: ../../library/curses.rst:1400 +#: ../../library/curses.rst:1402 msgid "Blink mode" msgstr "" -#: ../../library/curses.rst:1402 +#: ../../library/curses.rst:1404 msgid "Bold mode" msgstr "" -#: ../../library/curses.rst:1404 +#: ../../library/curses.rst:1406 msgid "Dim mode" msgstr "" -#: ../../library/curses.rst:1406 +#: ../../library/curses.rst:1408 msgid "Invisible or blank mode" msgstr "" -#: ../../library/curses.rst:1408 +#: ../../library/curses.rst:1410 msgid "Italic mode" msgstr "" -#: ../../library/curses.rst:1410 +#: ../../library/curses.rst:1412 msgid "Normal attribute" msgstr "" -#: ../../library/curses.rst:1412 +#: ../../library/curses.rst:1414 msgid "Protected mode" msgstr "" -#: ../../library/curses.rst:1414 +#: ../../library/curses.rst:1416 msgid "Reverse background and foreground colors" msgstr "" -#: ../../library/curses.rst:1417 +#: ../../library/curses.rst:1419 msgid "Standout mode" msgstr "" -#: ../../library/curses.rst:1419 +#: ../../library/curses.rst:1421 msgid "Underline mode" msgstr "" -#: ../../library/curses.rst:1421 +#: ../../library/curses.rst:1423 msgid "Horizontal highlight" msgstr "" -#: ../../library/curses.rst:1423 +#: ../../library/curses.rst:1425 msgid "Left highlight" msgstr "" -#: ../../library/curses.rst:1425 +#: ../../library/curses.rst:1427 msgid "Low highlight" msgstr "" -#: ../../library/curses.rst:1427 +#: ../../library/curses.rst:1429 msgid "Right highlight" msgstr "" -#: ../../library/curses.rst:1429 +#: ../../library/curses.rst:1431 msgid "Top highlight" msgstr "" -#: ../../library/curses.rst:1431 +#: ../../library/curses.rst:1433 msgid "Vertical highlight" msgstr "" -#: ../../library/curses.rst:1434 +#: ../../library/curses.rst:1436 msgid "``A_ITALIC`` was added." msgstr "新增 ``A_ITALIC``。" -#: ../../library/curses.rst:1437 +#: ../../library/curses.rst:1439 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: ../../library/curses.rst:1441 +#: ../../library/curses.rst:1443 msgid "Bit-mask" msgstr "" -#: ../../library/curses.rst:1443 +#: ../../library/curses.rst:1445 msgid "Bit-mask to extract attributes" msgstr "" -#: ../../library/curses.rst:1446 +#: ../../library/curses.rst:1448 msgid "Bit-mask to extract a character" msgstr "" -#: ../../library/curses.rst:1449 +#: ../../library/curses.rst:1451 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: ../../library/curses.rst:1453 +#: ../../library/curses.rst:1455 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." msgstr "" -#: ../../library/curses.rst:1459 +#: ../../library/curses.rst:1461 msgid "Key constant" msgstr "" -#: ../../library/curses.rst:1459 +#: ../../library/curses.rst:1461 msgid "Key" msgstr "" -#: ../../library/curses.rst:1461 +#: ../../library/curses.rst:1463 msgid "Minimum key value" msgstr "" -#: ../../library/curses.rst:1463 +#: ../../library/curses.rst:1465 msgid "Break key (unreliable)" msgstr "" -#: ../../library/curses.rst:1465 +#: ../../library/curses.rst:1467 msgid "Down-arrow" msgstr "" -#: ../../library/curses.rst:1467 +#: ../../library/curses.rst:1469 msgid "Up-arrow" msgstr "" -#: ../../library/curses.rst:1469 +#: ../../library/curses.rst:1471 msgid "Left-arrow" msgstr "" -#: ../../library/curses.rst:1471 +#: ../../library/curses.rst:1473 msgid "Right-arrow" msgstr "" -#: ../../library/curses.rst:1473 +#: ../../library/curses.rst:1475 msgid "Home key (upward+left arrow)" msgstr "" -#: ../../library/curses.rst:1475 +#: ../../library/curses.rst:1477 msgid "Backspace (unreliable)" msgstr "" -#: ../../library/curses.rst:1477 +#: ../../library/curses.rst:1479 msgid "Function keys. Up to 64 function keys are supported." msgstr "" -#: ../../library/curses.rst:1480 +#: ../../library/curses.rst:1482 msgid "Value of function key *n*" msgstr "" -#: ../../library/curses.rst:1482 +#: ../../library/curses.rst:1484 msgid "Delete line" msgstr "" -#: ../../library/curses.rst:1484 +#: ../../library/curses.rst:1486 msgid "Insert line" msgstr "" -#: ../../library/curses.rst:1486 +#: ../../library/curses.rst:1488 msgid "Delete character" msgstr "" -#: ../../library/curses.rst:1488 +#: ../../library/curses.rst:1490 msgid "Insert char or enter insert mode" msgstr "" -#: ../../library/curses.rst:1490 +#: ../../library/curses.rst:1492 msgid "Exit insert char mode" msgstr "" -#: ../../library/curses.rst:1492 +#: ../../library/curses.rst:1494 msgid "Clear screen" msgstr "" -#: ../../library/curses.rst:1494 +#: ../../library/curses.rst:1496 msgid "Clear to end of screen" msgstr "" -#: ../../library/curses.rst:1496 +#: ../../library/curses.rst:1498 msgid "Clear to end of line" msgstr "" -#: ../../library/curses.rst:1498 +#: ../../library/curses.rst:1500 msgid "Scroll 1 line forward" msgstr "" -#: ../../library/curses.rst:1500 +#: ../../library/curses.rst:1502 msgid "Scroll 1 line backward (reverse)" msgstr "" -#: ../../library/curses.rst:1502 +#: ../../library/curses.rst:1504 msgid "Next page" msgstr "" -#: ../../library/curses.rst:1504 +#: ../../library/curses.rst:1506 msgid "Previous page" msgstr "" -#: ../../library/curses.rst:1506 +#: ../../library/curses.rst:1508 msgid "Set tab" msgstr "" -#: ../../library/curses.rst:1508 +#: ../../library/curses.rst:1510 msgid "Clear tab" msgstr "" -#: ../../library/curses.rst:1510 +#: ../../library/curses.rst:1512 msgid "Clear all tabs" msgstr "" -#: ../../library/curses.rst:1512 +#: ../../library/curses.rst:1514 msgid "Enter or send (unreliable)" msgstr "" -#: ../../library/curses.rst:1514 +#: ../../library/curses.rst:1516 msgid "Soft (partial) reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1516 +#: ../../library/curses.rst:1518 msgid "Reset or hard reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1518 +#: ../../library/curses.rst:1520 msgid "Print" msgstr "" -#: ../../library/curses.rst:1520 +#: ../../library/curses.rst:1522 msgid "Home down or bottom (lower left)" msgstr "" -#: ../../library/curses.rst:1522 +#: ../../library/curses.rst:1524 msgid "Upper left of keypad" msgstr "" -#: ../../library/curses.rst:1524 +#: ../../library/curses.rst:1526 msgid "Upper right of keypad" msgstr "" -#: ../../library/curses.rst:1526 +#: ../../library/curses.rst:1528 msgid "Center of keypad" msgstr "" -#: ../../library/curses.rst:1528 +#: ../../library/curses.rst:1530 msgid "Lower left of keypad" msgstr "" -#: ../../library/curses.rst:1530 +#: ../../library/curses.rst:1532 msgid "Lower right of keypad" msgstr "" -#: ../../library/curses.rst:1532 +#: ../../library/curses.rst:1534 msgid "Back tab" msgstr "" -#: ../../library/curses.rst:1534 +#: ../../library/curses.rst:1536 msgid "Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1536 +#: ../../library/curses.rst:1538 msgid "Cancel" msgstr "" -#: ../../library/curses.rst:1538 +#: ../../library/curses.rst:1540 msgid "Close" msgstr "" -#: ../../library/curses.rst:1540 +#: ../../library/curses.rst:1542 msgid "Cmd (command)" msgstr "" -#: ../../library/curses.rst:1542 +#: ../../library/curses.rst:1544 msgid "Copy" msgstr "" -#: ../../library/curses.rst:1544 +#: ../../library/curses.rst:1546 msgid "Create" msgstr "" -#: ../../library/curses.rst:1546 +#: ../../library/curses.rst:1548 msgid "End" msgstr "" -#: ../../library/curses.rst:1548 +#: ../../library/curses.rst:1550 msgid "Exit" msgstr "" -#: ../../library/curses.rst:1550 +#: ../../library/curses.rst:1552 msgid "Find" msgstr "" -#: ../../library/curses.rst:1552 +#: ../../library/curses.rst:1554 msgid "Help" msgstr "" -#: ../../library/curses.rst:1554 +#: ../../library/curses.rst:1556 msgid "Mark" msgstr "" -#: ../../library/curses.rst:1556 +#: ../../library/curses.rst:1558 msgid "Message" msgstr "" -#: ../../library/curses.rst:1558 +#: ../../library/curses.rst:1560 msgid "Move" msgstr "" -#: ../../library/curses.rst:1560 +#: ../../library/curses.rst:1562 msgid "Next" msgstr "" -#: ../../library/curses.rst:1562 +#: ../../library/curses.rst:1564 msgid "Open" msgstr "" -#: ../../library/curses.rst:1564 +#: ../../library/curses.rst:1566 msgid "Options" msgstr "" -#: ../../library/curses.rst:1566 +#: ../../library/curses.rst:1568 msgid "Prev (previous)" msgstr "" -#: ../../library/curses.rst:1568 +#: ../../library/curses.rst:1570 msgid "Redo" msgstr "" -#: ../../library/curses.rst:1570 +#: ../../library/curses.rst:1572 msgid "Ref (reference)" msgstr "" -#: ../../library/curses.rst:1572 +#: ../../library/curses.rst:1574 msgid "Refresh" msgstr "" -#: ../../library/curses.rst:1574 +#: ../../library/curses.rst:1576 msgid "Replace" msgstr "" -#: ../../library/curses.rst:1576 +#: ../../library/curses.rst:1578 msgid "Restart" msgstr "" -#: ../../library/curses.rst:1578 +#: ../../library/curses.rst:1580 msgid "Resume" msgstr "" -#: ../../library/curses.rst:1580 +#: ../../library/curses.rst:1582 msgid "Save" msgstr "" -#: ../../library/curses.rst:1582 +#: ../../library/curses.rst:1584 msgid "Shifted Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1584 +#: ../../library/curses.rst:1586 msgid "Shifted Cancel" msgstr "" -#: ../../library/curses.rst:1586 +#: ../../library/curses.rst:1588 msgid "Shifted Command" msgstr "" -#: ../../library/curses.rst:1588 +#: ../../library/curses.rst:1590 msgid "Shifted Copy" msgstr "" -#: ../../library/curses.rst:1590 +#: ../../library/curses.rst:1592 msgid "Shifted Create" msgstr "" -#: ../../library/curses.rst:1592 +#: ../../library/curses.rst:1594 msgid "Shifted Delete char" msgstr "" -#: ../../library/curses.rst:1594 +#: ../../library/curses.rst:1596 msgid "Shifted Delete line" msgstr "" -#: ../../library/curses.rst:1596 +#: ../../library/curses.rst:1598 msgid "Select" msgstr "" -#: ../../library/curses.rst:1598 +#: ../../library/curses.rst:1600 msgid "Shifted End" msgstr "" -#: ../../library/curses.rst:1600 +#: ../../library/curses.rst:1602 msgid "Shifted Clear line" msgstr "" -#: ../../library/curses.rst:1602 +#: ../../library/curses.rst:1604 msgid "Shifted Exit" msgstr "" -#: ../../library/curses.rst:1604 +#: ../../library/curses.rst:1606 msgid "Shifted Find" msgstr "" -#: ../../library/curses.rst:1606 +#: ../../library/curses.rst:1608 msgid "Shifted Help" msgstr "" -#: ../../library/curses.rst:1608 +#: ../../library/curses.rst:1610 msgid "Shifted Home" msgstr "" -#: ../../library/curses.rst:1610 +#: ../../library/curses.rst:1612 msgid "Shifted Input" msgstr "" -#: ../../library/curses.rst:1612 +#: ../../library/curses.rst:1614 msgid "Shifted Left arrow" msgstr "" -#: ../../library/curses.rst:1614 +#: ../../library/curses.rst:1616 msgid "Shifted Message" msgstr "" -#: ../../library/curses.rst:1616 +#: ../../library/curses.rst:1618 msgid "Shifted Move" msgstr "" -#: ../../library/curses.rst:1618 +#: ../../library/curses.rst:1620 msgid "Shifted Next" msgstr "" -#: ../../library/curses.rst:1620 +#: ../../library/curses.rst:1622 msgid "Shifted Options" msgstr "" -#: ../../library/curses.rst:1622 +#: ../../library/curses.rst:1624 msgid "Shifted Prev" msgstr "" -#: ../../library/curses.rst:1624 +#: ../../library/curses.rst:1626 msgid "Shifted Print" msgstr "" -#: ../../library/curses.rst:1626 +#: ../../library/curses.rst:1628 msgid "Shifted Redo" msgstr "" -#: ../../library/curses.rst:1628 +#: ../../library/curses.rst:1630 msgid "Shifted Replace" msgstr "" -#: ../../library/curses.rst:1630 +#: ../../library/curses.rst:1632 msgid "Shifted Right arrow" msgstr "" -#: ../../library/curses.rst:1632 +#: ../../library/curses.rst:1634 msgid "Shifted Resume" msgstr "" -#: ../../library/curses.rst:1634 +#: ../../library/curses.rst:1636 msgid "Shifted Save" msgstr "" -#: ../../library/curses.rst:1636 +#: ../../library/curses.rst:1638 msgid "Shifted Suspend" msgstr "" -#: ../../library/curses.rst:1638 +#: ../../library/curses.rst:1640 msgid "Shifted Undo" msgstr "" -#: ../../library/curses.rst:1640 +#: ../../library/curses.rst:1642 msgid "Suspend" msgstr "" -#: ../../library/curses.rst:1642 +#: ../../library/curses.rst:1644 msgid "Undo" msgstr "" -#: ../../library/curses.rst:1644 +#: ../../library/curses.rst:1646 msgid "Mouse event has occurred" msgstr "" -#: ../../library/curses.rst:1646 +#: ../../library/curses.rst:1648 msgid "Terminal resize event" msgstr "" -#: ../../library/curses.rst:1648 +#: ../../library/curses.rst:1650 msgid "Maximum key value" msgstr "" -#: ../../library/curses.rst:1651 +#: ../../library/curses.rst:1653 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " "are normally at least four function keys (:const:`KEY_F1 `, :const:" @@ -2054,64 +2062,64 @@ msgid "" "keypad mappings are standard:" msgstr "" -#: ../../library/curses.rst:1660 +#: ../../library/curses.rst:1662 msgid "Keycap" msgstr "" -#: ../../library/curses.rst:1660 ../../library/curses.rst:1805 -#: ../../library/curses.rst:1929 +#: ../../library/curses.rst:1662 ../../library/curses.rst:1807 +#: ../../library/curses.rst:1931 msgid "Constant" msgstr "" -#: ../../library/curses.rst:1662 +#: ../../library/curses.rst:1664 msgid ":kbd:`Insert`" msgstr ":kbd:`Insert`" -#: ../../library/curses.rst:1662 +#: ../../library/curses.rst:1664 msgid "KEY_IC" msgstr "KEY_IC" -#: ../../library/curses.rst:1664 +#: ../../library/curses.rst:1666 msgid ":kbd:`Delete`" msgstr ":kbd:`Delete`" -#: ../../library/curses.rst:1664 +#: ../../library/curses.rst:1666 msgid "KEY_DC" msgstr "KEY_DC" -#: ../../library/curses.rst:1666 +#: ../../library/curses.rst:1668 msgid ":kbd:`Home`" msgstr ":kbd:`Home`" -#: ../../library/curses.rst:1666 +#: ../../library/curses.rst:1668 msgid "KEY_HOME" msgstr "KEY_HOME" -#: ../../library/curses.rst:1668 +#: ../../library/curses.rst:1670 msgid ":kbd:`End`" msgstr ":kbd:`End`" -#: ../../library/curses.rst:1668 +#: ../../library/curses.rst:1670 msgid "KEY_END" msgstr "KEY_END" -#: ../../library/curses.rst:1670 +#: ../../library/curses.rst:1672 msgid ":kbd:`Page Up`" msgstr ":kbd:`Page Up`" -#: ../../library/curses.rst:1670 +#: ../../library/curses.rst:1672 msgid "KEY_PPAGE" msgstr "KEY_PPAGE" -#: ../../library/curses.rst:1672 +#: ../../library/curses.rst:1674 msgid ":kbd:`Page Down`" msgstr ":kbd:`Page Down`" -#: ../../library/curses.rst:1672 +#: ../../library/curses.rst:1674 msgid "KEY_NPAGE" msgstr "KEY_NPAGE" -#: ../../library/curses.rst:1677 +#: ../../library/curses.rst:1679 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2119,268 +2127,268 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: ../../library/curses.rst:1684 +#: ../../library/curses.rst:1686 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: ../../library/curses.rst:1687 +#: ../../library/curses.rst:1689 msgid "ACS code" msgstr "" -#: ../../library/curses.rst:1689 +#: ../../library/curses.rst:1691 msgid "alternate name for upper right corner" msgstr "" -#: ../../library/curses.rst:1691 +#: ../../library/curses.rst:1693 msgid "solid square block" msgstr "" -#: ../../library/curses.rst:1693 +#: ../../library/curses.rst:1695 msgid "board of squares" msgstr "" -#: ../../library/curses.rst:1695 +#: ../../library/curses.rst:1697 msgid "alternate name for horizontal line" msgstr "" -#: ../../library/curses.rst:1697 +#: ../../library/curses.rst:1699 msgid "alternate name for upper left corner" msgstr "" -#: ../../library/curses.rst:1699 +#: ../../library/curses.rst:1701 msgid "alternate name for top tee" msgstr "" -#: ../../library/curses.rst:1701 +#: ../../library/curses.rst:1703 msgid "bottom tee" msgstr "" -#: ../../library/curses.rst:1703 +#: ../../library/curses.rst:1705 msgid "bullet" msgstr "" -#: ../../library/curses.rst:1705 +#: ../../library/curses.rst:1707 msgid "checker board (stipple)" msgstr "" -#: ../../library/curses.rst:1707 +#: ../../library/curses.rst:1709 msgid "arrow pointing down" msgstr "" -#: ../../library/curses.rst:1709 +#: ../../library/curses.rst:1711 msgid "degree symbol" msgstr "" -#: ../../library/curses.rst:1711 +#: ../../library/curses.rst:1713 msgid "diamond" msgstr "" -#: ../../library/curses.rst:1713 +#: ../../library/curses.rst:1715 msgid "greater-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1715 +#: ../../library/curses.rst:1717 msgid "horizontal line" msgstr "" -#: ../../library/curses.rst:1717 +#: ../../library/curses.rst:1719 msgid "lantern symbol" msgstr "" -#: ../../library/curses.rst:1719 +#: ../../library/curses.rst:1721 msgid "left arrow" msgstr "" -#: ../../library/curses.rst:1721 +#: ../../library/curses.rst:1723 msgid "less-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1723 +#: ../../library/curses.rst:1725 msgid "lower left-hand corner" msgstr "" -#: ../../library/curses.rst:1725 +#: ../../library/curses.rst:1727 msgid "lower right-hand corner" msgstr "" -#: ../../library/curses.rst:1727 +#: ../../library/curses.rst:1729 msgid "left tee" msgstr "" -#: ../../library/curses.rst:1729 +#: ../../library/curses.rst:1731 msgid "not-equal sign" msgstr "" -#: ../../library/curses.rst:1731 +#: ../../library/curses.rst:1733 msgid "letter pi" msgstr "" -#: ../../library/curses.rst:1733 +#: ../../library/curses.rst:1735 msgid "plus-or-minus sign" msgstr "" -#: ../../library/curses.rst:1735 +#: ../../library/curses.rst:1737 msgid "big plus sign" msgstr "" -#: ../../library/curses.rst:1737 +#: ../../library/curses.rst:1739 msgid "right arrow" msgstr "" -#: ../../library/curses.rst:1739 +#: ../../library/curses.rst:1741 msgid "right tee" msgstr "" -#: ../../library/curses.rst:1741 +#: ../../library/curses.rst:1743 msgid "scan line 1" msgstr "" -#: ../../library/curses.rst:1743 +#: ../../library/curses.rst:1745 msgid "scan line 3" msgstr "" -#: ../../library/curses.rst:1745 +#: ../../library/curses.rst:1747 msgid "scan line 7" msgstr "" -#: ../../library/curses.rst:1747 +#: ../../library/curses.rst:1749 msgid "scan line 9" msgstr "" -#: ../../library/curses.rst:1749 +#: ../../library/curses.rst:1751 msgid "alternate name for lower right corner" msgstr "" -#: ../../library/curses.rst:1751 +#: ../../library/curses.rst:1753 msgid "alternate name for vertical line" msgstr "" -#: ../../library/curses.rst:1753 +#: ../../library/curses.rst:1755 msgid "alternate name for right tee" msgstr "" -#: ../../library/curses.rst:1755 +#: ../../library/curses.rst:1757 msgid "alternate name for lower left corner" msgstr "" -#: ../../library/curses.rst:1757 +#: ../../library/curses.rst:1759 msgid "alternate name for bottom tee" msgstr "" -#: ../../library/curses.rst:1759 +#: ../../library/curses.rst:1761 msgid "alternate name for left tee" msgstr "" -#: ../../library/curses.rst:1761 +#: ../../library/curses.rst:1763 msgid "alternate name for crossover or big plus" msgstr "" -#: ../../library/curses.rst:1763 +#: ../../library/curses.rst:1765 msgid "pound sterling" msgstr "" -#: ../../library/curses.rst:1765 +#: ../../library/curses.rst:1767 msgid "top tee" msgstr "" -#: ../../library/curses.rst:1767 +#: ../../library/curses.rst:1769 msgid "up arrow" msgstr "" -#: ../../library/curses.rst:1769 +#: ../../library/curses.rst:1771 msgid "upper left corner" msgstr "" -#: ../../library/curses.rst:1771 +#: ../../library/curses.rst:1773 msgid "upper right corner" msgstr "" -#: ../../library/curses.rst:1773 +#: ../../library/curses.rst:1775 msgid "vertical line" msgstr "" -#: ../../library/curses.rst:1776 +#: ../../library/curses.rst:1778 msgid "" "The following table lists mouse button constants used by :meth:`getmouse`:" msgstr "" -#: ../../library/curses.rst:1779 +#: ../../library/curses.rst:1781 msgid "Mouse button constant" msgstr "" -#: ../../library/curses.rst:1781 +#: ../../library/curses.rst:1783 msgid "Mouse button *n* pressed" msgstr "" -#: ../../library/curses.rst:1783 +#: ../../library/curses.rst:1785 msgid "Mouse button *n* released" msgstr "" -#: ../../library/curses.rst:1785 +#: ../../library/curses.rst:1787 msgid "Mouse button *n* clicked" msgstr "" -#: ../../library/curses.rst:1787 +#: ../../library/curses.rst:1789 msgid "Mouse button *n* double clicked" msgstr "" -#: ../../library/curses.rst:1789 +#: ../../library/curses.rst:1791 msgid "Mouse button *n* triple clicked" msgstr "" -#: ../../library/curses.rst:1791 +#: ../../library/curses.rst:1793 msgid "Shift was down during button state change" msgstr "" -#: ../../library/curses.rst:1793 ../../library/curses.rst:1795 +#: ../../library/curses.rst:1795 ../../library/curses.rst:1797 msgid "Control was down during button state change" msgstr "" -#: ../../library/curses.rst:1802 +#: ../../library/curses.rst:1804 msgid "The following table lists the predefined colors:" msgstr "" -#: ../../library/curses.rst:1805 +#: ../../library/curses.rst:1807 msgid "Color" msgstr "顏色" -#: ../../library/curses.rst:1807 +#: ../../library/curses.rst:1809 msgid "Black" msgstr "黑" -#: ../../library/curses.rst:1809 +#: ../../library/curses.rst:1811 msgid "Blue" msgstr "藍" -#: ../../library/curses.rst:1811 +#: ../../library/curses.rst:1813 msgid "Cyan (light greenish blue)" msgstr "" -#: ../../library/curses.rst:1813 +#: ../../library/curses.rst:1815 msgid "Green" msgstr "綠" -#: ../../library/curses.rst:1815 +#: ../../library/curses.rst:1817 msgid "Magenta (purplish red)" msgstr "" -#: ../../library/curses.rst:1817 +#: ../../library/curses.rst:1819 msgid "Red" msgstr "紅" -#: ../../library/curses.rst:1819 +#: ../../library/curses.rst:1821 msgid "White" msgstr "白" -#: ../../library/curses.rst:1821 +#: ../../library/curses.rst:1823 msgid "Yellow" msgstr "" -#: ../../library/curses.rst:1826 +#: ../../library/curses.rst:1828 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" -#: ../../library/curses.rst:1834 +#: ../../library/curses.rst:1836 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2390,11 +2398,11 @@ msgid "" "purposes." msgstr "" -#: ../../library/curses.rst:1840 +#: ../../library/curses.rst:1842 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr ":mod:`curses.textpad` 模組定義了以下函式:" -#: ../../library/curses.rst:1845 +#: ../../library/curses.rst:1847 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2406,15 +2414,15 @@ msgid "" "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: ../../library/curses.rst:1858 +#: ../../library/curses.rst:1860 msgid "Textbox objects" msgstr "" -#: ../../library/curses.rst:1860 +#: ../../library/curses.rst:1862 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: ../../library/curses.rst:1865 +#: ../../library/curses.rst:1867 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2423,11 +2431,11 @@ msgid "" "instance's :attr:`stripspaces` flag is initially on." msgstr "" -#: ../../library/curses.rst:1871 +#: ../../library/curses.rst:1873 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: ../../library/curses.rst:1876 +#: ../../library/curses.rst:1878 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -2438,167 +2446,167 @@ msgid "" "`stripspaces` attribute." msgstr "" -#: ../../library/curses.rst:1887 +#: ../../library/curses.rst:1889 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" msgstr "" -#: ../../library/curses.rst:1891 ../../library/curses.rst:1929 +#: ../../library/curses.rst:1893 ../../library/curses.rst:1931 msgid "Keystroke" msgstr "" -#: ../../library/curses.rst:1891 +#: ../../library/curses.rst:1893 msgid "Action" msgstr "" -#: ../../library/curses.rst:1893 +#: ../../library/curses.rst:1895 msgid ":kbd:`Control-A`" msgstr ":kbd:`Control-A`" -#: ../../library/curses.rst:1893 +#: ../../library/curses.rst:1895 msgid "Go to left edge of window." msgstr "" -#: ../../library/curses.rst:1895 ../../library/curses.rst:1931 +#: ../../library/curses.rst:1897 ../../library/curses.rst:1933 msgid ":kbd:`Control-B`" msgstr ":kbd:`Control-B`" -#: ../../library/curses.rst:1895 +#: ../../library/curses.rst:1897 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: ../../library/curses.rst:1898 +#: ../../library/curses.rst:1900 msgid ":kbd:`Control-D`" msgstr ":kbd:`Control-D`" -#: ../../library/curses.rst:1898 +#: ../../library/curses.rst:1900 msgid "Delete character under cursor." msgstr "" -#: ../../library/curses.rst:1900 +#: ../../library/curses.rst:1902 msgid ":kbd:`Control-E`" msgstr ":kbd:`Control-E`" -#: ../../library/curses.rst:1900 +#: ../../library/curses.rst:1902 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: ../../library/curses.rst:1903 ../../library/curses.rst:1933 +#: ../../library/curses.rst:1905 ../../library/curses.rst:1935 msgid ":kbd:`Control-F`" msgstr ":kbd:`Control-F`" -#: ../../library/curses.rst:1903 +#: ../../library/curses.rst:1905 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: ../../library/curses.rst:1906 +#: ../../library/curses.rst:1908 msgid ":kbd:`Control-G`" msgstr ":kbd:`Control-G`" -#: ../../library/curses.rst:1906 +#: ../../library/curses.rst:1908 msgid "Terminate, returning the window contents." msgstr "" -#: ../../library/curses.rst:1908 +#: ../../library/curses.rst:1910 msgid ":kbd:`Control-H`" msgstr ":kbd:`Control-H`" -#: ../../library/curses.rst:1908 +#: ../../library/curses.rst:1910 msgid "Delete character backward." msgstr "" -#: ../../library/curses.rst:1910 +#: ../../library/curses.rst:1912 msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:1910 +#: ../../library/curses.rst:1912 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "" -#: ../../library/curses.rst:1913 +#: ../../library/curses.rst:1915 msgid ":kbd:`Control-K`" msgstr ":kbd:`Control-K`" -#: ../../library/curses.rst:1913 +#: ../../library/curses.rst:1915 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: ../../library/curses.rst:1916 +#: ../../library/curses.rst:1918 msgid ":kbd:`Control-L`" msgstr ":kbd:`Control-L`" -#: ../../library/curses.rst:1916 +#: ../../library/curses.rst:1918 msgid "Refresh screen." msgstr "" -#: ../../library/curses.rst:1918 ../../library/curses.rst:1937 +#: ../../library/curses.rst:1920 ../../library/curses.rst:1939 msgid ":kbd:`Control-N`" msgstr ":kbd:`Control-N`" -#: ../../library/curses.rst:1918 +#: ../../library/curses.rst:1920 msgid "Cursor down; move down one line." msgstr "" -#: ../../library/curses.rst:1920 +#: ../../library/curses.rst:1922 msgid ":kbd:`Control-O`" msgstr ":kbd:`Control-O`" -#: ../../library/curses.rst:1920 +#: ../../library/curses.rst:1922 msgid "Insert a blank line at cursor location." msgstr "" -#: ../../library/curses.rst:1922 ../../library/curses.rst:1935 +#: ../../library/curses.rst:1924 ../../library/curses.rst:1937 msgid ":kbd:`Control-P`" msgstr ":kbd:`Control-P`" -#: ../../library/curses.rst:1922 +#: ../../library/curses.rst:1924 msgid "Cursor up; move up one line." msgstr "" -#: ../../library/curses.rst:1925 +#: ../../library/curses.rst:1927 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: ../../library/curses.rst:1931 +#: ../../library/curses.rst:1933 msgid ":const:`~curses.KEY_LEFT`" msgstr ":const:`~curses.KEY_LEFT`" -#: ../../library/curses.rst:1933 +#: ../../library/curses.rst:1935 msgid ":const:`~curses.KEY_RIGHT`" msgstr ":const:`~curses.KEY_RIGHT`" -#: ../../library/curses.rst:1935 +#: ../../library/curses.rst:1937 msgid ":const:`~curses.KEY_UP`" msgstr ":const:`~curses.KEY_UP`" -#: ../../library/curses.rst:1937 +#: ../../library/curses.rst:1939 msgid ":const:`~curses.KEY_DOWN`" msgstr ":const:`~curses.KEY_DOWN`" -#: ../../library/curses.rst:1939 +#: ../../library/curses.rst:1941 msgid ":const:`~curses.KEY_BACKSPACE`" msgstr ":const:`~curses.KEY_BACKSPACE`" -#: ../../library/curses.rst:1939 +#: ../../library/curses.rst:1941 msgid ":kbd:`Control-h`" msgstr ":kbd:`Control-h`" -#: ../../library/curses.rst:1942 +#: ../../library/curses.rst:1944 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: ../../library/curses.rst:1948 +#: ../../library/curses.rst:1950 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: ../../library/curses.rst:1954 +#: ../../library/curses.rst:1956 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/ensurepip.po b/library/ensurepip.po index 7e92f48d4f9..fe4b492a9dd 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-19 00:13+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+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-" @@ -58,19 +58,27 @@ msgstr "" "此模組\\ *不會*\\ 通過網路存取。所有需要用來初始建置 ``pip`` 的元件都已包含在" "套件之內。" -#: ../../library/ensurepip.rst:35 +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/ensurepip.rst:37 msgid ":ref:`installing-index`" msgstr ":ref:`installing-index`" -#: ../../library/ensurepip.rst:36 +#: ../../library/ensurepip.rst:38 msgid "The end user guide for installing Python packages" msgstr "對於終端使用者安裝 Python 套件的指引" -#: ../../library/ensurepip.rst:38 +#: ../../library/ensurepip.rst:40 msgid ":pep:`453`: Explicit bootstrapping of pip in Python installations" msgstr ":pep:`453`: 在 Python 安裝中的 pip 明確初始建置" -#: ../../library/ensurepip.rst:39 +#: ../../library/ensurepip.rst:41 msgid "The original rationale and specification for this module." msgstr "此模組的最初設計理念與規範。" @@ -86,24 +94,24 @@ msgstr "" "此模組在\\ :ref:`行動平台 `\\ 或\\ :ref:`WebAssembly 平" "台 `\\ 上不支援。" -#: ../../library/ensurepip.rst:44 +#: ../../library/ensurepip.rst:46 msgid "Command line interface" msgstr "命令列介面" -#: ../../library/ensurepip.rst:48 +#: ../../library/ensurepip.rst:50 msgid "" "The command line interface is invoked using the interpreter's ``-m`` switch." msgstr "使用直譯器 (interpreter) 的 ``-m`` 來叫用命令列介面" -#: ../../library/ensurepip.rst:50 +#: ../../library/ensurepip.rst:52 msgid "The simplest possible invocation is::" msgstr "最簡單可行的呼叫: ::" -#: ../../library/ensurepip.rst:52 +#: ../../library/ensurepip.rst:54 msgid "python -m ensurepip" msgstr "python -m ensurepip" -#: ../../library/ensurepip.rst:54 +#: ../../library/ensurepip.rst:56 msgid "" "This invocation will install ``pip`` if it is not already installed, but " "otherwise does nothing. To ensure the installed version of ``pip`` is at " @@ -114,11 +122,11 @@ msgstr "" "upgrade`` 參數來確保 ``pip`` 的安裝版本至少為目前 ``ensurepip`` 中最新可用的" "版本: ::" -#: ../../library/ensurepip.rst:59 +#: ../../library/ensurepip.rst:61 msgid "python -m ensurepip --upgrade" msgstr "python -m ensurepip --upgrade" -#: ../../library/ensurepip.rst:61 +#: ../../library/ensurepip.rst:63 msgid "" "By default, ``pip`` is installed into the current virtual environment (if " "one is active) or into the system site packages (if there is no active " @@ -128,7 +136,7 @@ msgstr "" "預設上,``pip`` 會被安裝至目前虛擬環境(若已啟動虛擬環境)或系統端的套件(若" "沒有啟動的虛擬環境)。安裝位置可透過兩個額外的命令列選項來控制:" -#: ../../library/ensurepip.rst:68 +#: ../../library/ensurepip.rst:70 msgid "" "Installs ``pip`` relative to the given root directory rather than the root " "of the currently active virtual environment (if any) or the default root for " @@ -137,7 +145,7 @@ msgstr "" "安裝 ``pip`` 到給定的根目錄 (root directory) 的相對路徑,而不是目前虛擬環境" "(若存在)的根目錄,或目前 Python 安裝版所預設的根目錄。" -#: ../../library/ensurepip.rst:74 +#: ../../library/ensurepip.rst:76 msgid "" "Installs ``pip`` into the user site packages directory rather than globally " "for the current Python installation (this option is not permitted inside an " @@ -146,7 +154,7 @@ msgstr "" "安裝 ``pip`` 到使用者端的套件目錄,而不是全域安裝到目前的 Python 安裝版(此選" "項不允許在一啟動的虛擬環境中使用)。" -#: ../../library/ensurepip.rst:78 +#: ../../library/ensurepip.rst:80 msgid "" "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " "stands for the version of Python used to invoke ``ensurepip``). The scripts " @@ -155,42 +163,42 @@ msgstr "" "預設會安裝 ``pipX`` 和 ``pipX.Y`` 腳本(X.Y 代表用來叫用 ``ensurepip`` 的 " "Python 之版本)。安裝的腳本可透過兩個額外的命令列選項來控制:" -#: ../../library/ensurepip.rst:85 +#: ../../library/ensurepip.rst:87 msgid "" "If an alternate installation is requested, the ``pipX`` script will *not* be " "installed." msgstr "若要求一個替代安裝版,則\\ *不會*\\ 安裝 ``pipX`` 腳本。" -#: ../../library/ensurepip.rst:90 +#: ../../library/ensurepip.rst:92 msgid "" "If a \"default pip\" installation is requested, the ``pip`` script will be " "installed in addition to the two regular scripts." msgstr "若要求安裝「預設 pip」,則會安裝 ``pip`` 腳本,及 2 個常規腳本。" -#: ../../library/ensurepip.rst:93 +#: ../../library/ensurepip.rst:95 msgid "" "Providing both of the script selection options will trigger an exception." msgstr "提供兩種指令選項將會導致例外 (exception) 。" -#: ../../library/ensurepip.rst:96 +#: ../../library/ensurepip.rst:98 msgid "Module API" msgstr "模組 API" -#: ../../library/ensurepip.rst:98 +#: ../../library/ensurepip.rst:100 msgid ":mod:`ensurepip` exposes two functions for programmatic use:" msgstr ":mod:`ensurepip` 開放了兩個用於編寫程式的函式:" -#: ../../library/ensurepip.rst:102 +#: ../../library/ensurepip.rst:104 msgid "" "Returns a string specifying the available version of pip that will be " "installed when bootstrapping an environment." msgstr "回傳一個字串,用以標明初始建置時,安裝的 pip 的可行版本號。" -#: ../../library/ensurepip.rst:109 +#: ../../library/ensurepip.rst:111 msgid "Bootstraps ``pip`` into the current or designated environment." msgstr "在目前或指定的環境之中建立 ``pip``。" -#: ../../library/ensurepip.rst:111 +#: ../../library/ensurepip.rst:113 msgid "" "*root* specifies an alternative root directory to install relative to. If " "*root* is ``None``, then installation uses the default install location for " @@ -199,64 +207,64 @@ msgstr "" "*root* 指定一個替代的根目錄,作為安裝的相對路徑。若 *root* 為 ``None``,則安" "裝使用目前環境的預設安裝位置。" -#: ../../library/ensurepip.rst:115 +#: ../../library/ensurepip.rst:117 msgid "" "*upgrade* indicates whether or not to upgrade an existing installation of an " "earlier version of ``pip`` to the available version." msgstr "*upgrade* 指出是否要將一個既有的較早版本的 ``pip`` 升級至可用的新版。" -#: ../../library/ensurepip.rst:118 +#: ../../library/ensurepip.rst:120 msgid "" "*user* indicates whether to use the user scheme rather than installing " "globally." msgstr "*user* 指出是否要使用使用者的安裝方案而不是全域安裝。" -#: ../../library/ensurepip.rst:121 +#: ../../library/ensurepip.rst:123 msgid "" "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " "stands for the current version of Python)." msgstr "預設會安裝 ``pipX`` 和 ``pipX.Y`` 腳本(X.Y 代表 Python 的目前版本)。" -#: ../../library/ensurepip.rst:124 +#: ../../library/ensurepip.rst:126 msgid "If *altinstall* is set, then ``pipX`` will *not* be installed." msgstr "如果啟用了 *altinstall*,則不會安裝 ``pipX``。" -#: ../../library/ensurepip.rst:126 +#: ../../library/ensurepip.rst:128 msgid "" "If *default_pip* is set, then ``pip`` will be installed in addition to the " "two regular scripts." msgstr "如果啟用了 *default_pip*,則會安裝 ``pip``,以及 2 個常規腳本。" -#: ../../library/ensurepip.rst:129 +#: ../../library/ensurepip.rst:131 msgid "" "Setting both *altinstall* and *default_pip* will trigger :exc:`ValueError`." msgstr "同時啟用 *altinstall* 跟 *default_pip*,將會觸發 :exc:`ValueError`。" -#: ../../library/ensurepip.rst:132 +#: ../../library/ensurepip.rst:134 msgid "" "*verbosity* controls the level of output to :data:`sys.stdout` from the " "bootstrapping operation." msgstr "" "*verbosity* 用來控制初始建置操作內,對於 :data:`sys.stdout` 的輸出等級。" -#: ../../library/ensurepip.rst:135 +#: ../../library/ensurepip.rst:137 msgid "" "Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " "argument ``root``." msgstr "" -"引發一個附帶引數 ``root`` 的\\ :ref:`稽核事件 ` " -"``ensurepip.bootstrap``。" +"引發一個附帶引數 ``root`` 的\\ :ref:`稽核事件 ` ``ensurepip." +"bootstrap``。" -#: ../../library/ensurepip.rst:139 +#: ../../library/ensurepip.rst:141 msgid "" -"The bootstrapping process has side effects on both ``sys.path`` and " -"``os.environ``. Invoking the command line interface in a subprocess instead " +"The bootstrapping process has side effects on both ``sys.path`` and ``os." +"environ``. Invoking the command line interface in a subprocess instead " "allows these side effects to be avoided." msgstr "" "初始建置的過程對於 ``sys.path`` 及 ``os.environ`` 均有副作用。改為在一子行程 " "(subprocess) 呼叫命令列介面可避免這些副作用。" -#: ../../library/ensurepip.rst:145 +#: ../../library/ensurepip.rst:147 msgid "" "The bootstrapping process may install additional modules required by " "``pip``, but other software should not assume those dependencies will always " diff --git a/library/functions.po b/library/functions.po index b7d0254a17b..c3e8d654e1d 100644 --- a/library/functions.po +++ b/library/functions.po @@ -10,7 +10,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-11-10 16:45+0000\n" "PO-Revision-Date: 2024-05-06 17:06+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3237,7 +3237,7 @@ msgid "" "implemented. This will help avoid bugs when using the same data with other " "ordering tools such as :func:`max` that rely on a different underlying " "method. Implementing all six comparisons also helps avoid confusion for " -"mixed type comparisons which can call reflected the :meth:`~object.__gt__` " +"mixed type comparisons which can call the reflected :meth:`~object.__gt__` " "method." msgstr "" diff --git a/library/gzip.po b/library/gzip.po index ef7e20773d4..9ca208ed592 100644 --- a/library/gzip.po +++ b/library/gzip.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-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,100 +32,107 @@ msgid "" "just like the GNU programs :program:`gzip` and :program:`gunzip` would." msgstr "" -#: ../../library/gzip.rst:14 -msgid "The data compression is provided by the :mod:`zlib` module." +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." msgstr "" #: ../../library/gzip.rst:16 +msgid "The data compression is provided by the :mod:`zlib` module." +msgstr "" + +#: ../../library/gzip.rst:18 msgid "" -"The :mod:`gzip` module provides the :class:`GzipFile` class, as well as " -"the :func:`.open`, :func:`compress` and :func:`decompress` convenience " -"functions. The :class:`GzipFile` class reads and writes :program:`gzip`\\ " -"-format files, automatically compressing or decompressing the data so that " -"it looks like an ordinary :term:`file object`." +"The :mod:`gzip` module provides the :class:`GzipFile` class, as well as the :" +"func:`.open`, :func:`compress` and :func:`decompress` convenience functions. " +"The :class:`GzipFile` class reads and writes :program:`gzip`\\ -format " +"files, automatically compressing or decompressing the data so that it looks " +"like an ordinary :term:`file object`." msgstr "" -#: ../../library/gzip.rst:22 +#: ../../library/gzip.rst:24 msgid "" -"Note that additional file formats which can be decompressed by " -"the :program:`gzip` and :program:`gunzip` programs, such as those produced " -"by :program:`compress` and :program:`pack`, are not supported by this module." +"Note that additional file formats which can be decompressed by the :program:" +"`gzip` and :program:`gunzip` programs, such as those produced by :program:" +"`compress` and :program:`pack`, are not supported by this module." msgstr "" -#: ../../library/gzip.rst:26 +#: ../../library/gzip.rst:28 msgid "The module defines the following items:" msgstr "此模組定義了以下項目:" -#: ../../library/gzip.rst:31 +#: ../../library/gzip.rst:33 msgid "" "Open a gzip-compressed file in binary or text mode, returning a :term:`file " "object`." msgstr "" -#: ../../library/gzip.rst:34 +#: ../../library/gzip.rst:36 msgid "" -"The *filename* argument can be an actual filename (a :class:`str` " -"or :class:`bytes` object), or an existing file object to read from or write " -"to." +"The *filename* argument can be an actual filename (a :class:`str` or :class:" +"`bytes` object), or an existing file object to read from or write to." msgstr "" -#: ../../library/gzip.rst:37 +#: ../../library/gzip.rst:39 msgid "" "The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, " "``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``, " "``'at'``, ``'wt'``, or ``'xt'`` for text mode. The default is ``'rb'``." msgstr "" -#: ../../library/gzip.rst:41 +#: ../../library/gzip.rst:43 msgid "" -"The *compresslevel* argument is an integer from 0 to 9, as for " -"the :class:`GzipFile` constructor." +"The *compresslevel* argument is an integer from 0 to 9, as for the :class:" +"`GzipFile` constructor." msgstr "" -#: ../../library/gzip.rst:44 +#: ../../library/gzip.rst:46 msgid "" "For binary mode, this function is equivalent to the :class:`GzipFile` " "constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the " "*encoding*, *errors* and *newline* arguments must not be provided." msgstr "" -#: ../../library/gzip.rst:48 +#: ../../library/gzip.rst:50 msgid "" -"For text mode, a :class:`GzipFile` object is created, and wrapped in " -"an :class:`io.TextIOWrapper` instance with the specified encoding, error " +"For text mode, a :class:`GzipFile` object is created, and wrapped in an :" +"class:`io.TextIOWrapper` instance with the specified encoding, error " "handling behavior, and line ending(s)." msgstr "" -#: ../../library/gzip.rst:52 +#: ../../library/gzip.rst:54 msgid "" "Added support for *filename* being a file object, support for text mode, and " "the *encoding*, *errors* and *newline* arguments." msgstr "" -#: ../../library/gzip.rst:56 +#: ../../library/gzip.rst:58 msgid "Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes." msgstr "新增 ``'x'``、``'xb'`` 和 ``'xt'`` 模式的支援。" -#: ../../library/gzip.rst:59 ../../library/gzip.rst:173 +#: ../../library/gzip.rst:61 ../../library/gzip.rst:175 msgid "Accepts a :term:`path-like object`." msgstr "接受\\ :term:`類路徑物件 `。" -#: ../../library/gzip.rst:64 +#: ../../library/gzip.rst:66 msgid "" -"An exception raised for invalid gzip files. It inherits " -"from :exc:`OSError`. :exc:`EOFError` and :exc:`zlib.error` can also be " -"raised for invalid gzip files." +"An exception raised for invalid gzip files. It inherits from :exc:" +"`OSError`. :exc:`EOFError` and :exc:`zlib.error` can also be raised for " +"invalid gzip files." msgstr "" -#: ../../library/gzip.rst:72 +#: ../../library/gzip.rst:74 msgid "" "Constructor for the :class:`GzipFile` class, which simulates most of the " -"methods of a :term:`file object`, with the exception of " -"the :meth:`~io.IOBase.truncate` method. At least one of *fileobj* and " -"*filename* must be given a non-trivial value." +"methods of a :term:`file object`, with the exception of the :meth:`~io." +"IOBase.truncate` method. At least one of *fileobj* and *filename* must be " +"given a non-trivial value." msgstr "" -#: ../../library/gzip.rst:77 +#: ../../library/gzip.rst:79 msgid "" "The new class instance is based on *fileobj*, which can be a regular file, " "an :class:`io.BytesIO` object, or any other object which simulates a file. " @@ -133,7 +140,7 @@ msgid "" "file object." msgstr "" -#: ../../library/gzip.rst:82 +#: ../../library/gzip.rst:84 msgid "" "When *fileobj* is not ``None``, the *filename* argument is only used to be " "included in the :program:`gzip` file header, which may include the original " @@ -142,7 +149,7 @@ msgid "" "in this case the original filename is not included in the header." msgstr "" -#: ../../library/gzip.rst:88 +#: ../../library/gzip.rst:90 msgid "" "The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, " "``'w'``, ``'wb'``, ``'x'``, or ``'xb'``, depending on whether the file will " @@ -152,14 +159,14 @@ msgid "" "writing." msgstr "" -#: ../../library/gzip.rst:94 +#: ../../library/gzip.rst:96 msgid "" "Note that the file is always opened in binary mode. To open a compressed " "file in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with " "an :class:`io.TextIOWrapper`)." msgstr "" -#: ../../library/gzip.rst:98 +#: ../../library/gzip.rst:100 msgid "" "The *compresslevel* argument is an integer from ``0`` to ``9`` controlling " "the level of compression; ``1`` is fastest and produces the least " @@ -167,7 +174,7 @@ msgid "" "is no compression. The default is ``9``." msgstr "" -#: ../../library/gzip.rst:103 +#: ../../library/gzip.rst:105 msgid "" "The optional *mtime* argument is the timestamp requested by gzip. The time " "is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. If " @@ -175,54 +182,53 @@ msgid "" "generate a compressed stream that does not depend on creation time." msgstr "" -#: ../../library/gzip.rst:108 +#: ../../library/gzip.rst:110 msgid "" "See below for the :attr:`mtime` attribute that is set when decompressing." msgstr "" -#: ../../library/gzip.rst:110 +#: ../../library/gzip.rst:112 msgid "" "Calling a :class:`GzipFile` object's :meth:`!close` method does not close " "*fileobj*, since you might wish to append more material after the compressed " "data. This also allows you to pass an :class:`io.BytesIO` object opened for " -"writing as *fileobj*, and retrieve the resulting memory buffer using " -"the :class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method." +"writing as *fileobj*, and retrieve the resulting memory buffer using the :" +"class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method." msgstr "" -#: ../../library/gzip.rst:116 +#: ../../library/gzip.rst:118 msgid "" ":class:`GzipFile` supports the :class:`io.BufferedIOBase` interface, " -"including iteration and the :keyword:`with` statement. Only " -"the :meth:`~io.IOBase.truncate` method isn't implemented." +"including iteration and the :keyword:`with` statement. Only the :meth:`~io." +"IOBase.truncate` method isn't implemented." msgstr "" -#: ../../library/gzip.rst:120 +#: ../../library/gzip.rst:122 msgid ":class:`GzipFile` also provides the following method and attribute:" msgstr ":class:`GzipFile` 也提供了以下的方法和屬性:" -#: ../../library/gzip.rst:124 +#: ../../library/gzip.rst:126 msgid "" "Read *n* uncompressed bytes without advancing the file position. The number " "of bytes returned may be more or less than requested." msgstr "" -#: ../../library/gzip.rst:127 +#: ../../library/gzip.rst:129 msgid "" -"While calling :meth:`peek` does not change the file position of " -"the :class:`GzipFile`, it may change the position of the underlying file " -"object (e.g. if the :class:`GzipFile` was constructed with the *fileobj* " -"parameter)." +"While calling :meth:`peek` does not change the file position of the :class:" +"`GzipFile`, it may change the position of the underlying file object (e.g. " +"if the :class:`GzipFile` was constructed with the *fileobj* parameter)." msgstr "" -#: ../../library/gzip.rst:136 +#: ../../library/gzip.rst:138 msgid "``'rb'`` for reading and ``'wb'`` for writing." msgstr "" -#: ../../library/gzip.rst:138 +#: ../../library/gzip.rst:140 msgid "In previous versions it was an integer ``1`` or ``2``." msgstr "" -#: ../../library/gzip.rst:143 +#: ../../library/gzip.rst:145 msgid "" "When decompressing, this attribute is set to the last timestamp in the most " "recently read header. It is an integer, holding the number of seconds since " @@ -230,51 +236,51 @@ msgid "" "reading any headers is ``None``." msgstr "" -#: ../../library/gzip.rst:150 +#: ../../library/gzip.rst:152 msgid "" "The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. " "Equivalent to the output of :func:`os.fspath` on the original input path, " "with no other normalization, resolution or expansion." msgstr "" -#: ../../library/gzip.rst:154 +#: ../../library/gzip.rst:156 msgid "" "Support for the :keyword:`with` statement was added, along with the *mtime* " "constructor argument and :attr:`mtime` attribute." msgstr "" -#: ../../library/gzip.rst:158 +#: ../../library/gzip.rst:160 msgid "Support for zero-padded and unseekable files was added." msgstr "" -#: ../../library/gzip.rst:161 +#: ../../library/gzip.rst:163 msgid "The :meth:`io.BufferedIOBase.read1` method is now implemented." msgstr ":meth:`io.BufferedIOBase.read1` 方法現在已有實作。" -#: ../../library/gzip.rst:164 +#: ../../library/gzip.rst:166 msgid "Added support for the ``'x'`` and ``'xb'`` modes." msgstr "新增 ``'x'`` 和 ``'xb'`` 模式的支援。" -#: ../../library/gzip.rst:167 +#: ../../library/gzip.rst:169 msgid "" "Added support for writing arbitrary :term:`bytes-like objects `. The :meth:`~io.BufferedIOBase.read` method now accepts an argument " "of ``None``." msgstr "" -#: ../../library/gzip.rst:176 +#: ../../library/gzip.rst:178 msgid "" "Opening :class:`GzipFile` for writing without specifying the *mode* argument " "is deprecated." msgstr "" -#: ../../library/gzip.rst:180 +#: ../../library/gzip.rst:182 msgid "" "Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute " "instead." msgstr "" -#: ../../library/gzip.rst:187 +#: ../../library/gzip.rst:189 msgid "" "Compress the *data*, returning a :class:`bytes` object containing the " "compressed data. *compresslevel* and *mtime* have the same meaning as in " @@ -282,32 +288,32 @@ msgid "" "reproducible output." msgstr "" -#: ../../library/gzip.rst:193 +#: ../../library/gzip.rst:195 msgid "Added the *mtime* parameter for reproducible output." msgstr "" -#: ../../library/gzip.rst:195 +#: ../../library/gzip.rst:197 msgid "" "Speed is improved by compressing all data at once instead of in a streamed " -"fashion. Calls with *mtime* set to ``0`` are delegated " -"to :func:`zlib.compress` for better speed. In this situation the output may " -"contain a gzip header \"OS\" byte value other than 255 \"unknown\" as " -"supplied by the underlying zlib implementation." +"fashion. Calls with *mtime* set to ``0`` are delegated to :func:`zlib." +"compress` for better speed. In this situation the output may contain a gzip " +"header \"OS\" byte value other than 255 \"unknown\" as supplied by the " +"underlying zlib implementation." msgstr "" -#: ../../library/gzip.rst:202 +#: ../../library/gzip.rst:204 msgid "" "The gzip header OS byte is guaranteed to be set to 255 when this function is " "used as was the case in 3.10 and earlier." msgstr "" -#: ../../library/gzip.rst:205 +#: ../../library/gzip.rst:207 msgid "" "The *mtime* parameter now defaults to 0 for reproducible output. For the " "previous behaviour of using the current time, pass ``None`` to *mtime*." msgstr "" -#: ../../library/gzip.rst:212 +#: ../../library/gzip.rst:214 msgid "" "Decompress the *data*, returning a :class:`bytes` object containing the " "uncompressed data. This function is capable of decompressing multi-member " @@ -316,21 +322,21 @@ msgid "" "*wbits* set to 31 is faster." msgstr "" -#: ../../library/gzip.rst:219 +#: ../../library/gzip.rst:221 msgid "" "Speed is improved by decompressing members at once in memory instead of in a " "streamed fashion." msgstr "" -#: ../../library/gzip.rst:226 +#: ../../library/gzip.rst:228 msgid "Examples of usage" msgstr "用法範例" -#: ../../library/gzip.rst:228 +#: ../../library/gzip.rst:230 msgid "Example of how to read a compressed file::" msgstr "如何讀取壓縮檔案的範例: ::" -#: ../../library/gzip.rst:230 +#: ../../library/gzip.rst:232 msgid "" "import gzip\n" "with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" @@ -340,11 +346,11 @@ msgstr "" "with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" " file_content = f.read()" -#: ../../library/gzip.rst:234 +#: ../../library/gzip.rst:236 msgid "Example of how to create a compressed GZIP file::" msgstr "如何建立一個壓縮的 GZIP 檔案的範例: ::" -#: ../../library/gzip.rst:236 +#: ../../library/gzip.rst:238 msgid "" "import gzip\n" "content = b\"Lots of content here\"\n" @@ -356,11 +362,11 @@ msgstr "" "with gzip.open('/home/joe/file.txt.gz', 'wb') as f:\n" " f.write(content)" -#: ../../library/gzip.rst:241 +#: ../../library/gzip.rst:243 msgid "Example of how to GZIP compress an existing file::" msgstr "如何壓縮一個已存在的檔案的範例: ::" -#: ../../library/gzip.rst:243 +#: ../../library/gzip.rst:245 msgid "" "import gzip\n" "import shutil\n" @@ -374,11 +380,11 @@ msgstr "" " with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:\n" " shutil.copyfileobj(f_in, f_out)" -#: ../../library/gzip.rst:249 +#: ../../library/gzip.rst:251 msgid "Example of how to GZIP compress a binary string::" msgstr "如何壓縮一個二進位字串的範例: ::" -#: ../../library/gzip.rst:251 +#: ../../library/gzip.rst:253 msgid "" "import gzip\n" "s_in = b\"Lots of content here\"\n" @@ -388,62 +394,62 @@ msgstr "" "s_in = b\"Lots of content here\"\n" "s_out = gzip.compress(s_in)" -#: ../../library/gzip.rst:257 +#: ../../library/gzip.rst:259 msgid "Module :mod:`zlib`" msgstr ":mod:`zlib` 模組" -#: ../../library/gzip.rst:258 +#: ../../library/gzip.rst:260 msgid "" "The basic data compression module needed to support the :program:`gzip` file " "format." msgstr "" -#: ../../library/gzip.rst:261 +#: ../../library/gzip.rst:263 msgid "" "In case gzip (de)compression is a bottleneck, the `python-isal`_ package " "speeds up (de)compression with a mostly compatible API." msgstr "" -#: ../../library/gzip.rst:271 +#: ../../library/gzip.rst:273 msgid "Command Line Interface" msgstr "命令列介面" -#: ../../library/gzip.rst:273 +#: ../../library/gzip.rst:275 msgid "" "The :mod:`gzip` module provides a simple command line interface to compress " "or decompress files." msgstr "" -#: ../../library/gzip.rst:276 +#: ../../library/gzip.rst:278 msgid "Once executed the :mod:`gzip` module keeps the input file(s)." msgstr "" -#: ../../library/gzip.rst:280 +#: ../../library/gzip.rst:282 msgid "" "Add a new command line interface with a usage. By default, when you will " "execute the CLI, the default compression level is 6." msgstr "" -#: ../../library/gzip.rst:284 +#: ../../library/gzip.rst:286 msgid "Command line options" msgstr "命令列選項" -#: ../../library/gzip.rst:288 +#: ../../library/gzip.rst:290 msgid "If *file* is not specified, read from :data:`sys.stdin`." msgstr "如果未指定 *file*,則從 :data:`sys.stdin` 讀取。" -#: ../../library/gzip.rst:292 +#: ../../library/gzip.rst:294 msgid "Indicates the fastest compression method (less compression)." msgstr "" -#: ../../library/gzip.rst:296 +#: ../../library/gzip.rst:298 msgid "Indicates the slowest compression method (best compression)." msgstr "" -#: ../../library/gzip.rst:300 +#: ../../library/gzip.rst:302 msgid "Decompress the given file." msgstr "解壓縮指定的檔案。" -#: ../../library/gzip.rst:304 +#: ../../library/gzip.rst:306 msgid "Show the help message." msgstr "顯示幫助訊息。" diff --git a/library/idle.po b/library/idle.po index 4a69237b923..1cae6123278 100644 --- a/library/idle.po +++ b/library/idle.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-07 00:14+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,11 +70,23 @@ msgstr "具有持久性斷點、能夠逐步執行和檢視全域和區域命名 msgid "configuration, browsers, and other dialogs" msgstr "設定、瀏覽器和其他對話框" -#: ../../library/idle.rst:41 +#: ../../library/idle.rst:40 +msgid "The IDLE application is implemented in the :mod:`idlelib` package." +msgstr "" + +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/idle.rst:45 msgid "Menus" msgstr "目錄" -#: ../../library/idle.rst:43 +#: ../../library/idle.rst:47 msgid "" "IDLE has two main window types, the Shell window and the Editor window. It " "is possible to have multiple editor windows simultaneously. On Windows and " @@ -82,81 +94,81 @@ msgid "" "which window type it is associated with." msgstr "" -#: ../../library/idle.rst:48 +#: ../../library/idle.rst:52 msgid "" "Output windows, such as used for Edit => Find in Files, are a subtype of " "editor window. They currently have the same top menu but a different " "default title and context menu." msgstr "" -#: ../../library/idle.rst:52 +#: ../../library/idle.rst:56 msgid "" "On macOS, there is one application menu. It dynamically changes according " "to the window currently selected. It has an IDLE menu, and some entries " "described below are moved around to conform to Apple guidelines." msgstr "" -#: ../../library/idle.rst:57 +#: ../../library/idle.rst:61 msgid "File menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:59 +#: ../../library/idle.rst:63 msgid "New File" msgstr "新增檔案" -#: ../../library/idle.rst:60 +#: ../../library/idle.rst:64 msgid "Create a new file editing window." msgstr "" -#: ../../library/idle.rst:62 +#: ../../library/idle.rst:66 msgid "Open..." msgstr "" -#: ../../library/idle.rst:63 +#: ../../library/idle.rst:67 msgid "Open an existing file with an Open dialog." msgstr "" -#: ../../library/idle.rst:65 +#: ../../library/idle.rst:69 msgid "Open Module..." msgstr "" -#: ../../library/idle.rst:66 +#: ../../library/idle.rst:70 msgid "Open an existing module (searches sys.path)." msgstr "" -#: ../../library/idle.rst:68 +#: ../../library/idle.rst:72 msgid "Recent Files" msgstr "" -#: ../../library/idle.rst:69 +#: ../../library/idle.rst:73 msgid "Open a list of recent files. Click one to open it." msgstr "" -#: ../../library/idle.rst:75 +#: ../../library/idle.rst:79 msgid "Module Browser" msgstr "" -#: ../../library/idle.rst:76 +#: ../../library/idle.rst:80 msgid "" "Show functions, classes, and methods in the current Editor file in a tree " "structure. In the shell, open a module first." msgstr "" -#: ../../library/idle.rst:79 +#: ../../library/idle.rst:83 msgid "Path Browser" msgstr "" -#: ../../library/idle.rst:80 +#: ../../library/idle.rst:84 msgid "" "Show sys.path directories, modules, functions, classes and methods in a tree " "structure." msgstr "" -#: ../../library/idle.rst:83 +#: ../../library/idle.rst:87 msgid "Save" msgstr "" -#: ../../library/idle.rst:84 +#: ../../library/idle.rst:88 msgid "" "Save the current window to the associated file, if there is one. Windows " "that have been changed since being opened or last saved have a \\* before " @@ -164,11 +176,11 @@ msgid "" "instead." msgstr "" -#: ../../library/idle.rst:89 +#: ../../library/idle.rst:93 msgid "Save As..." msgstr "" -#: ../../library/idle.rst:90 +#: ../../library/idle.rst:94 msgid "" "Save the current window with a Save As dialog. The file saved becomes the " "new associated file for the window. (If your file manager is set to hide " @@ -177,283 +189,283 @@ msgid "" "text files, except that on macOS Aqua,'.py' is added for all files.)" msgstr "" -#: ../../library/idle.rst:96 +#: ../../library/idle.rst:100 msgid "Save Copy As..." msgstr "" -#: ../../library/idle.rst:97 +#: ../../library/idle.rst:101 msgid "" "Save the current window to different file without changing the associated " "file. (See Save As note above about filename extensions.)" msgstr "" -#: ../../library/idle.rst:100 +#: ../../library/idle.rst:104 msgid "Print Window" msgstr "" -#: ../../library/idle.rst:101 +#: ../../library/idle.rst:105 msgid "Print the current window to the default printer." msgstr "" -#: ../../library/idle.rst:103 +#: ../../library/idle.rst:107 msgid "Close Window" msgstr "" -#: ../../library/idle.rst:104 +#: ../../library/idle.rst:108 msgid "" "Close the current window (if an unsaved editor, ask to save; if an unsaved " "Shell, ask to quit execution). Calling ``exit()`` or ``close()`` in the " "Shell window also closes Shell. If this is the only window, also exit IDLE." msgstr "" -#: ../../library/idle.rst:108 +#: ../../library/idle.rst:112 msgid "Exit IDLE" msgstr "離開 IDLE" -#: ../../library/idle.rst:109 +#: ../../library/idle.rst:113 msgid "Close all windows and quit IDLE (ask to save unsaved edit windows)." msgstr "" -#: ../../library/idle.rst:112 +#: ../../library/idle.rst:116 msgid "Edit menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:114 +#: ../../library/idle.rst:118 msgid "Undo" msgstr "" -#: ../../library/idle.rst:115 +#: ../../library/idle.rst:119 msgid "" "Undo the last change to the current window. A maximum of 1000 changes may " "be undone." msgstr "" -#: ../../library/idle.rst:118 +#: ../../library/idle.rst:122 msgid "Redo" msgstr "" -#: ../../library/idle.rst:119 +#: ../../library/idle.rst:123 msgid "Redo the last undone change to the current window." msgstr "" -#: ../../library/idle.rst:121 +#: ../../library/idle.rst:125 msgid "Select All" msgstr "Select All(選擇全部)" -#: ../../library/idle.rst:122 +#: ../../library/idle.rst:126 msgid "Select the entire contents of the current window." msgstr "" -#: ../../library/idle.rst:124 ../../library/idle.rst:356 -#: ../../library/idle.rst:370 +#: ../../library/idle.rst:128 ../../library/idle.rst:360 +#: ../../library/idle.rst:374 msgid "Cut" msgstr "Cut(剪下)" -#: ../../library/idle.rst:125 ../../library/idle.rst:371 +#: ../../library/idle.rst:129 ../../library/idle.rst:375 msgid "" "Copy selection into the system-wide clipboard; then delete the selection." msgstr "" -#: ../../library/idle.rst:127 ../../library/idle.rst:356 -#: ../../library/idle.rst:373 +#: ../../library/idle.rst:131 ../../library/idle.rst:360 +#: ../../library/idle.rst:377 msgid "Copy" msgstr "Copy(複製)" -#: ../../library/idle.rst:128 ../../library/idle.rst:374 +#: ../../library/idle.rst:132 ../../library/idle.rst:378 msgid "Copy selection into the system-wide clipboard." msgstr "" -#: ../../library/idle.rst:130 ../../library/idle.rst:356 -#: ../../library/idle.rst:376 +#: ../../library/idle.rst:134 ../../library/idle.rst:360 +#: ../../library/idle.rst:380 msgid "Paste" msgstr "Paste(貼上)" -#: ../../library/idle.rst:131 ../../library/idle.rst:377 +#: ../../library/idle.rst:135 ../../library/idle.rst:381 msgid "Insert contents of the system-wide clipboard into the current window." msgstr "" -#: ../../library/idle.rst:133 +#: ../../library/idle.rst:137 msgid "The clipboard functions are also available in context menus." msgstr "" -#: ../../library/idle.rst:135 +#: ../../library/idle.rst:139 msgid "Find..." msgstr "" -#: ../../library/idle.rst:136 +#: ../../library/idle.rst:140 msgid "Open a search dialog with many options" msgstr "" -#: ../../library/idle.rst:138 +#: ../../library/idle.rst:142 msgid "Find Again" msgstr "" -#: ../../library/idle.rst:139 +#: ../../library/idle.rst:143 msgid "Repeat the last search, if there is one." msgstr "" -#: ../../library/idle.rst:141 +#: ../../library/idle.rst:145 msgid "Find Selection" msgstr "" -#: ../../library/idle.rst:142 +#: ../../library/idle.rst:146 msgid "Search for the currently selected string, if there is one." msgstr "" -#: ../../library/idle.rst:144 +#: ../../library/idle.rst:148 msgid "Find in Files..." msgstr "" -#: ../../library/idle.rst:145 +#: ../../library/idle.rst:149 msgid "Open a file search dialog. Put results in a new output window." msgstr "" -#: ../../library/idle.rst:147 +#: ../../library/idle.rst:151 msgid "Replace..." msgstr "" -#: ../../library/idle.rst:148 +#: ../../library/idle.rst:152 msgid "Open a search-and-replace dialog." msgstr "" -#: ../../library/idle.rst:150 +#: ../../library/idle.rst:154 msgid "Go to Line" msgstr "" -#: ../../library/idle.rst:151 +#: ../../library/idle.rst:155 msgid "" "Move the cursor to the beginning of the line requested and make that line " "visible. A request past the end of the file goes to the end. Clear any " "selection and update the line and column status." msgstr "" -#: ../../library/idle.rst:155 +#: ../../library/idle.rst:159 msgid "Show Completions" msgstr "" -#: ../../library/idle.rst:156 +#: ../../library/idle.rst:160 msgid "" "Open a scrollable list allowing selection of existing names. See :ref:" "`Completions ` in the Editing and navigation section below." msgstr "" -#: ../../library/idle.rst:159 +#: ../../library/idle.rst:163 msgid "Expand Word" msgstr "" -#: ../../library/idle.rst:160 +#: ../../library/idle.rst:164 msgid "" "Expand a prefix you have typed to match a full word in the same window; " "repeat to get a different expansion." msgstr "" -#: ../../library/idle.rst:163 +#: ../../library/idle.rst:167 msgid "Show Call Tip" msgstr "" -#: ../../library/idle.rst:164 +#: ../../library/idle.rst:168 msgid "" "After an unclosed parenthesis for a function, open a small window with " "function parameter hints. See :ref:`Calltips ` in the Editing and " "navigation section below." msgstr "" -#: ../../library/idle.rst:168 +#: ../../library/idle.rst:172 msgid "Show Surrounding Parens" msgstr "" -#: ../../library/idle.rst:169 +#: ../../library/idle.rst:173 msgid "Highlight the surrounding parenthesis." msgstr "" -#: ../../library/idle.rst:174 +#: ../../library/idle.rst:178 msgid "Format menu (Editor window only)" msgstr "" -#: ../../library/idle.rst:176 +#: ../../library/idle.rst:180 msgid "Format Paragraph" msgstr "" -#: ../../library/idle.rst:177 +#: ../../library/idle.rst:181 msgid "" "Reformat the current blank-line-delimited paragraph in comment block or " "multiline string or selected line in a string. All lines in the paragraph " "will be formatted to less than N columns, where N defaults to 72." msgstr "" -#: ../../library/idle.rst:181 +#: ../../library/idle.rst:185 msgid "Indent Region" msgstr "" -#: ../../library/idle.rst:182 +#: ../../library/idle.rst:186 msgid "Shift selected lines right by the indent width (default 4 spaces)." msgstr "" -#: ../../library/idle.rst:184 +#: ../../library/idle.rst:188 msgid "Dedent Region" msgstr "" -#: ../../library/idle.rst:185 +#: ../../library/idle.rst:189 msgid "Shift selected lines left by the indent width (default 4 spaces)." msgstr "" -#: ../../library/idle.rst:187 +#: ../../library/idle.rst:191 msgid "Comment Out Region" msgstr "" -#: ../../library/idle.rst:188 +#: ../../library/idle.rst:192 msgid "Insert ## in front of selected lines." msgstr "" -#: ../../library/idle.rst:190 +#: ../../library/idle.rst:194 msgid "Uncomment Region" msgstr "" -#: ../../library/idle.rst:191 +#: ../../library/idle.rst:195 msgid "Remove leading # or ## from selected lines." msgstr "" -#: ../../library/idle.rst:193 +#: ../../library/idle.rst:197 msgid "Tabify Region" msgstr "" -#: ../../library/idle.rst:194 +#: ../../library/idle.rst:198 msgid "" "Turn *leading* stretches of spaces into tabs. (Note: We recommend using 4 " "space blocks to indent Python code.)" msgstr "" -#: ../../library/idle.rst:197 +#: ../../library/idle.rst:201 msgid "Untabify Region" msgstr "" -#: ../../library/idle.rst:198 +#: ../../library/idle.rst:202 msgid "Turn *all* tabs into the correct number of spaces." msgstr "" -#: ../../library/idle.rst:200 +#: ../../library/idle.rst:204 msgid "Toggle Tabs" msgstr "" -#: ../../library/idle.rst:201 +#: ../../library/idle.rst:205 msgid "Open a dialog to switch between indenting with spaces and tabs." msgstr "" -#: ../../library/idle.rst:203 +#: ../../library/idle.rst:207 msgid "New Indent Width" msgstr "" -#: ../../library/idle.rst:204 +#: ../../library/idle.rst:208 msgid "" "Open a dialog to change indent width. The accepted default by the Python " "community is 4 spaces." msgstr "" -#: ../../library/idle.rst:207 +#: ../../library/idle.rst:211 msgid "Strip Trailing Whitespace" msgstr "" -#: ../../library/idle.rst:208 +#: ../../library/idle.rst:212 msgid "" "Remove trailing space and other whitespace characters after the last non-" "whitespace character of a line by applying :meth:`str.rstrip` to each line, " @@ -461,15 +473,15 @@ msgid "" "extra newlines at the end of the file." msgstr "" -#: ../../library/idle.rst:217 +#: ../../library/idle.rst:221 msgid "Run menu (Editor window only)" msgstr "" -#: ../../library/idle.rst:221 +#: ../../library/idle.rst:225 msgid "Run Module" msgstr "" -#: ../../library/idle.rst:222 +#: ../../library/idle.rst:226 msgid "" "Do :ref:`Check Module `. If no error, restart the shell to " "clean the environment, then execute the module. Output is displayed in the " @@ -479,22 +491,22 @@ msgid "" "similar to executing a file with ``python -i file`` at a command line." msgstr "" -#: ../../library/idle.rst:232 +#: ../../library/idle.rst:236 msgid "Run... Customized" msgstr "" -#: ../../library/idle.rst:233 +#: ../../library/idle.rst:237 msgid "" "Same as :ref:`Run Module `, but run the module with customized " "settings. *Command Line Arguments* extend :data:`sys.argv` as if passed on " "a command line. The module can be run in the Shell without restarting." msgstr "" -#: ../../library/idle.rst:239 +#: ../../library/idle.rst:243 msgid "Check Module" msgstr "" -#: ../../library/idle.rst:240 +#: ../../library/idle.rst:244 msgid "" "Check the syntax of the module currently open in the Editor window. If the " "module has not been saved IDLE will either prompt the user to save or " @@ -503,70 +515,70 @@ msgid "" "window." msgstr "" -#: ../../library/idle.rst:248 +#: ../../library/idle.rst:252 msgid "Python Shell" msgstr "" -#: ../../library/idle.rst:249 +#: ../../library/idle.rst:253 msgid "Open or wake up the Python Shell window." msgstr "" -#: ../../library/idle.rst:253 +#: ../../library/idle.rst:257 msgid "Shell menu (Shell window only)" msgstr "" -#: ../../library/idle.rst:255 +#: ../../library/idle.rst:259 msgid "View Last Restart" msgstr "" -#: ../../library/idle.rst:256 +#: ../../library/idle.rst:260 msgid "Scroll the shell window to the last Shell restart." msgstr "" -#: ../../library/idle.rst:258 +#: ../../library/idle.rst:262 msgid "Restart Shell" msgstr "" -#: ../../library/idle.rst:259 +#: ../../library/idle.rst:263 msgid "" "Restart the shell to clean the environment and reset display and exception " "handling." msgstr "" -#: ../../library/idle.rst:261 +#: ../../library/idle.rst:265 msgid "Previous History" msgstr "" -#: ../../library/idle.rst:262 +#: ../../library/idle.rst:266 msgid "" "Cycle through earlier commands in history which match the current entry." msgstr "" -#: ../../library/idle.rst:264 +#: ../../library/idle.rst:268 msgid "Next History" msgstr "" -#: ../../library/idle.rst:265 +#: ../../library/idle.rst:269 msgid "Cycle through later commands in history which match the current entry." msgstr "" -#: ../../library/idle.rst:267 +#: ../../library/idle.rst:271 msgid "Interrupt Execution" msgstr "" -#: ../../library/idle.rst:268 +#: ../../library/idle.rst:272 msgid "Stop a running program." msgstr "" -#: ../../library/idle.rst:271 +#: ../../library/idle.rst:275 msgid "Debug menu (Shell window only)" msgstr "" -#: ../../library/idle.rst:273 +#: ../../library/idle.rst:277 msgid "Go to File/Line" msgstr "" -#: ../../library/idle.rst:274 +#: ../../library/idle.rst:278 msgid "" "Look on the current line. with the cursor, and the line above for a filename " "and line number. If found, open the file if not already open, and show the " @@ -575,45 +587,45 @@ msgid "" "Shell window and Output windows." msgstr "" -#: ../../library/idle.rst:284 +#: ../../library/idle.rst:288 msgid "Debugger (toggle)" msgstr "" -#: ../../library/idle.rst:285 +#: ../../library/idle.rst:289 msgid "" "When activated, code entered in the Shell or run from an Editor will run " "under the debugger. In the Editor, breakpoints can be set with the context " "menu. This feature is still incomplete and somewhat experimental." msgstr "" -#: ../../library/idle.rst:289 +#: ../../library/idle.rst:293 msgid "Stack Viewer" msgstr "" -#: ../../library/idle.rst:290 +#: ../../library/idle.rst:294 msgid "" "Show the stack traceback of the last exception in a tree widget, with access " "to locals and globals." msgstr "" -#: ../../library/idle.rst:293 +#: ../../library/idle.rst:297 msgid "Auto-open Stack Viewer" msgstr "" -#: ../../library/idle.rst:294 +#: ../../library/idle.rst:298 msgid "" "Toggle automatically opening the stack viewer on an unhandled exception." msgstr "" -#: ../../library/idle.rst:297 +#: ../../library/idle.rst:301 msgid "Options menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:299 +#: ../../library/idle.rst:303 msgid "Configure IDLE" msgstr "" -#: ../../library/idle.rst:300 +#: ../../library/idle.rst:304 msgid "" "Open a configuration dialog and change preferences for the following: fonts, " "indentation, keybindings, text color themes, startup windows and size, " @@ -622,39 +634,39 @@ msgid "" "see :ref:`Setting preferences ` under Help and preferences." msgstr "" -#: ../../library/idle.rst:307 +#: ../../library/idle.rst:311 msgid "" "Most configuration options apply to all windows or all future windows. The " "option items below only apply to the active window." msgstr "" -#: ../../library/idle.rst:310 +#: ../../library/idle.rst:314 msgid "Show/Hide Code Context (Editor Window only)" msgstr "" -#: ../../library/idle.rst:311 +#: ../../library/idle.rst:315 msgid "" "Open a pane at the top of the edit window which shows the block context of " "the code which has scrolled above the top of the window. See :ref:`Code " "Context ` in the Editing and Navigation section below." msgstr "" -#: ../../library/idle.rst:316 +#: ../../library/idle.rst:320 msgid "Show/Hide Line Numbers (Editor Window only)" msgstr "" -#: ../../library/idle.rst:317 +#: ../../library/idle.rst:321 msgid "" "Open a column to the left of the edit window which shows the number of each " "line of text. The default is off, which may be changed in the preferences " "(see :ref:`Setting preferences `)." msgstr "" -#: ../../library/idle.rst:321 +#: ../../library/idle.rst:325 msgid "Zoom/Restore Height" msgstr "" -#: ../../library/idle.rst:322 +#: ../../library/idle.rst:326 msgid "" "Toggles the window between normal size and maximum height. The initial size " "defaults to 40 lines by 80 chars unless changed on the General tab of the " @@ -664,74 +676,74 @@ msgid "" "no effect when a window is maximized." msgstr "" -#: ../../library/idle.rst:330 +#: ../../library/idle.rst:334 msgid "Window menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:332 +#: ../../library/idle.rst:336 msgid "" "Lists the names of all open windows; select one to bring it to the " "foreground (deiconifying it if necessary)." msgstr "" -#: ../../library/idle.rst:336 +#: ../../library/idle.rst:340 msgid "Help menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:338 +#: ../../library/idle.rst:342 msgid "About IDLE" msgstr "關於 IDLE" -#: ../../library/idle.rst:339 +#: ../../library/idle.rst:343 msgid "Display version, copyright, license, credits, and more." msgstr "" -#: ../../library/idle.rst:341 +#: ../../library/idle.rst:345 msgid "IDLE Help" msgstr "" -#: ../../library/idle.rst:342 +#: ../../library/idle.rst:346 msgid "" "Display this IDLE document, detailing the menu options, basic editing and " "navigation, and other tips." msgstr "" -#: ../../library/idle.rst:345 +#: ../../library/idle.rst:349 msgid "Python Docs" msgstr "Python 文件" -#: ../../library/idle.rst:346 +#: ../../library/idle.rst:350 msgid "" "Access local Python documentation, if installed, or start a web browser and " "open docs.python.org showing the latest Python documentation." msgstr "" -#: ../../library/idle.rst:349 +#: ../../library/idle.rst:353 msgid "Turtle Demo" msgstr "" -#: ../../library/idle.rst:350 +#: ../../library/idle.rst:354 msgid "Run the turtledemo module with example Python code and turtle drawings." msgstr "" -#: ../../library/idle.rst:352 +#: ../../library/idle.rst:356 msgid "" "Additional help sources may be added here with the Configure IDLE dialog " "under the General tab. See the :ref:`Help sources ` subsection " "below for more on Help menu choices." msgstr "" -#: ../../library/idle.rst:365 +#: ../../library/idle.rst:369 msgid "Context menus" msgstr "" -#: ../../library/idle.rst:367 +#: ../../library/idle.rst:371 msgid "" "Open a context menu by right-clicking in a window (Control-click on macOS). " "Context menus have the standard clipboard functions also on the Edit menu." msgstr "" -#: ../../library/idle.rst:379 +#: ../../library/idle.rst:383 msgid "" "Editor windows also have breakpoint functions. Lines with a breakpoint set " "are specially marked. Breakpoints only have an effect when running under " @@ -739,66 +751,66 @@ msgid "" "directory." msgstr "" -#: ../../library/idle.rst:356 ../../library/idle.rst:384 +#: ../../library/idle.rst:360 ../../library/idle.rst:388 msgid "Set Breakpoint" msgstr "" -#: ../../library/idle.rst:385 +#: ../../library/idle.rst:389 msgid "Set a breakpoint on the current line." msgstr "" -#: ../../library/idle.rst:356 ../../library/idle.rst:387 +#: ../../library/idle.rst:360 ../../library/idle.rst:391 msgid "Clear Breakpoint" msgstr "" -#: ../../library/idle.rst:388 +#: ../../library/idle.rst:392 msgid "Clear the breakpoint on that line." msgstr "" -#: ../../library/idle.rst:390 +#: ../../library/idle.rst:394 msgid "Shell and Output windows also have the following." msgstr "" -#: ../../library/idle.rst:392 +#: ../../library/idle.rst:396 msgid "Go to file/line" msgstr "" -#: ../../library/idle.rst:393 +#: ../../library/idle.rst:397 msgid "Same as in Debug menu." msgstr "" -#: ../../library/idle.rst:395 +#: ../../library/idle.rst:399 msgid "" "The Shell window also has an output squeezing facility explained in the " "*Python Shell window* subsection below." msgstr "" -#: ../../library/idle.rst:398 +#: ../../library/idle.rst:402 msgid "Squeeze" msgstr "" -#: ../../library/idle.rst:399 +#: ../../library/idle.rst:403 msgid "" "If the cursor is over an output line, squeeze all the output between the " "code above and the prompt below down to a 'Squeezed text' label." msgstr "" -#: ../../library/idle.rst:406 +#: ../../library/idle.rst:410 msgid "Editing and Navigation" msgstr "" -#: ../../library/idle.rst:409 +#: ../../library/idle.rst:413 msgid "Editor windows" msgstr "" -#: ../../library/idle.rst:411 +#: ../../library/idle.rst:415 msgid "" "IDLE may open editor windows when it starts, depending on settings and how " "you start IDLE. Thereafter, use the File menu. There can be only one open " "editor window for a given file." msgstr "" -#: ../../library/idle.rst:415 +#: ../../library/idle.rst:419 msgid "" "The title bar contains the name of the file, the full path, and the version " "of Python and IDLE running the window. The status bar contains the line " @@ -806,17 +818,17 @@ msgid "" "numbers with 0." msgstr "" -#: ../../library/idle.rst:420 +#: ../../library/idle.rst:424 msgid "" "IDLE assumes that files with a known .py* extension contain Python code and " "that other files do not. Run Python code with the Run menu." msgstr "" -#: ../../library/idle.rst:424 +#: ../../library/idle.rst:428 msgid "Key bindings" msgstr "" -#: ../../library/idle.rst:426 +#: ../../library/idle.rst:430 msgid "" "The IDLE insertion cursor is a thin vertical bar between character " "positions. When characters are entered, the insertion cursor and everything " @@ -824,7 +836,7 @@ msgid "" "the new space." msgstr "" -#: ../../library/idle.rst:431 +#: ../../library/idle.rst:435 msgid "" "Several non-character keys move the cursor and possibly delete characters. " "Deletion does not puts text on the clipboard, but IDLE has an undo list. " @@ -833,52 +845,52 @@ msgid "" "discussions assume that the keys have not been re-bound to something else.)" msgstr "" -#: ../../library/idle.rst:438 +#: ../../library/idle.rst:442 msgid "Arrow keys move the cursor one character or line." msgstr "" -#: ../../library/idle.rst:440 +#: ../../library/idle.rst:444 msgid "" ":kbd:`C-LeftArrow` and :kbd:`C-RightArrow` moves left or right one word." msgstr "" -#: ../../library/idle.rst:442 +#: ../../library/idle.rst:446 msgid ":kbd:`Home` and :kbd:`End` go to the beginning or end of the line." msgstr "" -#: ../../library/idle.rst:444 +#: ../../library/idle.rst:448 msgid ":kbd:`Page Up` and :kbd:`Page Down` go up or down one screen." msgstr "" -#: ../../library/idle.rst:446 +#: ../../library/idle.rst:450 msgid ":kbd:`C-Home` and :kbd:`C-End` go to beginning or end of the file." msgstr "" -#: ../../library/idle.rst:448 +#: ../../library/idle.rst:452 msgid "" ":kbd:`Backspace` and :kbd:`Del` (or :kbd:`C-d`) delete the previous or next " "character." msgstr "" -#: ../../library/idle.rst:451 +#: ../../library/idle.rst:455 msgid ":kbd:`C-Backspace` and :kbd:`C-Del` delete one word left or right." msgstr "" -#: ../../library/idle.rst:453 +#: ../../library/idle.rst:457 msgid ":kbd:`C-k` deletes ('kills') everything to the right." msgstr "" -#: ../../library/idle.rst:455 +#: ../../library/idle.rst:459 msgid "" "Standard keybindings (like :kbd:`C-c` to copy and :kbd:`C-v` to paste) may " "work. Keybindings are selected in the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:459 +#: ../../library/idle.rst:463 msgid "Automatic indentation" msgstr "" -#: ../../library/idle.rst:461 +#: ../../library/idle.rst:465 msgid "" "After a block-opening statement, the next line is indented by 4 spaces (in " "the Python Shell window by one tab). After certain keywords (break, return " @@ -888,17 +900,17 @@ msgid "" "tabs are restricted to four spaces due to Tcl/Tk limitations." msgstr "" -#: ../../library/idle.rst:468 +#: ../../library/idle.rst:472 msgid "" "See also the indent/dedent region commands on the :ref:`Format menu `." msgstr "" -#: ../../library/idle.rst:472 +#: ../../library/idle.rst:476 msgid "Search and Replace" msgstr "" -#: ../../library/idle.rst:474 +#: ../../library/idle.rst:478 msgid "" "Any selection becomes a search target. However, only selections within a " "line work because searches are only performed within lines with the terminal " @@ -906,11 +918,11 @@ msgid "" "interpreted according to the Python re module." msgstr "" -#: ../../library/idle.rst:482 +#: ../../library/idle.rst:486 msgid "Completions" msgstr "" -#: ../../library/idle.rst:484 +#: ../../library/idle.rst:488 msgid "" "Completions are supplied, when requested and available, for module names, " "attributes of classes or functions, or filenames. Each request method " @@ -923,7 +935,7 @@ msgid "" "box. A double click within the box selects and closes." msgstr "" -#: ../../library/idle.rst:495 +#: ../../library/idle.rst:499 msgid "" "One way to open a box is to type a key character and wait for a predefined " "interval. This defaults to 2 seconds; customize it in the settings dialog. " @@ -935,7 +947,7 @@ msgid "" "directory name and a separator." msgstr "" -#: ../../library/idle.rst:505 +#: ../../library/idle.rst:509 msgid "" "Instead of waiting, or after a box is closed, open a completion box " "immediately with Show Completions on the Edit menu. The default hot key is :" @@ -946,7 +958,7 @@ msgid "" "directory." msgstr "" -#: ../../library/idle.rst:513 +#: ../../library/idle.rst:517 msgid "" "Hitting :kbd:`Tab` after a prefix usually has the same effect as Show " "Completions. (With no prefix, it indents.) However, if there is only one " @@ -954,14 +966,14 @@ msgid "" "without opening a box." msgstr "" -#: ../../library/idle.rst:518 +#: ../../library/idle.rst:522 msgid "" "Invoking 'Show Completions', or hitting :kbd:`Tab` after a prefix, outside " "of a string and without a preceding '.' opens a box with keywords, builtin " "names, and available module-level names." msgstr "" -#: ../../library/idle.rst:522 +#: ../../library/idle.rst:526 msgid "" "When editing code in an editor (as oppose to Shell), increase the available " "module-level names by running your code and not restarting the Shell " @@ -969,18 +981,18 @@ msgid "" "file. This also increases possible attribute completions." msgstr "" -#: ../../library/idle.rst:528 +#: ../../library/idle.rst:532 msgid "" "Completion boxes initially exclude names beginning with '_' or, for modules, " "not included in '__all__'. The hidden names can be accessed by typing '_' " "after '.', either before or after the box is opened." msgstr "" -#: ../../library/idle.rst:535 +#: ../../library/idle.rst:539 msgid "Calltips" msgstr "" -#: ../../library/idle.rst:537 +#: ../../library/idle.rst:541 msgid "" "A calltip is shown automatically when one types :kbd:`(` after the name of " "an *accessible* function. A function name expression may include dots and " @@ -990,7 +1002,7 @@ msgid "" "or enter its shortcut to display a calltip." msgstr "" -#: ../../library/idle.rst:544 +#: ../../library/idle.rst:548 msgid "" "The calltip consists of the function's signature and docstring up to the " "latter's first blank line or the fifth non-blank line. (Some builtin " @@ -999,14 +1011,14 @@ msgid "" "or name (keyword) only. Details are subject to change." msgstr "" -#: ../../library/idle.rst:550 +#: ../../library/idle.rst:554 msgid "" "In Shell, the accessible functions depends on what modules have been " "imported into the user process, including those imported by Idle itself, and " "which definitions have been run, all since the last restart." msgstr "" -#: ../../library/idle.rst:554 +#: ../../library/idle.rst:558 msgid "" "For example, restart the Shell and enter ``itertools.count(``. A calltip " "appears because Idle imports itertools into the user process for its own " @@ -1016,18 +1028,18 @@ msgid "" "display a calltip." msgstr "" -#: ../../library/idle.rst:561 +#: ../../library/idle.rst:565 msgid "" "In an editor, import statements have no effect until one runs the file. One " "might want to run a file after writing import statements, after adding " "function definitions, or after opening an existing file." msgstr "" -#: ../../library/idle.rst:568 +#: ../../library/idle.rst:572 msgid "Code Context" msgstr "" -#: ../../library/idle.rst:570 +#: ../../library/idle.rst:574 msgid "" "Within an editor window containing Python code, code context can be toggled " "in order to show or hide a pane at the top of the window. When shown, this " @@ -1041,23 +1053,23 @@ msgid "" "the top of the editor." msgstr "" -#: ../../library/idle.rst:581 +#: ../../library/idle.rst:585 msgid "" "The text and background colors for the context pane can be configured under " "the Highlights tab in the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:585 +#: ../../library/idle.rst:589 msgid "Shell window" msgstr "" -#: ../../library/idle.rst:587 +#: ../../library/idle.rst:591 msgid "" "In IDLE's Shell, enter, edit, and recall complete statements. (Most consoles " "and terminals only work with a single physical line at a time)." msgstr "" -#: ../../library/idle.rst:590 +#: ../../library/idle.rst:594 msgid "" "Submit a single-line statement for execution by hitting :kbd:`Return` with " "the cursor anywhere on the line. If a line is extended with Backslash (:kbd:" @@ -1065,7 +1077,7 @@ msgid "" "compound statement by entering a blank line after the statement." msgstr "" -#: ../../library/idle.rst:596 +#: ../../library/idle.rst:600 msgid "" "When one pastes code into Shell, it is not compiled and possibly executed " "until one hits :kbd:`Return`, as specified above. One may edit pasted code " @@ -1074,7 +1086,7 @@ msgid "" "one." msgstr "" -#: ../../library/idle.rst:602 +#: ../../library/idle.rst:606 msgid "" "Lines containing ``RESTART`` mean that the user execution process has been " "re-started. This occurs when the user execution process has crashed, when " @@ -1082,38 +1094,38 @@ msgid "" "window." msgstr "" -#: ../../library/idle.rst:607 +#: ../../library/idle.rst:611 msgid "" "The editing features described in previous subsections work when entering " "code interactively. IDLE's Shell window also responds to the following:" msgstr "" -#: ../../library/idle.rst:610 +#: ../../library/idle.rst:614 msgid ":kbd:`C-c` attempts to interrupt statement execution (but may fail)." msgstr "" -#: ../../library/idle.rst:612 +#: ../../library/idle.rst:616 msgid ":kbd:`C-d` closes Shell if typed at a ``>>>`` prompt." msgstr "" -#: ../../library/idle.rst:614 +#: ../../library/idle.rst:618 msgid "" ":kbd:`Alt-p` and :kbd:`Alt-n` (:kbd:`C-p` and :kbd:`C-n` on macOS) retrieve " "to the current prompt the previous or next previously entered statement that " "matches anything already typed." msgstr "" -#: ../../library/idle.rst:618 +#: ../../library/idle.rst:622 msgid "" ":kbd:`Return` while the cursor is on any previous statement appends the " "latter to anything already typed at the prompt." msgstr "" -#: ../../library/idle.rst:622 +#: ../../library/idle.rst:626 msgid "Text colors" msgstr "" -#: ../../library/idle.rst:624 +#: ../../library/idle.rst:628 msgid "" "Idle defaults to black on white text, but colors text with special meanings. " "For the shell, these are shell output, shell error, user output, and user " @@ -1123,7 +1135,7 @@ msgid "" "(when present), found text (when possible), and selected text." msgstr "" -#: ../../library/idle.rst:631 +#: ../../library/idle.rst:635 msgid "" "IDLE also highlights the :ref:`soft keywords ` :keyword:" "`match`, :keyword:`case `, and :keyword:`_ ` in " @@ -1132,7 +1144,7 @@ msgid "" "patterns." msgstr "" -#: ../../library/idle.rst:637 +#: ../../library/idle.rst:641 msgid "" "Text coloring is done in the background, so uncolorized text is occasionally " "visible. To change the color scheme, use the Configure IDLE dialog " @@ -1140,11 +1152,11 @@ msgid "" "and text in popups and dialogs is not user-configurable." msgstr "" -#: ../../library/idle.rst:644 +#: ../../library/idle.rst:648 msgid "Startup and Code Execution" msgstr "" -#: ../../library/idle.rst:646 +#: ../../library/idle.rst:650 msgid "" "Upon startup with the ``-s`` option, IDLE will execute the file referenced " "by the environment variables :envvar:`IDLESTARTUP` or :envvar:" @@ -1156,7 +1168,7 @@ msgid "" "modules." msgstr "" -#: ../../library/idle.rst:654 +#: ../../library/idle.rst:658 msgid "" "In addition, ``Tk`` also loads a startup file if it is present. Note that " "the Tk file is loaded unconditionally. This additional file is ``.Idle.py`` " @@ -1165,72 +1177,72 @@ msgid "" "importing functions to be used from IDLE's Python shell." msgstr "" -#: ../../library/idle.rst:661 +#: ../../library/idle.rst:665 msgid "Command line usage" msgstr "命令列用法" -#: ../../library/idle.rst:665 +#: ../../library/idle.rst:669 msgid "" "IDLE can be invoked from the command line with various options. The general " "syntax is:" msgstr "" -#: ../../library/idle.rst:667 +#: ../../library/idle.rst:671 msgid "python -m idlelib [options] [file ...]" msgstr "python -m idlelib [options] [file ...]" -#: ../../library/idle.rst:671 +#: ../../library/idle.rst:675 msgid "The following options are available:" msgstr "" -#: ../../library/idle.rst:675 +#: ../../library/idle.rst:679 msgid "" "Run the specified Python command in the shell window. For example, pass ``-c " "\"print('Hello, World!')\"``. On Windows, the outer quotes must be double " "quotes as shown." msgstr "" -#: ../../library/idle.rst:681 +#: ../../library/idle.rst:685 msgid "Enable the debugger and open the shell window." msgstr "" -#: ../../library/idle.rst:685 +#: ../../library/idle.rst:689 msgid "Open an editor window." msgstr "" -#: ../../library/idle.rst:689 +#: ../../library/idle.rst:693 msgid "Print a help message with legal combinations of options and exit." msgstr "" -#: ../../library/idle.rst:693 +#: ../../library/idle.rst:697 msgid "Open a shell window." msgstr "" -#: ../../library/idle.rst:697 +#: ../../library/idle.rst:701 msgid "Run the specified file in the shell window." msgstr "" -#: ../../library/idle.rst:701 +#: ../../library/idle.rst:705 msgid "" "Run the startup file (as defined by the environment variables :envvar:" "`IDLESTARTUP` or :envvar:`PYTHONSTARTUP`) before opening the shell window." msgstr "" -#: ../../library/idle.rst:705 +#: ../../library/idle.rst:709 msgid "Set the title of the shell window." msgstr "" -#: ../../library/idle.rst:709 +#: ../../library/idle.rst:713 msgid "" "Read and execute standard input in the shell window. This option must be the " "last one before any arguments." msgstr "" -#: ../../library/idle.rst:711 +#: ../../library/idle.rst:715 msgid "If arguments are provided:" msgstr "" -#: ../../library/idle.rst:713 +#: ../../library/idle.rst:717 msgid "" "If ``-``, ``-c``, or ``-r`` is used, all arguments are placed in ``sys." "argv[1:]``, and ``sys.argv[0]`` is set to ``''``, ``'-c'``, or ``'-r'`` " @@ -1238,17 +1250,17 @@ msgid "" "the *Options* dialog." msgstr "" -#: ../../library/idle.rst:716 +#: ../../library/idle.rst:720 msgid "" "Otherwise, arguments are treated as files to be opened for editing, and " "``sys.argv`` reflects the arguments passed to IDLE itself." msgstr "" -#: ../../library/idle.rst:720 +#: ../../library/idle.rst:724 msgid "Startup failure" msgstr "" -#: ../../library/idle.rst:722 +#: ../../library/idle.rst:726 msgid "" "IDLE uses a socket to communicate between the IDLE GUI process and the user " "code execution process. A connection must be established whenever the Shell " @@ -1258,7 +1270,7 @@ msgid "" "directs the user here. It then exits." msgstr "" -#: ../../library/idle.rst:729 +#: ../../library/idle.rst:733 msgid "" "One specific connection failure on Unix systems results from misconfigured " "masquerading rules somewhere in a system's network setup. When IDLE is " @@ -1268,7 +1280,7 @@ msgid "" "``tcplisten `` in another." msgstr "" -#: ../../library/idle.rst:737 +#: ../../library/idle.rst:741 msgid "" "A common cause of failure is a user-written file with the same name as a " "standard library module, such as *random.py* and *tkinter.py*. When such a " @@ -1277,7 +1289,7 @@ msgid "" "file." msgstr "" -#: ../../library/idle.rst:743 +#: ../../library/idle.rst:747 msgid "" "Though less common than in the past, an antivirus or firewall program may " "stop the connection. If the program cannot be taught to allow the " @@ -1287,7 +1299,7 @@ msgid "" "connections." msgstr "" -#: ../../library/idle.rst:750 +#: ../../library/idle.rst:754 msgid "" "Python installation issues occasionally stop IDLE: multiple versions can " "clash, or a single installation might need admin access. If one undo the " @@ -1295,7 +1307,7 @@ msgid "" "completely remove Python and start over." msgstr "" -#: ../../library/idle.rst:755 +#: ../../library/idle.rst:759 msgid "" "A zombie pythonw.exe process could be a problem. On Windows, use Task " "Manager to check for one and stop it if there is. Sometimes a restart " @@ -1304,7 +1316,7 @@ msgid "" "may fix a temporary problem." msgstr "" -#: ../../library/idle.rst:761 +#: ../../library/idle.rst:765 msgid "" "When IDLE first starts, it attempts to read user configuration files in ``~/." "idlerc/`` (~ is one's home directory). If there is a problem, an error " @@ -1315,14 +1327,14 @@ msgid "" "with the settings dialog." msgstr "" -#: ../../library/idle.rst:769 +#: ../../library/idle.rst:773 msgid "" "If IDLE quits with no message, and it was not started from a console, try " "starting it from a console or terminal (``python -m idlelib``) and see if " "this results in an error message." msgstr "" -#: ../../library/idle.rst:773 +#: ../../library/idle.rst:777 msgid "" "On Unix-based systems with tcl/tk older than ``8.6.11`` (see ``About IDLE``) " "certain characters of certain fonts can cause a tk failure with a message to " @@ -1331,11 +1343,11 @@ msgid "" "upgrade tcl/tk, then re-configure IDLE to use a font that works better." msgstr "" -#: ../../library/idle.rst:781 +#: ../../library/idle.rst:785 msgid "Running user code" msgstr "" -#: ../../library/idle.rst:783 +#: ../../library/idle.rst:787 msgid "" "With rare exceptions, the result of executing Python code with IDLE is " "intended to be the same as executing the same code by the default method, " @@ -1345,7 +1357,7 @@ msgid "" "``threading.active_count()`` returns 2 instead of 1." msgstr "" -#: ../../library/idle.rst:790 +#: ../../library/idle.rst:794 msgid "" "By default, IDLE runs user code in a separate OS process rather than in the " "user interface process that runs the shell and editor. In the execution " @@ -1355,7 +1367,7 @@ msgid "" "__stderr__`` are not touched, but may be ``None``." msgstr "" -#: ../../library/idle.rst:797 +#: ../../library/idle.rst:801 msgid "" "Sending print output from one process to a text widget in another is slower " "than printing to a system terminal in the same process. This has the most " @@ -1367,7 +1379,7 @@ msgid "" "fields and lines." msgstr "" -#: ../../library/idle.rst:806 +#: ../../library/idle.rst:810 msgid "" "IDLE's standard stream replacements are not inherited by subprocesses " "created in the execution process, whether directly by user code or by " @@ -1378,14 +1390,14 @@ msgid "" "attached to that window for input and output." msgstr "" -#: ../../library/idle.rst:815 +#: ../../library/idle.rst:819 msgid "" "If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, " "IDLE's changes are lost and input from the keyboard and output to the screen " "will not work correctly." msgstr "" -#: ../../library/idle.rst:819 +#: ../../library/idle.rst:823 msgid "" "When Shell has the focus, it controls the keyboard and screen. This is " "normally transparent, but functions that directly access the keyboard and " @@ -1393,7 +1405,7 @@ msgid "" "determine whether a key has been pressed and if so, which." msgstr "" -#: ../../library/idle.rst:824 +#: ../../library/idle.rst:828 msgid "" "The IDLE code running in the execution process adds frames to the call stack " "that would not be there otherwise. IDLE wraps ``sys.getrecursionlimit`` and " @@ -1401,17 +1413,17 @@ msgid "" "frames." msgstr "" -#: ../../library/idle.rst:829 +#: ../../library/idle.rst:833 msgid "" "When user code raises SystemExit either directly or by calling sys.exit, " "IDLE returns to a Shell prompt instead of exiting." msgstr "" -#: ../../library/idle.rst:833 +#: ../../library/idle.rst:837 msgid "User output in Shell" msgstr "" -#: ../../library/idle.rst:835 +#: ../../library/idle.rst:839 msgid "" "When a program outputs text, the result is determined by the corresponding " "output device. When IDLE executes user code, ``sys.stdout`` and ``sys." @@ -1421,7 +1433,7 @@ msgid "" "rather than production runs." msgstr "" -#: ../../library/idle.rst:842 +#: ../../library/idle.rst:846 msgid "" "For instance, Shell never throws away output. A program that sends " "unlimited output to Shell will eventually fill memory, resulting in a memory " @@ -1430,7 +1442,7 @@ msgid "" "lines, with 300 the default." msgstr "" -#: ../../library/idle.rst:848 +#: ../../library/idle.rst:852 msgid "" "A Tk Text widget, and hence IDLE's Shell, displays characters (codepoints) " "in the BMP (Basic Multilingual Plane) subset of Unicode. Which characters " @@ -1444,7 +1456,7 @@ msgid "" "spacing behavior.) ::" msgstr "" -#: ../../library/idle.rst:858 +#: ../../library/idle.rst:862 msgid "" ">>> s = 'a\\tb\\a<\\x02><\\r>\\bc\\nd' # Enter 22 chars.\n" ">>> len(s)\n" @@ -1455,7 +1467,7 @@ msgid "" "# Result varies by OS and font. Try it." msgstr "" -#: ../../library/idle.rst:866 +#: ../../library/idle.rst:870 msgid "" "The ``repr`` function is used for interactive echo of expression values. It " "returns an altered version of the input string in which control codes, some " @@ -1464,13 +1476,13 @@ msgid "" "regardless of how they are displayed." msgstr "" -#: ../../library/idle.rst:872 +#: ../../library/idle.rst:876 msgid "" "Normal and error output are generally kept separate (on separate lines) from " "code input and each other. They each get different highlight colors." msgstr "" -#: ../../library/idle.rst:875 +#: ../../library/idle.rst:879 msgid "" "For SyntaxError tracebacks, the normal '^' marking where the error was " "detected is replaced by coloring the text with an error highlight. When code " @@ -1479,7 +1491,7 @@ msgid "" "opened if necessary." msgstr "" -#: ../../library/idle.rst:881 +#: ../../library/idle.rst:885 msgid "" "Shell has a special facility for squeezing output lines down to a 'Squeezed " "text' label. This is done automatically for output over N lines (N = 50 by " @@ -1488,18 +1500,18 @@ msgid "" "on the output. This can be useful lines long enough to slow down scrolling." msgstr "" -#: ../../library/idle.rst:889 +#: ../../library/idle.rst:893 msgid "" "Squeezed output is expanded in place by double-clicking the label. It can " "also be sent to the clipboard or a separate view window by right-clicking " "the label." msgstr "" -#: ../../library/idle.rst:894 +#: ../../library/idle.rst:898 msgid "Developing tkinter applications" msgstr "" -#: ../../library/idle.rst:896 +#: ../../library/idle.rst:900 msgid "" "IDLE is intentionally different from standard Python in order to facilitate " "development of tkinter programs. Enter ``import tkinter as tk; root = tk." @@ -1511,7 +1523,7 @@ msgid "" "changes in standard Python until one enters ``root.update()``." msgstr "" -#: ../../library/idle.rst:905 +#: ../../library/idle.rst:909 msgid "" "Most tkinter programs run ``root.mainloop()``, which usually does not return " "until the tk app is destroyed. If the program is run with ``python -i`` or " @@ -1519,7 +1531,7 @@ msgid "" "``mainloop()`` returns, at which time there is nothing left to interact with." msgstr "" -#: ../../library/idle.rst:911 +#: ../../library/idle.rst:915 msgid "" "When running a tkinter program from an IDLE editor, one can comment out the " "mainloop call. One then gets a shell prompt immediately and can interact " @@ -1527,11 +1539,11 @@ msgid "" "mainloop call when running in standard Python." msgstr "" -#: ../../library/idle.rst:917 +#: ../../library/idle.rst:921 msgid "Running without a subprocess" msgstr "" -#: ../../library/idle.rst:919 +#: ../../library/idle.rst:923 msgid "" "By default, IDLE executes user code in a separate subprocess via a socket, " "which uses the internal loopback interface. This connection is not " @@ -1539,7 +1551,7 @@ msgid "" "firewall software complains anyway, you can ignore it." msgstr "" -#: ../../library/idle.rst:924 +#: ../../library/idle.rst:928 msgid "" "If the attempt to make the socket connection fails, Idle will notify you. " "Such failures are sometimes transient, but if persistent, the problem may be " @@ -1548,7 +1560,7 @@ msgid "" "command line switch." msgstr "" -#: ../../library/idle.rst:930 +#: ../../library/idle.rst:934 msgid "" "If IDLE is started with the -n command line switch it will run in a single " "process and will not create the subprocess which runs the RPC Python " @@ -1562,15 +1574,15 @@ msgid "" "at all possible." msgstr "" -#: ../../library/idle.rst:945 +#: ../../library/idle.rst:949 msgid "Help and Preferences" msgstr "" -#: ../../library/idle.rst:950 +#: ../../library/idle.rst:954 msgid "Help sources" msgstr "" -#: ../../library/idle.rst:952 +#: ../../library/idle.rst:956 msgid "" "Help menu entry \"IDLE Help\" displays a formatted html version of the IDLE " "chapter of the Library Reference. The result, in a read-only tkinter text " @@ -1580,7 +1592,7 @@ msgid "" "the opened box." msgstr "" -#: ../../library/idle.rst:960 +#: ../../library/idle.rst:964 msgid "" "Help menu entry \"Python Docs\" opens the extensive sources of help, " "including tutorials, available at ``docs.python.org/x.y``, where 'x.y' is " @@ -1589,17 +1601,17 @@ msgid "" "instead." msgstr "" -#: ../../library/idle.rst:966 +#: ../../library/idle.rst:970 msgid "" "Selected URLs can be added or removed from the help menu at any time using " "the General tab of the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:972 +#: ../../library/idle.rst:976 msgid "Setting preferences" msgstr "設定偏好" -#: ../../library/idle.rst:974 +#: ../../library/idle.rst:978 msgid "" "The font preferences, highlighting, keys, and general preferences can be " "changed via Configure IDLE on the Option menu. Non-default user settings are " @@ -1608,7 +1620,7 @@ msgid "" "or more of the files in ``.idlerc``." msgstr "" -#: ../../library/idle.rst:980 +#: ../../library/idle.rst:984 msgid "" "On the Font tab, see the text sample for the effect of font face and size on " "multiple characters in multiple languages. Edit the sample to add other " @@ -1617,7 +1629,7 @@ msgid "" "them to the top of the sample and try changing first size and then font." msgstr "" -#: ../../library/idle.rst:987 +#: ../../library/idle.rst:991 msgid "" "On the Highlights and Keys tab, select a built-in or custom color theme and " "key set. To use a newer built-in color theme or key set with older IDLEs, " @@ -1625,22 +1637,22 @@ msgid "" "IDLEs." msgstr "" -#: ../../library/idle.rst:993 +#: ../../library/idle.rst:997 msgid "IDLE on macOS" msgstr "macOS 上的 IDLE" -#: ../../library/idle.rst:995 +#: ../../library/idle.rst:999 msgid "" "Under System Preferences: Dock, one can set \"Prefer tabs when opening " "documents\" to \"Always\". This setting is not compatible with the tk/" "tkinter GUI framework used by IDLE, and it breaks a few IDLE features." msgstr "" -#: ../../library/idle.rst:1000 +#: ../../library/idle.rst:1004 msgid "Extensions" msgstr "" -#: ../../library/idle.rst:1002 +#: ../../library/idle.rst:1006 msgid "" "IDLE contains an extension facility. Preferences for extensions can be " "changed with the Extensions tab of the preferences dialog. See the beginning " @@ -1649,21 +1661,21 @@ msgid "" "testing." msgstr "" -#: ../../library/idle.rst:1010 +#: ../../library/idle.rst:1014 msgid "idlelib --- implementation of IDLE application" msgstr "" -#: ../../library/idle.rst:1015 +#: ../../library/idle.rst:1019 msgid "**Source code:** :source:`Lib/idlelib`" msgstr "**原始碼:**\\ :source:`Lib/idlelib/`" -#: ../../library/idle.rst:1019 +#: ../../library/idle.rst:1023 msgid "" "The Lib/idlelib package implements the IDLE application. See the rest of " "this page for how to use IDLE." msgstr "" -#: ../../library/idle.rst:1022 +#: ../../library/idle.rst:1026 msgid "" "The files in idlelib are described in idlelib/README.txt. Access it either " "in idlelib or click Help => About IDLE on the IDLE menu. This file also " @@ -1684,27 +1696,27 @@ msgstr "Python Editor(Python 編輯器)" msgid "Integrated Development Environment" msgstr "Integrated Development Environment(整合開發環境)" -#: ../../library/idle.rst:71 +#: ../../library/idle.rst:75 msgid "Module browser" msgstr "Module browser(模組瀏覽器)" -#: ../../library/idle.rst:71 +#: ../../library/idle.rst:75 msgid "Path browser" msgstr "Path browser(路徑瀏覽器)" -#: ../../library/idle.rst:213 +#: ../../library/idle.rst:217 msgid "Run script" msgstr "Run script(執行腳本)" -#: ../../library/idle.rst:280 +#: ../../library/idle.rst:284 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/idle.rst:280 +#: ../../library/idle.rst:284 msgid "stack viewer" msgstr "stack viewer(堆疊檢視器)" -#: ../../library/idle.rst:356 +#: ../../library/idle.rst:360 msgid "breakpoints" msgstr "breakpoints(中斷點)" diff --git a/library/locale.po b/library/locale.po index 511cf776da2..5e1c70bcb6a 100644 --- a/library/locale.po +++ b/library/locale.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -714,8 +714,8 @@ msgstr "" #: ../../library/locale.rst:519 msgid "" "Python doesn't internally use locale-dependent character transformation " -"functions from ``ctype.h``. Instead, an internal ``pyctype.h`` provides " -"locale-independent equivalents like :c:macro:`!Py_TOLOWER`." +"functions from ``ctype.h``. Instead, ``pyctype.h`` provides locale-" +"independent equivalents like :c:macro:`Py_TOLOWER`." msgstr "" #: ../../library/locale.rst:526 diff --git a/library/lzma.po b/library/lzma.po index 396f3c40431..f2d18e0a266 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,23 +41,31 @@ msgid "" "multiple threads, it is necessary to protect it with a lock." msgstr "" -#: ../../library/lzma.rst:29 +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/lzma.rst:31 msgid "" "This exception is raised when an error occurs during compression or " "decompression, or while initializing the compressor/decompressor state." msgstr "" -#: ../../library/lzma.rst:34 +#: ../../library/lzma.rst:36 msgid "Reading and writing compressed files" msgstr "" -#: ../../library/lzma.rst:38 +#: ../../library/lzma.rst:40 msgid "" "Open an LZMA-compressed file in binary or text mode, returning a :term:`file " "object`." msgstr "" -#: ../../library/lzma.rst:41 +#: ../../library/lzma.rst:43 msgid "" "The *filename* argument can be either an actual file name (given as a :class:" "`str`, :class:`bytes` or :term:`path-like ` object), in " @@ -65,7 +73,7 @@ msgid "" "read from or write to." msgstr "" -#: ../../library/lzma.rst:46 +#: ../../library/lzma.rst:48 msgid "" "The *mode* argument can be any of ``\"r\"``, ``\"rb\"``, ``\"w\"``, " "``\"wb\"``, ``\"x\"``, ``\"xb\"``, ``\"a\"`` or ``\"ab\"`` for binary mode, " @@ -73,46 +81,46 @@ msgid "" "default is ``\"rb\"``." msgstr "" -#: ../../library/lzma.rst:50 ../../library/lzma.rst:95 +#: ../../library/lzma.rst:52 ../../library/lzma.rst:97 msgid "" "When opening a file for reading, the *format* and *filters* arguments have " "the same meanings as for :class:`LZMADecompressor`. In this case, the " "*check* and *preset* arguments should not be used." msgstr "" -#: ../../library/lzma.rst:54 ../../library/lzma.rst:99 +#: ../../library/lzma.rst:56 ../../library/lzma.rst:101 msgid "" "When opening a file for writing, the *format*, *check*, *preset* and " "*filters* arguments have the same meanings as for :class:`LZMACompressor`." msgstr "" -#: ../../library/lzma.rst:57 +#: ../../library/lzma.rst:59 msgid "" "For binary mode, this function is equivalent to the :class:`LZMAFile` " "constructor: ``LZMAFile(filename, mode, ...)``. In this case, the " "*encoding*, *errors* and *newline* arguments must not be provided." msgstr "" -#: ../../library/lzma.rst:61 +#: ../../library/lzma.rst:63 msgid "" "For text mode, a :class:`LZMAFile` object is created, and wrapped in an :" "class:`io.TextIOWrapper` instance with the specified encoding, error " "handling behavior, and line ending(s)." msgstr "" -#: ../../library/lzma.rst:65 +#: ../../library/lzma.rst:67 msgid "Added support for the ``\"x\"``, ``\"xb\"`` and ``\"xt\"`` modes." msgstr "新增 ``\"x\"``、``\"xb\"`` 和 ``\"xt\"`` 模式的支援。" -#: ../../library/lzma.rst:68 ../../library/lzma.rst:141 +#: ../../library/lzma.rst:70 ../../library/lzma.rst:143 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/lzma.rst:74 +#: ../../library/lzma.rst:76 msgid "Open an LZMA-compressed file in binary mode." msgstr "" -#: ../../library/lzma.rst:76 +#: ../../library/lzma.rst:78 msgid "" "An :class:`LZMAFile` can wrap an already-open :term:`file object`, or " "operate directly on a named file. The *filename* argument specifies either " @@ -122,7 +130,7 @@ msgid "" "the :class:`LZMAFile` is closed." msgstr "" -#: ../../library/lzma.rst:83 +#: ../../library/lzma.rst:85 msgid "" "The *mode* argument can be either ``\"r\"`` for reading (default), ``\"w\"`` " "for overwriting, ``\"x\"`` for exclusive creation, or ``\"a\"`` for " @@ -130,38 +138,38 @@ msgid "" "``\"xb\"`` and ``\"ab\"`` respectively." msgstr "" -#: ../../library/lzma.rst:88 +#: ../../library/lzma.rst:90 msgid "" "If *filename* is a file object (rather than an actual file name), a mode of " "``\"w\"`` does not truncate the file, and is instead equivalent to ``\"a\"``." msgstr "" -#: ../../library/lzma.rst:91 +#: ../../library/lzma.rst:93 msgid "" "When opening a file for reading, the input file may be the concatenation of " "multiple separate compressed streams. These are transparently decoded as a " "single logical stream." msgstr "" -#: ../../library/lzma.rst:102 +#: ../../library/lzma.rst:104 msgid "" ":class:`LZMAFile` supports all the members specified by :class:`io." "BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io." "IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." msgstr "" -#: ../../library/lzma.rst:107 +#: ../../library/lzma.rst:109 msgid "The following method and attributes are also provided:" msgstr "" -#: ../../library/lzma.rst:111 +#: ../../library/lzma.rst:113 msgid "" "Return buffered data without advancing the file position. At least one byte " "of data will be returned, unless EOF has been reached. The exact number of " "bytes returned is unspecified (the *size* argument is ignored)." msgstr "" -#: ../../library/lzma.rst:115 +#: ../../library/lzma.rst:117 msgid "" "While calling :meth:`peek` does not change the file position of the :class:" "`LZMAFile`, it may change the position of the underlying file object (e.g. " @@ -169,70 +177,70 @@ msgid "" "*filename*)." msgstr "" -#: ../../library/lzma.rst:122 +#: ../../library/lzma.rst:124 msgid "``'rb'`` for reading and ``'wb'`` for writing." msgstr "" -#: ../../library/lzma.rst:128 +#: ../../library/lzma.rst:130 msgid "" "The lzma file name. Equivalent to the :attr:`~io.FileIO.name` attribute of " "the underlying :term:`file object`." msgstr "" -#: ../../library/lzma.rst:134 +#: ../../library/lzma.rst:136 msgid "Added support for the ``\"x\"`` and ``\"xb\"`` modes." msgstr "新增 ``\"x\"`` 和 ``\"xb\"`` 模式的支援。" -#: ../../library/lzma.rst:137 +#: ../../library/lzma.rst:139 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." msgstr "" -#: ../../library/lzma.rst:146 +#: ../../library/lzma.rst:148 msgid "Compressing and decompressing data in memory" msgstr "" -#: ../../library/lzma.rst:150 +#: ../../library/lzma.rst:152 msgid "" "Create a compressor object, which can be used to compress data incrementally." msgstr "" -#: ../../library/lzma.rst:152 +#: ../../library/lzma.rst:154 msgid "" "For a more convenient way of compressing a single chunk of data, see :func:" "`compress`." msgstr "" -#: ../../library/lzma.rst:155 +#: ../../library/lzma.rst:157 msgid "" "The *format* argument specifies what container format should be used. " "Possible values are:" msgstr "" -#: ../../library/lzma.rst:158 +#: ../../library/lzma.rst:160 msgid ":const:`FORMAT_XZ`: The ``.xz`` container format." msgstr "" -#: ../../library/lzma.rst:159 +#: ../../library/lzma.rst:161 msgid "This is the default format." msgstr "" -#: ../../library/lzma.rst:161 +#: ../../library/lzma.rst:163 msgid ":const:`FORMAT_ALONE`: The legacy ``.lzma`` container format." msgstr "" -#: ../../library/lzma.rst:162 +#: ../../library/lzma.rst:164 msgid "" "This format is more limited than ``.xz`` -- it does not support integrity " "checks or multiple filters." msgstr "" -#: ../../library/lzma.rst:165 +#: ../../library/lzma.rst:167 msgid ":const:`FORMAT_RAW`: A raw data stream, not using any container format." msgstr "" -#: ../../library/lzma.rst:166 +#: ../../library/lzma.rst:168 msgid "" "This format specifier does not support integrity checks, and requires that " "you always specify a custom filter chain (for both compression and " @@ -240,46 +248,46 @@ msgid "" "decompressed using :const:`FORMAT_AUTO` (see :class:`LZMADecompressor`)." msgstr "" -#: ../../library/lzma.rst:171 +#: ../../library/lzma.rst:173 msgid "" "The *check* argument specifies the type of integrity check to include in the " "compressed data. This check is used when decompressing, to ensure that the " "data has not been corrupted. Possible values are:" msgstr "" -#: ../../library/lzma.rst:175 +#: ../../library/lzma.rst:177 msgid "" ":const:`CHECK_NONE`: No integrity check. This is the default (and the only " "acceptable value) for :const:`FORMAT_ALONE` and :const:`FORMAT_RAW`." msgstr "" -#: ../../library/lzma.rst:179 +#: ../../library/lzma.rst:181 msgid ":const:`CHECK_CRC32`: 32-bit Cyclic Redundancy Check." msgstr "" -#: ../../library/lzma.rst:181 +#: ../../library/lzma.rst:183 msgid "" ":const:`CHECK_CRC64`: 64-bit Cyclic Redundancy Check. This is the default " "for :const:`FORMAT_XZ`." msgstr "" -#: ../../library/lzma.rst:184 +#: ../../library/lzma.rst:186 msgid ":const:`CHECK_SHA256`: 256-bit Secure Hash Algorithm." msgstr "" -#: ../../library/lzma.rst:186 +#: ../../library/lzma.rst:188 msgid "" "If the specified check is not supported, an :class:`LZMAError` is raised." msgstr "" -#: ../../library/lzma.rst:188 +#: ../../library/lzma.rst:190 msgid "" "The compression settings can be specified either as a preset compression " "level (with the *preset* argument), or in detail as a custom filter chain " "(with the *filters* argument)." msgstr "" -#: ../../library/lzma.rst:192 +#: ../../library/lzma.rst:194 msgid "" "The *preset* argument (if provided) should be an integer between ``0`` and " "``9`` (inclusive), optionally OR-ed with the constant :const:" @@ -288,7 +296,7 @@ msgid "" "presets produce smaller output, but make the compression process slower." msgstr "" -#: ../../library/lzma.rst:201 +#: ../../library/lzma.rst:203 msgid "" "In addition to being more CPU-intensive, compression with higher presets " "also requires much more memory (and produces output that needs more memory " @@ -297,13 +305,13 @@ msgid "" "generally best to stick with the default preset." msgstr "" -#: ../../library/lzma.rst:207 +#: ../../library/lzma.rst:209 msgid "" "The *filters* argument (if provided) should be a filter chain specifier. " "See :ref:`filter-chain-specs` for details." msgstr "" -#: ../../library/lzma.rst:212 +#: ../../library/lzma.rst:214 msgid "" "Compress *data* (a :class:`bytes` object), returning a :class:`bytes` object " "containing compressed data for at least part of the input. Some of *data* " @@ -312,29 +320,29 @@ msgid "" "any previous calls to :meth:`compress`." msgstr "" -#: ../../library/lzma.rst:220 +#: ../../library/lzma.rst:222 msgid "" "Finish the compression process, returning a :class:`bytes` object containing " "any data stored in the compressor's internal buffers." msgstr "" -#: ../../library/lzma.rst:223 +#: ../../library/lzma.rst:225 msgid "The compressor cannot be used after this method has been called." msgstr "" -#: ../../library/lzma.rst:228 +#: ../../library/lzma.rst:230 msgid "" "Create a decompressor object, which can be used to decompress data " "incrementally." msgstr "" -#: ../../library/lzma.rst:231 +#: ../../library/lzma.rst:233 msgid "" "For a more convenient way of decompressing an entire compressed stream at " "once, see :func:`decompress`." msgstr "" -#: ../../library/lzma.rst:234 +#: ../../library/lzma.rst:236 msgid "" "The *format* argument specifies the container format that should be used. " "The default is :const:`FORMAT_AUTO`, which can decompress both ``.xz`` and " @@ -342,7 +350,7 @@ msgid "" "`FORMAT_ALONE`, and :const:`FORMAT_RAW`." msgstr "" -#: ../../library/lzma.rst:239 +#: ../../library/lzma.rst:241 msgid "" "The *memlimit* argument specifies a limit (in bytes) on the amount of memory " "that the decompressor can use. When this argument is used, decompression " @@ -350,7 +358,7 @@ msgid "" "input within the given memory limit." msgstr "" -#: ../../library/lzma.rst:244 +#: ../../library/lzma.rst:246 msgid "" "The *filters* argument specifies the filter chain that was used to create " "the stream being decompressed. This argument is required if *format* is :" @@ -358,7 +366,7 @@ msgid "" "`filter-chain-specs` for more information about filter chains." msgstr "" -#: ../../library/lzma.rst:250 +#: ../../library/lzma.rst:252 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`LZMAFile`. To " @@ -366,7 +374,7 @@ msgid "" "create a new decompressor for each stream." msgstr "" -#: ../../library/lzma.rst:257 +#: ../../library/lzma.rst:259 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -374,7 +382,7 @@ msgid "" "output of any previous calls to :meth:`decompress`." msgstr "" -#: ../../library/lzma.rst:263 +#: ../../library/lzma.rst:265 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -383,100 +391,100 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: ../../library/lzma.rst:270 +#: ../../library/lzma.rst:272 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: ../../library/lzma.rst:275 +#: ../../library/lzma.rst:277 msgid "" "Attempting to decompress data after the end of stream is reached raises an :" "exc:`EOFError`. Any data found after the end of the stream is ignored and " "saved in the :attr:`~.unused_data` attribute." msgstr "" -#: ../../library/lzma.rst:279 +#: ../../library/lzma.rst:281 msgid "Added the *max_length* parameter." msgstr "新增 *max_length* 參數。" -#: ../../library/lzma.rst:284 +#: ../../library/lzma.rst:286 msgid "" "The ID of the integrity check used by the input stream. This may be :const:" "`CHECK_UNKNOWN` until enough of the input has been decoded to determine what " "integrity check it uses." msgstr "" -#: ../../library/lzma.rst:290 +#: ../../library/lzma.rst:292 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: ../../library/lzma.rst:294 +#: ../../library/lzma.rst:296 msgid "Data found after the end of the compressed stream." msgstr "" -#: ../../library/lzma.rst:296 +#: ../../library/lzma.rst:298 msgid "Before the end of the stream is reached, this will be ``b\"\"``." msgstr "" -#: ../../library/lzma.rst:300 +#: ../../library/lzma.rst:302 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." msgstr "" -#: ../../library/lzma.rst:307 +#: ../../library/lzma.rst:309 msgid "" "Compress *data* (a :class:`bytes` object), returning the compressed data as " "a :class:`bytes` object." msgstr "" -#: ../../library/lzma.rst:310 +#: ../../library/lzma.rst:312 msgid "" "See :class:`LZMACompressor` above for a description of the *format*, " "*check*, *preset* and *filters* arguments." msgstr "" -#: ../../library/lzma.rst:316 +#: ../../library/lzma.rst:318 msgid "" "Decompress *data* (a :class:`bytes` object), returning the uncompressed data " "as a :class:`bytes` object." msgstr "" -#: ../../library/lzma.rst:319 +#: ../../library/lzma.rst:321 msgid "" "If *data* is the concatenation of multiple distinct compressed streams, " "decompress all of these streams, and return the concatenation of the results." msgstr "" -#: ../../library/lzma.rst:322 +#: ../../library/lzma.rst:324 msgid "" "See :class:`LZMADecompressor` above for a description of the *format*, " "*memlimit* and *filters* arguments." msgstr "" -#: ../../library/lzma.rst:327 +#: ../../library/lzma.rst:329 msgid "Miscellaneous" msgstr "" -#: ../../library/lzma.rst:331 +#: ../../library/lzma.rst:333 msgid "" "Return ``True`` if the given integrity check is supported on this system." msgstr "" -#: ../../library/lzma.rst:333 +#: ../../library/lzma.rst:335 msgid "" ":const:`CHECK_NONE` and :const:`CHECK_CRC32` are always supported. :const:" "`CHECK_CRC64` and :const:`CHECK_SHA256` may be unavailable if you are using " "a version of :program:`liblzma` that was compiled with a limited feature set." msgstr "" -#: ../../library/lzma.rst:342 +#: ../../library/lzma.rst:344 msgid "Specifying custom filter chains" msgstr "" -#: ../../library/lzma.rst:344 +#: ../../library/lzma.rst:346 msgid "" "A filter chain specifier is a sequence of dictionaries, where each " "dictionary contains the ID and options for a single filter. Each dictionary " @@ -484,118 +492,118 @@ msgid "" "filter-dependent options. Valid filter IDs are as follows:" msgstr "" -#: ../../library/lzma.rst:349 +#: ../../library/lzma.rst:351 msgid "Compression filters:" msgstr "" -#: ../../library/lzma.rst:351 +#: ../../library/lzma.rst:353 msgid ":const:`FILTER_LZMA1` (for use with :const:`FORMAT_ALONE`)" msgstr "" -#: ../../library/lzma.rst:352 +#: ../../library/lzma.rst:354 msgid "" ":const:`FILTER_LZMA2` (for use with :const:`FORMAT_XZ` and :const:" "`FORMAT_RAW`)" msgstr "" -#: ../../library/lzma.rst:354 +#: ../../library/lzma.rst:356 msgid "Delta filter:" msgstr "" -#: ../../library/lzma.rst:356 +#: ../../library/lzma.rst:358 msgid ":const:`FILTER_DELTA`" msgstr ":const:`FILTER_DELTA`" -#: ../../library/lzma.rst:358 +#: ../../library/lzma.rst:360 msgid "Branch-Call-Jump (BCJ) filters:" msgstr "" -#: ../../library/lzma.rst:360 +#: ../../library/lzma.rst:362 msgid ":const:`FILTER_X86`" msgstr ":const:`FILTER_X86`" -#: ../../library/lzma.rst:361 +#: ../../library/lzma.rst:363 msgid ":const:`FILTER_IA64`" msgstr ":const:`FILTER_IA64`" -#: ../../library/lzma.rst:362 +#: ../../library/lzma.rst:364 msgid ":const:`FILTER_ARM`" msgstr ":const:`FILTER_ARM`" -#: ../../library/lzma.rst:363 +#: ../../library/lzma.rst:365 msgid ":const:`FILTER_ARMTHUMB`" msgstr ":const:`FILTER_ARMTHUMB`" -#: ../../library/lzma.rst:364 +#: ../../library/lzma.rst:366 msgid ":const:`FILTER_POWERPC`" msgstr ":const:`FILTER_POWERPC`" -#: ../../library/lzma.rst:365 +#: ../../library/lzma.rst:367 msgid ":const:`FILTER_SPARC`" msgstr ":const:`FILTER_SPARC`" -#: ../../library/lzma.rst:367 +#: ../../library/lzma.rst:369 msgid "" "A filter chain can consist of up to 4 filters, and cannot be empty. The last " "filter in the chain must be a compression filter, and any other filters must " "be delta or BCJ filters." msgstr "" -#: ../../library/lzma.rst:371 +#: ../../library/lzma.rst:373 msgid "" "Compression filters support the following options (specified as additional " "entries in the dictionary representing the filter):" msgstr "" -#: ../../library/lzma.rst:374 +#: ../../library/lzma.rst:376 msgid "" "``preset``: A compression preset to use as a source of default values for " "options that are not specified explicitly." msgstr "" -#: ../../library/lzma.rst:376 +#: ../../library/lzma.rst:378 msgid "" "``dict_size``: Dictionary size in bytes. This should be between 4 KiB and " "1.5 GiB (inclusive)." msgstr "" -#: ../../library/lzma.rst:378 +#: ../../library/lzma.rst:380 msgid "``lc``: Number of literal context bits." msgstr "" -#: ../../library/lzma.rst:379 +#: ../../library/lzma.rst:381 msgid "" "``lp``: Number of literal position bits. The sum ``lc + lp`` must be at most " "4." msgstr "" -#: ../../library/lzma.rst:381 +#: ../../library/lzma.rst:383 msgid "``pb``: Number of position bits; must be at most 4." msgstr "" -#: ../../library/lzma.rst:382 +#: ../../library/lzma.rst:384 msgid "``mode``: :const:`MODE_FAST` or :const:`MODE_NORMAL`." msgstr "" -#: ../../library/lzma.rst:383 +#: ../../library/lzma.rst:385 msgid "" "``nice_len``: What should be considered a \"nice length\" for a match. This " "should be 273 or less." msgstr "" -#: ../../library/lzma.rst:385 +#: ../../library/lzma.rst:387 msgid "" "``mf``: What match finder to use -- :const:`MF_HC3`, :const:`MF_HC4`, :const:" "`MF_BT2`, :const:`MF_BT3`, or :const:`MF_BT4`." msgstr "" -#: ../../library/lzma.rst:387 +#: ../../library/lzma.rst:389 msgid "" "``depth``: Maximum search depth used by match finder. 0 (default) means to " "select automatically based on other filter options." msgstr "" -#: ../../library/lzma.rst:390 +#: ../../library/lzma.rst:392 msgid "" "The delta filter stores the differences between bytes, producing more " "repetitive input for the compressor in certain circumstances. It supports " @@ -604,7 +612,7 @@ msgid "" "bytes." msgstr "" -#: ../../library/lzma.rst:395 +#: ../../library/lzma.rst:397 msgid "" "The BCJ filters are intended to be applied to machine code. They convert " "relative branches, calls and jumps in the code to use absolute addressing, " @@ -614,15 +622,15 @@ msgid "" "data. The default is 0." msgstr "" -#: ../../library/lzma.rst:403 +#: ../../library/lzma.rst:405 msgid "Examples" msgstr "範例" -#: ../../library/lzma.rst:405 +#: ../../library/lzma.rst:407 msgid "Reading in a compressed file::" msgstr "" -#: ../../library/lzma.rst:407 +#: ../../library/lzma.rst:409 msgid "" "import lzma\n" "with lzma.open(\"file.xz\") as f:\n" @@ -632,11 +640,11 @@ msgstr "" "with lzma.open(\"file.xz\") as f:\n" " file_content = f.read()" -#: ../../library/lzma.rst:411 +#: ../../library/lzma.rst:413 msgid "Creating a compressed file::" msgstr "" -#: ../../library/lzma.rst:413 +#: ../../library/lzma.rst:415 msgid "" "import lzma\n" "data = b\"Insert Data Here\"\n" @@ -648,11 +656,11 @@ msgstr "" "with lzma.open(\"file.xz\", \"w\") as f:\n" " f.write(data)" -#: ../../library/lzma.rst:418 +#: ../../library/lzma.rst:420 msgid "Compressing data in memory::" msgstr "" -#: ../../library/lzma.rst:420 +#: ../../library/lzma.rst:422 msgid "" "import lzma\n" "data_in = b\"Insert Data Here\"\n" @@ -662,11 +670,11 @@ msgstr "" "data_in = b\"Insert Data Here\"\n" "data_out = lzma.compress(data_in)" -#: ../../library/lzma.rst:424 +#: ../../library/lzma.rst:426 msgid "Incremental compression::" msgstr "" -#: ../../library/lzma.rst:426 +#: ../../library/lzma.rst:428 msgid "" "import lzma\n" "lzc = lzma.LZMACompressor()\n" @@ -678,11 +686,11 @@ msgid "" "result = b\"\".join([out1, out2, out3, out4])" msgstr "" -#: ../../library/lzma.rst:435 +#: ../../library/lzma.rst:437 msgid "Writing compressed data to an already-open file::" msgstr "" -#: ../../library/lzma.rst:437 +#: ../../library/lzma.rst:439 msgid "" "import lzma\n" "with open(\"file.xz\", \"wb\") as f:\n" @@ -698,11 +706,11 @@ msgstr "" " lzf.write(b\"This *will* be compressed\\n\")\n" " f.write(b\"Not compressed\\n\")" -#: ../../library/lzma.rst:444 +#: ../../library/lzma.rst:446 msgid "Creating a compressed file using a custom filter chain::" msgstr "" -#: ../../library/lzma.rst:446 +#: ../../library/lzma.rst:448 msgid "" "import lzma\n" "my_filters = [\n" diff --git a/library/msvcrt.po b/library/msvcrt.po index a706e3af3cd..98c7d99db9b 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-11-10 16:45+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-" @@ -44,16 +44,20 @@ msgid "" msgstr "" #: ../../library/msvcrt.rst:25 +msgid "Availability" +msgstr "" + +#: ../../library/msvcrt.rst:27 msgid "" "Operations in this module now raise :exc:`OSError` where :exc:`IOError` was " "raised." msgstr "" -#: ../../library/msvcrt.rst:33 +#: ../../library/msvcrt.rst:35 msgid "File Operations" msgstr "" -#: ../../library/msvcrt.rst:38 +#: ../../library/msvcrt.rst:40 msgid "" "Lock part of a file based on file descriptor *fd* from the C runtime. " "Raises :exc:`OSError` on failure. The locked region of the file extends from " @@ -64,7 +68,7 @@ msgid "" "individually." msgstr "" -#: ../../library/msvcrt.rst:45 +#: ../../library/msvcrt.rst:47 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.locking`` with arguments " "``fd``, ``mode``, ``nbytes``." @@ -72,31 +76,31 @@ msgstr "" "引發一個附帶引數 ``fd``、``mode``、``nbytes`` 的\\ :ref:`稽核事件 " "` ``msvcrt.locking``。" -#: ../../library/msvcrt.rst:51 +#: ../../library/msvcrt.rst:53 msgid "" "Locks the specified bytes. If the bytes cannot be locked, the program " "immediately tries again after 1 second. If, after 10 attempts, the bytes " "cannot be locked, :exc:`OSError` is raised." msgstr "" -#: ../../library/msvcrt.rst:59 +#: ../../library/msvcrt.rst:61 msgid "" "Locks the specified bytes. If the bytes cannot be locked, :exc:`OSError` is " "raised." msgstr "" -#: ../../library/msvcrt.rst:65 +#: ../../library/msvcrt.rst:67 msgid "Unlocks the specified bytes, which must have been previously locked." msgstr "" -#: ../../library/msvcrt.rst:70 +#: ../../library/msvcrt.rst:72 msgid "" "Set the line-end translation mode for the file descriptor *fd*. To set it to " "text mode, *flags* should be :const:`os.O_TEXT`; for binary, it should be :" "const:`os.O_BINARY`." msgstr "" -#: ../../library/msvcrt.rst:77 +#: ../../library/msvcrt.rst:79 msgid "" "Create a C runtime file descriptor from the file handle *handle*. The " "*flags* parameter should be a bitwise OR of :const:`os.O_APPEND`, :const:`os." @@ -105,13 +109,13 @@ msgid "" "object." msgstr "" -#: ../../library/msvcrt.rst:83 +#: ../../library/msvcrt.rst:85 msgid "" "The file descriptor is inheritable by default. Pass :const:`os.O_NOINHERIT` " "flag to make it non inheritable." msgstr "" -#: ../../library/msvcrt.rst:86 +#: ../../library/msvcrt.rst:88 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.open_osfhandle`` with " "arguments ``handle``, ``flags``." @@ -119,13 +123,13 @@ msgstr "" "引發一個附帶引數 ``handle``、``flags`` 的\\ :ref:`稽核事件 ` " "``msvcrt.open_osfhandle``。" -#: ../../library/msvcrt.rst:91 +#: ../../library/msvcrt.rst:93 msgid "" "Return the file handle for the file descriptor *fd*. Raises :exc:`OSError` " "if *fd* is not recognized." msgstr "" -#: ../../library/msvcrt.rst:94 +#: ../../library/msvcrt.rst:96 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.get_osfhandle`` with " "argument ``fd``." @@ -133,17 +137,17 @@ msgstr "" "引發一個附帶引數 ``fd`` 的\\ :ref:`稽核事件 ` ``msvcrt." "get_osfhandle``。" -#: ../../library/msvcrt.rst:100 +#: ../../library/msvcrt.rst:102 msgid "Console I/O" msgstr "" -#: ../../library/msvcrt.rst:105 +#: ../../library/msvcrt.rst:107 msgid "" "Returns a nonzero value if a keypress is waiting to be read. Otherwise, " "return 0." msgstr "" -#: ../../library/msvcrt.rst:111 +#: ../../library/msvcrt.rst:113 msgid "" "Read a keypress and return the resulting character as a byte string. Nothing " "is echoed to the console. This call will block if a keypress is not already " @@ -153,49 +157,49 @@ msgid "" "be read with this function." msgstr "" -#: ../../library/msvcrt.rst:121 +#: ../../library/msvcrt.rst:123 msgid "Wide char variant of :func:`getch`, returning a Unicode value." msgstr "" -#: ../../library/msvcrt.rst:126 +#: ../../library/msvcrt.rst:128 msgid "" "Similar to :func:`getch`, but the keypress will be echoed if it represents a " "printable character." msgstr "" -#: ../../library/msvcrt.rst:132 +#: ../../library/msvcrt.rst:134 msgid "Wide char variant of :func:`getche`, returning a Unicode value." msgstr "" -#: ../../library/msvcrt.rst:137 +#: ../../library/msvcrt.rst:139 msgid "Print the byte string *char* to the console without buffering." msgstr "" -#: ../../library/msvcrt.rst:142 +#: ../../library/msvcrt.rst:144 msgid "Wide char variant of :func:`putch`, accepting a Unicode value." msgstr "" -#: ../../library/msvcrt.rst:147 +#: ../../library/msvcrt.rst:149 msgid "" "Cause the byte string *char* to be \"pushed back\" into the console buffer; " "it will be the next character read by :func:`getch` or :func:`getche`." msgstr "" -#: ../../library/msvcrt.rst:153 +#: ../../library/msvcrt.rst:155 msgid "Wide char variant of :func:`ungetch`, accepting a Unicode value." msgstr "" -#: ../../library/msvcrt.rst:159 +#: ../../library/msvcrt.rst:161 msgid "Other Functions" msgstr "" -#: ../../library/msvcrt.rst:164 +#: ../../library/msvcrt.rst:166 msgid "" "Force the :c:func:`malloc` heap to clean itself up and return unused blocks " "to the operating system. On failure, this raises :exc:`OSError`." msgstr "" -#: ../../library/msvcrt.rst:170 +#: ../../library/msvcrt.rst:172 msgid "" "Changes the location where the C runtime writes an error message for an " "error that might end the program. *mode* must be one of the :const:`!" @@ -204,31 +208,31 @@ msgid "" "Python `." msgstr "" -#: ../../library/msvcrt.rst:179 +#: ../../library/msvcrt.rst:181 msgid "" "Error sink is determined by the app's type. Only available in :ref:`debug " "build of Python `." msgstr "" -#: ../../library/msvcrt.rst:185 +#: ../../library/msvcrt.rst:187 msgid "" "Error sink is a standard error. Only available in :ref:`debug build of " "Python `." msgstr "" -#: ../../library/msvcrt.rst:191 +#: ../../library/msvcrt.rst:193 msgid "" "Error sink is a message box. Only available in :ref:`debug build of Python " "`." msgstr "" -#: ../../library/msvcrt.rst:197 +#: ../../library/msvcrt.rst:199 msgid "" "Report the current error mode value. Only available in :ref:`debug build of " "Python `." msgstr "" -#: ../../library/msvcrt.rst:203 +#: ../../library/msvcrt.rst:205 msgid "" "Specifies the destination or destinations for a specific report type " "generated by :c:func:`!_CrtDbgReport` in the MS VC++ runtime. *type* must be " @@ -237,7 +241,7 @@ msgid "" "`debug build of Python `." msgstr "" -#: ../../library/msvcrt.rst:212 +#: ../../library/msvcrt.rst:214 msgid "" "After you use :func:`CrtSetReportMode` to specify :const:`CRTDBG_MODE_FILE`, " "you can specify the file handle to receive the message text. *type* must be " @@ -246,51 +250,51 @@ msgid "" "Python `." msgstr "" -#: ../../library/msvcrt.rst:221 +#: ../../library/msvcrt.rst:223 msgid "" "Warnings, messages, and information that doesn't need immediate attention." msgstr "" -#: ../../library/msvcrt.rst:226 +#: ../../library/msvcrt.rst:228 msgid "" "Errors, unrecoverable problems, and issues that require immediate attention." msgstr "" -#: ../../library/msvcrt.rst:231 +#: ../../library/msvcrt.rst:233 msgid "Assertion failures." msgstr "" -#: ../../library/msvcrt.rst:236 +#: ../../library/msvcrt.rst:238 msgid "Writes the message to the debugger's output window." msgstr "" -#: ../../library/msvcrt.rst:241 +#: ../../library/msvcrt.rst:243 msgid "" "Writes the message to a user-supplied file handle. :func:`CrtSetReportFile` " "should be called to define the specific file or stream to use as the " "destination." msgstr "" -#: ../../library/msvcrt.rst:248 +#: ../../library/msvcrt.rst:250 msgid "" "Creates a message box to display the message along with the ``Abort``, " "``Retry``, and ``Ignore`` buttons." msgstr "" -#: ../../library/msvcrt.rst:254 +#: ../../library/msvcrt.rst:256 msgid "Returns current *mode* for the specified *type*." msgstr "" -#: ../../library/msvcrt.rst:259 +#: ../../library/msvcrt.rst:261 msgid "The CRT Assembly version, from the :file:`crtassem.h` header file." msgstr "" -#: ../../library/msvcrt.rst:264 +#: ../../library/msvcrt.rst:266 msgid "" "The VC Assembly public key token, from the :file:`crtassem.h` header file." msgstr "" -#: ../../library/msvcrt.rst:269 +#: ../../library/msvcrt.rst:271 msgid "" "The Libraries Assembly name prefix, from the :file:`crtassem.h` header file." msgstr "" diff --git a/library/readline.po b/library/readline.po index cccb0ce363a..b6458e84d1d 100644 --- a/library/readline.po +++ b/library/readline.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-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,8 @@ msgid "" "This module can be used directly, or via the :mod:`rlcompleter` module, " "which supports completion of Python identifiers at the interactive prompt. " "Settings made using this module affect the behaviour of both the " -"interpreter's interactive prompt and the prompts offered by the built-" -"in :func:`input` function." +"interpreter's interactive prompt and the prompts offered by the built-in :" +"func:`input` function." msgstr "" #: ../../library/readline.rst:20 @@ -54,21 +54,29 @@ msgstr "" "此模組在\\ :ref:`行動平台 `\\ 或\\ :ref:`WebAssembly 平" "台 `\\ 上不支援。" -#: ../../library/readline.rst:31 +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/readline.rst:33 msgid "" "The underlying Readline library API may be implemented by the ``editline`` " "(``libedit``) library instead of GNU readline. On macOS the :mod:`readline` " "module detects which library is being used at run time." msgstr "" -#: ../../library/readline.rst:36 +#: ../../library/readline.rst:38 msgid "" "The configuration file for ``editline`` is different from that of GNU " -"readline. If you programmatically load configuration strings you can " -"use :data:`backend` to determine which library is being used." +"readline. If you programmatically load configuration strings you can use :" +"data:`backend` to determine which library is being used." msgstr "" -#: ../../library/readline.rst:40 +#: ../../library/readline.rst:42 msgid "" "If you use ``editline``/``libedit`` readline emulation on macOS, the " "initialization file located in your home directory is named ``.editrc``. For " @@ -76,7 +84,7 @@ msgid "" "keybindings and TAB completion::" msgstr "" -#: ../../library/readline.rst:45 +#: ../../library/readline.rst:47 msgid "" "python:bind -v\n" "python:bind ^I rl_complete" @@ -84,34 +92,34 @@ msgstr "" "python:bind -v\n" "python:bind ^I rl_complete" -#: ../../library/readline.rst:48 +#: ../../library/readline.rst:50 msgid "" "Also note that different libraries may use different history file formats. " "When switching the underlying library, existing history files may become " "unusable." msgstr "" -#: ../../library/readline.rst:54 +#: ../../library/readline.rst:56 msgid "" "The name of the underlying Readline library being used, either " "``\"readline\"`` or ``\"editline\"``." msgstr "" -#: ../../library/readline.rst:60 +#: ../../library/readline.rst:62 msgid "Init file" msgstr "" -#: ../../library/readline.rst:62 +#: ../../library/readline.rst:64 msgid "The following functions relate to the init file and user configuration:" msgstr "" -#: ../../library/readline.rst:67 +#: ../../library/readline.rst:69 msgid "" -"Execute the init line provided in the *string* argument. This " -"calls :c:func:`!rl_parse_and_bind` in the underlying library." +"Execute the init line provided in the *string* argument. This calls :c:func:" +"`!rl_parse_and_bind` in the underlying library." msgstr "" -#: ../../library/readline.rst:73 +#: ../../library/readline.rst:75 msgid "" "Execute a readline initialization file. The default filename is the last " "filename used. This calls :c:func:`!rl_read_init_file` in the underlying " @@ -120,47 +128,46 @@ msgid "" "regardless of which file the library resolves." msgstr "" -#: ../../library/readline.rst:79 ../../library/readline.rst:122 -#: ../../library/readline.rst:134 ../../library/readline.rst:149 +#: ../../library/readline.rst:81 ../../library/readline.rst:124 +#: ../../library/readline.rst:136 ../../library/readline.rst:151 msgid "The auditing event was added." msgstr "" -#: ../../library/readline.rst:84 +#: ../../library/readline.rst:86 msgid "Line buffer" msgstr "" -#: ../../library/readline.rst:86 +#: ../../library/readline.rst:88 msgid "The following functions operate on the line buffer:" msgstr "" -#: ../../library/readline.rst:91 +#: ../../library/readline.rst:93 msgid "" "Return the current contents of the line buffer (:c:data:`!rl_line_buffer` in " "the underlying library)." msgstr "" -#: ../../library/readline.rst:97 +#: ../../library/readline.rst:99 msgid "" -"Insert text into the line buffer at the cursor position. This " -"calls :c:func:`!rl_insert_text` in the underlying library, but ignores the " -"return value." +"Insert text into the line buffer at the cursor position. This calls :c:func:" +"`!rl_insert_text` in the underlying library, but ignores the return value." msgstr "" -#: ../../library/readline.rst:104 +#: ../../library/readline.rst:106 msgid "" "Change what's displayed on the screen to reflect the current contents of the " "line buffer. This calls :c:func:`!rl_redisplay` in the underlying library." msgstr "" -#: ../../library/readline.rst:109 +#: ../../library/readline.rst:111 msgid "History file" msgstr "" -#: ../../library/readline.rst:111 +#: ../../library/readline.rst:113 msgid "The following functions operate on a history file:" msgstr "" -#: ../../library/readline.rst:116 +#: ../../library/readline.rst:118 msgid "" "Load a readline history file, and append it to the history list. The default " "filename is :file:`~/.history`. This calls :c:func:`!read_history` in the " @@ -168,7 +175,7 @@ msgid "" "with the file name if given and :code:`\"~/.history\"` otherwise." msgstr "" -#: ../../library/readline.rst:128 +#: ../../library/readline.rst:130 msgid "" "Save the history list to a readline history file, overwriting any existing " "file. The default filename is :file:`~/.history`. This calls :c:func:`!" @@ -177,90 +184,90 @@ msgid "" "otherwise." msgstr "" -#: ../../library/readline.rst:140 +#: ../../library/readline.rst:142 msgid "" "Append the last *nelements* items of history to a file. The default " -"filename is :file:`~/.history`. The file must already exist. This " -"calls :c:func:`!append_history` in the underlying library. This function " -"only exists if Python was compiled for a version of the library that " -"supports it. It raises an :ref:`auditing event ` ``open`` with the " -"file name if given and :code:`\"~/.history\"` otherwise." +"filename is :file:`~/.history`. The file must already exist. This calls :c:" +"func:`!append_history` in the underlying library. This function only exists " +"if Python was compiled for a version of the library that supports it. It " +"raises an :ref:`auditing event ` ``open`` with the file name if " +"given and :code:`\"~/.history\"` otherwise." msgstr "" -#: ../../library/readline.rst:156 +#: ../../library/readline.rst:158 msgid "" -"Set or return the desired number of lines to save in the history file. " -"The :func:`write_history_file` function uses this value to truncate the " -"history file, by calling :c:func:`!history_truncate_file` in the underlying " +"Set or return the desired number of lines to save in the history file. The :" +"func:`write_history_file` function uses this value to truncate the history " +"file, by calling :c:func:`!history_truncate_file` in the underlying " "library. Negative values imply unlimited history file size." msgstr "" -#: ../../library/readline.rst:164 +#: ../../library/readline.rst:166 msgid "History list" msgstr "" -#: ../../library/readline.rst:166 +#: ../../library/readline.rst:168 msgid "The following functions operate on a global history list:" msgstr "" -#: ../../library/readline.rst:171 +#: ../../library/readline.rst:173 msgid "" "Clear the current history. This calls :c:func:`!clear_history` in the " "underlying library. The Python function only exists if Python was compiled " "for a version of the library that supports it." msgstr "" -#: ../../library/readline.rst:178 +#: ../../library/readline.rst:180 msgid "" "Return the number of items currently in the history. (This is different " "from :func:`get_history_length`, which returns the maximum number of lines " "that will be written to a history file.)" msgstr "" -#: ../../library/readline.rst:185 +#: ../../library/readline.rst:187 msgid "" "Return the current contents of history item at *index*. The item index is " "one-based. This calls :c:func:`!history_get` in the underlying library." msgstr "" -#: ../../library/readline.rst:191 +#: ../../library/readline.rst:193 msgid "" "Remove history item specified by its position from the history. The position " "is zero-based. This calls :c:func:`!remove_history` in the underlying " "library." msgstr "" -#: ../../library/readline.rst:198 +#: ../../library/readline.rst:200 msgid "" "Replace history item specified by its position with *line*. The position is " "zero-based. This calls :c:func:`!replace_history_entry` in the underlying " "library." msgstr "" -#: ../../library/readline.rst:205 +#: ../../library/readline.rst:207 msgid "" "Append *line* to the history buffer, as if it was the last line typed. This " "calls :c:func:`!add_history` in the underlying library." msgstr "" -#: ../../library/readline.rst:211 +#: ../../library/readline.rst:213 msgid "" "Enable or disable automatic calls to :c:func:`!add_history` when reading " "input via readline. The *enabled* argument should be a Boolean value that " "when true, enables auto history, and that when false, disables auto history." msgstr "" -#: ../../library/readline.rst:219 +#: ../../library/readline.rst:221 msgid "" "Auto history is enabled by default, and changes to this do not persist " "across multiple sessions." msgstr "" -#: ../../library/readline.rst:224 +#: ../../library/readline.rst:226 msgid "Startup hooks" msgstr "" -#: ../../library/readline.rst:229 +#: ../../library/readline.rst:231 msgid "" "Set or remove the function invoked by the :c:data:`!rl_startup_hook` " "callback of the underlying library. If *function* is specified, it will be " @@ -269,7 +276,7 @@ msgid "" "readline prints the first prompt." msgstr "" -#: ../../library/readline.rst:238 +#: ../../library/readline.rst:240 msgid "" "Set or remove the function invoked by the :c:data:`!rl_pre_input_hook` " "callback of the underlying library. If *function* is specified, it will be " @@ -280,11 +287,11 @@ msgid "" "of the library that supports it." msgstr "" -#: ../../library/readline.rst:250 +#: ../../library/readline.rst:252 msgid "Completion" msgstr "" -#: ../../library/readline.rst:252 +#: ../../library/readline.rst:254 msgid "" "The following functions relate to implementing a custom word completion " "function. This is typically operated by the Tab key, and can suggest and " @@ -294,7 +301,7 @@ msgid "" "custom completer, a different set of word delimiters should be set." msgstr "" -#: ../../library/readline.rst:262 +#: ../../library/readline.rst:264 msgid "" "Set or remove the completer function. If *function* is specified, it will " "be used as the new completer function; if omitted or ``None``, any completer " @@ -304,7 +311,7 @@ msgid "" "starting with *text*." msgstr "" -#: ../../library/readline.rst:269 +#: ../../library/readline.rst:271 msgid "" "The installed completer function is invoked by the *entry_func* callback " "passed to :c:func:`!rl_completion_matches` in the underlying library. The " @@ -312,19 +319,19 @@ msgid "" "rl_attempted_completion_function` callback of the underlying library." msgstr "" -#: ../../library/readline.rst:278 +#: ../../library/readline.rst:280 msgid "" "Get the completer function, or ``None`` if no completer function has been " "set." msgstr "" -#: ../../library/readline.rst:283 +#: ../../library/readline.rst:285 msgid "" "Get the type of completion being attempted. This returns the :c:data:`!" "rl_completion_type` variable in the underlying library as an integer." msgstr "" -#: ../../library/readline.rst:291 +#: ../../library/readline.rst:293 msgid "" "Get the beginning or ending index of the completion scope. These indexes are " "the *start* and *end* arguments passed to the :c:data:`!" @@ -334,7 +341,7 @@ msgid "" "differently than libreadline." msgstr "" -#: ../../library/readline.rst:302 +#: ../../library/readline.rst:304 msgid "" "Set or get the word delimiters for completion. These determine the start of " "the word to be considered for completion (the completion scope). These " @@ -342,7 +349,7 @@ msgid "" "in the underlying library." msgstr "" -#: ../../library/readline.rst:310 +#: ../../library/readline.rst:312 msgid "" "Set or remove the completion display function. If *function* is specified, " "it will be used as the new completion display function; if omitted or " @@ -353,11 +360,11 @@ msgid "" "each time matches need to be displayed." msgstr "" -#: ../../library/readline.rst:323 +#: ../../library/readline.rst:325 msgid "Example" msgstr "範例" -#: ../../library/readline.rst:325 +#: ../../library/readline.rst:327 msgid "" "The following example demonstrates how to use the :mod:`readline` module's " "history reading and writing functions to automatically load and save a " @@ -366,7 +373,7 @@ msgid "" "sessions from the user's :envvar:`PYTHONSTARTUP` file. ::" msgstr "" -#: ../../library/readline.rst:331 +#: ../../library/readline.rst:333 msgid "" "import atexit\n" "import os\n" @@ -383,19 +390,19 @@ msgid "" "atexit.register(readline.write_history_file, histfile)" msgstr "" -#: ../../library/readline.rst:345 +#: ../../library/readline.rst:347 msgid "" -"This code is actually automatically run when Python is run " -"in :ref:`interactive mode ` (see :ref:`rlcompleter-config`)." +"This code is actually automatically run when Python is run in :ref:" +"`interactive mode ` (see :ref:`rlcompleter-config`)." msgstr "" -#: ../../library/readline.rst:348 +#: ../../library/readline.rst:350 msgid "" "The following example achieves the same goal but supports concurrent " "interactive sessions, by only appending the new history. ::" msgstr "" -#: ../../library/readline.rst:351 +#: ../../library/readline.rst:353 msgid "" "import atexit\n" "import os\n" @@ -433,13 +440,13 @@ msgstr "" " readline.append_history_file(new_h_len - prev_h_len, histfile)\n" "atexit.register(save, h_len, histfile)" -#: ../../library/readline.rst:369 +#: ../../library/readline.rst:371 msgid "" "The following example extends the :class:`code.InteractiveConsole` class to " "support history save/restore. ::" msgstr "" -#: ../../library/readline.rst:372 +#: ../../library/readline.rst:374 msgid "" "import atexit\n" "import code\n" diff --git a/library/sqlite3.po b/library/sqlite3.po index 644dd1f93b2..417b8c1e85b 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -6,7 +6,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-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,71 +39,79 @@ msgstr "" msgid "" "The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an " "SQL interface compliant with the DB-API 2.0 specification described by :pep:" -"`249`, and requires SQLite 3.15.2 or newer." +"`249`, and requires the third-party `SQLite `_ library." msgstr "" -#: ../../library/sqlite3.rst:36 +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/sqlite3.rst:38 msgid "This document includes four main sections:" msgstr "此文件包含四個主要章節:" -#: ../../library/sqlite3.rst:38 +#: ../../library/sqlite3.rst:40 msgid ":ref:`sqlite3-tutorial` teaches how to use the :mod:`!sqlite3` module." msgstr ":ref:`sqlite3-tutorial` 教導如何使用 :mod:`!sqlite3` 模組。" -#: ../../library/sqlite3.rst:39 +#: ../../library/sqlite3.rst:41 msgid "" ":ref:`sqlite3-reference` describes the classes and functions this module " "defines." msgstr ":ref:`sqlite3-reference` 描述此模組定義的類別與函式。" -#: ../../library/sqlite3.rst:41 +#: ../../library/sqlite3.rst:43 msgid ":ref:`sqlite3-howtos` details how to handle specific tasks." msgstr ":ref:`sqlite3-howtos` 詳細說明如何處理特定工作。" -#: ../../library/sqlite3.rst:42 +#: ../../library/sqlite3.rst:44 msgid "" ":ref:`sqlite3-explanation` provides in-depth background on transaction " "control." msgstr ":ref:`sqlite3-explanation` 深入提供交易 (transaction) 控制的背景。" -#: ../../library/sqlite3.rst:47 +#: ../../library/sqlite3.rst:49 msgid "https://www.sqlite.org" msgstr "https://www.sqlite.org" -#: ../../library/sqlite3.rst:48 +#: ../../library/sqlite3.rst:50 msgid "" "The SQLite web page; the documentation describes the syntax and the " "available data types for the supported SQL dialect." msgstr "" -#: ../../library/sqlite3.rst:51 +#: ../../library/sqlite3.rst:53 msgid "https://www.w3schools.com/sql/" msgstr "https://www.w3schools.com/sql/" -#: ../../library/sqlite3.rst:52 +#: ../../library/sqlite3.rst:54 msgid "Tutorial, reference and examples for learning SQL syntax." msgstr "" -#: ../../library/sqlite3.rst:54 +#: ../../library/sqlite3.rst:56 msgid ":pep:`249` - Database API Specification 2.0" msgstr ":pep:`249` - 資料庫 API 規格 2.0" -#: ../../library/sqlite3.rst:55 +#: ../../library/sqlite3.rst:57 msgid "PEP written by Marc-André Lemburg." msgstr "PEP 由 Marc-André Lemburg 撰寫。" -#: ../../library/sqlite3.rst:68 +#: ../../library/sqlite3.rst:70 msgid "Tutorial" msgstr "教學" -#: ../../library/sqlite3.rst:70 +#: ../../library/sqlite3.rst:72 msgid "" "In this tutorial, you will create a database of Monty Python movies using " "basic :mod:`!sqlite3` functionality. It assumes a fundamental understanding " "of database concepts, including `cursors`_ and `transactions`_." msgstr "" -#: ../../library/sqlite3.rst:75 +#: ../../library/sqlite3.rst:77 msgid "" "First, we need to create a new database and open a database connection to " "allow :mod:`!sqlite3` to work with it. Call :func:`sqlite3.connect` to " @@ -111,7 +119,7 @@ msgid "" "working directory, implicitly creating it if it does not exist:" msgstr "" -#: ../../library/sqlite3.rst:81 +#: ../../library/sqlite3.rst:83 msgid "" "import sqlite3\n" "con = sqlite3.connect(\"tutorial.db\")" @@ -119,24 +127,24 @@ msgstr "" "import sqlite3\n" "con = sqlite3.connect(\"tutorial.db\")" -#: ../../library/sqlite3.rst:86 +#: ../../library/sqlite3.rst:88 msgid "" "The returned :class:`Connection` object ``con`` represents the connection to " "the on-disk database." msgstr "" -#: ../../library/sqlite3.rst:89 +#: ../../library/sqlite3.rst:91 msgid "" "In order to execute SQL statements and fetch results from SQL queries, we " "will need to use a database cursor. Call :meth:`con.cursor() ` to create the :class:`Cursor`:" msgstr "" -#: ../../library/sqlite3.rst:93 +#: ../../library/sqlite3.rst:95 msgid "cur = con.cursor()" msgstr "cur = con.cursor()" -#: ../../library/sqlite3.rst:97 +#: ../../library/sqlite3.rst:99 msgid "" "Now that we've got a database connection and a cursor, we can create a " "database table ``movie`` with columns for title, release year, and review " @@ -146,11 +154,11 @@ msgid "" "`cur.execute(...) `:" msgstr "" -#: ../../library/sqlite3.rst:106 +#: ../../library/sqlite3.rst:108 msgid "cur.execute(\"CREATE TABLE movie(title, year, score)\")" msgstr "cur.execute(\"CREATE TABLE movie(title, year, score)\")" -#: ../../library/sqlite3.rst:113 +#: ../../library/sqlite3.rst:115 msgid "" "We can verify that the new table has been created by querying the " "``sqlite_master`` table built-in to SQLite, which should now contain an " @@ -160,7 +168,7 @@ msgid "" "` to fetch the resulting row:" msgstr "" -#: ../../library/sqlite3.rst:121 +#: ../../library/sqlite3.rst:123 msgid "" ">>> res = cur.execute(\"SELECT name FROM sqlite_master\")\n" ">>> res.fetchone()\n" @@ -170,14 +178,14 @@ msgstr "" ">>> res.fetchone()\n" "('movie',)" -#: ../../library/sqlite3.rst:127 +#: ../../library/sqlite3.rst:129 msgid "" "We can see that the table has been created, as the query returns a :class:" "`tuple` containing the table's name. If we query ``sqlite_master`` for a non-" "existent table ``spam``, :meth:`!res.fetchone` will return ``None``:" msgstr "" -#: ../../library/sqlite3.rst:132 +#: ../../library/sqlite3.rst:134 msgid "" ">>> res = cur.execute(\"SELECT name FROM sqlite_master WHERE name='spam'\")\n" ">>> res.fetchone() is None\n" @@ -187,14 +195,14 @@ msgstr "" ">>> res.fetchone() is None\n" "True" -#: ../../library/sqlite3.rst:138 +#: ../../library/sqlite3.rst:140 msgid "" "Now, add two rows of data supplied as SQL literals by executing an " "``INSERT`` statement, once again by calling :meth:`cur.execute(...) `:" msgstr "" -#: ../../library/sqlite3.rst:142 +#: ../../library/sqlite3.rst:144 msgid "" "cur.execute(\"\"\"\n" " INSERT INTO movie VALUES\n" @@ -208,7 +216,7 @@ msgstr "" " ('And Now for Something Completely Different', 1971, 7.5)\n" "\"\"\")" -#: ../../library/sqlite3.rst:150 +#: ../../library/sqlite3.rst:152 msgid "" "The ``INSERT`` statement implicitly opens a transaction, which needs to be " "committed before changes are saved in the database (see :ref:`sqlite3-" @@ -216,11 +224,11 @@ msgid "" "commit>` on the connection object to commit the transaction:" msgstr "" -#: ../../library/sqlite3.rst:156 +#: ../../library/sqlite3.rst:158 msgid "con.commit()" msgstr "con.commit()" -#: ../../library/sqlite3.rst:160 +#: ../../library/sqlite3.rst:162 msgid "" "We can verify that the data was inserted correctly by executing a ``SELECT`` " "query. Use the now-familiar :meth:`cur.execute(...) ` to " @@ -228,7 +236,7 @@ msgid "" "fetchall>` to return all resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:166 +#: ../../library/sqlite3.rst:168 msgid "" ">>> res = cur.execute(\"SELECT score FROM movie\")\n" ">>> res.fetchall()\n" @@ -238,19 +246,19 @@ msgstr "" ">>> res.fetchall()\n" "[(8.2,), (7.5,)]" -#: ../../library/sqlite3.rst:172 +#: ../../library/sqlite3.rst:174 msgid "" "The result is a :class:`list` of two :class:`!tuple`\\s, one per row, each " "containing that row's ``score`` value." msgstr "" -#: ../../library/sqlite3.rst:175 +#: ../../library/sqlite3.rst:177 msgid "" "Now, insert three more rows by calling :meth:`cur.executemany(...) `:" msgstr "" -#: ../../library/sqlite3.rst:178 +#: ../../library/sqlite3.rst:180 msgid "" "data = [\n" " (\"Monty Python Live at the Hollywood Bowl\", 1982, 7.9),\n" @@ -261,7 +269,7 @@ msgid "" "con.commit() # Remember to commit the transaction after executing INSERT." msgstr "" -#: ../../library/sqlite3.rst:188 +#: ../../library/sqlite3.rst:190 msgid "" "Notice that ``?`` placeholders are used to bind ``data`` to the query. " "Always use placeholders instead of :ref:`string formatting ` " @@ -269,13 +277,13 @@ msgid "" "(see :ref:`sqlite3-placeholders` for more details)." msgstr "" -#: ../../library/sqlite3.rst:194 +#: ../../library/sqlite3.rst:196 msgid "" "We can verify that the new rows were inserted by executing a ``SELECT`` " "query, this time iterating over the results of the query:" msgstr "" -#: ../../library/sqlite3.rst:198 +#: ../../library/sqlite3.rst:200 msgid "" ">>> for row in cur.execute(\"SELECT year, title FROM movie ORDER BY " "year\"):\n" @@ -295,20 +303,20 @@ msgstr "" "(1982, 'Monty Python Live at the Hollywood Bowl')\n" "(1983, \"Monty Python's The Meaning of Life\")" -#: ../../library/sqlite3.rst:208 +#: ../../library/sqlite3.rst:210 msgid "" "Each row is a two-item :class:`tuple` of ``(year, title)``, matching the " "columns selected in the query." msgstr "" -#: ../../library/sqlite3.rst:211 +#: ../../library/sqlite3.rst:213 msgid "" "Finally, verify that the database has been written to disk by calling :meth:" "`con.close() ` to close the existing connection, opening a " "new one, creating a new cursor, then querying the database:" msgstr "" -#: ../../library/sqlite3.rst:216 +#: ../../library/sqlite3.rst:218 msgid "" ">>> con.close()\n" ">>> new_con = sqlite3.connect(\"tutorial.db\")\n" @@ -334,50 +342,50 @@ msgstr "" "released in 1975\n" ">>> new_con.close()" -#: ../../library/sqlite3.rst:227 +#: ../../library/sqlite3.rst:229 msgid "" "You've now created an SQLite database using the :mod:`!sqlite3` module, " "inserted data and retrieved values from it in multiple ways." msgstr "" -#: ../../library/sqlite3.rst:239 +#: ../../library/sqlite3.rst:241 msgid ":ref:`sqlite3-howtos` for further reading:" msgstr "進一步參考 :ref:`sqlite3-howtos`:" -#: ../../library/sqlite3.rst:241 +#: ../../library/sqlite3.rst:243 msgid ":ref:`sqlite3-placeholders`" msgstr ":ref:`sqlite3-placeholders`" -#: ../../library/sqlite3.rst:242 +#: ../../library/sqlite3.rst:244 msgid ":ref:`sqlite3-adapters`" msgstr ":ref:`sqlite3-adapters`" -#: ../../library/sqlite3.rst:243 +#: ../../library/sqlite3.rst:245 msgid ":ref:`sqlite3-converters`" msgstr ":ref:`sqlite3-converters`" -#: ../../library/sqlite3.rst:244 ../../library/sqlite3.rst:600 +#: ../../library/sqlite3.rst:246 ../../library/sqlite3.rst:602 msgid ":ref:`sqlite3-connection-context-manager`" msgstr ":ref:`sqlite3-connection-context-manager`" -#: ../../library/sqlite3.rst:245 +#: ../../library/sqlite3.rst:247 msgid ":ref:`sqlite3-howto-row-factory`" msgstr ":ref:`sqlite3-howto-row-factory`" -#: ../../library/sqlite3.rst:247 +#: ../../library/sqlite3.rst:249 msgid "" ":ref:`sqlite3-explanation` for in-depth background on transaction control." msgstr "" -#: ../../library/sqlite3.rst:252 +#: ../../library/sqlite3.rst:254 msgid "Reference" msgstr "" -#: ../../library/sqlite3.rst:260 +#: ../../library/sqlite3.rst:262 msgid "Module functions" msgstr "" -#: ../../library/sqlite3.rst:268 +#: ../../library/sqlite3.rst:270 msgid "Open a connection to an SQLite database." msgstr "" @@ -385,14 +393,14 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/sqlite3.rst:270 +#: ../../library/sqlite3.rst:272 msgid "" "The path to the database file to be opened. You can pass ``\":memory:\"`` to " "create an `SQLite database existing only in memory `_, and open a connection to it." msgstr "" -#: ../../library/sqlite3.rst:277 +#: ../../library/sqlite3.rst:279 msgid "" "How many seconds the connection should wait before raising an :exc:" "`OperationalError` when a table is locked. If another connection opens a " @@ -400,7 +408,7 @@ msgid "" "transaction is committed. Default five seconds." msgstr "" -#: ../../library/sqlite3.rst:284 +#: ../../library/sqlite3.rst:286 msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " @@ -410,7 +418,7 @@ msgid "" "types if both flags are set. By default (``0``), type detection is disabled." msgstr "" -#: ../../library/sqlite3.rst:295 +#: ../../library/sqlite3.rst:297 msgid "" "Control legacy transaction handling behaviour. See :attr:`Connection." "isolation_level` and :ref:`sqlite3-transaction-control-isolation-level` for " @@ -420,7 +428,7 @@ msgid "" "`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default)." msgstr "" -#: ../../library/sqlite3.rst:305 +#: ../../library/sqlite3.rst:307 msgid "" "If ``True`` (default), :exc:`ProgrammingError` will be raised if the " "database connection is used by a thread other than the one that created it. " @@ -429,19 +437,19 @@ msgid "" "See :attr:`threadsafety` for more information." msgstr "" -#: ../../library/sqlite3.rst:314 +#: ../../library/sqlite3.rst:316 msgid "" "A custom subclass of :class:`Connection` to create the connection with, if " "not the default :class:`Connection` class." msgstr "" -#: ../../library/sqlite3.rst:318 +#: ../../library/sqlite3.rst:320 msgid "" "The number of statements that :mod:`!sqlite3` should internally cache for " "this connection, to avoid parsing overhead. By default, 128 statements." msgstr "" -#: ../../library/sqlite3.rst:323 +#: ../../library/sqlite3.rst:325 msgid "" "If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform " "Resource Identifier)` with a file path and an optional query string. The " @@ -450,7 +458,7 @@ msgid "" "various :ref:`sqlite3-uri-tricks`." msgstr "" -#: ../../library/sqlite3.rst:332 +#: ../../library/sqlite3.rst:334 msgid "" "Control :pep:`249` transaction handling behaviour. See :attr:`Connection." "autocommit` and :ref:`sqlite3-transaction-control-autocommit` for more " @@ -463,7 +471,7 @@ msgstr "" msgid "Return type" msgstr "" -#: ../../library/sqlite3.rst:343 +#: ../../library/sqlite3.rst:345 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." @@ -471,7 +479,7 @@ msgstr "" "引發一個附帶引數 ``database`` 的\\ :ref:`稽核事件 ` ``sqlite3." "connect``。" -#: ../../library/sqlite3.rst:344 +#: ../../library/sqlite3.rst:346 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." @@ -479,31 +487,31 @@ msgstr "" "引發一個附帶引數 ``connection_handle`` 的\\ :ref:`稽核事件 ` " "``sqlite3.connect/handle``。" -#: ../../library/sqlite3.rst:346 +#: ../../library/sqlite3.rst:348 msgid "Added the *uri* parameter." msgstr "新增 *uri* 參數。" -#: ../../library/sqlite3.rst:349 +#: ../../library/sqlite3.rst:351 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:352 +#: ../../library/sqlite3.rst:354 msgid "Added the ``sqlite3.connect/handle`` auditing event." msgstr "新增 ``sqlite3.connect/handle`` 稽核事件。" -#: ../../library/sqlite3.rst:355 +#: ../../library/sqlite3.rst:357 msgid "Added the *autocommit* parameter." msgstr "新增 *autocommit* 參數。" -#: ../../library/sqlite3.rst:358 +#: ../../library/sqlite3.rst:360 msgid "" "Positional use of the parameters *timeout*, *detect_types*, " "*isolation_level*, *check_same_thread*, *factory*, *cached_statements*, and " "*uri* is deprecated. They will become keyword-only parameters in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:366 +#: ../../library/sqlite3.rst:368 msgid "" "Return ``True`` if the string *statement* appears to contain one or more " "complete SQL statements. No syntactic verification or parsing of any kind is " @@ -511,11 +519,11 @@ msgid "" "and the statement is terminated by a semicolon." msgstr "" -#: ../../library/sqlite3.rst:372 +#: ../../library/sqlite3.rst:374 msgid "For example:" msgstr "範例:" -#: ../../library/sqlite3.rst:374 +#: ../../library/sqlite3.rst:376 msgid "" ">>> sqlite3.complete_statement(\"SELECT foo FROM bar;\")\n" "True\n" @@ -527,20 +535,20 @@ msgstr "" ">>> sqlite3.complete_statement(\"SELECT foo\")\n" "False" -#: ../../library/sqlite3.rst:381 +#: ../../library/sqlite3.rst:383 msgid "" "This function may be useful during command-line input to determine if the " "entered text seems to form a complete SQL statement, or if additional input " "is needed before calling :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:385 +#: ../../library/sqlite3.rst:387 msgid "" "See :func:`!runsource` in :source:`Lib/sqlite3/__main__.py` for real-world " "use." msgstr "" -#: ../../library/sqlite3.rst:390 +#: ../../library/sqlite3.rst:392 msgid "" "Enable or disable callback tracebacks. By default you will not get any " "tracebacks in user-defined functions, aggregates, converters, authorizer " @@ -549,14 +557,14 @@ msgid "" "on :data:`sys.stderr`. Use ``False`` to disable the feature again." msgstr "" -#: ../../library/sqlite3.rst:399 +#: ../../library/sqlite3.rst:401 msgid "" "Errors in user-defined function callbacks are logged as unraisable " "exceptions. Use an :func:`unraisable hook handler ` for " "introspection of the failed callback." msgstr "" -#: ../../library/sqlite3.rst:405 +#: ../../library/sqlite3.rst:407 msgid "" "Register an *adapter* :term:`callable` to adapt the Python type *type* into " "an SQLite type. The adapter is called with a Python object of type *type* as " @@ -564,7 +572,7 @@ msgid "" "natively understands `." msgstr "" -#: ../../library/sqlite3.rst:413 +#: ../../library/sqlite3.rst:415 msgid "" "Register the *converter* :term:`callable` to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " @@ -574,24 +582,24 @@ msgid "" "type detection works." msgstr "" -#: ../../library/sqlite3.rst:421 +#: ../../library/sqlite3.rst:423 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" -#: ../../library/sqlite3.rst:428 +#: ../../library/sqlite3.rst:430 msgid "Module constants" msgstr "" -#: ../../library/sqlite3.rst:432 +#: ../../library/sqlite3.rst:434 msgid "" "Set :attr:`~Connection.autocommit` to this constant to select old style (pre-" "Python 3.12) transaction control behaviour. See :ref:`sqlite3-transaction-" "control-isolation-level` for more information." msgstr "" -#: ../../library/sqlite3.rst:438 +#: ../../library/sqlite3.rst:440 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function using the declared types for each column. The " @@ -600,7 +608,7 @@ msgid "" "the converter dictionary key. For example:" msgstr "" -#: ../../library/sqlite3.rst:446 +#: ../../library/sqlite3.rst:448 msgid "" "CREATE TABLE test(\n" " i integer primary key, ! will look up a converter named \"integer\"\n" @@ -609,19 +617,19 @@ msgid "" " )" msgstr "" -#: ../../library/sqlite3.rst:454 +#: ../../library/sqlite3.rst:456 msgid "" "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:459 +#: ../../library/sqlite3.rst:461 msgid "" "Generated fields (for example ``MAX(p)``) are returned as :class:`str`. Use :" "const:`!PARSE_COLNAMES` to enforce types for such queries." msgstr "" -#: ../../library/sqlite3.rst:464 +#: ../../library/sqlite3.rst:466 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function by using the type name, parsed from the query " @@ -630,66 +638,66 @@ msgid "" "square brackets (``[]``)." msgstr "" -#: ../../library/sqlite3.rst:471 +#: ../../library/sqlite3.rst:473 msgid "" "SELECT MAX(p) as \"p [point]\" FROM test; ! will look up converter \"point\"" msgstr "" -#: ../../library/sqlite3.rst:475 +#: ../../library/sqlite3.rst:477 msgid "" "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:482 +#: ../../library/sqlite3.rst:484 msgid "" "Flags that should be returned by the *authorizer_callback* :term:`callable` " "passed to :meth:`Connection.set_authorizer`, to indicate whether:" msgstr "" -#: ../../library/sqlite3.rst:485 +#: ../../library/sqlite3.rst:487 msgid "Access is allowed (:const:`!SQLITE_OK`)," msgstr "" -#: ../../library/sqlite3.rst:486 +#: ../../library/sqlite3.rst:488 msgid "" "The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)" msgstr "" -#: ../../library/sqlite3.rst:487 +#: ../../library/sqlite3.rst:489 msgid "" "The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)" msgstr "" -#: ../../library/sqlite3.rst:491 +#: ../../library/sqlite3.rst:493 msgid "" "String constant stating the supported DB-API level. Required by the DB-API. " "Hard-coded to ``\"2.0\"``." msgstr "" -#: ../../library/sqlite3.rst:496 +#: ../../library/sqlite3.rst:498 msgid "" "String constant stating the type of parameter marker formatting expected by " "the :mod:`!sqlite3` module. Required by the DB-API. Hard-coded to " "``\"qmark\"``." msgstr "" -#: ../../library/sqlite3.rst:502 +#: ../../library/sqlite3.rst:504 msgid "The ``named`` DB-API parameter style is also supported." msgstr "" -#: ../../library/sqlite3.rst:506 +#: ../../library/sqlite3.rst:508 msgid "" "Version number of the runtime SQLite library as a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:510 +#: ../../library/sqlite3.rst:512 msgid "" "Version number of the runtime SQLite library as a :class:`tuple` of :class:" "`integers `." msgstr "" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:517 msgid "" "Integer constant required by the DB-API 2.0, stating the level of thread " "safety the :mod:`!sqlite3` module supports. This attribute is set based on " @@ -697,172 +705,172 @@ msgid "" "underlying SQLite library is compiled with. The SQLite threading modes are:" msgstr "" -#: ../../library/sqlite3.rst:520 +#: ../../library/sqlite3.rst:522 msgid "" "**Single-thread**: In this mode, all mutexes are disabled and SQLite is " "unsafe to use in more than a single thread at once." msgstr "" -#: ../../library/sqlite3.rst:522 +#: ../../library/sqlite3.rst:524 msgid "" "**Multi-thread**: In this mode, SQLite can be safely used by multiple " "threads provided that no single database connection is used simultaneously " "in two or more threads." msgstr "" -#: ../../library/sqlite3.rst:525 +#: ../../library/sqlite3.rst:527 msgid "" "**Serialized**: In serialized mode, SQLite can be safely used by multiple " "threads with no restriction." msgstr "" -#: ../../library/sqlite3.rst:528 +#: ../../library/sqlite3.rst:530 msgid "" "The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels " "are as follows:" msgstr "" -#: ../../library/sqlite3.rst:532 +#: ../../library/sqlite3.rst:534 msgid "SQLite threading mode" msgstr "SQLite 執行緒模式" -#: ../../library/sqlite3.rst:532 +#: ../../library/sqlite3.rst:534 msgid ":pep:`threadsafety <0249#threadsafety>`" msgstr ":pep:`執行緒安全 <0249#threadsafety>`" -#: ../../library/sqlite3.rst:532 +#: ../../library/sqlite3.rst:534 msgid "`SQLITE_THREADSAFE`_" msgstr "`SQLITE_THREADSAFE`_" -#: ../../library/sqlite3.rst:532 +#: ../../library/sqlite3.rst:534 msgid "DB-API 2.0 meaning" msgstr "" -#: ../../library/sqlite3.rst:535 +#: ../../library/sqlite3.rst:537 msgid "single-thread" msgstr "" -#: ../../library/sqlite3.rst:535 +#: ../../library/sqlite3.rst:537 msgid "0" msgstr "0" -#: ../../library/sqlite3.rst:535 +#: ../../library/sqlite3.rst:537 msgid "Threads may not share the module" msgstr "" -#: ../../library/sqlite3.rst:538 +#: ../../library/sqlite3.rst:540 msgid "multi-thread" msgstr "" -#: ../../library/sqlite3.rst:538 ../../library/sqlite3.rst:541 +#: ../../library/sqlite3.rst:540 ../../library/sqlite3.rst:543 msgid "1" msgstr "1" -#: ../../library/sqlite3.rst:538 +#: ../../library/sqlite3.rst:540 msgid "2" msgstr "2" -#: ../../library/sqlite3.rst:538 +#: ../../library/sqlite3.rst:540 msgid "Threads may share the module, but not connections" msgstr "" -#: ../../library/sqlite3.rst:541 +#: ../../library/sqlite3.rst:543 msgid "serialized" msgstr "" -#: ../../library/sqlite3.rst:541 +#: ../../library/sqlite3.rst:543 msgid "3" msgstr "3" -#: ../../library/sqlite3.rst:541 +#: ../../library/sqlite3.rst:543 msgid "Threads may share the module, connections and cursors" msgstr "" -#: ../../library/sqlite3.rst:547 +#: ../../library/sqlite3.rst:549 msgid "Set *threadsafety* dynamically instead of hard-coding it to ``1``." msgstr "" -#: ../../library/sqlite3.rst:569 +#: ../../library/sqlite3.rst:571 msgid "" "These constants are used for the :meth:`Connection.setconfig` and :meth:" "`~Connection.getconfig` methods." msgstr "" -#: ../../library/sqlite3.rst:572 +#: ../../library/sqlite3.rst:574 msgid "" "The availability of these constants varies depending on the version of " "SQLite Python was compiled with." msgstr "" -#: ../../library/sqlite3.rst:579 +#: ../../library/sqlite3.rst:581 msgid "https://www.sqlite.org/c3ref/c_dbconfig_defensive.html" msgstr "https://www.sqlite.org/c3ref/c_dbconfig_defensive.html" -#: ../../library/sqlite3.rst:580 +#: ../../library/sqlite3.rst:582 msgid "SQLite docs: Database Connection Configuration Options" msgstr "" -#: ../../library/sqlite3.rst:582 +#: ../../library/sqlite3.rst:584 msgid "The :data:`!version` and :data:`!version_info` constants." msgstr "" -#: ../../library/sqlite3.rst:588 +#: ../../library/sqlite3.rst:590 msgid "Connection objects" msgstr "Connection 物件" -#: ../../library/sqlite3.rst:592 +#: ../../library/sqlite3.rst:594 msgid "" "Each open SQLite database is represented by a ``Connection`` object, which " "is created using :func:`sqlite3.connect`. Their main purpose is creating :" "class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." msgstr "" -#: ../../library/sqlite3.rst:599 +#: ../../library/sqlite3.rst:601 msgid ":ref:`sqlite3-connection-shortcuts`" msgstr ":ref:`sqlite3-connection-shortcuts`" -#: ../../library/sqlite3.rst:605 +#: ../../library/sqlite3.rst:607 msgid "" "A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before a :" "class:`!Connection` object is deleted." msgstr "" -#: ../../library/sqlite3.rst:608 +#: ../../library/sqlite3.rst:610 msgid "An SQLite database connection has the following attributes and methods:" msgstr "一個 SQLite 資料庫連線具有以下屬性和方法:" -#: ../../library/sqlite3.rst:612 +#: ../../library/sqlite3.rst:614 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " "single optional parameter *factory*. If supplied, this must be a :term:" "`callable` returning an instance of :class:`Cursor` or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:619 +#: ../../library/sqlite3.rst:621 msgid "" "Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large " "OBject)`." msgstr "" -#: ../../library/sqlite3.rst:622 +#: ../../library/sqlite3.rst:624 msgid "The name of the table where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:625 +#: ../../library/sqlite3.rst:627 msgid "The name of the column where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:628 +#: ../../library/sqlite3.rst:630 msgid "The row id where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:631 +#: ../../library/sqlite3.rst:633 msgid "" "Set to ``True`` if the blob should be opened without write permissions. " "Defaults to ``False``." msgstr "" -#: ../../library/sqlite3.rst:636 +#: ../../library/sqlite3.rst:638 msgid "" "The name of the database where the blob is located. Defaults to ``\"main\"``." msgstr "" @@ -871,17 +879,17 @@ msgstr "" msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:640 +#: ../../library/sqlite3.rst:642 msgid "When trying to open a blob in a ``WITHOUT ROWID`` table." msgstr "" -#: ../../library/sqlite3.rst:647 +#: ../../library/sqlite3.rst:649 msgid "" "The blob size cannot be changed using the :class:`Blob` class. Use the SQL " "function ``zeroblob`` to create a blob with a fixed size." msgstr "" -#: ../../library/sqlite3.rst:654 +#: ../../library/sqlite3.rst:656 msgid "" "Commit any pending transaction to the database. If :attr:`autocommit` is " "``True``, or there is no open transaction, this method does nothing. If :" @@ -889,7 +897,7 @@ msgid "" "pending transaction was committed by this method." msgstr "" -#: ../../library/sqlite3.rst:662 +#: ../../library/sqlite3.rst:664 msgid "" "Roll back to the start of any pending transaction. If :attr:`autocommit` is " "``True``, or there is no open transaction, this method does nothing. If :" @@ -897,7 +905,7 @@ msgid "" "pending transaction was rolled back by this method." msgstr "" -#: ../../library/sqlite3.rst:670 +#: ../../library/sqlite3.rst:672 msgid "" "Close the database connection. If :attr:`autocommit` is ``False``, any " "pending transaction is implicitly rolled back. If :attr:`!autocommit` is " @@ -906,63 +914,63 @@ msgid "" "losing pending changes." msgstr "" -#: ../../library/sqlite3.rst:680 +#: ../../library/sqlite3.rst:682 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it " "with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:686 +#: ../../library/sqlite3.rst:688 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on " "it with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:692 +#: ../../library/sqlite3.rst:694 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` " "on it with the given *sql_script*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:698 +#: ../../library/sqlite3.rst:700 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:700 +#: ../../library/sqlite3.rst:702 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:703 +#: ../../library/sqlite3.rst:705 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:707 +#: ../../library/sqlite3.rst:709 msgid "" "A :term:`callable` that is called when the SQL function is invoked. The " "callable must return :ref:`a type natively supported by SQLite `. Set to ``None`` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:714 +#: ../../library/sqlite3.rst:716 msgid "" "If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " "optimizations." msgstr "" -#: ../../library/sqlite3.rst:719 +#: ../../library/sqlite3.rst:721 msgid "Added the *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:722 ../../library/sqlite3.rst:766 -#: ../../library/sqlite3.rst:834 ../../library/sqlite3.rst:1113 -#: ../../library/sqlite3.rst:1537 ../../library/sqlite3.rst:1578 +#: ../../library/sqlite3.rst:724 ../../library/sqlite3.rst:768 +#: ../../library/sqlite3.rst:836 ../../library/sqlite3.rst:1115 +#: ../../library/sqlite3.rst:1539 ../../library/sqlite3.rst:1580 msgid "Example:" msgstr "範例:" -#: ../../library/sqlite3.rst:724 +#: ../../library/sqlite3.rst:726 msgid "" ">>> import hashlib\n" ">>> def md5sum(t):\n" @@ -984,27 +992,27 @@ msgstr "" "('acbd18db4cc2f85cedef654fccc4a4d8',)\n" ">>> con.close()" -#: ../../library/sqlite3.rst:738 +#: ../../library/sqlite3.rst:740 msgid "" "Passing *name*, *narg*, and *func* as keyword arguments is deprecated. These " "parameters will become positional-only in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:744 +#: ../../library/sqlite3.rst:746 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:746 +#: ../../library/sqlite3.rst:748 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:749 +#: ../../library/sqlite3.rst:751 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:753 +#: ../../library/sqlite3.rst:755 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -1013,31 +1021,31 @@ msgid "" "*n_arg*. Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:754 +#: ../../library/sqlite3.rst:756 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:756 +#: ../../library/sqlite3.rst:758 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:757 ../../library/sqlite3.rst:818 +#: ../../library/sqlite3.rst:759 ../../library/sqlite3.rst:820 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:760 +#: ../../library/sqlite3.rst:762 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:763 +#: ../../library/sqlite3.rst:765 msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:768 +#: ../../library/sqlite3.rst:770 msgid "" "class MySum:\n" " def __init__(self):\n" @@ -1079,27 +1087,27 @@ msgstr "" "\n" "con.close()" -#: ../../library/sqlite3.rst:797 +#: ../../library/sqlite3.rst:799 msgid "" "Passing *name*, *n_arg*, and *aggregate_class* as keyword arguments is " "deprecated. These parameters will become positional-only in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:803 +#: ../../library/sqlite3.rst:805 msgid "Create or remove a user-defined aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:805 +#: ../../library/sqlite3.rst:807 msgid "The name of the SQL aggregate window function to create or remove." msgstr "" -#: ../../library/sqlite3.rst:808 +#: ../../library/sqlite3.rst:810 msgid "" "The number of arguments the SQL aggregate window function can accept. If " "``-1``, it may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:812 +#: ../../library/sqlite3.rst:814 msgid "" "A class that must implement the following methods: * ``step()``: Add a row " "to the current window. * ``value()``: Return the current value of the " @@ -1111,39 +1119,39 @@ msgid "" "function." msgstr "" -#: ../../library/sqlite3.rst:813 +#: ../../library/sqlite3.rst:815 msgid "A class that must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:815 +#: ../../library/sqlite3.rst:817 msgid "``step()``: Add a row to the current window." msgstr "" -#: ../../library/sqlite3.rst:816 +#: ../../library/sqlite3.rst:818 msgid "``value()``: Return the current value of the aggregate." msgstr "" -#: ../../library/sqlite3.rst:817 +#: ../../library/sqlite3.rst:819 msgid "``inverse()``: Remove a row from the current window." msgstr "" -#: ../../library/sqlite3.rst:821 +#: ../../library/sqlite3.rst:823 msgid "" "The number of arguments that the ``step()`` and ``value()`` methods must " "accept is controlled by *num_params*." msgstr "" -#: ../../library/sqlite3.rst:824 +#: ../../library/sqlite3.rst:826 msgid "Set to ``None`` to remove an existing SQL aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:826 +#: ../../library/sqlite3.rst:828 msgid "" "If used with a version of SQLite older than 3.25.0, which does not support " "aggregate window functions." msgstr "" -#: ../../library/sqlite3.rst:836 +#: ../../library/sqlite3.rst:838 msgid "" "# Example taken from https://www.sqlite.org/windowfunctions.html#udfwinfunc\n" "class WindowSumInt:\n" @@ -1191,30 +1199,30 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:890 +#: ../../library/sqlite3.rst:892 msgid "" "Create a collation named *name* using the collating function *callable*. " "*callable* is passed two :class:`string ` arguments, and it should " "return an :class:`integer `:" msgstr "" -#: ../../library/sqlite3.rst:894 +#: ../../library/sqlite3.rst:896 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:895 +#: ../../library/sqlite3.rst:897 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:896 +#: ../../library/sqlite3.rst:898 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:898 +#: ../../library/sqlite3.rst:900 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:900 +#: ../../library/sqlite3.rst:902 msgid "" "def collate_reverse(string1, string2):\n" " if string1 == string2:\n" @@ -1252,24 +1260,24 @@ msgstr "" " print(row)\n" "con.close()" -#: ../../library/sqlite3.rst:926 +#: ../../library/sqlite3.rst:928 msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" -#: ../../library/sqlite3.rst:928 +#: ../../library/sqlite3.rst:930 msgid "" "The collation name can contain any Unicode character. Earlier, only ASCII " "characters were allowed." msgstr "" -#: ../../library/sqlite3.rst:935 +#: ../../library/sqlite3.rst:937 msgid "" "Call this method from a different thread to abort any queries that might be " "executing on the connection. Aborted queries will raise an :exc:" "`OperationalError`." msgstr "" -#: ../../library/sqlite3.rst:942 +#: ../../library/sqlite3.rst:944 msgid "" "Register :term:`callable` *authorizer_callback* to be invoked for each " "attempt to access a column of a table in the database. The callback should " @@ -1278,7 +1286,7 @@ msgid "" "underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:949 +#: ../../library/sqlite3.rst:951 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or ``None`` " @@ -1288,7 +1296,7 @@ msgid "" "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: ../../library/sqlite3.rst:956 +#: ../../library/sqlite3.rst:958 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -1296,21 +1304,21 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:960 +#: ../../library/sqlite3.rst:962 msgid "Passing ``None`` as *authorizer_callback* will disable the authorizer." msgstr "" -#: ../../library/sqlite3.rst:962 +#: ../../library/sqlite3.rst:964 msgid "Added support for disabling the authorizer using ``None``." msgstr "" -#: ../../library/sqlite3.rst:965 +#: ../../library/sqlite3.rst:967 msgid "" "Passing *authorizer_callback* as a keyword argument is deprecated. The " "parameter will become positional-only in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:972 +#: ../../library/sqlite3.rst:974 msgid "" "Register :term:`callable` *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -1318,32 +1326,32 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:977 +#: ../../library/sqlite3.rst:979 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:980 +#: ../../library/sqlite3.rst:982 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise a :exc:`DatabaseError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:984 +#: ../../library/sqlite3.rst:986 msgid "" "Passing *progress_handler* as a keyword argument is deprecated. The " "parameter will become positional-only in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:991 +#: ../../library/sqlite3.rst:993 msgid "" "Register :term:`callable` *trace_callback* to be invoked for each SQL " "statement that is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:994 +#: ../../library/sqlite3.rst:996 msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " @@ -1353,24 +1361,24 @@ msgid "" "execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:1002 +#: ../../library/sqlite3.rst:1004 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:1005 +#: ../../library/sqlite3.rst:1007 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:1012 +#: ../../library/sqlite3.rst:1014 msgid "" "Passing *trace_callback* as a keyword argument is deprecated. The parameter " "will become positional-only in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:1019 +#: ../../library/sqlite3.rst:1021 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " @@ -1379,7 +1387,7 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:1028 +#: ../../library/sqlite3.rst:1030 msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " @@ -1388,7 +1396,7 @@ msgid "" "program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1037 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." @@ -1396,11 +1404,11 @@ msgstr "" "引發一個附帶引數 ``connection``、``enabled`` 的\\ :ref:`稽核事件 ` " "``sqlite3.enable_load_extension``。" -#: ../../library/sqlite3.rst:1039 +#: ../../library/sqlite3.rst:1041 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "加入 ``sqlite3.enable_load_extension`` 稽核事件。" -#: ../../library/sqlite3.rst:1045 +#: ../../library/sqlite3.rst:1047 msgid "" "con.enable_load_extension(True)\n" "\n" @@ -1430,24 +1438,24 @@ msgid "" " print(row)" msgstr "" -#: ../../library/sqlite3.rst:1071 +#: ../../library/sqlite3.rst:1073 msgid "" "Load an SQLite extension from a shared library. Enable extension loading " "with :meth:`enable_load_extension` before calling this method." msgstr "" -#: ../../library/sqlite3.rst:1075 +#: ../../library/sqlite3.rst:1077 msgid "The path to the SQLite extension." msgstr "" -#: ../../library/sqlite3.rst:1079 +#: ../../library/sqlite3.rst:1081 msgid "" "Entry point name. If ``None`` (the default), SQLite will come up with an " "entry point name of its own; see the SQLite docs `Loading an Extension`_ for " "details." msgstr "" -#: ../../library/sqlite3.rst:1088 +#: ../../library/sqlite3.rst:1090 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." @@ -1455,29 +1463,29 @@ msgstr "" "引發一個附帶引數 ``connection``、``path`` 的\\ :ref:`稽核事件 ` " "``sqlite3.load_extension``。" -#: ../../library/sqlite3.rst:1092 +#: ../../library/sqlite3.rst:1094 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "加入 ``sqlite3.load_extension`` 稽核事件。" -#: ../../library/sqlite3.rst:1095 +#: ../../library/sqlite3.rst:1097 msgid "Added the *entrypoint* parameter." msgstr "新增 *entrypoint* 參數。" -#: ../../library/sqlite3.rst:1102 +#: ../../library/sqlite3.rst:1104 msgid "" "Return an :term:`iterator` to dump the database as SQL source code. Useful " "when saving an in-memory database for later restoration. Similar to the ``." "dump`` command in the :program:`sqlite3` shell." msgstr "" -#: ../../library/sqlite3.rst:1106 +#: ../../library/sqlite3.rst:1108 msgid "" "An optional ``LIKE`` pattern for database objects to dump, e.g. " "``prefix_%``. If ``None`` (the default), all database objects will be " "included." msgstr "" -#: ../../library/sqlite3.rst:1115 +#: ../../library/sqlite3.rst:1117 msgid "" "# Convert file example.db to SQL dump file dump.sql\n" "con = sqlite3.connect('example.db')\n" @@ -1487,35 +1495,35 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:1126 ../../library/sqlite3.rst:1200 +#: ../../library/sqlite3.rst:1128 ../../library/sqlite3.rst:1202 msgid ":ref:`sqlite3-howto-encoding`" msgstr ":ref:`sqlite3-howto-encoding`" -#: ../../library/sqlite3.rst:1128 +#: ../../library/sqlite3.rst:1130 msgid "Added the *filter* parameter." msgstr "新增 *filter* 參數。" -#: ../../library/sqlite3.rst:1133 +#: ../../library/sqlite3.rst:1135 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1135 +#: ../../library/sqlite3.rst:1137 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1138 +#: ../../library/sqlite3.rst:1140 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1141 +#: ../../library/sqlite3.rst:1143 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:1147 +#: ../../library/sqlite3.rst:1149 msgid "" "If set to a :term:`callable`, it is invoked with three integer arguments for " "every backup iteration: the *status* of the last iteration, the *remaining* " @@ -1523,24 +1531,24 @@ msgid "" "Defaults to ``None``." msgstr "" -#: ../../library/sqlite3.rst:1156 +#: ../../library/sqlite3.rst:1158 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1163 +#: ../../library/sqlite3.rst:1165 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1167 +#: ../../library/sqlite3.rst:1169 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1169 +#: ../../library/sqlite3.rst:1171 msgid "" "def progress(status, remaining, total):\n" " print(f'Copied {total-remaining} of {total} pages...')\n" @@ -1562,11 +1570,11 @@ msgstr "" "dst.close()\n" "src.close()" -#: ../../library/sqlite3.rst:1186 +#: ../../library/sqlite3.rst:1188 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1188 +#: ../../library/sqlite3.rst:1190 msgid "" "src = sqlite3.connect('example.db')\n" "dst = sqlite3.connect(':memory:')\n" @@ -1580,25 +1588,25 @@ msgstr "" "dst.close()\n" "src.close()" -#: ../../library/sqlite3.rst:1204 +#: ../../library/sqlite3.rst:1206 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1206 +#: ../../library/sqlite3.rst:1208 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1211 ../../library/sqlite3.rst:1248 +#: ../../library/sqlite3.rst:1213 ../../library/sqlite3.rst:1250 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1214 +#: ../../library/sqlite3.rst:1216 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1224 +#: ../../library/sqlite3.rst:1226 msgid "" ">>> con.getlimit(sqlite3.SQLITE_LIMIT_SQL_LENGTH)\n" "1000000000" @@ -1606,7 +1614,7 @@ msgstr "" ">>> con.getlimit(sqlite3.SQLITE_LIMIT_SQL_LENGTH)\n" "1000000000" -#: ../../library/sqlite3.rst:1234 +#: ../../library/sqlite3.rst:1236 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1614,22 +1622,22 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1239 +#: ../../library/sqlite3.rst:1241 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1242 +#: ../../library/sqlite3.rst:1244 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1251 +#: ../../library/sqlite3.rst:1253 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1254 +#: ../../library/sqlite3.rst:1256 msgid "" ">>> con.setlimit(sqlite3.SQLITE_LIMIT_ATTACHED, 1)\n" "10\n" @@ -1641,25 +1649,25 @@ msgstr "" ">>> con.getlimit(sqlite3.SQLITE_LIMIT_ATTACHED)\n" "1" -#: ../../library/sqlite3.rst:1272 +#: ../../library/sqlite3.rst:1274 msgid "Query a boolean connection configuration option." msgstr "" -#: ../../library/sqlite3.rst:1274 ../../library/sqlite3.rst:1285 +#: ../../library/sqlite3.rst:1276 ../../library/sqlite3.rst:1287 msgid "A :ref:`SQLITE_DBCONFIG code `." msgstr "" -#: ../../library/sqlite3.rst:1283 +#: ../../library/sqlite3.rst:1285 msgid "Set a boolean connection configuration option." msgstr "" -#: ../../library/sqlite3.rst:1288 +#: ../../library/sqlite3.rst:1290 msgid "" "``True`` if the configuration option should be enabled (default); ``False`` " "if it should be disabled." msgstr "" -#: ../../library/sqlite3.rst:1296 +#: ../../library/sqlite3.rst:1298 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1668,17 +1676,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1302 +#: ../../library/sqlite3.rst:1304 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1310 +#: ../../library/sqlite3.rst:1312 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1318 +#: ../../library/sqlite3.rst:1320 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1686,96 +1694,96 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1324 +#: ../../library/sqlite3.rst:1326 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1327 +#: ../../library/sqlite3.rst:1329 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1331 +#: ../../library/sqlite3.rst:1333 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1335 +#: ../../library/sqlite3.rst:1337 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1338 +#: ../../library/sqlite3.rst:1340 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1343 +#: ../../library/sqlite3.rst:1345 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1350 +#: ../../library/sqlite3.rst:1352 msgid "" "This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!" "autocommit` has three allowed values:" msgstr "" -#: ../../library/sqlite3.rst:1353 +#: ../../library/sqlite3.rst:1355 msgid "" "``False``: Select :pep:`249`-compliant transaction behaviour, implying that :" "mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :" "meth:`rollback` to close transactions." msgstr "" -#: ../../library/sqlite3.rst:1357 +#: ../../library/sqlite3.rst:1359 msgid "This is the recommended value of :attr:`!autocommit`." msgstr "" -#: ../../library/sqlite3.rst:1359 +#: ../../library/sqlite3.rst:1361 msgid "" "``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:" "`rollback` have no effect in this mode." msgstr "" -#: ../../library/sqlite3.rst:1362 +#: ../../library/sqlite3.rst:1364 msgid "" ":data:`LEGACY_TRANSACTION_CONTROL`: Pre-Python 3.12 (non-:pep:`249`-" "compliant) transaction control. See :attr:`isolation_level` for more details." msgstr "" -#: ../../library/sqlite3.rst:1366 +#: ../../library/sqlite3.rst:1368 msgid "This is currently the default value of :attr:`!autocommit`." msgstr "" -#: ../../library/sqlite3.rst:1368 +#: ../../library/sqlite3.rst:1370 msgid "" "Changing :attr:`!autocommit` to ``False`` will open a new transaction, and " "changing it to ``True`` will commit any pending transaction." msgstr "" -#: ../../library/sqlite3.rst:1371 +#: ../../library/sqlite3.rst:1373 msgid "See :ref:`sqlite3-transaction-control-autocommit` for more details." msgstr "更多詳情請見 :ref:`sqlite3-transaction-control-autocommit`。" -#: ../../library/sqlite3.rst:1375 +#: ../../library/sqlite3.rst:1377 msgid "" "The :attr:`isolation_level` attribute has no effect unless :attr:" "`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." msgstr "" -#: ../../library/sqlite3.rst:1382 +#: ../../library/sqlite3.rst:1384 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1385 +#: ../../library/sqlite3.rst:1387 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1392 +#: ../../library/sqlite3.rst:1394 msgid "" "Controls the :ref:`legacy transaction handling mode ` of :mod:`!sqlite3`. If set to ``None``, " @@ -1785,13 +1793,13 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:1400 +#: ../../library/sqlite3.rst:1402 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:1405 +#: ../../library/sqlite3.rst:1407 msgid "" "Using :attr:`autocommit` to control transaction handling is recommended over " "using :attr:`!isolation_level`. :attr:`!isolation_level` has no effect " @@ -1799,7 +1807,7 @@ msgid "" "default)." msgstr "" -#: ../../library/sqlite3.rst:1412 +#: ../../library/sqlite3.rst:1414 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1808,33 +1816,33 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1419 ../../library/sqlite3.rst:1711 -#: ../../library/sqlite3.rst:1734 +#: ../../library/sqlite3.rst:1421 ../../library/sqlite3.rst:1713 +#: ../../library/sqlite3.rst:1736 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "更多詳情請見 :ref:`sqlite3-howto-row-factory`。" -#: ../../library/sqlite3.rst:1423 +#: ../../library/sqlite3.rst:1425 msgid "" "A :term:`callable` that accepts a :class:`bytes` parameter and returns a " "text representation of it. The callable is invoked for SQLite values with " "the ``TEXT`` data type. By default, this attribute is set to :class:`str`." msgstr "" -#: ../../library/sqlite3.rst:1428 +#: ../../library/sqlite3.rst:1430 msgid "See :ref:`sqlite3-howto-encoding` for more details." msgstr "更多詳情請見 :ref:`sqlite3-howto-encoding`。" -#: ../../library/sqlite3.rst:1432 +#: ../../library/sqlite3.rst:1434 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:1439 +#: ../../library/sqlite3.rst:1441 msgid "Cursor objects" msgstr "Cursor 物件" -#: ../../library/sqlite3.rst:1441 +#: ../../library/sqlite3.rst:1443 msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " @@ -1842,14 +1850,14 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1448 +#: ../../library/sqlite3.rst:1450 msgid "" "Cursor objects are :term:`iterators `, meaning that if you :meth:" "`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " "to fetch the resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:1459 +#: ../../library/sqlite3.rst:1461 msgid "" "for row in cur.execute(\"SELECT t FROM data\"):\n" " print(row)" @@ -1857,35 +1865,35 @@ msgstr "" "for row in cur.execute(\"SELECT t FROM data\"):\n" " print(row)" -#: ../../library/sqlite3.rst:1473 +#: ../../library/sqlite3.rst:1475 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr ":class:`Cursor` 實例具有以下屬性和方法。" -#: ../../library/sqlite3.rst:1480 +#: ../../library/sqlite3.rst:1482 msgid "" "Execute a single SQL statement, optionally binding Python values using :ref:" "`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:1484 +#: ../../library/sqlite3.rst:1486 msgid "A single SQL statement." msgstr "單一個 SQL 陳述式。" -#: ../../library/sqlite3.rst:1487 +#: ../../library/sqlite3.rst:1489 msgid "" "Python values to bind to placeholders in *sql*. A :class:`!dict` if named " "placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1494 +#: ../../library/sqlite3.rst:1496 msgid "" "When *sql* contains more than one SQL statement. When :ref:`named " "placeholders ` are used and *parameters* is a sequence " "instead of a :class:`dict`." msgstr "" -#: ../../library/sqlite3.rst:1499 +#: ../../library/sqlite3.rst:1501 msgid "" "If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :" "attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, " @@ -1893,46 +1901,46 @@ msgid "" "transaction, a transaction is implicitly opened before executing *sql*." msgstr "" -#: ../../library/sqlite3.rst:1508 +#: ../../library/sqlite3.rst:1510 msgid "" ":exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:" "`dict`." msgstr "" -#: ../../library/sqlite3.rst:1512 +#: ../../library/sqlite3.rst:1514 msgid "Use :meth:`executescript` to execute multiple SQL statements." msgstr "" -#: ../../library/sqlite3.rst:1516 +#: ../../library/sqlite3.rst:1518 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " "` :abbr:`DML (Data Manipulation Language)` SQL " "statement *sql*." msgstr "" -#: ../../library/sqlite3.rst:1520 +#: ../../library/sqlite3.rst:1522 msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1522 +#: ../../library/sqlite3.rst:1524 msgid "A single SQL DML statement." msgstr "" -#: ../../library/sqlite3.rst:1525 +#: ../../library/sqlite3.rst:1527 msgid "" "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1531 +#: ../../library/sqlite3.rst:1533 msgid "" "When *sql* contains more than one SQL statement or is not a DML statement, " "When :ref:`named placeholders ` are used and the items " "in *parameters* are sequences instead of :class:`dict`\\s." msgstr "" -#: ../../library/sqlite3.rst:1539 +#: ../../library/sqlite3.rst:1541 msgid "" "rows = [\n" " (\"row1\",),\n" @@ -1948,20 +1956,20 @@ msgstr "" "# cur 是一個 sqlite3.Cursor 物件\n" "cur.executemany(\"INSERT INTO data VALUES(?)\", rows)" -#: ../../library/sqlite3.rst:1554 +#: ../../library/sqlite3.rst:1556 msgid "" "Any resulting rows are discarded, including DML statements with `RETURNING " "clauses`_." msgstr "" -#: ../../library/sqlite3.rst:1561 +#: ../../library/sqlite3.rst:1563 msgid "" ":exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used and the items in *parameters* are sequences instead " "of :class:`dict`\\s." msgstr "" -#: ../../library/sqlite3.rst:1568 +#: ../../library/sqlite3.rst:1570 msgid "" "Execute the SQL statements in *sql_script*. If the :attr:`~Connection." "autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending " @@ -1970,11 +1978,11 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1576 +#: ../../library/sqlite3.rst:1578 msgid "*sql_script* must be a :class:`string `." msgstr "*sql_script* 必須是一個 :class:`string `。" -#: ../../library/sqlite3.rst:1580 +#: ../../library/sqlite3.rst:1582 msgid "" "# cur is an sqlite3.Cursor object\n" "cur.executescript(\"\"\"\n" @@ -1994,20 +2002,20 @@ msgstr "" " COMMIT;\n" "\"\"\")" -#: ../../library/sqlite3.rst:1593 +#: ../../library/sqlite3.rst:1595 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1601 +#: ../../library/sqlite3.rst:1603 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1604 +#: ../../library/sqlite3.rst:1606 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -2015,7 +2023,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1610 +#: ../../library/sqlite3.rst:1612 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -2023,44 +2031,44 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1615 +#: ../../library/sqlite3.rst:1617 msgid "Negative *size* values are rejected by raising :exc:`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1620 +#: ../../library/sqlite3.rst:1622 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1627 +#: ../../library/sqlite3.rst:1629 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1629 +#: ../../library/sqlite3.rst:1631 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:1634 ../../library/sqlite3.rst:1638 +#: ../../library/sqlite3.rst:1636 ../../library/sqlite3.rst:1640 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1642 +#: ../../library/sqlite3.rst:1644 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:1645 +#: ../../library/sqlite3.rst:1647 msgid "Negative values are rejected by raising :exc:`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1650 +#: ../../library/sqlite3.rst:1652 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -2068,7 +2076,7 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1655 +#: ../../library/sqlite3.rst:1657 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> cur = con.cursor()\n" @@ -2082,18 +2090,18 @@ msgstr "" "True\n" ">>> con.close()" -#: ../../library/sqlite3.rst:1665 +#: ../../library/sqlite3.rst:1667 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1669 +#: ../../library/sqlite3.rst:1671 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1673 +#: ../../library/sqlite3.rst:1675 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -2103,15 +2111,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1681 +#: ../../library/sqlite3.rst:1683 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1683 +#: ../../library/sqlite3.rst:1685 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1688 +#: ../../library/sqlite3.rst:1690 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -2121,7 +2129,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1699 +#: ../../library/sqlite3.rst:1701 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -2130,18 +2138,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1706 +#: ../../library/sqlite3.rst:1708 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" "Cursor` was created. Assigning to this attribute does not affect :attr:" "`Connection.row_factory` of the parent connection." msgstr "" -#: ../../library/sqlite3.rst:1722 +#: ../../library/sqlite3.rst:1724 msgid "Row objects" msgstr "Row 物件" -#: ../../library/sqlite3.rst:1726 +#: ../../library/sqlite3.rst:1728 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -2149,28 +2157,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1731 +#: ../../library/sqlite3.rst:1733 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1738 +#: ../../library/sqlite3.rst:1740 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:1742 +#: ../../library/sqlite3.rst:1744 msgid "Added support of slicing." msgstr "新增對切片的支援。" -#: ../../library/sqlite3.rst:1749 +#: ../../library/sqlite3.rst:1751 msgid "Blob objects" msgstr "Blob 物件" -#: ../../library/sqlite3.rst:1755 +#: ../../library/sqlite3.rst:1757 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " "write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" @@ -2178,13 +2186,13 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1760 +#: ../../library/sqlite3.rst:1762 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1763 +#: ../../library/sqlite3.rst:1765 msgid "" "con = sqlite3.connect(\":memory:\")\n" "con.execute(\"CREATE TABLE test(blob_col blob)\")\n" @@ -2206,18 +2214,18 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:1791 +#: ../../library/sqlite3.rst:1793 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1793 +#: ../../library/sqlite3.rst:1795 msgid "" "The blob will be unusable from this point onward. An :class:`~sqlite3." "Error` (or subclass) exception will be raised if any further operation is " "attempted with the blob." msgstr "" -#: ../../library/sqlite3.rst:1799 +#: ../../library/sqlite3.rst:1801 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " @@ -2225,18 +2233,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1807 +#: ../../library/sqlite3.rst:1809 msgid "" "Write *data* to the blob at the current offset. This function cannot change " "the blob length. Writing beyond the end of the blob will raise :exc:" "`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1813 +#: ../../library/sqlite3.rst:1815 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1817 +#: ../../library/sqlite3.rst:1819 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other " @@ -2244,26 +2252,26 @@ msgid "" "position) and :const:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1825 +#: ../../library/sqlite3.rst:1827 msgid "PrepareProtocol objects" msgstr "PrepareProtocol 物件" -#: ../../library/sqlite3.rst:1829 +#: ../../library/sqlite3.rst:1831 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1837 +#: ../../library/sqlite3.rst:1839 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1839 +#: ../../library/sqlite3.rst:1841 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1843 +#: ../../library/sqlite3.rst:1845 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -2271,39 +2279,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1850 +#: ../../library/sqlite3.rst:1852 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1854 +#: ../../library/sqlite3.rst:1856 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1859 +#: ../../library/sqlite3.rst:1861 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1866 +#: ../../library/sqlite3.rst:1868 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1873 +#: ../../library/sqlite3.rst:1875 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1880 +#: ../../library/sqlite3.rst:1882 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -2311,14 +2319,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1887 +#: ../../library/sqlite3.rst:1889 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1893 +#: ../../library/sqlite3.rst:1895 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -2326,20 +2334,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1901 +#: ../../library/sqlite3.rst:1903 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1906 +#: ../../library/sqlite3.rst:1908 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1913 +#: ../../library/sqlite3.rst:1915 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " @@ -2347,7 +2355,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1920 +#: ../../library/sqlite3.rst:1922 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -2356,78 +2364,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1930 +#: ../../library/sqlite3.rst:1932 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1932 +#: ../../library/sqlite3.rst:1934 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1935 +#: ../../library/sqlite3.rst:1937 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1938 ../../library/sqlite3.rst:1955 +#: ../../library/sqlite3.rst:1940 ../../library/sqlite3.rst:1957 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1938 ../../library/sqlite3.rst:1955 +#: ../../library/sqlite3.rst:1940 ../../library/sqlite3.rst:1957 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1940 ../../library/sqlite3.rst:1957 +#: ../../library/sqlite3.rst:1942 ../../library/sqlite3.rst:1959 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1940 ../../library/sqlite3.rst:1957 +#: ../../library/sqlite3.rst:1942 ../../library/sqlite3.rst:1959 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1942 ../../library/sqlite3.rst:1959 +#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1942 ../../library/sqlite3.rst:1959 +#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 +#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 +#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1946 +#: ../../library/sqlite3.rst:1948 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1966 +#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1968 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1966 +#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1968 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1952 +#: ../../library/sqlite3.rst:1954 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1965 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1969 +#: ../../library/sqlite3.rst:1971 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -2436,47 +2444,47 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1979 +#: ../../library/sqlite3.rst:1981 msgid "Default adapters and converters (deprecated)" msgstr "" -#: ../../library/sqlite3.rst:1983 +#: ../../library/sqlite3.rst:1985 msgid "" "The default adapters and converters are deprecated as of Python 3.12. " "Instead, use the :ref:`sqlite3-adapter-converter-recipes` and tailor them to " "your needs." msgstr "" -#: ../../library/sqlite3.rst:1987 +#: ../../library/sqlite3.rst:1989 msgid "The deprecated default adapters and converters consist of:" msgstr "" -#: ../../library/sqlite3.rst:1989 +#: ../../library/sqlite3.rst:1991 msgid "" "An adapter for :class:`datetime.date` objects to :class:`strings ` in " "`ISO 8601`_ format." msgstr "" -#: ../../library/sqlite3.rst:1991 +#: ../../library/sqlite3.rst:1993 msgid "" "An adapter for :class:`datetime.datetime` objects to strings in ISO 8601 " "format." msgstr "" -#: ../../library/sqlite3.rst:1993 +#: ../../library/sqlite3.rst:1995 msgid "" "A converter for :ref:`declared ` \"date\" types to :" "class:`datetime.date` objects." msgstr "" -#: ../../library/sqlite3.rst:1995 +#: ../../library/sqlite3.rst:1997 msgid "" "A converter for declared \"timestamp\" types to :class:`datetime.datetime` " "objects. Fractional parts will be truncated to 6 digits (microsecond " "precision)." msgstr "" -#: ../../library/sqlite3.rst:2001 +#: ../../library/sqlite3.rst:2003 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -2484,42 +2492,42 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:2014 +#: ../../library/sqlite3.rst:2016 msgid "Command-line interface" msgstr "命令列介面" -#: ../../library/sqlite3.rst:2016 +#: ../../library/sqlite3.rst:2018 msgid "" "The :mod:`!sqlite3` module can be invoked as a script, using the " "interpreter's :option:`-m` switch, in order to provide a simple SQLite " "shell. The argument signature is as follows::" msgstr "" -#: ../../library/sqlite3.rst:2021 +#: ../../library/sqlite3.rst:2023 msgid "python -m sqlite3 [-h] [-v] [filename] [sql]" msgstr "python -m sqlite3 [-h] [-v] [filename] [sql]" -#: ../../library/sqlite3.rst:2023 +#: ../../library/sqlite3.rst:2025 msgid "Type ``.quit`` or CTRL-D to exit the shell." msgstr "" -#: ../../library/sqlite3.rst:2029 +#: ../../library/sqlite3.rst:2031 msgid "Print CLI help." msgstr "" -#: ../../library/sqlite3.rst:2033 +#: ../../library/sqlite3.rst:2035 msgid "Print underlying SQLite library version." msgstr "" -#: ../../library/sqlite3.rst:2041 +#: ../../library/sqlite3.rst:2043 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:2046 +#: ../../library/sqlite3.rst:2048 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:2048 +#: ../../library/sqlite3.rst:2050 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -2527,7 +2535,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:2053 +#: ../../library/sqlite3.rst:2055 msgid "" ">>> # Never do this -- insecure!\n" ">>> symbol = input()\n" @@ -2545,7 +2553,7 @@ msgstr "" "SELECT * FROM stocks WHERE symbol = '' OR TRUE; --'\n" ">>> cur.execute(sql)" -#: ../../library/sqlite3.rst:2061 +#: ../../library/sqlite3.rst:2063 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -2553,7 +2561,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:2066 +#: ../../library/sqlite3.rst:2068 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -2564,7 +2572,7 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:2077 +#: ../../library/sqlite3.rst:2079 msgid "" "con = sqlite3.connect(\":memory:\")\n" "cur = con.execute(\"CREATE TABLE lang(name, first_appeared)\")\n" @@ -2585,24 +2593,24 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2104 +#: ../../library/sqlite3.rst:2106 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:2111 +#: ../../library/sqlite3.rst:2113 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:2113 +#: ../../library/sqlite3.rst:2115 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:2117 +#: ../../library/sqlite3.rst:2119 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -2612,11 +2620,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:2129 +#: ../../library/sqlite3.rst:2131 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:2131 +#: ../../library/sqlite3.rst:2133 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -2626,7 +2634,7 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:2139 +#: ../../library/sqlite3.rst:2141 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2658,18 +2666,18 @@ msgstr "" "print(cur.fetchone()[0])\n" "con.close()" -#: ../../library/sqlite3.rst:2163 +#: ../../library/sqlite3.rst:2165 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:2165 +#: ../../library/sqlite3.rst:2167 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:2169 +#: ../../library/sqlite3.rst:2171 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2703,36 +2711,36 @@ msgstr "" "print(cur.fetchone()[0])\n" "con.close()" -#: ../../library/sqlite3.rst:2196 +#: ../../library/sqlite3.rst:2198 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:2198 +#: ../../library/sqlite3.rst:2200 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:2203 +#: ../../library/sqlite3.rst:2205 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:2206 +#: ../../library/sqlite3.rst:2208 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:2211 +#: ../../library/sqlite3.rst:2213 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2214 +#: ../../library/sqlite3.rst:2216 msgid "" "def convert_point(s):\n" " x, y = map(float, s.split(b\";\"))\n" @@ -2742,32 +2750,32 @@ msgstr "" " x, y = map(float, s.split(b\";\"))\n" " return Point(x, y)" -#: ../../library/sqlite3.rst:2220 +#: ../../library/sqlite3.rst:2222 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2224 +#: ../../library/sqlite3.rst:2226 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2225 +#: ../../library/sqlite3.rst:2227 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2226 +#: ../../library/sqlite3.rst:2228 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2230 +#: ../../library/sqlite3.rst:2232 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2232 +#: ../../library/sqlite3.rst:2234 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2809,15 +2817,15 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2283 +#: ../../library/sqlite3.rst:2285 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2285 +#: ../../library/sqlite3.rst:2287 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2287 +#: ../../library/sqlite3.rst:2289 msgid "" "import datetime\n" "import sqlite3\n" @@ -2855,11 +2863,11 @@ msgid "" "sqlite3.register_converter(\"timestamp\", convert_timestamp)" msgstr "" -#: ../../library/sqlite3.rst:2347 +#: ../../library/sqlite3.rst:2349 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2349 +#: ../../library/sqlite3.rst:2351 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -2871,7 +2879,7 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2358 +#: ../../library/sqlite3.rst:2360 msgid "" "# Create and fill the table.\n" "con = sqlite3.connect(\":memory:\")\n" @@ -2895,11 +2903,11 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2390 +#: ../../library/sqlite3.rst:2392 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2392 +#: ../../library/sqlite3.rst:2394 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -2911,21 +2919,21 @@ msgid "" "rolling back." msgstr "" -#: ../../library/sqlite3.rst:2403 +#: ../../library/sqlite3.rst:2405 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, or if :attr:`~Connection.autocommit` is ``True``, the context " "manager does nothing." msgstr "" -#: ../../library/sqlite3.rst:2408 +#: ../../library/sqlite3.rst:2410 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection. If you need a closing context manager, consider using :meth:" "`contextlib.closing`." msgstr "" -#: ../../library/sqlite3.rst:2412 +#: ../../library/sqlite3.rst:2414 msgid "" "con = sqlite3.connect(\":memory:\")\n" "con.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR " @@ -2949,19 +2957,19 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2442 +#: ../../library/sqlite3.rst:2444 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2444 +#: ../../library/sqlite3.rst:2446 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2446 +#: ../../library/sqlite3.rst:2448 msgid "Open a database in read-only mode:" msgstr "以唯讀模式開啟資料庫:" -#: ../../library/sqlite3.rst:2448 +#: ../../library/sqlite3.rst:2450 msgid "" ">>> con = sqlite3.connect(\"file:tutorial.db?mode=ro\", uri=True)\n" ">>> con.execute(\"CREATE TABLE readonly(data)\")\n" @@ -2975,13 +2983,13 @@ msgstr "" "OperationalError: attempt to write a readonly database\n" ">>> con.close()" -#: ../../library/sqlite3.rst:2456 +#: ../../library/sqlite3.rst:2458 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2459 +#: ../../library/sqlite3.rst:2461 msgid "" ">>> con = sqlite3.connect(\"file:nosuchdb.db?mode=rw\", uri=True)\n" "Traceback (most recent call last):\n" @@ -2991,11 +2999,11 @@ msgstr "" "Traceback (most recent call last):\n" "OperationalError: unable to open database file" -#: ../../library/sqlite3.rst:2466 +#: ../../library/sqlite3.rst:2468 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2468 +#: ../../library/sqlite3.rst:2470 msgid "" "db = \"file:mem1?mode=memory&cache=shared\"\n" "con1 = sqlite3.connect(db, uri=True)\n" @@ -3021,24 +3029,24 @@ msgstr "" "con1.close()\n" "con2.close()" -#: ../../library/sqlite3.rst:2482 +#: ../../library/sqlite3.rst:2484 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2491 +#: ../../library/sqlite3.rst:2493 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2493 +#: ../../library/sqlite3.rst:2495 msgid "" "By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" "class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." "Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" -#: ../../library/sqlite3.rst:2498 +#: ../../library/sqlite3.rst:2500 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -3046,7 +3054,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2503 +#: ../../library/sqlite3.rst:2505 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -3054,7 +3062,7 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2508 +#: ../../library/sqlite3.rst:2510 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = sqlite3.Row" @@ -3062,11 +3070,11 @@ msgstr "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = sqlite3.Row" -#: ../../library/sqlite3.rst:2513 +#: ../../library/sqlite3.rst:2515 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2515 +#: ../../library/sqlite3.rst:2517 msgid "" ">>> res = con.execute(\"SELECT 'Earth' AS name, 6378 AS radius\")\n" ">>> row = res.fetchone()\n" @@ -3081,7 +3089,7 @@ msgid "" ">>> con.close()" msgstr "" -#: ../../library/sqlite3.rst:2531 +#: ../../library/sqlite3.rst:2533 msgid "" "The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the " "above example. In such cases, SQLite returns a single row with columns " @@ -3089,13 +3097,13 @@ msgid "" "alias``." msgstr "" -#: ../../library/sqlite3.rst:2536 +#: ../../library/sqlite3.rst:2538 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2539 +#: ../../library/sqlite3.rst:2541 msgid "" "def dict_factory(cursor, row):\n" " fields = [column[0] for column in cursor.description]\n" @@ -3105,12 +3113,12 @@ msgstr "" " fields = [column[0] for column in cursor.description]\n" " return {key: value for key, value in zip(fields, row)}" -#: ../../library/sqlite3.rst:2545 +#: ../../library/sqlite3.rst:2547 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2547 +#: ../../library/sqlite3.rst:2549 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = dict_factory\n" @@ -3126,11 +3134,11 @@ msgstr "" "{'a': 1, 'b': 2}\n" ">>> con.close()" -#: ../../library/sqlite3.rst:2556 +#: ../../library/sqlite3.rst:2558 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2558 +#: ../../library/sqlite3.rst:2560 msgid "" "from collections import namedtuple\n" "\n" @@ -3146,11 +3154,11 @@ msgstr "" " cls = namedtuple(\"Row\", fields)\n" " return cls._make(row)" -#: ../../library/sqlite3.rst:2567 +#: ../../library/sqlite3.rst:2569 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2569 +#: ../../library/sqlite3.rst:2571 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = namedtuple_factory\n" @@ -3176,18 +3184,18 @@ msgstr "" "2\n" ">>> con.close()" -#: ../../library/sqlite3.rst:2583 +#: ../../library/sqlite3.rst:2585 msgid "" "With some adjustments, the above recipe can be adapted to use a :class:" "`~dataclasses.dataclass`, or any other custom class, instead of a :class:" "`~collections.namedtuple`." msgstr "" -#: ../../library/sqlite3.rst:2591 +#: ../../library/sqlite3.rst:2593 msgid "How to handle non-UTF-8 text encodings" msgstr "如何處理非 UTF-8 的文字編碼" -#: ../../library/sqlite3.rst:2593 +#: ../../library/sqlite3.rst:2595 msgid "" "By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with " "the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might " @@ -3195,7 +3203,7 @@ msgid "" "`~Connection.text_factory` to handle such cases." msgstr "" -#: ../../library/sqlite3.rst:2599 +#: ../../library/sqlite3.rst:2601 msgid "" "Because of SQLite's `flexible typing`_, it is not uncommon to encounter " "table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or " @@ -3206,39 +3214,39 @@ msgid "" "text using this :attr:`~Connection.text_factory`:" msgstr "" -#: ../../library/sqlite3.rst:2608 +#: ../../library/sqlite3.rst:2610 msgid "con.text_factory = lambda data: str(data, encoding=\"latin2\")" msgstr "con.text_factory = lambda data: str(data, encoding=\"latin2\")" -#: ../../library/sqlite3.rst:2612 +#: ../../library/sqlite3.rst:2614 msgid "" "For invalid UTF-8 or arbitrary data in stored in ``TEXT`` table columns, you " "can use the following technique, borrowed from the :ref:`unicode-howto`:" msgstr "" -#: ../../library/sqlite3.rst:2615 +#: ../../library/sqlite3.rst:2617 msgid "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" msgstr "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" -#: ../../library/sqlite3.rst:2621 +#: ../../library/sqlite3.rst:2623 msgid "" "The :mod:`!sqlite3` module API does not support strings containing " "surrogates." msgstr "" -#: ../../library/sqlite3.rst:2626 +#: ../../library/sqlite3.rst:2628 msgid ":ref:`unicode-howto`" msgstr ":ref:`unicode-howto`" -#: ../../library/sqlite3.rst:2632 +#: ../../library/sqlite3.rst:2634 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2638 +#: ../../library/sqlite3.rst:2640 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2640 +#: ../../library/sqlite3.rst:2642 msgid "" ":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " "database transactions are opened and closed. :ref:`sqlite3-transaction-" @@ -3246,24 +3254,24 @@ msgid "" "isolation-level` retains the pre-Python 3.12 behaviour." msgstr "" -#: ../../library/sqlite3.rst:2649 +#: ../../library/sqlite3.rst:2651 msgid "Transaction control via the ``autocommit`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2651 +#: ../../library/sqlite3.rst:2653 msgid "" "The recommended way of controlling transaction behaviour is through the :" "attr:`Connection.autocommit` attribute, which should preferably be set using " "the *autocommit* parameter of :func:`connect`." msgstr "" -#: ../../library/sqlite3.rst:2656 +#: ../../library/sqlite3.rst:2658 msgid "" "It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-" "compliant transaction control. This means:" msgstr "" -#: ../../library/sqlite3.rst:2660 +#: ../../library/sqlite3.rst:2662 msgid "" ":mod:`!sqlite3` ensures that a transaction is always open, so :func:" "`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " @@ -3272,21 +3280,21 @@ msgid "" "when opening transactions." msgstr "" -#: ../../library/sqlite3.rst:2665 +#: ../../library/sqlite3.rst:2667 msgid "Transactions should be committed explicitly using :meth:`!commit`." msgstr "" -#: ../../library/sqlite3.rst:2666 +#: ../../library/sqlite3.rst:2668 msgid "Transactions should be rolled back explicitly using :meth:`!rollback`." msgstr "" -#: ../../library/sqlite3.rst:2667 +#: ../../library/sqlite3.rst:2669 msgid "" "An implicit rollback is performed if the database is :meth:`~Connection." "close`-ed with pending changes." msgstr "" -#: ../../library/sqlite3.rst:2670 +#: ../../library/sqlite3.rst:2672 msgid "" "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " "mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " @@ -3295,25 +3303,25 @@ msgid "" "in_transaction` to query the low-level SQLite autocommit mode." msgstr "" -#: ../../library/sqlite3.rst:2678 +#: ../../library/sqlite3.rst:2680 msgid "" "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " "control behaviour to the :attr:`Connection.isolation_level` attribute. See :" "ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" -#: ../../library/sqlite3.rst:2687 +#: ../../library/sqlite3.rst:2689 msgid "Transaction control via the ``isolation_level`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2691 +#: ../../library/sqlite3.rst:2693 msgid "" "The recommended way of controlling transactions is via the :attr:" "`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" "autocommit`." msgstr "" -#: ../../library/sqlite3.rst:2695 +#: ../../library/sqlite3.rst:2697 msgid "" "If :attr:`Connection.autocommit` is set to :data:" "`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " @@ -3321,7 +3329,7 @@ msgid "" "Otherwise, :attr:`!isolation_level` has no effect." msgstr "" -#: ../../library/sqlite3.rst:2701 +#: ../../library/sqlite3.rst:2703 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -3335,7 +3343,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2714 +#: ../../library/sqlite3.rst:2716 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -3345,33 +3353,33 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2722 +#: ../../library/sqlite3.rst:2724 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2726 +#: ../../library/sqlite3.rst:2728 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:2730 +#: ../../library/sqlite3.rst:2732 msgid "" "The recommended way of controlling transactions is now via the :attr:" "`~Connection.autocommit` attribute." msgstr "" -#: ../../library/sqlite3.rst:1475 +#: ../../library/sqlite3.rst:1477 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/sqlite3.rst:1475 ../../library/sqlite3.rst:1476 +#: ../../library/sqlite3.rst:1477 ../../library/sqlite3.rst:1478 msgid "in SQL statements" msgstr "於 SQL 陳述式中" -#: ../../library/sqlite3.rst:1476 +#: ../../library/sqlite3.rst:1478 msgid ": (colon)" msgstr ": (冒號)" diff --git a/library/ssl.po b/library/ssl.po index adc4b3823df..9afef5dd0e5 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-28 00:15+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,20 +27,27 @@ msgid "**Source code:** :source:`Lib/ssl.py`" msgstr "**原始碼:**\\ :source:`Lib/ssl.py`" #: ../../library/ssl.rst:18 +#, fuzzy msgid "" "This module provides access to Transport Layer Security (often known as " "\"Secure Sockets Layer\") encryption and peer authentication facilities for " "network sockets, both client-side and server-side. This module uses the " -"OpenSSL library. It is available on all modern Unix systems, Windows, macOS, " -"and probably additional platforms, as long as OpenSSL is installed on that " -"platform." +"OpenSSL library." msgstr "" "這個模組向用戶端及伺服器端提供了對於網路 socket 的傳輸層安全性協定(或稱為" "「安全通訊協定 (Secure Sockets Layer)」)加密及身分驗證功能。這個模組使用 " "OpenSSL 套件,它可以在所有的 Unix 系統、Windows、macOS、以及其他任何可能的平" "台上使用,只要事先在該平台上安裝 OpenSSL。" -#: ../../library/ssl.rst:26 +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/ssl.rst:27 msgid "" "Some behavior may be platform dependent, since calls are made to the " "operating system socket APIs. The installed version of OpenSSL may also " @@ -50,7 +57,7 @@ msgstr "" "由於呼叫了作業系統的 socket APIs,有些行為會根據平台而有所不同。OpenSSL 的安" "裝版本也會對模組的運作產生影響。例如,OpenSSL 版本 1.1.1 附帶 TLSv1.3。" -#: ../../library/ssl.rst:32 +#: ../../library/ssl.rst:33 msgid "" "Don't use this module without reading the :ref:`ssl-security`. Doing so may " "lead to a false sense of security, as the default settings of the ssl module " @@ -59,7 +66,7 @@ msgstr "" "在使用此模組之前,請閱讀 :ref:`ssl-security`。如果不這樣做,可能會產生錯誤的" "安全性認知,因為 ssl 模組的預設設定未必適合你的應用程式。" -#: ../../library/ssl.rst:455 ../../library/ssl.rst:470 +#: ../../library/ssl.rst:456 ../../library/ssl.rst:471 #: ../../includes/wasm-notavail.rst:3 msgid "Availability" msgstr "可用性" @@ -72,7 +79,7 @@ msgstr "" "此模組在 WebAssembly 平台上不起作用或無法使用。更多資訊請參閱 :ref:`wasm-" "availability`。" -#: ../../library/ssl.rst:38 +#: ../../library/ssl.rst:39 msgid "" "This section documents the objects and functions in the ``ssl`` module; for " "more general information about TLS, SSL, and certificates, the reader is " @@ -81,7 +88,7 @@ msgstr "" "這個章節記錄了 ``ssl`` 模組的物件及函式;關於 TSL、SSL、以及憑證的更多資訊," "可以去參考此章節底部的「詳情」部分。" -#: ../../library/ssl.rst:42 +#: ../../library/ssl.rst:43 msgid "" "This module provides a class, :class:`ssl.SSLSocket`, which is derived from " "the :class:`socket.socket` type, and provides a socket-like wrapper that " @@ -99,7 +106,7 @@ msgstr "" "(cipher);和 :meth:`get_verified_chain`、:meth:`get_unverified_chain` 能用於" "取得憑證鏈。" -#: ../../library/ssl.rst:51 +#: ../../library/ssl.rst:52 msgid "" "For more sophisticated applications, the :class:`ssl.SSLContext` class helps " "manage settings and certificates, which can then be inherited by SSL sockets " @@ -109,11 +116,11 @@ msgstr "" "可以透過 :meth:`SSLContext.wrap_socket` 方法建立的 SSL socket 繼承這些設定和" "認證。" -#: ../../library/ssl.rst:55 +#: ../../library/ssl.rst:56 msgid "Updated to support linking with OpenSSL 1.1.0" msgstr "更新以支援與 OpenSSL 1.1.0 進行連結" -#: ../../library/ssl.rst:60 +#: ../../library/ssl.rst:61 msgid "" "OpenSSL 0.9.8, 1.0.0 and 1.0.1 are deprecated and no longer supported. In " "the future the ssl module will require at least OpenSSL 1.0.2 or 1.1.0." @@ -121,26 +128,26 @@ msgstr "" "OpenSSL 0.9.8, 1.0.0 及 1.0.1 版本已被棄用且不再支援。在未來 ssl 模組將需要至" "少 OpenSSL 1.0.2 版本或 1.1.0 版本。" -#: ../../library/ssl.rst:66 +#: ../../library/ssl.rst:67 msgid "" ":pep:`644` has been implemented. The ssl module requires OpenSSL 1.1.1 or " "newer." msgstr ":pep:`644` 已經被實作。ssl 模組需要 OpenSSL 1.1.1 以上的版本才能使用。" -#: ../../library/ssl.rst:69 +#: ../../library/ssl.rst:70 msgid "" "Use of deprecated constants and functions result in deprecation warnings." msgstr "使用已經被棄用的常數或函式將會導致棄用警示。" -#: ../../library/ssl.rst:73 +#: ../../library/ssl.rst:74 msgid "Functions, Constants, and Exceptions" msgstr "函式、常數與例外" -#: ../../library/ssl.rst:77 +#: ../../library/ssl.rst:78 msgid "Socket creation" msgstr "Socket 建立" -#: ../../library/ssl.rst:79 +#: ../../library/ssl.rst:80 msgid "" "Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext." "wrap_socket` method. The helper function :func:`create_default_context` " @@ -150,11 +157,11 @@ msgstr "" "助函式 :func:`create_default_context` 會回傳有安全預設設定的新語境 " "(context)。" -#: ../../library/ssl.rst:84 +#: ../../library/ssl.rst:85 msgid "Client socket example with default context and IPv4/IPv6 dual stack::" msgstr "使用預設語境及 IPv4/IPv6 雙協定堆疊的用戶端 socket 範例: ::" -#: ../../library/ssl.rst:86 +#: ../../library/ssl.rst:87 msgid "" "import socket\n" "import ssl\n" @@ -176,11 +183,11 @@ msgstr "" " with context.wrap_socket(sock, server_hostname=hostname) as ssock:\n" " print(ssock.version())" -#: ../../library/ssl.rst:97 +#: ../../library/ssl.rst:98 msgid "Client socket example with custom context and IPv4::" msgstr "使用自訂語境及 IPv4 的用戶端 socket範例: ::" -#: ../../library/ssl.rst:99 +#: ../../library/ssl.rst:100 msgid "" "hostname = 'www.python.org'\n" "# PROTOCOL_TLS_CLIENT requires valid cert chain and hostname\n" @@ -192,11 +199,11 @@ msgid "" " print(ssock.version())" msgstr "" -#: ../../library/ssl.rst:109 +#: ../../library/ssl.rst:110 msgid "Server socket example listening on localhost IPv4::" msgstr "在本地 IPv4 上監聽伺服器 socket 的範例: ::" -#: ../../library/ssl.rst:111 +#: ../../library/ssl.rst:112 msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\n" "context.load_cert_chain('/path/to/certchain.pem', '/path/to/private.key')\n" @@ -218,17 +225,17 @@ msgstr "" " conn, addr = ssock.accept()\n" " ..." -#: ../../library/ssl.rst:123 +#: ../../library/ssl.rst:124 msgid "Context creation" msgstr "語境建立" -#: ../../library/ssl.rst:125 +#: ../../library/ssl.rst:126 msgid "" "A convenience function helps create :class:`SSLContext` objects for common " "purposes." msgstr "一個可以幫忙建立出 :class:`SSLContext` 物件以用於一般目的的方便函式。" -#: ../../library/ssl.rst:131 +#: ../../library/ssl.rst:132 msgid "" "Return a new :class:`SSLContext` object with default settings for the given " "*purpose*. The settings are chosen by the :mod:`ssl` module, and usually " @@ -238,7 +245,7 @@ msgstr "" "回傳一個新的 :class:`SSLContext` 物件,使用給定 *purpose* 的預設值。這些設定" "是由 :mod:`ssl` 選擇,通常比直接呼叫 :class:`SSLContext` 有更高的安全性。" -#: ../../library/ssl.rst:136 +#: ../../library/ssl.rst:137 msgid "" "*cafile*, *capath*, *cadata* represent optional CA certificates to trust for " "certificate verification, as in :meth:`SSLContext.load_verify_locations`. " @@ -252,7 +259,7 @@ msgstr "" # Skylull: `high encryption cipher` 可能是指 https://superuser.com/questions/1751902/how-to-check-which-ciphers-are-included-in-high-ciphers-constant # 其文中表示可能是指 128bit 以上 key length 的加密算法,需要其他來源佐證。 # 或是 https://help.fortinet.com/fweb/582/Content/FortiWeb/fortiweb-admin/supported_cipher_suites.htm#ssl_414712646_1189301 -#: ../../library/ssl.rst:142 +#: ../../library/ssl.rst:143 msgid "" "The settings are: :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` with " @@ -271,7 +278,7 @@ msgstr "" "個值有被設定時) 或使用預設的 CA 憑證 :meth:`SSLContext." "load_default_certs` 。" -#: ../../library/ssl.rst:151 +#: ../../library/ssl.rst:152 msgid "" "When :attr:`~SSLContext.keylog_filename` is supported and the environment " "variable :envvar:`SSLKEYLOGFILE` is set, :func:`create_default_context` " @@ -281,7 +288,7 @@ msgstr "" "`SSLKEYLOGFILE` 時 :func:`create_default_context` 會啟用密鑰日誌記錄 " "(logging)。" -#: ../../library/ssl.rst:155 +#: ../../library/ssl.rst:156 msgid "" "The default settings for this context include :data:" "`VERIFY_X509_PARTIAL_CHAIN` and :data:`VERIFY_X509_STRICT`. These make the " @@ -290,7 +297,7 @@ msgid "" "incompatibility with older X.509 certificates." msgstr "" -#: ../../library/ssl.rst:162 +#: ../../library/ssl.rst:163 msgid "" "The protocol, options, cipher and other settings may change to more " "restrictive values anytime without prior deprecation. The values represent " @@ -299,7 +306,7 @@ msgstr "" "協定、選項、加密方式和其它設定可以在不捨棄舊值的情況下直接更改成新的值,這些" "值代表了在相容性和安全性之間取得的合理平衡。" -#: ../../library/ssl.rst:166 +#: ../../library/ssl.rst:167 msgid "" "If your application needs specific settings, you should create a :class:" "`SSLContext` and apply the settings yourself." @@ -307,7 +314,7 @@ msgstr "" "如果你的應用程式需要特殊的設定,你應該要自行建立一個 :class:`SSLContext` 並自" "行調整設定。" -#: ../../library/ssl.rst:170 +#: ../../library/ssl.rst:171 msgid "" "If you find that when certain older clients or servers attempt to connect " "with a :class:`SSLContext` created by this function that they get an error " @@ -323,7 +330,7 @@ msgstr "" "SSL3.0 已經\\ `被完全破解 `_。如果你仍" "然希望在允許 SSL3.0 連線的情況下使用此函式,可以使用下面的方法: ::" -#: ../../library/ssl.rst:179 +#: ../../library/ssl.rst:180 msgid "" "ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)\n" "ctx.options &= ~ssl.OP_NO_SSLv3" @@ -331,7 +338,7 @@ msgstr "" "ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)\n" "ctx.options &= ~ssl.OP_NO_SSLv3" -#: ../../library/ssl.rst:183 +#: ../../library/ssl.rst:184 msgid "" "This context enables :data:`VERIFY_X509_STRICT` by default, which may reject " "pre-:rfc:`5280` or malformed certificates that the underlying OpenSSL " @@ -339,7 +346,7 @@ msgid "" "recommended, you can do so using::" msgstr "" -#: ../../library/ssl.rst:188 +#: ../../library/ssl.rst:189 msgid "" "ctx = ssl.create_default_context()\n" "ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" @@ -347,23 +354,23 @@ msgstr "" "ctx = ssl.create_default_context()\n" "ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" -#: ../../library/ssl.rst:195 +#: ../../library/ssl.rst:196 msgid "RC4 was dropped from the default cipher string." msgstr "把 RC4 從預設加密方法字串中捨棄。" -#: ../../library/ssl.rst:199 +#: ../../library/ssl.rst:200 msgid "ChaCha20/Poly1305 was added to the default cipher string." msgstr "把 ChaCha20/Poly1305 加入預設加密方法字串。" -#: ../../library/ssl.rst:201 +#: ../../library/ssl.rst:202 msgid "3DES was dropped from the default cipher string." msgstr "把 3DES 從預設加密方法字串中捨棄。" -#: ../../library/ssl.rst:205 +#: ../../library/ssl.rst:206 msgid "Support for key logging to :envvar:`SSLKEYLOGFILE` was added." msgstr "增加了 :envvar:`SSLKEYLOGFILE` 對密鑰日誌記錄 (logging) 的支援。" -#: ../../library/ssl.rst:209 +#: ../../library/ssl.rst:210 msgid "" "The context now uses :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER` protocol instead of generic :data:`PROTOCOL_TLS`." @@ -371,17 +378,17 @@ msgstr "" "目前語境使用 :data:`PROTOCOL_TLS_CLIENT` 協定或 :data:`PROTOCOL_TLS_SERVER` " "協定而非通用的 :data:`PROTOCOL_TLS`。" -#: ../../library/ssl.rst:215 +#: ../../library/ssl.rst:216 msgid "" "The context now uses :data:`VERIFY_X509_PARTIAL_CHAIN` and :data:" "`VERIFY_X509_STRICT` in its default verify flags." msgstr "" -#: ../../library/ssl.rst:220 +#: ../../library/ssl.rst:221 msgid "Exceptions" msgstr "例外" -#: ../../library/ssl.rst:224 +#: ../../library/ssl.rst:225 msgid "" "Raised to signal an error from the underlying SSL implementation (currently " "provided by the OpenSSL library). This signifies some problem in the higher-" @@ -395,11 +402,11 @@ msgstr "" "`OSError` 的一個子型別。:exc:`SSLError` 實例的錯誤程式代碼和訊息是由 OpenSSL " "函式庫提供。" -#: ../../library/ssl.rst:231 +#: ../../library/ssl.rst:232 msgid ":exc:`SSLError` used to be a subtype of :exc:`socket.error`." msgstr ":exc:`SSLError` 曾經是 :exc:`socket.error` 的一個子型別。" -#: ../../library/ssl.rst:236 +#: ../../library/ssl.rst:237 msgid "" "A string mnemonic designating the OpenSSL submodule in which the error " "occurred, such as ``SSL``, ``PEM`` or ``X509``. The range of possible " @@ -408,7 +415,7 @@ msgstr "" "一個字串符號 (string mnemonic),用來指定發生錯誤的 OpenSSL 子模組,如:" "``SSL``、``PEM`` 或 ``X509``。可能值的範圍取決於 OpenSSL 的版本。" -#: ../../library/ssl.rst:244 +#: ../../library/ssl.rst:245 msgid "" "A string mnemonic designating the reason this error occurred, for example " "``CERTIFICATE_VERIFY_FAILED``. The range of possible values depends on the " @@ -417,7 +424,7 @@ msgstr "" "一個字串符號,用來指定發生錯誤的原因,如:``CERTIFICATE_VERIFY_FAILED``。可能" "值的範圍取決於 OpenSSL 的版本。" -#: ../../library/ssl.rst:252 +#: ../../library/ssl.rst:253 msgid "" "A subclass of :exc:`SSLError` raised when trying to read or write and the " "SSL connection has been closed cleanly. Note that this doesn't mean that " @@ -426,7 +433,7 @@ msgstr "" "一個 :exc:`SSLError` 的子類別,當嘗試去讀寫已經被完全關閉的 SSL 連線時會被引" "發。請注意,這並不表示底層傳輸(例如 TCP)已經被關閉。" -#: ../../library/ssl.rst:260 +#: ../../library/ssl.rst:261 msgid "" "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be " @@ -435,7 +442,7 @@ msgstr "" "一個 :exc:`SSLError` 的子類別,當嘗試去讀寫資料前,底層 TCP 傳輸需要先接收更" "多資料時會由\\ :ref:`非阻塞的 SSL socket ` 引發該錯誤。" -#: ../../library/ssl.rst:269 +#: ../../library/ssl.rst:270 msgid "" "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be " @@ -444,7 +451,7 @@ msgstr "" "一個 :exc:`SSLError` 的子類別,當嘗試去讀寫資料前,底層 TCP 傳輸需要先發送更" "多資料時會由\\ :ref:`非阻塞的 SSL socket ` 引發該錯誤。" -#: ../../library/ssl.rst:278 +#: ../../library/ssl.rst:279 msgid "" "A subclass of :exc:`SSLError` raised when a system error was encountered " "while trying to fulfill an operation on a SSL socket. Unfortunately, there " @@ -453,7 +460,7 @@ msgstr "" "一個 :exc:`SSLError` 的子類別,當嘗試去操作 SSL socket 時有系統錯誤產生會引發" "此錯誤。不幸的是,目前沒有任何簡單的方法可以去檢查原本的的 errno 編號。" -#: ../../library/ssl.rst:286 +#: ../../library/ssl.rst:287 msgid "" "A subclass of :exc:`SSLError` raised when the SSL connection has been " "terminated abruptly. Generally, you shouldn't try to reuse the underlying " @@ -462,32 +469,32 @@ msgstr "" "一個 :exc:`SSLError` 的子類別,當 SSL 連線被突然終止時會引發此錯誤。通常,當" "此錯誤發生時,你不該再去重新使用底層傳輸。" -#: ../../library/ssl.rst:294 +#: ../../library/ssl.rst:295 msgid "" "A subclass of :exc:`SSLError` raised when certificate validation has failed." msgstr "當憑證驗證失敗時會引發的一個 :exc:`SSLError` 子類別。" -#: ../../library/ssl.rst:301 +#: ../../library/ssl.rst:302 msgid "A numeric error number that denotes the verification error." msgstr "一個表示驗證錯誤的錯誤數值編號。" -#: ../../library/ssl.rst:305 +#: ../../library/ssl.rst:306 msgid "A human readable string of the verification error." msgstr "一個人類可讀的驗證錯誤字串。" -#: ../../library/ssl.rst:309 +#: ../../library/ssl.rst:310 msgid "An alias for :exc:`SSLCertVerificationError`." msgstr ":exc:`SSLCertVerificationError` 的別名。" -#: ../../library/ssl.rst:311 +#: ../../library/ssl.rst:312 msgid "The exception is now an alias for :exc:`SSLCertVerificationError`." msgstr "此例外現在是 :exc:`SSLCertVerificationError` 的別名。" -#: ../../library/ssl.rst:316 +#: ../../library/ssl.rst:317 msgid "Random generation" msgstr "隨機產生" -#: ../../library/ssl.rst:320 +#: ../../library/ssl.rst:321 msgid "" "Return *num* cryptographically strong pseudo-random bytes. Raises an :class:" "`SSLError` if the PRNG has not been seeded with enough data or if the " @@ -500,11 +507,11 @@ msgstr "" "func:`RAND_status` 函式可以用來檢查 PRNG 函式,而 :func:`RAND_add` 則可以用來" "為 PRNG 設定隨機種子。" -#: ../../library/ssl.rst:326 +#: ../../library/ssl.rst:327 msgid "For almost all applications :func:`os.urandom` is preferable." msgstr "在幾乎所有的應用程式中,:func:`os.urandom` 會是較好的選擇。" -#: ../../library/ssl.rst:328 +#: ../../library/ssl.rst:329 msgid "" "Read the Wikipedia article, `Cryptographically secure pseudorandom number " "generator (CSPRNG) `_\\ 文章來了" "解密碼學安全偽隨機數產生器的需求。" -#: ../../library/ssl.rst:337 +#: ../../library/ssl.rst:338 msgid "" "Return ``True`` if the SSL pseudo-random number generator has been seeded " "with 'enough' randomness, and ``False`` otherwise. You can use :func:`ssl." @@ -526,7 +533,7 @@ msgstr "" "``True`` ,否則回傳 ``False``。你可以使用 :func:`ssl.RAND_egd` 函式和 :func:" "`ssl.RAND_add` 函式來增加偽隨機數產生器的隨機性。" -#: ../../library/ssl.rst:344 +#: ../../library/ssl.rst:345 msgid "" "Mix the given *bytes* into the SSL pseudo-random number generator. The " "parameter *entropy* (a float) is a lower bound on the entropy contained in " @@ -537,15 +544,15 @@ msgstr "" "指字串中包含熵值的下限(因此你可以將其設為 ``0.0``\\ )。請參閱 :rfc:`1750` " "了解有關熵源的更多資訊。" -#: ../../library/ssl.rst:349 +#: ../../library/ssl.rst:350 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "可寫入的\\ :term:`類位元組物件 `\\ 現在可被接受。" -#: ../../library/ssl.rst:353 +#: ../../library/ssl.rst:354 msgid "Certificate handling" msgstr "認證處理" -#: ../../library/ssl.rst:361 +#: ../../library/ssl.rst:362 msgid "" "Return the time in seconds since the Epoch, given the ``cert_time`` string " "representing the \"notBefore\" or \"notAfter\" date from a certificate in " @@ -555,11 +562,11 @@ msgstr "" "\"notAfter\" 日期,字串採用 ``\"%b %d %H:%M:%S %Y %Z\"`` 格式(C 語言區域設" "定)。" -#: ../../library/ssl.rst:366 +#: ../../library/ssl.rst:367 msgid "Here's an example:" msgstr "以下是一個範例:" -#: ../../library/ssl.rst:368 +#: ../../library/ssl.rst:369 msgid "" ">>> import ssl\n" ">>> timestamp = ssl.cert_time_to_seconds(\"Jan 5 09:34:43 2018 GMT\")\n" @@ -577,11 +584,11 @@ msgstr "" ">>> print(datetime.utcfromtimestamp(timestamp))\n" "2018-01-05 09:34:43" -#: ../../library/ssl.rst:378 +#: ../../library/ssl.rst:379 msgid "\"notBefore\" or \"notAfter\" dates must use GMT (:rfc:`5280`)." msgstr "\"notBefore\" 或 \"notAfter\" 日期必須使用 GMT (:rfc:`5280`)。" -#: ../../library/ssl.rst:380 +#: ../../library/ssl.rst:381 msgid "" "Interpret the input time as a time in UTC as specified by 'GMT' timezone in " "the input string. Local timezone was used previously. Return an integer (no " @@ -590,7 +597,7 @@ msgstr "" "將輸入的時間直譯為 UTC 時間,如輸入字串中指定的 'GMT' 時區。在之前是使用本地" "的時區。回傳一個整數(在輸入格式中不包括秒的小數部分)。" -#: ../../library/ssl.rst:389 +#: ../../library/ssl.rst:390 msgid "" "Given the address ``addr`` of an SSL-protected server, as a (*hostname*, " "*port-number*) pair, fetches the server's certificate, and returns it as a " @@ -611,11 +618,11 @@ msgstr "" "組根憑證對伺服器憑證進行驗證,如果驗證失敗,呼叫將失敗。可以使用 ``timeout`` " "參數指定超時時間。" -#: ../../library/ssl.rst:400 +#: ../../library/ssl.rst:401 msgid "This function is now IPv6-compatible." msgstr "此函式現在是與 IPv6 相容的。" -#: ../../library/ssl.rst:403 +#: ../../library/ssl.rst:404 msgid "" "The default *ssl_version* is changed from :data:`PROTOCOL_SSLv3` to :data:" "`PROTOCOL_TLS` for maximum compatibility with modern servers." @@ -623,11 +630,11 @@ msgstr "" "預設的 *ssl_version* 已經從 :data:`PROTOCOL_SSLv3` 改為 :data:" "`PROTOCOL_TLS`,已確保與現今的伺服器有最大的相容性。" -#: ../../library/ssl.rst:407 +#: ../../library/ssl.rst:408 msgid "The *timeout* parameter was added." msgstr "新增 *timeout* 參數。" -#: ../../library/ssl.rst:412 +#: ../../library/ssl.rst:413 msgid "" "Given a certificate as a DER-encoded blob of bytes, returns a PEM-encoded " "string version of the same certificate." @@ -635,14 +642,14 @@ msgstr "" "給定一個以 DER 編碼的位元組 blob 作為憑證,回傳以 PEM 編碼字串版本的相同憑" "證。" -#: ../../library/ssl.rst:417 +#: ../../library/ssl.rst:418 msgid "" "Given a certificate as an ASCII PEM string, returns a DER-encoded sequence " "of bytes for that same certificate." msgstr "" "給定一個以 ASCII PEM 的字串作為憑證,回傳以 DER 編碼的位元組序列的相同憑證。" -#: ../../library/ssl.rst:422 +#: ../../library/ssl.rst:423 msgid "" "Returns a named tuple with paths to OpenSSL's default cafile and capath. The " "paths are the same as used by :meth:`SSLContext.set_default_verify_paths`. " @@ -652,39 +659,39 @@ msgstr "" "meth:`SSLContext.set_default_verify_paths` 使用的相同。回傳值是一個 :term:" "`named tuple` ``DefaultVerifyPaths``:" -#: ../../library/ssl.rst:427 +#: ../../library/ssl.rst:428 msgid "" ":attr:`cafile` - resolved path to cafile or ``None`` if the file doesn't " "exist," msgstr ":attr:`cafile` - 解析後的 cafile 路徑,如果檔案不存在則為 ``None``," -#: ../../library/ssl.rst:428 +#: ../../library/ssl.rst:429 msgid "" ":attr:`capath` - resolved path to capath or ``None`` if the directory " "doesn't exist," msgstr ":attr:`capath` - 解析後的 capath 路徑,如果目錄不存在則為 ``None``," -#: ../../library/ssl.rst:429 +#: ../../library/ssl.rst:430 msgid "" ":attr:`openssl_cafile_env` - OpenSSL's environment key that points to a " "cafile," msgstr ":attr:`openssl_cafile_env` - 指向 cafile 的 OpenSSL 環境密鑰," -#: ../../library/ssl.rst:430 +#: ../../library/ssl.rst:431 msgid ":attr:`openssl_cafile` - hard coded path to a cafile," msgstr ":attr:`openssl_cafile` - hard coded 的 cafile 路徑," -#: ../../library/ssl.rst:431 +#: ../../library/ssl.rst:432 msgid "" ":attr:`openssl_capath_env` - OpenSSL's environment key that points to a " "capath," msgstr ":attr:`openssl_capath_env` - 指向 capath 的 OpenSSL 環境密鑰," -#: ../../library/ssl.rst:432 +#: ../../library/ssl.rst:433 msgid ":attr:`openssl_capath` - hard coded path to a capath directory" msgstr ":attr:`openssl_capath` - hard coded 的 capath 目錄路徑" -#: ../../library/ssl.rst:438 +#: ../../library/ssl.rst:439 msgid "" "Retrieve certificates from Windows' system cert store. *store_name* may be " "one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert " @@ -693,7 +700,7 @@ msgstr "" "從 Windows 的系統憑證儲存庫中搜尋憑證。*store_name* 可以是 ``CA``、``ROOT`` " "或 ``MY`` 的其中一個。Windows 也可能會提供額外的憑證儲存庫。" -#: ../../library/ssl.rst:442 +#: ../../library/ssl.rst:443 msgid "" "The function returns a list of (cert_bytes, encoding_type, trust) tuples. " "The encoding_type specifies the encoding of cert_bytes. It is either :const:" @@ -706,12 +713,12 @@ msgstr "" "`x509_asn` 或是用來表示 PKCS#7 ASN.1 資料的 :const:`pkcs_7_asn`。Trust 通過一" "組 OIDS 來指定憑證的用途,或是如果憑證對所有用途都可以使用則回傳 ``True``。" -#: ../../library/ssl.rst:449 ../../library/ssl.rst:1609 -#: ../../library/ssl.rst:1909 +#: ../../library/ssl.rst:450 ../../library/ssl.rst:1610 +#: ../../library/ssl.rst:1910 msgid "Example::" msgstr "範例: ::" -#: ../../library/ssl.rst:451 +#: ../../library/ssl.rst:452 msgid "" ">>> ssl.enum_certificates(\"CA\")\n" "[(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),\n" @@ -721,7 +728,7 @@ msgstr "" "[(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),\n" " (b'data...', 'x509_asn', True)]" -#: ../../library/ssl.rst:461 +#: ../../library/ssl.rst:462 msgid "" "Retrieve CRLs from Windows' system cert store. *store_name* may be one of " "``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert stores, too." @@ -729,7 +736,7 @@ msgstr "" "從 Windows 的系統憑證儲存庫中搜尋 CRLs。*store_name* 可以是 ``CA``、``ROOT`` " "或 ``MY`` 的其中一個。Windows 也可能會提供額外的憑證儲存庫。" -#: ../../library/ssl.rst:465 +#: ../../library/ssl.rst:466 msgid "" "The function returns a list of (cert_bytes, encoding_type, trust) tuples. " "The encoding_type specifies the encoding of cert_bytes. It is either :const:" @@ -739,18 +746,18 @@ msgstr "" "指定了 cert_bytes 的編碼格式。它可以是用來表示 X.509 ASN.1 資料的 :const:" "`x509_asn` 或是用來表示 PKCS#7 ASN.1 資料的 :const:`pkcs_7_asn`。" -#: ../../library/ssl.rst:476 +#: ../../library/ssl.rst:477 msgid "Constants" msgstr "常數" -#: ../../library/ssl.rst:478 +#: ../../library/ssl.rst:479 msgid "" "All constants are now :class:`enum.IntEnum` or :class:`enum.IntFlag` " "collections." msgstr "" "所有的常數現在都是 :class:`enum.IntEnum` 或 :class:`enum.IntFlag` 的集合。" -#: ../../library/ssl.rst:484 +#: ../../library/ssl.rst:485 msgid "" "Possible value for :attr:`SSLContext.verify_mode`. Except for :const:" "`PROTOCOL_TLS_CLIENT`, it is the default mode. With client-side sockets, " @@ -761,7 +768,7 @@ msgstr "" "外,這是預設的模式。對於用戶端的 sockets,幾乎任何憑證都能被允許。驗證錯誤," "像是不被信任或是過期的憑證,會被忽略並不會中止 TLS/SSL 握手。" -#: ../../library/ssl.rst:490 +#: ../../library/ssl.rst:491 msgid "" "In server mode, no certificate is requested from the client, so the client " "does not send any for client cert authentication." @@ -769,11 +776,11 @@ msgstr "" "在伺服器模式下,不會從用戶端請求任何憑證,所以用戶端不用發送任何用於用戶端憑" "證身分驗證的憑證。" -#: ../../library/ssl.rst:493 ../../library/ssl.rst:2411 +#: ../../library/ssl.rst:494 ../../library/ssl.rst:2412 msgid "See the discussion of :ref:`ssl-security` below." msgstr "參閱下方 :ref:`ssl-security` 的討論。" -#: ../../library/ssl.rst:497 +#: ../../library/ssl.rst:498 msgid "" "Possible value for :attr:`SSLContext.verify_mode`. In client mode, :const:" "`CERT_OPTIONAL` has the same meaning as :const:`CERT_REQUIRED`. It is " @@ -783,7 +790,7 @@ msgstr "" "`CERT_OPTIONAL` 具有與 :const:`CERT_REQUIRED` 相同的含意。對於客戶端 sockets " "推薦改用 :const:`CERT_REQUIRED`。" -#: ../../library/ssl.rst:502 +#: ../../library/ssl.rst:503 msgid "" "In server mode, a client certificate request is sent to the client. The " "client may either ignore the request or send a certificate in order perform " @@ -795,7 +802,7 @@ msgstr "" "發送憑證來執行 TLS 用戶端憑證身分驗證。如果用戶端選擇發送憑證,則會對其進行驗" "證。任何驗證錯誤都會立刻終止 TLS 握手。" -#: ../../library/ssl.rst:508 ../../library/ssl.rst:527 +#: ../../library/ssl.rst:509 ../../library/ssl.rst:528 msgid "" "Use of this setting requires a valid set of CA certificates to be passed to :" "meth:`SSLContext.load_verify_locations`." @@ -803,7 +810,7 @@ msgstr "" "使用此設定需要將一組有效的 CA 憑證傳送給 :meth:`SSLContext." "load_verify_locations`。" -#: ../../library/ssl.rst:513 +#: ../../library/ssl.rst:514 msgid "" "Possible value for :attr:`SSLContext.verify_mode`. In this mode, " "certificates are required from the other side of the socket connection; an :" @@ -821,7 +828,7 @@ msgstr "" "`PROTOCOL_TLS_CLIENT` 會使用 :const:`CERT_REQUIRED` 並預設開啟 :attr:" "`~SSLContext.check_hostname`。" -#: ../../library/ssl.rst:523 +#: ../../library/ssl.rst:524 msgid "" "With server socket, this mode provides mandatory TLS client cert " "authentication. A client certificate request is sent to the client and the " @@ -830,11 +837,11 @@ msgstr "" "對於 socket 伺服器,此模式會提供強制的 TLS 用戶端憑證驗證。用戶端憑證請求會被" "發送給用戶端並且用戶端必須提供有效且被信任的憑證。" -#: ../../library/ssl.rst:532 +#: ../../library/ssl.rst:533 msgid ":class:`enum.IntEnum` collection of CERT_* constants." msgstr ":class:`enum.IntEnum` 為 CERT_* 常數的一個集合。" -#: ../../library/ssl.rst:538 +#: ../../library/ssl.rst:539 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, " "certificate revocation lists (CRLs) are not checked. By default OpenSSL does " @@ -843,7 +850,7 @@ msgstr "" ":attr:`SSLContext.verify_flags` 可能的值。在此模式下,不會檢查憑證吊銷列表 " "(CRLs)。預設的 OpenSSL 並不會請求及驗證 CRLs。" -#: ../../library/ssl.rst:546 +#: ../../library/ssl.rst:547 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the " "peer cert is checked but none of the intermediate CA certificates. The mode " @@ -856,7 +863,7 @@ msgstr "" "效的 CRL 簽名。如果沒有用 :attr:`SSLContext.load_verify_locations` 載入適當" "的 CRL,則會驗證失敗。" -#: ../../library/ssl.rst:556 +#: ../../library/ssl.rst:557 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, CRLs of " "all certificates in the peer cert chain are checked." @@ -864,7 +871,7 @@ msgstr "" ":attr:`SSLContext.verify_flags` 可能的值。在此模式下,會檢查對等憑證鍊中所有" "憑證的 CRLs。" -#: ../../library/ssl.rst:563 +#: ../../library/ssl.rst:564 msgid "" "Possible value for :attr:`SSLContext.verify_flags` to disable workarounds " "for broken X.509 certificates." @@ -872,13 +879,13 @@ msgstr "" ":attr:`SSLContext.verify_flags` 可能的值,用來禁用已損壞的 X.509 憑證的解決方" "法。" -#: ../../library/ssl.rst:570 +#: ../../library/ssl.rst:571 msgid "" "Possible value for :attr:`SSLContext.verify_flags` to enables proxy " "certificate verification." msgstr ":attr:`SSLContext.verify_flags` 可能的值,用來啟用憑證代理驗證。" -#: ../../library/ssl.rst:577 +#: ../../library/ssl.rst:578 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to " "prefer trusted certificates when building the trust chain to validate a " @@ -887,7 +894,7 @@ msgstr "" ":attr:`SSLContext.verify_flags` 可能的值。它指示 OpenSSL 在構建信任鍊來驗證憑" "證時會優先使用被信任的憑證。此旗標預設開啟。" -#: ../../library/ssl.rst:585 +#: ../../library/ssl.rst:586 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to " "accept intermediate CAs in the trust store to be treated as trust-anchors, " @@ -899,11 +906,11 @@ msgstr "" "間 CAs 作為信任錨,就像自簽名的根 CA 憑證。這樣就能去信任中間 CA 所頒發的憑" "證,而不一定非要去信任其祖先的根 CA。" -#: ../../library/ssl.rst:596 +#: ../../library/ssl.rst:597 msgid ":class:`enum.IntFlag` collection of VERIFY_* constants." msgstr ":class:`enum.IntFlag` 為 VERIFY_* 常數的其中一個集合。" -#: ../../library/ssl.rst:602 +#: ../../library/ssl.rst:603 msgid "" "Selects the highest protocol version that both the client and server " "support. Despite the name, this option can select both \"SSL\" and \"TLS\" " @@ -912,7 +919,7 @@ msgstr "" "選擇用戶端及伺服器均可以支援最高協定版本。儘管名稱只有 「TLS」,但實際上" "「SSL」和「TLS」均可以選擇。" -#: ../../library/ssl.rst:609 +#: ../../library/ssl.rst:610 msgid "" "TLS clients and servers require different default settings for secure " "communication. The generic TLS protocol constant is deprecated in favor of :" @@ -921,7 +928,7 @@ msgstr "" "TLS 的用戶端及伺服器端需要不同的預設值來實現安全通訊。通用的 TLS 協定常數已被" "廢除,並改用 :data:`PROTOCOL_TLS_CLIENT` 和 :data:`PROTOCOL_TLS_SERVER`。" -#: ../../library/ssl.rst:615 +#: ../../library/ssl.rst:616 msgid "" "Auto-negotiate the highest protocol version that both the client and server " "support, and configure the context client-side connections. The protocol " @@ -931,35 +938,35 @@ msgstr "" "自動協商用戶端和伺服器服務器都支援的最高協定版本,並配置用戶端語境連線。該協" "定預設啟用 :data:`CERT_REQUIRED` 和 :attr:`~SSLContext.check_hostname`。" -#: ../../library/ssl.rst:624 +#: ../../library/ssl.rst:625 msgid "" "Auto-negotiate the highest protocol version that both the client and server " "support, and configure the context server-side connections." msgstr "自動協商用戶端和伺服器都支援的最高協定版本,並配置用戶端語境連線。" -#: ../../library/ssl.rst:631 +#: ../../library/ssl.rst:632 msgid "Alias for :data:`PROTOCOL_TLS`." msgstr ":data:`PROTOCOL_TLS` 的別名。" -#: ../../library/ssl.rst:635 +#: ../../library/ssl.rst:636 msgid "Use :data:`PROTOCOL_TLS` instead." msgstr "請改用 :data:`PROTOCOL_TLS`。" -#: ../../library/ssl.rst:639 +#: ../../library/ssl.rst:640 msgid "Selects SSL version 3 as the channel encryption protocol." msgstr "選擇第三版的 SSL 做為通道加密協定。" -#: ../../library/ssl.rst:641 +#: ../../library/ssl.rst:642 msgid "" "This protocol is not available if OpenSSL is compiled with the ``no-ssl3`` " "option." msgstr "如果 OpenSSL 是用 ``no-ssl3`` 編譯的,則此項協定無法使用。" -#: ../../library/ssl.rst:646 +#: ../../library/ssl.rst:647 msgid "SSL version 3 is insecure. Its use is highly discouraged." msgstr "第三版的 SSL 是不安全的,強烈建議不要使用。" -#: ../../library/ssl.rst:650 +#: ../../library/ssl.rst:651 msgid "" "OpenSSL has deprecated all version specific protocols. Use the default " "protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT` with :" @@ -970,16 +977,16 @@ msgstr "" "`PROTOCOL_TLS_SERVER` 協定或帶有 :attr:`SSLContext.minimum_version` 和 :attr:" "`SSLContext.maximum_version` 的 :data:`PROTOCOL_TLS_CLIENT`。" -#: ../../library/ssl.rst:658 +#: ../../library/ssl.rst:659 msgid "Selects TLS version 1.0 as the channel encryption protocol." msgstr "選擇 1.0 版的 TLS 做為通道加密協定。" -#: ../../library/ssl.rst:662 ../../library/ssl.rst:673 -#: ../../library/ssl.rst:684 +#: ../../library/ssl.rst:663 ../../library/ssl.rst:674 +#: ../../library/ssl.rst:685 msgid "OpenSSL has deprecated all version specific protocols." msgstr "OpenSSL 已經將所有版本特定的協定棄用。" -#: ../../library/ssl.rst:666 +#: ../../library/ssl.rst:667 msgid "" "Selects TLS version 1.1 as the channel encryption protocol. Available only " "with openssl version 1.0.1+." @@ -987,7 +994,7 @@ msgstr "" "選擇 1.1 版的 TLS 做為通道加密協定。只有在 1.0.1 版本以上的 OpenSSL 才可以選" "用。" -#: ../../library/ssl.rst:677 +#: ../../library/ssl.rst:678 msgid "" "Selects TLS version 1.2 as the channel encryption protocol. Available only " "with openssl version 1.0.1+." @@ -995,7 +1002,7 @@ msgstr "" "選擇 1.2 版的 TLS 做為通道加密協定。只有在 1.0.1 版本以上的 OpenSSL 才可以選" "用。" -#: ../../library/ssl.rst:688 +#: ../../library/ssl.rst:689 msgid "" "Enables workarounds for various bugs present in other SSL implementations. " "This option is set by default. It does not necessarily set the same flags " @@ -1004,7 +1011,7 @@ msgstr "" "啟用對 SSL 實作時所產生的各種錯誤的緩解措施。此選項預設被設定。它不一定設定" "與 OpenSSL 的 ``SSL_OP_ALL`` 常數相同的旗標。" -#: ../../library/ssl.rst:696 +#: ../../library/ssl.rst:697 msgid "" "Prevents an SSLv2 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing SSLv2 as " @@ -1013,11 +1020,11 @@ msgstr "" "防止 SSLv2 連線。此選項只可以跟 :const:`PROTOCOL_TLS` 一起使用。它會防止同級 " "(peer)選用 SSLv2 做為協定版本。" -#: ../../library/ssl.rst:704 +#: ../../library/ssl.rst:705 msgid "SSLv2 is deprecated" msgstr "SSLv2 已被棄用" -#: ../../library/ssl.rst:708 +#: ../../library/ssl.rst:709 msgid "" "Prevents an SSLv3 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing SSLv3 as " @@ -1026,11 +1033,11 @@ msgstr "" "防止 SSLv3 連線。此選項只可以跟 :const:`PROTOCOL_TLS` 一起使用。它會防止同級" "選用 SSLv3 做為協定版本。" -#: ../../library/ssl.rst:716 +#: ../../library/ssl.rst:717 msgid "SSLv3 is deprecated" msgstr "SSLv3 已被棄用" -#: ../../library/ssl.rst:720 +#: ../../library/ssl.rst:721 msgid "" "Prevents a TLSv1 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1 as " @@ -1039,7 +1046,7 @@ msgstr "" "防止 TLSv1 連線。此選項只可以跟 :const:`PROTOCOL_TLS` 一起使用。它會防止同級" "選用 TLSv1 做為協定版本。" -#: ../../library/ssl.rst:726 +#: ../../library/ssl.rst:727 msgid "" "The option is deprecated since OpenSSL 1.1.0, use the new :attr:`SSLContext." "minimum_version` and :attr:`SSLContext.maximum_version` instead." @@ -1047,7 +1054,7 @@ msgstr "" "該選項自從 OpenSSL 1.1.0 以後已被棄用,請改用新的 :attr:`SSLContext." "minimum_version` 及 :attr:`SSLContext.maximum_version` 代替。" -#: ../../library/ssl.rst:733 +#: ../../library/ssl.rst:734 msgid "" "Prevents a TLSv1.1 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.1 as " @@ -1056,11 +1063,11 @@ msgstr "" "防止 TLSv1.1 連線。此選項只可以跟 :const:`PROTOCOL_TLS` 一起使用。它會防止同" "級選用 TLSv1.1 做為協定版本。只有 1.0.1 版後的 OpenSSL 版本才能使用。" -#: ../../library/ssl.rst:739 ../../library/ssl.rst:750 +#: ../../library/ssl.rst:740 ../../library/ssl.rst:751 msgid "The option is deprecated since OpenSSL 1.1.0." msgstr "此選項自 OpenSSL 1.1.0 版已被棄用。" -#: ../../library/ssl.rst:744 +#: ../../library/ssl.rst:745 msgid "" "Prevents a TLSv1.2 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.2 as " @@ -1069,7 +1076,7 @@ msgstr "" "防止 TLSv1.2 連線。此選項只可以跟 :const:`PROTOCOL_TLS` 一起使用。它會防止同" "級選用 TLSv1.2 做為協定版本。只有 1.0.1 版後的 OpenSSL 版本才能使用。" -#: ../../library/ssl.rst:755 +#: ../../library/ssl.rst:756 msgid "" "Prevents a TLSv1.3 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.3 as " @@ -1081,7 +1088,7 @@ msgstr "" "級選用 TLSv1.3 做為協定版本。TSL1.3 只適用於 1.1.1 版以後的 OpenSSL。當使用 " "Python 編譯舊版的 OpenSSL 時,該標志預設為 *0*。" -#: ../../library/ssl.rst:763 +#: ../../library/ssl.rst:764 msgid "" "The option is deprecated since OpenSSL 1.1.0. It was added to 2.7.15 and " "3.6.3 for backwards compatibility with OpenSSL 1.0.2." @@ -1089,7 +1096,7 @@ msgstr "" "此選項自 OpenSSL 1.1.0 以後已被棄用。它被添加到 2.7.15 和 3.6.3 中,以向後相" "容 OpenSSL 1.0.2。" -#: ../../library/ssl.rst:769 +#: ../../library/ssl.rst:770 msgid "" "Disable all renegotiation in TLSv1.2 and earlier. Do not send HelloRequest " "messages, and ignore renegotiation requests via ClientHello." @@ -1097,11 +1104,11 @@ msgstr "" "停用所有在 TLSv1.2 及更早版本的重協商 (renegotiation)。不發送 HelloRequest 訊" "息,並忽略通過 ClientHello 的重協商請求。" -#: ../../library/ssl.rst:772 +#: ../../library/ssl.rst:773 msgid "This option is only available with OpenSSL 1.1.0h and later." msgstr "此選項僅適用於 OpenSSL 1.1.0h 及更新版本。" -#: ../../library/ssl.rst:778 +#: ../../library/ssl.rst:779 msgid "" "Use the server's cipher ordering preference, rather than the client's. This " "option has no effect on client sockets and SSLv2 server sockets." @@ -1109,7 +1116,7 @@ msgstr "" "使用伺服器的加密方法名稱字串排序優先順序,而不是用戶端的。此選項並不會影響到" "用戶端及 SSLv2 伺服器的 sockets。" -#: ../../library/ssl.rst:785 +#: ../../library/ssl.rst:786 msgid "" "Prevents reuse of the same DH key for distinct SSL sessions. This improves " "forward secrecy but requires more computational resources. This option only " @@ -1118,7 +1125,7 @@ msgstr "" "防止對不同的 SSL 會談重複使用相同的 DH 密鑰。這會加強向前保密但需要更多的運算" "資源。此選項只適用於伺服器 sockets。" -#: ../../library/ssl.rst:793 +#: ../../library/ssl.rst:794 msgid "" "Prevents reuse of the same ECDH key for distinct SSL sessions. This " "improves forward secrecy but requires more computational resources. This " @@ -1127,7 +1134,7 @@ msgstr "" "防止對不同的 SSL 會談重複使用相同的 ECDH 密鑰。這會加強向前保密但需要更多的運" "算資源。此選項只適用於伺服器 sockets。" -#: ../../library/ssl.rst:801 +#: ../../library/ssl.rst:802 msgid "" "Send dummy Change Cipher Spec (CCS) messages in TLS 1.3 handshake to make a " "TLS 1.3 connection look more like a TLS 1.2 connection." @@ -1135,34 +1142,34 @@ msgstr "" "在 TLS 1.3 握手中發送虛擬的變更加密方法規範 (CCS) 消息,以使 TLS 1.3 連接看起" "來更像 TLS 1.2 連線。" -#: ../../library/ssl.rst:804 +#: ../../library/ssl.rst:805 msgid "This option is only available with OpenSSL 1.1.1 and later." msgstr "此選項僅適用於 OpenSSL 1.1.1 及更新版本。" -#: ../../library/ssl.rst:810 +#: ../../library/ssl.rst:811 msgid "" "Disable compression on the SSL channel. This is useful if the application " "protocol supports its own compression scheme." msgstr "" "在 SSL 通道上禁用壓縮。如果應用程序協定支援自己的壓縮方案,這會很有用。" -#: ../../library/ssl.rst:817 +#: ../../library/ssl.rst:818 msgid ":class:`enum.IntFlag` collection of OP_* constants." msgstr ":class:`enum.IntFlag` 為 OP_* 常數中的一個集合。" -#: ../../library/ssl.rst:821 +#: ../../library/ssl.rst:822 msgid "Prevent client side from requesting a session ticket." msgstr "防止用戶端請求會談票據。" -#: ../../library/ssl.rst:827 +#: ../../library/ssl.rst:828 msgid "Ignore unexpected shutdown of TLS connections." msgstr "忽略意外關閉的 TLS 連線。" -#: ../../library/ssl.rst:829 ../../library/ssl.rst:845 +#: ../../library/ssl.rst:830 ../../library/ssl.rst:846 msgid "This option is only available with OpenSSL 3.0.0 and later." msgstr "此選項僅適用於 OpenSSL 3.0.0 及更新版本。" -#: ../../library/ssl.rst:835 +#: ../../library/ssl.rst:836 msgid "" "Enable the use of the kernel TLS. To benefit from the feature, OpenSSL must " "have been compiled with support for it, and the negotiated cipher suites and " @@ -1173,7 +1180,7 @@ msgstr "" "的加密套件及擴充套件也必須被該功能支援 (該功能所支援的列表可能會因平台及核心" "而有所差異)。" -#: ../../library/ssl.rst:840 +#: ../../library/ssl.rst:841 msgid "" "Note that with enabled kernel TLS some cryptographic operations are " "performed by the kernel directly and not via any available OpenSSL " @@ -1184,13 +1191,13 @@ msgstr "" "的 OpenSSL 所提供的程序,而這可能並非你所想使用的,例如:當應用程式要求所有的" "加密操作由 FIPS 提供執行。" -#: ../../library/ssl.rst:851 +#: ../../library/ssl.rst:852 msgid "" "Allow legacy insecure renegotiation between OpenSSL and unpatched servers " "only." msgstr "只允許 OpenSSL 與未修補的伺服器進行遺留 (legacy) 不安全重協商。" -#: ../../library/ssl.rst:858 +#: ../../library/ssl.rst:859 msgid "" "Whether the OpenSSL library has built-in support for the *Application-Layer " "Protocol Negotiation* TLS extension as described in :rfc:`7301`." @@ -1198,7 +1205,7 @@ msgstr "" "OpenSSL 函式庫是否內建支援 *應用層協定協商* TLS 擴充套件,該擴充套件描述在 :" "rfc:`7301` 中。" -#: ../../library/ssl.rst:865 +#: ../../library/ssl.rst:866 msgid "" "Whether the OpenSSL library has built-in support not checking subject common " "name and :attr:`SSLContext.hostname_checks_common_name` is writeable." @@ -1206,7 +1213,7 @@ msgstr "" "OpenSSL 函式庫是否內建支援不檢查主題通用名稱及 :attr:`SSLContext." "hostname_checks_common_name` 是否可寫。" -#: ../../library/ssl.rst:873 +#: ../../library/ssl.rst:874 msgid "" "Whether the OpenSSL library has built-in support for the Elliptic Curve-" "based Diffie-Hellman key exchange. This should be true unless the feature " @@ -1215,7 +1222,7 @@ msgstr "" "OpenSSL 函式庫是否內建支援基於橢圓曲線的 (Elliptic Curve-based) Diffie-" "Hellman 金鑰交換。此回傳值應該要為 true 除非發布者明確禁用此功能。" -#: ../../library/ssl.rst:881 +#: ../../library/ssl.rst:882 msgid "" "Whether the OpenSSL library has built-in support for the *Server Name " "Indication* extension (as defined in :rfc:`6066`)." @@ -1223,7 +1230,7 @@ msgstr "" "OpenSSL 函式庫是否內建支援 *伺服器名稱提示* 擴充套件 (在 :rfc:`6066` 中定" "義)。" -#: ../../library/ssl.rst:888 +#: ../../library/ssl.rst:889 msgid "" "Whether the OpenSSL library has built-in support for the *Next Protocol " "Negotiation* as described in the `Application Layer Protocol Negotiation " @@ -1236,45 +1243,45 @@ msgstr "" "描述。當此值為 true 時,你可以使用 :meth:`SSLContext.set_npn_protocols` 方法" "來公告你想支援的協定。" -#: ../../library/ssl.rst:898 +#: ../../library/ssl.rst:899 msgid "" "Whether the OpenSSL library has built-in support for the SSL 2.0 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 SSL 2.0 協定。" -#: ../../library/ssl.rst:904 +#: ../../library/ssl.rst:905 msgid "" "Whether the OpenSSL library has built-in support for the SSL 3.0 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 SSL 3.0 協定。" -#: ../../library/ssl.rst:910 +#: ../../library/ssl.rst:911 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.0 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 TLS 1.0 協定。" -#: ../../library/ssl.rst:916 +#: ../../library/ssl.rst:917 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.1 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 TLS 1.1 協定。" -#: ../../library/ssl.rst:922 +#: ../../library/ssl.rst:923 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.2 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 TLS 1.2 協定。" -#: ../../library/ssl.rst:928 +#: ../../library/ssl.rst:929 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.3 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 TLS 1.3 協定。" -#: ../../library/ssl.rst:934 +#: ../../library/ssl.rst:935 msgid "Whether the OpenSSL library has built-in support for TLS-PSK." msgstr "此 OpenSSL 函式庫是否內建支援 TLS-PSK。" -#: ../../library/ssl.rst:940 +#: ../../library/ssl.rst:941 msgid "Whether the OpenSSL library has built-in support for TLS-PHA." msgstr "此 OpenSSL 函式庫是否內建支援 TLS-PHA。" -#: ../../library/ssl.rst:946 +#: ../../library/ssl.rst:947 msgid "" "List of supported TLS channel binding types. Strings in this list can be " "used as arguments to :meth:`SSLSocket.get_channel_binding`." @@ -1282,11 +1289,11 @@ msgstr "" "支援的 TLS 通道綁定類型列表。列表中的字串可以作為 :meth:`SSLSocket." "get_channel_binding` 的參數。" -#: ../../library/ssl.rst:953 +#: ../../library/ssl.rst:954 msgid "The version string of the OpenSSL library loaded by the interpreter::" msgstr "直譯器所加載的 OpenSSL 函式庫的版本字串::" -#: ../../library/ssl.rst:955 +#: ../../library/ssl.rst:956 msgid "" ">>> ssl.OPENSSL_VERSION\n" "'OpenSSL 1.0.2k 26 Jan 2017'" @@ -1294,13 +1301,13 @@ msgstr "" ">>> ssl.OPENSSL_VERSION\n" "'OpenSSL 1.0.2k 26 Jan 2017'" -#: ../../library/ssl.rst:962 +#: ../../library/ssl.rst:963 msgid "" "A tuple of five integers representing version information about the OpenSSL " "library::" msgstr "代表 OpenSSL 函式庫版本資訊的五個整數的元組: ::" -#: ../../library/ssl.rst:965 +#: ../../library/ssl.rst:966 msgid "" ">>> ssl.OPENSSL_VERSION_INFO\n" "(1, 0, 2, 11, 15)" @@ -1308,11 +1315,11 @@ msgstr "" ">>> ssl.OPENSSL_VERSION_INFO\n" "(1, 0, 2, 11, 15)" -#: ../../library/ssl.rst:972 +#: ../../library/ssl.rst:973 msgid "The raw version number of the OpenSSL library, as a single integer::" msgstr "OpenSSL 函式庫的初始版本,以單一整數表示::" -#: ../../library/ssl.rst:974 +#: ../../library/ssl.rst:975 msgid "" ">>> ssl.OPENSSL_VERSION_NUMBER\n" "268443839\n" @@ -1324,7 +1331,7 @@ msgstr "" ">>> hex(ssl.OPENSSL_VERSION_NUMBER)\n" "'0x100020bf'" -#: ../../library/ssl.rst:985 +#: ../../library/ssl.rst:986 msgid "" "Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry " "`_ 包" "含了此列表以及其含義定義所在的 RFC 的引用。" -#: ../../library/ssl.rst:989 +#: ../../library/ssl.rst:990 msgid "" "Used as the return value of the callback function in :meth:`SSLContext." "set_servername_callback`." msgstr "" "被用來做為 :meth:`SSLContext.set_servername_callback` 中回呼函式的回傳值。" -#: ../../library/ssl.rst:996 +#: ../../library/ssl.rst:997 msgid ":class:`enum.IntEnum` collection of ALERT_DESCRIPTION_* constants." msgstr ":class:`enum.IntEnum` 為 ALERT_DESCRIPTION_* 常數中的一個集合。" -#: ../../library/ssl.rst:1002 +#: ../../library/ssl.rst:1003 msgid "" "Option for :func:`create_default_context` and :meth:`SSLContext." "load_default_certs`. This value indicates that the context may be used to " @@ -1356,7 +1363,7 @@ msgstr "" ":func:`create_default_context` 和 :meth:`SSLContext.load_default_certs` 的選" "項。此值表示該語境可能會用於驗證網頁伺服器 (因此它將用於建立用戶端 socket)。" -#: ../../library/ssl.rst:1011 +#: ../../library/ssl.rst:1012 msgid "" "Option for :func:`create_default_context` and :meth:`SSLContext." "load_default_certs`. This value indicates that the context may be used to " @@ -1367,11 +1374,11 @@ msgstr "" "項。此值表示該語境可能會用於驗證網頁用戶端 (因此,它將用於建立伺服器端的 " "socket)。" -#: ../../library/ssl.rst:1020 +#: ../../library/ssl.rst:1021 msgid ":class:`enum.IntEnum` collection of SSL_ERROR_* constants." msgstr ":class:`enum.IntEnum` 為 SSL_ERROR_* 常數中的一個集合。" -#: ../../library/ssl.rst:1026 +#: ../../library/ssl.rst:1027 msgid "" ":class:`enum.IntEnum` collection of SSL and TLS versions for :attr:" "`SSLContext.maximum_version` and :attr:`SSLContext.minimum_version`." @@ -1379,7 +1386,7 @@ msgstr "" "用於 :attr:`SSLContext.maximum_version` 和 :attr:`SSLContext." "minimum_version` 的 SSL 和 TLS 版本 :class:`enum.IntEnum` 集合。" -#: ../../library/ssl.rst:1034 +#: ../../library/ssl.rst:1035 msgid "" "The minimum or maximum supported SSL or TLS version. These are magic " "constants. Their values don't reflect the lowest and highest available TLS/" @@ -1388,11 +1395,11 @@ msgstr "" "最低或最高支援的 SSL 或 TLS 版本。這些是特殊常數。它們的值並不反映可用的最低" "和最高 TLS/SSL 版本。" -#: ../../library/ssl.rst:1044 +#: ../../library/ssl.rst:1045 msgid "SSL 3.0 to TLS 1.3." msgstr "SSL 3.0 到 TLS 1.3。" -#: ../../library/ssl.rst:1048 +#: ../../library/ssl.rst:1049 msgid "" "All :class:`TLSVersion` members except :attr:`TLSVersion.TLSv1_2` and :attr:" "`TLSVersion.TLSv1_3` are deprecated." @@ -1400,47 +1407,47 @@ msgstr "" "除了 :attr:`TLSVersion.TLSv1_2` 和 :attr:`TLSVersion.TLSv1_3` 之外,所有的 :" "class:`TLSVersion` 成員都已被棄用。" -#: ../../library/ssl.rst:1053 +#: ../../library/ssl.rst:1054 msgid "SSL Sockets" msgstr "SSL Sockets" -#: ../../library/ssl.rst:1057 +#: ../../library/ssl.rst:1058 msgid "SSL sockets provide the following methods of :ref:`socket-objects`:" msgstr "SSL sockets 提供以下 :ref:`socket-objects` 方法:" -#: ../../library/ssl.rst:1059 +#: ../../library/ssl.rst:1060 msgid ":meth:`~socket.socket.accept`" msgstr ":meth:`~socket.socket.accept`" -#: ../../library/ssl.rst:1060 +#: ../../library/ssl.rst:1061 msgid ":meth:`~socket.socket.bind`" msgstr ":meth:`~socket.socket.bind`" -#: ../../library/ssl.rst:1061 +#: ../../library/ssl.rst:1062 msgid ":meth:`~socket.socket.close`" msgstr ":meth:`~socket.socket.close`" -#: ../../library/ssl.rst:1062 +#: ../../library/ssl.rst:1063 msgid ":meth:`~socket.socket.connect`" msgstr ":meth:`~socket.socket.connect`" -#: ../../library/ssl.rst:1063 +#: ../../library/ssl.rst:1064 msgid ":meth:`~socket.socket.detach`" msgstr ":meth:`~socket.socket.detach`" -#: ../../library/ssl.rst:1064 +#: ../../library/ssl.rst:1065 msgid ":meth:`~socket.socket.fileno`" msgstr ":meth:`~socket.socket.fileno`" -#: ../../library/ssl.rst:1065 +#: ../../library/ssl.rst:1066 msgid ":meth:`~socket.socket.getpeername`, :meth:`~socket.socket.getsockname`" msgstr ":meth:`~socket.socket.getpeername`、:meth:`~socket.socket.getsockname`" -#: ../../library/ssl.rst:1066 +#: ../../library/ssl.rst:1067 msgid ":meth:`~socket.socket.getsockopt`, :meth:`~socket.socket.setsockopt`" msgstr ":meth:`~socket.socket.getsockopt`、:meth:`~socket.socket.setsockopt`" -#: ../../library/ssl.rst:1067 +#: ../../library/ssl.rst:1068 msgid "" ":meth:`~socket.socket.gettimeout`, :meth:`~socket.socket.settimeout`, :meth:" "`~socket.socket.setblocking`" @@ -1448,15 +1455,15 @@ msgstr "" ":meth:`~socket.socket.gettimeout`、:meth:`~socket.socket.settimeout`、:meth:" "`~socket.socket.setblocking`" -#: ../../library/ssl.rst:1069 +#: ../../library/ssl.rst:1070 msgid ":meth:`~socket.socket.listen`" msgstr ":meth:`~socket.socket.listen`" -#: ../../library/ssl.rst:1070 +#: ../../library/ssl.rst:1071 msgid ":meth:`~socket.socket.makefile`" msgstr ":meth:`~socket.socket.makefile`" -#: ../../library/ssl.rst:1071 +#: ../../library/ssl.rst:1072 msgid "" ":meth:`~socket.socket.recv`, :meth:`~socket.socket.recv_into` (but passing a " "non-zero ``flags`` argument is not allowed)" @@ -1464,7 +1471,7 @@ msgstr "" ":meth:`~socket.socket.recv`、:meth:`~socket.socket.recv_into` (但不允許傳遞" "非零的 ``flags`` 引數)" -#: ../../library/ssl.rst:1073 +#: ../../library/ssl.rst:1074 msgid "" ":meth:`~socket.socket.send`, :meth:`~socket.socket.sendall` (with the same " "limitation)" @@ -1472,7 +1479,7 @@ msgstr "" ":meth:`~socket.socket.send`、:meth:`~socket.socket.sendall` (同樣不允許傳遞" "非零的 ``flags`` 引數)" -#: ../../library/ssl.rst:1075 +#: ../../library/ssl.rst:1076 msgid "" ":meth:`~socket.socket.sendfile` (but :mod:`os.sendfile` will be used for " "plain-text sockets only, else :meth:`~socket.socket.send` will be used)" @@ -1480,11 +1487,11 @@ msgstr "" ":meth:`~socket.socket.sendfile` (但 :mod:`os.sendfile` 只能用於純文本 " "sockets,其餘則會使用 :meth:`~socket.socket.send`)" -#: ../../library/ssl.rst:1077 +#: ../../library/ssl.rst:1078 msgid ":meth:`~socket.socket.shutdown`" msgstr ":meth:`~socket.socket.shutdown`" -#: ../../library/ssl.rst:1079 +#: ../../library/ssl.rst:1080 msgid "" "However, since the SSL (and TLS) protocol has its own framing atop of TCP, " "the SSL sockets abstraction can, in certain respects, diverge from the " @@ -1495,18 +1502,18 @@ msgstr "" "sockets 的抽象可能會與普通作業系統級別的 sockets 規範有所不同。特別是請參閱" "\\ :ref:`關於 non-blocking sockets 的說明 `。" -#: ../../library/ssl.rst:1084 +#: ../../library/ssl.rst:1085 msgid "" "Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext." "wrap_socket` method." msgstr "" ":class:`SSLSocket` 的實例必須使用 :meth:`SSLContext.wrap_socket` 方法建立。" -#: ../../library/ssl.rst:1087 +#: ../../library/ssl.rst:1088 msgid "The :meth:`sendfile` method was added." msgstr "新增 :meth:`sendfile` 方法。" -#: ../../library/ssl.rst:1090 +#: ../../library/ssl.rst:1091 msgid "" "The :meth:`shutdown` does not reset the socket timeout each time bytes are " "received or sent. The socket timeout is now the maximum total duration of " @@ -1515,7 +1522,7 @@ msgstr "" ":meth:`shutdown` 不會在每次接收或發送位元組時重置 socket 超時時間。現在," "socket 超時時間是關閉操作的最大總持續時間。" -#: ../../library/ssl.rst:1095 +#: ../../library/ssl.rst:1096 msgid "" "It is deprecated to create a :class:`SSLSocket` instance directly, use :meth:" "`SSLContext.wrap_socket` to wrap a socket." @@ -1523,7 +1530,7 @@ msgstr "" "直接建立 :class:`SSLSocket` 實例的方式已被棄用,請使用 :meth:`SSLContext." "wrap_socket` 來包裝 socket。" -#: ../../library/ssl.rst:1099 +#: ../../library/ssl.rst:1100 msgid "" ":class:`SSLSocket` instances must to created with :meth:`~SSLContext." "wrap_socket`. In earlier versions, it was possible to create instances " @@ -1532,7 +1539,7 @@ msgstr "" ":class:`SSLSocket` 實例必須使用 :meth:`~SSLContext.wrap_socket` 建立。在較早" "的版本中可以直接建立實例,但這從未被記錄或正式支援。" -#: ../../library/ssl.rst:1105 +#: ../../library/ssl.rst:1106 msgid "" "Python now uses ``SSL_read_ex`` and ``SSL_write_ex`` internally. The " "functions support reading and writing of data larger than 2 GB. Writing zero-" @@ -1541,11 +1548,11 @@ msgstr "" "Python 現在內部使用了 ``SSL_read_ex`` 和 ``SSL_write_ex`` 函式。這些函式支援" "讀取和寫入大於 2 GB 的資料。寫入零長度的資料不再會導致協定違規錯誤。" -#: ../../library/ssl.rst:1110 +#: ../../library/ssl.rst:1111 msgid "SSL sockets also have the following additional methods and attributes:" msgstr "SSL sockets 還具有以下附加方法和屬性:" -#: ../../library/ssl.rst:1114 +#: ../../library/ssl.rst:1115 msgid "" "Read up to *len* bytes of data from the SSL socket and return the result as " "a ``bytes`` instance. If *buffer* is specified, then read into the buffer " @@ -1554,7 +1561,7 @@ msgstr "" "從 SSL socket 讀取 *len* 位元組的資料,並將結果以 ``bytes`` 實例的形式回傳。" "如果指定了 *buffer*,則將資料讀入緩衝區,並回傳讀取的位元組。" -#: ../../library/ssl.rst:1118 +#: ../../library/ssl.rst:1119 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the read would block." @@ -1562,14 +1569,14 @@ msgstr "" "如果 socket 是\\ :ref:`非阻塞的 `\\ 則會引發 :exc:" "`SSLWantReadError` 或 :exc:`SSLWantWriteError` 並且讀取操作將會被阻塞。" -#: ../../library/ssl.rst:1121 +#: ../../library/ssl.rst:1122 msgid "" "As at any time a re-negotiation is possible, a call to :meth:`read` can also " "cause write operations." msgstr "" "由於在任何時刻都可能發生重新協商,呼叫 :meth:`read` 也可能觸發寫入操作。" -#: ../../library/ssl.rst:1124 +#: ../../library/ssl.rst:1125 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration to read up to *len* " @@ -1578,19 +1585,19 @@ msgstr "" "當接收或發送位元組時,socket 的超時時間將不再重置。現在,socket 超時時間是讀" "取最多 *len* 位元組的總最大持續時間。" -#: ../../library/ssl.rst:1129 +#: ../../library/ssl.rst:1130 msgid "Use :meth:`~SSLSocket.recv` instead of :meth:`~SSLSocket.read`." msgstr "請改用 :meth:`~SSLSocket.recv` 來替換掉 :meth:`~SSLSocket.read`。" -#: ../../library/ssl.rst:1134 +#: ../../library/ssl.rst:1135 msgid "" "Write *data* to the SSL socket and return the number of bytes written. The " "*data* argument must be an object supporting the buffer interface." msgstr "" -"將 *data* 寫入 SSL socket 並回傳寫入的位元組數量。*data* 引數必須是支援緩衝區介" -"面的物件。" +"將 *data* 寫入 SSL socket 並回傳寫入的位元組數量。*data* 引數必須是支援緩衝區" +"介面的物件。" -#: ../../library/ssl.rst:1137 +#: ../../library/ssl.rst:1138 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the write would block." @@ -1598,14 +1605,14 @@ msgstr "" "如果 socket 是\\ :ref:`非阻塞的 `\\ 則會引發 :exc:" "`SSLWantReadError` 或 :exc:`SSLWantWriteError` 並且寫入操作將會被阻塞。" -#: ../../library/ssl.rst:1140 +#: ../../library/ssl.rst:1141 msgid "" "As at any time a re-negotiation is possible, a call to :meth:`write` can " "also cause read operations." msgstr "" "由於在任何時刻都可能發生重新協商,呼叫 :meth:`write` 也可能觸發讀取操作。" -#: ../../library/ssl.rst:1143 +#: ../../library/ssl.rst:1144 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration to write *data*." @@ -1613,11 +1620,11 @@ msgstr "" "當接收或發送位元組時,socket 的超時時間將不再重置。現在,socket 超時時間是寫" "入 *data* 的總最大持續時間。" -#: ../../library/ssl.rst:1147 +#: ../../library/ssl.rst:1148 msgid "Use :meth:`~SSLSocket.send` instead of :meth:`~SSLSocket.write`." msgstr "請改用 :meth:`~SSLSocket.send` 來替換掉 :meth:`~SSLSocket.write`。" -#: ../../library/ssl.rst:1152 +#: ../../library/ssl.rst:1153 msgid "" "The :meth:`~SSLSocket.read` and :meth:`~SSLSocket.write` methods are the low-" "level methods that read and write unencrypted, application-level data and " @@ -1629,7 +1636,7 @@ msgstr "" "讀取和寫入未加密的應用層資料,並將其加密/解密為加密的寫入層資料。這些方法需要" "一個已建立的 SSL 連接,即握手已完成,且未呼叫 :meth:`SSLSocket.unwrap`。" -#: ../../library/ssl.rst:1158 +#: ../../library/ssl.rst:1159 msgid "" "Normally you should use the socket API methods like :meth:`~socket.socket." "recv` and :meth:`~socket.socket.send` instead of these methods." @@ -1637,18 +1644,18 @@ msgstr "" "通常你應該使用像 :meth:`~socket.socket.recv` 和 :meth:`~socket.socket.send` " "這樣的 socket API 方法,而不是直接使用這些方法。" -#: ../../library/ssl.rst:1164 +#: ../../library/ssl.rst:1165 msgid "Perform the SSL setup handshake." msgstr "執行 SSL 設定握手。" -#: ../../library/ssl.rst:1166 +#: ../../library/ssl.rst:1167 msgid "" "If *block* is true and the timeout obtained by :meth:`~socket.socket." "gettimeout` is zero, the socket is set in blocking mode until the handshake " "is performed." msgstr "" -#: ../../library/ssl.rst:1169 +#: ../../library/ssl.rst:1170 msgid "" "The handshake method also performs :func:`!match_hostname` when the :attr:" "`~SSLContext.check_hostname` attribute of the socket's :attr:`~SSLSocket." @@ -1657,7 +1664,7 @@ msgstr "" "當 socket 的 :attr:`~SSLSocket.context` 的 :attr:`~SSLContext." "check_hostname` 屬性質為 true 時,握手方法也會執行 :func:`!match_hostname`。" -#: ../../library/ssl.rst:1174 +#: ../../library/ssl.rst:1175 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration of the handshake." @@ -1665,18 +1672,18 @@ msgstr "" "Socket 超時時間已經不會在每次接收或傳送位元組時重置。現在,超時時間是握手過程" "的最大總持續時間。" -#: ../../library/ssl.rst:1178 +#: ../../library/ssl.rst:1179 msgid "" "Hostname or IP address is matched by OpenSSL during handshake. The function :" "func:`!match_hostname` is no longer used. In case OpenSSL refuses a hostname " "or IP address, the handshake is aborted early and a TLS alert message is " "sent to the peer." msgstr "" -"在握手過程中,OpenSSL 會去配對主機名稱或 IP 地址。已不再使用 :func:" -"`!match_hostname` 函式。如果 OpenSSL 拒絕某個主機名稱或 IP 地址,握手將會提前" -"中止,並向對方發送 TLS 警報訊息。" +"在握手過程中,OpenSSL 會去配對主機名稱或 IP 地址。已不再使用 :func:`!" +"match_hostname` 函式。如果 OpenSSL 拒絕某個主機名稱或 IP 地址,握手將會提前中" +"止,並向對方發送 TLS 警報訊息。" -#: ../../library/ssl.rst:1186 +#: ../../library/ssl.rst:1187 msgid "" "If there is no certificate for the peer on the other end of the connection, " "return ``None``. If the SSL handshake hasn't been done yet, raise :exc:" @@ -1685,7 +1692,7 @@ msgstr "" "如果連線端沒有證書,則回傳 ``None``。如果 SSL 握手尚未完成,則引發 :exc:" "`ValueError`。" -#: ../../library/ssl.rst:1190 +#: ../../library/ssl.rst:1191 msgid "" "If the ``binary_form`` parameter is :const:`False`, and a certificate was " "received from the peer, this method returns a :class:`dict` instance. If " @@ -1702,7 +1709,7 @@ msgstr "" "``issuer`` (簽發證書的主體)。如果證書中包含 *Subject Alternative Name* 擴充 " "(參考\\ :rfc:`3280`\\ ),字典中還會有一個 ``subjectAltName`` 鍵。" -#: ../../library/ssl.rst:1199 +#: ../../library/ssl.rst:1200 msgid "" "The ``subject`` and ``issuer`` fields are tuples containing the sequence of " "relative distinguished names (RDNs) given in the certificate's data " @@ -1713,7 +1720,7 @@ msgstr "" "names, RDNs) 序列的元組,這些 RDN 來自證書資料結構中的相應欄位。每個 RDN 都是" "一組名稱與值的對。以下是現實中的範例: ::" -#: ../../library/ssl.rst:1204 +#: ../../library/ssl.rst:1205 msgid "" "{'issuer': ((('countryName', 'IL'),),\n" " (('organizationName', 'StartCom Ltd.'),),\n" @@ -1755,7 +1762,7 @@ msgstr "" " 'subjectAltName': (('DNS', '*.eff.org'), ('DNS', 'eff.org')),\n" " 'version': 3}" -#: ../../library/ssl.rst:1223 +#: ../../library/ssl.rst:1224 msgid "" "If the ``binary_form`` parameter is :const:`True`, and a certificate was " "provided, this method returns the DER-encoded form of the entire certificate " @@ -1767,13 +1774,13 @@ msgstr "" "以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對等未提供證書,則回傳 :" "const:`None`。對等是否提供證書取決於 SSL socket 的腳色:" -#: ../../library/ssl.rst:1229 +#: ../../library/ssl.rst:1230 msgid "" "for a client SSL socket, the server will always provide a certificate, " "regardless of whether validation was required;" msgstr "對於用戶端 SSL socket,伺服器將永遠提供證書,無論是否需要進行驗證;" -#: ../../library/ssl.rst:1232 +#: ../../library/ssl.rst:1233 msgid "" "for a server SSL socket, the client will only provide a certificate when " "requested by the server; therefore :meth:`getpeercert` will return :const:" @@ -1784,41 +1791,41 @@ msgstr "" "是 :const:`CERT_NONE` (而非 :const:`CERT_OPTIONAL` 或 :const:" "`CERT_REQUIRED`),則 :meth:`getpeercert` 會回傳 :const:`None`。" -#: ../../library/ssl.rst:1237 +#: ../../library/ssl.rst:1238 msgid "See also :attr:`SSLContext.check_hostname`." msgstr "請見 :attr:`SSLContext.check_hostname`。" -#: ../../library/ssl.rst:1239 +#: ../../library/ssl.rst:1240 msgid "" "The returned dictionary includes additional items such as ``issuer`` and " "``notBefore``." msgstr "" -#: ../../library/ssl.rst:1243 +#: ../../library/ssl.rst:1244 msgid "" ":exc:`ValueError` is raised when the handshake isn't done. The returned " "dictionary includes additional X509v3 extension items such as " "``crlDistributionPoints``, ``caIssuers`` and ``OCSP`` URIs." msgstr "" -#: ../../library/ssl.rst:1248 +#: ../../library/ssl.rst:1249 msgid "IPv6 address strings no longer have a trailing new line." msgstr "" -#: ../../library/ssl.rst:1253 +#: ../../library/ssl.rst:1254 msgid "" "Returns verified certificate chain provided by the other end of the SSL " "channel as a list of DER-encoded bytes. If certificate verification was " "disabled method acts the same as :meth:`~SSLSocket.get_unverified_chain`." msgstr "" -#: ../../library/ssl.rst:1262 +#: ../../library/ssl.rst:1263 msgid "" "Returns raw certificate chain provided by the other end of the SSL channel " "as a list of DER-encoded bytes." msgstr "" -#: ../../library/ssl.rst:1269 +#: ../../library/ssl.rst:1270 msgid "" "Returns a three-value tuple containing the name of the cipher being used, " "the version of the SSL protocol that defines its use, and the number of " @@ -1826,7 +1833,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/ssl.rst:1275 +#: ../../library/ssl.rst:1276 msgid "" "Return the list of ciphers available in both the client and server. Each " "entry of the returned list is a three-value tuple containing the name of the " @@ -1836,25 +1843,25 @@ msgid "" "socket." msgstr "" -#: ../../library/ssl.rst:1286 +#: ../../library/ssl.rst:1287 msgid "" "Return the compression algorithm being used as a string, or ``None`` if the " "connection isn't compressed." msgstr "" -#: ../../library/ssl.rst:1289 +#: ../../library/ssl.rst:1290 msgid "" "If the higher-level protocol supports its own compression mechanism, you can " "use :data:`OP_NO_COMPRESSION` to disable SSL-level compression." msgstr "" -#: ../../library/ssl.rst:1296 +#: ../../library/ssl.rst:1297 msgid "" "Get channel binding data for current connection, as a bytes object. Returns " "``None`` if not connected or the handshake has not been completed." msgstr "" -#: ../../library/ssl.rst:1299 +#: ../../library/ssl.rst:1300 msgid "" "The *cb_type* parameter allow selection of the desired channel binding type. " "Valid channel binding types are listed in the :data:`CHANNEL_BINDING_TYPES` " @@ -1863,7 +1870,7 @@ msgid "" "channel binding type is requested." msgstr "" -#: ../../library/ssl.rst:1309 +#: ../../library/ssl.rst:1310 msgid "" "Return the protocol that was selected during the TLS handshake. If :meth:" "`SSLContext.set_alpn_protocols` was not called, if the other party does not " @@ -1871,7 +1878,7 @@ msgid "" "protocols, or if the handshake has not happened yet, ``None`` is returned." msgstr "" -#: ../../library/ssl.rst:1319 +#: ../../library/ssl.rst:1320 msgid "" "Return the higher-level protocol that was selected during the TLS/SSL " "handshake. If :meth:`SSLContext.set_npn_protocols` was not called, or if the " @@ -1879,11 +1886,11 @@ msgid "" "this will return ``None``." msgstr "" -#: ../../library/ssl.rst:1328 ../../library/ssl.rst:1697 +#: ../../library/ssl.rst:1329 ../../library/ssl.rst:1698 msgid "NPN has been superseded by ALPN" msgstr "" -#: ../../library/ssl.rst:1332 +#: ../../library/ssl.rst:1333 msgid "" "Performs the SSL shutdown handshake, which removes the TLS layer from the " "underlying socket, and returns the underlying socket object. This can be " @@ -1892,7 +1899,7 @@ msgid "" "other side of the connection, rather than the original socket." msgstr "" -#: ../../library/ssl.rst:1340 +#: ../../library/ssl.rst:1341 msgid "" "Requests post-handshake authentication (PHA) from a TLS 1.3 client. PHA can " "only be initiated for a TLS 1.3 connection from a server-side socket, after " @@ -1900,26 +1907,26 @@ msgid "" "`SSLContext.post_handshake_auth`." msgstr "" -#: ../../library/ssl.rst:1345 +#: ../../library/ssl.rst:1346 msgid "" "The method does not perform a cert exchange immediately. The server-side " "sends a CertificateRequest during the next write event and expects the " "client to respond with a certificate on the next read event." msgstr "" -#: ../../library/ssl.rst:1349 +#: ../../library/ssl.rst:1350 msgid "" "If any precondition isn't met (e.g. not TLS 1.3, PHA not enabled), an :exc:" "`SSLError` is raised." msgstr "" -#: ../../library/ssl.rst:1353 +#: ../../library/ssl.rst:1354 msgid "" "Only available with OpenSSL 1.1.1 and TLS 1.3 enabled. Without TLS 1.3 " "support, the method raises :exc:`NotImplementedError`." msgstr "" -#: ../../library/ssl.rst:1360 +#: ../../library/ssl.rst:1361 msgid "" "Return the actual SSL protocol version negotiated by the connection as a " "string, or ``None`` if no secure connection is established. As of this " @@ -1928,29 +1935,29 @@ msgid "" "may define more return values." msgstr "" -#: ../../library/ssl.rst:1370 +#: ../../library/ssl.rst:1371 msgid "" "Returns the number of already decrypted bytes available for read, pending on " "the connection." msgstr "" -#: ../../library/ssl.rst:1375 +#: ../../library/ssl.rst:1376 msgid "The :class:`SSLContext` object this SSL socket is tied to." msgstr "" -#: ../../library/ssl.rst:1381 +#: ../../library/ssl.rst:1382 msgid "" "A boolean which is ``True`` for server-side sockets and ``False`` for client-" "side sockets." msgstr "" -#: ../../library/ssl.rst:1388 +#: ../../library/ssl.rst:1389 msgid "" "Hostname of the server: :class:`str` type, or ``None`` for server-side " "socket or if the hostname was not specified in the constructor." msgstr "" -#: ../../library/ssl.rst:1393 +#: ../../library/ssl.rst:1394 msgid "" "The attribute is now always ASCII text. When ``server_hostname`` is an " "internationalized domain name (IDN), this attribute now stores the A-label " @@ -1958,7 +1965,7 @@ msgid "" "org\"``)." msgstr "" -#: ../../library/ssl.rst:1401 +#: ../../library/ssl.rst:1402 msgid "" "The :class:`SSLSession` for this SSL connection. The session is available " "for client and server side sockets after the TLS handshake has been " @@ -1966,11 +1973,11 @@ msgid "" "`~SSLSocket.do_handshake` has been called to reuse a session." msgstr "" -#: ../../library/ssl.rst:1414 +#: ../../library/ssl.rst:1415 msgid "SSL Contexts" msgstr "" -#: ../../library/ssl.rst:1418 +#: ../../library/ssl.rst:1419 msgid "" "An SSL context holds various data longer-lived than single SSL connections, " "such as SSL configuration options, certificate(s) and private key(s). It " @@ -1978,7 +1985,7 @@ msgid "" "speed up repeated connections from the same clients." msgstr "" -#: ../../library/ssl.rst:1425 +#: ../../library/ssl.rst:1426 msgid "" "Create a new SSL context. You may pass *protocol* which must be one of the " "``PROTOCOL_*`` constants defined in this module. The parameter specifies " @@ -1989,109 +1996,109 @@ msgid "" "provides the most compatibility with other versions." msgstr "" -#: ../../library/ssl.rst:1434 +#: ../../library/ssl.rst:1435 msgid "" "Here's a table showing which versions in a client (down the side) can " "connect to which versions in a server (along the top):" msgstr "" -#: ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1441 msgid "*client* / **server**" msgstr "*client* / **server**" -#: ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1441 msgid "**SSLv2**" msgstr "**SSLv2**" -#: ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1441 msgid "**SSLv3**" msgstr "**SSLv3**" -#: ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1441 msgid "**TLS** [3]_" msgstr "**TLS** [3]_" -#: ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1441 msgid "**TLSv1**" msgstr "**TLSv1**" -#: ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1441 msgid "**TLSv1.1**" msgstr "**TLSv1.1**" -#: ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1441 msgid "**TLSv1.2**" msgstr "**TLSv1.2**" -#: ../../library/ssl.rst:1442 +#: ../../library/ssl.rst:1443 msgid "*SSLv2*" msgstr "*SSLv2*" -#: ../../library/ssl.rst:1442 ../../library/ssl.rst:1443 -#: ../../library/ssl.rst:1444 ../../library/ssl.rst:1445 -#: ../../library/ssl.rst:1446 ../../library/ssl.rst:1447 +#: ../../library/ssl.rst:1443 ../../library/ssl.rst:1444 +#: ../../library/ssl.rst:1445 ../../library/ssl.rst:1446 +#: ../../library/ssl.rst:1447 ../../library/ssl.rst:1448 msgid "yes" msgstr "" -#: ../../library/ssl.rst:1442 ../../library/ssl.rst:1443 -#: ../../library/ssl.rst:1445 ../../library/ssl.rst:1446 -#: ../../library/ssl.rst:1447 +#: ../../library/ssl.rst:1443 ../../library/ssl.rst:1444 +#: ../../library/ssl.rst:1446 ../../library/ssl.rst:1447 +#: ../../library/ssl.rst:1448 msgid "no" msgstr "" -#: ../../library/ssl.rst:1442 ../../library/ssl.rst:1444 +#: ../../library/ssl.rst:1443 ../../library/ssl.rst:1445 msgid "no [1]_" msgstr "" -#: ../../library/ssl.rst:1443 +#: ../../library/ssl.rst:1444 msgid "*SSLv3*" msgstr "*SSLv3*" -#: ../../library/ssl.rst:1443 ../../library/ssl.rst:1444 +#: ../../library/ssl.rst:1444 ../../library/ssl.rst:1445 msgid "no [2]_" msgstr "" -#: ../../library/ssl.rst:1444 +#: ../../library/ssl.rst:1445 msgid "*TLS* (*SSLv23*) [3]_" msgstr "*TLS* (*SSLv23*) [3]_" -#: ../../library/ssl.rst:1445 +#: ../../library/ssl.rst:1446 msgid "*TLSv1*" msgstr "*TLSv1*" -#: ../../library/ssl.rst:1446 +#: ../../library/ssl.rst:1447 msgid "*TLSv1.1*" msgstr "*TLSv1.1*" -#: ../../library/ssl.rst:1447 +#: ../../library/ssl.rst:1448 msgid "*TLSv1.2*" msgstr "*TLSv1.2*" -#: ../../library/ssl.rst:1450 +#: ../../library/ssl.rst:1451 msgid "Footnotes" msgstr "註腳" -#: ../../library/ssl.rst:1451 +#: ../../library/ssl.rst:1452 msgid ":class:`SSLContext` disables SSLv2 with :data:`OP_NO_SSLv2` by default." msgstr ":class:`SSLContext` 預設會關閉 SSLv2 的 :data:`OP_NO_SSLv2`。" -#: ../../library/ssl.rst:1452 +#: ../../library/ssl.rst:1453 msgid ":class:`SSLContext` disables SSLv3 with :data:`OP_NO_SSLv3` by default." msgstr ":class:`SSLContext` 預設會關閉 SSLv3 的 :data:`OP_NO_SSLv3`。" -#: ../../library/ssl.rst:1453 +#: ../../library/ssl.rst:1454 msgid "" "TLS 1.3 protocol will be available with :data:`PROTOCOL_TLS` in OpenSSL >= " "1.1.1. There is no dedicated PROTOCOL constant for just TLS 1.3." msgstr "" -#: ../../library/ssl.rst:1458 +#: ../../library/ssl.rst:1459 msgid "" ":func:`create_default_context` lets the :mod:`ssl` module choose security " "settings for a given purpose." msgstr "" -#: ../../library/ssl.rst:1463 +#: ../../library/ssl.rst:1464 msgid "" "The context is created with secure default values. The options :data:" "`OP_NO_COMPRESSION`, :data:`OP_CIPHER_SERVER_PREFERENCE`, :data:" @@ -2101,14 +2108,14 @@ msgid "" "ciphers and no ``MD5`` ciphers." msgstr "" -#: ../../library/ssl.rst:1473 +#: ../../library/ssl.rst:1474 msgid "" ":class:`SSLContext` without protocol argument is deprecated. The context " "class will either require :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER` protocol in the future." msgstr "" -#: ../../library/ssl.rst:1479 +#: ../../library/ssl.rst:1480 msgid "" "The default cipher suites now include only secure AES and ChaCha20 ciphers " "with forward secrecy and security level 2. RSA and DH keys with less than " @@ -2117,7 +2124,7 @@ msgid "" "use TLS 1.2 as minimum TLS version." msgstr "" -#: ../../library/ssl.rst:1487 +#: ../../library/ssl.rst:1488 msgid "" ":class:`SSLContext` only supports limited mutation once it has been used by " "a connection. Adding new certificates to the internal trust store is " @@ -2125,29 +2132,29 @@ msgid "" "may result in surprising behavior." msgstr "" -#: ../../library/ssl.rst:1494 +#: ../../library/ssl.rst:1495 msgid "" ":class:`SSLContext` is designed to be shared and used by multiple " "connections. Thus, it is thread-safe as long as it is not reconfigured after " "being used by a connection." msgstr "" -#: ../../library/ssl.rst:1499 +#: ../../library/ssl.rst:1500 msgid ":class:`SSLContext` objects have the following methods and attributes:" msgstr ":class:`SSLContext` 物件具有以下方法和屬性:" -#: ../../library/ssl.rst:1503 +#: ../../library/ssl.rst:1504 msgid "" "Get statistics about quantities of loaded X.509 certificates, count of X.509 " "certificates flagged as CA certificates and certificate revocation lists as " "dictionary." msgstr "" -#: ../../library/ssl.rst:1507 +#: ../../library/ssl.rst:1508 msgid "Example for a context with one CA cert and one other cert::" msgstr "" -#: ../../library/ssl.rst:1509 +#: ../../library/ssl.rst:1510 msgid "" ">>> context.cert_store_stats()\n" "{'crl': 0, 'x509_ca': 1, 'x509': 2}" @@ -2155,7 +2162,7 @@ msgstr "" ">>> context.cert_store_stats()\n" "{'crl': 0, 'x509_ca': 1, 'x509': 2}" -#: ../../library/ssl.rst:1517 +#: ../../library/ssl.rst:1518 msgid "" "Load a private key and the corresponding certificate. The *certfile* string " "must be the path to a single file in PEM format containing the certificate " @@ -2166,7 +2173,7 @@ msgid "" "more information on how the certificate is stored in the *certfile*." msgstr "" -#: ../../library/ssl.rst:1526 +#: ../../library/ssl.rst:1527 msgid "" "The *password* argument may be a function to call to get the password for " "decrypting the private key. It will only be called if the private key is " @@ -2178,24 +2185,24 @@ msgid "" "encrypted and no password is needed." msgstr "" -#: ../../library/ssl.rst:1535 +#: ../../library/ssl.rst:1536 msgid "" "If the *password* argument is not specified and a password is required, " "OpenSSL's built-in password prompting mechanism will be used to " "interactively prompt the user for a password." msgstr "" -#: ../../library/ssl.rst:1539 +#: ../../library/ssl.rst:1540 msgid "" "An :class:`SSLError` is raised if the private key doesn't match with the " "certificate." msgstr "" -#: ../../library/ssl.rst:1542 +#: ../../library/ssl.rst:1543 msgid "New optional argument *password*." msgstr "新增可選引數 *password*。" -#: ../../library/ssl.rst:1547 +#: ../../library/ssl.rst:1548 msgid "" "Load a set of default \"certification authority\" (CA) certificates from " "default locations. On Windows it loads CA certs from the ``CA`` and ``ROOT`` " @@ -2204,7 +2211,7 @@ msgid "" "from other locations, too." msgstr "" -#: ../../library/ssl.rst:1553 +#: ../../library/ssl.rst:1554 msgid "" "The *purpose* flag specifies what kind of CA certificates are loaded. The " "default settings :const:`Purpose.SERVER_AUTH` loads certificates, that are " @@ -2213,35 +2220,35 @@ msgid "" "certificate verification on the server side." msgstr "" -#: ../../library/ssl.rst:1563 +#: ../../library/ssl.rst:1564 msgid "" "Load a set of \"certification authority\" (CA) certificates used to validate " "other peers' certificates when :data:`verify_mode` is other than :data:" "`CERT_NONE`. At least one of *cafile* or *capath* must be specified." msgstr "" -#: ../../library/ssl.rst:1567 +#: ../../library/ssl.rst:1568 msgid "" "This method can also load certification revocation lists (CRLs) in PEM or " "DER format. In order to make use of CRLs, :attr:`SSLContext.verify_flags` " "must be configured properly." msgstr "" -#: ../../library/ssl.rst:1571 +#: ../../library/ssl.rst:1572 msgid "" "The *cafile* string, if present, is the path to a file of concatenated CA " "certificates in PEM format. See the discussion of :ref:`ssl-certificates` " "for more information about how to arrange the certificates in this file." msgstr "" -#: ../../library/ssl.rst:1576 +#: ../../library/ssl.rst:1577 msgid "" "The *capath* string, if present, is the path to a directory containing " "several CA certificates in PEM format, following an `OpenSSL specific layout " "`_." msgstr "" -#: ../../library/ssl.rst:1581 +#: ../../library/ssl.rst:1582 msgid "" "The *cadata* object, if present, is either an ASCII string of one or more " "PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded " @@ -2249,11 +2256,11 @@ msgid "" "are ignored but at least one certificate must be present." msgstr "" -#: ../../library/ssl.rst:1586 +#: ../../library/ssl.rst:1587 msgid "New optional argument *cadata*" msgstr "新增可選引數 *cadata*" -#: ../../library/ssl.rst:1591 +#: ../../library/ssl.rst:1592 msgid "" "Get a list of loaded \"certification authority\" (CA) certificates. If the " "``binary_form`` parameter is :const:`False` each list entry is a dict like " @@ -2263,19 +2270,19 @@ msgid "" "a SSL connection." msgstr "" -#: ../../library/ssl.rst:1599 +#: ../../library/ssl.rst:1600 msgid "" "Certificates in a capath directory aren't loaded unless they have been used " "at least once." msgstr "" -#: ../../library/ssl.rst:1606 +#: ../../library/ssl.rst:1607 msgid "" "Get a list of enabled ciphers. The list is in order of cipher priority. See :" "meth:`SSLContext.set_ciphers`." msgstr "" -#: ../../library/ssl.rst:1611 +#: ../../library/ssl.rst:1612 msgid "" ">>> ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)\n" ">>> ctx.set_ciphers('ECDHE+AESGCM:!ECDSA')\n" @@ -2333,7 +2340,7 @@ msgstr "" " 'strength_bits': 128,\n" " 'symmetric': 'aes-128-gcm'}]" -#: ../../library/ssl.rst:1643 +#: ../../library/ssl.rst:1644 msgid "" "Load a set of default \"certification authority\" (CA) certificates from a " "filesystem path defined when building the OpenSSL library. Unfortunately, " @@ -2343,7 +2350,7 @@ msgid "" "configured properly." msgstr "" -#: ../../library/ssl.rst:1652 +#: ../../library/ssl.rst:1653 msgid "" "Set the available ciphers for sockets created with this context. It should " "be a string in the `OpenSSL cipher list format `_" msgstr "" -#: ../../library/ssl.rst:1791 +#: ../../library/ssl.rst:1792 msgid "Vincent Bernat." msgstr "" -#: ../../library/ssl.rst:1797 +#: ../../library/ssl.rst:1798 msgid "" "Wrap an existing Python socket *sock* and return an instance of :attr:" "`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The returned SSL " @@ -2535,13 +2542,13 @@ msgid "" "a :const:`~socket.SOCK_STREAM` socket; other socket types are unsupported." msgstr "" -#: ../../library/ssl.rst:1803 +#: ../../library/ssl.rst:1804 msgid "" "The parameter ``server_side`` is a boolean which identifies whether server-" "side or client-side behavior is desired from this socket." msgstr "" -#: ../../library/ssl.rst:1806 +#: ../../library/ssl.rst:1807 msgid "" "For client-side sockets, the context construction is lazy; if the underlying " "socket isn't connected yet, the context construction will be performed " @@ -2552,7 +2559,7 @@ msgid "" "exc:`SSLError`." msgstr "" -#: ../../library/ssl.rst:1814 +#: ../../library/ssl.rst:1815 msgid "" "On client connections, the optional parameter *server_hostname* specifies " "the hostname of the service which we are connecting to. This allows a " @@ -2561,7 +2568,7 @@ msgid "" "*server_hostname* will raise a :exc:`ValueError` if *server_side* is true." msgstr "" -#: ../../library/ssl.rst:1820 +#: ../../library/ssl.rst:1821 msgid "" "The parameter ``do_handshake_on_connect`` specifies whether to do the SSL " "handshake automatically after doing a :meth:`socket.connect`, or whether the " @@ -2571,7 +2578,7 @@ msgid "" "socket I/O involved in the handshake." msgstr "" -#: ../../library/ssl.rst:1827 +#: ../../library/ssl.rst:1828 msgid "" "The parameter ``suppress_ragged_eofs`` specifies how the :meth:`SSLSocket." "recv` method should signal unexpected EOF from the other end of the " @@ -2581,40 +2588,40 @@ msgid "" "exceptions back to the caller." msgstr "" -#: ../../library/ssl.rst:1834 +#: ../../library/ssl.rst:1835 msgid "*session*, see :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:1836 +#: ../../library/ssl.rst:1837 msgid "" "To wrap an :class:`SSLSocket` in another :class:`SSLSocket`, use :meth:" "`SSLContext.wrap_bio`." msgstr "" -#: ../../library/ssl.rst:1839 +#: ../../library/ssl.rst:1840 msgid "" "Always allow a server_hostname to be passed, even if OpenSSL does not have " "SNI." msgstr "" -#: ../../library/ssl.rst:1843 ../../library/ssl.rst:1870 +#: ../../library/ssl.rst:1844 ../../library/ssl.rst:1871 msgid "*session* argument was added." msgstr "新增 *session* 引數。" -#: ../../library/ssl.rst:1846 +#: ../../library/ssl.rst:1847 msgid "" "The method returns an instance of :attr:`SSLContext.sslsocket_class` instead " "of hard-coded :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1852 +#: ../../library/ssl.rst:1853 msgid "" "The return type of :meth:`SSLContext.wrap_socket`, defaults to :class:" "`SSLSocket`. The attribute can be assigned to on instances of :class:" "`SSLContext` in order to return a custom subclass of :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1862 +#: ../../library/ssl.rst:1863 msgid "" "Wrap the BIO objects *incoming* and *outgoing* and return an instance of :" "attr:`SSLContext.sslobject_class` (default :class:`SSLObject`). The SSL " @@ -2622,26 +2629,26 @@ msgid "" "outgoing BIO." msgstr "" -#: ../../library/ssl.rst:1867 +#: ../../library/ssl.rst:1868 msgid "" "The *server_side*, *server_hostname* and *session* parameters have the same " "meaning as in :meth:`SSLContext.wrap_socket`." msgstr "" -#: ../../library/ssl.rst:1873 +#: ../../library/ssl.rst:1874 msgid "" "The method returns an instance of :attr:`SSLContext.sslobject_class` instead " "of hard-coded :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1879 +#: ../../library/ssl.rst:1880 msgid "" "The return type of :meth:`SSLContext.wrap_bio`, defaults to :class:" "`SSLObject`. The attribute can be overridden on instance of class in order " "to return a custom subclass of :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1887 +#: ../../library/ssl.rst:1888 msgid "" "Get statistics about the SSL sessions created or managed by this context. A " "dictionary is returned which maps the names of each `piece of information " @@ -2650,7 +2657,7 @@ msgid "" "the session cache since the context was created::" msgstr "" -#: ../../library/ssl.rst:1892 +#: ../../library/ssl.rst:1893 msgid "" ">>> stats = context.session_stats()\n" ">>> stats['hits'], stats['misses']\n" @@ -2660,7 +2667,7 @@ msgstr "" ">>> stats['hits'], stats['misses']\n" "(0, 0)" -#: ../../library/ssl.rst:1898 +#: ../../library/ssl.rst:1899 msgid "" "Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. " "The context's :attr:`~SSLContext.verify_mode` must be set to :data:" @@ -2673,7 +2680,7 @@ msgid "" "With other protocols, hostname checking must be enabled explicitly." msgstr "" -#: ../../library/ssl.rst:1911 +#: ../../library/ssl.rst:1912 msgid "" "import socket, ssl\n" "\n" @@ -2697,7 +2704,7 @@ msgstr "" "ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com')\n" "ssl_sock.connect(('www.verisign.com', 443))" -#: ../../library/ssl.rst:1926 +#: ../../library/ssl.rst:1927 msgid "" ":attr:`~SSLContext.verify_mode` is now automatically changed to :data:" "`CERT_REQUIRED` when hostname checking is enabled and :attr:`~SSLContext." @@ -2705,7 +2712,7 @@ msgid "" "failed with a :exc:`ValueError`." msgstr "" -#: ../../library/ssl.rst:1933 +#: ../../library/ssl.rst:1934 msgid "" "Write TLS keys to a keylog file, whenever key material is generated or " "received. The keylog file is designed for debugging purposes only. The file " @@ -2714,7 +2721,7 @@ msgid "" "synchronized between threads, but not between processes." msgstr "" -#: ../../library/ssl.rst:1943 +#: ../../library/ssl.rst:1944 msgid "" "A :class:`TLSVersion` enum member representing the highest supported TLS " "version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The " @@ -2722,7 +2729,7 @@ msgid "" "const:`PROTOCOL_TLS_CLIENT`, and :const:`PROTOCOL_TLS_SERVER`." msgstr "" -#: ../../library/ssl.rst:1948 +#: ../../library/ssl.rst:1949 msgid "" "The attributes :attr:`~SSLContext.maximum_version`, :attr:`~SSLContext." "minimum_version` and :attr:`SSLContext.options` all affect the supported SSL " @@ -2732,38 +2739,38 @@ msgid "" "`TLSVersion.TLSv1_2` will not be able to establish a TLS 1.2 connection." msgstr "" -#: ../../library/ssl.rst:1961 +#: ../../library/ssl.rst:1962 msgid "" "Like :attr:`SSLContext.maximum_version` except it is the lowest supported " "version or :attr:`TLSVersion.MINIMUM_SUPPORTED`." msgstr "" -#: ../../library/ssl.rst:1968 +#: ../../library/ssl.rst:1969 msgid "" "Control the number of TLS 1.3 session tickets of a :const:" "`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS 1.0 to 1.2 " "connections." msgstr "" -#: ../../library/ssl.rst:1976 +#: ../../library/ssl.rst:1977 msgid "" "An integer representing the set of SSL options enabled on this context. The " "default value is :data:`OP_ALL`, but you can specify other options such as :" "data:`OP_NO_SSLv2` by ORing them together." msgstr "" -#: ../../library/ssl.rst:1980 +#: ../../library/ssl.rst:1981 msgid ":attr:`SSLContext.options` returns :class:`Options` flags:" msgstr ":attr:`SSLContext.options` 會回傳 :class:`Options` 旗標:" -#: ../../library/ssl.rst:1988 +#: ../../library/ssl.rst:1989 msgid "" "All ``OP_NO_SSL*`` and ``OP_NO_TLS*`` options have been deprecated since " "Python 3.7. Use :attr:`SSLContext.minimum_version` and :attr:`SSLContext." "maximum_version` instead." msgstr "" -#: ../../library/ssl.rst:1994 +#: ../../library/ssl.rst:1995 msgid "" "Enable TLS 1.3 post-handshake client authentication. Post-handshake auth is " "disabled by default and a server can only request a TLS client certificate " @@ -2771,13 +2778,13 @@ msgid "" "client certificate at any time after the handshake." msgstr "" -#: ../../library/ssl.rst:1999 +#: ../../library/ssl.rst:2000 msgid "" "When enabled on client-side sockets, the client signals the server that it " "supports post-handshake authentication." msgstr "" -#: ../../library/ssl.rst:2002 +#: ../../library/ssl.rst:2003 msgid "" "When enabled on server-side sockets, :attr:`SSLContext.verify_mode` must be " "set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, too. The actual " @@ -2785,66 +2792,66 @@ msgid "" "verify_client_post_handshake` is called and some I/O is performed." msgstr "" -#: ../../library/ssl.rst:2012 +#: ../../library/ssl.rst:2013 msgid "" "The protocol version chosen when constructing the context. This attribute " "is read-only." msgstr "" -#: ../../library/ssl.rst:2017 +#: ../../library/ssl.rst:2018 msgid "" "Whether :attr:`~SSLContext.check_hostname` falls back to verify the cert's " "subject common name in the absence of a subject alternative name extension " "(default: true)." msgstr "" -#: ../../library/ssl.rst:2025 +#: ../../library/ssl.rst:2026 msgid "" "The flag had no effect with OpenSSL before version 1.1.1l. Python 3.8.9, " "3.9.3, and 3.10 include workarounds for previous versions." msgstr "" -#: ../../library/ssl.rst:2030 +#: ../../library/ssl.rst:2031 msgid "" "An integer representing the `security level `_ for the context. This attribute is read-" "only." msgstr "" -#: ../../library/ssl.rst:2038 +#: ../../library/ssl.rst:2039 msgid "" "The flags for certificate verification operations. You can set flags like :" "data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL does " "neither require nor verify certificate revocation lists (CRLs)." msgstr "" -#: ../../library/ssl.rst:2044 +#: ../../library/ssl.rst:2045 msgid ":attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:" msgstr ":attr:`SSLContext.verify_flags` 會回傳 :class:`VerifyFlags` 旗標:" -#: ../../library/ssl.rst:2052 +#: ../../library/ssl.rst:2053 msgid "" "Whether to try to verify other peers' certificates and how to behave if " "verification fails. This attribute must be one of :data:`CERT_NONE`, :data:" "`CERT_OPTIONAL` or :data:`CERT_REQUIRED`." msgstr "" -#: ../../library/ssl.rst:2056 +#: ../../library/ssl.rst:2057 msgid ":attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum:" msgstr ":attr:`SSLContext.verify_mode` 會回傳 :class:`VerifyMode` 列舉:" -#: ../../library/ssl.rst:2064 +#: ../../library/ssl.rst:2065 msgid "" "Enables TLS-PSK (pre-shared key) authentication on a client-side connection." msgstr "" -#: ../../library/ssl.rst:2066 ../../library/ssl.rst:2115 +#: ../../library/ssl.rst:2067 ../../library/ssl.rst:2116 msgid "" "In general, certificate based authentication should be preferred over this " "method." msgstr "" -#: ../../library/ssl.rst:2068 +#: ../../library/ssl.rst:2069 msgid "" "The parameter ``callback`` is a callable object with the signature: ``def " "callback(hint: str | None) -> tuple[str | None, bytes]``. The ``hint`` " @@ -2856,27 +2863,27 @@ msgid "" "shared key. Return a zero length PSK to reject the connection." msgstr "" -#: ../../library/ssl.rst:2078 ../../library/ssl.rst:2124 +#: ../../library/ssl.rst:2079 ../../library/ssl.rst:2125 msgid "Setting ``callback`` to :const:`None` removes any existing callback." msgstr "" -#: ../../library/ssl.rst:2081 +#: ../../library/ssl.rst:2082 msgid "When using TLS 1.3:" msgstr "使用 TLS 1.3 時:" -#: ../../library/ssl.rst:2083 +#: ../../library/ssl.rst:2084 msgid "the ``hint`` parameter is always :const:`None`." msgstr "``hint`` 參數始終為 :const:`None`。" -#: ../../library/ssl.rst:2084 +#: ../../library/ssl.rst:2085 msgid "client-identity must be a non-empty string." msgstr "" -#: ../../library/ssl.rst:2086 ../../library/ssl.rst:2133 +#: ../../library/ssl.rst:2087 ../../library/ssl.rst:2134 msgid "Example usage::" msgstr "範例用法: ::" -#: ../../library/ssl.rst:2088 +#: ../../library/ssl.rst:2089 msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" "context.check_hostname = False\n" @@ -2897,18 +2904,18 @@ msgid "" "context.set_psk_client_callback(callback)" msgstr "" -#: ../../library/ssl.rst:2106 ../../library/ssl.rst:2151 +#: ../../library/ssl.rst:2107 ../../library/ssl.rst:2152 msgid "" "This method will raise :exc:`NotImplementedError` if :data:`HAS_PSK` is " "``False``." msgstr "" -#: ../../library/ssl.rst:2113 +#: ../../library/ssl.rst:2114 msgid "" "Enables TLS-PSK (pre-shared key) authentication on a server-side connection." msgstr "" -#: ../../library/ssl.rst:2117 +#: ../../library/ssl.rst:2118 msgid "" "The parameter ``callback`` is a callable object with the signature: ``def " "callback(identity: str | None) -> bytes``. The ``identity`` parameter is an " @@ -2918,19 +2925,19 @@ msgid "" "connection." msgstr "" -#: ../../library/ssl.rst:2126 +#: ../../library/ssl.rst:2127 msgid "" "The parameter ``identity_hint`` is an optional identity hint string sent to " "the client. The string must be less than or equal to ``256`` octets when " "UTF-8 encoded." msgstr "" -#: ../../library/ssl.rst:2131 +#: ../../library/ssl.rst:2132 msgid "" "When using TLS 1.3 the ``identity_hint`` parameter is not sent to the client." msgstr "" -#: ../../library/ssl.rst:2135 +#: ../../library/ssl.rst:2136 msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\n" "context.maximum_version = ssl.TLSVersion.TLSv1_2\n" @@ -2949,11 +2956,11 @@ msgid "" "context.set_psk_server_callback(callback, 'ServerId_1')" msgstr "" -#: ../../library/ssl.rst:2163 +#: ../../library/ssl.rst:2164 msgid "Certificates" msgstr "" -#: ../../library/ssl.rst:2165 +#: ../../library/ssl.rst:2166 msgid "" "Certificates in general are part of a public-key / private-key system. In " "this system, each *principal*, (which may be a machine, or a person, or an " @@ -2964,7 +2971,7 @@ msgid "" "other part, and **only** with the other part." msgstr "" -#: ../../library/ssl.rst:2173 +#: ../../library/ssl.rst:2174 msgid "" "A certificate contains information about two principals. It contains the " "name of a *subject*, and the subject's public key. It also contains a " @@ -2978,7 +2985,7 @@ msgid "" "as two fields, called \"notBefore\" and \"notAfter\"." msgstr "" -#: ../../library/ssl.rst:2183 +#: ../../library/ssl.rst:2184 msgid "" "In the Python use of certificates, a client or server can use a certificate " "to prove who they are. The other side of a network connection can also be " @@ -2991,14 +2998,14 @@ msgid "" "take place." msgstr "" -#: ../../library/ssl.rst:2193 +#: ../../library/ssl.rst:2194 msgid "" "Python uses files to contain certificates. They should be formatted as " "\"PEM\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a " "header line and a footer line::" msgstr "" -#: ../../library/ssl.rst:2197 +#: ../../library/ssl.rst:2198 msgid "" "-----BEGIN CERTIFICATE-----\n" "... (certificate in base64 PEM encoding) ...\n" @@ -3008,11 +3015,11 @@ msgstr "" "... (certificate in base64 PEM encoding) ...\n" "-----END CERTIFICATE-----" -#: ../../library/ssl.rst:2202 +#: ../../library/ssl.rst:2203 msgid "Certificate chains" msgstr "" -#: ../../library/ssl.rst:2204 +#: ../../library/ssl.rst:2205 msgid "" "The Python files which contain certificates can contain a sequence of " "certificates, sometimes called a *certificate chain*. This chain should " @@ -3028,7 +3035,7 @@ msgid "" "agency which issued the certification authority's certificate::" msgstr "" -#: ../../library/ssl.rst:2217 +#: ../../library/ssl.rst:2218 msgid "" "-----BEGIN CERTIFICATE-----\n" "... (certificate for your server)...\n" @@ -3050,11 +3057,11 @@ msgstr "" "... (the root certificate for the CA's issuer)...\n" "-----END CERTIFICATE-----" -#: ../../library/ssl.rst:2228 +#: ../../library/ssl.rst:2229 msgid "CA certificates" msgstr "" -#: ../../library/ssl.rst:2230 +#: ../../library/ssl.rst:2231 msgid "" "If you are going to require validation of the other side of the connection's " "certificate, you need to provide a \"CA certs\" file, filled with the " @@ -3066,11 +3073,11 @@ msgid "" "create_default_context`." msgstr "" -#: ../../library/ssl.rst:2239 +#: ../../library/ssl.rst:2240 msgid "Combined key and certificate" msgstr "" -#: ../../library/ssl.rst:2241 +#: ../../library/ssl.rst:2242 msgid "" "Often the private key is stored in the same file as the certificate; in this " "case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain` " @@ -3078,7 +3085,7 @@ msgid "" "should come before the first certificate in the certificate chain::" msgstr "" -#: ../../library/ssl.rst:2247 +#: ../../library/ssl.rst:2248 msgid "" "-----BEGIN RSA PRIVATE KEY-----\n" "... (private key in base64 encoding) ...\n" @@ -3094,11 +3101,11 @@ msgstr "" "... (certificate in base64 PEM encoding) ...\n" "-----END CERTIFICATE-----" -#: ../../library/ssl.rst:2255 +#: ../../library/ssl.rst:2256 msgid "Self-signed certificates" msgstr "" -#: ../../library/ssl.rst:2257 +#: ../../library/ssl.rst:2258 msgid "" "If you are going to create a server that provides SSL-encrypted connection " "services, you will need to acquire a certificate for that service. There " @@ -3108,7 +3115,7 @@ msgid "" "package, using something like the following::" msgstr "" -#: ../../library/ssl.rst:2264 +#: ../../library/ssl.rst:2265 msgid "" "% openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout cert.pem\n" "Generating a 1024 bit RSA private key\n" @@ -3134,28 +3141,28 @@ msgid "" "%" msgstr "" -#: ../../library/ssl.rst:2286 +#: ../../library/ssl.rst:2287 msgid "" "The disadvantage of a self-signed certificate is that it is its own root " "certificate, and no one else will have it in their cache of known (and " "trusted) root certificates." msgstr "" -#: ../../library/ssl.rst:2292 +#: ../../library/ssl.rst:2293 msgid "Examples" msgstr "範例" -#: ../../library/ssl.rst:2295 +#: ../../library/ssl.rst:2296 msgid "Testing for SSL support" msgstr "" -#: ../../library/ssl.rst:2297 +#: ../../library/ssl.rst:2298 msgid "" "To test for the presence of SSL support in a Python installation, user code " "should use the following idiom::" msgstr "" -#: ../../library/ssl.rst:2300 +#: ../../library/ssl.rst:2301 msgid "" "try:\n" " import ssl\n" @@ -3165,27 +3172,27 @@ msgid "" " ... # do something that requires SSL support" msgstr "" -#: ../../library/ssl.rst:2308 +#: ../../library/ssl.rst:2309 msgid "Client-side operation" msgstr "" -#: ../../library/ssl.rst:2310 +#: ../../library/ssl.rst:2311 msgid "" "This example creates a SSL context with the recommended security settings " "for client sockets, including automatic certificate verification::" msgstr "" -#: ../../library/ssl.rst:2313 +#: ../../library/ssl.rst:2314 msgid ">>> context = ssl.create_default_context()" msgstr ">>> context = ssl.create_default_context()" -#: ../../library/ssl.rst:2315 +#: ../../library/ssl.rst:2316 msgid "" "If you prefer to tune security settings yourself, you might create a context " "from scratch (but beware that you might not get the settings right)::" msgstr "" -#: ../../library/ssl.rst:2319 +#: ../../library/ssl.rst:2320 msgid "" ">>> context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> context.load_verify_locations(\"/etc/ssl/certs/ca-bundle.crt\")" @@ -3193,14 +3200,14 @@ msgstr "" ">>> context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> context.load_verify_locations(\"/etc/ssl/certs/ca-bundle.crt\")" -#: ../../library/ssl.rst:2322 +#: ../../library/ssl.rst:2323 msgid "" "(this snippet assumes your operating system places a bundle of all CA " "certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an " "error and have to adjust the location)" msgstr "" -#: ../../library/ssl.rst:2326 +#: ../../library/ssl.rst:2327 msgid "" "The :data:`PROTOCOL_TLS_CLIENT` protocol configures the context for cert " "validation and hostname verification. :attr:`~SSLContext.verify_mode` is set " @@ -3208,7 +3215,7 @@ msgid "" "``True``. All other protocols create SSL contexts with insecure defaults." msgstr "" -#: ../../library/ssl.rst:2331 +#: ../../library/ssl.rst:2332 msgid "" "When you use the context to connect to a server, :const:`CERT_REQUIRED` and :" "attr:`~SSLContext.check_hostname` validate the server certificate: it " @@ -3217,7 +3224,7 @@ msgid "" "properties like validity and identity of the hostname::" msgstr "" -#: ../../library/ssl.rst:2337 +#: ../../library/ssl.rst:2338 msgid "" ">>> conn = context.wrap_socket(socket.socket(socket.AF_INET),\n" "... server_hostname=\"www.python.org\")\n" @@ -3227,21 +3234,21 @@ msgstr "" "... server_hostname=\"www.python.org\")\n" ">>> conn.connect((\"www.python.org\", 443))" -#: ../../library/ssl.rst:2341 +#: ../../library/ssl.rst:2342 msgid "You may then fetch the certificate::" msgstr "" -#: ../../library/ssl.rst:2343 +#: ../../library/ssl.rst:2344 msgid ">>> cert = conn.getpeercert()" msgstr ">>> cert = conn.getpeercert()" -#: ../../library/ssl.rst:2345 +#: ../../library/ssl.rst:2346 msgid "" "Visual inspection shows that the certificate does identify the desired " "service (that is, the HTTPS host ``www.python.org``)::" msgstr "" -#: ../../library/ssl.rst:2348 +#: ../../library/ssl.rst:2349 msgid "" ">>> pprint.pprint(cert)\n" "{'OCSP': ('http://ocsp.digicert.com',),\n" @@ -3331,13 +3338,13 @@ msgstr "" " ('DNS', 'id.python.org')),\n" " 'version': 3}" -#: ../../library/ssl.rst:2388 +#: ../../library/ssl.rst:2389 msgid "" "Now the SSL channel is established and the certificate verified, you can " "proceed to talk with the server::" msgstr "" -#: ../../library/ssl.rst:2391 +#: ../../library/ssl.rst:2392 msgid "" ">>> conn.sendall(b\"HEAD / HTTP/1.0\\r\\nHost: linuxfr.org\\r\\n\\r\\n\")\n" ">>> pprint.pprint(conn.recv(1024).split(b\"\\r\\n\"))\n" @@ -3379,11 +3386,11 @@ msgstr "" " b'',\n" " b'']" -#: ../../library/ssl.rst:2415 +#: ../../library/ssl.rst:2416 msgid "Server-side operation" msgstr "伺服器端操作" -#: ../../library/ssl.rst:2417 +#: ../../library/ssl.rst:2418 msgid "" "For server operation, typically you'll need to have a server certificate, " "and private key, each in a file. You'll first create a context holding the " @@ -3392,7 +3399,7 @@ msgid "" "start waiting for clients to connect::" msgstr "" -#: ../../library/ssl.rst:2423 +#: ../../library/ssl.rst:2424 msgid "" "import socket, ssl\n" "\n" @@ -3412,14 +3419,14 @@ msgstr "" "bindsocket.bind(('myaddr.example.com', 10023))\n" "bindsocket.listen(5)" -#: ../../library/ssl.rst:2432 +#: ../../library/ssl.rst:2433 msgid "" "When a client connects, you'll call :meth:`accept` on the socket to get the " "new socket from the other end, and use the context's :meth:`SSLContext." "wrap_socket` method to create a server-side SSL socket for the connection::" msgstr "" -#: ../../library/ssl.rst:2436 +#: ../../library/ssl.rst:2437 msgid "" "while True:\n" " newsocket, fromaddr = bindsocket.accept()\n" @@ -3439,13 +3446,13 @@ msgstr "" " connstream.shutdown(socket.SHUT_RDWR)\n" " connstream.close()" -#: ../../library/ssl.rst:2445 +#: ../../library/ssl.rst:2446 msgid "" "Then you'll read data from the ``connstream`` and do something with it till " "you are finished with the client (or the client is finished with you)::" msgstr "" -#: ../../library/ssl.rst:2448 +#: ../../library/ssl.rst:2449 msgid "" "def deal_with_client(connstream):\n" " data = connstream.recv(1024)\n" @@ -3459,7 +3466,7 @@ msgid "" " # finished with client" msgstr "" -#: ../../library/ssl.rst:2459 +#: ../../library/ssl.rst:2460 msgid "" "And go back to listening for new client connections (of course, a real " "server would probably handle each client connection in a separate thread, or " @@ -3467,18 +3474,18 @@ msgid "" "event loop)." msgstr "" -#: ../../library/ssl.rst:2467 +#: ../../library/ssl.rst:2468 msgid "Notes on non-blocking sockets" msgstr "" -#: ../../library/ssl.rst:2469 +#: ../../library/ssl.rst:2470 msgid "" "SSL sockets behave slightly different than regular sockets in non-blocking " "mode. When working with non-blocking sockets, there are thus several things " "you need to be aware of:" msgstr "" -#: ../../library/ssl.rst:2473 +#: ../../library/ssl.rst:2474 msgid "" "Most :class:`SSLSocket` methods will raise either :exc:`SSLWantWriteError` " "or :exc:`SSLWantReadError` instead of :exc:`BlockingIOError` if an I/O " @@ -3490,13 +3497,13 @@ msgid "" "require a prior *write* to the underlying socket." msgstr "" -#: ../../library/ssl.rst:2485 +#: ../../library/ssl.rst:2486 msgid "" "In earlier Python versions, the :meth:`!SSLSocket.send` method returned zero " "instead of raising :exc:`SSLWantWriteError` or :exc:`SSLWantReadError`." msgstr "" -#: ../../library/ssl.rst:2489 +#: ../../library/ssl.rst:2490 msgid "" "Calling :func:`~select.select` tells you that the OS-level socket can be " "read from (or written to), but it does not imply that there is sufficient " @@ -3506,7 +3513,7 @@ msgid "" "`~select.select`." msgstr "" -#: ../../library/ssl.rst:2496 +#: ../../library/ssl.rst:2497 msgid "" "Conversely, since the SSL layer has its own framing, a SSL socket may still " "have data available for reading without :func:`~select.select` being aware " @@ -3515,13 +3522,13 @@ msgid "" "call if still necessary." msgstr "" -#: ../../library/ssl.rst:2502 +#: ../../library/ssl.rst:2503 msgid "" "(of course, similar provisions apply when using other primitives such as :" "func:`~select.poll`, or those in the :mod:`selectors` module)" msgstr "" -#: ../../library/ssl.rst:2505 +#: ../../library/ssl.rst:2506 msgid "" "The SSL handshake itself will be non-blocking: the :meth:`SSLSocket." "do_handshake` method has to be retried until it returns successfully. Here " @@ -3529,7 +3536,7 @@ msgid "" "readiness::" msgstr "" -#: ../../library/ssl.rst:2510 +#: ../../library/ssl.rst:2511 msgid "" "while True:\n" " try:\n" @@ -3549,7 +3556,7 @@ msgstr "" " except ssl.SSLWantWriteError:\n" " select.select([], [sock], [])" -#: ../../library/ssl.rst:2521 +#: ../../library/ssl.rst:2522 msgid "" "The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets ` and provides a higher level :ref:`Streams API `. " "This means that for example :meth:`~SSLSocket.read` will raise an :exc:" "`SSLWantReadError` if it needs more data than the incoming BIO has available." msgstr "" -#: ../../library/ssl.rst:2624 +#: ../../library/ssl.rst:2625 msgid "" ":class:`SSLObject` instances must be created with :meth:`~SSLContext." "wrap_bio`. In earlier versions, it was possible to create instances " "directly. This was never documented or officially supported." msgstr "" -#: ../../library/ssl.rst:2630 +#: ../../library/ssl.rst:2631 msgid "" "An SSLObject communicates with the outside world using memory buffers. The " "class :class:`MemoryBIO` provides a memory buffer that can be used for this " "purpose. It wraps an OpenSSL memory BIO (Basic IO) object:" msgstr "" -#: ../../library/ssl.rst:2636 +#: ../../library/ssl.rst:2637 msgid "" "A memory buffer that can be used to pass data between Python and an SSL " "protocol instance." msgstr "" -#: ../../library/ssl.rst:2641 +#: ../../library/ssl.rst:2642 msgid "Return the number of bytes currently in the memory buffer." msgstr "" -#: ../../library/ssl.rst:2645 +#: ../../library/ssl.rst:2646 msgid "" "A boolean indicating whether the memory BIO is current at the end-of-file " "position." msgstr "" -#: ../../library/ssl.rst:2650 +#: ../../library/ssl.rst:2651 msgid "" "Read up to *n* bytes from the memory buffer. If *n* is not specified or " "negative, all bytes are returned." msgstr "" -#: ../../library/ssl.rst:2655 +#: ../../library/ssl.rst:2656 msgid "" "Write the bytes from *buf* to the memory BIO. The *buf* argument must be an " "object supporting the buffer protocol." msgstr "" -#: ../../library/ssl.rst:2658 +#: ../../library/ssl.rst:2659 msgid "" "The return value is the number of bytes written, which is always equal to " "the length of *buf*." msgstr "" -#: ../../library/ssl.rst:2663 +#: ../../library/ssl.rst:2664 msgid "" "Write an EOF marker to the memory BIO. After this method has been called, it " "is illegal to call :meth:`~MemoryBIO.write`. The attribute :attr:`eof` will " "become true after all data currently in the buffer has been read." msgstr "" -#: ../../library/ssl.rst:2669 +#: ../../library/ssl.rst:2670 msgid "SSL session" msgstr "" -#: ../../library/ssl.rst:2675 +#: ../../library/ssl.rst:2676 msgid "Session object used by :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:2687 +#: ../../library/ssl.rst:2688 msgid "Security considerations" msgstr "" -#: ../../library/ssl.rst:2690 +#: ../../library/ssl.rst:2691 msgid "Best defaults" msgstr "" -#: ../../library/ssl.rst:2692 +#: ../../library/ssl.rst:2693 msgid "" "For **client use**, if you don't have any special requirements for your " "security policy, it is highly recommended that you use the :func:" @@ -3841,13 +3848,13 @@ msgid "" "settings." msgstr "" -#: ../../library/ssl.rst:2699 +#: ../../library/ssl.rst:2700 msgid "" "For example, here is how you would use the :class:`smtplib.SMTP` class to " "create a trusted, secure connection to a SMTP server::" msgstr "" -#: ../../library/ssl.rst:2702 +#: ../../library/ssl.rst:2703 msgid "" ">>> import ssl, smtplib\n" ">>> smtp = smtplib.SMTP(\"mail.python.org\", port=587)\n" @@ -3861,13 +3868,13 @@ msgstr "" ">>> smtp.starttls(context=context)\n" "(220, b'2.0.0 Ready to start TLS')" -#: ../../library/ssl.rst:2708 +#: ../../library/ssl.rst:2709 msgid "" "If a client certificate is needed for the connection, it can be added with :" "meth:`SSLContext.load_cert_chain`." msgstr "" -#: ../../library/ssl.rst:2711 +#: ../../library/ssl.rst:2712 msgid "" "By contrast, if you create the SSL context by calling the :class:" "`SSLContext` constructor yourself, it will not have certificate validation " @@ -3875,15 +3882,15 @@ msgid "" "paragraphs below to achieve a good security level." msgstr "" -#: ../../library/ssl.rst:2717 +#: ../../library/ssl.rst:2718 msgid "Manual settings" msgstr "手動設定" -#: ../../library/ssl.rst:2720 +#: ../../library/ssl.rst:2721 msgid "Verifying certificates" msgstr "驗證憑證" -#: ../../library/ssl.rst:2722 +#: ../../library/ssl.rst:2723 msgid "" "When calling the :class:`SSLContext` constructor directly, :const:" "`CERT_NONE` is the default. Since it does not authenticate the other peer, " @@ -3898,13 +3905,13 @@ msgid "" "enabled." msgstr "" -#: ../../library/ssl.rst:2734 +#: ../../library/ssl.rst:2735 msgid "" "Hostname matchings is now performed by OpenSSL. Python no longer uses :func:" "`!match_hostname`." msgstr "" -#: ../../library/ssl.rst:2738 +#: ../../library/ssl.rst:2739 msgid "" "In server mode, if you want to authenticate your clients using the SSL layer " "(rather than using a higher-level authentication mechanism), you'll also " @@ -3912,11 +3919,11 @@ msgid "" "certificate." msgstr "" -#: ../../library/ssl.rst:2744 +#: ../../library/ssl.rst:2745 msgid "Protocol versions" msgstr "協定版本" -#: ../../library/ssl.rst:2746 +#: ../../library/ssl.rst:2747 msgid "" "SSL versions 2 and 3 are considered insecure and are therefore dangerous to " "use. If you want maximum compatibility between clients and servers, it is " @@ -3925,7 +3932,7 @@ msgid "" "by default." msgstr "" -#: ../../library/ssl.rst:2754 +#: ../../library/ssl.rst:2755 msgid "" ">>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_3\n" @@ -3935,7 +3942,7 @@ msgstr "" ">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_3\n" ">>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3" -#: ../../library/ssl.rst:2759 +#: ../../library/ssl.rst:2760 msgid "" "The SSL context created above will only allow TLSv1.3 and later (if " "supported by your system) connections to a server. :const:" @@ -3943,11 +3950,11 @@ msgid "" "default. You have to load certificates into the context." msgstr "" -#: ../../library/ssl.rst:2766 +#: ../../library/ssl.rst:2767 msgid "Cipher selection" msgstr "" -#: ../../library/ssl.rst:2768 +#: ../../library/ssl.rst:2769 msgid "" "If you have advanced security requirements, fine-tuning of the ciphers " "enabled when negotiating a SSL session is possible through the :meth:" @@ -3960,11 +3967,11 @@ msgid "" "command on your system." msgstr "" -#: ../../library/ssl.rst:2779 +#: ../../library/ssl.rst:2780 msgid "Multi-processing" msgstr "" -#: ../../library/ssl.rst:2781 +#: ../../library/ssl.rst:2782 msgid "" "If using this module as part of a multi-processed application (using, for " "example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules), be " @@ -3975,17 +3982,17 @@ msgid "" "sufficient." msgstr "" -#: ../../library/ssl.rst:2793 +#: ../../library/ssl.rst:2794 msgid "TLS 1.3" msgstr "TLS 1.3" -#: ../../library/ssl.rst:2797 +#: ../../library/ssl.rst:2798 msgid "" "The TLS 1.3 protocol behaves slightly differently than previous version of " "TLS/SSL. Some new TLS 1.3 features are not yet available." msgstr "" -#: ../../library/ssl.rst:2800 +#: ../../library/ssl.rst:2801 msgid "" "TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 " "cipher suites are enabled by default. The method :meth:`SSLContext." @@ -3993,14 +4000,14 @@ msgid "" "`SSLContext.get_ciphers` returns them." msgstr "" -#: ../../library/ssl.rst:2804 +#: ../../library/ssl.rst:2805 msgid "" "Session tickets are no longer sent as part of the initial handshake and are " "handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are " "not compatible with TLS 1.3." msgstr "" -#: ../../library/ssl.rst:2807 +#: ../../library/ssl.rst:2808 msgid "" "Client-side certificates are also no longer verified during the initial " "handshake. A server can request a certificate at any time. Clients process " @@ -4008,21 +4015,21 @@ msgid "" "server." msgstr "" -#: ../../library/ssl.rst:2811 +#: ../../library/ssl.rst:2812 msgid "" "TLS 1.3 features like early data, deferred TLS client cert request, " "signature algorithm configuration, and rekeying are not supported yet." msgstr "" -#: ../../library/ssl.rst:2817 +#: ../../library/ssl.rst:2818 msgid "Class :class:`socket.socket`" msgstr ":class:`socket.socket` 類別" -#: ../../library/ssl.rst:2818 +#: ../../library/ssl.rst:2819 msgid "Documentation of underlying :mod:`socket` class" msgstr "底層 :mod:`socket` 類別的文件" -#: ../../library/ssl.rst:2820 +#: ../../library/ssl.rst:2821 msgid "" "`SSL/TLS Strong Encryption: An Introduction `_" @@ -4030,11 +4037,11 @@ msgstr "" "`SSL/TLS Strong Encryption: An Introduction `_" -#: ../../library/ssl.rst:2821 +#: ../../library/ssl.rst:2822 msgid "Intro from the Apache HTTP Server documentation" msgstr "Apache HTTP Server 文件的介紹" -#: ../../library/ssl.rst:2823 +#: ../../library/ssl.rst:2824 msgid "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" @@ -4042,19 +4049,19 @@ msgstr "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" -#: ../../library/ssl.rst:2824 +#: ../../library/ssl.rst:2825 msgid "Steve Kent" msgstr "Steve Kent" -#: ../../library/ssl.rst:2826 +#: ../../library/ssl.rst:2827 msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" msgstr ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" -#: ../../library/ssl.rst:2827 +#: ../../library/ssl.rst:2828 msgid "Donald E., Jeffrey I. Schiller" msgstr "Donald E., Jeffrey I. Schiller" -#: ../../library/ssl.rst:2829 +#: ../../library/ssl.rst:2830 msgid "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" @@ -4062,11 +4069,11 @@ msgstr "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" -#: ../../library/ssl.rst:2830 +#: ../../library/ssl.rst:2831 msgid "D. Cooper" msgstr "D. Cooper" -#: ../../library/ssl.rst:2832 +#: ../../library/ssl.rst:2833 msgid "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" @@ -4074,19 +4081,19 @@ msgstr "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" -#: ../../library/ssl.rst:2833 +#: ../../library/ssl.rst:2834 msgid "T. Dierks et. al." msgstr "T. Dierks et. al." -#: ../../library/ssl.rst:2835 +#: ../../library/ssl.rst:2836 msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgstr ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" -#: ../../library/ssl.rst:2836 +#: ../../library/ssl.rst:2837 msgid "D. Eastlake" msgstr "D. Eastlake" -#: ../../library/ssl.rst:2838 +#: ../../library/ssl.rst:2839 msgid "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" @@ -4094,11 +4101,11 @@ msgstr "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" -#: ../../library/ssl.rst:2839 +#: ../../library/ssl.rst:2840 msgid "IANA" msgstr "IANA" -#: ../../library/ssl.rst:2841 +#: ../../library/ssl.rst:2842 msgid "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" @@ -4106,11 +4113,11 @@ msgstr "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" -#: ../../library/ssl.rst:2842 +#: ../../library/ssl.rst:2843 msgid "IETF" msgstr "IETF" -#: ../../library/ssl.rst:2844 +#: ../../library/ssl.rst:2845 msgid "" "`Mozilla's Server Side TLS recommendations `_" @@ -4118,7 +4125,7 @@ msgstr "" "`Mozilla's Server Side TLS recommendations `_" -#: ../../library/ssl.rst:2845 +#: ../../library/ssl.rst:2846 msgid "Mozilla" msgstr "Mozilla" @@ -4146,10 +4153,10 @@ msgstr "Transport Layer Security(傳輸層安全)" msgid "Secure Sockets Layer" msgstr "Secure Sockets Layer(安全 socket 層)" -#: ../../library/ssl.rst:2156 +#: ../../library/ssl.rst:2157 msgid "certificates" msgstr "certificates(憑證)" -#: ../../library/ssl.rst:2158 +#: ../../library/ssl.rst:2159 msgid "X509 certificate" msgstr "X509 certificate(X509 憑證)" diff --git a/library/tarfile.po b/library/tarfile.po index 07886ed8ffa..b62237dea78 100644 --- a/library/tarfile.po +++ b/library/tarfile.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-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,44 +40,52 @@ msgstr "" #: ../../library/tarfile.rst:21 msgid "" -"reads and writes :mod:`gzip`, :mod:`bz2`, :mod:`compression.zstd`, " -"and :mod:`lzma` compressed archives if the respective modules are available." +"reads and writes :mod:`gzip`, :mod:`bz2`, :mod:`compression.zstd`, and :mod:" +"`lzma` compressed archives if the respective modules are available." msgstr "" -#: ../../library/tarfile.rst:24 +#: ../../library/tarfile.rst:27 +msgid "" +"If any of these :term:`optional modules ` are missing from " +"your copy of CPython, look for documentation from your distributor (that is, " +"whoever provided Python to you). If you are the distributor, see :ref:" +"`optional-module-requirements`." +msgstr "" + +#: ../../library/tarfile.rst:32 msgid "read/write support for the POSIX.1-1988 (ustar) format." msgstr "" -#: ../../library/tarfile.rst:26 +#: ../../library/tarfile.rst:34 msgid "" "read/write support for the GNU tar format including *longname* and " "*longlink* extensions, read-only support for all variants of the *sparse* " "extension including restoration of sparse files." msgstr "" -#: ../../library/tarfile.rst:30 +#: ../../library/tarfile.rst:38 msgid "read/write support for the POSIX.1-2001 (pax) format." msgstr "" -#: ../../library/tarfile.rst:32 +#: ../../library/tarfile.rst:40 msgid "" "handles directories, regular files, hardlinks, symbolic links, fifos, " "character devices and block devices and is able to acquire and restore file " "information like timestamp, access permissions and owner." msgstr "" -#: ../../library/tarfile.rst:36 +#: ../../library/tarfile.rst:44 msgid "Added support for :mod:`lzma` compression." msgstr "新增對 :mod:`lzma` 壓縮的支援。" -#: ../../library/tarfile.rst:39 +#: ../../library/tarfile.rst:47 msgid "" "Archives are extracted using a :ref:`filter `, " "which makes it possible to either limit surprising/dangerous features, or to " "acknowledge that they are expected and the archive is fully trusted." msgstr "" -#: ../../library/tarfile.rst:44 +#: ../../library/tarfile.rst:52 msgid "" "Set the default extraction filter to :func:`data `, which " "disallows some dangerous features such as links to absolute paths or paths " @@ -85,18 +93,18 @@ msgid "" "to :func:`fully_trusted `." msgstr "" -#: ../../library/tarfile.rst:52 +#: ../../library/tarfile.rst:60 msgid "Added support for Zstandard compression using :mod:`compression.zstd`." msgstr "新增對 Zstandard 壓縮的支援(使用 :mod:`compression.zstd`)。" -#: ../../library/tarfile.rst:56 +#: ../../library/tarfile.rst:64 msgid "" "Return a :class:`TarFile` object for the pathname *name*. For detailed " "information on :class:`TarFile` objects and the keyword arguments that are " "allowed, see :ref:`tarfile-objects`." msgstr "" -#: ../../library/tarfile.rst:60 +#: ../../library/tarfile.rst:68 msgid "" "*mode* has to be a string of the form ``'filemode[:compression]'``, it " "defaults to ``'r'``. Here is a full list of mode combinations:" @@ -104,417 +112,415 @@ msgstr "" "*mode* 必須是 ``'filemode[:compression]'`` 形式的字串,預設為 ``'r'``。以下是" "所有可能的模式組合:" -#: ../../library/tarfile.rst:64 +#: ../../library/tarfile.rst:72 msgid "mode" msgstr "模式" -#: ../../library/tarfile.rst:64 +#: ../../library/tarfile.rst:72 msgid "action" msgstr "操作" -#: ../../library/tarfile.rst:66 +#: ../../library/tarfile.rst:74 msgid "``'r'`` or ``'r:*'``" msgstr "``'r'`` 或 ``'r:*'``" -#: ../../library/tarfile.rst:66 +#: ../../library/tarfile.rst:74 msgid "Open for reading with transparent compression (recommended)." msgstr "" -#: ../../library/tarfile.rst:69 +#: ../../library/tarfile.rst:77 msgid "``'r:'``" msgstr "``'r:'``" -#: ../../library/tarfile.rst:69 +#: ../../library/tarfile.rst:77 msgid "Open for reading exclusively without compression." msgstr "" -#: ../../library/tarfile.rst:72 +#: ../../library/tarfile.rst:80 msgid "``'r:gz'``" msgstr "``'r:gz'``" -#: ../../library/tarfile.rst:72 +#: ../../library/tarfile.rst:80 msgid "Open for reading with gzip compression." msgstr "開啟以讀取 gzip 壓縮。" -#: ../../library/tarfile.rst:74 +#: ../../library/tarfile.rst:82 msgid "``'r:bz2'``" msgstr "``'r:bz2'``" -#: ../../library/tarfile.rst:74 +#: ../../library/tarfile.rst:82 msgid "Open for reading with bzip2 compression." msgstr "開啟以讀取 bzip2 壓縮。" -#: ../../library/tarfile.rst:76 +#: ../../library/tarfile.rst:84 msgid "``'r:xz'``" msgstr "``'r:xz'``" -#: ../../library/tarfile.rst:76 +#: ../../library/tarfile.rst:84 msgid "Open for reading with lzma compression." msgstr "開啟以讀取 lzma 壓縮。" -#: ../../library/tarfile.rst:78 +#: ../../library/tarfile.rst:86 msgid "``'r:zst'``" msgstr "``'r:zst'``" -#: ../../library/tarfile.rst:78 +#: ../../library/tarfile.rst:86 msgid "Open for reading with Zstandard compression." msgstr "開啟以讀取 Zstandard 壓縮。" -#: ../../library/tarfile.rst:80 +#: ../../library/tarfile.rst:88 msgid "``'x'`` or ``'x:'``" msgstr "``'x'`` 或 ``'x:'``" -#: ../../library/tarfile.rst:80 +#: ../../library/tarfile.rst:88 msgid "" -"Create a tarfile exclusively without compression. Raise " -"a :exc:`FileExistsError` exception if it already exists." +"Create a tarfile exclusively without compression. Raise a :exc:" +"`FileExistsError` exception if it already exists." msgstr "" -#: ../../library/tarfile.rst:85 +#: ../../library/tarfile.rst:93 msgid "``'x:gz'``" msgstr "``'x:gz'``" -#: ../../library/tarfile.rst:85 +#: ../../library/tarfile.rst:93 msgid "" "Create a tarfile with gzip compression. Raise a :exc:`FileExistsError` " "exception if it already exists." msgstr "" -#: ../../library/tarfile.rst:89 +#: ../../library/tarfile.rst:97 msgid "``'x:bz2'``" msgstr "``'x:bz2'``" -#: ../../library/tarfile.rst:89 +#: ../../library/tarfile.rst:97 msgid "" "Create a tarfile with bzip2 compression. Raise a :exc:`FileExistsError` " "exception if it already exists." msgstr "" -#: ../../library/tarfile.rst:93 +#: ../../library/tarfile.rst:101 msgid "``'x:xz'``" msgstr "``'x:xz'``" -#: ../../library/tarfile.rst:93 +#: ../../library/tarfile.rst:101 msgid "" "Create a tarfile with lzma compression. Raise a :exc:`FileExistsError` " "exception if it already exists." msgstr "" -#: ../../library/tarfile.rst:97 +#: ../../library/tarfile.rst:105 msgid "``'x:zst'``" msgstr "``'x:zst'``" -#: ../../library/tarfile.rst:97 +#: ../../library/tarfile.rst:105 msgid "" "Create a tarfile with Zstandard compression. Raise a :exc:`FileExistsError` " "exception if it already exists." msgstr "" -#: ../../library/tarfile.rst:101 +#: ../../library/tarfile.rst:109 msgid "``'a'`` or ``'a:'``" msgstr "``'a'`` 或 ``'a:'``" -#: ../../library/tarfile.rst:101 +#: ../../library/tarfile.rst:109 msgid "" "Open for appending with no compression. The file is created if it does not " "exist." msgstr "" -#: ../../library/tarfile.rst:104 +#: ../../library/tarfile.rst:112 msgid "``'w'`` or ``'w:'``" msgstr "``'w'`` 或 ``'w:'``" -#: ../../library/tarfile.rst:104 +#: ../../library/tarfile.rst:112 msgid "Open for uncompressed writing." msgstr "" -#: ../../library/tarfile.rst:107 +#: ../../library/tarfile.rst:115 msgid "``'w:gz'``" msgstr "``'w:gz'``" -#: ../../library/tarfile.rst:107 +#: ../../library/tarfile.rst:115 msgid "Open for gzip compressed writing." msgstr "開啟以用於 gzip 壓縮寫入。" -#: ../../library/tarfile.rst:109 +#: ../../library/tarfile.rst:117 msgid "``'w:bz2'``" msgstr "``'w:bz2'``" -#: ../../library/tarfile.rst:109 +#: ../../library/tarfile.rst:117 msgid "Open for bzip2 compressed writing." msgstr "開啟以用於 bzip2 壓縮寫入。" -#: ../../library/tarfile.rst:111 +#: ../../library/tarfile.rst:119 msgid "``'w:xz'``" msgstr "``'w:xz'``" -#: ../../library/tarfile.rst:111 +#: ../../library/tarfile.rst:119 msgid "Open for lzma compressed writing." msgstr "開啟以用於 lzma 壓縮寫入。" -#: ../../library/tarfile.rst:113 +#: ../../library/tarfile.rst:121 msgid "``'w:zst'``" msgstr "``'w:zst'``" -#: ../../library/tarfile.rst:113 +#: ../../library/tarfile.rst:121 msgid "Open for Zstandard compressed writing." msgstr "開啟以用於 Zstandard 壓縮寫入。" -#: ../../library/tarfile.rst:116 +#: ../../library/tarfile.rst:124 msgid "" "Note that ``'a:gz'``, ``'a:bz2'`` or ``'a:xz'`` is not possible. If *mode* " -"is not suitable to open a certain (compressed) file for " -"reading, :exc:`ReadError` is raised. Use *mode* ``'r'`` to avoid this. If a " -"compression method is not supported, :exc:`CompressionError` is raised." +"is not suitable to open a certain (compressed) file for reading, :exc:" +"`ReadError` is raised. Use *mode* ``'r'`` to avoid this. If a compression " +"method is not supported, :exc:`CompressionError` is raised." msgstr "" -#: ../../library/tarfile.rst:121 +#: ../../library/tarfile.rst:129 msgid "" "If *fileobj* is specified, it is used as an alternative to a :term:`file " "object` opened in binary mode for *name*. It is supposed to be at position 0." msgstr "" -#: ../../library/tarfile.rst:124 +#: ../../library/tarfile.rst:132 msgid "" "For modes ``'w:gz'``, ``'x:gz'``, ``'w|gz'``, ``'w:bz2'``, ``'x:bz2'``, ``'w|" "bz2'``, :func:`tarfile.open` accepts the keyword argument *compresslevel* " "(default ``9``) to specify the compression level of the file." msgstr "" -#: ../../library/tarfile.rst:128 +#: ../../library/tarfile.rst:136 msgid "" "For modes ``'w:xz'``, ``'x:xz'`` and ``'w|xz'``, :func:`tarfile.open` " "accepts the keyword argument *preset* to specify the compression level of " "the file." msgstr "" -#: ../../library/tarfile.rst:131 +#: ../../library/tarfile.rst:139 msgid "" "For modes ``'w:zst'``, ``'x:zst'`` and ``'w|zst'``, :func:`tarfile.open` " "accepts the keyword argument *level* to specify the compression level of the " "file. The keyword argument *options* may also be passed, providing advanced " -"Zstandard compression parameters described " -"by :class:`~compression.zstd.CompressionParameter`. The keyword argument " -"*zstd_dict* can be passed to provide a :class:`~compression.zstd.ZstdDict`, " -"a Zstandard dictionary used to improve compression of smaller amounts of " -"data." +"Zstandard compression parameters described by :class:`~compression.zstd." +"CompressionParameter`. The keyword argument *zstd_dict* can be passed to " +"provide a :class:`~compression.zstd.ZstdDict`, a Zstandard dictionary used " +"to improve compression of smaller amounts of data." msgstr "" -#: ../../library/tarfile.rst:140 +#: ../../library/tarfile.rst:148 msgid "" "For special purposes, there is a second format for *mode*: ``'filemode|" "[compression]'``. :func:`tarfile.open` will return a :class:`TarFile` " "object that processes its data as a stream of blocks. No random seeking " -"will be done on the file. If given, *fileobj* may be any object that has " -"a :meth:`~io.RawIOBase.read` or :meth:`~io.RawIOBase.write` method " -"(depending on the *mode*) that works with bytes. *bufsize* specifies the " -"blocksize and defaults to ``20 * 512`` bytes. Use this variant in " -"combination with e.g. ``sys.stdin.buffer``, a socket :term:`file object` or " -"a tape device. However, such a :class:`TarFile` object is limited in that it " -"does not allow random access, see :ref:`tar-examples`. The currently " -"possible modes:" +"will be done on the file. If given, *fileobj* may be any object that has a :" +"meth:`~io.RawIOBase.read` or :meth:`~io.RawIOBase.write` method (depending " +"on the *mode*) that works with bytes. *bufsize* specifies the blocksize and " +"defaults to ``20 * 512`` bytes. Use this variant in combination with e.g. " +"``sys.stdin.buffer``, a socket :term:`file object` or a tape device. " +"However, such a :class:`TarFile` object is limited in that it does not allow " +"random access, see :ref:`tar-examples`. The currently possible modes:" msgstr "" -#: ../../library/tarfile.rst:154 +#: ../../library/tarfile.rst:162 msgid "Mode" msgstr "模式" -#: ../../library/tarfile.rst:154 +#: ../../library/tarfile.rst:162 msgid "Action" msgstr "操作" -#: ../../library/tarfile.rst:156 +#: ../../library/tarfile.rst:164 msgid "``'r|*'``" msgstr "``'r|*'``" -#: ../../library/tarfile.rst:156 +#: ../../library/tarfile.rst:164 msgid "Open a *stream* of tar blocks for reading with transparent compression." msgstr "" -#: ../../library/tarfile.rst:159 +#: ../../library/tarfile.rst:167 msgid "``'r|'``" msgstr "``'r|'``" -#: ../../library/tarfile.rst:159 +#: ../../library/tarfile.rst:167 msgid "Open a *stream* of uncompressed tar blocks for reading." msgstr "" -#: ../../library/tarfile.rst:162 +#: ../../library/tarfile.rst:170 msgid "``'r|gz'``" msgstr "``'r|gz'``" -#: ../../library/tarfile.rst:162 +#: ../../library/tarfile.rst:170 msgid "Open a gzip compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:165 +#: ../../library/tarfile.rst:173 msgid "``'r|bz2'``" msgstr "``'r|bz2'``" -#: ../../library/tarfile.rst:165 +#: ../../library/tarfile.rst:173 msgid "Open a bzip2 compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:168 +#: ../../library/tarfile.rst:176 msgid "``'r|xz'``" msgstr "``'r|xz'``" -#: ../../library/tarfile.rst:168 +#: ../../library/tarfile.rst:176 msgid "Open an lzma compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:171 +#: ../../library/tarfile.rst:179 msgid "``'r|zst'``" msgstr "``'r|zst'``" -#: ../../library/tarfile.rst:171 +#: ../../library/tarfile.rst:179 msgid "Open a Zstandard compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:174 +#: ../../library/tarfile.rst:182 msgid "``'w|'``" msgstr "``'w|'``" -#: ../../library/tarfile.rst:174 +#: ../../library/tarfile.rst:182 msgid "Open an uncompressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:176 +#: ../../library/tarfile.rst:184 msgid "``'w|gz'``" msgstr "``'w|gz'``" -#: ../../library/tarfile.rst:176 +#: ../../library/tarfile.rst:184 msgid "Open a gzip compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:179 +#: ../../library/tarfile.rst:187 msgid "``'w|bz2'``" msgstr "``'w|bz2'``" -#: ../../library/tarfile.rst:179 +#: ../../library/tarfile.rst:187 msgid "Open a bzip2 compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:182 +#: ../../library/tarfile.rst:190 msgid "``'w|xz'``" msgstr "``'w|xz'``" -#: ../../library/tarfile.rst:182 +#: ../../library/tarfile.rst:190 msgid "Open an lzma compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:185 +#: ../../library/tarfile.rst:193 msgid "``'w|zst'``" msgstr "``'w|zst'``" -#: ../../library/tarfile.rst:185 +#: ../../library/tarfile.rst:193 msgid "Open a Zstandard compressed *stream* for writing." msgstr "開啟以用於 Zstandard 壓縮寫入。" -#: ../../library/tarfile.rst:189 ../../library/tarfile.rst:468 +#: ../../library/tarfile.rst:197 ../../library/tarfile.rst:476 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/tarfile.rst:192 ../../library/tarfile.rst:471 -#: ../../library/tarfile.rst:719 +#: ../../library/tarfile.rst:200 ../../library/tarfile.rst:479 +#: ../../library/tarfile.rst:727 msgid "The *name* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/tarfile.rst:195 +#: ../../library/tarfile.rst:203 msgid "The *compresslevel* keyword argument also works for streams." msgstr "" -#: ../../library/tarfile.rst:198 +#: ../../library/tarfile.rst:206 msgid "The *preset* keyword argument also works for streams." msgstr "" -#: ../../library/tarfile.rst:205 +#: ../../library/tarfile.rst:213 msgid "" "Class for reading and writing tar archives. Do not use this class directly: " "use :func:`tarfile.open` instead. See :ref:`tarfile-objects`." msgstr "" -#: ../../library/tarfile.rst:211 +#: ../../library/tarfile.rst:219 msgid "" -"Return :const:`True` if *name* is a tar archive file, that " -"the :mod:`tarfile` module can read. *name* may be a :class:`str`, file, or " -"file-like object." +"Return :const:`True` if *name* is a tar archive file, that the :mod:" +"`tarfile` module can read. *name* may be a :class:`str`, file, or file-like " +"object." msgstr "" -#: ../../library/tarfile.rst:214 +#: ../../library/tarfile.rst:222 msgid "Support for file and file-like objects." msgstr "對檔案和類檔案物件的支援。" -#: ../../library/tarfile.rst:218 +#: ../../library/tarfile.rst:226 msgid "The :mod:`tarfile` module defines the following exceptions:" msgstr ":mod:`tarfile` 模組定義了以下例外:" -#: ../../library/tarfile.rst:223 +#: ../../library/tarfile.rst:231 msgid "Base class for all :mod:`tarfile` exceptions." msgstr "所有 :mod:`tarfile` 例外的基底類別。" -#: ../../library/tarfile.rst:228 +#: ../../library/tarfile.rst:236 msgid "" "Is raised when a tar archive is opened, that either cannot be handled by " "the :mod:`tarfile` module or is somehow invalid." msgstr "" -#: ../../library/tarfile.rst:234 +#: ../../library/tarfile.rst:242 msgid "" "Is raised when a compression method is not supported or when the data cannot " "be decoded properly." msgstr "" -#: ../../library/tarfile.rst:240 +#: ../../library/tarfile.rst:248 msgid "" -"Is raised for the limitations that are typical for stream-" -"like :class:`TarFile` objects." +"Is raised for the limitations that are typical for stream-like :class:" +"`TarFile` objects." msgstr "" -#: ../../library/tarfile.rst:246 +#: ../../library/tarfile.rst:254 msgid "" "Is raised for *non-fatal* errors when using :meth:`TarFile.extract`, but " "only if :attr:`TarFile.errorlevel`\\ ``== 2``." msgstr "" -#: ../../library/tarfile.rst:252 +#: ../../library/tarfile.rst:260 msgid "Is raised by :meth:`TarInfo.frombuf` if the buffer it gets is invalid." msgstr "" -#: ../../library/tarfile.rst:257 +#: ../../library/tarfile.rst:265 msgid "" "Base class for members :ref:`refused ` by filters." msgstr "" -#: ../../library/tarfile.rst:262 +#: ../../library/tarfile.rst:270 msgid "" -"Information about the member that the filter refused to extract, " -"as :ref:`TarInfo `." +"Information about the member that the filter refused to extract, as :ref:" +"`TarInfo `." msgstr "" -#: ../../library/tarfile.rst:267 +#: ../../library/tarfile.rst:275 msgid "Raised to refuse extracting a member with an absolute path." msgstr "" -#: ../../library/tarfile.rst:271 +#: ../../library/tarfile.rst:279 msgid "Raised to refuse extracting a member outside the destination directory." msgstr "" -#: ../../library/tarfile.rst:275 +#: ../../library/tarfile.rst:283 msgid "Raised to refuse extracting a special file (e.g. a device or pipe)." msgstr "" -#: ../../library/tarfile.rst:279 +#: ../../library/tarfile.rst:287 msgid "Raised to refuse extracting a symbolic link with an absolute path." msgstr "" -#: ../../library/tarfile.rst:283 +#: ../../library/tarfile.rst:291 msgid "" "Raised to refuse extracting a symbolic link pointing outside the destination " "directory." msgstr "" -#: ../../library/tarfile.rst:288 +#: ../../library/tarfile.rst:296 msgid "" "Raised to refuse emulating a link (hard or symbolic) by extracting another " "archive member, when that member would be rejected by the filter location. " @@ -522,159 +528,159 @@ msgid "" "as :attr:`!BaseException.__context__`." msgstr "" -#: ../../library/tarfile.rst:296 +#: ../../library/tarfile.rst:304 msgid "The following constants are available at the module level:" msgstr "" -#: ../../library/tarfile.rst:300 +#: ../../library/tarfile.rst:308 msgid "" "The default character encoding: ``'utf-8'`` on Windows, the value returned " "by :func:`sys.getfilesystemencoding` otherwise." msgstr "" -#: ../../library/tarfile.rst:306 +#: ../../library/tarfile.rst:314 msgid "A regular file :attr:`~TarInfo.type`." msgstr "一個普通檔案 :attr:`~TarInfo.type`。" -#: ../../library/tarfile.rst:310 +#: ../../library/tarfile.rst:318 msgid "A link (inside tarfile) :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:314 +#: ../../library/tarfile.rst:322 msgid "A symbolic link :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:318 +#: ../../library/tarfile.rst:326 msgid "A character special device :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:322 +#: ../../library/tarfile.rst:330 msgid "A block special device :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:326 +#: ../../library/tarfile.rst:334 msgid "A directory :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:330 +#: ../../library/tarfile.rst:338 msgid "A FIFO special device :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:334 +#: ../../library/tarfile.rst:342 msgid "A contiguous file :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:338 +#: ../../library/tarfile.rst:346 msgid "A GNU tar longname :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:342 +#: ../../library/tarfile.rst:350 msgid "A GNU tar longlink :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:346 +#: ../../library/tarfile.rst:354 msgid "A GNU tar sparse file :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:349 +#: ../../library/tarfile.rst:357 msgid "" -"Each of the following constants defines a tar archive format that " -"the :mod:`tarfile` module is able to create. See section :ref:`tar-formats` " -"for details." +"Each of the following constants defines a tar archive format that the :mod:" +"`tarfile` module is able to create. See section :ref:`tar-formats` for " +"details." msgstr "" -#: ../../library/tarfile.rst:356 +#: ../../library/tarfile.rst:364 msgid "POSIX.1-1988 (ustar) format." msgstr "POSIX.1-1988 (ustar) 格式。" -#: ../../library/tarfile.rst:361 +#: ../../library/tarfile.rst:369 msgid "GNU tar format." msgstr "GNU tar 格式。" -#: ../../library/tarfile.rst:366 +#: ../../library/tarfile.rst:374 msgid "POSIX.1-2001 (pax) format." msgstr "POSIX.1-2001 (pax) 格式。" -#: ../../library/tarfile.rst:371 +#: ../../library/tarfile.rst:379 msgid "" -"The default format for creating archives. This is " -"currently :const:`PAX_FORMAT`." +"The default format for creating archives. This is currently :const:" +"`PAX_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:373 +#: ../../library/tarfile.rst:381 msgid "" -"The default format for new archives was changed to :const:`PAX_FORMAT` " -"from :const:`GNU_FORMAT`." +"The default format for new archives was changed to :const:`PAX_FORMAT` from :" +"const:`GNU_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:380 +#: ../../library/tarfile.rst:388 msgid "Module :mod:`zipfile`" msgstr ":mod:`zipfile` 模組" -#: ../../library/tarfile.rst:381 +#: ../../library/tarfile.rst:389 msgid "Documentation of the :mod:`zipfile` standard module." msgstr ":mod:`zipfile` 標準模組的文件。" -#: ../../library/tarfile.rst:383 +#: ../../library/tarfile.rst:391 msgid ":ref:`archiving-operations`" msgstr ":ref:`archiving-operations`" -#: ../../library/tarfile.rst:384 +#: ../../library/tarfile.rst:392 msgid "" "Documentation of the higher-level archiving facilities provided by the " "standard :mod:`shutil` module." msgstr "" -#: ../../library/tarfile.rst:387 +#: ../../library/tarfile.rst:395 msgid "" "`GNU tar manual, Basic Tar Format `_" msgstr "" -#: ../../library/tarfile.rst:388 +#: ../../library/tarfile.rst:396 msgid "Documentation for tar archive files, including GNU tar extensions." msgstr "" -#: ../../library/tarfile.rst:394 +#: ../../library/tarfile.rst:402 msgid "TarFile Objects" msgstr "TarFile 物件" -#: ../../library/tarfile.rst:396 +#: ../../library/tarfile.rst:404 msgid "" "The :class:`TarFile` object provides an interface to a tar archive. A tar " "archive is a sequence of blocks. An archive member (a stored file) is made " "up of a header block followed by data blocks. It is possible to store a file " -"in a tar archive several times. Each archive member is represented by " -"a :class:`TarInfo` object, see :ref:`tarinfo-objects` for details." +"in a tar archive several times. Each archive member is represented by a :" +"class:`TarInfo` object, see :ref:`tarinfo-objects` for details." msgstr "" -#: ../../library/tarfile.rst:402 +#: ../../library/tarfile.rst:410 msgid "" -"A :class:`TarFile` object can be used as a context manager in " -"a :keyword:`with` statement. It will automatically be closed when the block " -"is completed. Please note that in the event of an exception an archive " -"opened for writing will not be finalized; only the internally used file " -"object will be closed. See the :ref:`tar-examples` section for a use case." +"A :class:`TarFile` object can be used as a context manager in a :keyword:" +"`with` statement. It will automatically be closed when the block is " +"completed. Please note that in the event of an exception an archive opened " +"for writing will not be finalized; only the internally used file object will " +"be closed. See the :ref:`tar-examples` section for a use case." msgstr "" -#: ../../library/tarfile.rst:408 +#: ../../library/tarfile.rst:416 msgid "Added support for the context management protocol." msgstr "新增對情境管理協定的支援。" -#: ../../library/tarfile.rst:413 +#: ../../library/tarfile.rst:421 msgid "" "All following arguments are optional and can be accessed as instance " "attributes as well." msgstr "" -#: ../../library/tarfile.rst:416 +#: ../../library/tarfile.rst:424 msgid "" "*name* is the pathname of the archive. *name* may be a :term:`path-like " "object`. It can be omitted if *fileobj* is given. In this case, the file " "object's :attr:`!name` attribute is used if it exists." msgstr "" -#: ../../library/tarfile.rst:420 +#: ../../library/tarfile.rst:428 msgid "" "*mode* is either ``'r'`` to read from an existing archive, ``'a'`` to append " "data to an existing file, ``'w'`` to create a new file overwriting an " @@ -682,18 +688,18 @@ msgid "" "exist." msgstr "" -#: ../../library/tarfile.rst:424 +#: ../../library/tarfile.rst:432 msgid "" "If *fileobj* is given, it is used for reading or writing data. If it can be " "determined, *mode* is overridden by *fileobj*'s mode. *fileobj* will be used " "from position 0." msgstr "" -#: ../../library/tarfile.rst:430 +#: ../../library/tarfile.rst:438 msgid "*fileobj* is not closed, when :class:`TarFile` is closed." msgstr "" -#: ../../library/tarfile.rst:432 +#: ../../library/tarfile.rst:440 msgid "" "*format* controls the archive format for writing. It must be one of the " "constants :const:`USTAR_FORMAT`, :const:`GNU_FORMAT` or :const:`PAX_FORMAT` " @@ -701,20 +707,20 @@ msgid "" "detected, even if different formats are present in a single archive." msgstr "" -#: ../../library/tarfile.rst:437 +#: ../../library/tarfile.rst:445 msgid "" "The *tarinfo* argument can be used to replace the default :class:`TarInfo` " "class with a different one." msgstr "" -#: ../../library/tarfile.rst:440 +#: ../../library/tarfile.rst:448 msgid "" "If *dereference* is :const:`False`, add symbolic and hard links to the " "archive. If it is :const:`True`, add the content of the target files to the " "archive. This has no effect on systems that do not support symbolic links." msgstr "" -#: ../../library/tarfile.rst:444 +#: ../../library/tarfile.rst:452 msgid "" "If *ignore_zeros* is :const:`False`, treat an empty block as the end of the " "archive. If it is :const:`True`, skip empty (and invalid) blocks and try to " @@ -722,77 +728,77 @@ msgid "" "concatenated or damaged archives." msgstr "" -#: ../../library/tarfile.rst:448 +#: ../../library/tarfile.rst:456 msgid "" "*debug* can be set from ``0`` (no debug messages) up to ``3`` (all debug " "messages). The messages are written to ``sys.stderr``." msgstr "" -#: ../../library/tarfile.rst:451 +#: ../../library/tarfile.rst:459 msgid "" "*errorlevel* controls how extraction errors are handled, see :attr:`the " "corresponding attribute `." msgstr "" -#: ../../library/tarfile.rst:454 +#: ../../library/tarfile.rst:462 msgid "" "The *encoding* and *errors* arguments define the character encoding to be " "used for reading or writing the archive and how conversion errors are going " -"to be handled. The default settings will work for most users. See " -"section :ref:`tar-unicode` for in-depth information." +"to be handled. The default settings will work for most users. See section :" +"ref:`tar-unicode` for in-depth information." msgstr "" -#: ../../library/tarfile.rst:459 +#: ../../library/tarfile.rst:467 msgid "" "The *pax_headers* argument is an optional dictionary of strings which will " "be added as a pax global header if *format* is :const:`PAX_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:462 +#: ../../library/tarfile.rst:470 msgid "" "If *stream* is set to :const:`True` then while reading the archive info " "about files in the archive are not cached, saving memory." msgstr "" -#: ../../library/tarfile.rst:465 ../../library/tarfile.rst:788 +#: ../../library/tarfile.rst:473 ../../library/tarfile.rst:796 msgid "Use ``'surrogateescape'`` as the default for the *errors* argument." msgstr "使用 ``'surrogateescape'`` 作為 *errors* 引數的預設值。" -#: ../../library/tarfile.rst:474 +#: ../../library/tarfile.rst:482 msgid "Add the *stream* parameter." msgstr "新增 *stream* 參數。" -#: ../../library/tarfile.rst:479 +#: ../../library/tarfile.rst:487 msgid "" "Alternative constructor. The :func:`tarfile.open` function is actually a " "shortcut to this classmethod." msgstr "" -#: ../../library/tarfile.rst:485 +#: ../../library/tarfile.rst:493 msgid "" "Return a :class:`TarInfo` object for member *name*. If *name* can not be " "found in the archive, :exc:`KeyError` is raised." msgstr "" -#: ../../library/tarfile.rst:490 +#: ../../library/tarfile.rst:498 msgid "" "If a member occurs more than once in the archive, its last occurrence is " "assumed to be the most up-to-date version." msgstr "" -#: ../../library/tarfile.rst:496 +#: ../../library/tarfile.rst:504 msgid "" "Return the members of the archive as a list of :class:`TarInfo` objects. The " "list has the same order as the members in the archive." msgstr "" -#: ../../library/tarfile.rst:502 +#: ../../library/tarfile.rst:510 msgid "" "Return the members as a list of their names. It has the same order as the " "list returned by :meth:`getmembers`." msgstr "" -#: ../../library/tarfile.rst:508 +#: ../../library/tarfile.rst:516 msgid "" "Print a table of contents to ``sys.stdout``. If *verbose* is :const:`False`, " "only the names of the members are printed. If it is :const:`True`, output " @@ -800,18 +806,18 @@ msgid "" "given, it must be a subset of the list returned by :meth:`getmembers`." msgstr "" -#: ../../library/tarfile.rst:513 +#: ../../library/tarfile.rst:521 msgid "Added the *members* parameter." msgstr "新增 *members* 參數。" -#: ../../library/tarfile.rst:519 +#: ../../library/tarfile.rst:527 msgid "" -"Return the next member of the archive as a :class:`TarInfo` object, " -"when :class:`TarFile` is opened for reading. Return :const:`None` if there " -"is no more available." +"Return the next member of the archive as a :class:`TarInfo` object, when :" +"class:`TarFile` is opened for reading. Return :const:`None` if there is no " +"more available." msgstr "" -#: ../../library/tarfile.rst:526 +#: ../../library/tarfile.rst:534 msgid "" "Extract all members from the archive to the current working directory or " "directory *path*. If optional *members* is given, it must be a subset of the " @@ -823,14 +829,14 @@ msgid "" "fail." msgstr "" -#: ../../library/tarfile.rst:534 +#: ../../library/tarfile.rst:542 msgid "" "If *numeric_owner* is :const:`True`, the uid and gid numbers from the " "tarfile are used to set the owner/group for the extracted files. Otherwise, " "the named values from the tarfile are used." msgstr "" -#: ../../library/tarfile.rst:538 +#: ../../library/tarfile.rst:546 msgid "" "The *filter* argument specifies how ``members`` are modified or rejected " "before extraction. See :ref:`tarfile-extraction-filter` for details. It is " @@ -839,11 +845,11 @@ msgid "" "secure default (3.13 and lower)." msgstr "" -#: ../../library/tarfile.rst:547 +#: ../../library/tarfile.rst:555 msgid "Never extract archives from untrusted sources without prior inspection." msgstr "" -#: ../../library/tarfile.rst:549 +#: ../../library/tarfile.rst:557 msgid "" "Since Python 3.14, the default (:func:`data `) will prevent the " "most dangerous security issues. However, it will not prevent *all* " @@ -851,24 +857,24 @@ msgid "" "section for details." msgstr "" -#: ../../library/tarfile.rst:554 ../../library/tarfile.rst:591 +#: ../../library/tarfile.rst:562 ../../library/tarfile.rst:599 msgid "Added the *numeric_owner* parameter." msgstr "新增 *numeric_owner* 參數。" -#: ../../library/tarfile.rst:557 ../../library/tarfile.rst:594 +#: ../../library/tarfile.rst:565 ../../library/tarfile.rst:602 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/tarfile.rst:560 ../../library/tarfile.rst:597 -#: ../../library/tarfile.rst:681 +#: ../../library/tarfile.rst:568 ../../library/tarfile.rst:605 +#: ../../library/tarfile.rst:689 msgid "Added the *filter* parameter." msgstr "新增 *filter* 參數。" -#: ../../library/tarfile.rst:563 +#: ../../library/tarfile.rst:571 msgid "The *filter* parameter now defaults to ``'data'``." msgstr "" -#: ../../library/tarfile.rst:569 +#: ../../library/tarfile.rst:577 msgid "" "Extract a member from the archive to the current working directory, using " "its full name. Its file information is extracted as accurately as possible. " @@ -877,29 +883,29 @@ msgid "" "File attributes (owner, mtime, mode) are set unless *set_attrs* is false." msgstr "" -#: ../../library/tarfile.rst:575 +#: ../../library/tarfile.rst:583 msgid "" -"The *numeric_owner* and *filter* arguments are the same as " -"for :meth:`extractall`." +"The *numeric_owner* and *filter* arguments are the same as for :meth:" +"`extractall`." msgstr "" -#: ../../library/tarfile.rst:580 +#: ../../library/tarfile.rst:588 msgid "" "The :meth:`extract` method does not take care of several extraction issues. " "In most cases you should consider using the :meth:`extractall` method." msgstr "" -#: ../../library/tarfile.rst:585 +#: ../../library/tarfile.rst:593 msgid "" "Never extract archives from untrusted sources without prior inspection. See " "the warning for :meth:`extractall` for details." msgstr "" -#: ../../library/tarfile.rst:588 +#: ../../library/tarfile.rst:596 msgid "Added the *set_attrs* parameter." msgstr "增加 *set_attrs* 參數。" -#: ../../library/tarfile.rst:603 +#: ../../library/tarfile.rst:611 msgid "" "Extract a member from the archive as a file object. *member* may be a " "filename or a :class:`TarInfo` object. If *member* is a regular file or a " @@ -908,65 +914,65 @@ msgid "" "the archive, :exc:`KeyError` is raised." msgstr "" -#: ../../library/tarfile.rst:609 +#: ../../library/tarfile.rst:617 msgid "Return an :class:`io.BufferedReader` object." msgstr "" -#: ../../library/tarfile.rst:612 +#: ../../library/tarfile.rst:620 msgid "" "The returned :class:`io.BufferedReader` object has the :attr:`!mode` " "attribute which is always equal to ``'rb'``." msgstr "" -#: ../../library/tarfile.rst:619 +#: ../../library/tarfile.rst:627 msgid "" -"If *errorlevel* is ``0``, errors are ignored when " -"using :meth:`TarFile.extract` and :meth:`TarFile.extractall`. Nevertheless, " -"they appear as error messages in the debug output when *debug* is greater " -"than 0. If ``1`` (the default), all *fatal* errors are raised " -"as :exc:`OSError` or :exc:`FilterError` exceptions. If ``2``, all *non-" -"fatal* errors are raised as :exc:`TarError` exceptions as well." +"If *errorlevel* is ``0``, errors are ignored when using :meth:`TarFile." +"extract` and :meth:`TarFile.extractall`. Nevertheless, they appear as error " +"messages in the debug output when *debug* is greater than 0. If ``1`` (the " +"default), all *fatal* errors are raised as :exc:`OSError` or :exc:" +"`FilterError` exceptions. If ``2``, all *non-fatal* errors are raised as :" +"exc:`TarError` exceptions as well." msgstr "" -#: ../../library/tarfile.rst:627 +#: ../../library/tarfile.rst:635 msgid "" "Some exceptions, e.g. ones caused by wrong argument types or data " "corruption, are always raised." msgstr "" -#: ../../library/tarfile.rst:630 +#: ../../library/tarfile.rst:638 msgid "" -"Custom :ref:`extraction filters ` should " -"raise :exc:`FilterError` for *fatal* errors and :exc:`ExtractError` for *non-" -"fatal* ones." +"Custom :ref:`extraction filters ` should raise :" +"exc:`FilterError` for *fatal* errors and :exc:`ExtractError` for *non-fatal* " +"ones." msgstr "" -#: ../../library/tarfile.rst:634 +#: ../../library/tarfile.rst:642 msgid "" "Note that when an exception is raised, the archive may be partially " "extracted. It is the user’s responsibility to clean up." msgstr "" -#: ../../library/tarfile.rst:641 +#: ../../library/tarfile.rst:649 msgid "" "The :ref:`extraction filter ` used as a default " -"for the *filter* argument of :meth:`~TarFile.extract` " -"and :meth:`~TarFile.extractall`." +"for the *filter* argument of :meth:`~TarFile.extract` and :meth:`~TarFile." +"extractall`." msgstr "" -#: ../../library/tarfile.rst:645 +#: ../../library/tarfile.rst:653 msgid "" "The attribute may be ``None`` or a callable. String names are not allowed " "for this attribute, unlike the *filter* argument to :meth:`~TarFile.extract`." msgstr "" -#: ../../library/tarfile.rst:649 +#: ../../library/tarfile.rst:657 msgid "" "If ``extraction_filter`` is ``None`` (the default), extraction methods will " "use the :func:`data ` filter by default." msgstr "" -#: ../../library/tarfile.rst:652 +#: ../../library/tarfile.rst:660 msgid "" "The attribute may be set on instances or overridden in subclasses. It also " "is possible to set it on the ``TarFile`` class itself to set a global " @@ -976,45 +982,45 @@ msgid "" "wrapped in :func:`staticmethod` to prevent injection of a ``self`` argument." msgstr "" -#: ../../library/tarfile.rst:662 +#: ../../library/tarfile.rst:670 msgid "" "The default filter is set to :func:`data `, which disallows " "some dangerous features such as links to absolute paths or paths outside of " -"the destination. Previously, the default was equivalent " -"to :func:`fully_trusted `." +"the destination. Previously, the default was equivalent to :func:" +"`fully_trusted `." msgstr "" -#: ../../library/tarfile.rst:670 +#: ../../library/tarfile.rst:678 msgid "" "Add the file *name* to the archive. *name* may be any type of file " "(directory, fifo, symbolic link, etc.). If given, *arcname* specifies an " "alternative name for the file in the archive. Directories are added " -"recursively by default. This can be avoided by setting *recursive* " -"to :const:`False`. Recursion adds entries in sorted order. If *filter* is " -"given, it should be a function that takes a :class:`TarInfo` object argument " -"and returns the changed :class:`TarInfo` object. If it instead " -"returns :const:`None` the :class:`TarInfo` object will be excluded from the " -"archive. See :ref:`tar-examples` for an example." +"recursively by default. This can be avoided by setting *recursive* to :const:" +"`False`. Recursion adds entries in sorted order. If *filter* is given, it " +"should be a function that takes a :class:`TarInfo` object argument and " +"returns the changed :class:`TarInfo` object. If it instead returns :const:" +"`None` the :class:`TarInfo` object will be excluded from the archive. See :" +"ref:`tar-examples` for an example." msgstr "" -#: ../../library/tarfile.rst:684 +#: ../../library/tarfile.rst:692 msgid "Recursion adds entries in sorted order." msgstr "" -#: ../../library/tarfile.rst:690 +#: ../../library/tarfile.rst:698 msgid "" "Add the :class:`TarInfo` object *tarinfo* to the archive. If *tarinfo* " -"represents a non zero-size regular file, the *fileobj* argument should be " -"a :term:`binary file`, and ``tarinfo.size`` bytes are read from it and added " -"to the archive. You can create :class:`TarInfo` objects directly, or by " -"using :meth:`gettarinfo`." +"represents a non zero-size regular file, the *fileobj* argument should be a :" +"term:`binary file`, and ``tarinfo.size`` bytes are read from it and added to " +"the archive. You can create :class:`TarInfo` objects directly, or by using :" +"meth:`gettarinfo`." msgstr "" -#: ../../library/tarfile.rst:697 +#: ../../library/tarfile.rst:705 msgid "*fileobj* must be given for non-zero-sized regular files." msgstr "" -#: ../../library/tarfile.rst:702 +#: ../../library/tarfile.rst:710 msgid "" "Create a :class:`TarInfo` object from the result of :func:`os.stat` or " "equivalent on an existing file. The file is either named by *name*, or " @@ -1025,31 +1031,31 @@ msgid "" "The name should be a text string." msgstr "" -#: ../../library/tarfile.rst:711 +#: ../../library/tarfile.rst:719 msgid "" "You can modify some of the :class:`TarInfo`’s attributes before you add it " "using :meth:`addfile`. If the file object is not an ordinary file object " -"positioned at the beginning of the file, attributes such " -"as :attr:`~TarInfo.size` may need modifying. This is the case for objects " -"such as :class:`~gzip.GzipFile`. The :attr:`~TarInfo.name` may also be " -"modified, in which case *arcname* could be a dummy string." +"positioned at the beginning of the file, attributes such as :attr:`~TarInfo." +"size` may need modifying. This is the case for objects such as :class:" +"`~gzip.GzipFile`. The :attr:`~TarInfo.name` may also be modified, in which " +"case *arcname* could be a dummy string." msgstr "" -#: ../../library/tarfile.rst:725 +#: ../../library/tarfile.rst:733 msgid "" "Close the :class:`TarFile`. In write mode, two finishing zero blocks are " "appended to the archive." msgstr "" -#: ../../library/tarfile.rst:732 +#: ../../library/tarfile.rst:740 msgid "A dictionary containing key-value pairs of pax global headers." msgstr "" -#: ../../library/tarfile.rst:739 +#: ../../library/tarfile.rst:747 msgid "TarInfo Objects" msgstr "TarInfo 物件" -#: ../../library/tarfile.rst:741 +#: ../../library/tarfile.rst:749 msgid "" "A :class:`TarInfo` object represents one member in a :class:`TarFile`. Aside " "from storing all required attributes of a file (like file type, size, time, " @@ -1057,228 +1063,228 @@ msgid "" "type. It does *not* contain the file's data itself." msgstr "" -#: ../../library/tarfile.rst:746 +#: ../../library/tarfile.rst:754 msgid "" -":class:`TarInfo` objects are returned by :class:`TarFile`'s " -"methods :meth:`~TarFile.getmember`, :meth:`~TarFile.getmembers` " -"and :meth:`~TarFile.gettarinfo`." +":class:`TarInfo` objects are returned by :class:`TarFile`'s methods :meth:" +"`~TarFile.getmember`, :meth:`~TarFile.getmembers` and :meth:`~TarFile." +"gettarinfo`." msgstr "" -#: ../../library/tarfile.rst:750 +#: ../../library/tarfile.rst:758 msgid "" -"Modifying the objects returned by :meth:`~TarFile.getmember` " -"or :meth:`~TarFile.getmembers` will affect all subsequent operations on the " -"archive. For cases where this is unwanted, you can use :mod:`copy.copy() " -"` or call the :meth:`~TarInfo.replace` method to create a modified " -"copy in one step." +"Modifying the objects returned by :meth:`~TarFile.getmember` or :meth:" +"`~TarFile.getmembers` will affect all subsequent operations on the archive. " +"For cases where this is unwanted, you can use :mod:`copy.copy() ` or " +"call the :meth:`~TarInfo.replace` method to create a modified copy in one " +"step." msgstr "" -#: ../../library/tarfile.rst:756 +#: ../../library/tarfile.rst:764 msgid "" "Several attributes can be set to ``None`` to indicate that a piece of " "metadata is unused or unknown. Different :class:`TarInfo` methods handle " "``None`` differently:" msgstr "" -#: ../../library/tarfile.rst:760 +#: ../../library/tarfile.rst:768 msgid "" "The :meth:`~TarFile.extract` or :meth:`~TarFile.extractall` methods will " "ignore the corresponding metadata, leaving it set to a default." msgstr "" -#: ../../library/tarfile.rst:762 +#: ../../library/tarfile.rst:770 msgid ":meth:`~TarFile.addfile` will fail." msgstr "" -#: ../../library/tarfile.rst:763 +#: ../../library/tarfile.rst:771 msgid ":meth:`~TarFile.list` will print a placeholder string." msgstr "" -#: ../../library/tarfile.rst:767 +#: ../../library/tarfile.rst:775 msgid "Create a :class:`TarInfo` object." msgstr "" -#: ../../library/tarfile.rst:772 +#: ../../library/tarfile.rst:780 msgid "Create and return a :class:`TarInfo` object from string buffer *buf*." msgstr "" -#: ../../library/tarfile.rst:774 +#: ../../library/tarfile.rst:782 msgid "Raises :exc:`HeaderError` if the buffer is invalid." msgstr "" -#: ../../library/tarfile.rst:779 +#: ../../library/tarfile.rst:787 msgid "" "Read the next member from the :class:`TarFile` object *tarfile* and return " "it as a :class:`TarInfo` object." msgstr "" -#: ../../library/tarfile.rst:785 +#: ../../library/tarfile.rst:793 msgid "" "Create a string buffer from a :class:`TarInfo` object. For information on " "the arguments see the constructor of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:792 +#: ../../library/tarfile.rst:800 msgid "A ``TarInfo`` object has the following public data attributes:" msgstr "一個 ``TarInfo`` 物件具有以下公開資料屬性:" -#: ../../library/tarfile.rst:798 +#: ../../library/tarfile.rst:806 msgid "Name of the archive member." msgstr "" -#: ../../library/tarfile.rst:804 +#: ../../library/tarfile.rst:812 msgid "Size in bytes." msgstr "" -#: ../../library/tarfile.rst:810 +#: ../../library/tarfile.rst:818 msgid "" -"Time of last modification in seconds since the :ref:`epoch `, as " -"in :attr:`os.stat_result.st_mtime`." +"Time of last modification in seconds since the :ref:`epoch `, as in :" +"attr:`os.stat_result.st_mtime`." msgstr "" -#: ../../library/tarfile.rst:815 ../../library/tarfile.rst:826 -#: ../../library/tarfile.rst:858 ../../library/tarfile.rst:869 -#: ../../library/tarfile.rst:880 ../../library/tarfile.rst:891 +#: ../../library/tarfile.rst:823 ../../library/tarfile.rst:834 +#: ../../library/tarfile.rst:866 ../../library/tarfile.rst:877 +#: ../../library/tarfile.rst:888 ../../library/tarfile.rst:899 msgid "" -"Can be set to ``None`` for :meth:`~TarFile.extract` " -"and :meth:`~TarFile.extractall`, causing extraction to skip applying this " -"attribute." +"Can be set to ``None`` for :meth:`~TarFile.extract` and :meth:`~TarFile." +"extractall`, causing extraction to skip applying this attribute." msgstr "" -#: ../../library/tarfile.rst:822 +#: ../../library/tarfile.rst:830 msgid "Permission bits, as for :func:`os.chmod`." msgstr "" -#: ../../library/tarfile.rst:832 +#: ../../library/tarfile.rst:840 msgid "" -"File type. *type* is usually one of these " -"constants: :const:`REGTYPE`, :const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`, :const:`FIFOTYPE`, :const:`CONTTYPE`, :const:`CHRTYPE`, :const:`BLKTYPE`, :const:`GNUTYPE_SPARSE`. " -"To determine the type of a :class:`TarInfo` object more conveniently, use " -"the ``is*()`` methods below." +"File type. *type* is usually one of these constants: :const:`REGTYPE`, :" +"const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`, :" +"const:`FIFOTYPE`, :const:`CONTTYPE`, :const:`CHRTYPE`, :const:`BLKTYPE`, :" +"const:`GNUTYPE_SPARSE`. To determine the type of a :class:`TarInfo` object " +"more conveniently, use the ``is*()`` methods below." msgstr "" -#: ../../library/tarfile.rst:842 +#: ../../library/tarfile.rst:850 msgid "" "Name of the target file name, which is only present in :class:`TarInfo` " "objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." msgstr "" -#: ../../library/tarfile.rst:845 +#: ../../library/tarfile.rst:853 msgid "" "For symbolic links (``SYMTYPE``), the *linkname* is relative to the " "directory that contains the link. For hard links (``LNKTYPE``), the " "*linkname* is relative to the root of the archive." msgstr "" -#: ../../library/tarfile.rst:854 +#: ../../library/tarfile.rst:862 msgid "User ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:865 +#: ../../library/tarfile.rst:873 msgid "Group ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:876 +#: ../../library/tarfile.rst:884 msgid "User name." msgstr "" -#: ../../library/tarfile.rst:887 +#: ../../library/tarfile.rst:895 msgid "Group name." msgstr "" -#: ../../library/tarfile.rst:898 +#: ../../library/tarfile.rst:906 msgid "Header checksum." msgstr "" -#: ../../library/tarfile.rst:904 +#: ../../library/tarfile.rst:912 msgid "Device major number." msgstr "" -#: ../../library/tarfile.rst:910 +#: ../../library/tarfile.rst:918 msgid "Device minor number." msgstr "" -#: ../../library/tarfile.rst:916 +#: ../../library/tarfile.rst:924 msgid "The tar header starts here." msgstr "" -#: ../../library/tarfile.rst:922 +#: ../../library/tarfile.rst:930 msgid "The file's data starts here." msgstr "" -#: ../../library/tarfile.rst:927 +#: ../../library/tarfile.rst:935 msgid "Sparse member information." msgstr "" -#: ../../library/tarfile.rst:933 +#: ../../library/tarfile.rst:941 msgid "" "A dictionary containing key-value pairs of an associated pax extended header." msgstr "" -#: ../../library/tarfile.rst:941 +#: ../../library/tarfile.rst:949 msgid "" "Return a *new* copy of the :class:`!TarInfo` object with the given " "attributes changed. For example, to return a ``TarInfo`` with the group name " "set to ``'staff'``, use::" msgstr "" -#: ../../library/tarfile.rst:945 +#: ../../library/tarfile.rst:953 msgid "new_tarinfo = old_tarinfo.replace(gname='staff')" msgstr "new_tarinfo = old_tarinfo.replace(gname='staff')" -#: ../../library/tarfile.rst:947 +#: ../../library/tarfile.rst:955 msgid "" -"By default, a deep copy is made. If *deep* is false, the copy is shallow, " -"i.e. ``pax_headers`` and any custom attributes are shared with the original " +"By default, a deep copy is made. If *deep* is false, the copy is shallow, i." +"e. ``pax_headers`` and any custom attributes are shared with the original " "``TarInfo`` object." msgstr "" -#: ../../library/tarfile.rst:951 +#: ../../library/tarfile.rst:959 msgid "A :class:`TarInfo` object also provides some convenient query methods:" msgstr "" -#: ../../library/tarfile.rst:956 +#: ../../library/tarfile.rst:964 msgid "Return :const:`True` if the :class:`TarInfo` object is a regular file." msgstr "" -#: ../../library/tarfile.rst:961 +#: ../../library/tarfile.rst:969 msgid "Same as :meth:`isfile`." msgstr "" -#: ../../library/tarfile.rst:966 +#: ../../library/tarfile.rst:974 msgid "Return :const:`True` if it is a directory." msgstr "如果它是一個目錄,則回傳 :const:`True`。" -#: ../../library/tarfile.rst:971 +#: ../../library/tarfile.rst:979 msgid "Return :const:`True` if it is a symbolic link." msgstr "如果它是一個符號連結,則回傳 :const:`True`。" -#: ../../library/tarfile.rst:976 +#: ../../library/tarfile.rst:984 msgid "Return :const:`True` if it is a hard link." msgstr "" -#: ../../library/tarfile.rst:981 +#: ../../library/tarfile.rst:989 msgid "Return :const:`True` if it is a character device." msgstr "如果它是一個字元裝置,則回傳 :const:`True`。" -#: ../../library/tarfile.rst:986 +#: ../../library/tarfile.rst:994 msgid "Return :const:`True` if it is a block device." msgstr "如果它是一個區塊裝置,則回傳 :const:`True`。" -#: ../../library/tarfile.rst:991 +#: ../../library/tarfile.rst:999 msgid "Return :const:`True` if it is a FIFO." msgstr "如果它是一個 FIFO,則回傳 :const:`True`。" -#: ../../library/tarfile.rst:996 +#: ../../library/tarfile.rst:1004 msgid "" "Return :const:`True` if it is one of character device, block device or FIFO." msgstr "如果它是一個字元裝置、區塊裝置或 FIFO,則回傳 :const:`True`。" -#: ../../library/tarfile.rst:1002 +#: ../../library/tarfile.rst:1010 msgid "Extraction filters" msgstr "" -#: ../../library/tarfile.rst:1006 +#: ../../library/tarfile.rst:1014 msgid "" "The *tar* format is designed to capture all details of a UNIX-like " "filesystem, which makes it very powerful. Unfortunately, the features make " @@ -1288,237 +1294,236 @@ msgid "" "components, or symlinks that affect later members)." msgstr "" -#: ../../library/tarfile.rst:1014 +#: ../../library/tarfile.rst:1022 msgid "" "In most cases, the full functionality is not needed. Therefore, *tarfile* " "supports extraction filters: a mechanism to limit functionality, and thus " "mitigate some of the security issues." msgstr "" -#: ../../library/tarfile.rst:1020 +#: ../../library/tarfile.rst:1028 msgid "" "None of the available filters blocks *all* dangerous archive features. Never " -"extract archives from untrusted sources without prior inspection. See " -"also :ref:`tarfile-further-verification`." +"extract archives from untrusted sources without prior inspection. See also :" +"ref:`tarfile-further-verification`." msgstr "" -#: ../../library/tarfile.rst:1026 +#: ../../library/tarfile.rst:1034 msgid ":pep:`706`" msgstr ":pep:`706`" -#: ../../library/tarfile.rst:1027 +#: ../../library/tarfile.rst:1035 msgid "Contains further motivation and rationale behind the design." msgstr "" -#: ../../library/tarfile.rst:1029 +#: ../../library/tarfile.rst:1037 msgid "" -"The *filter* argument to :meth:`TarFile.extract` " -"or :meth:`~TarFile.extractall` can be:" +"The *filter* argument to :meth:`TarFile.extract` or :meth:`~TarFile." +"extractall` can be:" msgstr "" -#: ../../library/tarfile.rst:1032 +#: ../../library/tarfile.rst:1040 msgid "" "the string ``'fully_trusted'``: Honor all metadata as specified in the " "archive. Should be used if the user trusts the archive completely, or " "implements their own complex verification." msgstr "" -#: ../../library/tarfile.rst:1037 +#: ../../library/tarfile.rst:1045 msgid "" "the string ``'tar'``: Honor most *tar*-specific features (i.e. features of " "UNIX-like filesystems), but block features that are very likely to be " "surprising or malicious. See :func:`tar_filter` for details." msgstr "" -#: ../../library/tarfile.rst:1041 +#: ../../library/tarfile.rst:1049 msgid "" "the string ``'data'``: Ignore or block most features specific to UNIX-like " -"filesystems. Intended for extracting cross-platform data archives. " -"See :func:`data_filter` for details." +"filesystems. Intended for extracting cross-platform data archives. See :func:" +"`data_filter` for details." msgstr "" -#: ../../library/tarfile.rst:1045 +#: ../../library/tarfile.rst:1053 msgid "``None`` (default): Use :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:1047 +#: ../../library/tarfile.rst:1055 msgid "" "If that is also ``None`` (the default), the ``'data'`` filter will be used." msgstr "" -#: ../../library/tarfile.rst:1051 +#: ../../library/tarfile.rst:1059 msgid "" "The default filter is set to :func:`data `. Previously, the " "default was equivalent to :func:`fully_trusted `." msgstr "" -#: ../../library/tarfile.rst:1055 +#: ../../library/tarfile.rst:1063 msgid "" -"A callable which will be called for each extracted member with " -"a :ref:`TarInfo ` describing the member and the destination " -"path to where the archive is extracted (i.e. the same path is used for all " +"A callable which will be called for each extracted member with a :ref:" +"`TarInfo ` describing the member and the destination path " +"to where the archive is extracted (i.e. the same path is used for all " "members)::" msgstr "" -#: ../../library/tarfile.rst:1060 +#: ../../library/tarfile.rst:1068 msgid "filter(member: TarInfo, path: str, /) -> TarInfo | None" msgstr "filter(member: TarInfo, path: str, /) -> TarInfo | None" -#: ../../library/tarfile.rst:1062 +#: ../../library/tarfile.rst:1070 msgid "" "The callable is called just before each member is extracted, so it can take " "the current state of the disk into account. It can:" msgstr "" -#: ../../library/tarfile.rst:1066 +#: ../../library/tarfile.rst:1074 msgid "" "return a :class:`TarInfo` object which will be used instead of the metadata " "in the archive, or" msgstr "" -#: ../../library/tarfile.rst:1068 +#: ../../library/tarfile.rst:1076 msgid "return ``None``, in which case the member will be skipped, or" msgstr "" -#: ../../library/tarfile.rst:1069 +#: ../../library/tarfile.rst:1077 msgid "" -"raise an exception to abort the operation or skip the member, depending " -"on :attr:`~TarFile.errorlevel`. Note that when extraction is " -"aborted, :meth:`~TarFile.extractall` may leave the archive partially " -"extracted. It does not attempt to clean up." +"raise an exception to abort the operation or skip the member, depending on :" +"attr:`~TarFile.errorlevel`. Note that when extraction is aborted, :meth:" +"`~TarFile.extractall` may leave the archive partially extracted. It does not " +"attempt to clean up." msgstr "" -#: ../../library/tarfile.rst:1075 +#: ../../library/tarfile.rst:1083 msgid "Default named filters" msgstr "" -#: ../../library/tarfile.rst:1077 +#: ../../library/tarfile.rst:1085 msgid "" "The pre-defined, named filters are available as functions, so they can be " "reused in custom filters:" msgstr "" -#: ../../library/tarfile.rst:1082 +#: ../../library/tarfile.rst:1090 msgid "Return *member* unchanged." msgstr "" -#: ../../library/tarfile.rst:1084 +#: ../../library/tarfile.rst:1092 msgid "This implements the ``'fully_trusted'`` filter." msgstr "" -#: ../../library/tarfile.rst:1088 +#: ../../library/tarfile.rst:1096 msgid "Implements the ``'tar'`` filter." msgstr "" -#: ../../library/tarfile.rst:1090 +#: ../../library/tarfile.rst:1098 msgid "Strip leading slashes (``/`` and :data:`os.sep`) from filenames." msgstr "" -#: ../../library/tarfile.rst:1091 +#: ../../library/tarfile.rst:1099 msgid "" ":ref:`Refuse ` to extract files with absolute " "paths (in case the name is absolute even after stripping slashes, e.g. ``C:/" "foo`` on Windows). This raises :class:`~tarfile.AbsolutePathError`." msgstr "" -#: ../../library/tarfile.rst:1095 +#: ../../library/tarfile.rst:1103 msgid "" ":ref:`Refuse ` to extract files whose absolute " "path (after following symlinks) would end up outside the destination. This " "raises :class:`~tarfile.OutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:1098 +#: ../../library/tarfile.rst:1106 msgid "" -"Clear high mode bits (setuid, setgid, sticky) and group/other write bits " -"(:const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`)." +"Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" +"const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`)." msgstr "" -#: ../../library/tarfile.rst:1101 ../../library/tarfile.rst:1140 +#: ../../library/tarfile.rst:1109 ../../library/tarfile.rst:1148 msgid "Return the modified ``TarInfo`` member." msgstr "" -#: ../../library/tarfile.rst:1105 +#: ../../library/tarfile.rst:1113 msgid "" "Implements the ``'data'`` filter. In addition to what ``tar_filter`` does:" msgstr "" -#: ../../library/tarfile.rst:1108 +#: ../../library/tarfile.rst:1116 msgid "" -"Normalize link targets (:attr:`TarInfo.linkname`) " -"using :func:`os.path.normpath`. Note that this removes internal ``..`` " -"components, which may change the meaning of the link if the path in :attr:`!" -"TarInfo.linkname` traverses symbolic links." +"Normalize link targets (:attr:`TarInfo.linkname`) using :func:`os.path." +"normpath`. Note that this removes internal ``..`` components, which may " +"change the meaning of the link if the path in :attr:`!TarInfo.linkname` " +"traverses symbolic links." msgstr "" -#: ../../library/tarfile.rst:1114 +#: ../../library/tarfile.rst:1122 msgid "" ":ref:`Refuse ` to extract links (hard or soft) " "that link to absolute paths, or ones that link outside the destination." msgstr "" -#: ../../library/tarfile.rst:1117 +#: ../../library/tarfile.rst:1125 msgid "" -"This raises :class:`~tarfile.AbsoluteLinkError` " -"or :class:`~tarfile.LinkOutsideDestinationError`." +"This raises :class:`~tarfile.AbsoluteLinkError` or :class:`~tarfile." +"LinkOutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:1120 +#: ../../library/tarfile.rst:1128 msgid "" "Note that such files are refused even on platforms that do not support " "symbolic links." msgstr "" -#: ../../library/tarfile.rst:1123 +#: ../../library/tarfile.rst:1131 msgid "" ":ref:`Refuse ` to extract device files (including " "pipes). This raises :class:`~tarfile.SpecialFileError`." msgstr "" -#: ../../library/tarfile.rst:1127 +#: ../../library/tarfile.rst:1135 msgid "For regular files, including hard links:" msgstr "" -#: ../../library/tarfile.rst:1129 +#: ../../library/tarfile.rst:1137 msgid "" -"Set the owner read and write permissions (:const:`~stat.S_IRUSR` " -"| :const:`~stat.S_IWUSR`)." +"Set the owner read and write permissions (:const:`~stat.S_IRUSR` | :const:" +"`~stat.S_IWUSR`)." msgstr "" -#: ../../library/tarfile.rst:1131 +#: ../../library/tarfile.rst:1139 msgid "" -"Remove the group & other executable permission (:const:`~stat.S_IXGRP` " -"| :const:`~stat.S_IXOTH`) if the owner doesn’t have it " -"(:const:`~stat.S_IXUSR`)." +"Remove the group & other executable permission (:const:`~stat.S_IXGRP` | :" +"const:`~stat.S_IXOTH`) if the owner doesn’t have it (:const:`~stat.S_IXUSR`)." msgstr "" -#: ../../library/tarfile.rst:1135 +#: ../../library/tarfile.rst:1143 msgid "" "For other files (directories), set ``mode`` to ``None``, so that extraction " "methods skip applying permission bits." msgstr "" -#: ../../library/tarfile.rst:1137 +#: ../../library/tarfile.rst:1145 msgid "" "Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to " "``None``, so that extraction methods skip setting it." msgstr "" -#: ../../library/tarfile.rst:1142 +#: ../../library/tarfile.rst:1150 msgid "" -"Note that this filter does not block *all* dangerous archive features. " -"See :ref:`tarfile-further-verification` for details." +"Note that this filter does not block *all* dangerous archive features. See :" +"ref:`tarfile-further-verification` for details." msgstr "" -#: ../../library/tarfile.rst:1147 +#: ../../library/tarfile.rst:1155 msgid "Link targets are now normalized." msgstr "" -#: ../../library/tarfile.rst:1153 +#: ../../library/tarfile.rst:1161 msgid "Filter errors" msgstr "" -#: ../../library/tarfile.rst:1155 +#: ../../library/tarfile.rst:1163 msgid "" "When a filter refuses to extract a file, it will raise an appropriate " "exception, a subclass of :class:`~tarfile.FilterError`. This will abort the " @@ -1527,11 +1532,11 @@ msgid "" "continue." msgstr "" -#: ../../library/tarfile.rst:1165 +#: ../../library/tarfile.rst:1173 msgid "Hints for further verification" msgstr "" -#: ../../library/tarfile.rst:1167 +#: ../../library/tarfile.rst:1175 msgid "" "Even with ``filter='data'``, *tarfile* is not suited for extracting " "untrusted files without prior inspection. Among other issues, the pre-" @@ -1539,73 +1544,73 @@ msgid "" "additional checks." msgstr "" -#: ../../library/tarfile.rst:1172 +#: ../../library/tarfile.rst:1180 msgid "Here is an incomplete list of things to consider:" msgstr "" -#: ../../library/tarfile.rst:1174 +#: ../../library/tarfile.rst:1182 msgid "" -"Extract to a :func:`new temporary directory ` to prevent " -"e.g. exploiting pre-existing links, and to make it easier to clean up after " -"a failed extraction." +"Extract to a :func:`new temporary directory ` to prevent e." +"g. exploiting pre-existing links, and to make it easier to clean up after a " +"failed extraction." msgstr "" -#: ../../library/tarfile.rst:1177 +#: ../../library/tarfile.rst:1185 msgid "Disallow symbolic links if you do not need the functionality." msgstr "" -#: ../../library/tarfile.rst:1178 +#: ../../library/tarfile.rst:1186 msgid "" "When working with untrusted data, use external (e.g. OS-level) limits on " "disk, memory and CPU usage." msgstr "" -#: ../../library/tarfile.rst:1180 +#: ../../library/tarfile.rst:1188 msgid "" "Check filenames against an allow-list of characters (to filter out control " "characters, confusables, foreign path separators, and so on)." msgstr "" -#: ../../library/tarfile.rst:1183 +#: ../../library/tarfile.rst:1191 msgid "" "Check that filenames have expected extensions (discouraging files that " "execute when you “click on them”, or extension-less files like Windows " "special device names)." msgstr "" -#: ../../library/tarfile.rst:1186 +#: ../../library/tarfile.rst:1194 msgid "" "Limit the number of extracted files, total size of extracted data, filename " "length (including symlink length), and size of individual files." msgstr "" -#: ../../library/tarfile.rst:1188 +#: ../../library/tarfile.rst:1196 msgid "Check for files that would be shadowed on case-insensitive filesystems." msgstr "" -#: ../../library/tarfile.rst:1190 +#: ../../library/tarfile.rst:1198 msgid "Also note that:" msgstr "" -#: ../../library/tarfile.rst:1192 +#: ../../library/tarfile.rst:1200 msgid "" "Tar files may contain multiple versions of the same file. Later ones are " "expected to overwrite any earlier ones. This feature is crucial to allow " "updating tape archives, but can be abused maliciously." msgstr "" -#: ../../library/tarfile.rst:1196 +#: ../../library/tarfile.rst:1204 msgid "" "*tarfile* does not protect against issues with “live” data, e.g. an attacker " "tinkering with the destination (or source) directory while extraction (or " "archiving) is in progress." msgstr "" -#: ../../library/tarfile.rst:1202 +#: ../../library/tarfile.rst:1210 msgid "Supporting older Python versions" msgstr "" -#: ../../library/tarfile.rst:1204 +#: ../../library/tarfile.rst:1212 msgid "" "Extraction filters were added to Python 3.12, but may be backported to older " "versions as security updates. To check whether the feature is available, use " @@ -1613,18 +1618,18 @@ msgid "" "version." msgstr "" -#: ../../library/tarfile.rst:1209 +#: ../../library/tarfile.rst:1217 msgid "" "The following examples show how to support Python versions with and without " "the feature. Note that setting ``extraction_filter`` will affect any " "subsequent operations." msgstr "" -#: ../../library/tarfile.rst:1213 +#: ../../library/tarfile.rst:1221 msgid "Fully trusted archive::" msgstr "" -#: ../../library/tarfile.rst:1215 +#: ../../library/tarfile.rst:1223 msgid "" "my_tarfile.extraction_filter = (lambda member, path: member)\n" "my_tarfile.extractall()" @@ -1632,13 +1637,13 @@ msgstr "" "my_tarfile.extraction_filter = (lambda member, path: member)\n" "my_tarfile.extractall()" -#: ../../library/tarfile.rst:1218 +#: ../../library/tarfile.rst:1226 msgid "" "Use the ``'data'`` filter if available, but revert to Python 3.11 behavior " "(``'fully_trusted'``) if this feature is not available::" msgstr "" -#: ../../library/tarfile.rst:1221 +#: ../../library/tarfile.rst:1229 msgid "" "my_tarfile.extraction_filter = getattr(tarfile, 'data_filter',\n" " (lambda member, path: member))\n" @@ -1648,19 +1653,19 @@ msgstr "" " (lambda member, path: member))\n" "my_tarfile.extractall()" -#: ../../library/tarfile.rst:1225 +#: ../../library/tarfile.rst:1233 msgid "Use the ``'data'`` filter; *fail* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1227 +#: ../../library/tarfile.rst:1235 msgid "my_tarfile.extractall(filter=tarfile.data_filter)" msgstr "my_tarfile.extractall(filter=tarfile.data_filter)" -#: ../../library/tarfile.rst:1229 +#: ../../library/tarfile.rst:1237 msgid "or::" msgstr "或: ::" -#: ../../library/tarfile.rst:1231 +#: ../../library/tarfile.rst:1239 msgid "" "my_tarfile.extraction_filter = tarfile.data_filter\n" "my_tarfile.extractall()" @@ -1668,11 +1673,11 @@ msgstr "" "my_tarfile.extraction_filter = tarfile.data_filter\n" "my_tarfile.extractall()" -#: ../../library/tarfile.rst:1234 +#: ../../library/tarfile.rst:1242 msgid "Use the ``'data'`` filter; *warn* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1236 +#: ../../library/tarfile.rst:1244 msgid "" "if hasattr(tarfile, 'data_filter'):\n" " my_tarfile.extractall(filter='data')\n" @@ -1688,18 +1693,18 @@ msgstr "" " warn_the_user('Extracting may be unsafe; consider updating Python')\n" " my_tarfile.extractall()" -#: ../../library/tarfile.rst:1245 +#: ../../library/tarfile.rst:1253 msgid "Stateful extraction filter example" msgstr "" -#: ../../library/tarfile.rst:1247 +#: ../../library/tarfile.rst:1255 msgid "" "While *tarfile*'s extraction methods take a simple *filter* callable, custom " "filters may be more complex objects with an internal state. It may be useful " "to write these as context managers, to be used like this::" msgstr "" -#: ../../library/tarfile.rst:1251 +#: ../../library/tarfile.rst:1259 msgid "" "with StatefulFilter() as filter_func:\n" " tar.extractall(path, filter=filter_func)" @@ -1707,11 +1712,11 @@ msgstr "" "with StatefulFilter() as filter_func:\n" " tar.extractall(path, filter=filter_func)" -#: ../../library/tarfile.rst:1254 +#: ../../library/tarfile.rst:1262 msgid "Such a filter can be written as, for example::" msgstr "" -#: ../../library/tarfile.rst:1256 +#: ../../library/tarfile.rst:1264 msgid "" "class StatefulFilter:\n" " def __init__(self):\n" @@ -1741,108 +1746,107 @@ msgstr "" " def __exit__(self, *exc_info):\n" " print(f'{self.file_count} files extracted')" -#: ../../library/tarfile.rst:1276 +#: ../../library/tarfile.rst:1284 msgid "Command-Line Interface" msgstr "命令列介面" -#: ../../library/tarfile.rst:1280 +#: ../../library/tarfile.rst:1288 msgid "" "The :mod:`tarfile` module provides a simple command-line interface to " "interact with tar archives." msgstr "" -#: ../../library/tarfile.rst:1283 +#: ../../library/tarfile.rst:1291 msgid "" -"If you want to create a new tar archive, specify its name after " -"the :option:`-c` option and then list the filename(s) that should be " -"included:" +"If you want to create a new tar archive, specify its name after the :option:" +"`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/tarfile.rst:1286 +#: ../../library/tarfile.rst:1294 msgid "$ python -m tarfile -c monty.tar spam.txt eggs.txt" msgstr "$ python -m tarfile -c monty.tar spam.txt eggs.txt" -#: ../../library/tarfile.rst:1290 +#: ../../library/tarfile.rst:1298 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/tarfile.rst:1292 +#: ../../library/tarfile.rst:1300 msgid "$ python -m tarfile -c monty.tar life-of-brian_1979/" msgstr "$ python -m tarfile -c monty.tar life-of-brian_1979/" -#: ../../library/tarfile.rst:1296 +#: ../../library/tarfile.rst:1304 msgid "" -"If you want to extract a tar archive into the current directory, use " -"the :option:`-e` option:" +"If you want to extract a tar archive into the current directory, use the :" +"option:`-e` option:" msgstr "" -#: ../../library/tarfile.rst:1299 +#: ../../library/tarfile.rst:1307 msgid "$ python -m tarfile -e monty.tar" msgstr "$ python -m tarfile -e monty.tar" -#: ../../library/tarfile.rst:1303 +#: ../../library/tarfile.rst:1311 msgid "" "You can also extract a tar archive into a different directory by passing the " "directory's name:" msgstr "" -#: ../../library/tarfile.rst:1306 +#: ../../library/tarfile.rst:1314 msgid "$ python -m tarfile -e monty.tar other-dir/" msgstr "$ python -m tarfile -e monty.tar other-dir/" -#: ../../library/tarfile.rst:1310 +#: ../../library/tarfile.rst:1318 msgid "For a list of the files in a tar archive, use the :option:`-l` option:" msgstr "" -#: ../../library/tarfile.rst:1312 +#: ../../library/tarfile.rst:1320 msgid "$ python -m tarfile -l monty.tar" msgstr "$ python -m tarfile -l monty.tar" -#: ../../library/tarfile.rst:1318 +#: ../../library/tarfile.rst:1326 msgid "Command-line options" msgstr "命令列選項" -#: ../../library/tarfile.rst:1323 +#: ../../library/tarfile.rst:1331 msgid "List files in a tarfile." msgstr "" -#: ../../library/tarfile.rst:1328 +#: ../../library/tarfile.rst:1336 msgid "Create tarfile from source files." msgstr "" -#: ../../library/tarfile.rst:1333 +#: ../../library/tarfile.rst:1341 msgid "" "Extract tarfile into the current directory if *output_dir* is not specified." msgstr "" -#: ../../library/tarfile.rst:1338 +#: ../../library/tarfile.rst:1346 msgid "Test whether the tarfile is valid or not." msgstr "" -#: ../../library/tarfile.rst:1342 +#: ../../library/tarfile.rst:1350 msgid "Verbose output." msgstr "" -#: ../../library/tarfile.rst:1346 +#: ../../library/tarfile.rst:1354 msgid "" "Specifies the *filter* for ``--extract``. See :ref:`tarfile-extraction-" "filter` for details. Only string names are accepted (that is, " "``fully_trusted``, ``tar``, and ``data``)." msgstr "" -#: ../../library/tarfile.rst:1354 +#: ../../library/tarfile.rst:1362 msgid "Examples" msgstr "範例" -#: ../../library/tarfile.rst:1357 +#: ../../library/tarfile.rst:1365 msgid "Reading examples" msgstr "" -#: ../../library/tarfile.rst:1359 +#: ../../library/tarfile.rst:1367 msgid "How to extract an entire tar archive to the current working directory::" msgstr "" -#: ../../library/tarfile.rst:1361 +#: ../../library/tarfile.rst:1369 msgid "" "import tarfile\n" "tar = tarfile.open(\"sample.tar.gz\")\n" @@ -1854,13 +1858,13 @@ msgstr "" "tar.extractall(filter='data')\n" "tar.close()" -#: ../../library/tarfile.rst:1366 +#: ../../library/tarfile.rst:1374 msgid "" "How to extract a subset of a tar archive with :meth:`TarFile.extractall` " "using a generator function instead of a list::" msgstr "" -#: ../../library/tarfile.rst:1369 +#: ../../library/tarfile.rst:1377 msgid "" "import os\n" "import tarfile\n" @@ -1886,13 +1890,13 @@ msgstr "" "tar.extractall(members=py_files(tar))\n" "tar.close()" -#: ../../library/tarfile.rst:1381 +#: ../../library/tarfile.rst:1389 msgid "" "How to read a gzip compressed tar archive and display some member " "information::" msgstr "" -#: ../../library/tarfile.rst:1383 +#: ../../library/tarfile.rst:1391 msgid "" "import tarfile\n" "tar = tarfile.open(\"sample.tar.gz\", \"r:gz\")\n" @@ -1908,15 +1912,15 @@ msgid "" "tar.close()" msgstr "" -#: ../../library/tarfile.rst:1396 +#: ../../library/tarfile.rst:1404 msgid "Writing examples" msgstr "" -#: ../../library/tarfile.rst:1398 +#: ../../library/tarfile.rst:1406 msgid "How to create an uncompressed tar archive from a list of filenames::" msgstr "" -#: ../../library/tarfile.rst:1400 +#: ../../library/tarfile.rst:1408 msgid "" "import tarfile\n" "tar = tarfile.open(\"sample.tar\", \"w\")\n" @@ -1930,11 +1934,11 @@ msgstr "" " tar.add(name)\n" "tar.close()" -#: ../../library/tarfile.rst:1406 +#: ../../library/tarfile.rst:1414 msgid "The same example using the :keyword:`with` statement::" msgstr "" -#: ../../library/tarfile.rst:1408 +#: ../../library/tarfile.rst:1416 msgid "" "import tarfile\n" "with tarfile.open(\"sample.tar\", \"w\") as tar:\n" @@ -1946,13 +1950,13 @@ msgstr "" " for name in [\"foo\", \"bar\", \"quux\"]:\n" " tar.add(name)" -#: ../../library/tarfile.rst:1413 +#: ../../library/tarfile.rst:1421 msgid "" "How to create and write an archive to stdout using :data:`sys.stdout.buffer " "` in the *fileobj* parameter in :meth:`TarFile.add`::" msgstr "" -#: ../../library/tarfile.rst:1417 +#: ../../library/tarfile.rst:1425 msgid "" "import sys\n" "import tarfile\n" @@ -1968,13 +1972,13 @@ msgstr "" " for name in [\"foo\", \"bar\", \"quux\"]:\n" " tar.add(name)" -#: ../../library/tarfile.rst:1423 +#: ../../library/tarfile.rst:1431 msgid "" "How to create an archive and reset the user information using the *filter* " "parameter in :meth:`TarFile.add`::" msgstr "" -#: ../../library/tarfile.rst:1426 +#: ../../library/tarfile.rst:1434 msgid "" "import tarfile\n" "def reset(tarinfo):\n" @@ -1994,17 +1998,17 @@ msgstr "" "tar.add(\"foo\", filter=reset)\n" "tar.close()" -#: ../../library/tarfile.rst:1439 +#: ../../library/tarfile.rst:1447 msgid "Supported tar formats" msgstr "支援的 tar 格式" -#: ../../library/tarfile.rst:1441 +#: ../../library/tarfile.rst:1449 msgid "" "There are three tar formats that can be created with the :mod:`tarfile` " "module:" msgstr "" -#: ../../library/tarfile.rst:1443 +#: ../../library/tarfile.rst:1451 msgid "" "The POSIX.1-1988 ustar format (:const:`USTAR_FORMAT`). It supports filenames " "up to a length of at best 256 characters and linknames up to 100 characters. " @@ -2012,7 +2016,7 @@ msgid "" "supported format." msgstr "" -#: ../../library/tarfile.rst:1448 +#: ../../library/tarfile.rst:1456 msgid "" "The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and " "linknames, files bigger than 8 GiB and sparse files. It is the de facto " @@ -2020,7 +2024,7 @@ msgid "" "extensions for long names, sparse file support is read-only." msgstr "" -#: ../../library/tarfile.rst:1453 +#: ../../library/tarfile.rst:1461 msgid "" "The POSIX.1-2001 pax format (:const:`PAX_FORMAT`). It is the most flexible " "format with virtually no limits. It supports long filenames and linknames, " @@ -2031,7 +2035,7 @@ msgid "" "*ustar* format. It is the current default format for new archives." msgstr "" -#: ../../library/tarfile.rst:1461 +#: ../../library/tarfile.rst:1469 msgid "" "It extends the existing *ustar* format with extra headers for information " "that cannot be stored otherwise. There are two flavours of pax headers: " @@ -2040,13 +2044,13 @@ msgid "" "in a pax header is encoded in *UTF-8* for portability reasons." msgstr "" -#: ../../library/tarfile.rst:1467 +#: ../../library/tarfile.rst:1475 msgid "" "There are some more variants of the tar format which can be read, but not " "created:" msgstr "" -#: ../../library/tarfile.rst:1470 +#: ../../library/tarfile.rst:1478 msgid "" "The ancient V7 format. This is the first tar format from Unix Seventh " "Edition, storing only regular files and directories. Names must not be " @@ -2055,17 +2059,17 @@ msgid "" "ASCII characters." msgstr "" -#: ../../library/tarfile.rst:1475 +#: ../../library/tarfile.rst:1483 msgid "" "The SunOS tar extended format. This format is a variant of the POSIX.1-2001 " "pax format, but is not compatible." msgstr "" -#: ../../library/tarfile.rst:1481 +#: ../../library/tarfile.rst:1489 msgid "Unicode issues" msgstr "" -#: ../../library/tarfile.rst:1483 +#: ../../library/tarfile.rst:1491 msgid "" "The tar format was originally conceived to make backups on tape drives with " "the main focus on preserving file system information. Nowadays tar archives " @@ -2080,13 +2084,13 @@ msgid "" "It stores non-ASCII metadata using the universal character encoding *UTF-8*." msgstr "" -#: ../../library/tarfile.rst:1495 +#: ../../library/tarfile.rst:1503 msgid "" "The details of character conversion in :mod:`tarfile` are controlled by the " "*encoding* and *errors* keyword arguments of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:1498 +#: ../../library/tarfile.rst:1506 msgid "" "*encoding* defines the character encoding to use for the metadata in the " "archive. The default value is :func:`sys.getfilesystemencoding` or " @@ -2095,7 +2099,7 @@ msgid "" "not set appropriately, this conversion may fail." msgstr "" -#: ../../library/tarfile.rst:1504 +#: ../../library/tarfile.rst:1512 msgid "" "The *errors* argument defines how characters are treated that cannot be " "converted. Possible values are listed in section :ref:`error-handlers`. The " @@ -2103,7 +2107,7 @@ msgid "" "system calls, see :ref:`os-filenames`." msgstr "" -#: ../../library/tarfile.rst:1509 +#: ../../library/tarfile.rst:1517 msgid "" "For :const:`PAX_FORMAT` archives (the default), *encoding* is generally not " "needed because all the metadata is stored using *UTF-8*. *encoding* is only " diff --git a/library/tkinter.po b/library/tkinter.po index 974a2ab0e1d..01aa34c7fb9 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-20 00:15+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2025-07-13 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -83,11 +83,19 @@ msgstr "" "們的新 API。新舊 API 目前都還能使用。你在網路上找到的大多數文件仍使用舊版 " "API,而且可能已經嚴重過時。" -#: ../../library/tkinter.rst:41 +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/tkinter.rst:43 msgid "`TkDocs `_" msgstr "`TkDocs `_" -#: ../../library/tkinter.rst:42 +#: ../../library/tkinter.rst:44 msgid "" "Extensive tutorial on creating user interfaces with Tkinter. Explains key " "concepts, and illustrates recommended approaches using the modern API." @@ -95,55 +103,55 @@ msgstr "" "關於使用 Tkinter 建立使用者介面的詳盡教學。內容解釋了關鍵概念,並使用現代 " "API 來說明建議的方法。" -#: ../../library/tkinter.rst:45 +#: ../../library/tkinter.rst:47 msgid "" "`Tkinter 8.5 reference: a GUI for Python `_" msgstr "" "`Tkinter 8.5 reference: a GUI for Python `_" -#: ../../library/tkinter.rst:46 +#: ../../library/tkinter.rst:48 msgid "" "Reference documentation for Tkinter 8.5 detailing available classes, " "methods, and options." msgstr "Tkinter 8.5 的參考文件,詳細說明了可用的類別、方法和選項。" -#: ../../library/tkinter.rst:48 +#: ../../library/tkinter.rst:50 msgid "Tcl/Tk Resources:" msgstr "Tcl/Tk 相關資源:" -#: ../../library/tkinter.rst:50 +#: ../../library/tkinter.rst:52 msgid "`Tk commands `_" msgstr "`Tk 指令 `_" -#: ../../library/tkinter.rst:51 +#: ../../library/tkinter.rst:53 msgid "" "Comprehensive reference to each of the underlying Tcl/Tk commands used by " "Tkinter." msgstr "Tkinter 所使用的每個底層 Tcl/Tk 指令的綜合參考資料。" -#: ../../library/tkinter.rst:53 +#: ../../library/tkinter.rst:55 msgid "`Tcl/Tk Home Page `_" msgstr "`Tcl/Tk 首頁 `_" -#: ../../library/tkinter.rst:54 +#: ../../library/tkinter.rst:56 msgid "Additional documentation, and links to Tcl/Tk core development." msgstr "額外的文件,以及連至 Tcl/Tk 核心開發的連結。" -#: ../../library/tkinter.rst:56 +#: ../../library/tkinter.rst:58 msgid "Books:" msgstr "書籍:" -#: ../../library/tkinter.rst:58 +#: ../../library/tkinter.rst:60 msgid "" "`Modern Tkinter for Busy Python Developers `_" msgstr "" "`Modern Tkinter for Busy Python Developers `_" -#: ../../library/tkinter.rst:59 +#: ../../library/tkinter.rst:61 msgid "By Mark Roseman. (ISBN 978-1999149567)" msgstr "由 Mark Roseman 所著。(ISBN 978-1999149567)" -#: ../../library/tkinter.rst:61 +#: ../../library/tkinter.rst:63 msgid "" "`Python GUI programming with Tkinter `_" @@ -151,19 +159,19 @@ msgstr "" "`Python GUI programming with Tkinter `_" -#: ../../library/tkinter.rst:62 +#: ../../library/tkinter.rst:64 msgid "By Alan D. Moore. (ISBN 978-1788835886)" msgstr "由 Alan D. Moore 所著。(ISBN 978-1788835886)" -#: ../../library/tkinter.rst:64 +#: ../../library/tkinter.rst:66 msgid "`Programming Python `_" msgstr "`Programming Python `_" -#: ../../library/tkinter.rst:65 +#: ../../library/tkinter.rst:67 msgid "By Mark Lutz; has excellent coverage of Tkinter. (ISBN 978-0596158101)" msgstr "由 Mark Lutz 所著;對 Tkinter 有極佳的涵蓋。(ISBN 978-0596158101)" -#: ../../library/tkinter.rst:67 +#: ../../library/tkinter.rst:69 msgid "" "`Tcl and the Tk Toolkit (2nd edition) `_" @@ -171,7 +179,7 @@ msgstr "" "`Tcl and the Tk Toolkit (2nd edition) `_" -#: ../../library/tkinter.rst:68 +#: ../../library/tkinter.rst:70 msgid "" "By John Ousterhout, inventor of Tcl/Tk, and Ken Jones; does not cover " "Tkinter. (ISBN 978-0321336330)" @@ -179,11 +187,11 @@ msgstr "" "由 Tcl/Tk 發明者 John Ousterhout 與 Ken Jones 所著;不包含 Tkinter。(ISBN " "978-0321336330)" -#: ../../library/tkinter.rst:72 +#: ../../library/tkinter.rst:74 msgid "Architecture" msgstr "架構" -#: ../../library/tkinter.rst:74 +#: ../../library/tkinter.rst:76 msgid "" "Tcl/Tk is not a single library but rather consists of a few distinct " "modules, each with separate functionality and its own official " @@ -193,11 +201,11 @@ msgstr "" "Tcl/Tk 並非單一函式庫,而是由幾個不同的模組所組成,每個模組都有獨立的功能和官" "方文件。Python 的二進位發行版也隨附了一個附加模組。" -#: ../../library/tkinter.rst:79 +#: ../../library/tkinter.rst:81 msgid "Tcl" msgstr "Tcl" -#: ../../library/tkinter.rst:80 +#: ../../library/tkinter.rst:82 msgid "" "Tcl is a dynamic interpreted programming language, just like Python. Though " "it can be used on its own as a general-purpose programming language, it is " @@ -218,11 +226,11 @@ msgstr "" "繞著協同多工(cooperative multitasking)設計的,而 Tkinter 則彌合了這種差異" "(詳情請參閱 `Threading model`_)。" -#: ../../library/tkinter.rst:92 ../../library/tkinter.rst:906 +#: ../../library/tkinter.rst:94 ../../library/tkinter.rst:908 msgid "Tk" msgstr "Tk" -#: ../../library/tkinter.rst:93 +#: ../../library/tkinter.rst:95 msgid "" "Tk is a `Tcl package `_ implemented in C " "that adds custom commands to create and manipulate GUI widgets. Each :class:" @@ -235,11 +243,11 @@ msgstr "" "Tcl 直譯器實例。Tk 的元件非常可自訂,但代價是外觀較為過時。Tk 使用 Tcl 的事件" "佇列來產生和處理 GUI 事件。" -#: ../../library/tkinter.rst:99 +#: ../../library/tkinter.rst:101 msgid "Ttk" msgstr "Ttk" -#: ../../library/tkinter.rst:100 +#: ../../library/tkinter.rst:102 msgid "" "Themed Tk (Ttk) is a newer family of Tk widgets that provide a much better " "appearance on different platforms than many of the classic Tk widgets. Ttk " @@ -250,7 +258,7 @@ msgstr "" "上提供了更好的外觀。從 Tk 8.5 版開始,Ttk 作為 Tk 的一部分發行。Python 的繫結" "(bindings)則在一個獨立的模組 :mod:`tkinter.ttk` 中提供。" -#: ../../library/tkinter.rst:105 +#: ../../library/tkinter.rst:107 msgid "" "Internally, Tk and Ttk use facilities of the underlying operating system, i." "e., Xlib on Unix/X11, Cocoa on macOS, GDI on Windows." @@ -258,7 +266,7 @@ msgstr "" "在內部,Tk 和 Ttk 使用底層作業系統的設施,即 Unix/X11 上的 Xlib、macOS 上的 " "Cocoa、Windows 上的 GDI。" -#: ../../library/tkinter.rst:108 +#: ../../library/tkinter.rst:110 msgid "" "When your Python application uses a class in Tkinter, e.g., to create a " "widget, the :mod:`tkinter` module first assembles a Tcl/Tk command string. " @@ -272,11 +280,11 @@ msgstr "" "的 :mod:`_tkinter` 二進位模組,後者再呼叫 Tcl 直譯器來對其進行計算。Tcl 直譯" "器接著會呼叫 Tk 和/或 Ttk 套件,而這些套件又會再呼叫 Xlib、Cocoa 或 GDI。" -#: ../../library/tkinter.rst:116 +#: ../../library/tkinter.rst:118 msgid "Tkinter Modules" msgstr "Tkinter 模組" -#: ../../library/tkinter.rst:118 +#: ../../library/tkinter.rst:120 msgid "" "Support for Tkinter is spread across several modules. Most applications will " "need the main :mod:`tkinter` module, as well as the :mod:`tkinter.ttk` " @@ -285,7 +293,7 @@ msgstr "" "對 Tkinter 的支援分散在數個模組中。大多數應用程式將需要主要的 :mod:`tkinter` " "模組,以及 :mod:`tkinter.ttk` 模組,後者提供了現代主題式元件集和 API: ::" -#: ../../library/tkinter.rst:123 +#: ../../library/tkinter.rst:125 msgid "" "from tkinter import *\n" "from tkinter import ttk" @@ -293,7 +301,7 @@ msgstr "" "from tkinter import *\n" "from tkinter import ttk" -#: ../../library/tkinter.rst:129 +#: ../../library/tkinter.rst:131 msgid "" "Construct a toplevel Tk widget, which is usually the main window of an " "application, and initialize a Tcl interpreter for this widget. Each " @@ -302,28 +310,28 @@ msgstr "" "建構一個頂層 Tk 元件,它通常是應用程式的主視窗,並為此元件初始化一個 Tcl 直譯" "器。每個實例都有其自己關聯的 Tcl 直譯器。" -#: ../../library/tkinter.rst:133 +#: ../../library/tkinter.rst:135 msgid "" "The :class:`Tk` class is typically instantiated using all default values. " "However, the following keyword arguments are currently recognized:" msgstr "" ":class:`Tk` 類別通常使用所有預設值來實例化。然而,目前可辨識下列關鍵字引數:" -#: ../../library/tkinter.rst:136 +#: ../../library/tkinter.rst:138 msgid "*screenName*" msgstr "*screenName*" -#: ../../library/tkinter.rst:137 +#: ../../library/tkinter.rst:139 msgid "" "When given (as a string), sets the :envvar:`DISPLAY` environment variable. " "(X11 only)" msgstr "當給定(作為字串)時,設定 :envvar:`DISPLAY` 環境變數。(僅限 X11)" -#: ../../library/tkinter.rst:139 +#: ../../library/tkinter.rst:141 msgid "*baseName*" msgstr "*baseName*" -#: ../../library/tkinter.rst:140 +#: ../../library/tkinter.rst:142 msgid "" "Name of the profile file. By default, *baseName* is derived from the " "program name (``sys.argv[0]``)." @@ -331,11 +339,11 @@ msgstr "" "設定檔的名稱。預設情況下,*baseName* 是從程式名稱(``sys.argv[0]``)衍生而" "來。" -#: ../../library/tkinter.rst:142 +#: ../../library/tkinter.rst:144 msgid "*className*" msgstr "*className*" -#: ../../library/tkinter.rst:143 +#: ../../library/tkinter.rst:145 msgid "" "Name of the widget class. Used as a profile file and also as the name with " "which Tcl is invoked (*argv0* in *interp*)." @@ -343,11 +351,11 @@ msgstr "" "元件類別的名稱。用作設定檔,也用作呼叫 Tcl 時的名稱(*interp* 中的 " "*argv0*)。" -#: ../../library/tkinter.rst:145 +#: ../../library/tkinter.rst:147 msgid "*useTk*" msgstr "*useTk*" -#: ../../library/tkinter.rst:146 +#: ../../library/tkinter.rst:148 msgid "" "If ``True``, initialize the Tk subsystem. The :func:`tkinter.Tcl() ` " "function sets this to ``False``." @@ -355,11 +363,11 @@ msgstr "" "若為 ``True``,則初始化 Tk 子系統。:func:`tkinter.Tcl() ` 函式會將此設定" "為 ``False``。" -#: ../../library/tkinter.rst:148 +#: ../../library/tkinter.rst:150 msgid "*sync*" msgstr "*sync*" -#: ../../library/tkinter.rst:149 +#: ../../library/tkinter.rst:151 msgid "" "If ``True``, execute all X server commands synchronously, so that errors are " "reported immediately. Can be used for debugging. (X11 only)" @@ -367,11 +375,11 @@ msgstr "" "若為 ``True``,則同步執行所有 X 伺服器指令,以便立即回報錯誤。可用於偵錯。" "(僅限 X11)" -#: ../../library/tkinter.rst:151 +#: ../../library/tkinter.rst:153 msgid "*use*" msgstr "*use*" -#: ../../library/tkinter.rst:152 +#: ../../library/tkinter.rst:154 msgid "" "Specifies the *id* of the window in which to embed the application, instead " "of it being created as an independent toplevel window. *id* must be " @@ -382,7 +390,7 @@ msgstr "" "頂層元件的 -use 選項值相同的方式指定(也就是說,其形式類似 :meth:`winfo_id` " "回傳的形式)。" -#: ../../library/tkinter.rst:158 +#: ../../library/tkinter.rst:160 msgid "" "Note that on some platforms this will only work correctly if *id* refers to " "a Tk frame or toplevel that has its -container option enabled." @@ -390,7 +398,7 @@ msgstr "" "請注意,在某些平台上,只有當 *id* 指向一個已啟用 -container 選項的 Tk 框架或" "頂層視窗時,此功能才能正常運作。" -#: ../../library/tkinter.rst:161 +#: ../../library/tkinter.rst:163 msgid "" ":class:`Tk` reads and interprets profile files, named :file:`.{className}." "tcl` and :file:`.{baseName}.tcl`, into the Tcl interpreter and calls :func:" @@ -403,7 +411,7 @@ msgstr "" "{baseName}.py` 的內容呼叫 :func:`exec`。設定檔的路徑是 :envvar:`HOME` 環境變" "數,如果未定義,則是 :data:`os.curdir`。" -#: ../../library/tkinter.rst:170 +#: ../../library/tkinter.rst:172 msgid "" "The Tk application object created by instantiating :class:`Tk`. This " "provides access to the Tcl interpreter. Each widget that is attached the " @@ -412,7 +420,7 @@ msgstr "" "透過實例化 :class:`Tk` 建立的 Tk 應用程式物件。這提供了對 Tcl 直譯器的存取。" "每個附加到同一個 :class:`Tk` 實例的元件,其 :attr:`tk` 屬性都具有相同的值。" -#: ../../library/tkinter.rst:177 +#: ../../library/tkinter.rst:179 msgid "" "The widget object that contains this widget. For :class:`Tk`, the *master* " "is :const:`None` because it is the main window. The terms *master* and " @@ -427,7 +435,7 @@ msgstr "" "而,呼叫 :meth:`winfo_parent` 會回傳元件名稱的字串,而 :attr:`master` 則回傳" "物件。*parent*/*child* 反映了樹狀關係,而 *master*/*slave* 反映了容器結構。" -#: ../../library/tkinter.rst:187 +#: ../../library/tkinter.rst:189 msgid "" "The immediate descendants of this widget as a :class:`dict` with the child " "widget names as the keys and the child instance objects as the values." @@ -435,7 +443,7 @@ msgstr "" "此元件的直接子代,形式為一個 :class:`dict`,其中鍵為子元件的名稱,值為子實例" "物件。" -#: ../../library/tkinter.rst:194 +#: ../../library/tkinter.rst:196 msgid "" "The :func:`Tcl` function is a factory function which creates an object much " "like that created by the :class:`Tk` class, except that it does not " @@ -452,79 +460,79 @@ msgstr "" "Linux 系統)。由 :func:`Tcl` 物件建立的物件可以透過呼叫其 :meth:`loadtk` 方法" "來建立一個頂層視窗(並初始化 Tk 子系統)。" -#: ../../library/tkinter.rst:203 +#: ../../library/tkinter.rst:205 msgid "The modules that provide Tk support include:" msgstr "提供 Tk 支援的模組包括:" -#: ../../library/tkinter.rst:205 +#: ../../library/tkinter.rst:207 msgid ":mod:`tkinter`" msgstr ":mod:`tkinter`" -#: ../../library/tkinter.rst:206 +#: ../../library/tkinter.rst:208 msgid "Main Tkinter module." msgstr "主要的 Tkinter 模組。" -#: ../../library/tkinter.rst:208 +#: ../../library/tkinter.rst:210 msgid ":mod:`tkinter.colorchooser`" msgstr ":mod:`tkinter.colorchooser`" -#: ../../library/tkinter.rst:209 +#: ../../library/tkinter.rst:211 msgid "Dialog to let the user choose a color." msgstr "讓使用者選擇顏色的對話方塊。" -#: ../../library/tkinter.rst:211 +#: ../../library/tkinter.rst:213 msgid ":mod:`tkinter.commondialog`" msgstr ":mod:`tkinter.commondialog`" -#: ../../library/tkinter.rst:212 +#: ../../library/tkinter.rst:214 msgid "Base class for the dialogs defined in the other modules listed here." msgstr "此處列出的其他模組中定義的對話方塊的基底類別。" -#: ../../library/tkinter.rst:214 +#: ../../library/tkinter.rst:216 msgid ":mod:`tkinter.filedialog`" msgstr ":mod:`tkinter.filedialog`" -#: ../../library/tkinter.rst:215 +#: ../../library/tkinter.rst:217 msgid "Common dialogs to allow the user to specify a file to open or save." msgstr "讓使用者指定要開啟或儲存的檔案的通用對話方塊。" -#: ../../library/tkinter.rst:217 +#: ../../library/tkinter.rst:219 msgid ":mod:`tkinter.font`" msgstr ":mod:`tkinter.font`" -#: ../../library/tkinter.rst:218 +#: ../../library/tkinter.rst:220 msgid "Utilities to help work with fonts." msgstr "協助處理字型的工具程式。" -#: ../../library/tkinter.rst:220 +#: ../../library/tkinter.rst:222 msgid ":mod:`tkinter.messagebox`" msgstr ":mod:`tkinter.messagebox`" -#: ../../library/tkinter.rst:221 +#: ../../library/tkinter.rst:223 msgid "Access to standard Tk dialog boxes." msgstr "存取標準的 Tk 對話方塊。" -#: ../../library/tkinter.rst:223 +#: ../../library/tkinter.rst:225 msgid ":mod:`tkinter.scrolledtext`" msgstr ":mod:`tkinter.scrolledtext`" -#: ../../library/tkinter.rst:224 +#: ../../library/tkinter.rst:226 msgid "Text widget with a vertical scroll bar built in." msgstr "內建垂直捲軸的文字元件。" -#: ../../library/tkinter.rst:226 +#: ../../library/tkinter.rst:228 msgid ":mod:`tkinter.simpledialog`" msgstr ":mod:`tkinter.simpledialog`" -#: ../../library/tkinter.rst:227 +#: ../../library/tkinter.rst:229 msgid "Basic dialogs and convenience functions." msgstr "基本的對話方塊和便利函式。" -#: ../../library/tkinter.rst:229 +#: ../../library/tkinter.rst:231 msgid ":mod:`tkinter.ttk`" msgstr ":mod:`tkinter.ttk`" -#: ../../library/tkinter.rst:230 +#: ../../library/tkinter.rst:232 msgid "" "Themed widget set introduced in Tk 8.5, providing modern alternatives for " "many of the classic widgets in the main :mod:`tkinter` module." @@ -532,15 +540,15 @@ msgstr "" "在 Tk 8.5 中引入的主題式元件集,為主 :mod:`tkinter` 模組中的許多傳統元件提供" "了現代化的替代方案。" -#: ../../library/tkinter.rst:233 +#: ../../library/tkinter.rst:235 msgid "Additional modules:" msgstr "額外模組:" -#: ../../library/tkinter.rst:238 +#: ../../library/tkinter.rst:240 msgid ":mod:`_tkinter`" msgstr ":mod:`_tkinter`" -#: ../../library/tkinter.rst:239 +#: ../../library/tkinter.rst:241 msgid "" "A binary module that contains the low-level interface to Tcl/Tk. It is " "automatically imported by the main :mod:`tkinter` module, and should never " @@ -552,21 +560,21 @@ msgstr "" "用程式開發者不應直接使用它。它通常是一個共享函式庫(或 DLL),但在某些情況下" "可能會與 Python 直譯器靜態連結。" -#: ../../library/tkinter.rst:245 +#: ../../library/tkinter.rst:247 msgid ":mod:`idlelib`" msgstr ":mod:`idlelib`" -#: ../../library/tkinter.rst:246 +#: ../../library/tkinter.rst:248 msgid "" "Python's Integrated Development and Learning Environment (IDLE). Based on :" "mod:`tkinter`." msgstr "Python 的整合開發與學習環境(IDLE)。基於 :mod:`tkinter`。" -#: ../../library/tkinter.rst:249 +#: ../../library/tkinter.rst:251 msgid ":mod:`tkinter.constants`" msgstr ":mod:`tkinter.constants`" -#: ../../library/tkinter.rst:250 +#: ../../library/tkinter.rst:252 msgid "" "Symbolic constants that can be used in place of strings when passing various " "parameters to Tkinter calls. Automatically imported by the main :mod:" @@ -575,30 +583,30 @@ msgstr "" "在將各種參數傳遞給 Tkinter 呼叫時,可用於替代字串的符號常數。由主 :mod:" "`tkinter` 模組自動引入。" -#: ../../library/tkinter.rst:254 +#: ../../library/tkinter.rst:256 msgid ":mod:`tkinter.dnd`" msgstr ":mod:`tkinter.dnd`" -#: ../../library/tkinter.rst:255 +#: ../../library/tkinter.rst:257 msgid "" "(experimental) Drag-and-drop support for :mod:`tkinter`. This will become " "deprecated when it is replaced with the Tk DND." msgstr "" "(實驗性)對 :mod:`tkinter` 的拖放支援。當它被 Tk DND 取代時,將會被棄用。" -#: ../../library/tkinter.rst:258 +#: ../../library/tkinter.rst:260 msgid ":mod:`turtle`" msgstr ":mod:`turtle`" -#: ../../library/tkinter.rst:259 +#: ../../library/tkinter.rst:261 msgid "Turtle graphics in a Tk window." msgstr "在 Tk 視窗中的海龜繪圖。" -#: ../../library/tkinter.rst:263 +#: ../../library/tkinter.rst:265 msgid "Tkinter Life Preserver" msgstr "Tkinter 應急指南" -#: ../../library/tkinter.rst:265 +#: ../../library/tkinter.rst:267 msgid "" "This section is not designed to be an exhaustive tutorial on either Tk or " "Tkinter. For that, refer to one of the external resources noted earlier. " @@ -610,7 +618,7 @@ msgstr "" "一。相反地,本節提供了一個快速導覽,介紹 Tkinter 應用程式的外觀、識別基礎的 " "Tk 概念,並解釋 Tkinter 包裝器的結構。" -#: ../../library/tkinter.rst:271 +#: ../../library/tkinter.rst:273 msgid "" "The remainder of this section will help you to identify the classes, " "methods, and options you'll need in your Tkinter application, and where to " @@ -620,11 +628,11 @@ msgstr "" "本節的其餘部分將幫助你識別在 Tkinter 應用程式中所需的類別、方法和選項,以及在" "哪裡可以找到關於它們的更詳細文件,包括在官方的 Tcl/Tk 參考手冊中。" -#: ../../library/tkinter.rst:278 +#: ../../library/tkinter.rst:280 msgid "A Hello World Program" msgstr "一個 Hello World 程式" -#: ../../library/tkinter.rst:280 +#: ../../library/tkinter.rst:282 msgid "" "We'll start by walking through a \"Hello World\" application in Tkinter. " "This isn't the smallest one we could write, but has enough to illustrate " @@ -633,7 +641,7 @@ msgstr "" "我們將從一個 Tkinter 的 \"Hello World\" 應用程式開始。這不是我們能寫出的最小" "程式,但足以說明一些你需要知道的關鍵概念。" -#: ../../library/tkinter.rst:286 +#: ../../library/tkinter.rst:288 msgid "" "from tkinter import *\n" "from tkinter import ttk\n" @@ -653,7 +661,7 @@ msgstr "" "ttk.Button(frm, text=\"Quit\", command=root.destroy).grid(column=1, row=0)\n" "root.mainloop()" -#: ../../library/tkinter.rst:296 +#: ../../library/tkinter.rst:298 msgid "" "After the imports, the next line creates an instance of the :class:`Tk` " "class, which initializes Tk and creates its associated Tcl interpreter. It " @@ -663,7 +671,7 @@ msgstr "" "在引入之後,下一行建立了一個 :class:`Tk` 類別的實例,它會初始化 Tk 並建立其關" "聯的 Tcl 直譯器。它還會建立一個頂層視窗,稱為根視窗,作為應用程式的主視窗。" -#: ../../library/tkinter.rst:301 +#: ../../library/tkinter.rst:303 msgid "" "The following line creates a frame widget, which in this case will contain a " "label and a button we'll create next. The frame is fit inside the root " @@ -672,7 +680,7 @@ msgstr "" "接下來的一行建立了一個框架元件,在本例中,它將包含我們接下來要建立的一個標籤" "和一個按鈕。該框架被放置在根視窗內。" -#: ../../library/tkinter.rst:305 +#: ../../library/tkinter.rst:307 msgid "" "The next line creates a label widget holding a static text string. The :meth:" "`grid` method is used to specify the relative layout (position) of the label " @@ -681,7 +689,7 @@ msgstr "" "下一行建立了一個包含靜態文字字串的標籤元件。:meth:`grid` 方法用於指定標籤在其" "包含的框架元件中的相對佈局(位置),類似於 HTML 中表格的運作方式。" -#: ../../library/tkinter.rst:309 +#: ../../library/tkinter.rst:311 msgid "" "A button widget is then created, and placed to the right of the label. When " "pressed, it will call the :meth:`destroy` method of the root window." @@ -689,7 +697,7 @@ msgstr "" "然後建立一個按鈕元件,並放置在標籤的右側。當按下時,它將呼叫根視窗的 :meth:" "`destroy` 方法。" -#: ../../library/tkinter.rst:312 +#: ../../library/tkinter.rst:314 msgid "" "Finally, the :meth:`mainloop` method puts everything on the display, and " "responds to user input until the program terminates." @@ -697,19 +705,19 @@ msgstr "" "最後,:meth:`mainloop` 方法將所有內容顯示在螢幕上,並回應使用者輸入,直到程式" "終止。" -#: ../../library/tkinter.rst:318 +#: ../../library/tkinter.rst:320 msgid "Important Tk Concepts" msgstr "重要的 Tk 概念" -#: ../../library/tkinter.rst:320 +#: ../../library/tkinter.rst:322 msgid "Even this simple program illustrates the following key Tk concepts:" msgstr "即使是這個簡單的程式也說明了以下關鍵的 Tk 概念:" -#: ../../library/tkinter.rst:322 +#: ../../library/tkinter.rst:324 msgid "widgets" msgstr "元件(widgets)" -#: ../../library/tkinter.rst:323 +#: ../../library/tkinter.rst:325 msgid "" "A Tkinter user interface is made up of individual *widgets*. Each widget is " "represented as a Python object, instantiated from classes like :class:`ttk." @@ -719,11 +727,11 @@ msgstr "" "Python 物件,從 :class:`ttk.Frame`、:class:`ttk.Label` 和 :class:`ttk." "Button` 等類別實例化而來。" -#: ../../library/tkinter.rst:327 +#: ../../library/tkinter.rst:329 msgid "widget hierarchy" msgstr "元件階層(widget hierarchy)" -#: ../../library/tkinter.rst:328 +#: ../../library/tkinter.rst:330 msgid "" "Widgets are arranged in a *hierarchy*. The label and button were contained " "within a frame, which in turn was contained within the root window. When " @@ -734,11 +742,11 @@ msgstr "" "在根視窗內。在建立每個\\ *子*\\ 元件時,其\\ *父*\\ 元件會作為第一個引數傳遞" "給元件的建構函式。" -#: ../../library/tkinter.rst:333 +#: ../../library/tkinter.rst:335 msgid "configuration options" msgstr "設定選項(configuration options)" -#: ../../library/tkinter.rst:334 +#: ../../library/tkinter.rst:336 msgid "" "Widgets have *configuration options*, which modify their appearance and " "behavior, such as the text to display in a label or button. Different " @@ -747,11 +755,11 @@ msgstr "" "元件具有\\ *設定選項*,可以修改其外觀和行為,例如在標籤或按鈕中顯示的文字。不" "同類別的元件會有不同的選項集。" -#: ../../library/tkinter.rst:338 +#: ../../library/tkinter.rst:340 msgid "geometry management" msgstr "佈局管理(geometry management)" -#: ../../library/tkinter.rst:339 +#: ../../library/tkinter.rst:341 msgid "" "Widgets aren't automatically added to the user interface when they are " "created. A *geometry manager* like ``grid`` controls where in the user " @@ -760,11 +768,11 @@ msgstr "" "元件在建立時不會自動新增到使用者介面中。像 ``grid`` 這樣的\\ *佈局管理器*\\ " "(geometry manager)會控制它們在使用者介面中的放置位置。" -#: ../../library/tkinter.rst:343 +#: ../../library/tkinter.rst:345 msgid "event loop" msgstr "事件迴圈(event loop)" -#: ../../library/tkinter.rst:344 +#: ../../library/tkinter.rst:346 msgid "" "Tkinter reacts to user input, changes from your program, and even refreshes " "the display only when actively running an *event loop*. If your program " @@ -773,11 +781,11 @@ msgstr "" "Tkinter 只有在主動執行\\ *事件迴圈*\\ 時,才會對使用者輸入、程式的變更,甚至" "螢幕刷新做出反應。如果你的程式沒有執行事件迴圈,你的使用者介面將不會更新。" -#: ../../library/tkinter.rst:350 +#: ../../library/tkinter.rst:352 msgid "Understanding How Tkinter Wraps Tcl/Tk" msgstr "了解 Tkinter 如何包裝 Tcl/Tk" -#: ../../library/tkinter.rst:352 +#: ../../library/tkinter.rst:354 msgid "" "When your application uses Tkinter's classes and methods, internally Tkinter " "is assembling strings representing Tcl/Tk commands, and executing those " @@ -787,7 +795,7 @@ msgstr "" "當你的應用程式使用 Tkinter 的類別和方法時,Tkinter 內部正在組合代表 Tcl/Tk 指" "令的字串,並在附加到你應用程式 :class:`Tk` 實例的 Tcl 直譯器中執行這些指令。" -#: ../../library/tkinter.rst:357 +#: ../../library/tkinter.rst:359 msgid "" "Whether it's trying to navigate reference documentation, trying to find the " "right method or option, adapting some existing code, or debugging your " @@ -797,13 +805,13 @@ msgstr "" "無論是試圖瀏覽參考文件、尋找正確的方法或選項、改寫一些現有程式碼,還是偵錯你" "的 Tkinter 應用程式,在某些時候,了解那些底層 Tcl/Tk 指令的樣貌會很有幫助。" -#: ../../library/tkinter.rst:362 +#: ../../library/tkinter.rst:364 msgid "" "To illustrate, here is the Tcl/Tk equivalent of the main part of the Tkinter " "script above." msgstr "為了說明,以下是上面 Tkinter 腳本主要部分的 Tcl/Tk 對等程式碼。" -#: ../../library/tkinter.rst:367 +#: ../../library/tkinter.rst:369 msgid "" "ttk::frame .frm -padding 10\n" "grid .frm\n" @@ -817,7 +825,7 @@ msgstr "" "grid [ttk::button .frm.btn -text \"Quit\" -command \"destroy .\"] -column 1 -" "row 0" -#: ../../library/tkinter.rst:373 +#: ../../library/tkinter.rst:375 msgid "" "Tcl's syntax is similar to many shell languages, where the first word is the " "command to be executed, with arguments to that command following it, " @@ -827,19 +835,19 @@ msgstr "" "Tcl 的語法類似於許多 shell 語言,第一個字是要執行的指令,後面跟著該指令的引" "數,以空格分隔。在不深入太多細節的情況下,請注意以下幾點:" -#: ../../library/tkinter.rst:377 +#: ../../library/tkinter.rst:379 msgid "" "The commands used to create widgets (like ``ttk::frame``) correspond to " "widget classes in Tkinter." msgstr "用於建立元件的指令(如 ``ttk::frame``)對應於 Tkinter 中的元件類別。" -#: ../../library/tkinter.rst:380 +#: ../../library/tkinter.rst:382 msgid "" "Tcl widget options (like ``-text``) correspond to keyword arguments in " "Tkinter." msgstr "Tcl 元件選項(如 ``-text``)對應於 Tkinter 中的關鍵字引數。" -#: ../../library/tkinter.rst:383 +#: ../../library/tkinter.rst:385 msgid "" "Widgets are referred to by a *pathname* in Tcl (like ``.frm.btn``), whereas " "Tkinter doesn't use names but object references." @@ -847,7 +855,7 @@ msgstr "" "在 Tcl 中,元件是透過\\ *路徑名稱*\\ (如 ``.frm.btn``)來參照,而 Tkinter 不" "使用名稱,而是使用物件參照。" -#: ../../library/tkinter.rst:386 +#: ../../library/tkinter.rst:388 msgid "" "A widget's place in the widget hierarchy is encoded in its (hierarchical) " "pathname, which uses a ``.`` (dot) as a path separator. The pathname for the " @@ -858,7 +866,7 @@ msgstr "" "(點)作為路徑分隔符。根視窗的路徑名稱就是 ``.``\\ (點)。在 Tkinter 中,階" "層不是由路徑名稱定義的,而是在建立每個子元件時指定父元件來定義的。" -#: ../../library/tkinter.rst:392 +#: ../../library/tkinter.rst:394 msgid "" "Operations which are implemented as separate *commands* in Tcl (like " "``grid`` or ``destroy``) are represented as *methods* on Tkinter widget " @@ -870,11 +878,11 @@ msgstr "" "Tkinter 中則表示為元件物件上的\\ *方法*。正如你稍後會看到的,在其他時候,Tcl " "使用的看起來像是對元件物件的方法呼叫,這更接近 Tkinter 中的用法。" -#: ../../library/tkinter.rst:400 +#: ../../library/tkinter.rst:402 msgid "How do I...? What option does...?" msgstr "我該如何...?哪個選項可以...?" -#: ../../library/tkinter.rst:402 +#: ../../library/tkinter.rst:404 msgid "" "If you're not sure how to do something in Tkinter, and you can't immediately " "find it in the tutorial or reference documentation you're using, there are a " @@ -883,7 +891,7 @@ msgstr "" "如果你不確定如何在 Tkinter 中做某件事,並且無法立即在你正在使用的教學或參考文" "件中找到它,這裡有一些可能有幫助的策略。" -#: ../../library/tkinter.rst:406 +#: ../../library/tkinter.rst:408 msgid "" "First, remember that the details of how individual widgets work may vary " "across different versions of both Tkinter and Tcl/Tk. If you're searching " @@ -893,7 +901,7 @@ msgstr "" "首先,請記住,個別元件的運作細節可能會因 Tkinter 和 Tcl/Tk 的不同版本而異。如" "果你正在搜尋文件,請確保它對應於你系統上安裝的 Python 和 Tcl/Tk 版本。" -#: ../../library/tkinter.rst:411 +#: ../../library/tkinter.rst:413 msgid "" "When searching for how to use an API, it helps to know the exact name of the " "class, option, or method that you're using. Introspection, either in an " @@ -904,7 +912,7 @@ msgstr "" "自省(Introspection),無論是在互動式 Python shell 中還是使用 :func:`print`," "都可以幫助你識別所需內容。" -#: ../../library/tkinter.rst:416 +#: ../../library/tkinter.rst:418 msgid "" "To find out what configuration options are available on any widget, call " "its :meth:`configure` method, which returns a dictionary containing a " @@ -915,7 +923,7 @@ msgstr "" "會回傳一個字典,其中包含有關每個物件的各種資訊,包括其預設值和目前值。使用 :" "meth:`keys` 僅取得每個選項的名稱。" -#: ../../library/tkinter.rst:423 +#: ../../library/tkinter.rst:425 msgid "" "btn = ttk.Button(frm, ...)\n" "print(btn.configure().keys())" @@ -923,7 +931,7 @@ msgstr "" "btn = ttk.Button(frm, ...)\n" "print(btn.configure().keys())" -#: ../../library/tkinter.rst:426 +#: ../../library/tkinter.rst:428 msgid "" "As most widgets have many configuration options in common, it can be useful " "to find out which are specific to a particular widget class. Comparing the " @@ -933,11 +941,11 @@ msgstr "" "由於大多數元件有許多共通的設定選項,找出特定於某個元件類別的選項會很有用。將" "選項串列與像框架這樣較簡單的元件的選項串列進行比較,是做到這一點的一種方法。" -#: ../../library/tkinter.rst:433 +#: ../../library/tkinter.rst:435 msgid "print(set(btn.configure().keys()) - set(frm.configure().keys()))" msgstr "print(set(btn.configure().keys()) - set(frm.configure().keys()))" -#: ../../library/tkinter.rst:435 +#: ../../library/tkinter.rst:437 msgid "" "Similarly, you can find the available methods for a widget object using the " "standard :func:`dir` function. If you try it, you'll see there are over 200 " @@ -948,7 +956,7 @@ msgstr "" "下,你會看到有超過 200 個常見的元件方法,所以再次強調,識別特定於某個元件類別" "的方法是很有幫助的。" -#: ../../library/tkinter.rst:442 +#: ../../library/tkinter.rst:444 msgid "" "print(dir(btn))\n" "print(set(dir(btn)) - set(dir(frm)))" @@ -956,11 +964,11 @@ msgstr "" "print(dir(btn))\n" "print(set(dir(btn)) - set(dir(frm)))" -#: ../../library/tkinter.rst:447 +#: ../../library/tkinter.rst:449 msgid "Navigating the Tcl/Tk Reference Manual" msgstr "瀏覽 Tcl/Tk 參考手冊" -#: ../../library/tkinter.rst:449 +#: ../../library/tkinter.rst:451 msgid "" "As noted, the official `Tk commands `_ reference manual (man pages) is often the most accurate " @@ -972,7 +980,7 @@ msgstr "" "htm>`_ 參考手冊(man pages)通常是對元件上特定操作作用的最準確描述。即使你知" "道所需選項或方法的名稱,你可能仍有幾個地方需要查看。" -#: ../../library/tkinter.rst:454 +#: ../../library/tkinter.rst:456 msgid "" "While all operations in Tkinter are implemented as method calls on widget " "objects, you've seen that many Tcl/Tk operations appear as commands that " @@ -983,7 +991,7 @@ msgstr "" "Tk 操作顯示為指令,這些指令將元件路徑名稱作為其第一個參數,後面跟著可選的參" "數,例如:" -#: ../../library/tkinter.rst:461 +#: ../../library/tkinter.rst:463 msgid "" "destroy .\n" "grid .frm.btn -column 0 -row 0" @@ -991,7 +999,7 @@ msgstr "" "destroy .\n" "grid .frm.btn -column 0 -row 0" -#: ../../library/tkinter.rst:464 +#: ../../library/tkinter.rst:466 msgid "" "Others, however, look more like methods called on a widget object (in fact, " "when you create a widget in Tcl/Tk, it creates a Tcl command with the name " @@ -1002,7 +1010,7 @@ msgstr "" "個元件時,它會建立一個以元件路徑名稱為名的 Tcl 指令,該指令的第一個參數是要呼" "叫的方法名稱)。" -#: ../../library/tkinter.rst:471 +#: ../../library/tkinter.rst:473 msgid "" ".frm.btn invoke\n" ".frm.lbl configure -text \"Goodbye\"" @@ -1010,7 +1018,7 @@ msgstr "" ".frm.btn invoke\n" ".frm.lbl configure -text \"Goodbye\"" -#: ../../library/tkinter.rst:475 +#: ../../library/tkinter.rst:477 msgid "" "In the official Tcl/Tk reference documentation, you'll find most operations " "that look like method calls on the man page for a specific widget (e.g., " @@ -1025,7 +1033,7 @@ msgstr "" "數的函式通常有自己的 man page(例如 `grid `_)。" -#: ../../library/tkinter.rst:483 +#: ../../library/tkinter.rst:485 msgid "" "You'll find many common options and methods in the `options `_ or `ttk::widget `_ man page " "中找到許多常見的選項和方法,而其他的則在特定元件類別的 man page 中找到。" -#: ../../library/tkinter.rst:488 +#: ../../library/tkinter.rst:490 msgid "" "You'll also find that many Tkinter methods have compound names, e.g., :func:" "`winfo_x`, :func:`winfo_height`, :func:`winfo_viewable`. You'd find " @@ -1047,7 +1055,7 @@ msgstr "" "`winfo_height`、:func:`winfo_viewable`。你可以在 `winfo `_ man page 中找到所有這些文件的說明。" -#: ../../library/tkinter.rst:494 +#: ../../library/tkinter.rst:496 msgid "" "Somewhat confusingly, there are also methods on all Tkinter widgets that " "don't actually operate on the widget, but operate at a global scope, " @@ -1060,11 +1068,11 @@ msgstr "" "法。(它們恰好被實作為所有 Tkinter 元件都繼承的基底 :class:`Widget` 類別中的" "方法)。" -#: ../../library/tkinter.rst:503 +#: ../../library/tkinter.rst:505 msgid "Threading model" msgstr "執行緒模型" -#: ../../library/tkinter.rst:505 +#: ../../library/tkinter.rst:507 msgid "" "Python and Tcl/Tk have very different threading models, which :mod:`tkinter` " "tries to bridge. If you use threads, you may need to be aware of this." @@ -1072,7 +1080,7 @@ msgstr "" "Python 和 Tcl/Tk 有非常不同的執行緒模型,:mod:`tkinter` 試圖彌合這種差異。如" "果你使用執行緒,你可能需要意識到這一點。" -#: ../../library/tkinter.rst:508 +#: ../../library/tkinter.rst:510 msgid "" "A Python interpreter may have many threads associated with it. In Tcl, " "multiple threads can be created, but each thread has a separate Tcl " @@ -1084,7 +1092,7 @@ msgstr "" "但每個執行緒都有一個獨立的 Tcl 直譯器實例與之關聯。執行緒也可以建立多個直譯器" "實例,但每個直譯器實例只能由建立它的那個執行緒使用。" -#: ../../library/tkinter.rst:513 +#: ../../library/tkinter.rst:515 msgid "" "Each :class:`Tk` object created by :mod:`tkinter` contains a Tcl " "interpreter. It also keeps track of which thread created that interpreter. " @@ -1098,7 +1106,7 @@ msgstr "" "內部,如果呼叫來自建立 :class:`Tk` 物件的執行緒以外的執行緒,則會將一個事件發" "佈到直譯器的事件佇列中,執行後,結果會回傳給呼叫的 Python 執行緒。" -#: ../../library/tkinter.rst:520 +#: ../../library/tkinter.rst:522 msgid "" "Tcl/Tk applications are normally event-driven, meaning that after " "initialization, the interpreter runs an event loop (i.e. :func:`Tk." @@ -1117,7 +1125,7 @@ msgstr "" "行緒中執行。這與許多 GUI 工具集不同,在那些工具集中,GUI 在一個與所有應用程式" "碼(包括事件處理常式)完全分離的執行緒中執行。" -#: ../../library/tkinter.rst:529 +#: ../../library/tkinter.rst:531 msgid "" "If the Tcl interpreter is not running the event loop and processing events, " "any :mod:`tkinter` calls made from threads other than the one running the " @@ -1126,11 +1134,11 @@ msgstr "" "如果 Tcl 直譯器沒有在執行事件迴圈和處理事件,那麼從執行 Tcl 直譯器的執行緒以" "外的執行緒發出的任何 :mod:`tkinter` 呼叫都將失敗。" -#: ../../library/tkinter.rst:533 +#: ../../library/tkinter.rst:535 msgid "A number of special cases exist:" msgstr "存在一些特殊情況:" -#: ../../library/tkinter.rst:535 +#: ../../library/tkinter.rst:537 msgid "" "Tcl/Tk libraries can be built so they are not thread-aware. In this case, :" "mod:`tkinter` calls the library from the originating Python thread, even if " @@ -1141,7 +1149,7 @@ msgstr "" "會從原始的 Python 執行緒呼叫該函式庫,即使這與建立 Tcl 直譯器的執行緒不同。一" "個全域鎖確保一次只發生一個呼叫。" -#: ../../library/tkinter.rst:540 +#: ../../library/tkinter.rst:542 msgid "" "While :mod:`tkinter` allows you to create more than one instance of a :class:" "`Tk` object (with its own interpreter), all interpreters that are part of " @@ -1155,7 +1163,7 @@ msgstr "" "亂。在實務上,不要一次建立多個 :class:`Tk` 的實例。否則,最好在不同的執行緒中" "建立它們,並確保你正在執行一個具備執行緒感知能力的 Tcl/Tk 建構版本。" -#: ../../library/tkinter.rst:546 +#: ../../library/tkinter.rst:548 msgid "" "Blocking event handlers are not the only way to prevent the Tcl interpreter " "from reentering the event loop. It is even possible to run multiple nested " @@ -1166,7 +1174,7 @@ msgstr "" "多個巢狀的事件迴圈或完全放棄事件迴圈。如果你在事件或執行緒方面做任何複雜的操" "作,請注意這些可能性。" -#: ../../library/tkinter.rst:551 +#: ../../library/tkinter.rst:553 msgid "" "There are a few select :mod:`tkinter` functions that presently work only " "when called from the thread that created the Tcl interpreter." @@ -1174,33 +1182,33 @@ msgstr "" "目前有少數幾個 :mod:`tkinter` 函式只有在從建立 Tcl 直譯器的執行緒中呼叫時才能" "正常運作。" -#: ../../library/tkinter.rst:556 +#: ../../library/tkinter.rst:558 msgid "Handy Reference" msgstr "實用參考" -#: ../../library/tkinter.rst:562 +#: ../../library/tkinter.rst:564 msgid "Setting Options" msgstr "設定選項" -#: ../../library/tkinter.rst:564 +#: ../../library/tkinter.rst:566 msgid "" "Options control things like the color and border width of a widget. Options " "can be set in three ways:" msgstr "選項控制著諸如元件的顏色和邊框寬度等。選項可以透過三種方式設定:" -#: ../../library/tkinter.rst:567 +#: ../../library/tkinter.rst:569 msgid "At object creation time, using keyword arguments" msgstr "在物件建立時,使用關鍵字引數" -#: ../../library/tkinter.rst:570 +#: ../../library/tkinter.rst:572 msgid "fred = Button(self, fg=\"red\", bg=\"blue\")" msgstr "fred = Button(self, fg=\"red\", bg=\"blue\")" -#: ../../library/tkinter.rst:572 +#: ../../library/tkinter.rst:574 msgid "After object creation, treating the option name like a dictionary index" msgstr "在物件建立後,將選項名稱視為字典索引" -#: ../../library/tkinter.rst:575 +#: ../../library/tkinter.rst:577 msgid "" "fred[\"fg\"] = \"red\"\n" "fred[\"bg\"] = \"blue\"" @@ -1208,23 +1216,23 @@ msgstr "" "fred[\"fg\"] = \"red\"\n" "fred[\"bg\"] = \"blue\"" -#: ../../library/tkinter.rst:578 +#: ../../library/tkinter.rst:580 msgid "" "Use the config() method to update multiple attrs subsequent to object " "creation" msgstr "在物件建立後,使用 config() 方法更新多個屬性" -#: ../../library/tkinter.rst:581 +#: ../../library/tkinter.rst:583 msgid "fred.config(fg=\"red\", bg=\"blue\")" msgstr "fred.config(fg=\"red\", bg=\"blue\")" -#: ../../library/tkinter.rst:583 +#: ../../library/tkinter.rst:585 msgid "" "For a complete explanation of a given option and its behavior, see the Tk " "man pages for the widget in question." msgstr "有關給定選項及其行為的完整解釋,請參閱相關元件的 Tk man pages。" -#: ../../library/tkinter.rst:586 +#: ../../library/tkinter.rst:588 msgid "" "Note that the man pages list \"STANDARD OPTIONS\" and \"WIDGET SPECIFIC " "OPTIONS\" for each widget. The former is a list of options that are common " @@ -1236,7 +1244,7 @@ msgstr "" "元件共有的選項串列,後者是該特定元件特有的選項。標準選項記錄在 :manpage:" "`options(3)` man page 中。" -#: ../../library/tkinter.rst:592 +#: ../../library/tkinter.rst:594 msgid "" "No distinction between standard and widget-specific options is made in this " "document. Some options don't apply to some kinds of widgets. Whether a " @@ -1247,7 +1255,7 @@ msgstr "" "給定元件是否回應特定選項取決於該元件的類別;按鈕有 ``command`` 選項,標籤則沒" "有。" -#: ../../library/tkinter.rst:597 +#: ../../library/tkinter.rst:599 msgid "" "The options supported by a given widget are listed in that widget's man " "page, or can be queried at runtime by calling the :meth:`config` method " @@ -1259,7 +1267,7 @@ msgstr "" "叫 :meth:`config` 方法,或對該元件呼叫 :meth:`keys` 方法來查詢。這些呼叫的回" "傳值是一個字典,其鍵是選項名稱的字串(例如 ``'relief'``),其值是 5-tuples。" -#: ../../library/tkinter.rst:603 +#: ../../library/tkinter.rst:605 msgid "" "Some options, like ``bg`` are synonyms for common options with long names " "(``bg`` is shorthand for \"background\"). Passing the ``config()`` method " @@ -1272,79 +1280,79 @@ msgstr "" "2-tuple,而不是 5-tuple。回傳的 2-tuple 將包含同義詞的名稱和「真實」選項(例" "如 ``('bg', 'background')``)。" -#: ../../library/tkinter.rst:610 +#: ../../library/tkinter.rst:612 msgid "Index" msgstr "索引" -#: ../../library/tkinter.rst:610 +#: ../../library/tkinter.rst:612 msgid "Meaning" msgstr "含義" -#: ../../library/tkinter.rst:610 +#: ../../library/tkinter.rst:612 msgid "Example" msgstr "範例" -#: ../../library/tkinter.rst:612 +#: ../../library/tkinter.rst:614 msgid "0" msgstr "0" -#: ../../library/tkinter.rst:612 +#: ../../library/tkinter.rst:614 msgid "option name" msgstr "選項名稱" -#: ../../library/tkinter.rst:612 ../../library/tkinter.rst:614 +#: ../../library/tkinter.rst:614 ../../library/tkinter.rst:616 msgid "``'relief'``" msgstr "``'relief'``" -#: ../../library/tkinter.rst:614 +#: ../../library/tkinter.rst:616 msgid "1" msgstr "1" -#: ../../library/tkinter.rst:614 +#: ../../library/tkinter.rst:616 msgid "option name for database lookup" msgstr "用於資料庫查詢的選項名稱" -#: ../../library/tkinter.rst:616 +#: ../../library/tkinter.rst:618 msgid "2" msgstr "2" -#: ../../library/tkinter.rst:616 +#: ../../library/tkinter.rst:618 msgid "option class for database lookup" msgstr "用於資料庫查詢的選項類別" -#: ../../library/tkinter.rst:616 +#: ../../library/tkinter.rst:618 msgid "``'Relief'``" msgstr "``'Relief'``" -#: ../../library/tkinter.rst:619 +#: ../../library/tkinter.rst:621 msgid "3" msgstr "3" -#: ../../library/tkinter.rst:619 +#: ../../library/tkinter.rst:621 msgid "default value" msgstr "預設值" -#: ../../library/tkinter.rst:619 +#: ../../library/tkinter.rst:621 msgid "``'raised'``" msgstr "``'raised'``" -#: ../../library/tkinter.rst:621 +#: ../../library/tkinter.rst:623 msgid "4" msgstr "4" -#: ../../library/tkinter.rst:621 +#: ../../library/tkinter.rst:623 msgid "current value" msgstr "目前值" -#: ../../library/tkinter.rst:621 +#: ../../library/tkinter.rst:623 msgid "``'groove'``" msgstr "``'groove'``" -#: ../../library/tkinter.rst:624 +#: ../../library/tkinter.rst:626 msgid "Example::" msgstr "範例: ::" -#: ../../library/tkinter.rst:626 +#: ../../library/tkinter.rst:628 msgid "" ">>> print(fred.config())\n" "{'relief': ('relief', 'relief', 'Relief', 'raised', 'groove')}" @@ -1352,17 +1360,17 @@ msgstr "" ">>> print(fred.config())\n" "{'relief': ('relief', 'relief', 'Relief', 'raised', 'groove')}" -#: ../../library/tkinter.rst:629 +#: ../../library/tkinter.rst:631 msgid "" "Of course, the dictionary printed will include all the options available and " "their values. This is meant only as an example." msgstr "當然,印出的字典將包含所有可用的選項及其值。這僅作為一個範例。" -#: ../../library/tkinter.rst:634 +#: ../../library/tkinter.rst:636 msgid "The Packer" msgstr "Packer 佈局管理器" -#: ../../library/tkinter.rst:638 +#: ../../library/tkinter.rst:640 msgid "" "The packer is one of Tk's geometry-management mechanisms. Geometry " "managers are used to specify the relative positioning of widgets within " @@ -1377,7 +1385,7 @@ msgstr "" "瑣的 *placer*\\ (較不常用,我們在此不予介紹)相比,packer 採用定性的關係規範" "——*上方*、*左方*、*填滿*\\ 等——並為你計算出確切的放置座標。" -#: ../../library/tkinter.rst:645 +#: ../../library/tkinter.rst:647 msgid "" "The size of any *master* widget is determined by the size of the \"slave " "widgets\" inside. The packer is used to control where slave widgets appear " @@ -1391,7 +1399,7 @@ msgstr "" "再將框架 pack 到其他框架中,以達到你想要的佈局。此外,一旦 packed,佈局會動態" "調整以適應設定的增量變更。" -#: ../../library/tkinter.rst:652 +#: ../../library/tkinter.rst:654 msgid "" "Note that widgets do not appear until they have had their geometry specified " "with a geometry manager. It's a common early mistake to leave out the " @@ -1404,7 +1412,7 @@ msgstr "" "但沒有任何東西出現時感到驚訝。一個元件只有在例如 packer 的 :meth:`pack` 方法" "被應用於其上之後才會出現。" -#: ../../library/tkinter.rst:658 +#: ../../library/tkinter.rst:660 msgid "" "The pack() method can be called with keyword-option/value pairs that control " "where the widget is to appear within its container, and how it is to behave " @@ -1413,7 +1421,7 @@ msgstr "" "pack() 方法可以與關鍵字選項/值對一起呼叫,以控制元件在其容器中出現的位置,以" "及當主應用程式視窗調整大小時它的行為方式。以下是一些範例: ::" -#: ../../library/tkinter.rst:662 +#: ../../library/tkinter.rst:664 msgid "" "fred.pack() # defaults to side = \"top\"\n" "fred.pack(side=\"left\")\n" @@ -1423,11 +1431,11 @@ msgstr "" "fred.pack(side=\"left\")\n" "fred.pack(expand=1)" -#: ../../library/tkinter.rst:668 +#: ../../library/tkinter.rst:670 msgid "Packer Options" msgstr "Packer 選項" -#: ../../library/tkinter.rst:670 +#: ../../library/tkinter.rst:672 msgid "" "For more extensive information on the packer and the options that it can " "take, see the man pages and page 183 of John Ousterhout's book." @@ -1435,62 +1443,62 @@ msgstr "" "有關 packer 及其可接受選項的更詳盡資訊,請參閱 man pages 和 John Ousterhout " "書中的第 183 頁。" -#: ../../library/tkinter.rst:673 ../../library/tkinter.rst:792 +#: ../../library/tkinter.rst:675 ../../library/tkinter.rst:794 msgid "anchor" msgstr "anchor" -#: ../../library/tkinter.rst:674 +#: ../../library/tkinter.rst:676 msgid "" "Anchor type. Denotes where the packer is to place each slave in its parcel." msgstr "錨點類型。表示 packer 將每個 slave 放置在其區域中的位置。" -#: ../../library/tkinter.rst:676 +#: ../../library/tkinter.rst:678 msgid "expand" msgstr "expand" -#: ../../library/tkinter.rst:677 +#: ../../library/tkinter.rst:679 msgid "Boolean, ``0`` or ``1``." msgstr "布林值,``0`` 或 ``1``。" -#: ../../library/tkinter.rst:679 +#: ../../library/tkinter.rst:681 msgid "fill" msgstr "fill" -#: ../../library/tkinter.rst:680 +#: ../../library/tkinter.rst:682 msgid "Legal values: ``'x'``, ``'y'``, ``'both'``, ``'none'``." msgstr "合法值:``'x'``、``'y'``、``'both'``、``'none'``。" -#: ../../library/tkinter.rst:682 +#: ../../library/tkinter.rst:684 msgid "ipadx and ipady" msgstr "ipadx 和 ipady" -#: ../../library/tkinter.rst:683 +#: ../../library/tkinter.rst:685 msgid "" "A distance - designating internal padding on each side of the slave widget." msgstr "一個距離——指定 slave 元件每側的內部填充。" -#: ../../library/tkinter.rst:685 +#: ../../library/tkinter.rst:687 msgid "padx and pady" msgstr "padx 和 pady" -#: ../../library/tkinter.rst:686 +#: ../../library/tkinter.rst:688 msgid "" "A distance - designating external padding on each side of the slave widget." msgstr "一個距離——指定 slave 元件每側的外部填充。" -#: ../../library/tkinter.rst:688 +#: ../../library/tkinter.rst:690 msgid "side" msgstr "side" -#: ../../library/tkinter.rst:689 +#: ../../library/tkinter.rst:691 msgid "Legal values are: ``'left'``, ``'right'``, ``'top'``, ``'bottom'``." msgstr "合法值為:``'left'``、``'right'``、``'top'``、``'bottom'``。" -#: ../../library/tkinter.rst:693 +#: ../../library/tkinter.rst:695 msgid "Coupling Widget Variables" msgstr "耦合元件變數" -#: ../../library/tkinter.rst:695 +#: ../../library/tkinter.rst:697 msgid "" "The current-value setting of some widgets (like text entry widgets) can be " "connected directly to application variables by using special options. These " @@ -1504,7 +1512,7 @@ msgstr "" "和 ``value``。這種連接是雙向的:如果變數因任何原因發生變化,與之連接的元件將" "會更新以反映新值。" -#: ../../library/tkinter.rst:701 +#: ../../library/tkinter.rst:703 msgid "" "Unfortunately, in the current implementation of :mod:`tkinter` it is not " "possible to hand over an arbitrary Python variable to a widget through a " @@ -1516,7 +1524,7 @@ msgstr "" "``textvariable`` 選項將任意的 Python 變數傳遞給元件。唯一適用此功能的變數類型" "是從 :mod:`tkinter` 中定義的一個名為 Variable 的類別繼承的子類別變數。" -#: ../../library/tkinter.rst:707 +#: ../../library/tkinter.rst:709 msgid "" "There are many useful subclasses of Variable already defined: :class:" "`StringVar`, :class:`IntVar`, :class:`DoubleVar`, and :class:`BooleanVar`. " @@ -1530,11 +1538,11 @@ msgstr "" "叫 :meth:`get` 方法,要更改其值,則呼叫 :meth:`!set` 方法。如果你遵循此協定," "元件將始終追蹤變數的值,無需你進一步干預。" -#: ../../library/tkinter.rst:714 ../../library/tkinter.rst:893 +#: ../../library/tkinter.rst:716 ../../library/tkinter.rst:895 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/tkinter.rst:716 +#: ../../library/tkinter.rst:718 msgid "" "import tkinter as tk\n" "\n" @@ -1596,11 +1604,11 @@ msgstr "" "myapp = App(root)\n" "myapp.mainloop()" -#: ../../library/tkinter.rst:747 +#: ../../library/tkinter.rst:749 msgid "The Window Manager" msgstr "視窗管理器" -#: ../../library/tkinter.rst:751 +#: ../../library/tkinter.rst:753 msgid "" "In Tk, there is a utility command, ``wm``, for interacting with the window " "manager. Options to the ``wm`` command allow you to control things like " @@ -1614,7 +1622,7 @@ msgstr "" "class:`Wm` 類別上的方法。頂層元件是 :class:`Wm` 類別的子類別,因此可以直接呼" "叫 :class:`Wm` 方法。" -#: ../../library/tkinter.rst:758 +#: ../../library/tkinter.rst:760 msgid "" "To get at the toplevel window that contains a given widget, you can often " "just refer to the widget's master. Of course if the widget has been packed " @@ -1629,11 +1637,11 @@ msgstr "" "頂層視窗,你可以呼叫 :meth:`_root` 方法。此方法以底線開頭,表示此函式是實作的" "一部分,而不是 Tk 功能的介面。" -#: ../../library/tkinter.rst:765 +#: ../../library/tkinter.rst:767 msgid "Here are some examples of typical usage::" msgstr "以下是一些常見用法範例: ::" -#: ../../library/tkinter.rst:767 +#: ../../library/tkinter.rst:769 msgid "" "import tkinter as tk\n" "\n" @@ -1673,11 +1681,11 @@ msgstr "" "# 啟動程式\n" "myapp.mainloop()" -#: ../../library/tkinter.rst:788 ../../library/tkinter.rst:790 +#: ../../library/tkinter.rst:790 ../../library/tkinter.rst:792 msgid "Tk Option Data Types" msgstr "Tk 選項資料型別" -#: ../../library/tkinter.rst:793 +#: ../../library/tkinter.rst:795 msgid "" "Legal values are points of the compass: ``\"n\"``, ``\"ne\"``, ``\"e\"``, " "``\"se\"``, ``\"s\"``, ``\"sw\"``, ``\"w\"``, ``\"nw\"``, and also " @@ -1686,11 +1694,11 @@ msgstr "" "合法值為羅盤方位點:``\"n\"``、``\"ne\"``、``\"e\"``、``\"se\"``、``\"s\"``、" "``\"sw\"``、``\"w\"``、``\"nw\"``,以及 ``\"center\"``。" -#: ../../library/tkinter.rst:796 +#: ../../library/tkinter.rst:798 msgid "bitmap" msgstr "bitmap" -#: ../../library/tkinter.rst:797 +#: ../../library/tkinter.rst:799 msgid "" "There are eight built-in, named bitmaps: ``'error'``, ``'gray25'``, " "``'gray50'``, ``'hourglass'``, ``'info'``, ``'questhead'``, ``'question'``, " @@ -1702,23 +1710,23 @@ msgstr "" "要指定一個 X 點陣圖檔名,請給出檔案的完整路徑,並在前面加上一個 ``@``,例如 " "``\"@/usr/contrib/bitmap/gumby.bit\"``。" -#: ../../library/tkinter.rst:802 +#: ../../library/tkinter.rst:804 msgid "boolean" msgstr "boolean" -#: ../../library/tkinter.rst:803 +#: ../../library/tkinter.rst:805 msgid "You can pass integers 0 or 1 or the strings ``\"yes\"`` or ``\"no\"``." msgstr "你可以傳遞整數 0 或 1,或字串 ``\"yes\"`` 或 ``\"no\"``。" -#: ../../library/tkinter.rst:805 +#: ../../library/tkinter.rst:807 msgid "callback" msgstr "callback" -#: ../../library/tkinter.rst:806 +#: ../../library/tkinter.rst:808 msgid "This is any Python function that takes no arguments. For example::" msgstr "這是任何不帶引數的 Python 函式。例如: ::" -#: ../../library/tkinter.rst:808 +#: ../../library/tkinter.rst:810 msgid "" "def print_it():\n" " print(\"hi there\")\n" @@ -1728,11 +1736,11 @@ msgstr "" " print(\"hi there\")\n" "fred[\"command\"] = print_it" -#: ../../library/tkinter.rst:812 +#: ../../library/tkinter.rst:814 msgid "color" msgstr "color" -#: ../../library/tkinter.rst:813 +#: ../../library/tkinter.rst:815 msgid "" "Colors can be given as the names of X colors in the rgb.txt file, or as " "strings representing RGB values in 4 bit: ``\"#RGB\"``, 8 bit: " @@ -1745,11 +1753,11 @@ msgstr "" "``\"#RRRGGGBBB\"`` 或 16 位元:``\"#RRRRGGGGBBBB\"``,其中 R、G、B 在此代表任" "何合法的十六進位數字。詳情請參閱 Ousterhout 書中的第 160 頁。" -#: ../../library/tkinter.rst:818 +#: ../../library/tkinter.rst:820 msgid "cursor" msgstr "cursor" -#: ../../library/tkinter.rst:819 +#: ../../library/tkinter.rst:821 msgid "" "The standard X cursor names from :file:`cursorfont.h` can be used, without " "the ``XC_`` prefix. For example to get a hand cursor (:const:`XC_hand2`), " @@ -1760,11 +1768,11 @@ msgstr "" "要取得手形游標(:const:`XC_hand2`),請使用字串 ``\"hand2\"``。你也可以指定自" "己的點陣圖和遮罩檔案。請參閱 Ousterhout 書中的第 179 頁。" -#: ../../library/tkinter.rst:824 +#: ../../library/tkinter.rst:826 msgid "distance" msgstr "distance" -#: ../../library/tkinter.rst:825 +#: ../../library/tkinter.rst:827 msgid "" "Screen distances can be specified in either pixels or absolute distances. " "Pixels are given as numbers and absolute distances as strings, with the " @@ -1776,11 +1784,11 @@ msgstr "" "元表示單位:``c`` 代表公分,``i`` 代表英寸,``m`` 代表毫米,``p`` 代表印刷的" "點。例如,3.5 英寸表示為 ``\"3.5i\"``。" -#: ../../library/tkinter.rst:831 +#: ../../library/tkinter.rst:833 msgid "font" msgstr "font" -#: ../../library/tkinter.rst:832 +#: ../../library/tkinter.rst:834 msgid "" "Tk uses a list font name format, such as ``{courier 10 bold}``. Font sizes " "with positive numbers are measured in points; sizes with negative numbers " @@ -1789,11 +1797,11 @@ msgstr "" "Tk 使用串列字型名稱格式,例如 ``{courier 10 bold}``。帶有正數的字型大小以點為" "單位;帶有負數的大小以像素為單位。" -#: ../../library/tkinter.rst:836 +#: ../../library/tkinter.rst:838 msgid "geometry" msgstr "geometry" -#: ../../library/tkinter.rst:837 +#: ../../library/tkinter.rst:839 msgid "" "This is a string of the form ``widthxheight``, where width and height are " "measured in pixels for most widgets (in characters for widgets displaying " @@ -1803,22 +1811,21 @@ msgstr "" "像素為單位(對於顯示文字的元件則以字元為單位)。例如:``fred[\"geometry\"] = " "\"200x100\"``。" -#: ../../library/tkinter.rst:841 +#: ../../library/tkinter.rst:843 msgid "justify" msgstr "justify" -#: ../../library/tkinter.rst:842 +#: ../../library/tkinter.rst:844 msgid "" "Legal values are the strings: ``\"left\"``, ``\"center\"``, and " "``\"right\"``." -msgstr "" -"合法值為字串:``\"left\"``、``\"center\"`` 和 ``\"right\"``。" +msgstr "合法值為字串:``\"left\"``、``\"center\"`` 和 ``\"right\"``。" -#: ../../library/tkinter.rst:844 +#: ../../library/tkinter.rst:846 msgid "region" msgstr "region" -#: ../../library/tkinter.rst:845 +#: ../../library/tkinter.rst:847 msgid "" "This is a string with four space-delimited elements, each of which is a " "legal distance (see above). For example: ``\"2 3 4 5\"`` and ``\"3i 2i 4.5i " @@ -1828,11 +1835,11 @@ msgstr "" "文)。例如:``\"2 3 4 5\"``、``\"3i 2i 4.5i 2i\"`` 和 ``\"3c 2c 4c " "10.43c\"`` 都是合法的區域。" -#: ../../library/tkinter.rst:849 +#: ../../library/tkinter.rst:851 msgid "relief" msgstr "relief" -#: ../../library/tkinter.rst:850 +#: ../../library/tkinter.rst:852 msgid "" "Determines what the border style of a widget will be. Legal values are: " "``\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, and " @@ -1841,11 +1848,11 @@ msgstr "" "決定元件的邊框樣式。合法值為:``\"raised\"``、``\"sunken\"``、``\"flat\"``、" "``\"groove\"`` 和 ``\"ridge\"``。" -#: ../../library/tkinter.rst:853 +#: ../../library/tkinter.rst:855 msgid "scrollcommand" msgstr "scrollcommand" -#: ../../library/tkinter.rst:854 +#: ../../library/tkinter.rst:856 msgid "" "This is almost always the :meth:`!set` method of some scrollbar widget, but " "can be any widget method that takes a single argument." @@ -1853,19 +1860,19 @@ msgstr "" "這幾乎總是某個捲軸元件的 :meth:`!set` 方法,但也可以是任何接受單一引數的元件" "方法。" -#: ../../library/tkinter.rst:857 +#: ../../library/tkinter.rst:859 msgid "wrap" msgstr "wrap" -#: ../../library/tkinter.rst:858 +#: ../../library/tkinter.rst:860 msgid "Must be one of: ``\"none\"``, ``\"char\"``, or ``\"word\"``." msgstr "必須是以下之一:``\"none\"``、``\"char\"`` 或 ``\"word\"``。" -#: ../../library/tkinter.rst:863 +#: ../../library/tkinter.rst:865 msgid "Bindings and Events" msgstr "繫結與事件" -#: ../../library/tkinter.rst:869 +#: ../../library/tkinter.rst:871 msgid "" "The bind method from the widget command allows you to watch for certain " "events and to have a callback function trigger when that event type occurs. " @@ -1874,19 +1881,19 @@ msgstr "" "來自元件指令的 bind 方法允許你監視某些事件,並在該事件類型發生時觸發一個回呼" "函式。bind 方法的形式是: ::" -#: ../../library/tkinter.rst:873 +#: ../../library/tkinter.rst:875 msgid "def bind(self, sequence, func, add=''):" msgstr "def bind(self, sequence, func, add=''):" -#: ../../library/tkinter.rst:875 +#: ../../library/tkinter.rst:877 msgid "where:" msgstr "其中:" -#: ../../library/tkinter.rst:877 +#: ../../library/tkinter.rst:879 msgid "sequence" msgstr "sequence" -#: ../../library/tkinter.rst:878 +#: ../../library/tkinter.rst:880 msgid "" "is a string that denotes the target kind of event. (See the :manpage:" "`bind(3tk)` man page, and page 201 of John Ousterhout's book, :title-" @@ -1896,11 +1903,11 @@ msgstr "" "及 John Ousterhout 的書 :title-reference:`Tcl and the Tk Toolkit (2nd " "edition)` 的第 201 頁)。" -#: ../../library/tkinter.rst:882 +#: ../../library/tkinter.rst:884 msgid "func" msgstr "func" -#: ../../library/tkinter.rst:883 +#: ../../library/tkinter.rst:885 msgid "" "is a Python function, taking one argument, to be invoked when the event " "occurs. An Event instance will be passed as the argument. (Functions " @@ -1909,11 +1916,11 @@ msgstr "" "是一個 Python 函式,接受一個引數,在事件發生時被呼叫。一個 Event 實例將作為引" "數傳遞。(以這種方式部署的函式通常稱為\\ *回呼*。)" -#: ../../library/tkinter.rst:887 +#: ../../library/tkinter.rst:889 msgid "add" msgstr "add" -#: ../../library/tkinter.rst:888 +#: ../../library/tkinter.rst:890 msgid "" "is optional, either ``''`` or ``'+'``. Passing an empty string denotes that " "this binding is to replace any other bindings that this event is associated " @@ -1924,7 +1931,7 @@ msgstr "" "聯的任何其他繫結。傳遞一個 ``'+'`` 意味著此函式將被新增到繫結到此事件類型的函" "式串列中。" -#: ../../library/tkinter.rst:895 +#: ../../library/tkinter.rst:897 msgid "" "def turn_red(self, event):\n" " event.widget[\"activeforeground\"] = \"red\"\n" @@ -1936,7 +1943,7 @@ msgstr "" "\n" "self.button.bind(\"\", self.turn_red)" -#: ../../library/tkinter.rst:900 +#: ../../library/tkinter.rst:902 msgid "" "Notice how the widget field of the event is being accessed in the " "``turn_red()`` callback. This field contains the widget that caught the X " @@ -1948,143 +1955,143 @@ msgstr "" "件的元件。下表列出了你可以存取的其他事件欄位,以及它們在 Tk 中的表示方式,這" "在參閱 Tk man pages 時可能很有用。" -#: ../../library/tkinter.rst:906 +#: ../../library/tkinter.rst:908 msgid "Tkinter Event Field" msgstr "Tkinter 事件欄位" -#: ../../library/tkinter.rst:908 +#: ../../library/tkinter.rst:910 msgid "%f" msgstr "%f" -#: ../../library/tkinter.rst:908 +#: ../../library/tkinter.rst:910 msgid "focus" msgstr "focus" -#: ../../library/tkinter.rst:908 +#: ../../library/tkinter.rst:910 msgid "%A" msgstr "%A" -#: ../../library/tkinter.rst:908 +#: ../../library/tkinter.rst:910 msgid "char" msgstr "char" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:912 msgid "%h" msgstr "%h" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:912 msgid "height" msgstr "height" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:912 msgid "%E" msgstr "%E" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:912 msgid "send_event" msgstr "send_event" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:914 msgid "%k" msgstr "%k" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:914 msgid "keycode" msgstr "keycode" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:914 msgid "%K" msgstr "%K" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:914 msgid "keysym" msgstr "keysym" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:916 msgid "%s" msgstr "%s" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:916 msgid "state" msgstr "state" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:916 msgid "%N" msgstr "%N" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:916 msgid "keysym_num" msgstr "keysym_num" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:918 msgid "%t" msgstr "%t" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:918 msgid "time" msgstr "time" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:918 msgid "%T" msgstr "%T" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:918 msgid "type" msgstr "type" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:920 msgid "%w" msgstr "%w" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:920 msgid "width" msgstr "width" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:920 msgid "%W" msgstr "%W" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:920 msgid "widget" msgstr "widget" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:922 msgid "%x" msgstr "%x" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:922 msgid "x" msgstr "x" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:922 msgid "%X" msgstr "%X" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:922 msgid "x_root" msgstr "x_root" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:924 msgid "%y" msgstr "%y" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:924 msgid "y" msgstr "y" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:924 msgid "%Y" msgstr "%Y" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:924 msgid "y_root" msgstr "y_root" -#: ../../library/tkinter.rst:927 +#: ../../library/tkinter.rst:929 msgid "The index Parameter" msgstr "index 參數" -#: ../../library/tkinter.rst:929 +#: ../../library/tkinter.rst:931 msgid "" "A number of widgets require \"index\" parameters to be passed. These are " "used to point at a specific place in a Text widget, or to particular " @@ -2093,11 +2100,11 @@ msgstr "" "許多元件需要傳遞 \"index\" 參數。這些參數用於指向 Text 元件中的特定位置、" "Entry 元件中的特定字元,或 Menu 元件中的特定選單項目。" -#: ../../library/tkinter.rst:933 +#: ../../library/tkinter.rst:935 msgid "Entry widget indexes (index, view index, etc.)" msgstr "Entry 元件索引(index、view index 等)" -#: ../../library/tkinter.rst:934 +#: ../../library/tkinter.rst:936 msgid "" "Entry widgets have options that refer to character positions in the text " "being displayed. You can use these :mod:`tkinter` functions to access these " @@ -2106,21 +2113,21 @@ msgstr "" "Entry 元件具有參照所顯示文字中字元位置的選項。你可以使用這些 :mod:`tkinter` " "函式來存取文字元件中的這些特殊點:" -#: ../../library/tkinter.rst:938 +#: ../../library/tkinter.rst:940 msgid "Text widget indexes" msgstr "Text 元件索引" -#: ../../library/tkinter.rst:939 +#: ../../library/tkinter.rst:941 msgid "" "The index notation for Text widgets is very rich and is best described in " "the Tk man pages." msgstr "Text 元件的索引表示法非常豐富,在 Tk man pages 中有最好的描述。" -#: ../../library/tkinter.rst:942 +#: ../../library/tkinter.rst:944 msgid "Menu indexes (menu.invoke(), menu.entryconfig(), etc.)" msgstr "選單索引(menu.invoke()、menu.entryconfig() 等)" -#: ../../library/tkinter.rst:943 +#: ../../library/tkinter.rst:945 msgid "" "Some options and methods for menus manipulate specific menu entries. Anytime " "a menu index is needed for an option or a parameter, you may pass in:" @@ -2128,23 +2135,23 @@ msgstr "" "選單的某些選項和方法會操作特定的選單項目。每當選項或參數需要選單索引時,你可" "以傳入:" -#: ../../library/tkinter.rst:946 +#: ../../library/tkinter.rst:948 msgid "" "an integer which refers to the numeric position of the entry in the widget, " "counted from the top, starting with 0;" msgstr "一個整數,它參照元件中項目的數字位置,從頂部開始計數,從 0 開始;" -#: ../../library/tkinter.rst:949 +#: ../../library/tkinter.rst:951 msgid "" "the string ``\"active\"``, which refers to the menu position that is " "currently under the cursor;" msgstr "字串 ``\"active\"``,它參照目前在游標下的選單位置;" -#: ../../library/tkinter.rst:952 +#: ../../library/tkinter.rst:954 msgid "the string ``\"last\"`` which refers to the last menu item;" msgstr "字串 ``\"last\"``,它參照最後一個選單項目;" -#: ../../library/tkinter.rst:954 +#: ../../library/tkinter.rst:956 msgid "" "An integer preceded by ``@``, as in ``@6``, where the integer is interpreted " "as a y pixel coordinate in the menu's coordinate system;" @@ -2152,7 +2159,7 @@ msgstr "" "一個以 ``@`` 為前綴的整數,如 ``@6``,其中該整數被解釋為選單座標系統中的 y 像" "素座標;" -#: ../../library/tkinter.rst:957 +#: ../../library/tkinter.rst:959 msgid "" "the string ``\"none\"``, which indicates no menu entry at all, most often " "used with menu.activate() to deactivate all entries, and finally," @@ -2160,7 +2167,7 @@ msgstr "" "字串 ``\"none\"``,表示完全沒有選單項目,最常用於 menu.activate() 以停用所有" "項目,最後," -#: ../../library/tkinter.rst:960 +#: ../../library/tkinter.rst:962 msgid "" "a text string that is pattern matched against the label of the menu entry, " "as scanned from the top of the menu to the bottom. Note that this index " @@ -2172,21 +2179,21 @@ msgstr "" "此索引類型在所有其他類型之後考慮,這意味著標籤為 ``last``、``active`` 或 " "``none`` 的選單項目的匹配可能會被解釋為上述的字面值。" -#: ../../library/tkinter.rst:968 +#: ../../library/tkinter.rst:970 msgid "Images" msgstr "圖片" -#: ../../library/tkinter.rst:970 +#: ../../library/tkinter.rst:972 msgid "" "Images of different formats can be created through the corresponding " "subclass of :class:`tkinter.Image`:" msgstr "可以透過 :class:`tkinter.Image` 的相應子類別來建立不同格式的圖片:" -#: ../../library/tkinter.rst:973 +#: ../../library/tkinter.rst:975 msgid ":class:`BitmapImage` for images in XBM format." msgstr ":class:`BitmapImage` 用於 XBM 格式的圖片。" -#: ../../library/tkinter.rst:975 +#: ../../library/tkinter.rst:977 msgid "" ":class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter " "is supported starting with Tk 8.6." @@ -2194,14 +2201,14 @@ msgstr "" ":class:`PhotoImage` 用於 PGM、PPM、GIF 和 PNG 格式的圖片。後者從 Tk 8.6 開始" "支援。" -#: ../../library/tkinter.rst:978 +#: ../../library/tkinter.rst:980 msgid "" "Either type of image is created through either the ``file`` or the ``data`` " "option (other options are available as well)." msgstr "" "任一類型的圖片都是透過 ``file`` 或 ``data`` 選項建立的(也有其他選項可用)。" -#: ../../library/tkinter.rst:981 +#: ../../library/tkinter.rst:983 msgid "" "Added the :class:`!PhotoImage` method :meth:`!copy_replace` to copy a region " "from one image to other image, possibly with pixel zooming and/or " @@ -2215,7 +2222,7 @@ msgstr "" "subsample`。將 *zoom* 和 *subsample* 參數新增到 :class:`!PhotoImage` 方法 :" "meth:`!copy`。" -#: ../../library/tkinter.rst:990 +#: ../../library/tkinter.rst:992 msgid "" "The image object can then be used wherever an ``image`` option is supported " "by some widget (e.g. labels, buttons, menus). In these cases, Tk will not " @@ -2227,7 +2234,7 @@ msgstr "" "用。在這些情況下,Tk 將不會保留對圖片的參照。當對圖片物件的最後一個 Python 參" "照被刪除時,圖片資料也會被刪除,Tk 將在使用該圖片的任何地方顯示一個空框。" -#: ../../library/tkinter.rst:998 +#: ../../library/tkinter.rst:1000 msgid "" "The `Pillow `_ package adds support for formats " "such as BMP, JPEG, TIFF, and WebP, among others." @@ -2235,11 +2242,11 @@ msgstr "" "`Pillow `_ 套件新增了對 BMP、JPEG、TIFF 和 WebP " "等格式的支援。" -#: ../../library/tkinter.rst:1004 +#: ../../library/tkinter.rst:1006 msgid "File Handlers" msgstr "檔案處理常式" -#: ../../library/tkinter.rst:1006 +#: ../../library/tkinter.rst:1008 msgid "" "Tk allows you to register and unregister a callback function which will be " "called from the Tk mainloop when I/O is possible on a file descriptor. Only " @@ -2248,7 +2255,7 @@ msgstr "" "Tk 允許你註冊和取消註冊一個回呼函式,當檔案描述器上可以進行 I/O 時,該函式將" "從 Tk 主迴圈中被呼叫。每個檔案描述器只能註冊一個處理常式。範例程式碼: ::" -#: ../../library/tkinter.rst:1010 +#: ../../library/tkinter.rst:1012 msgid "" "import tkinter\n" "widget = tkinter.Tk()\n" @@ -2264,11 +2271,11 @@ msgstr "" "...\n" "widget.tk.deletefilehandler(file)" -#: ../../library/tkinter.rst:1017 +#: ../../library/tkinter.rst:1019 msgid "This feature is not available on Windows." msgstr "此功能在 Windows 上不可用。" -#: ../../library/tkinter.rst:1019 +#: ../../library/tkinter.rst:1021 msgid "" "Since you don't know how many bytes are available for reading, you may not " "want to use the :class:`~io.BufferedIOBase` or :class:`~io.TextIOBase` :meth:" @@ -2285,7 +2292,7 @@ msgstr "" "法可以正常運作;對於其他檔案,請使用原始讀取或 ``os.read(file.fileno(), " "maxbytecount)``。" -#: ../../library/tkinter.rst:1030 +#: ../../library/tkinter.rst:1032 msgid "" "Registers the file handler callback function *func*. The *file* argument may " "either be an object with a :meth:`~io.IOBase.fileno` method (such as a file " @@ -2298,31 +2305,31 @@ msgstr "" "器。*mask* 引數是下面三個常數中任意一個的 OR 組合。回呼函式被呼叫的方式如" "下: ::" -#: ../../library/tkinter.rst:1036 +#: ../../library/tkinter.rst:1038 msgid "callback(file, mask)" msgstr "callback(file, mask)" -#: ../../library/tkinter.rst:1041 +#: ../../library/tkinter.rst:1043 msgid "Unregisters a file handler." msgstr "取消註冊檔案處理常式。" -#: ../../library/tkinter.rst:1048 +#: ../../library/tkinter.rst:1050 msgid "Constants used in the *mask* arguments." msgstr "用於 *mask* 引數的常數。" -#: ../../library/tkinter.rst:636 +#: ../../library/tkinter.rst:638 msgid "packing (widgets)" msgstr "packing(元件)" -#: ../../library/tkinter.rst:749 +#: ../../library/tkinter.rst:751 msgid "window manager (widgets)" msgstr "視窗管理器(元件)" -#: ../../library/tkinter.rst:865 +#: ../../library/tkinter.rst:867 msgid "bind (widgets)" msgstr "bind(元件)" -#: ../../library/tkinter.rst:865 +#: ../../library/tkinter.rst:867 msgid "events (widgets)" msgstr "事件(元件)" diff --git a/library/turtle.po b/library/turtle.po index 167466940b4..59795cf44fb 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-14 00:14+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,11 +40,19 @@ msgstr "" "的,一個 `以 Logo 程式語言撰寫的廣受歡迎的幾何繪圖工具 `_。" -#: ../../library/turtle.rst:34 -msgid "Get started" +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." msgstr "" #: ../../library/turtle.rst:36 +msgid "Get started" +msgstr "" + +#: ../../library/turtle.rst:38 msgid "" "Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an " "``import turtle``, give it the command ``turtle.forward(15)``, and it moves " @@ -53,26 +61,26 @@ msgid "" "degrees clockwise." msgstr "" -#: ../../library/turtle.rst:43 +#: ../../library/turtle.rst:45 msgid "" "Turtle can draw intricate shapes using programs that repeat simple moves." msgstr "龜可以使用重複簡單動作之程式來畫出複雜的形狀。" -#: ../../library/turtle.rst:49 +#: ../../library/turtle.rst:51 msgid "" "In Python, turtle graphics provides a representation of a physical " "\"turtle\" (a little robot with a pen) that draws on a sheet of paper on the " "floor." msgstr "" -#: ../../library/turtle.rst:52 +#: ../../library/turtle.rst:54 msgid "" "It's an effective and well-proven way for learners to encounter programming " "concepts and interaction with software, as it provides instant, visible " "feedback. It also provides convenient access to graphical output in general." msgstr "" -#: ../../library/turtle.rst:57 +#: ../../library/turtle.rst:59 msgid "" "Turtle drawing was originally created as an educational tool, to be used by " "teachers in the classroom. For the programmer who needs to produce some " @@ -80,62 +88,62 @@ msgid "" "introducing more complex or external libraries into their work." msgstr "" -#: ../../library/turtle.rst:66 +#: ../../library/turtle.rst:68 msgid "Tutorial" msgstr "教學" -#: ../../library/turtle.rst:68 +#: ../../library/turtle.rst:70 msgid "" "New users should start here. In this tutorial we'll explore some of the " "basics of turtle drawing." msgstr "" -#: ../../library/turtle.rst:73 +#: ../../library/turtle.rst:75 msgid "Starting a turtle environment" msgstr "啟動一個烏龜環境" -#: ../../library/turtle.rst:75 +#: ../../library/turtle.rst:77 msgid "In a Python shell, import all the objects of the ``turtle`` module::" msgstr "在 Python shell 中,引入 ``turtle`` 模組中所有物件: ::" -#: ../../library/turtle.rst:77 +#: ../../library/turtle.rst:79 msgid "from turtle import *" msgstr "from turtle import *" -#: ../../library/turtle.rst:79 +#: ../../library/turtle.rst:81 msgid "" "If you run into a ``No module named '_tkinter'`` error, you'll have to " "install the :mod:`Tk interface package ` on your system." msgstr "" -#: ../../library/turtle.rst:84 +#: ../../library/turtle.rst:86 msgid "Basic drawing" msgstr "基本繪圖" -#: ../../library/turtle.rst:86 +#: ../../library/turtle.rst:88 msgid "Send the turtle forward 100 steps::" msgstr "" -#: ../../library/turtle.rst:88 +#: ../../library/turtle.rst:90 msgid "forward(100)" msgstr "forward(100)" -#: ../../library/turtle.rst:90 +#: ../../library/turtle.rst:92 msgid "" "You should see (most likely, in a new window on your display) a line drawn " "by the turtle, heading East. Change the direction of the turtle, so that it " "turns 120 degrees left (anti-clockwise)::" msgstr "" -#: ../../library/turtle.rst:94 +#: ../../library/turtle.rst:96 msgid "left(120)" msgstr "left(120)" -#: ../../library/turtle.rst:96 +#: ../../library/turtle.rst:98 msgid "Let's continue by drawing a triangle::" msgstr "" -#: ../../library/turtle.rst:98 +#: ../../library/turtle.rst:100 msgid "" "forward(100)\n" "left(120)\n" @@ -145,81 +153,81 @@ msgstr "" "left(120)\n" "forward(100)" -#: ../../library/turtle.rst:102 +#: ../../library/turtle.rst:104 msgid "" "Notice how the turtle, represented by an arrow, points in different " "directions as you steer it." msgstr "" -#: ../../library/turtle.rst:105 +#: ../../library/turtle.rst:107 msgid "" "Experiment with those commands, and also with ``backward()`` and ``right()``." msgstr "" -#: ../../library/turtle.rst:110 ../../library/turtle.rst:364 -#: ../../library/turtle.rst:1062 +#: ../../library/turtle.rst:112 ../../library/turtle.rst:366 +#: ../../library/turtle.rst:1064 msgid "Pen control" msgstr "" -#: ../../library/turtle.rst:112 +#: ../../library/turtle.rst:114 msgid "" "Try changing the color - for example, ``color('blue')`` - and width of the " "line - for example, ``width(3)`` - and then drawing again." msgstr "" -#: ../../library/turtle.rst:115 +#: ../../library/turtle.rst:117 msgid "" "You can also move the turtle around without drawing, by lifting up the pen: " "``up()`` before moving. To start drawing again, use ``down()``." msgstr "" -#: ../../library/turtle.rst:120 +#: ../../library/turtle.rst:122 msgid "The turtle's position" msgstr "" -#: ../../library/turtle.rst:122 +#: ../../library/turtle.rst:124 msgid "" "Send your turtle back to its starting-point (useful if it has disappeared " "off-screen)::" msgstr "" -#: ../../library/turtle.rst:125 +#: ../../library/turtle.rst:127 msgid "home()" msgstr "home()" -#: ../../library/turtle.rst:127 +#: ../../library/turtle.rst:129 msgid "" "The home position is at the center of the turtle's screen. If you ever need " "to know them, get the turtle's x-y coordinates with::" msgstr "" -#: ../../library/turtle.rst:130 +#: ../../library/turtle.rst:132 msgid "pos()" msgstr "pos()" -#: ../../library/turtle.rst:132 +#: ../../library/turtle.rst:134 msgid "Home is at ``(0, 0)``." msgstr "" -#: ../../library/turtle.rst:134 +#: ../../library/turtle.rst:136 msgid "" "And after a while, it will probably help to clear the window so we can start " "anew::" msgstr "" -#: ../../library/turtle.rst:137 +#: ../../library/turtle.rst:139 msgid "clearscreen()" msgstr "clearscreen()" -#: ../../library/turtle.rst:141 +#: ../../library/turtle.rst:143 msgid "Making algorithmic patterns" msgstr "" -#: ../../library/turtle.rst:143 +#: ../../library/turtle.rst:145 msgid "Using loops, it's possible to build up geometric patterns::" msgstr "" -#: ../../library/turtle.rst:145 +#: ../../library/turtle.rst:147 msgid "" "for steps in range(100):\n" " for c in ('blue', 'red', 'green'):\n" @@ -233,17 +241,17 @@ msgstr "" " forward(steps)\n" " right(30)" -#: ../../library/turtle.rst:152 +#: ../../library/turtle.rst:154 msgid "\\ - which of course, are limited only by the imagination!" msgstr "" -#: ../../library/turtle.rst:154 +#: ../../library/turtle.rst:156 msgid "" "Let's draw the star shape at the top of this page. We want red lines, filled " "in with yellow::" msgstr "" -#: ../../library/turtle.rst:157 +#: ../../library/turtle.rst:159 msgid "" "color('red')\n" "fillcolor('yellow')" @@ -251,21 +259,21 @@ msgstr "" "color('red')\n" "fillcolor('yellow')" -#: ../../library/turtle.rst:160 +#: ../../library/turtle.rst:162 msgid "" "Just as ``up()`` and ``down()`` determine whether lines will be drawn, " "filling can be turned on and off::" msgstr "" -#: ../../library/turtle.rst:163 +#: ../../library/turtle.rst:165 msgid "begin_fill()" msgstr "begin_fill()" -#: ../../library/turtle.rst:165 +#: ../../library/turtle.rst:167 msgid "Next we'll create a loop::" msgstr "" -#: ../../library/turtle.rst:167 +#: ../../library/turtle.rst:169 msgid "" "while True:\n" " forward(200)\n" @@ -279,39 +287,39 @@ msgstr "" " if abs(pos()) < 1:\n" " break" -#: ../../library/turtle.rst:173 +#: ../../library/turtle.rst:175 msgid "" "``abs(pos()) < 1`` is a good way to know when the turtle is back at its home " "position." msgstr "" -#: ../../library/turtle.rst:176 +#: ../../library/turtle.rst:178 msgid "Finally, complete the filling::" msgstr "" -#: ../../library/turtle.rst:178 +#: ../../library/turtle.rst:180 msgid "end_fill()" msgstr "end_fill()" -#: ../../library/turtle.rst:180 +#: ../../library/turtle.rst:182 msgid "" "(Note that filling only actually takes place when you give the " "``end_fill()`` command.)" msgstr "" -#: ../../library/turtle.rst:187 +#: ../../library/turtle.rst:189 msgid "How to..." msgstr "" -#: ../../library/turtle.rst:189 +#: ../../library/turtle.rst:191 msgid "This section covers some typical turtle use-cases and approaches." msgstr "" -#: ../../library/turtle.rst:193 +#: ../../library/turtle.rst:195 msgid "Get started as quickly as possible" msgstr "" -#: ../../library/turtle.rst:195 +#: ../../library/turtle.rst:197 msgid "" "One of the joys of turtle graphics is the immediate, visual feedback that's " "available from simple commands - it's an excellent way to introduce children " @@ -319,21 +327,21 @@ msgid "" "course)." msgstr "" -#: ../../library/turtle.rst:200 +#: ../../library/turtle.rst:202 msgid "" "The turtle module makes this possible by exposing all its basic " "functionality as functions, available with ``from turtle import *``. The :" "ref:`turtle graphics tutorial ` covers this approach." msgstr "" -#: ../../library/turtle.rst:204 +#: ../../library/turtle.rst:206 msgid "" "It's worth noting that many of the turtle commands also have even more terse " "equivalents, such as ``fd()`` for :func:`forward`. These are especially " "useful when working with learners for whom typing is not a skill." msgstr "" -#: ../../library/turtle.rst:210 +#: ../../library/turtle.rst:212 msgid "" "You'll need to have the :mod:`Tk interface package ` installed on " "your system for turtle graphics to work. Be warned that this is not always " @@ -341,18 +349,18 @@ msgid "" "graphics with a learner." msgstr "" -#: ../../library/turtle.rst:217 +#: ../../library/turtle.rst:219 msgid "Automatically begin and end filling" msgstr "" -#: ../../library/turtle.rst:219 +#: ../../library/turtle.rst:221 msgid "" "Starting with Python 3.14, you can use the :func:`fill` :term:`context " "manager` instead of :func:`begin_fill` and :func:`end_fill` to automatically " "begin and end fill. Here is an example::" msgstr "" -#: ../../library/turtle.rst:223 +#: ../../library/turtle.rst:225 msgid "" "with fill():\n" " for i in range(4):\n" @@ -362,11 +370,11 @@ msgid "" "forward(200)" msgstr "" -#: ../../library/turtle.rst:230 +#: ../../library/turtle.rst:232 msgid "The code above is equivalent to::" msgstr "" -#: ../../library/turtle.rst:232 +#: ../../library/turtle.rst:234 msgid "" "begin_fill()\n" "for i in range(4):\n" @@ -377,11 +385,11 @@ msgid "" "forward(200)" msgstr "" -#: ../../library/turtle.rst:242 +#: ../../library/turtle.rst:244 msgid "Use the ``turtle`` module namespace" msgstr "" -#: ../../library/turtle.rst:244 +#: ../../library/turtle.rst:246 msgid "" "Using ``from turtle import *`` is convenient - but be warned that it imports " "a rather large collection of objects, and if you're doing anything but " @@ -390,7 +398,7 @@ msgid "" "might be imported)." msgstr "" -#: ../../library/turtle.rst:250 +#: ../../library/turtle.rst:252 msgid "" "The solution is to use ``import turtle`` - ``fd()`` becomes ``turtle.fd()``, " "``width()`` becomes ``turtle.width()`` and so on. (If typing \"turtle\" over " @@ -398,17 +406,17 @@ msgid "" "instead.)" msgstr "" -#: ../../library/turtle.rst:257 +#: ../../library/turtle.rst:259 msgid "Use turtle graphics in a script" msgstr "" -#: ../../library/turtle.rst:259 +#: ../../library/turtle.rst:261 msgid "" "It's recommended to use the ``turtle`` module namespace as described " "immediately above, for example::" msgstr "" -#: ../../library/turtle.rst:262 +#: ../../library/turtle.rst:264 msgid "" "import turtle as t\n" "from random import random\n" @@ -428,33 +436,33 @@ msgstr "" " t.right(angle)\n" " t.fd(steps)" -#: ../../library/turtle.rst:271 +#: ../../library/turtle.rst:273 msgid "" "Another step is also required though - as soon as the script ends, Python " "will also close the turtle's window. Add::" msgstr "" -#: ../../library/turtle.rst:274 +#: ../../library/turtle.rst:276 msgid "t.mainloop()" msgstr "t.mainloop()" -#: ../../library/turtle.rst:276 +#: ../../library/turtle.rst:278 msgid "" "to the end of the script. The script will now wait to be dismissed and will " "not exit until it is terminated, for example by closing the turtle graphics " "window." msgstr "" -#: ../../library/turtle.rst:282 +#: ../../library/turtle.rst:284 msgid "Use object-oriented turtle graphics" msgstr "" -#: ../../library/turtle.rst:284 +#: ../../library/turtle.rst:286 msgid "" ":ref:`Explanation of the object-oriented interface `" msgstr "" -#: ../../library/turtle.rst:286 +#: ../../library/turtle.rst:288 msgid "" "Other than for very basic introductory purposes, or for trying things out as " "quickly as possible, it's more usual and much more powerful to use the " @@ -462,18 +470,18 @@ msgid "" "multiple turtles on screen at once." msgstr "" -#: ../../library/turtle.rst:291 +#: ../../library/turtle.rst:293 msgid "" "In this approach, the various turtle commands are methods of objects (mostly " "of ``Turtle`` objects). You *can* use the object-oriented approach in the " "shell, but it would be more typical in a Python script." msgstr "" -#: ../../library/turtle.rst:295 +#: ../../library/turtle.rst:297 msgid "The example above then becomes::" msgstr "" -#: ../../library/turtle.rst:297 +#: ../../library/turtle.rst:299 msgid "" "from turtle import Turtle\n" "from random import random\n" @@ -499,43 +507,43 @@ msgstr "" "\n" "t.screen.mainloop()" -#: ../../library/turtle.rst:309 +#: ../../library/turtle.rst:311 msgid "" "Note the last line. ``t.screen`` is an instance of the :class:`Screen` that " "a Turtle instance exists on; it's created automatically along with the " "turtle." msgstr "" -#: ../../library/turtle.rst:313 +#: ../../library/turtle.rst:315 msgid "The turtle's screen can be customised, for example::" msgstr "" -#: ../../library/turtle.rst:315 +#: ../../library/turtle.rst:317 msgid "" "t.screen.title('Object-oriented turtle demo')\n" "t.screen.bgcolor(\"orange\")" msgstr "" -#: ../../library/turtle.rst:320 +#: ../../library/turtle.rst:322 msgid "Turtle graphics reference" msgstr "" -#: ../../library/turtle.rst:324 +#: ../../library/turtle.rst:326 msgid "" "In the following documentation the argument list for functions is given. " "Methods, of course, have the additional first argument *self* which is " "omitted here." msgstr "" -#: ../../library/turtle.rst:330 +#: ../../library/turtle.rst:332 msgid "Turtle methods" msgstr "" -#: ../../library/turtle.rst:332 ../../library/turtle.rst:475 +#: ../../library/turtle.rst:334 ../../library/turtle.rst:477 msgid "Turtle motion" msgstr "" -#: ../../library/turtle.rst:333 +#: ../../library/turtle.rst:335 msgid "Move and draw" msgstr "" @@ -579,7 +587,7 @@ msgstr ":func:`setheading` | :func:`seth`" msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2862 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2864 msgid ":func:`circle`" msgstr ":func:`circle`" @@ -587,7 +595,7 @@ msgstr ":func:`circle`" msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2840 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2842 msgid ":func:`stamp`" msgstr ":func:`stamp`" @@ -607,7 +615,7 @@ msgstr ":func:`undo`" msgid ":func:`speed`" msgstr ":func:`speed`" -#: ../../library/turtle.rst:352 ../../library/turtle.rst:911 +#: ../../library/turtle.rst:354 ../../library/turtle.rst:913 msgid "Tell Turtle's state" msgstr "" @@ -635,7 +643,7 @@ msgstr ":func:`heading`" msgid ":func:`distance`" msgstr ":func:`distance`" -#: ../../library/turtle.rst:360 +#: ../../library/turtle.rst:362 msgid "Setting and measurement" msgstr "" @@ -647,7 +655,7 @@ msgstr ":func:`degrees`" msgid ":func:`radians`" msgstr ":func:`radians`" -#: ../../library/turtle.rst:365 ../../library/turtle.rst:1065 +#: ../../library/turtle.rst:367 ../../library/turtle.rst:1067 msgid "Drawing state" msgstr "" @@ -671,7 +679,7 @@ msgstr ":func:`pen`" msgid ":func:`isdown`" msgstr ":func:`isdown`" -#: ../../library/turtle.rst:372 ../../library/turtle.rst:1157 +#: ../../library/turtle.rst:374 ../../library/turtle.rst:1159 msgid "Color control" msgstr "" @@ -687,7 +695,7 @@ msgstr ":func:`pencolor`" msgid ":func:`fillcolor`" msgstr ":func:`fillcolor`" -#: ../../library/turtle.rst:377 ../../library/turtle.rst:1296 +#: ../../library/turtle.rst:379 ../../library/turtle.rst:1298 msgid "Filling" msgstr "" @@ -707,7 +715,7 @@ msgstr ":func:`begin_fill`" msgid ":func:`end_fill`" msgstr ":func:`end_fill`" -#: ../../library/turtle.rst:383 ../../library/turtle.rst:1366 +#: ../../library/turtle.rst:385 ../../library/turtle.rst:1368 msgid "More drawing control" msgstr "" @@ -723,11 +731,11 @@ msgstr ":func:`clear`" msgid ":func:`write`" msgstr ":func:`write`" -#: ../../library/turtle.rst:388 ../../library/turtle.rst:1412 +#: ../../library/turtle.rst:390 ../../library/turtle.rst:1414 msgid "Turtle state" msgstr "" -#: ../../library/turtle.rst:389 ../../library/turtle.rst:1415 +#: ../../library/turtle.rst:391 ../../library/turtle.rst:1417 msgid "Visibility" msgstr "" @@ -743,7 +751,7 @@ msgstr ":func:`hideturtle` | :func:`ht`" msgid ":func:`isvisible`" msgstr ":func:`isvisible`" -#: ../../library/turtle.rst:394 ../../library/turtle.rst:1454 +#: ../../library/turtle.rst:396 ../../library/turtle.rst:1456 msgid "Appearance" msgstr "" @@ -779,11 +787,11 @@ msgstr ":func:`shapetransform`" msgid ":func:`get_shapepoly`" msgstr ":func:`get_shapepoly`" -#: ../../library/turtle.rst:404 ../../library/turtle.rst:1637 +#: ../../library/turtle.rst:406 ../../library/turtle.rst:1639 msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2834 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2836 msgid ":func:`onclick`" msgstr ":func:`onclick`" @@ -791,11 +799,11 @@ msgstr ":func:`onclick`" msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2817 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2819 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" -#: ../../library/turtle.rst:409 ../../library/turtle.rst:1711 +#: ../../library/turtle.rst:411 ../../library/turtle.rst:1713 msgid "Special Turtle methods" msgstr "" @@ -815,7 +823,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2856 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2858 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -835,11 +843,11 @@ msgstr ":func:`setundobuffer`" msgid ":func:`undobufferentries`" msgstr ":func:`undobufferentries`" -#: ../../library/turtle.rst:422 +#: ../../library/turtle.rst:424 msgid "Methods of TurtleScreen/Screen" msgstr "" -#: ../../library/turtle.rst:424 ../../library/turtle.rst:1882 +#: ../../library/turtle.rst:426 ../../library/turtle.rst:1884 msgid "Window control" msgstr "" @@ -867,7 +875,7 @@ msgstr ":func:`screensize`" msgid ":func:`setworldcoordinates`" msgstr ":func:`setworldcoordinates`" -#: ../../library/turtle.rst:432 ../../library/turtle.rst:2025 +#: ../../library/turtle.rst:434 ../../library/turtle.rst:2027 msgid "Animation control" msgstr "" @@ -887,7 +895,7 @@ msgstr ":func:`tracer`" msgid ":func:`update`" msgstr ":func:`update`" -#: ../../library/turtle.rst:438 ../../library/turtle.rst:2095 +#: ../../library/turtle.rst:440 ../../library/turtle.rst:2097 msgid "Using screen events" msgstr "" @@ -915,7 +923,7 @@ msgstr ":func:`ontimer`" msgid ":func:`mainloop` | :func:`done`" msgstr ":func:`mainloop` | :func:`done`" -#: ../../library/turtle.rst:446 ../../library/turtle.rst:2240 +#: ../../library/turtle.rst:448 ../../library/turtle.rst:2242 msgid "Settings and special methods" msgstr "" @@ -951,7 +959,7 @@ msgstr ":func:`window_height`" msgid ":func:`window_width`" msgstr ":func:`window_width`" -#: ../../library/turtle.rst:456 ../../library/turtle.rst:2204 +#: ../../library/turtle.rst:458 ../../library/turtle.rst:2206 msgid "Input methods" msgstr "" @@ -963,7 +971,7 @@ msgstr ":func:`textinput`" msgid ":func:`numinput`" msgstr ":func:`numinput`" -#: ../../library/turtle.rst:460 +#: ../../library/turtle.rst:462 msgid "Methods specific to Screen" msgstr "" @@ -987,11 +995,11 @@ msgstr ":func:`setup`" msgid ":func:`title`" msgstr ":func:`title`" -#: ../../library/turtle.rst:469 +#: ../../library/turtle.rst:471 msgid "Methods of RawTurtle/Turtle and corresponding functions" msgstr "" -#: ../../library/turtle.rst:471 +#: ../../library/turtle.rst:473 msgid "" "Most of the examples in this section refer to a Turtle instance called " "``turtle``." @@ -1001,19 +1009,19 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/turtle.rst:480 ../../library/turtle.rst:525 -#: ../../library/turtle.rst:550 ../../library/turtle.rst:648 -#: ../../library/turtle.rst:671 ../../library/turtle.rst:694 +#: ../../library/turtle.rst:482 ../../library/turtle.rst:527 +#: ../../library/turtle.rst:552 ../../library/turtle.rst:650 +#: ../../library/turtle.rst:673 ../../library/turtle.rst:696 msgid "a number (integer or float)" msgstr "" -#: ../../library/turtle.rst:482 +#: ../../library/turtle.rst:484 msgid "" "Move the turtle forward by the specified *distance*, in the direction the " "turtle is headed." msgstr "" -#: ../../library/turtle.rst:485 +#: ../../library/turtle.rst:487 msgid "" ">>> turtle.position()\n" "(0.00,0.00)\n" @@ -1033,18 +1041,18 @@ msgstr "" ">>> turtle.position()\n" "(-50.00,0.00)" -#: ../../library/turtle.rst:502 ../../library/turtle.rst:744 -#: ../../library/turtle.rst:1015 ../../library/turtle.rst:1553 +#: ../../library/turtle.rst:504 ../../library/turtle.rst:746 +#: ../../library/turtle.rst:1017 ../../library/turtle.rst:1555 msgid "a number" msgstr "" -#: ../../library/turtle.rst:504 +#: ../../library/turtle.rst:506 msgid "" "Move the turtle backward by *distance*, opposite to the direction the turtle " "is headed. Do not change the turtle's heading." msgstr "" -#: ../../library/turtle.rst:512 +#: ../../library/turtle.rst:514 msgid "" ">>> turtle.position()\n" "(0.00,0.00)\n" @@ -1058,14 +1066,14 @@ msgstr "" ">>> turtle.position()\n" "(-30.00,0.00)" -#: ../../library/turtle.rst:527 +#: ../../library/turtle.rst:529 msgid "" "Turn turtle right by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:537 +#: ../../library/turtle.rst:539 msgid "" ">>> turtle.heading()\n" "22.0\n" @@ -1079,14 +1087,14 @@ msgstr "" ">>> turtle.heading()\n" "337.0" -#: ../../library/turtle.rst:552 +#: ../../library/turtle.rst:554 msgid "" "Turn turtle left by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:562 +#: ../../library/turtle.rst:564 msgid "" ">>> turtle.heading()\n" "22.0\n" @@ -1100,28 +1108,28 @@ msgstr "" ">>> turtle.heading()\n" "67.0" -#: ../../library/turtle.rst:576 +#: ../../library/turtle.rst:578 msgid "a number or a pair/vector of numbers" msgstr "" -#: ../../library/turtle.rst:577 ../../library/turtle.rst:610 -#: ../../library/turtle.rst:611 +#: ../../library/turtle.rst:579 ../../library/turtle.rst:612 +#: ../../library/turtle.rst:613 msgid "a number or ``None``" msgstr "" -#: ../../library/turtle.rst:579 +#: ../../library/turtle.rst:581 msgid "" "If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` (e." "g. as returned by :func:`pos`)." msgstr "" -#: ../../library/turtle.rst:582 +#: ../../library/turtle.rst:584 msgid "" "Move turtle to an absolute position. If the pen is down, draw line. Do not " "change the turtle's orientation." msgstr "" -#: ../../library/turtle.rst:591 +#: ../../library/turtle.rst:593 msgid "" ">>> tp = turtle.pos()\n" ">>> tp\n" @@ -1149,11 +1157,11 @@ msgstr "" ">>> turtle.pos()\n" "(0.00,0.00)" -#: ../../library/turtle.rst:612 +#: ../../library/turtle.rst:614 msgid "a boolean" msgstr "" -#: ../../library/turtle.rst:614 +#: ../../library/turtle.rst:616 msgid "" "Move turtle to an absolute position. Unlike goto(x, y), a line will not be " "drawn. The turtle's orientation does not change. If currently filling, the " @@ -1163,7 +1171,7 @@ msgid "" "barrier like in goto(x, y)." msgstr "" -#: ../../library/turtle.rst:627 +#: ../../library/turtle.rst:629 msgid "" ">>> tp = turtle.pos()\n" ">>> tp\n" @@ -1191,12 +1199,12 @@ msgstr "" ">>> turtle.pos()\n" "(20.00,30.00)" -#: ../../library/turtle.rst:650 +#: ../../library/turtle.rst:652 msgid "" "Set the turtle's first coordinate to *x*, leave second coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:659 +#: ../../library/turtle.rst:661 msgid "" ">>> turtle.position()\n" "(0.00,240.00)\n" @@ -1210,12 +1218,12 @@ msgstr "" ">>> turtle.position()\n" "(10.00,240.00)" -#: ../../library/turtle.rst:673 +#: ../../library/turtle.rst:675 msgid "" "Set the turtle's second coordinate to *y*, leave first coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:681 +#: ../../library/turtle.rst:683 msgid "" ">>> turtle.position()\n" "(0.00,40.00)\n" @@ -1229,53 +1237,53 @@ msgstr "" ">>> turtle.position()\n" "(0.00,-10.00)" -#: ../../library/turtle.rst:696 +#: ../../library/turtle.rst:698 msgid "" "Set the orientation of the turtle to *to_angle*. Here are some common " "directions in degrees:" msgstr "" -#: ../../library/turtle.rst:700 +#: ../../library/turtle.rst:702 msgid "standard mode" msgstr "" -#: ../../library/turtle.rst:700 +#: ../../library/turtle.rst:702 msgid "logo mode" msgstr "" -#: ../../library/turtle.rst:702 +#: ../../library/turtle.rst:704 msgid "0 - east" msgstr "" -#: ../../library/turtle.rst:702 +#: ../../library/turtle.rst:704 msgid "0 - north" msgstr "" -#: ../../library/turtle.rst:703 +#: ../../library/turtle.rst:705 msgid "90 - north" msgstr "" -#: ../../library/turtle.rst:703 +#: ../../library/turtle.rst:705 msgid "90 - east" msgstr "" -#: ../../library/turtle.rst:704 +#: ../../library/turtle.rst:706 msgid "180 - west" msgstr "" -#: ../../library/turtle.rst:704 +#: ../../library/turtle.rst:706 msgid "180 - south" msgstr "" -#: ../../library/turtle.rst:705 +#: ../../library/turtle.rst:707 msgid "270 - south" msgstr "" -#: ../../library/turtle.rst:705 +#: ../../library/turtle.rst:707 msgid "270 - west" msgstr "" -#: ../../library/turtle.rst:708 +#: ../../library/turtle.rst:710 msgid "" ">>> turtle.setheading(90)\n" ">>> turtle.heading()\n" @@ -1285,13 +1293,13 @@ msgstr "" ">>> turtle.heading()\n" "90.0" -#: ../../library/turtle.rst:718 +#: ../../library/turtle.rst:720 msgid "" "Move turtle to the origin -- coordinates (0,0) -- and set its heading to its " "start-orientation (which depends on the mode, see :func:`mode`)." msgstr "" -#: ../../library/turtle.rst:728 +#: ../../library/turtle.rst:730 msgid "" ">>> turtle.heading()\n" "90.0\n" @@ -1313,15 +1321,15 @@ msgstr "" ">>> turtle.heading()\n" "0.0" -#: ../../library/turtle.rst:745 +#: ../../library/turtle.rst:747 msgid "a number (or ``None``)" msgstr "" -#: ../../library/turtle.rst:746 ../../library/turtle.rst:843 +#: ../../library/turtle.rst:748 ../../library/turtle.rst:845 msgid "an integer (or ``None``)" msgstr "" -#: ../../library/turtle.rst:748 +#: ../../library/turtle.rst:750 msgid "" "Draw a circle with given *radius*. The center is *radius* units left of the " "turtle; *extent* -- an angle -- determines which part of the circle is " @@ -1332,14 +1340,14 @@ msgid "" "changed by the amount of *extent*." msgstr "" -#: ../../library/turtle.rst:756 +#: ../../library/turtle.rst:758 msgid "" "As the circle is approximated by an inscribed regular polygon, *steps* " "determines the number of steps to use. If not given, it will be calculated " "automatically. May be used to draw regular polygons." msgstr "" -#: ../../library/turtle.rst:760 +#: ../../library/turtle.rst:762 msgid "" ">>> turtle.home()\n" ">>> turtle.position()\n" @@ -1358,21 +1366,21 @@ msgid "" "180.0" msgstr "" -#: ../../library/turtle.rst:786 +#: ../../library/turtle.rst:788 msgid "an integer >= 1 (if given)" msgstr "" -#: ../../library/turtle.rst:787 +#: ../../library/turtle.rst:789 msgid "a colorstring or a numeric color tuple" msgstr "" -#: ../../library/turtle.rst:789 +#: ../../library/turtle.rst:791 msgid "" "Draw a circular dot with diameter *size*, using *color*. If *size* is not " "given, the maximum of ``pensize+4`` and ``2*pensize`` is used." msgstr "" -#: ../../library/turtle.rst:793 +#: ../../library/turtle.rst:795 msgid "" ">>> turtle.home()\n" ">>> turtle.dot()\n" @@ -1390,14 +1398,14 @@ msgstr "" ">>> turtle.heading()\n" "0.0" -#: ../../library/turtle.rst:807 +#: ../../library/turtle.rst:809 msgid "" "Stamp a copy of the turtle shape onto the canvas at the current turtle " "position. Return a stamp_id for that stamp, which can be used to delete it " "by calling ``clearstamp(stamp_id)``." msgstr "" -#: ../../library/turtle.rst:811 +#: ../../library/turtle.rst:813 msgid "" ">>> turtle.color(\"blue\")\n" ">>> stamp_id = turtle.stamp()\n" @@ -1407,15 +1415,15 @@ msgstr "" ">>> stamp_id = turtle.stamp()\n" ">>> turtle.fd(50)" -#: ../../library/turtle.rst:821 +#: ../../library/turtle.rst:823 msgid "an integer, must be return value of previous :func:`stamp` call" msgstr "" -#: ../../library/turtle.rst:824 +#: ../../library/turtle.rst:826 msgid "Delete stamp with given *stampid*." msgstr "" -#: ../../library/turtle.rst:826 +#: ../../library/turtle.rst:828 msgid "" ">>> turtle.position()\n" "(150.00,-0.00)\n" @@ -1439,14 +1447,14 @@ msgstr "" ">>> turtle.position()\n" "(200.00,-0.00)" -#: ../../library/turtle.rst:845 +#: ../../library/turtle.rst:847 msgid "" "Delete all or first/last *n* of turtle's stamps. If *n* is ``None``, delete " "all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last " "*n* stamps." msgstr "" -#: ../../library/turtle.rst:849 +#: ../../library/turtle.rst:851 msgid "" ">>> for i in range(8):\n" "... unused_stamp_id = turtle.stamp()\n" @@ -1462,13 +1470,13 @@ msgstr "" ">>> turtle.clearstamps(-2)\n" ">>> turtle.clearstamps()" -#: ../../library/turtle.rst:861 +#: ../../library/turtle.rst:863 msgid "" "Undo (repeatedly) the last turtle action(s). Number of available undo " "actions is determined by the size of the undobuffer." msgstr "" -#: ../../library/turtle.rst:864 +#: ../../library/turtle.rst:866 msgid "" ">>> for i in range(4):\n" "... turtle.fd(50); turtle.lt(80)\n" @@ -1482,55 +1490,55 @@ msgstr "" ">>> for i in range(8):\n" "... turtle.undo()" -#: ../../library/turtle.rst:876 +#: ../../library/turtle.rst:878 msgid "an integer in the range 0..10 or a speedstring (see below)" msgstr "" -#: ../../library/turtle.rst:878 +#: ../../library/turtle.rst:880 msgid "" "Set the turtle's speed to an integer value in the range 0..10. If no " "argument is given, return current speed." msgstr "" -#: ../../library/turtle.rst:881 +#: ../../library/turtle.rst:883 msgid "" "If input is a number greater than 10 or smaller than 0.5, speed is set to " "0. Speedstrings are mapped to speedvalues as follows:" msgstr "" -#: ../../library/turtle.rst:884 +#: ../../library/turtle.rst:886 msgid "\"fastest\": 0" msgstr "" -#: ../../library/turtle.rst:885 +#: ../../library/turtle.rst:887 msgid "\"fast\": 10" msgstr "" -#: ../../library/turtle.rst:886 +#: ../../library/turtle.rst:888 msgid "\"normal\": 6" msgstr "" -#: ../../library/turtle.rst:887 +#: ../../library/turtle.rst:889 msgid "\"slow\": 3" msgstr "" -#: ../../library/turtle.rst:888 +#: ../../library/turtle.rst:890 msgid "\"slowest\": 1" msgstr "" -#: ../../library/turtle.rst:890 +#: ../../library/turtle.rst:892 msgid "" "Speeds from 1 to 10 enforce increasingly faster animation of line drawing " "and turtle turning." msgstr "" -#: ../../library/turtle.rst:893 +#: ../../library/turtle.rst:895 msgid "" "Attention: *speed* = 0 means that *no* animation takes place. forward/back " "makes turtle jump and likewise left/right make the turtle turn instantly." msgstr "" -#: ../../library/turtle.rst:897 +#: ../../library/turtle.rst:899 msgid "" ">>> turtle.speed()\n" "3\n" @@ -1550,12 +1558,12 @@ msgstr "" ">>> turtle.speed()\n" "9" -#: ../../library/turtle.rst:916 +#: ../../library/turtle.rst:918 msgid "" "Return the turtle's current location (x,y) (as a :class:`Vec2D` vector)." msgstr "" -#: ../../library/turtle.rst:918 +#: ../../library/turtle.rst:920 msgid "" ">>> turtle.pos()\n" "(440.00,-0.00)" @@ -1563,15 +1571,15 @@ msgstr "" ">>> turtle.pos()\n" "(440.00,-0.00)" -#: ../../library/turtle.rst:927 ../../library/turtle.rst:990 +#: ../../library/turtle.rst:929 ../../library/turtle.rst:992 msgid "a number or a pair/vector of numbers or a turtle instance" msgstr "" -#: ../../library/turtle.rst:928 ../../library/turtle.rst:991 +#: ../../library/turtle.rst:930 ../../library/turtle.rst:993 msgid "a number if *x* is a number, else ``None``" msgstr "" -#: ../../library/turtle.rst:930 +#: ../../library/turtle.rst:932 msgid "" "Return the angle between the line from turtle position to position specified " "by (x,y), the vector or the other turtle. This depends on the turtle's " @@ -1579,7 +1587,7 @@ msgid "" "\"logo\"." msgstr "" -#: ../../library/turtle.rst:934 +#: ../../library/turtle.rst:936 msgid "" ">>> turtle.goto(10, 10)\n" ">>> turtle.towards(0,0)\n" @@ -1589,11 +1597,11 @@ msgstr "" ">>> turtle.towards(0,0)\n" "225.0" -#: ../../library/turtle.rst:944 +#: ../../library/turtle.rst:946 msgid "Return the turtle's x coordinate." msgstr "" -#: ../../library/turtle.rst:946 +#: ../../library/turtle.rst:948 msgid "" ">>> turtle.home()\n" ">>> turtle.left(50)\n" @@ -1611,11 +1619,11 @@ msgstr "" ">>> print(round(turtle.xcor(), 5))\n" "64.27876" -#: ../../library/turtle.rst:960 +#: ../../library/turtle.rst:962 msgid "Return the turtle's y coordinate." msgstr "" -#: ../../library/turtle.rst:962 +#: ../../library/turtle.rst:964 msgid "" ">>> turtle.home()\n" ">>> turtle.left(60)\n" @@ -1633,13 +1641,13 @@ msgstr "" ">>> print(round(turtle.ycor(), 5))\n" "86.60254" -#: ../../library/turtle.rst:976 +#: ../../library/turtle.rst:978 msgid "" "Return the turtle's current heading (value depends on the turtle mode, see :" "func:`mode`)." msgstr "" -#: ../../library/turtle.rst:979 +#: ../../library/turtle.rst:981 msgid "" ">>> turtle.home()\n" ">>> turtle.left(67)\n" @@ -1651,13 +1659,13 @@ msgstr "" ">>> turtle.heading()\n" "67.0" -#: ../../library/turtle.rst:993 +#: ../../library/turtle.rst:995 msgid "" "Return the distance from the turtle to (x,y), the given vector, or the given " "other turtle, in turtle step units." msgstr "" -#: ../../library/turtle.rst:996 +#: ../../library/turtle.rst:998 msgid "" ">>> turtle.home()\n" ">>> turtle.distance(30,40)\n" @@ -1679,17 +1687,17 @@ msgstr "" ">>> turtle.distance(joe)\n" "77.0" -#: ../../library/turtle.rst:1011 +#: ../../library/turtle.rst:1013 msgid "Settings for measurement" msgstr "" -#: ../../library/turtle.rst:1017 +#: ../../library/turtle.rst:1019 msgid "" "Set angle measurement units, i.e. set number of \"degrees\" for a full " "circle. Default value is 360 degrees." msgstr "" -#: ../../library/turtle.rst:1020 +#: ../../library/turtle.rst:1022 msgid "" ">>> turtle.home()\n" ">>> turtle.left(90)\n" @@ -1706,13 +1714,13 @@ msgid "" "90.0" msgstr "" -#: ../../library/turtle.rst:1040 +#: ../../library/turtle.rst:1042 msgid "" "Set the angle measurement units to radians. Equivalent to ``degrees(2*math." "pi)``." msgstr "" -#: ../../library/turtle.rst:1043 +#: ../../library/turtle.rst:1045 msgid "" ">>> turtle.home()\n" ">>> turtle.left(90)\n" @@ -1730,87 +1738,87 @@ msgstr "" ">>> turtle.heading()\n" "1.5707963267948966" -#: ../../library/turtle.rst:1071 +#: ../../library/turtle.rst:1073 msgid "Pull the pen down -- drawing when moving." msgstr "" -#: ../../library/turtle.rst:1078 +#: ../../library/turtle.rst:1080 msgid "Pull the pen up -- no drawing when moving." msgstr "" -#: ../../library/turtle.rst:1084 +#: ../../library/turtle.rst:1086 msgid "a positive number" msgstr "" -#: ../../library/turtle.rst:1086 +#: ../../library/turtle.rst:1088 msgid "" "Set the line thickness to *width* or return it. If resizemode is set to " "\"auto\" and turtleshape is a polygon, that polygon is drawn with the same " "line thickness. If no argument is given, the current pensize is returned." msgstr "" -#: ../../library/turtle.rst:1090 +#: ../../library/turtle.rst:1092 msgid "" ">>> turtle.pensize()\n" "1\n" ">>> turtle.pensize(10) # from here on lines of width 10 are drawn" msgstr "" -#: ../../library/turtle.rst:1100 +#: ../../library/turtle.rst:1102 msgid "a dictionary with some or all of the below listed keys" msgstr "" -#: ../../library/turtle.rst:1101 +#: ../../library/turtle.rst:1103 msgid "one or more keyword-arguments with the below listed keys as keywords" msgstr "" -#: ../../library/turtle.rst:1103 +#: ../../library/turtle.rst:1105 msgid "" "Return or set the pen's attributes in a \"pen-dictionary\" with the " "following key/value pairs:" msgstr "" -#: ../../library/turtle.rst:1106 +#: ../../library/turtle.rst:1108 msgid "\"shown\": True/False" msgstr "" -#: ../../library/turtle.rst:1107 +#: ../../library/turtle.rst:1109 msgid "\"pendown\": True/False" msgstr "" -#: ../../library/turtle.rst:1108 +#: ../../library/turtle.rst:1110 msgid "\"pencolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:1109 +#: ../../library/turtle.rst:1111 msgid "\"fillcolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:1110 +#: ../../library/turtle.rst:1112 msgid "\"pensize\": positive number" msgstr "" -#: ../../library/turtle.rst:1111 +#: ../../library/turtle.rst:1113 msgid "\"speed\": number in range 0..10" msgstr "" -#: ../../library/turtle.rst:1112 +#: ../../library/turtle.rst:1114 msgid "\"resizemode\": \"auto\" or \"user\" or \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1113 +#: ../../library/turtle.rst:1115 msgid "\"stretchfactor\": (positive number, positive number)" msgstr "" -#: ../../library/turtle.rst:1114 +#: ../../library/turtle.rst:1116 msgid "\"outline\": positive number" msgstr "" -#: ../../library/turtle.rst:1115 +#: ../../library/turtle.rst:1117 msgid "\"tilt\": number" msgstr "" -#: ../../library/turtle.rst:1117 +#: ../../library/turtle.rst:1119 msgid "" "This dictionary can be used as argument for a subsequent call to :func:`pen` " "to restore the former pen-state. Moreover one or more of these attributes " @@ -1818,7 +1826,7 @@ msgid "" "attributes in one statement." msgstr "" -#: ../../library/turtle.rst:1122 +#: ../../library/turtle.rst:1124 msgid "" ">>> turtle.pen(fillcolor=\"black\", pencolor=\"red\", pensize=10)\n" ">>> sorted(turtle.pen().items())\n" @@ -1850,11 +1858,11 @@ msgstr "" ">>> sorted(turtle.pen().items())[:3]\n" "[('fillcolor', 'green'), ('outline', 1), ('pencolor', 'red')]" -#: ../../library/turtle.rst:1143 +#: ../../library/turtle.rst:1145 msgid "Return ``True`` if pen is down, ``False`` if it's up." msgstr "" -#: ../../library/turtle.rst:1145 +#: ../../library/turtle.rst:1147 msgid "" ">>> turtle.penup()\n" ">>> turtle.isdown()\n" @@ -1870,64 +1878,64 @@ msgstr "" ">>> turtle.isdown()\n" "True" -#: ../../library/turtle.rst:1163 +#: ../../library/turtle.rst:1165 msgid "Return or set the pencolor." msgstr "" -#: ../../library/turtle.rst:1165 ../../library/turtle.rst:1216 -#: ../../library/turtle.rst:1890 +#: ../../library/turtle.rst:1167 ../../library/turtle.rst:1218 +#: ../../library/turtle.rst:1892 msgid "Four input formats are allowed:" msgstr "" -#: ../../library/turtle.rst:1167 +#: ../../library/turtle.rst:1169 msgid "``pencolor()``" msgstr "``pencolor()``" -#: ../../library/turtle.rst:1168 +#: ../../library/turtle.rst:1170 msgid "" "Return the current pencolor as color specification string or as a tuple (see " "example). May be used as input to another color/pencolor/fillcolor/bgcolor " "call." msgstr "" -#: ../../library/turtle.rst:1172 +#: ../../library/turtle.rst:1174 msgid "``pencolor(colorstring)``" msgstr "``pencolor(colorstring)``" -#: ../../library/turtle.rst:1173 +#: ../../library/turtle.rst:1175 msgid "" "Set pencolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:1176 +#: ../../library/turtle.rst:1178 msgid "``pencolor((r, g, b))``" msgstr "``pencolor((r, g, b))``" -#: ../../library/turtle.rst:1177 +#: ../../library/turtle.rst:1179 msgid "" "Set pencolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:1181 +#: ../../library/turtle.rst:1183 msgid "``pencolor(r, g, b)``" msgstr "``pencolor(r, g, b)``" -#: ../../library/turtle.rst:1182 +#: ../../library/turtle.rst:1184 msgid "" "Set pencolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:1185 +#: ../../library/turtle.rst:1187 msgid "" "If turtleshape is a polygon, the outline of that polygon is drawn with the " "newly set pencolor." msgstr "" -#: ../../library/turtle.rst:1188 +#: ../../library/turtle.rst:1190 msgid "" ">>> colormode()\n" "1.0\n" @@ -1965,59 +1973,59 @@ msgstr "" ">>> turtle.pencolor()\n" "(50.0, 193.0, 143.0)" -#: ../../library/turtle.rst:1214 +#: ../../library/turtle.rst:1216 msgid "Return or set the fillcolor." msgstr "" -#: ../../library/turtle.rst:1218 +#: ../../library/turtle.rst:1220 msgid "``fillcolor()``" msgstr "``fillcolor()``" -#: ../../library/turtle.rst:1219 +#: ../../library/turtle.rst:1221 msgid "" "Return the current fillcolor as color specification string, possibly in " "tuple format (see example). May be used as input to another color/pencolor/" "fillcolor/bgcolor call." msgstr "" -#: ../../library/turtle.rst:1223 +#: ../../library/turtle.rst:1225 msgid "``fillcolor(colorstring)``" msgstr "``fillcolor(colorstring)``" -#: ../../library/turtle.rst:1224 +#: ../../library/turtle.rst:1226 msgid "" "Set fillcolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:1227 +#: ../../library/turtle.rst:1229 msgid "``fillcolor((r, g, b))``" msgstr "``fillcolor((r, g, b))``" -#: ../../library/turtle.rst:1228 +#: ../../library/turtle.rst:1230 msgid "" "Set fillcolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:1232 +#: ../../library/turtle.rst:1234 msgid "``fillcolor(r, g, b)``" msgstr "``fillcolor(r, g, b)``" -#: ../../library/turtle.rst:1233 +#: ../../library/turtle.rst:1235 msgid "" "Set fillcolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:1236 +#: ../../library/turtle.rst:1238 msgid "" "If turtleshape is a polygon, the interior of that polygon is drawn with the " "newly set fillcolor." msgstr "" -#: ../../library/turtle.rst:1239 +#: ../../library/turtle.rst:1241 msgid "" ">>> turtle.fillcolor(\"violet\")\n" ">>> turtle.fillcolor()\n" @@ -2043,55 +2051,55 @@ msgstr "" ">>> turtle.fillcolor()\n" "(255.0, 255.0, 255.0)" -#: ../../library/turtle.rst:1260 +#: ../../library/turtle.rst:1262 msgid "Return or set pencolor and fillcolor." msgstr "" -#: ../../library/turtle.rst:1262 +#: ../../library/turtle.rst:1264 msgid "" "Several input formats are allowed. They use 0 to 3 arguments as follows:" msgstr "" -#: ../../library/turtle.rst:1265 +#: ../../library/turtle.rst:1267 msgid "``color()``" msgstr "``color()``" -#: ../../library/turtle.rst:1266 +#: ../../library/turtle.rst:1268 msgid "" "Return the current pencolor and the current fillcolor as a pair of color " "specification strings or tuples as returned by :func:`pencolor` and :func:" "`fillcolor`." msgstr "" -#: ../../library/turtle.rst:1270 +#: ../../library/turtle.rst:1272 msgid "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" msgstr "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" -#: ../../library/turtle.rst:1271 +#: ../../library/turtle.rst:1273 msgid "" "Inputs as in :func:`pencolor`, set both, fillcolor and pencolor, to the " "given value." msgstr "" -#: ../../library/turtle.rst:1274 +#: ../../library/turtle.rst:1276 msgid "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" msgstr "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" -#: ../../library/turtle.rst:1275 +#: ../../library/turtle.rst:1277 msgid "" "Equivalent to ``pencolor(colorstring1)`` and ``fillcolor(colorstring2)`` and " "analogously if the other input format is used." msgstr "" -#: ../../library/turtle.rst:1278 +#: ../../library/turtle.rst:1280 msgid "" "If turtleshape is a polygon, outline and interior of that polygon is drawn " "with the newly set colors." msgstr "" -#: ../../library/turtle.rst:1281 +#: ../../library/turtle.rst:1283 msgid "" ">>> turtle.color(\"red\", \"green\")\n" ">>> turtle.color()\n" @@ -2107,15 +2115,15 @@ msgstr "" ">>> color()\n" "((40.0, 80.0, 120.0), (160.0, 200.0, 240.0))" -#: ../../library/turtle.rst:1292 +#: ../../library/turtle.rst:1294 msgid "See also: Screen method :func:`colormode`." msgstr "" -#: ../../library/turtle.rst:1306 +#: ../../library/turtle.rst:1308 msgid "Return fillstate (``True`` if filling, ``False`` else)." msgstr "" -#: ../../library/turtle.rst:1308 +#: ../../library/turtle.rst:1310 msgid "" ">>> turtle.begin_fill()\n" ">>> if turtle.filling():\n" @@ -2129,11 +2137,11 @@ msgstr "" "... else:\n" "... turtle.pensize(3)" -#: ../../library/turtle.rst:1319 +#: ../../library/turtle.rst:1321 msgid "Fill the shape drawn in the ``with turtle.fill():`` block." msgstr "" -#: ../../library/turtle.rst:1321 +#: ../../library/turtle.rst:1323 msgid "" ">>> turtle.color(\"black\", \"red\")\n" ">>> with turtle.fill():\n" @@ -2143,13 +2151,13 @@ msgstr "" ">>> with turtle.fill():\n" "... turtle.circle(80)" -#: ../../library/turtle.rst:1328 +#: ../../library/turtle.rst:1330 msgid "" "Using :func:`!fill` is equivalent to adding the :func:`begin_fill` before " "the fill-block and :func:`end_fill` after the fill-block:" msgstr "" -#: ../../library/turtle.rst:1331 ../../library/turtle.rst:1356 +#: ../../library/turtle.rst:1333 ../../library/turtle.rst:1358 msgid "" ">>> turtle.color(\"black\", \"red\")\n" ">>> turtle.begin_fill()\n" @@ -2161,15 +2169,15 @@ msgstr "" ">>> turtle.circle(80)\n" ">>> turtle.end_fill()" -#: ../../library/turtle.rst:1344 +#: ../../library/turtle.rst:1346 msgid "To be called just before drawing a shape to be filled." msgstr "" -#: ../../library/turtle.rst:1349 +#: ../../library/turtle.rst:1351 msgid "Fill the shape drawn after the last call to :func:`begin_fill`." msgstr "" -#: ../../library/turtle.rst:1351 +#: ../../library/turtle.rst:1353 msgid "" "Whether or not overlap regions for self-intersecting polygons or multiple " "shapes are filled depends on the operating system graphics, type of overlap, " @@ -2177,13 +2185,13 @@ msgid "" "all yellow or have some white regions." msgstr "" -#: ../../library/turtle.rst:1370 +#: ../../library/turtle.rst:1372 msgid "" "Delete the turtle's drawings from the screen, re-center the turtle and set " "variables to the default values." msgstr "" -#: ../../library/turtle.rst:1373 +#: ../../library/turtle.rst:1375 msgid "" ">>> turtle.goto(0,-22)\n" ">>> turtle.left(100)\n" @@ -2209,30 +2217,30 @@ msgstr "" ">>> turtle.heading()\n" "0.0" -#: ../../library/turtle.rst:1391 +#: ../../library/turtle.rst:1393 msgid "" "Delete the turtle's drawings from the screen. Do not move turtle. State " "and position of the turtle as well as drawings of other turtles are not " "affected." msgstr "" -#: ../../library/turtle.rst:1397 +#: ../../library/turtle.rst:1399 msgid "object to be written to the TurtleScreen" msgstr "" -#: ../../library/turtle.rst:1398 +#: ../../library/turtle.rst:1400 msgid "True/False" msgstr "True/False" -#: ../../library/turtle.rst:1399 +#: ../../library/turtle.rst:1401 msgid "one of the strings \"left\", \"center\" or right\"" msgstr "" -#: ../../library/turtle.rst:1400 +#: ../../library/turtle.rst:1402 msgid "a triple (fontname, fontsize, fonttype)" msgstr "" -#: ../../library/turtle.rst:1402 +#: ../../library/turtle.rst:1404 msgid "" "Write text - the string representation of *arg* - at the current turtle " "position according to *align* (\"left\", \"center\" or \"right\") and with " @@ -2240,34 +2248,34 @@ msgid "" "corner of the text. By default, *move* is ``False``." msgstr "" -#: ../../library/turtle.rst:1420 +#: ../../library/turtle.rst:1422 msgid "" "Make the turtle invisible. It's a good idea to do this while you're in the " "middle of doing some complex drawing, because hiding the turtle speeds up " "the drawing observably." msgstr "" -#: ../../library/turtle.rst:1424 +#: ../../library/turtle.rst:1426 msgid ">>> turtle.hideturtle()" msgstr ">>> turtle.hideturtle()" -#: ../../library/turtle.rst:1433 +#: ../../library/turtle.rst:1435 msgid "Make the turtle visible." msgstr "" -#: ../../library/turtle.rst:1435 +#: ../../library/turtle.rst:1437 msgid ">>> turtle.showturtle()" msgstr ">>> turtle.showturtle()" -#: ../../library/turtle.rst:1443 +#: ../../library/turtle.rst:1445 msgid "Return ``True`` if the Turtle is shown, ``False`` if it's hidden." msgstr "" -#: ../../library/turtle.rst:1458 +#: ../../library/turtle.rst:1460 msgid "a string which is a valid shapename" msgstr "" -#: ../../library/turtle.rst:1460 +#: ../../library/turtle.rst:1462 msgid "" "Set turtle shape to shape with given *name* or, if name is not given, return " "name of current shape. Shape with *name* must exist in the TurtleScreen's " @@ -2277,7 +2285,7 @@ msgid "" "`register_shape`." msgstr "" -#: ../../library/turtle.rst:1466 +#: ../../library/turtle.rst:1468 msgid "" ">>> turtle.shape()\n" "'classic'\n" @@ -2291,40 +2299,40 @@ msgstr "" ">>> turtle.shape()\n" "'turtle'" -#: ../../library/turtle.rst:1478 +#: ../../library/turtle.rst:1480 msgid "one of the strings \"auto\", \"user\", \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1480 +#: ../../library/turtle.rst:1482 msgid "" "Set resizemode to one of the values: \"auto\", \"user\", \"noresize\". If " "*rmode* is not given, return current resizemode. Different resizemodes have " "the following effects:" msgstr "" -#: ../../library/turtle.rst:1484 +#: ../../library/turtle.rst:1486 msgid "" "\"auto\": adapts the appearance of the turtle corresponding to the value of " "pensize." msgstr "" -#: ../../library/turtle.rst:1485 +#: ../../library/turtle.rst:1487 msgid "" "\"user\": adapts the appearance of the turtle according to the values of " "stretchfactor and outlinewidth (outline), which are set by :func:`shapesize`." msgstr "" -#: ../../library/turtle.rst:1488 +#: ../../library/turtle.rst:1490 msgid "\"noresize\": no adaption of the turtle's appearance takes place." msgstr "" -#: ../../library/turtle.rst:1490 +#: ../../library/turtle.rst:1492 msgid "" "``resizemode(\"user\")`` is called by :func:`shapesize` when used with " "arguments." msgstr "" -#: ../../library/turtle.rst:1492 +#: ../../library/turtle.rst:1494 msgid "" ">>> turtle.resizemode()\n" "'noresize'\n" @@ -2338,12 +2346,12 @@ msgstr "" ">>> turtle.resizemode()\n" "'auto'" -#: ../../library/turtle.rst:1505 ../../library/turtle.rst:1506 -#: ../../library/turtle.rst:1507 +#: ../../library/turtle.rst:1507 ../../library/turtle.rst:1508 +#: ../../library/turtle.rst:1509 msgid "positive number" msgstr "" -#: ../../library/turtle.rst:1509 +#: ../../library/turtle.rst:1511 msgid "" "Return or set the pen's attributes x/y-stretchfactors and/or outline. Set " "resizemode to \"user\". If and only if resizemode is set to \"user\", the " @@ -2353,7 +2361,7 @@ msgid "" "determines the width of the shape's outline." msgstr "" -#: ../../library/turtle.rst:1516 +#: ../../library/turtle.rst:1518 msgid "" ">>> turtle.shapesize()\n" "(1.0, 1.0, 1)\n" @@ -2375,12 +2383,12 @@ msgstr "" ">>> turtle.shapesize()\n" "(5, 5, 8)" -#: ../../library/turtle.rst:1532 ../../library/turtle.rst:2223 -#: ../../library/turtle.rst:2224 ../../library/turtle.rst:2225 +#: ../../library/turtle.rst:1534 ../../library/turtle.rst:2225 +#: ../../library/turtle.rst:2226 ../../library/turtle.rst:2227 msgid "number (optional)" msgstr "" -#: ../../library/turtle.rst:1534 +#: ../../library/turtle.rst:1536 msgid "" "Set or return the current shearfactor. Shear the turtleshape according to " "the given shearfactor shear, which is the tangent of the shear angle. Do " @@ -2389,7 +2397,7 @@ msgid "" "by which lines parallel to the heading of the turtle are sheared." msgstr "" -#: ../../library/turtle.rst:1541 +#: ../../library/turtle.rst:1543 msgid "" ">>> turtle.shape(\"circle\")\n" ">>> turtle.shapesize(5,2)\n" @@ -2403,13 +2411,13 @@ msgstr "" ">>> turtle.shearfactor()\n" "0.5" -#: ../../library/turtle.rst:1555 +#: ../../library/turtle.rst:1557 msgid "" "Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* " "change the turtle's heading (direction of movement)." msgstr "" -#: ../../library/turtle.rst:1558 +#: ../../library/turtle.rst:1560 msgid "" ">>> turtle.reset()\n" ">>> turtle.shape(\"circle\")\n" @@ -2427,13 +2435,13 @@ msgstr "" ">>> turtle.tilt(30)\n" ">>> turtle.fd(50)" -#: ../../library/turtle.rst:1572 ../../library/turtle.rst:1595 -#: ../../library/turtle.rst:1596 ../../library/turtle.rst:1597 -#: ../../library/turtle.rst:1598 +#: ../../library/turtle.rst:1574 ../../library/turtle.rst:1597 +#: ../../library/turtle.rst:1598 ../../library/turtle.rst:1599 +#: ../../library/turtle.rst:1600 msgid "a number (optional)" msgstr "" -#: ../../library/turtle.rst:1574 +#: ../../library/turtle.rst:1576 msgid "" "Set or return the current tilt-angle. If angle is given, rotate the " "turtleshape to point in the direction specified by angle, regardless of its " @@ -2443,7 +2451,7 @@ msgid "" "turtle (its direction of movement)." msgstr "" -#: ../../library/turtle.rst:1582 +#: ../../library/turtle.rst:1584 msgid "" ">>> turtle.reset()\n" ">>> turtle.shape(\"circle\")\n" @@ -2459,11 +2467,11 @@ msgstr "" ">>> turtle.tiltangle()\n" "45.0" -#: ../../library/turtle.rst:1600 +#: ../../library/turtle.rst:1602 msgid "Set or return the current transformation matrix of the turtle shape." msgstr "" -#: ../../library/turtle.rst:1602 +#: ../../library/turtle.rst:1604 msgid "" "If none of the matrix elements are given, return the transformation matrix " "as a tuple of 4 elements. Otherwise set the given elements and transform the " @@ -2473,7 +2481,7 @@ msgid "" "tiltangle according to the given matrix." msgstr "" -#: ../../library/turtle.rst:1611 +#: ../../library/turtle.rst:1613 msgid "" ">>> turtle = Turtle()\n" ">>> turtle.shape(\"square\")\n" @@ -2489,13 +2497,13 @@ msgstr "" ">>> turtle.shapetransform()\n" "(4.0, -1.0, -0.0, 2.0)" -#: ../../library/turtle.rst:1624 +#: ../../library/turtle.rst:1626 msgid "" "Return the current shape polygon as tuple of coordinate pairs. This can be " "used to define a new shape or components of a compound shape." msgstr "" -#: ../../library/turtle.rst:1627 +#: ../../library/turtle.rst:1629 msgid "" ">>> turtle.shape(\"square\")\n" ">>> turtle.shapetransform(4, -1, 0, 2)\n" @@ -2507,33 +2515,33 @@ msgstr "" ">>> turtle.get_shapepoly()\n" "((50, -20), (30, 20), (-50, 20), (-30, -20))" -#: ../../library/turtle.rst:1642 ../../library/turtle.rst:1664 -#: ../../library/turtle.rst:1689 ../../library/turtle.rst:2147 +#: ../../library/turtle.rst:1644 ../../library/turtle.rst:1666 +#: ../../library/turtle.rst:1691 ../../library/turtle.rst:2149 msgid "" "a function with two arguments which will be called with the coordinates of " "the clicked point on the canvas" msgstr "" -#: ../../library/turtle.rst:1644 ../../library/turtle.rst:1666 -#: ../../library/turtle.rst:1691 ../../library/turtle.rst:2149 +#: ../../library/turtle.rst:1646 ../../library/turtle.rst:1668 +#: ../../library/turtle.rst:1693 ../../library/turtle.rst:2151 msgid "number of the mouse-button, defaults to 1 (left mouse button)" msgstr "" -#: ../../library/turtle.rst:1645 ../../library/turtle.rst:1667 -#: ../../library/turtle.rst:1692 ../../library/turtle.rst:2150 +#: ../../library/turtle.rst:1647 ../../library/turtle.rst:1669 +#: ../../library/turtle.rst:1694 ../../library/turtle.rst:2152 msgid "" "``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise " "it will replace a former binding" msgstr "" -#: ../../library/turtle.rst:1648 +#: ../../library/turtle.rst:1650 msgid "" "Bind *fun* to mouse-click events on this turtle. If *fun* is ``None``, " "existing bindings are removed. Example for the anonymous turtle, i.e. the " "procedural way:" msgstr "" -#: ../../library/turtle.rst:1652 +#: ../../library/turtle.rst:1654 msgid "" ">>> def turn(x, y):\n" "... left(180)\n" @@ -2542,13 +2550,13 @@ msgid "" ">>> onclick(None) # event-binding will be removed" msgstr "" -#: ../../library/turtle.rst:1670 +#: ../../library/turtle.rst:1672 msgid "" "Bind *fun* to mouse-button-release events on this turtle. If *fun* is " "``None``, existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1673 +#: ../../library/turtle.rst:1675 msgid "" ">>> class MyTurtle(Turtle):\n" "... def glow(self,x,y):\n" @@ -2562,35 +2570,35 @@ msgid "" ">>> turtle.onrelease(turtle.unglow) # releasing turns it to transparent." msgstr "" -#: ../../library/turtle.rst:1695 +#: ../../library/turtle.rst:1697 msgid "" "Bind *fun* to mouse-move events on this turtle. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1698 +#: ../../library/turtle.rst:1700 msgid "" "Remark: Every sequence of mouse-move-events on a turtle is preceded by a " "mouse-click event on that turtle." msgstr "" -#: ../../library/turtle.rst:1701 +#: ../../library/turtle.rst:1703 msgid ">>> turtle.ondrag(turtle.goto)" msgstr ">>> turtle.ondrag(turtle.goto)" -#: ../../library/turtle.rst:1706 +#: ../../library/turtle.rst:1708 msgid "" "Subsequently, clicking and dragging the Turtle will move it across the " "screen thereby producing handdrawings (if pen is down)." msgstr "" -#: ../../library/turtle.rst:1716 +#: ../../library/turtle.rst:1718 msgid "" "Record the vertices of a polygon drawn in the ``with turtle.poly():`` block. " "The first and last vertices will be connected." msgstr "" -#: ../../library/turtle.rst:1719 +#: ../../library/turtle.rst:1721 msgid "" ">>> with turtle.poly():\n" "... turtle.forward(100)\n" @@ -2602,23 +2610,23 @@ msgstr "" "... turtle.right(60)\n" "... turtle.forward(100)" -#: ../../library/turtle.rst:1732 +#: ../../library/turtle.rst:1734 msgid "" "Start recording the vertices of a polygon. Current turtle position is first " "vertex of polygon." msgstr "" -#: ../../library/turtle.rst:1738 +#: ../../library/turtle.rst:1740 msgid "" "Stop recording the vertices of a polygon. Current turtle position is last " "vertex of polygon. This will be connected with the first vertex." msgstr "" -#: ../../library/turtle.rst:1744 +#: ../../library/turtle.rst:1746 msgid "Return the last recorded polygon." msgstr "" -#: ../../library/turtle.rst:1746 +#: ../../library/turtle.rst:1748 msgid "" ">>> turtle.home()\n" ">>> turtle.begin_poly()\n" @@ -2642,13 +2650,13 @@ msgstr "" ">>> p = turtle.get_poly()\n" ">>> register_shape(\"myFavouriteShape\", p)" -#: ../../library/turtle.rst:1763 +#: ../../library/turtle.rst:1765 msgid "" "Create and return a clone of the turtle with same position, heading and " "turtle properties." msgstr "" -#: ../../library/turtle.rst:1766 +#: ../../library/turtle.rst:1768 msgid "" ">>> mick = Turtle()\n" ">>> joe = mick.clone()" @@ -2656,13 +2664,13 @@ msgstr "" ">>> mick = Turtle()\n" ">>> joe = mick.clone()" -#: ../../library/turtle.rst:1776 +#: ../../library/turtle.rst:1778 msgid "" "Return the Turtle object itself. Only reasonable use: as a function to " "return the \"anonymous turtle\":" msgstr "" -#: ../../library/turtle.rst:1779 +#: ../../library/turtle.rst:1781 msgid "" ">>> pet = getturtle()\n" ">>> pet.fd(50)\n" @@ -2674,13 +2682,13 @@ msgstr "" ">>> pet\n" "" -#: ../../library/turtle.rst:1790 +#: ../../library/turtle.rst:1792 msgid "" "Return the :class:`TurtleScreen` object the turtle is drawing on. " "TurtleScreen methods can then be called for that object." msgstr "" -#: ../../library/turtle.rst:1793 +#: ../../library/turtle.rst:1795 msgid "" ">>> ts = turtle.getscreen()\n" ">>> ts\n" @@ -2692,11 +2700,11 @@ msgstr "" "\n" ">>> ts.bgcolor(\"pink\")" -#: ../../library/turtle.rst:1804 +#: ../../library/turtle.rst:1806 msgid "an integer or ``None``" msgstr "一個整數或 ``None``" -#: ../../library/turtle.rst:1806 +#: ../../library/turtle.rst:1808 msgid "" "Set or disable undobuffer. If *size* is an integer, an empty undobuffer of " "given size is installed. *size* gives the maximum number of turtle actions " @@ -2704,15 +2712,15 @@ msgid "" "``None``, the undobuffer is disabled." msgstr "" -#: ../../library/turtle.rst:1811 +#: ../../library/turtle.rst:1813 msgid ">>> turtle.setundobuffer(42)" msgstr ">>> turtle.setundobuffer(42)" -#: ../../library/turtle.rst:1819 +#: ../../library/turtle.rst:1821 msgid "Return number of entries in the undobuffer." msgstr "" -#: ../../library/turtle.rst:1821 +#: ../../library/turtle.rst:1823 msgid "" ">>> while undobufferentries():\n" "... undo()" @@ -2720,32 +2728,32 @@ msgstr "" ">>> while undobufferentries():\n" "... undo()" -#: ../../library/turtle.rst:1832 +#: ../../library/turtle.rst:1834 msgid "Compound shapes" msgstr "" -#: ../../library/turtle.rst:1834 +#: ../../library/turtle.rst:1836 msgid "" "To use compound turtle shapes, which consist of several polygons of " "different color, you must use the helper class :class:`Shape` explicitly as " "described below:" msgstr "" -#: ../../library/turtle.rst:1838 +#: ../../library/turtle.rst:1840 msgid "Create an empty Shape object of type \"compound\"." msgstr "" -#: ../../library/turtle.rst:1839 +#: ../../library/turtle.rst:1841 msgid "" "Add as many components to this object as desired, using the :meth:`~Shape." "addcomponent` method." msgstr "" -#: ../../library/turtle.rst:1842 +#: ../../library/turtle.rst:1844 msgid "For example:" msgstr "舉例來說:" -#: ../../library/turtle.rst:1844 +#: ../../library/turtle.rst:1846 msgid "" ">>> s = Shape(\"compound\")\n" ">>> poly1 = ((0,0),(10,-5),(0,10),(-10,-5))\n" @@ -2759,11 +2767,11 @@ msgstr "" ">>> poly2 = ((0,0),(10,-5),(-10,-5))\n" ">>> s.addcomponent(poly2, \"blue\", \"red\")" -#: ../../library/turtle.rst:1853 +#: ../../library/turtle.rst:1855 msgid "Now add the Shape to the Screen's shapelist and use it:" msgstr "" -#: ../../library/turtle.rst:1855 +#: ../../library/turtle.rst:1857 msgid "" ">>> register_shape(\"myshape\", s)\n" ">>> shape(\"myshape\")" @@ -2771,70 +2779,70 @@ msgstr "" ">>> register_shape(\"myshape\", s)\n" ">>> shape(\"myshape\")" -#: ../../library/turtle.rst:1864 +#: ../../library/turtle.rst:1866 msgid "" "The :class:`Shape` class is used internally by the :func:`register_shape` " "method in different ways. The application programmer has to deal with the " "Shape class *only* when using compound shapes like shown above!" msgstr "" -#: ../../library/turtle.rst:1870 +#: ../../library/turtle.rst:1872 msgid "Methods of TurtleScreen/Screen and corresponding functions" msgstr "" -#: ../../library/turtle.rst:1872 +#: ../../library/turtle.rst:1874 msgid "" "Most of the examples in this section refer to a TurtleScreen instance called " "``screen``." msgstr "" -#: ../../library/turtle.rst:1888 +#: ../../library/turtle.rst:1890 msgid "Return or set the background color of the TurtleScreen." msgstr "" -#: ../../library/turtle.rst:1892 +#: ../../library/turtle.rst:1894 msgid "``bgcolor()``" msgstr "``bgcolor()``" -#: ../../library/turtle.rst:1893 +#: ../../library/turtle.rst:1895 msgid "" "Return the current background color as color specification string or as a " "tuple (see example). May be used as input to another color/pencolor/" "fillcolor/bgcolor call." msgstr "" -#: ../../library/turtle.rst:1897 +#: ../../library/turtle.rst:1899 msgid "``bgcolor(colorstring)``" msgstr "``bgcolor(colorstring)``" -#: ../../library/turtle.rst:1898 +#: ../../library/turtle.rst:1900 msgid "" "Set the background color to *colorstring*, which is a Tk color specification " "string, such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:1901 +#: ../../library/turtle.rst:1903 msgid "``bgcolor((r, g, b))``" msgstr "``bgcolor((r, g, b))``" -#: ../../library/turtle.rst:1902 +#: ../../library/turtle.rst:1904 msgid "" "Set the background color to the RGB color represented by the tuple of *r*, " "*g*, and *b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, " "where colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:1907 +#: ../../library/turtle.rst:1909 msgid "``bgcolor(r, g, b)``" msgstr "``bgcolor(r, g, b)``" -#: ../../library/turtle.rst:1908 +#: ../../library/turtle.rst:1910 msgid "" "Set the background color to the RGB color represented by *r*, *g*, and *b*. " "Each of *r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:1911 +#: ../../library/turtle.rst:1913 msgid "" ">>> screen.bgcolor(\"orange\")\n" ">>> screen.bgcolor()\n" @@ -2850,13 +2858,13 @@ msgstr "" ">>> screen.bgcolor()\n" "(128.0, 0.0, 128.0)" -#: ../../library/turtle.rst:1924 +#: ../../library/turtle.rst:1926 msgid "" "a string, name of an image file (PNG, GIF, PGM, and PPM) or ``\"nopic\"``, " "or ``None``" msgstr "" -#: ../../library/turtle.rst:1927 +#: ../../library/turtle.rst:1929 msgid "" "Set background image or return name of current backgroundimage. If " "*picname* is a filename, set the corresponding image as background. If " @@ -2864,7 +2872,7 @@ msgid "" "*picname* is ``None``, return the filename of the current backgroundimage. ::" msgstr "" -#: ../../library/turtle.rst:1932 +#: ../../library/turtle.rst:1934 msgid "" ">>> screen.bgpic()\n" "'nopic'\n" @@ -2878,44 +2886,44 @@ msgstr "" ">>> screen.bgpic()\n" "\"landscape.gif\"" -#: ../../library/turtle.rst:1943 +#: ../../library/turtle.rst:1945 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``clearscreen``. The global function ``clear`` is a different one " "derived from the Turtle method ``clear``." msgstr "" -#: ../../library/turtle.rst:1950 +#: ../../library/turtle.rst:1952 msgid "" "Delete all drawings and all turtles from the TurtleScreen. Reset the now " "empty TurtleScreen to its initial state: white background, no background " "image, no event bindings and tracing on." msgstr "" -#: ../../library/turtle.rst:1959 +#: ../../library/turtle.rst:1961 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``resetscreen``. The global function ``reset`` is another one derived " "from the Turtle method ``reset``." msgstr "" -#: ../../library/turtle.rst:1966 +#: ../../library/turtle.rst:1968 msgid "Reset all Turtles on the Screen to their initial state." msgstr "" -#: ../../library/turtle.rst:1971 +#: ../../library/turtle.rst:1973 msgid "positive integer, new width of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1972 +#: ../../library/turtle.rst:1974 msgid "positive integer, new height of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1973 +#: ../../library/turtle.rst:1975 msgid "colorstring or color-tuple, new background color" msgstr "" -#: ../../library/turtle.rst:1975 +#: ../../library/turtle.rst:1977 msgid "" "If no arguments are given, return current (canvaswidth, canvasheight). Else " "resize the canvas the turtles are drawing on. Do not alter the drawing " @@ -2924,40 +2932,40 @@ msgid "" "outside the canvas before." msgstr "" -#: ../../library/turtle.rst:1987 +#: ../../library/turtle.rst:1989 msgid "e.g. to search for an erroneously escaped turtle ;-)" msgstr "" -#: ../../library/turtle.rst:1992 +#: ../../library/turtle.rst:1994 msgid "a number, x-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1993 +#: ../../library/turtle.rst:1995 msgid "a number, y-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1994 +#: ../../library/turtle.rst:1996 msgid "a number, x-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1995 +#: ../../library/turtle.rst:1997 msgid "a number, y-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1997 +#: ../../library/turtle.rst:1999 msgid "" "Set up user-defined coordinate system and switch to mode \"world\" if " "necessary. This performs a ``screen.reset()``. If mode \"world\" is " "already active, all drawings are redrawn according to the new coordinates." msgstr "" -#: ../../library/turtle.rst:2001 +#: ../../library/turtle.rst:2003 msgid "" "**ATTENTION**: in user-defined coordinate systems angles may appear " "distorted." msgstr "" -#: ../../library/turtle.rst:2004 +#: ../../library/turtle.rst:2006 msgid "" ">>> screen.reset()\n" ">>> screen.setworldcoordinates(-50,-7.5,50,7.5)\n" @@ -2975,14 +2983,14 @@ msgstr "" ">>> for _ in range(8):\n" "... left(45); fd(2) # 一個一般的八邊形" -#: ../../library/turtle.rst:2029 +#: ../../library/turtle.rst:2031 msgid "" "Temporarily disable turtle animation. The code written inside the " "``no_animation`` block will not be animated; once the code block is exited, " "the drawing will appear." msgstr "" -#: ../../library/turtle.rst:2033 +#: ../../library/turtle.rst:2035 msgid "" ">>> with screen.no_animation():\n" "... for dist in range(2, 400, 2):\n" @@ -2994,22 +3002,22 @@ msgstr "" "... fd(dist)\n" "... rt(90)" -#: ../../library/turtle.rst:2046 +#: ../../library/turtle.rst:2048 msgid "positive integer" msgstr "正整數" -#: ../../library/turtle.rst:2048 +#: ../../library/turtle.rst:2050 msgid "" "Set or return the drawing *delay* in milliseconds. (This is approximately " "the time interval between two consecutive canvas updates.) The longer the " "drawing delay, the slower the animation." msgstr "" -#: ../../library/turtle.rst:2052 +#: ../../library/turtle.rst:2054 msgid "Optional argument:" msgstr "可選引數: ::" -#: ../../library/turtle.rst:2054 +#: ../../library/turtle.rst:2056 msgid "" ">>> screen.delay()\n" "10\n" @@ -3023,11 +3031,11 @@ msgstr "" ">>> screen.delay()\n" "5" -#: ../../library/turtle.rst:2066 ../../library/turtle.rst:2067 +#: ../../library/turtle.rst:2068 ../../library/turtle.rst:2069 msgid "nonnegative integer" msgstr "非負整數" -#: ../../library/turtle.rst:2069 +#: ../../library/turtle.rst:2071 msgid "" "Turn turtle animation on/off and set delay for update drawings. If *n* is " "given, only each n-th regular screen update is really performed. (Can be " @@ -3036,7 +3044,7 @@ msgid "" "delay value (see :func:`delay`)." msgstr "" -#: ../../library/turtle.rst:2076 +#: ../../library/turtle.rst:2078 msgid "" ">>> screen.tracer(8, 25)\n" ">>> dist = 2\n" @@ -3052,37 +3060,37 @@ msgstr "" "... rt(90)\n" "... dist += 2" -#: ../../library/turtle.rst:2089 +#: ../../library/turtle.rst:2091 msgid "Perform a TurtleScreen update. To be used when tracer is turned off." msgstr "" -#: ../../library/turtle.rst:2091 +#: ../../library/turtle.rst:2093 msgid "See also the RawTurtle/Turtle method :func:`speed`." msgstr "另請參閱 RawTurtle/Turtle 的 :func:`speed` 方法。" -#: ../../library/turtle.rst:2099 +#: ../../library/turtle.rst:2101 msgid "" "Set focus on TurtleScreen (in order to collect key-events). Dummy arguments " "are provided in order to be able to pass :func:`listen` to the onclick " "method." msgstr "" -#: ../../library/turtle.rst:2106 ../../library/turtle.rst:2126 +#: ../../library/turtle.rst:2108 ../../library/turtle.rst:2128 msgid "a function with no arguments or ``None``" msgstr "" -#: ../../library/turtle.rst:2107 ../../library/turtle.rst:2127 +#: ../../library/turtle.rst:2109 ../../library/turtle.rst:2129 msgid "a string: key (e.g. \"a\") or key-symbol (e.g. \"space\")" msgstr "" -#: ../../library/turtle.rst:2109 +#: ../../library/turtle.rst:2111 msgid "" "Bind *fun* to key-release event of key. If *fun* is ``None``, event " "bindings are removed. Remark: in order to be able to register key-events, " "TurtleScreen must have the focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:2113 +#: ../../library/turtle.rst:2115 msgid "" ">>> def f():\n" "... fd(50)\n" @@ -3098,14 +3106,14 @@ msgstr "" ">>> screen.onkey(f, \"Up\")\n" ">>> screen.listen()" -#: ../../library/turtle.rst:2129 +#: ../../library/turtle.rst:2131 msgid "" "Bind *fun* to key-press event of key if key is given, or to any key-press-" "event if no key is given. Remark: in order to be able to register key-" "events, TurtleScreen must have focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:2134 +#: ../../library/turtle.rst:2136 msgid "" ">>> def f():\n" "... fd(50)\n" @@ -3119,19 +3127,19 @@ msgstr "" ">>> screen.onkey(f, \"Up\")\n" ">>> screen.listen()" -#: ../../library/turtle.rst:2153 +#: ../../library/turtle.rst:2155 msgid "" "Bind *fun* to mouse-click events on this screen. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:2156 +#: ../../library/turtle.rst:2158 msgid "" "Example for a TurtleScreen instance named ``screen`` and a Turtle instance " "named ``turtle``:" msgstr "" -#: ../../library/turtle.rst:2159 +#: ../../library/turtle.rst:2161 msgid "" ">>> screen.onclick(turtle.goto) # Subsequently clicking into the " "TurtleScreen will\n" @@ -3140,26 +3148,26 @@ msgid "" ">>> screen.onclick(None) # remove event binding again" msgstr "" -#: ../../library/turtle.rst:2167 +#: ../../library/turtle.rst:2169 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``onscreenclick``. The global function ``onclick`` is another one " "derived from the Turtle method ``onclick``." msgstr "" -#: ../../library/turtle.rst:2174 +#: ../../library/turtle.rst:2176 msgid "a function with no arguments" msgstr "" -#: ../../library/turtle.rst:2175 +#: ../../library/turtle.rst:2177 msgid "a number >= 0" msgstr "" -#: ../../library/turtle.rst:2177 +#: ../../library/turtle.rst:2179 msgid "Install a timer that calls *fun* after *t* milliseconds." msgstr "" -#: ../../library/turtle.rst:2179 +#: ../../library/turtle.rst:2181 msgid "" ">>> running = True\n" ">>> def f():\n" @@ -3171,7 +3179,7 @@ msgid "" ">>> running = False" msgstr "" -#: ../../library/turtle.rst:2195 +#: ../../library/turtle.rst:2197 msgid "" "Starts event loop - calling Tkinter's mainloop function. Must be the last " "statement in a turtle graphics program. Must *not* be used if a script is " @@ -3179,16 +3187,16 @@ msgid "" "turtle graphics. ::" msgstr "" -#: ../../library/turtle.rst:2200 +#: ../../library/turtle.rst:2202 msgid ">>> screen.mainloop()" msgstr ">>> screen.mainloop()" -#: ../../library/turtle.rst:2208 ../../library/turtle.rst:2209 -#: ../../library/turtle.rst:2221 ../../library/turtle.rst:2222 +#: ../../library/turtle.rst:2210 ../../library/turtle.rst:2211 +#: ../../library/turtle.rst:2223 ../../library/turtle.rst:2224 msgid "string" msgstr "string(字串)" -#: ../../library/turtle.rst:2211 +#: ../../library/turtle.rst:2213 msgid "" "Pop up a dialog window for input of a string. Parameter title is the title " "of the dialog window, prompt is a text mostly describing what information to " @@ -3196,11 +3204,11 @@ msgid "" "``None``. ::" msgstr "" -#: ../../library/turtle.rst:2216 +#: ../../library/turtle.rst:2218 msgid ">>> screen.textinput(\"NIM\", \"Name of first player:\")" msgstr ">>> screen.textinput(\"NIM\", \"Name of first player:\")" -#: ../../library/turtle.rst:2227 +#: ../../library/turtle.rst:2229 msgid "" "Pop up a dialog window for input of a number. title is the title of the " "dialog window, prompt is a text mostly describing what numerical information " @@ -3211,7 +3219,7 @@ msgid "" "return ``None``. ::" msgstr "" -#: ../../library/turtle.rst:2236 +#: ../../library/turtle.rst:2238 msgid "" ">>> screen.numinput(\"Poker\", \"Your stakes:\", 1000, minval=10, " "maxval=10000)" @@ -3219,17 +3227,17 @@ msgstr "" ">>> screen.numinput(\"Poker\", \"Your stakes:\", 1000, minval=10, " "maxval=10000)" -#: ../../library/turtle.rst:2244 +#: ../../library/turtle.rst:2246 msgid "one of the strings \"standard\", \"logo\" or \"world\"" msgstr "" -#: ../../library/turtle.rst:2246 +#: ../../library/turtle.rst:2248 msgid "" "Set turtle mode (\"standard\", \"logo\" or \"world\") and perform reset. If " "mode is not given, current mode is returned." msgstr "" -#: ../../library/turtle.rst:2249 +#: ../../library/turtle.rst:2251 msgid "" "Mode \"standard\" is compatible with old :mod:`turtle`. Mode \"logo\" is " "compatible with most Logo turtle graphics. Mode \"world\" uses user-defined " @@ -3237,60 +3245,60 @@ msgid "" "if ``x/y`` unit-ratio doesn't equal 1." msgstr "" -#: ../../library/turtle.rst:2255 +#: ../../library/turtle.rst:2257 msgid "Mode" msgstr "" -#: ../../library/turtle.rst:2255 +#: ../../library/turtle.rst:2257 msgid "Initial turtle heading" msgstr "" -#: ../../library/turtle.rst:2255 +#: ../../library/turtle.rst:2257 msgid "positive angles" msgstr "" -#: ../../library/turtle.rst:2257 +#: ../../library/turtle.rst:2259 msgid "\"standard\"" msgstr "" -#: ../../library/turtle.rst:2257 +#: ../../library/turtle.rst:2259 msgid "to the right (east)" msgstr "" -#: ../../library/turtle.rst:2257 +#: ../../library/turtle.rst:2259 msgid "counterclockwise" msgstr "" -#: ../../library/turtle.rst:2258 +#: ../../library/turtle.rst:2260 msgid "\"logo\"" msgstr "" -#: ../../library/turtle.rst:2258 +#: ../../library/turtle.rst:2260 msgid "upward (north)" msgstr "" -#: ../../library/turtle.rst:2258 +#: ../../library/turtle.rst:2260 msgid "clockwise" msgstr "" -#: ../../library/turtle.rst:2261 +#: ../../library/turtle.rst:2263 msgid "" ">>> mode(\"logo\") # resets turtle heading to north\n" ">>> mode()\n" "'logo'" msgstr "" -#: ../../library/turtle.rst:2271 +#: ../../library/turtle.rst:2273 msgid "one of the values 1.0 or 255" msgstr "" -#: ../../library/turtle.rst:2273 +#: ../../library/turtle.rst:2275 msgid "" "Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* " "values of color triples have to be in the range 0..*cmode*." msgstr "" -#: ../../library/turtle.rst:2276 +#: ../../library/turtle.rst:2278 msgid "" ">>> screen.colormode(1)\n" ">>> turtle.pencolor(240, 160, 80)\n" @@ -3316,13 +3324,13 @@ msgstr "" "255\n" ">>> turtle.pencolor(240,160,80)" -#: ../../library/turtle.rst:2294 +#: ../../library/turtle.rst:2296 msgid "" "Return the Canvas of this TurtleScreen. Useful for insiders who know what " "to do with a Tkinter Canvas." msgstr "" -#: ../../library/turtle.rst:2297 +#: ../../library/turtle.rst:2299 msgid "" ">>> cv = screen.getcanvas()\n" ">>> cv\n" @@ -3332,11 +3340,11 @@ msgstr "" ">>> cv\n" "" -#: ../../library/turtle.rst:2307 +#: ../../library/turtle.rst:2309 msgid "Return a list of names of all currently available turtle shapes." msgstr "" -#: ../../library/turtle.rst:2309 +#: ../../library/turtle.rst:2311 msgid "" ">>> screen.getshapes()\n" "['arrow', 'blank', 'circle', ..., 'turtle']" @@ -3344,69 +3352,69 @@ msgstr "" ">>> screen.getshapes()\n" "['arrow', 'blank', 'circle', ..., 'turtle']" -#: ../../library/turtle.rst:2319 +#: ../../library/turtle.rst:2321 msgid "There are four different ways to call this function:" msgstr "" -#: ../../library/turtle.rst:2321 +#: ../../library/turtle.rst:2323 msgid "" "*name* is the name of an image file (PNG, GIF, PGM, and PPM) and *shape* is " "``None``: Install the corresponding image shape. ::" msgstr "" -#: ../../library/turtle.rst:2324 +#: ../../library/turtle.rst:2326 msgid ">>> screen.register_shape(\"turtle.gif\")" msgstr ">>> screen.register_shape(\"turtle.gif\")" -#: ../../library/turtle.rst:2327 ../../library/turtle.rst:2336 +#: ../../library/turtle.rst:2329 ../../library/turtle.rst:2338 msgid "" "Image shapes *do not* rotate when turning the turtle, so they do not display " "the heading of the turtle!" msgstr "" -#: ../../library/turtle.rst:2330 +#: ../../library/turtle.rst:2332 msgid "" "*name* is an arbitrary string and *shape* is the name of an image file (PNG, " "GIF, PGM, and PPM): Install the corresponding image shape. ::" msgstr "" -#: ../../library/turtle.rst:2333 +#: ../../library/turtle.rst:2335 msgid ">>> screen.register_shape(\"turtle\", \"turtle.gif\")" msgstr ">>> screen.register_shape(\"turtle\", \"turtle.gif\")" -#: ../../library/turtle.rst:2339 +#: ../../library/turtle.rst:2341 msgid "" "*name* is an arbitrary string and *shape* is a tuple of pairs of " "coordinates: Install the corresponding polygon shape." msgstr "" -#: ../../library/turtle.rst:2342 +#: ../../library/turtle.rst:2344 msgid ">>> screen.register_shape(\"triangle\", ((5,-3), (0,5), (-5,-3)))" msgstr ">>> screen.register_shape(\"triangle\", ((5,-3), (0,5), (-5,-3)))" -#: ../../library/turtle.rst:2347 +#: ../../library/turtle.rst:2349 msgid "" "*name* is an arbitrary string and *shape* is a (compound) :class:`Shape` " "object: Install the corresponding compound shape." msgstr "" -#: ../../library/turtle.rst:2350 +#: ../../library/turtle.rst:2352 msgid "" "Add a turtle shape to TurtleScreen's shapelist. Only thusly registered " "shapes can be used by issuing the command ``shape(shapename)``." msgstr "" -#: ../../library/turtle.rst:2353 +#: ../../library/turtle.rst:2355 msgid "" "Added support for PNG, PGM, and PPM image formats. Both a shape name and an " "image file name can be specified." msgstr "" -#: ../../library/turtle.rst:2360 +#: ../../library/turtle.rst:2362 msgid "Return the list of turtles on the screen." msgstr "" -#: ../../library/turtle.rst:2362 +#: ../../library/turtle.rst:2364 msgid "" ">>> for turtle in screen.turtles():\n" "... turtle.color(\"red\")" @@ -3414,11 +3422,11 @@ msgstr "" ">>> for turtle in screen.turtles():\n" "... turtle.color(\"red\")" -#: ../../library/turtle.rst:2371 +#: ../../library/turtle.rst:2373 msgid "Return the height of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2373 +#: ../../library/turtle.rst:2375 msgid "" ">>> screen.window_height()\n" "480" @@ -3426,11 +3434,11 @@ msgstr "" ">>> screen.window_height()\n" "480" -#: ../../library/turtle.rst:2379 +#: ../../library/turtle.rst:2381 msgid "Return the width of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2381 +#: ../../library/turtle.rst:2383 msgid "" ">>> screen.window_width()\n" "640" @@ -3438,19 +3446,19 @@ msgstr "" ">>> screen.window_width()\n" "640" -#: ../../library/turtle.rst:2388 +#: ../../library/turtle.rst:2390 msgid "Methods specific to Screen, not inherited from TurtleScreen" msgstr "" -#: ../../library/turtle.rst:2392 +#: ../../library/turtle.rst:2394 msgid "Shut the turtlegraphics window." msgstr "" -#: ../../library/turtle.rst:2397 +#: ../../library/turtle.rst:2399 msgid "Bind ``bye()`` method to mouse clicks on the Screen." msgstr "" -#: ../../library/turtle.rst:2400 +#: ../../library/turtle.rst:2402 msgid "" "If the value \"using_IDLE\" in the configuration dictionary is ``False`` " "(default value), also enter mainloop. Remark: If IDLE with the ``-n`` " @@ -3459,22 +3467,22 @@ msgid "" "client script." msgstr "" -#: ../../library/turtle.rst:2409 +#: ../../library/turtle.rst:2411 msgid "Save the current turtle drawing (and turtles) as a PostScript file." msgstr "" -#: ../../library/turtle.rst:2411 +#: ../../library/turtle.rst:2413 msgid "the path of the saved PostScript file" msgstr "" -#: ../../library/turtle.rst:2412 +#: ../../library/turtle.rst:2414 msgid "" "if ``False`` and there already exists a file with the given filename, then " "the function will raise a ``FileExistsError``. If it is ``True``, the file " "will be overwritten." msgstr "" -#: ../../library/turtle.rst:2417 +#: ../../library/turtle.rst:2419 msgid "" ">>> screen.save(\"my_drawing.ps\")\n" ">>> screen.save(\"my_drawing.ps\", overwrite=True)" @@ -3482,38 +3490,38 @@ msgstr "" ">>> screen.save(\"my_drawing.ps\")\n" ">>> screen.save(\"my_drawing.ps\", overwrite=True)" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2429 msgid "" "Set the size and position of the main window. Default values of arguments " "are stored in the configuration dictionary and can be changed via a :file:" "`turtle.cfg` file." msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2433 msgid "" "if an integer, a size in pixels, if a float, a fraction of the screen; " "default is 50% of screen" msgstr "" -#: ../../library/turtle.rst:2433 +#: ../../library/turtle.rst:2435 msgid "" "if an integer, the height in pixels, if a float, a fraction of the screen; " "default is 75% of screen" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2437 msgid "" "if positive, starting position in pixels from the left edge of the screen, " "if negative from the right edge, if ``None``, center window horizontally" msgstr "" -#: ../../library/turtle.rst:2438 +#: ../../library/turtle.rst:2440 msgid "" "if positive, starting position in pixels from the top edge of the screen, if " "negative from the bottom edge, if ``None``, center window vertically" msgstr "" -#: ../../library/turtle.rst:2442 +#: ../../library/turtle.rst:2444 msgid "" ">>> screen.setup (width=200, height=200, startx=0, starty=0)\n" ">>> # sets window to 200x200 pixels, in upper left of screen\n" @@ -3521,128 +3529,128 @@ msgid "" ">>> # sets window to 75% of screen by 50% of screen and centers" msgstr "" -#: ../../library/turtle.rst:2453 +#: ../../library/turtle.rst:2455 msgid "a string that is shown in the titlebar of the turtle graphics window" msgstr "" -#: ../../library/turtle.rst:2456 +#: ../../library/turtle.rst:2458 msgid "Set title of turtle window to *titlestring*." msgstr "" -#: ../../library/turtle.rst:2458 +#: ../../library/turtle.rst:2460 msgid ">>> screen.title(\"Welcome to the turtle zoo!\")" msgstr ">>> screen.title(\"Welcome to the turtle zoo!\")" -#: ../../library/turtle.rst:2465 +#: ../../library/turtle.rst:2467 msgid "Public classes" msgstr "" -#: ../../library/turtle.rst:2471 +#: ../../library/turtle.rst:2473 msgid "" "a :class:`!tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" -#: ../../library/turtle.rst:2474 +#: ../../library/turtle.rst:2476 msgid "" "Create a turtle. The turtle has all methods described above as \"methods of " "Turtle/RawTurtle\"." msgstr "" -#: ../../library/turtle.rst:2480 +#: ../../library/turtle.rst:2482 msgid "" "Subclass of RawTurtle, has the same interface but draws on a default :class:" "`Screen` object created automatically when needed for the first time." msgstr "" -#: ../../library/turtle.rst:2486 +#: ../../library/turtle.rst:2488 msgid "a :class:`!tkinter.Canvas`" msgstr "一個 :class:`!tkinter.Canvas`" -#: ../../library/turtle.rst:2488 +#: ../../library/turtle.rst:2490 msgid "" "Provides screen oriented methods like :func:`bgcolor` etc. that are " "described above." msgstr "" -#: ../../library/turtle.rst:2493 +#: ../../library/turtle.rst:2495 msgid "" "Subclass of TurtleScreen, with :ref:`four methods added `." msgstr "" -#: ../../library/turtle.rst:2498 +#: ../../library/turtle.rst:2500 msgid "" "some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas " "with scrollbars added" msgstr "" -#: ../../library/turtle.rst:2501 +#: ../../library/turtle.rst:2503 msgid "" "Used by class Screen, which thus automatically provides a ScrolledCanvas as " "playground for the turtles." msgstr "" -#: ../../library/turtle.rst:2506 +#: ../../library/turtle.rst:2508 msgid "one of the strings \"polygon\", \"image\", \"compound\"" msgstr "" -#: ../../library/turtle.rst:2508 +#: ../../library/turtle.rst:2510 msgid "" "Data structure modeling shapes. The pair ``(type_, data)`` must follow this " "specification:" msgstr "" -#: ../../library/turtle.rst:2513 +#: ../../library/turtle.rst:2515 msgid "*type_*" msgstr "*type_*" -#: ../../library/turtle.rst:2513 +#: ../../library/turtle.rst:2515 msgid "*data*" msgstr "*data*" -#: ../../library/turtle.rst:2515 +#: ../../library/turtle.rst:2517 msgid "\"polygon\"" msgstr "\"polygon\"" -#: ../../library/turtle.rst:2515 +#: ../../library/turtle.rst:2517 msgid "a polygon-tuple, i.e. a tuple of pairs of coordinates" msgstr "" -#: ../../library/turtle.rst:2516 +#: ../../library/turtle.rst:2518 msgid "\"image\"" msgstr "\"image\"" -#: ../../library/turtle.rst:2516 +#: ../../library/turtle.rst:2518 msgid "an image (in this form only used internally!)" msgstr "" -#: ../../library/turtle.rst:2517 +#: ../../library/turtle.rst:2519 msgid "\"compound\"" msgstr "\"compound\"" -#: ../../library/turtle.rst:2517 +#: ../../library/turtle.rst:2519 msgid "" "``None`` (a compound shape has to be constructed using the :meth:" "`addcomponent` method)" msgstr "" -#: ../../library/turtle.rst:2523 +#: ../../library/turtle.rst:2525 msgid "a polygon, i.e. a tuple of pairs of numbers" msgstr "" -#: ../../library/turtle.rst:2524 +#: ../../library/turtle.rst:2526 msgid "a color the *poly* will be filled with" msgstr "" -#: ../../library/turtle.rst:2525 +#: ../../library/turtle.rst:2527 msgid "a color for the poly's outline (if given)" msgstr "" -#: ../../library/turtle.rst:2527 +#: ../../library/turtle.rst:2529 msgid "Example:" msgstr "例如:" -#: ../../library/turtle.rst:2529 +#: ../../library/turtle.rst:2531 msgid "" ">>> poly = ((0,0),(10,-5),(0,10),(-10,-5))\n" ">>> s = Shape(\"compound\")\n" @@ -3650,63 +3658,63 @@ msgid "" ">>> # ... add more components and then use register_shape()" msgstr "" -#: ../../library/turtle.rst:2537 +#: ../../library/turtle.rst:2539 msgid "See :ref:`compoundshapes`." msgstr "請見\\ :ref:`compoundshapes`。" -#: ../../library/turtle.rst:2542 +#: ../../library/turtle.rst:2544 msgid "" "A two-dimensional vector class, used as a helper class for implementing " "turtle graphics. May be useful for turtle graphics programs too. Derived " "from tuple, so a vector is a tuple!" msgstr "" -#: ../../library/turtle.rst:2546 +#: ../../library/turtle.rst:2548 msgid "Provides (for *a*, *b* vectors, *k* number):" msgstr "" -#: ../../library/turtle.rst:2548 +#: ../../library/turtle.rst:2550 msgid "``a + b`` vector addition" msgstr "``a + b`` 向量加法" -#: ../../library/turtle.rst:2549 +#: ../../library/turtle.rst:2551 msgid "``a - b`` vector subtraction" msgstr "``a - b`` 向量減法" -#: ../../library/turtle.rst:2550 +#: ../../library/turtle.rst:2552 msgid "``a * b`` inner product" msgstr "``a * b`` 內積" -#: ../../library/turtle.rst:2551 +#: ../../library/turtle.rst:2553 msgid "``k * a`` and ``a * k`` multiplication with scalar" msgstr "" -#: ../../library/turtle.rst:2552 +#: ../../library/turtle.rst:2554 msgid "``abs(a)`` absolute value of a" msgstr "``abs(a)`` a 的絕對值" -#: ../../library/turtle.rst:2553 +#: ../../library/turtle.rst:2555 msgid "``a.rotate(angle)`` rotation" msgstr "``a.rotate(angle)`` 旋轉" -#: ../../library/turtle.rst:2559 +#: ../../library/turtle.rst:2561 msgid "Explanation" msgstr "解釋" -#: ../../library/turtle.rst:2561 +#: ../../library/turtle.rst:2563 msgid "" "A turtle object draws on a screen object, and there a number of key classes " "in the turtle object-oriented interface that can be used to create them and " "relate them to each other." msgstr "" -#: ../../library/turtle.rst:2565 +#: ../../library/turtle.rst:2567 msgid "" "A :class:`Turtle` instance will automatically create a :class:`Screen` " "instance if one is not already present." msgstr "" -#: ../../library/turtle.rst:2568 +#: ../../library/turtle.rst:2570 msgid "" "``Turtle`` is a subclass of :class:`RawTurtle`, which *doesn't* " "automatically create a drawing surface - a *canvas* will need to be provided " @@ -3714,7 +3722,7 @@ msgid "" "`ScrolledCanvas` or :class:`TurtleScreen`." msgstr "" -#: ../../library/turtle.rst:2574 +#: ../../library/turtle.rst:2576 msgid "" ":class:`TurtleScreen` is the basic drawing surface for a turtle. :class:" "`Screen` is a subclass of ``TurtleScreen``, and includes :ref:`some " @@ -3723,7 +3731,7 @@ msgid "" "`!tkinter.Canvas` or a :class:`ScrolledCanvas` as an argument." msgstr "" -#: ../../library/turtle.rst:2581 +#: ../../library/turtle.rst:2583 msgid "" "The functional interface for turtle graphics uses the various methods of " "``Turtle`` and ``TurtleScreen``/``Screen``. Behind the scenes, a screen " @@ -3732,38 +3740,38 @@ msgid "" "created whenever any of the functions derived from a Turtle method is called." msgstr "" -#: ../../library/turtle.rst:2587 +#: ../../library/turtle.rst:2589 msgid "" "To use multiple turtles on a screen, the object-oriented interface must be " "used." msgstr "" -#: ../../library/turtle.rst:2592 +#: ../../library/turtle.rst:2594 msgid "Help and configuration" msgstr "" -#: ../../library/turtle.rst:2595 +#: ../../library/turtle.rst:2597 msgid "How to use help" msgstr "" -#: ../../library/turtle.rst:2597 +#: ../../library/turtle.rst:2599 msgid "" "The public methods of the Screen and Turtle classes are documented " "extensively via docstrings. So these can be used as online-help via the " "Python help facilities:" msgstr "" -#: ../../library/turtle.rst:2601 +#: ../../library/turtle.rst:2603 msgid "" "When using IDLE, tooltips show the signatures and first lines of the " "docstrings of typed in function-/method calls." msgstr "" -#: ../../library/turtle.rst:2604 +#: ../../library/turtle.rst:2606 msgid "Calling :func:`help` on methods or functions displays the docstrings::" msgstr "" -#: ../../library/turtle.rst:2606 +#: ../../library/turtle.rst:2608 msgid "" ">>> help(Screen.bgcolor)\n" "Help on method bgcolor in module turtle:\n" @@ -3823,13 +3831,13 @@ msgstr "" "\n" " >>> turtle.penup()" -#: ../../library/turtle.rst:2635 +#: ../../library/turtle.rst:2637 msgid "" "The docstrings of the functions which are derived from methods have a " "modified form::" msgstr "" -#: ../../library/turtle.rst:2638 +#: ../../library/turtle.rst:2640 msgid "" ">>> help(bgcolor)\n" "Help on function bgcolor in module turtle:\n" @@ -3893,28 +3901,28 @@ msgstr "" " Example:\n" " >>> penup()" -#: ../../library/turtle.rst:2669 +#: ../../library/turtle.rst:2671 msgid "" "These modified docstrings are created automatically together with the " "function definitions that are derived from the methods at import time." msgstr "" -#: ../../library/turtle.rst:2674 +#: ../../library/turtle.rst:2676 msgid "Translation of docstrings into different languages" msgstr "" -#: ../../library/turtle.rst:2676 +#: ../../library/turtle.rst:2678 msgid "" "There is a utility to create a dictionary the keys of which are the method " "names and the values of which are the docstrings of the public methods of " "the classes Screen and Turtle." msgstr "" -#: ../../library/turtle.rst:2682 +#: ../../library/turtle.rst:2684 msgid "a string, used as filename" msgstr "" -#: ../../library/turtle.rst:2684 +#: ../../library/turtle.rst:2686 msgid "" "Create and write docstring-dictionary to a Python script with the given " "filename. This function has to be called explicitly (it is not used by the " @@ -3923,37 +3931,37 @@ msgid "" "for translation of the docstrings into different languages." msgstr "" -#: ../../library/turtle.rst:2690 +#: ../../library/turtle.rst:2692 msgid "" "If you (or your students) want to use :mod:`turtle` with online help in your " "native language, you have to translate the docstrings and save the resulting " "file as e.g. :file:`turtle_docstringdict_german.py`." msgstr "" -#: ../../library/turtle.rst:2694 +#: ../../library/turtle.rst:2696 msgid "" "If you have an appropriate entry in your :file:`turtle.cfg` file this " "dictionary will be read in at import time and will replace the original " "English docstrings." msgstr "" -#: ../../library/turtle.rst:2697 +#: ../../library/turtle.rst:2699 msgid "" "At the time of this writing there are docstring dictionaries in German and " "in Italian. (Requests please to glingl@aon.at.)" msgstr "" -#: ../../library/turtle.rst:2703 +#: ../../library/turtle.rst:2705 msgid "How to configure Screen and Turtles" msgstr "" -#: ../../library/turtle.rst:2705 +#: ../../library/turtle.rst:2707 msgid "" "The built-in default configuration mimics the appearance and behaviour of " "the old turtle module in order to retain best possible compatibility with it." msgstr "" -#: ../../library/turtle.rst:2708 +#: ../../library/turtle.rst:2710 msgid "" "If you want to use a different configuration which better reflects the " "features of this module or which better fits to your needs, e.g. for use in " @@ -3962,12 +3970,12 @@ msgid "" "settings." msgstr "" -#: ../../library/turtle.rst:2713 +#: ../../library/turtle.rst:2715 msgid "" "The built in configuration would correspond to the following ``turtle.cfg``:" msgstr "" -#: ../../library/turtle.rst:2715 +#: ../../library/turtle.rst:2717 msgid "" "width = 0.5\n" "height = 0.75\n" @@ -4011,49 +4019,49 @@ msgstr "" "title = Python Turtle Graphics\n" "using_IDLE = False" -#: ../../library/turtle.rst:2738 +#: ../../library/turtle.rst:2740 msgid "Short explanation of selected entries:" msgstr "" -#: ../../library/turtle.rst:2740 +#: ../../library/turtle.rst:2742 msgid "" "The first four lines correspond to the arguments of the :func:`Screen.setup " "` method." msgstr "" -#: ../../library/turtle.rst:2742 +#: ../../library/turtle.rst:2744 msgid "" "Line 5 and 6 correspond to the arguments of the method :func:`Screen." "screensize `." msgstr "" -#: ../../library/turtle.rst:2744 +#: ../../library/turtle.rst:2746 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: ../../library/turtle.rst:2746 +#: ../../library/turtle.rst:2748 msgid "" "If you want to use no fill color (i.e. make the turtle transparent), you " "have to write ``fillcolor = \"\"`` (but all nonempty strings must not have " "quotes in the cfg file)." msgstr "" -#: ../../library/turtle.rst:2749 +#: ../../library/turtle.rst:2751 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: ../../library/turtle.rst:2751 +#: ../../library/turtle.rst:2753 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`)." msgstr "" -#: ../../library/turtle.rst:2754 +#: ../../library/turtle.rst:2756 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -4061,309 +4069,309 @@ msgid "" "docstrings." msgstr "" -#: ../../library/turtle.rst:2758 +#: ../../library/turtle.rst:2760 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its " "``-n`` switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: ../../library/turtle.rst:2762 +#: ../../library/turtle.rst:2764 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: ../../library/turtle.rst:2766 +#: ../../library/turtle.rst:2768 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: ../../library/turtle.rst:2772 +#: ../../library/turtle.rst:2774 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: ../../library/turtle.rst:2777 +#: ../../library/turtle.rst:2779 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: ../../library/turtle.rst:2780 +#: ../../library/turtle.rst:2782 msgid "python -m turtledemo" msgstr "python -m turtledemo" -#: ../../library/turtle.rst:2782 +#: ../../library/turtle.rst:2784 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: ../../library/turtle.rst:2784 +#: ../../library/turtle.rst:2786 msgid "python -m turtledemo.bytedesign" msgstr "python -m turtledemo.bytedesign" -#: ../../library/turtle.rst:2786 +#: ../../library/turtle.rst:2788 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2788 +#: ../../library/turtle.rst:2790 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: ../../library/turtle.rst:2790 +#: ../../library/turtle.rst:2792 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: ../../library/turtle.rst:2793 +#: ../../library/turtle.rst:2795 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: ../../library/turtle.rst:2796 +#: ../../library/turtle.rst:2798 msgid "The demo scripts are:" msgstr "" -#: ../../library/turtle.rst:2803 +#: ../../library/turtle.rst:2805 msgid "Name" msgstr "" -#: ../../library/turtle.rst:2803 +#: ../../library/turtle.rst:2805 msgid "Description" msgstr "描述" -#: ../../library/turtle.rst:2803 +#: ../../library/turtle.rst:2805 msgid "Features" msgstr "" -#: ../../library/turtle.rst:2805 +#: ../../library/turtle.rst:2807 msgid "bytedesign" msgstr "" -#: ../../library/turtle.rst:2805 +#: ../../library/turtle.rst:2807 msgid "complex classical turtle graphics pattern" msgstr "" -#: ../../library/turtle.rst:2805 +#: ../../library/turtle.rst:2807 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: ../../library/turtle.rst:2808 +#: ../../library/turtle.rst:2810 msgid "chaos" msgstr "" -#: ../../library/turtle.rst:2808 +#: ../../library/turtle.rst:2810 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: ../../library/turtle.rst:2808 +#: ../../library/turtle.rst:2810 msgid "world coordinates" msgstr "" -#: ../../library/turtle.rst:2814 +#: ../../library/turtle.rst:2816 msgid "clock" msgstr "" -#: ../../library/turtle.rst:2814 +#: ../../library/turtle.rst:2816 msgid "analog clock showing time of your computer" msgstr "" -#: ../../library/turtle.rst:2814 +#: ../../library/turtle.rst:2816 msgid "turtles as clock's hands, ontimer" msgstr "" -#: ../../library/turtle.rst:2817 +#: ../../library/turtle.rst:2819 msgid "colormixer" msgstr "" -#: ../../library/turtle.rst:2817 +#: ../../library/turtle.rst:2819 msgid "experiment with r, g, b" msgstr "" -#: ../../library/turtle.rst:2819 +#: ../../library/turtle.rst:2821 msgid "forest" msgstr "" -#: ../../library/turtle.rst:2819 +#: ../../library/turtle.rst:2821 msgid "3 breadth-first trees" msgstr "" -#: ../../library/turtle.rst:2819 +#: ../../library/turtle.rst:2821 msgid "randomization" msgstr "" -#: ../../library/turtle.rst:2821 +#: ../../library/turtle.rst:2823 msgid "fractalcurves" msgstr "" -#: ../../library/turtle.rst:2821 +#: ../../library/turtle.rst:2823 msgid "Hilbert & Koch curves" msgstr "" -#: ../../library/turtle.rst:2821 +#: ../../library/turtle.rst:2823 msgid "recursion" msgstr "" -#: ../../library/turtle.rst:2823 +#: ../../library/turtle.rst:2825 msgid "lindenmayer" msgstr "" -#: ../../library/turtle.rst:2823 +#: ../../library/turtle.rst:2825 msgid "ethnomathematics (indian kolams)" msgstr "" -#: ../../library/turtle.rst:2823 +#: ../../library/turtle.rst:2825 msgid "L-System" msgstr "" -#: ../../library/turtle.rst:2826 +#: ../../library/turtle.rst:2828 msgid "minimal_hanoi" msgstr "minimal_hanoi" -#: ../../library/turtle.rst:2826 +#: ../../library/turtle.rst:2828 msgid "Towers of Hanoi" msgstr "河內塔" -#: ../../library/turtle.rst:2826 +#: ../../library/turtle.rst:2828 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: ../../library/turtle.rst:2830 +#: ../../library/turtle.rst:2832 msgid "nim" msgstr "nim" -#: ../../library/turtle.rst:2830 +#: ../../library/turtle.rst:2832 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: ../../library/turtle.rst:2830 +#: ../../library/turtle.rst:2832 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: ../../library/turtle.rst:2834 +#: ../../library/turtle.rst:2836 msgid "paint" msgstr "" -#: ../../library/turtle.rst:2834 +#: ../../library/turtle.rst:2836 msgid "super minimalistic drawing program" msgstr "" -#: ../../library/turtle.rst:2837 +#: ../../library/turtle.rst:2839 msgid "peace" msgstr "" -#: ../../library/turtle.rst:2837 +#: ../../library/turtle.rst:2839 msgid "elementary" msgstr "" -#: ../../library/turtle.rst:2837 +#: ../../library/turtle.rst:2839 msgid "turtle: appearance and animation" msgstr "" -#: ../../library/turtle.rst:2840 +#: ../../library/turtle.rst:2842 msgid "penrose" msgstr "" -#: ../../library/turtle.rst:2840 +#: ../../library/turtle.rst:2842 msgid "aperiodic tiling with kites and darts" msgstr "" -#: ../../library/turtle.rst:2843 +#: ../../library/turtle.rst:2845 msgid "planet_and_moon" msgstr "planet_and_moon" -#: ../../library/turtle.rst:2843 +#: ../../library/turtle.rst:2845 msgid "simulation of gravitational system" msgstr "" -#: ../../library/turtle.rst:2843 +#: ../../library/turtle.rst:2845 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: ../../library/turtle.rst:2846 +#: ../../library/turtle.rst:2848 msgid "rosette" msgstr "" -#: ../../library/turtle.rst:2846 +#: ../../library/turtle.rst:2848 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: ../../library/turtle.rst:2846 +#: ../../library/turtle.rst:2848 msgid ":func:`clone`, :func:`undo`" msgstr ":func:`clone`, :func:`undo`" -#: ../../library/turtle.rst:2849 +#: ../../library/turtle.rst:2851 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2849 +#: ../../library/turtle.rst:2851 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2849 +#: ../../library/turtle.rst:2851 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2853 +#: ../../library/turtle.rst:2855 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2853 +#: ../../library/turtle.rst:2855 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2853 +#: ../../library/turtle.rst:2855 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2856 +#: ../../library/turtle.rst:2858 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2856 +#: ../../library/turtle.rst:2858 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2859 +#: ../../library/turtle.rst:2861 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2859 +#: ../../library/turtle.rst:2861 msgid "simple design" msgstr "" -#: ../../library/turtle.rst:2859 +#: ../../library/turtle.rst:2861 msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2862 +#: ../../library/turtle.rst:2864 msgid "yinyang" msgstr "" -#: ../../library/turtle.rst:2862 +#: ../../library/turtle.rst:2864 msgid "another elementary example" msgstr "" -#: ../../library/turtle.rst:2865 +#: ../../library/turtle.rst:2867 msgid "Have fun!" msgstr "" -#: ../../library/turtle.rst:2869 +#: ../../library/turtle.rst:2871 msgid "Changes since Python 2.6" msgstr "" -#: ../../library/turtle.rst:2871 +#: ../../library/turtle.rst:2873 msgid "" "The methods :func:`Turtle.tracer `, :func:`Turtle.window_width " "` and :func:`Turtle.window_height ` have been " @@ -4374,14 +4382,14 @@ msgid "" "methods.)" msgstr "" -#: ../../library/turtle.rst:2879 +#: ../../library/turtle.rst:2881 msgid "" "The method :func:`!Turtle.fill` has been eliminated. The behaviour of :func:" "`begin_fill` and :func:`end_fill` have changed slightly: now every filling " "process must be completed with an ``end_fill()`` call." msgstr "" -#: ../../library/turtle.rst:2884 +#: ../../library/turtle.rst:2886 msgid "" "A method :func:`Turtle.filling ` has been added. It returns a " "boolean value: ``True`` if a filling process is under way, ``False`` " @@ -4389,11 +4397,11 @@ msgid "" "in Python 2.6." msgstr "" -#: ../../library/turtle.rst:2890 +#: ../../library/turtle.rst:2892 msgid "Changes since Python 3.0" msgstr "" -#: ../../library/turtle.rst:2892 +#: ../../library/turtle.rst:2894 msgid "" "The :class:`Turtle` methods :func:`shearfactor`, :func:`shapetransform` and :" "func:`get_shapepoly` have been added. Thus the full range of regular linear " @@ -4402,21 +4410,21 @@ msgid "" "set the tilt angle." msgstr "" -#: ../../library/turtle.rst:2898 +#: ../../library/turtle.rst:2900 msgid "" "The :class:`Screen` method :func:`onkeypress` has been added as a complement " "to :func:`onkey`. As the latter binds actions to the key release event, an " "alias: :func:`onkeyrelease` was also added for it." msgstr "" -#: ../../library/turtle.rst:2902 +#: ../../library/turtle.rst:2904 msgid "" "The method :func:`Screen.mainloop ` has been added, so there is no " "longer a need to use the standalone :func:`mainloop` function when working " "with :class:`Screen` and :class:`Turtle` objects." msgstr "" -#: ../../library/turtle.rst:2906 +#: ../../library/turtle.rst:2908 msgid "" "Two input methods have been added: :func:`Screen.textinput ` and :" "func:`Screen.numinput `. These pop up input dialogs and return " diff --git a/library/winreg.po b/library/winreg.po index 044a32cdf8e..34bb21cb7b4 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 00:16+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,56 +29,60 @@ msgid "" "neglects to explicitly close them." msgstr "" -#: ../../library/winreg.rst:19 +#: ../../library/winreg.rst:17 +msgid "Availability" +msgstr "" + +#: ../../library/winreg.rst:21 msgid "" "Several functions in this module used to raise a :exc:`WindowsError`, which " "is now an alias of :exc:`OSError`." msgstr "" -#: ../../library/winreg.rst:26 +#: ../../library/winreg.rst:28 msgid "Functions" msgstr "函式" -#: ../../library/winreg.rst:28 +#: ../../library/winreg.rst:30 msgid "This module offers the following functions:" msgstr "" -#: ../../library/winreg.rst:33 +#: ../../library/winreg.rst:35 msgid "" "Closes a previously opened registry key. The *hkey* argument specifies a " "previously opened key." msgstr "" -#: ../../library/winreg.rst:38 +#: ../../library/winreg.rst:40 msgid "" "If *hkey* is not closed using this method (or via :meth:`hkey.Close() " "`), it is closed when the *hkey* object is destroyed by Python." msgstr "" -#: ../../library/winreg.rst:45 +#: ../../library/winreg.rst:47 msgid "" "Establishes a connection to a predefined registry handle on another " "computer, and returns a :ref:`handle object `." msgstr "" -#: ../../library/winreg.rst:48 +#: ../../library/winreg.rst:50 msgid "" "*computer_name* is the name of the remote computer, of the form ``r\"\\" "\\computername\"``. If ``None``, the local computer is used." msgstr "" -#: ../../library/winreg.rst:51 +#: ../../library/winreg.rst:53 msgid "*key* is the predefined handle to connect to." msgstr "" -#: ../../library/winreg.rst:53 ../../library/winreg.rst:77 -#: ../../library/winreg.rst:109 +#: ../../library/winreg.rst:55 ../../library/winreg.rst:79 +#: ../../library/winreg.rst:111 msgid "" "The return value is the handle of the opened key. If the function fails, an :" "exc:`OSError` exception is raised." msgstr "" -#: ../../library/winreg.rst:56 +#: ../../library/winreg.rst:58 msgid "" "Raises an :ref:`auditing event ` ``winreg.ConnectRegistry`` with " "arguments ``computer_name``, ``key``." @@ -86,48 +90,48 @@ msgstr "" "引發一個附帶引數 ``computer_name``、``key`` 的\\ :ref:`稽核事件 ` " "``winreg.ConnectRegistry``。" -#: ../../library/winreg.rst:58 ../../library/winreg.rst:84 -#: ../../library/winreg.rst:118 ../../library/winreg.rst:139 -#: ../../library/winreg.rst:172 ../../library/winreg.rst:203 -#: ../../library/winreg.rst:238 ../../library/winreg.rst:329 +#: ../../library/winreg.rst:60 ../../library/winreg.rst:86 +#: ../../library/winreg.rst:120 ../../library/winreg.rst:141 +#: ../../library/winreg.rst:174 ../../library/winreg.rst:205 +#: ../../library/winreg.rst:240 ../../library/winreg.rst:331 msgid "See :ref:`above `." msgstr "" -#: ../../library/winreg.rst:64 ../../library/winreg.rst:90 +#: ../../library/winreg.rst:66 ../../library/winreg.rst:92 msgid "" "Creates or opens the specified key, returning a :ref:`handle object `." msgstr "" -#: ../../library/winreg.rst:67 ../../library/winreg.rst:93 -#: ../../library/winreg.rst:126 ../../library/winreg.rst:147 -#: ../../library/winreg.rst:180 ../../library/winreg.rst:192 -#: ../../library/winreg.rst:211 ../../library/winreg.rst:260 -#: ../../library/winreg.rst:307 ../../library/winreg.rst:337 -#: ../../library/winreg.rst:363 ../../library/winreg.rst:383 -#: ../../library/winreg.rst:407 ../../library/winreg.rst:432 -#: ../../library/winreg.rst:460 ../../library/winreg.rst:491 -#: ../../library/winreg.rst:508 ../../library/winreg.rst:523 +#: ../../library/winreg.rst:69 ../../library/winreg.rst:95 +#: ../../library/winreg.rst:128 ../../library/winreg.rst:149 +#: ../../library/winreg.rst:182 ../../library/winreg.rst:194 +#: ../../library/winreg.rst:213 ../../library/winreg.rst:262 +#: ../../library/winreg.rst:309 ../../library/winreg.rst:339 +#: ../../library/winreg.rst:365 ../../library/winreg.rst:385 +#: ../../library/winreg.rst:409 ../../library/winreg.rst:434 +#: ../../library/winreg.rst:462 ../../library/winreg.rst:493 +#: ../../library/winreg.rst:510 ../../library/winreg.rst:525 msgid "" "*key* is an already open key, or one of the predefined :ref:`HKEY_* " "constants `." msgstr "" -#: ../../library/winreg.rst:70 ../../library/winreg.rst:96 +#: ../../library/winreg.rst:72 ../../library/winreg.rst:98 msgid "*sub_key* is a string that names the key this method opens or creates." msgstr "" -#: ../../library/winreg.rst:72 ../../library/winreg.rst:104 +#: ../../library/winreg.rst:74 ../../library/winreg.rst:106 msgid "" "If *key* is one of the predefined keys, *sub_key* may be ``None``. In that " "case, the handle returned is the same key handle passed in to the function." msgstr "" -#: ../../library/winreg.rst:75 ../../library/winreg.rst:107 +#: ../../library/winreg.rst:77 ../../library/winreg.rst:109 msgid "If the key already exists, this function opens the existing key." msgstr "" -#: ../../library/winreg.rst:80 ../../library/winreg.rst:112 +#: ../../library/winreg.rst:82 ../../library/winreg.rst:114 msgid "" "Raises an :ref:`auditing event ` ``winreg.CreateKey`` with " "arguments ``key``, ``sub_key``, ``access``." @@ -135,8 +139,8 @@ msgstr "" "引發一個附帶引數 ``key``、``sub_key``、``access`` 的\\ :ref:`稽核事件 " "` ``winreg.CreateKey``。" -#: ../../library/winreg.rst:82 ../../library/winreg.rst:114 -#: ../../library/winreg.rst:324 +#: ../../library/winreg.rst:84 ../../library/winreg.rst:116 +#: ../../library/winreg.rst:326 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey/result`` with " "argument ``key``." @@ -144,40 +148,40 @@ msgstr "" "引發一個附帶引數 ``key`` 的\\ :ref:`稽核事件 ` ``winreg.OpenKey/" "result``。" -#: ../../library/winreg.rst:98 ../../library/winreg.rst:154 +#: ../../library/winreg.rst:100 ../../library/winreg.rst:156 msgid "" "*reserved* is a reserved integer, and must be zero. The default is zero." msgstr "" -#: ../../library/winreg.rst:100 +#: ../../library/winreg.rst:102 msgid "" "*access* is an integer that specifies an access mask that describes the " "desired security access for the key. Default is :const:`KEY_WRITE`. See :" "ref:`Access Rights ` for other allowed values." msgstr "" -#: ../../library/winreg.rst:124 ../../library/winreg.rst:145 +#: ../../library/winreg.rst:126 ../../library/winreg.rst:147 msgid "Deletes the specified key." msgstr "" -#: ../../library/winreg.rst:129 +#: ../../library/winreg.rst:131 msgid "" "*sub_key* is a string that must be a subkey of the key identified by the " "*key* parameter. This value must not be ``None``, and the key may not have " "subkeys." msgstr "" -#: ../../library/winreg.rst:132 ../../library/winreg.rst:161 +#: ../../library/winreg.rst:134 ../../library/winreg.rst:163 msgid "*This method can not delete keys with subkeys.*" msgstr "" -#: ../../library/winreg.rst:134 ../../library/winreg.rst:163 +#: ../../library/winreg.rst:136 ../../library/winreg.rst:165 msgid "" "If the method succeeds, the entire key, including all of its values, is " "removed. If the method fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/winreg.rst:137 ../../library/winreg.rst:168 +#: ../../library/winreg.rst:139 ../../library/winreg.rst:170 msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteKey`` with " "arguments ``key``, ``sub_key``, ``access``." @@ -185,14 +189,14 @@ msgstr "" "引發一個附帶引數 ``key``、``sub_key``、``access`` 的\\ :ref:`稽核事件 " "` ``winreg.DeleteKey``。" -#: ../../library/winreg.rst:150 +#: ../../library/winreg.rst:152 msgid "" "*sub_key* is a string that must be a subkey of the key identified by the " "*key* parameter. This value must not be ``None``, and the key may not have " "subkeys." msgstr "" -#: ../../library/winreg.rst:156 +#: ../../library/winreg.rst:158 msgid "" "*access* is an integer that specifies an access mask that describes the " "desired security access for the key. Default is :const:`KEY_WOW64_64KEY`. " @@ -200,19 +204,19 @@ msgid "" "` for other allowed values." msgstr "" -#: ../../library/winreg.rst:166 +#: ../../library/winreg.rst:168 msgid "On unsupported Windows versions, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/winreg.rst:178 +#: ../../library/winreg.rst:180 msgid "Removes a named value from a registry key." msgstr "" -#: ../../library/winreg.rst:183 +#: ../../library/winreg.rst:185 msgid "*value* is a string that identifies the value to remove." msgstr "" -#: ../../library/winreg.rst:185 +#: ../../library/winreg.rst:187 msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteValue`` with " "arguments ``key``, ``value``." @@ -220,22 +224,22 @@ msgstr "" "引發一個附帶引數 ``key``、``value`` 的\\ :ref:`稽核事件 ` ``winreg." "DeleteValue``。" -#: ../../library/winreg.rst:190 +#: ../../library/winreg.rst:192 msgid "Enumerates subkeys of an open registry key, returning a string." msgstr "" -#: ../../library/winreg.rst:195 +#: ../../library/winreg.rst:197 msgid "*index* is an integer that identifies the index of the key to retrieve." msgstr "" -#: ../../library/winreg.rst:197 +#: ../../library/winreg.rst:199 msgid "" "The function retrieves the name of one subkey each time it is called. It is " "typically called repeatedly until an :exc:`OSError` exception is raised, " "indicating, no more values are available." msgstr "" -#: ../../library/winreg.rst:201 +#: ../../library/winreg.rst:203 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumKey`` with arguments " "``key``, ``index``." @@ -243,67 +247,67 @@ msgstr "" "引發一個附帶引數 ``key``、``index`` 的\\ :ref:`稽核事件 ` ``winreg." "EnumKey``。" -#: ../../library/winreg.rst:209 +#: ../../library/winreg.rst:211 msgid "Enumerates values of an open registry key, returning a tuple." msgstr "" -#: ../../library/winreg.rst:214 +#: ../../library/winreg.rst:216 msgid "" "*index* is an integer that identifies the index of the value to retrieve." msgstr "" -#: ../../library/winreg.rst:216 +#: ../../library/winreg.rst:218 msgid "" "The function retrieves the name of one subkey each time it is called. It is " "typically called repeatedly, until an :exc:`OSError` exception is raised, " "indicating no more values." msgstr "" -#: ../../library/winreg.rst:220 ../../library/winreg.rst:340 +#: ../../library/winreg.rst:222 ../../library/winreg.rst:342 msgid "The result is a tuple of 3 items:" msgstr "" -#: ../../library/winreg.rst:223 ../../library/winreg.rst:343 -#: ../../library/winreg.rst:391 +#: ../../library/winreg.rst:225 ../../library/winreg.rst:345 +#: ../../library/winreg.rst:393 msgid "Index" msgstr "" -#: ../../library/winreg.rst:223 ../../library/winreg.rst:343 -#: ../../library/winreg.rst:391 +#: ../../library/winreg.rst:225 ../../library/winreg.rst:345 +#: ../../library/winreg.rst:393 msgid "Meaning" msgstr "含義" -#: ../../library/winreg.rst:225 ../../library/winreg.rst:345 -#: ../../library/winreg.rst:393 +#: ../../library/winreg.rst:227 ../../library/winreg.rst:347 +#: ../../library/winreg.rst:395 msgid "``0``" msgstr "``0``" -#: ../../library/winreg.rst:225 +#: ../../library/winreg.rst:227 msgid "A string that identifies the value name" msgstr "" -#: ../../library/winreg.rst:227 ../../library/winreg.rst:348 -#: ../../library/winreg.rst:395 +#: ../../library/winreg.rst:229 ../../library/winreg.rst:350 +#: ../../library/winreg.rst:397 msgid "``1``" msgstr "``1``" -#: ../../library/winreg.rst:227 +#: ../../library/winreg.rst:229 msgid "" "An object that holds the value data, and whose type depends on the " "underlying registry type" msgstr "" -#: ../../library/winreg.rst:231 ../../library/winreg.rst:351 +#: ../../library/winreg.rst:233 ../../library/winreg.rst:353 msgid "``2``" msgstr "``2``" -#: ../../library/winreg.rst:231 +#: ../../library/winreg.rst:233 msgid "" "An integer that identifies the type of the value data (see table in docs " "for :meth:`SetValueEx`)" msgstr "" -#: ../../library/winreg.rst:236 +#: ../../library/winreg.rst:238 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumValue`` with " "arguments ``key``, ``index``." @@ -311,13 +315,13 @@ msgstr "" "引發一個附帶引數 ``key``、``index`` 的\\ :ref:`稽核事件 ` ``winreg." "EnumValue``。" -#: ../../library/winreg.rst:247 +#: ../../library/winreg.rst:249 msgid "" "Expands environment variable placeholders ``%NAME%`` in strings like :const:" "`REG_EXPAND_SZ`::" msgstr "" -#: ../../library/winreg.rst:250 +#: ../../library/winreg.rst:252 msgid "" ">>> ExpandEnvironmentStrings('%windir%')\n" "'C:\\\\Windows'" @@ -325,7 +329,7 @@ msgstr "" ">>> ExpandEnvironmentStrings('%windir%')\n" "'C:\\\\Windows'" -#: ../../library/winreg.rst:253 +#: ../../library/winreg.rst:255 msgid "" "Raises an :ref:`auditing event ` ``winreg." "ExpandEnvironmentStrings`` with argument ``str``." @@ -333,11 +337,11 @@ msgstr "" "引發一個附帶引數 ``str`` 的\\ :ref:`稽核事件 ` ``winreg." "ExpandEnvironmentStrings``。" -#: ../../library/winreg.rst:258 +#: ../../library/winreg.rst:260 msgid "Writes all the attributes of a key to the registry." msgstr "" -#: ../../library/winreg.rst:263 +#: ../../library/winreg.rst:265 msgid "" "It is not necessary to call :func:`FlushKey` to change a key. Registry " "changes are flushed to disk by the registry using its lazy flusher. " @@ -348,36 +352,36 @@ msgid "" "disk." msgstr "" -#: ../../library/winreg.rst:272 +#: ../../library/winreg.rst:274 msgid "" "If you don't know whether a :func:`FlushKey` call is required, it probably " "isn't." msgstr "" -#: ../../library/winreg.rst:278 +#: ../../library/winreg.rst:280 msgid "" "Creates a subkey under the specified key and stores registration information " "from a specified file into that subkey." msgstr "" -#: ../../library/winreg.rst:281 +#: ../../library/winreg.rst:283 msgid "" "*key* is a handle returned by :func:`ConnectRegistry` or one of the " "constants :const:`HKEY_USERS` or :const:`HKEY_LOCAL_MACHINE`." msgstr "" -#: ../../library/winreg.rst:284 +#: ../../library/winreg.rst:286 msgid "*sub_key* is a string that identifies the subkey to load." msgstr "" -#: ../../library/winreg.rst:286 +#: ../../library/winreg.rst:288 msgid "" "*file_name* is the name of the file to load registry data from. This file " "must have been created with the :func:`SaveKey` function. Under the file " "allocation table (FAT) file system, the filename may not have an extension." msgstr "" -#: ../../library/winreg.rst:290 +#: ../../library/winreg.rst:292 msgid "" "A call to :func:`LoadKey` fails if the calling process does not have the :c:" "data:`!SE_RESTORE_PRIVILEGE` privilege. Note that privileges are different " @@ -385,13 +389,13 @@ msgid "" "microsoft.com/en-us/library/ms724889%28v=VS.85%29.aspx>`__ for more details." msgstr "" -#: ../../library/winreg.rst:296 +#: ../../library/winreg.rst:298 msgid "" "If *key* is a handle returned by :func:`ConnectRegistry`, then the path " "specified in *file_name* is relative to the remote computer." msgstr "" -#: ../../library/winreg.rst:299 +#: ../../library/winreg.rst:301 msgid "" "Raises an :ref:`auditing event ` ``winreg.LoadKey`` with arguments " "``key``, ``sub_key``, ``file_name``." @@ -399,36 +403,36 @@ msgstr "" "引發一個附帶引數 ``key``、``sub_key``、``file_name`` 的\\ :ref:`稽核事件 " "` ``winreg.LoadKey``。" -#: ../../library/winreg.rst:305 +#: ../../library/winreg.rst:307 msgid "" "Opens the specified key, returning a :ref:`handle object `." msgstr "" -#: ../../library/winreg.rst:310 +#: ../../library/winreg.rst:312 msgid "*sub_key* is a string that identifies the sub_key to open." msgstr "" -#: ../../library/winreg.rst:312 +#: ../../library/winreg.rst:314 msgid "" "*reserved* is a reserved integer, and must be zero. The default is zero." msgstr "" -#: ../../library/winreg.rst:314 +#: ../../library/winreg.rst:316 msgid "" "*access* is an integer that specifies an access mask that describes the " "desired security access for the key. Default is :const:`KEY_READ`. See :" "ref:`Access Rights ` for other allowed values." msgstr "" -#: ../../library/winreg.rst:318 +#: ../../library/winreg.rst:320 msgid "The result is a new handle to the specified key." msgstr "" -#: ../../library/winreg.rst:320 +#: ../../library/winreg.rst:322 msgid "If the function fails, :exc:`OSError` is raised." msgstr "" -#: ../../library/winreg.rst:322 +#: ../../library/winreg.rst:324 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey`` with arguments " "``key``, ``sub_key``, ``access``." @@ -436,29 +440,29 @@ msgstr "" "引發一個附帶引數 ``key``、``sub_key``、``access`` 的\\ :ref:`稽核事件 " "` ``winreg.OpenKey``。" -#: ../../library/winreg.rst:326 +#: ../../library/winreg.rst:328 msgid "Allow the use of named arguments." msgstr "" -#: ../../library/winreg.rst:335 +#: ../../library/winreg.rst:337 msgid "Returns information about a key, as a tuple." msgstr "" -#: ../../library/winreg.rst:345 +#: ../../library/winreg.rst:347 msgid "An integer giving the number of sub keys this key has." msgstr "" -#: ../../library/winreg.rst:348 +#: ../../library/winreg.rst:350 msgid "An integer giving the number of values this key has." msgstr "" -#: ../../library/winreg.rst:351 +#: ../../library/winreg.rst:353 msgid "" "An integer giving when the key was last modified (if available) as 100's of " "nanoseconds since Jan 1, 1601." msgstr "" -#: ../../library/winreg.rst:356 +#: ../../library/winreg.rst:358 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryInfoKey`` with " "argument ``key``." @@ -466,11 +470,11 @@ msgstr "" "引發一個附帶引數 ``key`` 的\\ :ref:`稽核事件 ` ``winreg." "QueryInfoKey``。" -#: ../../library/winreg.rst:361 +#: ../../library/winreg.rst:363 msgid "Retrieves the unnamed value for a key, as a string." msgstr "" -#: ../../library/winreg.rst:366 +#: ../../library/winreg.rst:368 msgid "" "*sub_key* is a string that holds the name of the subkey with which the value " "is associated. If this parameter is ``None`` or empty, the function " @@ -478,7 +482,7 @@ msgid "" "identified by *key*." msgstr "" -#: ../../library/winreg.rst:370 +#: ../../library/winreg.rst:372 msgid "" "Values in the registry have name, type, and data components. This method " "retrieves the data for a key's first value that has a ``NULL`` name. But the " @@ -486,7 +490,7 @@ msgid "" "`QueryValueEx` if possible." msgstr "" -#: ../../library/winreg.rst:375 ../../library/winreg.rst:400 +#: ../../library/winreg.rst:377 ../../library/winreg.rst:402 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryValue`` with " "arguments ``key``, ``sub_key``, ``value_name``." @@ -494,35 +498,35 @@ msgstr "" "引發一個附帶引數 ``key``、``sub_key``、``value_name`` 的\\ :ref:`稽核事件 " "` ``winreg.QueryKey``。" -#: ../../library/winreg.rst:380 +#: ../../library/winreg.rst:382 msgid "" "Retrieves the type and data for a specified value name associated with an " "open registry key." msgstr "" -#: ../../library/winreg.rst:386 +#: ../../library/winreg.rst:388 msgid "*value_name* is a string indicating the value to query." msgstr "" -#: ../../library/winreg.rst:388 +#: ../../library/winreg.rst:390 msgid "The result is a tuple of 2 items:" msgstr "" -#: ../../library/winreg.rst:393 +#: ../../library/winreg.rst:395 msgid "The value of the registry item." msgstr "" -#: ../../library/winreg.rst:395 +#: ../../library/winreg.rst:397 msgid "" "An integer giving the registry type for this value (see table in docs for :" "meth:`SetValueEx`)" msgstr "" -#: ../../library/winreg.rst:405 +#: ../../library/winreg.rst:407 msgid "Saves the specified key, and all its subkeys to the specified file." msgstr "" -#: ../../library/winreg.rst:410 +#: ../../library/winreg.rst:412 msgid "" "*file_name* is the name of the file to save registry data to. This file " "cannot already exist. If this filename includes an extension, it cannot be " @@ -530,7 +534,7 @@ msgid "" "method." msgstr "" -#: ../../library/winreg.rst:415 +#: ../../library/winreg.rst:417 msgid "" "If *key* represents a key on a remote computer, the path described by " "*file_name* is relative to the remote computer. The caller of this method " @@ -540,11 +544,11 @@ msgid "" "library/ms724878%28v=VS.85%29.aspx>`__ for more details." msgstr "" -#: ../../library/winreg.rst:423 +#: ../../library/winreg.rst:425 msgid "This function passes ``NULL`` for *security_attributes* to the API." msgstr "" -#: ../../library/winreg.rst:425 +#: ../../library/winreg.rst:427 msgid "" "Raises an :ref:`auditing event ` ``winreg.SaveKey`` with arguments " "``key``, ``file_name``." @@ -552,47 +556,47 @@ msgstr "" "引發一個附帶引數 ``key``、``file_name`` 的\\ :ref:`稽核事件 ` " "``winreg.SaveKey``。" -#: ../../library/winreg.rst:430 +#: ../../library/winreg.rst:432 msgid "Associates a value with a specified key." msgstr "" -#: ../../library/winreg.rst:435 +#: ../../library/winreg.rst:437 msgid "" "*sub_key* is a string that names the subkey with which the value is " "associated." msgstr "" -#: ../../library/winreg.rst:437 +#: ../../library/winreg.rst:439 msgid "" "*type* is an integer that specifies the type of the data. Currently this " "must be :const:`REG_SZ`, meaning only strings are supported. Use the :func:" "`SetValueEx` function for support for other data types." msgstr "" -#: ../../library/winreg.rst:441 ../../library/winreg.rst:471 +#: ../../library/winreg.rst:443 ../../library/winreg.rst:473 msgid "*value* is a string that specifies the new value." msgstr "" -#: ../../library/winreg.rst:443 +#: ../../library/winreg.rst:445 msgid "" "If the key specified by the *sub_key* parameter does not exist, the SetValue " "function creates it." msgstr "" -#: ../../library/winreg.rst:446 ../../library/winreg.rst:479 +#: ../../library/winreg.rst:448 ../../library/winreg.rst:481 msgid "" "Value lengths are limited by available memory. Long values (more than 2048 " "bytes) should be stored as files with the filenames stored in the " "configuration registry. This helps the registry perform efficiently." msgstr "" -#: ../../library/winreg.rst:450 +#: ../../library/winreg.rst:452 msgid "" "The key identified by the *key* parameter must have been opened with :const:" "`KEY_SET_VALUE` access." msgstr "" -#: ../../library/winreg.rst:453 ../../library/winreg.rst:483 +#: ../../library/winreg.rst:455 ../../library/winreg.rst:485 msgid "" "Raises an :ref:`auditing event ` ``winreg.SetValue`` with " "arguments ``key``, ``sub_key``, ``type``, ``value``." @@ -600,58 +604,58 @@ msgstr "" "引發一個附帶引數 ``key``、``sub_key``、``type``、``value`` 的\\ :ref:`稽核事" "件 ` ``winreg.SetValue``。" -#: ../../library/winreg.rst:458 +#: ../../library/winreg.rst:460 msgid "Stores data in the value field of an open registry key." msgstr "" -#: ../../library/winreg.rst:463 +#: ../../library/winreg.rst:465 msgid "" "*value_name* is a string that names the subkey with which the value is " "associated." msgstr "" -#: ../../library/winreg.rst:466 +#: ../../library/winreg.rst:468 msgid "*reserved* can be anything -- zero is always passed to the API." msgstr "" -#: ../../library/winreg.rst:468 +#: ../../library/winreg.rst:470 msgid "" "*type* is an integer that specifies the type of the data. See :ref:`Value " "Types ` for the available types." msgstr "" -#: ../../library/winreg.rst:473 +#: ../../library/winreg.rst:475 msgid "" "This method can also set additional value and type information for the " "specified key. The key identified by the key parameter must have been " "opened with :const:`KEY_SET_VALUE` access." msgstr "" -#: ../../library/winreg.rst:477 +#: ../../library/winreg.rst:479 msgid "To open the key, use the :func:`CreateKey` or :func:`OpenKey` methods." msgstr "" -#: ../../library/winreg.rst:488 +#: ../../library/winreg.rst:490 msgid "" "Disables registry reflection for 32-bit processes running on a 64-bit " "operating system." msgstr "" -#: ../../library/winreg.rst:494 ../../library/winreg.rst:511 -#: ../../library/winreg.rst:528 +#: ../../library/winreg.rst:496 ../../library/winreg.rst:513 +#: ../../library/winreg.rst:530 msgid "" "Will generally raise :exc:`NotImplementedError` if executed on a 32-bit " "operating system." msgstr "" -#: ../../library/winreg.rst:497 +#: ../../library/winreg.rst:499 msgid "" "If the key is not on the reflection list, the function succeeds but has no " "effect. Disabling reflection for a key does not affect reflection of any " "subkeys." msgstr "" -#: ../../library/winreg.rst:501 +#: ../../library/winreg.rst:503 msgid "" "Raises an :ref:`auditing event ` ``winreg.DisableReflectionKey`` " "with argument ``key``." @@ -659,16 +663,16 @@ msgstr "" "引發一個附帶引數 ``key`` 的\\ :ref:`稽核事件 ` ``winreg." "DsiableReflectionKey``。" -#: ../../library/winreg.rst:506 +#: ../../library/winreg.rst:508 msgid "Restores registry reflection for the specified disabled key." msgstr "" -#: ../../library/winreg.rst:514 +#: ../../library/winreg.rst:516 msgid "" "Restoring reflection for a key does not affect reflection of any subkeys." msgstr "" -#: ../../library/winreg.rst:516 +#: ../../library/winreg.rst:518 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnableReflectionKey`` " "with argument ``key``." @@ -676,15 +680,15 @@ msgstr "" "引發一個附帶引數 ``key`` 的\\ :ref:`稽核事件 ` ``winreg." "EnableReflectionKey``。" -#: ../../library/winreg.rst:521 +#: ../../library/winreg.rst:523 msgid "Determines the reflection state for the specified key." msgstr "" -#: ../../library/winreg.rst:526 +#: ../../library/winreg.rst:528 msgid "Returns ``True`` if reflection is disabled." msgstr "" -#: ../../library/winreg.rst:531 +#: ../../library/winreg.rst:533 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryReflectionKey`` " "with argument ``key``." @@ -692,27 +696,27 @@ msgstr "" "引發一個附帶引數 ``key`` 的\\ :ref:`稽核事件 ` ``winreg." "QueryReflectionKey``。" -#: ../../library/winreg.rst:537 +#: ../../library/winreg.rst:539 msgid "Constants" msgstr "常數" -#: ../../library/winreg.rst:539 +#: ../../library/winreg.rst:541 msgid "" "The following constants are defined for use in many :mod:`winreg` functions." msgstr "" -#: ../../library/winreg.rst:544 +#: ../../library/winreg.rst:546 msgid "HKEY_* Constants" msgstr "" -#: ../../library/winreg.rst:548 +#: ../../library/winreg.rst:550 msgid "" "Registry entries subordinate to this key define types (or classes) of " "documents and the properties associated with those types. Shell and COM " "applications use the information stored under this key." msgstr "" -#: ../../library/winreg.rst:555 +#: ../../library/winreg.rst:557 msgid "" "Registry entries subordinate to this key define the preferences of the " "current user. These preferences include the settings of environment " @@ -720,48 +724,48 @@ msgid "" "and application preferences." msgstr "" -#: ../../library/winreg.rst:562 +#: ../../library/winreg.rst:564 msgid "" "Registry entries subordinate to this key define the physical state of the " "computer, including data about the bus type, system memory, and installed " "hardware and software." msgstr "" -#: ../../library/winreg.rst:568 +#: ../../library/winreg.rst:570 msgid "" "Registry entries subordinate to this key define the default user " "configuration for new users on the local computer and the user configuration " "for the current user." msgstr "" -#: ../../library/winreg.rst:574 +#: ../../library/winreg.rst:576 msgid "" "Registry entries subordinate to this key allow you to access performance " "data. The data is not actually stored in the registry; the registry " "functions cause the system to collect the data from its source." msgstr "" -#: ../../library/winreg.rst:582 +#: ../../library/winreg.rst:584 msgid "" "Contains information about the current hardware profile of the local " "computer system." msgstr "" -#: ../../library/winreg.rst:587 +#: ../../library/winreg.rst:589 msgid "This key is not used in versions of Windows after 98." msgstr "" -#: ../../library/winreg.rst:593 +#: ../../library/winreg.rst:595 msgid "Access Rights" msgstr "" -#: ../../library/winreg.rst:595 +#: ../../library/winreg.rst:597 msgid "" "For more information, see `Registry Key Security and Access `__." msgstr "" -#: ../../library/winreg.rst:600 +#: ../../library/winreg.rst:602 msgid "" "Combines the STANDARD_RIGHTS_REQUIRED, :const:`KEY_QUERY_VALUE`, :const:" "`KEY_SET_VALUE`, :const:`KEY_CREATE_SUB_KEY`, :const:" @@ -769,169 +773,169 @@ msgid "" "access rights." msgstr "" -#: ../../library/winreg.rst:607 +#: ../../library/winreg.rst:609 msgid "" "Combines the STANDARD_RIGHTS_WRITE, :const:`KEY_SET_VALUE`, and :const:" "`KEY_CREATE_SUB_KEY` access rights." msgstr "" -#: ../../library/winreg.rst:612 +#: ../../library/winreg.rst:614 msgid "" "Combines the STANDARD_RIGHTS_READ, :const:`KEY_QUERY_VALUE`, :const:" "`KEY_ENUMERATE_SUB_KEYS`, and :const:`KEY_NOTIFY` values." msgstr "" -#: ../../library/winreg.rst:617 +#: ../../library/winreg.rst:619 msgid "Equivalent to :const:`KEY_READ`." msgstr "" -#: ../../library/winreg.rst:621 +#: ../../library/winreg.rst:623 msgid "Required to query the values of a registry key." msgstr "" -#: ../../library/winreg.rst:625 +#: ../../library/winreg.rst:627 msgid "Required to create, delete, or set a registry value." msgstr "" -#: ../../library/winreg.rst:629 +#: ../../library/winreg.rst:631 msgid "Required to create a subkey of a registry key." msgstr "" -#: ../../library/winreg.rst:633 +#: ../../library/winreg.rst:635 msgid "Required to enumerate the subkeys of a registry key." msgstr "" -#: ../../library/winreg.rst:637 +#: ../../library/winreg.rst:639 msgid "" "Required to request change notifications for a registry key or for subkeys " "of a registry key." msgstr "" -#: ../../library/winreg.rst:642 +#: ../../library/winreg.rst:644 msgid "Reserved for system use." msgstr "" -#: ../../library/winreg.rst:648 +#: ../../library/winreg.rst:650 msgid "64-bit Specific" msgstr "" -#: ../../library/winreg.rst:650 +#: ../../library/winreg.rst:652 msgid "" "For more information, see `Accessing an Alternate Registry View `__." msgstr "" -#: ../../library/winreg.rst:655 +#: ../../library/winreg.rst:657 msgid "" "Indicates that an application on 64-bit Windows should operate on the 64-bit " "registry view. On 32-bit Windows, this constant is ignored." msgstr "" -#: ../../library/winreg.rst:660 +#: ../../library/winreg.rst:662 msgid "" "Indicates that an application on 64-bit Windows should operate on the 32-bit " "registry view. On 32-bit Windows, this constant is ignored." msgstr "" -#: ../../library/winreg.rst:666 +#: ../../library/winreg.rst:668 msgid "Value Types" msgstr "" -#: ../../library/winreg.rst:668 +#: ../../library/winreg.rst:670 msgid "" "For more information, see `Registry Value Types `__." msgstr "" -#: ../../library/winreg.rst:673 +#: ../../library/winreg.rst:675 msgid "Binary data in any form." msgstr "" -#: ../../library/winreg.rst:677 +#: ../../library/winreg.rst:679 msgid "32-bit number." msgstr "" -#: ../../library/winreg.rst:681 +#: ../../library/winreg.rst:683 msgid "" "A 32-bit number in little-endian format. Equivalent to :const:`REG_DWORD`." msgstr "" -#: ../../library/winreg.rst:685 +#: ../../library/winreg.rst:687 msgid "A 32-bit number in big-endian format." msgstr "" -#: ../../library/winreg.rst:689 +#: ../../library/winreg.rst:691 msgid "" "Null-terminated string containing references to environment variables " "(``%PATH%``)." msgstr "" -#: ../../library/winreg.rst:694 +#: ../../library/winreg.rst:696 msgid "A Unicode symbolic link." msgstr "" -#: ../../library/winreg.rst:698 +#: ../../library/winreg.rst:700 msgid "" "A sequence of null-terminated strings, terminated by two null characters. " "(Python handles this termination automatically.)" msgstr "" -#: ../../library/winreg.rst:703 +#: ../../library/winreg.rst:705 msgid "No defined value type." msgstr "" -#: ../../library/winreg.rst:707 +#: ../../library/winreg.rst:709 msgid "A 64-bit number." msgstr "" -#: ../../library/winreg.rst:713 +#: ../../library/winreg.rst:715 msgid "" "A 64-bit number in little-endian format. Equivalent to :const:`REG_QWORD`." msgstr "" -#: ../../library/winreg.rst:719 +#: ../../library/winreg.rst:721 msgid "A device-driver resource list." msgstr "" -#: ../../library/winreg.rst:723 +#: ../../library/winreg.rst:725 msgid "A hardware setting." msgstr "" -#: ../../library/winreg.rst:727 +#: ../../library/winreg.rst:729 msgid "A hardware resource list." msgstr "" -#: ../../library/winreg.rst:731 +#: ../../library/winreg.rst:733 msgid "A null-terminated string." msgstr "" -#: ../../library/winreg.rst:737 +#: ../../library/winreg.rst:739 msgid "Registry Handle Objects" msgstr "" -#: ../../library/winreg.rst:739 +#: ../../library/winreg.rst:741 msgid "" "This object wraps a Windows HKEY object, automatically closing it when the " "object is destroyed. To guarantee cleanup, you can call either the :meth:" "`~PyHKEY.Close` method on the object, or the :func:`CloseKey` function." msgstr "" -#: ../../library/winreg.rst:743 +#: ../../library/winreg.rst:745 msgid "All registry functions in this module return one of these objects." msgstr "" -#: ../../library/winreg.rst:745 +#: ../../library/winreg.rst:747 msgid "" "All registry functions in this module which accept a handle object also " "accept an integer, however, use of the handle object is encouraged." msgstr "" -#: ../../library/winreg.rst:748 +#: ../../library/winreg.rst:750 msgid "" "Handle objects provide semantics for :meth:`~object.__bool__` -- thus ::" msgstr "" -#: ../../library/winreg.rst:750 +#: ../../library/winreg.rst:752 msgid "" "if handle:\n" " print(\"Yes\")" @@ -939,13 +943,13 @@ msgstr "" "if handle:\n" " print(\"Yes\")" -#: ../../library/winreg.rst:753 +#: ../../library/winreg.rst:755 msgid "" "will print ``Yes`` if the handle is currently valid (has not been closed or " "detached)." msgstr "" -#: ../../library/winreg.rst:756 +#: ../../library/winreg.rst:758 msgid "" "Handle objects can be converted to an integer (e.g., using the built-in :" "func:`int` function), in which case the underlying Windows handle value is " @@ -954,33 +958,33 @@ msgid "" "object." msgstr "" -#: ../../library/winreg.rst:764 +#: ../../library/winreg.rst:766 msgid "Closes the underlying Windows handle." msgstr "" -#: ../../library/winreg.rst:766 +#: ../../library/winreg.rst:768 msgid "If the handle is already closed, no error is raised." msgstr "" -#: ../../library/winreg.rst:771 +#: ../../library/winreg.rst:773 msgid "Detaches the Windows handle from the handle object." msgstr "" -#: ../../library/winreg.rst:773 +#: ../../library/winreg.rst:775 msgid "" "The result is an integer that holds the value of the handle before it is " "detached. If the handle is already detached or closed, this will return " "zero." msgstr "" -#: ../../library/winreg.rst:777 +#: ../../library/winreg.rst:779 msgid "" "After calling this function, the handle is effectively invalidated, but the " "handle is not closed. You would call this function when you need the " "underlying Win32 handle to exist beyond the lifetime of the handle object." msgstr "" -#: ../../library/winreg.rst:781 +#: ../../library/winreg.rst:783 msgid "" "Raises an :ref:`auditing event ` ``winreg.PyHKEY.Detach`` with " "argument ``key``." @@ -988,28 +992,28 @@ msgstr "" "引發一個附帶引數 ``key`` 的\\ :ref:`稽核事件 ` ``winreg.PyHKEY." "Detach``。" -#: ../../library/winreg.rst:787 +#: ../../library/winreg.rst:789 msgid "" "The HKEY object implements :meth:`~object.__enter__` and :meth:`~object." "__exit__` and thus supports the context protocol for the :keyword:`with` " "statement::" msgstr "" -#: ../../library/winreg.rst:791 +#: ../../library/winreg.rst:793 msgid "" "with OpenKey(HKEY_LOCAL_MACHINE, \"foo\") as key:\n" " ... # work with key" msgstr "" -#: ../../library/winreg.rst:794 +#: ../../library/winreg.rst:796 msgid "" "will automatically close *key* when control leaves the :keyword:`with` block." msgstr "" -#: ../../library/winreg.rst:242 +#: ../../library/winreg.rst:244 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/winreg.rst:242 +#: ../../library/winreg.rst:244 msgid "environment variables expansion (Windows)" msgstr "environment variables expansion (Windows) (環境變數展開 (Windows))" diff --git a/library/winsound.po b/library/winsound.po index 020f1d5c3fc..0918bed6753 100644 --- a/library/winsound.po +++ b/library/winsound.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-11-10 16:45+0000\n" "PO-Revision-Date: 2025-05-19 23:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,7 +31,11 @@ msgstr "" ":mod:`winsound` 模組提供存取 Windows 平台所提供的基本音效播放機制。它包含數個" "函式與常數。" -#: ../../library/winsound.rst:19 +#: ../../library/winsound.rst:16 +msgid "Availability" +msgstr "" + +#: ../../library/winsound.rst:21 msgid "" "Beep the PC's speaker. The *frequency* parameter specifies frequency, in " "hertz, of the sound, and must be in the range 37 through 32,767. The " @@ -43,23 +47,23 @@ msgstr "" "須介於 37 到 32,767 之間。*duration* 參數指定音效持續的時間(以毫秒為單位)。" "若系統無法讓喇叭發出嗶聲,則會引發 :exc:`RuntimeError`。" -#: ../../library/winsound.rst:27 +#: ../../library/winsound.rst:29 msgid "" "Call the underlying :c:func:`!PlaySound` function from the Platform API. " "The *sound* parameter may be a filename, a system sound alias, audio data as " "a :term:`bytes-like object`, or ``None``. Its interpretation depends on the " "value of *flags*, which can be a bitwise ORed combination of the constants " "described below. If the *sound* parameter is ``None``, any currently playing " -"waveform sound is stopped. If the system indicates an " -"error, :exc:`RuntimeError` is raised." +"waveform sound is stopped. If the system indicates an error, :exc:" +"`RuntimeError` is raised." msgstr "" "呼叫平台 API 中底層的 :c:func:`!PlaySound` 函式。*sound* 參數可以是檔案名稱、" "系統音效別名、作為 :term:`bytes-like object` 的音訊資料,或 ``None``。其直譯" "方式取決於 *flags* 的值,該值可以是以下所述常數的位元 OR 組合。若 *sound* 為 " -"``None``,則會停止任何正在播放的波形音效。若系統回報錯誤,則會引" -"發 :exc:`RuntimeError`。" +"``None``,則會停止任何正在播放的波形音效。若系統回報錯誤,則會引發 :exc:" +"`RuntimeError`。" -#: ../../library/winsound.rst:38 +#: ../../library/winsound.rst:40 msgid "" "Call the underlying :c:func:`!MessageBeep` function from the Platform API. " "This plays a sound as specified in the registry. The *type* argument " @@ -74,85 +78,85 @@ msgstr "" "音效。*type* 引數指定要播放的音效類型,可接受的值包括 ``-1``、" "``MB_ICONASTERISK``、``MB_ICONEXCLAMATION``、``MB_ICONHAND``、" "``MB_ICONQUESTION`` 與 ``MB_OK``,這些皆會在下文中說明。數值 ``-1`` 會產生" -"「簡單嗶聲」,當無法播放其他音效時即作為最終退路。若系統回報錯誤,則會引" -"發 :exc:`RuntimeError`。" +"「簡單嗶聲」,當無法播放其他音效時即作為最終退路。若系統回報錯誤,則會引發 :" +"exc:`RuntimeError`。" -#: ../../library/winsound.rst:49 +#: ../../library/winsound.rst:51 msgid "" -"The *sound* parameter is the name of a WAV file. Do not use " -"with :const:`SND_ALIAS`." +"The *sound* parameter is the name of a WAV file. Do not use with :const:" +"`SND_ALIAS`." msgstr "*sound* 參數為 WAV 檔案名稱。請勿與 :const:`SND_ALIAS` 同時使用。" -#: ../../library/winsound.rst:55 +#: ../../library/winsound.rst:57 msgid "" "The *sound* parameter is a sound association name from the registry. If the " -"registry contains no such name, play the system default sound " -"unless :const:`SND_NODEFAULT` is also specified. If no default sound is " -"registered, raise :exc:`RuntimeError`. Do not use with :const:`SND_FILENAME`." +"registry contains no such name, play the system default sound unless :const:" +"`SND_NODEFAULT` is also specified. If no default sound is registered, raise :" +"exc:`RuntimeError`. Do not use with :const:`SND_FILENAME`." msgstr "" "*sound* 參數為登錄檔中的音效關聯名稱。若登錄檔中找不到此名稱,則會播放系統預" -"設音效,除非同時指定了 :const:`SND_NODEFAULT`。若沒有註冊預設音效,則會引" -"發 :exc:`RuntimeError`。請勿與 :const:`SND_FILENAME` 同時使用。" +"設音效,除非同時指定了 :const:`SND_NODEFAULT`。若沒有註冊預設音效,則會引發 :" +"exc:`RuntimeError`。請勿與 :const:`SND_FILENAME` 同時使用。" -#: ../../library/winsound.rst:60 +#: ../../library/winsound.rst:62 msgid "" "All Win32 systems support at least the following; most systems support many " "more:" msgstr "所有 Win32 系統至少支援以下項目;大多數系統支援更多:" -#: ../../library/winsound.rst:64 +#: ../../library/winsound.rst:66 msgid ":func:`PlaySound` *name*" msgstr ":func:`PlaySound` *name*" -#: ../../library/winsound.rst:64 +#: ../../library/winsound.rst:66 msgid "Corresponding Control Panel Sound name" msgstr "對應的控制台音效名稱" -#: ../../library/winsound.rst:66 +#: ../../library/winsound.rst:68 msgid "``'SystemAsterisk'``" msgstr "``'SystemAsterisk'``" -#: ../../library/winsound.rst:66 +#: ../../library/winsound.rst:68 msgid "Asterisk" msgstr "星號" -#: ../../library/winsound.rst:68 +#: ../../library/winsound.rst:70 msgid "``'SystemExclamation'``" msgstr "``'SystemExclamation'``" -#: ../../library/winsound.rst:68 +#: ../../library/winsound.rst:70 msgid "Exclamation" msgstr "驚嘆號" -#: ../../library/winsound.rst:70 +#: ../../library/winsound.rst:72 msgid "``'SystemExit'``" msgstr "``'SystemExit'``" -#: ../../library/winsound.rst:70 +#: ../../library/winsound.rst:72 msgid "Exit Windows" msgstr "離開 Windows" -#: ../../library/winsound.rst:72 +#: ../../library/winsound.rst:74 msgid "``'SystemHand'``" msgstr "``'SystemHand'``" -#: ../../library/winsound.rst:72 +#: ../../library/winsound.rst:74 msgid "Critical Stop" msgstr "關鍵性停止" -#: ../../library/winsound.rst:74 +#: ../../library/winsound.rst:76 msgid "``'SystemQuestion'``" msgstr "``'SystemQuestion'``" -#: ../../library/winsound.rst:74 +#: ../../library/winsound.rst:76 msgid "Question" msgstr "問題" -#: ../../library/winsound.rst:77 +#: ../../library/winsound.rst:79 msgid "For example::" msgstr "例如說: ::" -#: ../../library/winsound.rst:79 +#: ../../library/winsound.rst:81 msgid "" "import winsound\n" "# Play Windows exit sound.\n" @@ -170,57 +174,57 @@ msgstr "" "# (因為 \"*\" 可能不是任何音效的註冊名稱)。\n" "winsound.PlaySound(\"*\", winsound.SND_ALIAS)" -#: ../../library/winsound.rst:90 +#: ../../library/winsound.rst:92 msgid "" "Play the sound repeatedly. The :const:`SND_ASYNC` flag must also be used to " "avoid blocking. Cannot be used with :const:`SND_MEMORY`." msgstr "" -"重複播放音效。必須同時使用 :const:`SND_ASYNC` 旗標以避免阻塞。不能" -"與 :const:`SND_MEMORY` 一同使用。" +"重複播放音效。必須同時使用 :const:`SND_ASYNC` 旗標以避免阻塞。不能與 :const:" +"`SND_MEMORY` 一同使用。" -#: ../../library/winsound.rst:96 +#: ../../library/winsound.rst:98 msgid "" "The *sound* parameter to :func:`PlaySound` is a memory image of a WAV file, " "as a :term:`bytes-like object`." msgstr "" -"傳入 :func:`PlaySound` 的 *sound* 參數是 WAV 檔案的記憶體映像,型別" -"為 :term:`bytes-like object`。" +"傳入 :func:`PlaySound` 的 *sound* 參數是 WAV 檔案的記憶體映像,型別為 :term:" +"`bytes-like object`。" -#: ../../library/winsound.rst:101 +#: ../../library/winsound.rst:103 msgid "" "This module does not support playing from a memory image asynchronously, so " -"a combination of this flag and :const:`SND_ASYNC` will " -"raise :exc:`RuntimeError`." +"a combination of this flag and :const:`SND_ASYNC` will raise :exc:" +"`RuntimeError`." msgstr "" -"此模組不支援從記憶體映像非同步播放音效,因此若同時使用本旗標" -"與 :const:`SND_ASYNC`,將引發 :exc:`RuntimeError`。" +"此模組不支援從記憶體映像非同步播放音效,因此若同時使用本旗標與 :const:" +"`SND_ASYNC`,將引發 :exc:`RuntimeError`。" -#: ../../library/winsound.rst:107 +#: ../../library/winsound.rst:109 msgid "Stop playing all instances of the specified sound." msgstr "停止播放指定音效的所有實例。" -#: ../../library/winsound.rst:111 ../../library/winsound.rst:135 +#: ../../library/winsound.rst:113 ../../library/winsound.rst:137 msgid "This flag is not supported on modern Windows platforms." msgstr "此旗標在現代 Windows 平台上不支援。" -#: ../../library/winsound.rst:116 +#: ../../library/winsound.rst:118 msgid "Return immediately, allowing sounds to play asynchronously." msgstr "立即回傳,使音效可非同步播放。" -#: ../../library/winsound.rst:121 +#: ../../library/winsound.rst:123 msgid "" "If the specified sound cannot be found, do not play the system default sound." msgstr "若找不到指定的音效,則不播放系統預設音效。" -#: ../../library/winsound.rst:126 +#: ../../library/winsound.rst:128 msgid "Do not interrupt sounds currently playing." msgstr "不中斷目前正在播放的音效。" -#: ../../library/winsound.rst:131 +#: ../../library/winsound.rst:133 msgid "Return immediately if the sound driver is busy." msgstr "若音效驅動程式正在忙碌,則立即回傳此。" -#: ../../library/winsound.rst:140 +#: ../../library/winsound.rst:142 msgid "" "The *sound* parameter is an application-specific alias in the registry. This " "flag can be combined with the :const:`SND_ALIAS` flag to specify an " @@ -229,32 +233,32 @@ msgstr "" "*sound* 參數為登錄檔中的應用程式特定別名。此旗標可與 :const:`SND_ALIAS` 一同" "使用,以指定應用程式自訂的音效別名。" -#: ../../library/winsound.rst:147 +#: ../../library/winsound.rst:149 msgid "Triggers a SoundSentry event when the sound is played." msgstr "當音效被播放時,會觸發 SoundSentry 事件。" -#: ../../library/winsound.rst:154 +#: ../../library/winsound.rst:156 msgid "The sound is played synchronously. This is the default behavior." msgstr "音效會同步播放。這是預設行為。" -#: ../../library/winsound.rst:161 +#: ../../library/winsound.rst:163 msgid "Assign the sound to the audio session for system notification sounds." msgstr "將音效指派給系統通知音效的音訊工作階段 (audio session)。" -#: ../../library/winsound.rst:168 ../../library/winsound.rst:188 -#: ../../library/winsound.rst:200 +#: ../../library/winsound.rst:170 ../../library/winsound.rst:190 +#: ../../library/winsound.rst:202 msgid "Play the ``SystemDefault`` sound." msgstr "播放 ``SystemDefault`` 音效。" -#: ../../library/winsound.rst:173 ../../library/winsound.rst:214 +#: ../../library/winsound.rst:175 ../../library/winsound.rst:216 msgid "Play the ``SystemExclamation`` sound." msgstr "播放 ``SystemExclamation`` 音效。" -#: ../../library/winsound.rst:178 ../../library/winsound.rst:193 -#: ../../library/winsound.rst:207 +#: ../../library/winsound.rst:180 ../../library/winsound.rst:195 +#: ../../library/winsound.rst:209 msgid "Play the ``SystemHand`` sound." msgstr "播放 ``SystemHand`` 音效。" -#: ../../library/winsound.rst:183 +#: ../../library/winsound.rst:185 msgid "Play the ``SystemQuestion`` sound." msgstr "播放 ``SystemQuestion`` 音效。" diff --git a/library/zipfile.po b/library/zipfile.po index 1e268653906..45e588b2a7f 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2025-06-26 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,26 +50,35 @@ msgstr "" "ZIP 檔案)的 ZIP 檔案。它支援解密 ZIP 封存檔案中的加密檔案,但目前無法建立加" "密檔案。解密速度極慢,因為它是在原生 Python 中實作,而不是 C。" -#: ../../library/zipfile.rst:26 +#: ../../library/zipfile.rst:29 +msgid "" +"Handling compressed archives requires :term:`optional modules ` such as :mod:`zlib`, :mod:`bz2`, :mod:`lzma`, and :mod:`compression." +"zstd`. If any of them are missing from your copy of CPython, look for " +"documentation from your distributor (that is, whoever provided Python to " +"you). If you are the distributor, see :ref:`optional-module-requirements`." +msgstr "" + +#: ../../library/zipfile.rst:36 msgid "The module defines the following items:" msgstr "本模組定義了以下項目:" -#: ../../library/zipfile.rst:30 +#: ../../library/zipfile.rst:40 msgid "The error raised for bad ZIP files." msgstr "對於損壞的 ZIP 檔案所引發的錯誤。" -#: ../../library/zipfile.rst:37 +#: ../../library/zipfile.rst:47 msgid "" "Alias of :exc:`BadZipFile`, for compatibility with older Python versions." msgstr ":exc:`BadZipFile` 的別名,為了與舊版 Python 相容。" -#: ../../library/zipfile.rst:44 +#: ../../library/zipfile.rst:54 msgid "" "The error raised when a ZIP file would require ZIP64 functionality but that " "has not been enabled." msgstr "當 ZIP 檔案需要 ZIP64 功能但該功能未被啟用時所引發的錯誤。" -#: ../../library/zipfile.rst:51 +#: ../../library/zipfile.rst:61 msgid "" "The class for reading and writing ZIP files. See section :ref:`zipfile-" "objects` for constructor details." @@ -77,7 +86,7 @@ msgstr "" "用於讀取和寫入 ZIP 檔案的類別。有關建構函式的詳細資訊,請參閱 :ref:`zipfile-" "objects` 章節。" -#: ../../library/zipfile.rst:58 +#: ../../library/zipfile.rst:68 msgid "" "Class that implements a subset of the interface provided by :class:`pathlib." "Path`, including the full :class:`importlib.resources.abc.Traversable` " @@ -86,11 +95,11 @@ msgstr "" "實作了 :class:`pathlib.Path` 所提供介面子集的類別,包括完整的 :class:" "`importlib.resources.abc.Traversable` 介面。" -#: ../../library/zipfile.rst:68 +#: ../../library/zipfile.rst:78 msgid "Class for creating ZIP archives containing Python libraries." msgstr "用於建立包含 Python 函式庫的 ZIP 封存檔案的類別。" -#: ../../library/zipfile.rst:73 +#: ../../library/zipfile.rst:83 msgid "" "Class used to represent information about a member of an archive. Instances " "of this class are returned by the :meth:`.getinfo` and :meth:`.infolist` " @@ -107,7 +116,7 @@ msgstr "" "整名稱,而 *date_time* 應為一個包含六個欄位的元組,用以描述檔案的最後修改時" "間;這些欄位在 :ref:`zipinfo-objects` 章節中有所描述。" -#: ../../library/zipfile.rst:82 +#: ../../library/zipfile.rst:92 msgid "" "A public :attr:`!compress_level` attribute has been added to expose the " "formerly protected :attr:`!_compresslevel`. The older protected name " @@ -116,17 +125,17 @@ msgstr "" "新增了一個公開的 :attr:`!compress_level` 屬性,以公開先前受保護的 :attr:`!" "_compresslevel`。為了向後相容,舊的受保護名稱仍可作為一個特性繼續運作。" -#: ../../library/zipfile.rst:90 +#: ../../library/zipfile.rst:100 msgid "" "Resolve the date_time, compression attributes, and external attributes to " "suitable defaults as used by :meth:`ZipFile.writestr`." msgstr "" -#: ../../library/zipfile.rst:93 +#: ../../library/zipfile.rst:103 msgid "Returns self for chaining." msgstr "" -#: ../../library/zipfile.rst:100 +#: ../../library/zipfile.rst:110 msgid "" "Returns ``True`` if *filename* is a valid ZIP file based on its magic " "number, otherwise returns ``False``. *filename* may be a file or file-like " @@ -135,40 +144,40 @@ msgstr "" "如果 *filename* 根據其魔術數字(magic number)是一個有效的 ZIP 檔案,則回傳 " "``True``,否則回傳 ``False``。*filename* 也可以是一個檔案或類檔案物件。" -#: ../../library/zipfile.rst:103 +#: ../../library/zipfile.rst:113 msgid "Support for file and file-like objects." msgstr "支援檔案和類檔案物件。" -#: ../../library/zipfile.rst:109 +#: ../../library/zipfile.rst:119 msgid "The numeric constant for an uncompressed archive member." msgstr "用於未壓縮封存成員的數值常數。" -#: ../../library/zipfile.rst:114 +#: ../../library/zipfile.rst:124 msgid "" "The numeric constant for the usual ZIP compression method. This requires " "the :mod:`zlib` module." msgstr "用於常用的 ZIP 壓縮方法的數值常數。這需要 :mod:`zlib` 模組。" -#: ../../library/zipfile.rst:120 +#: ../../library/zipfile.rst:130 msgid "" "The numeric constant for the BZIP2 compression method. This requires the :" "mod:`bz2` module." msgstr "用於 BZIP2 壓縮方法的數值常數。這需要 :mod:`bz2` 模組。" -#: ../../library/zipfile.rst:127 +#: ../../library/zipfile.rst:137 msgid "" "The numeric constant for the LZMA compression method. This requires the :" "mod:`lzma` module." msgstr "用於 LZMA 壓縮方法的數值常數。這需要 :mod:`lzma` 模組。" -#: ../../library/zipfile.rst:134 +#: ../../library/zipfile.rst:144 msgid "" "The numeric constant for Zstandard compression. This requires the :mod:" "`compression.zstd` module." msgstr "" "用於 Zstandard 壓縮方法的數值常數。這需要 :mod:`compression.zstd` 模組。" -#: ../../library/zipfile.rst:139 +#: ../../library/zipfile.rst:149 msgid "" "In APPNOTE 6.3.7, the method ID ``20`` was assigned to Zstandard " "compression. This was changed in APPNOTE 6.3.8 to method ID ``93`` to avoid " @@ -177,7 +186,7 @@ msgid "" "method ID ``93``." msgstr "" -#: ../../library/zipfile.rst:149 +#: ../../library/zipfile.rst:159 msgid "" "The ZIP file format specification has included support for bzip2 compression " "since 2001, for LZMA compression since 2006, and Zstandard compression since " @@ -189,32 +198,32 @@ msgstr "" "壓縮、自 2020 年起支援 Zstandard 壓縮。然而某些工具(包括舊版的 Python)不支" "援這些壓縮方法,可能會完全拒絕處理該 ZIP 檔案,或無法解壓縮個別檔案。" -#: ../../library/zipfile.rst:157 +#: ../../library/zipfile.rst:167 msgid "`PKZIP Application Note`_" msgstr "`PKZIP Application Note`_" -#: ../../library/zipfile.rst:158 +#: ../../library/zipfile.rst:168 msgid "" "Documentation on the ZIP file format by Phil Katz, the creator of the format " "and algorithms used." msgstr "" "由 Phil Katz(該格式與所用演算法的創造者)所撰寫的關於 ZIP 檔案格式的文件。" -#: ../../library/zipfile.rst:161 +#: ../../library/zipfile.rst:171 msgid "`Info-ZIP Home Page `_" msgstr "`Info-ZIP 首頁 `_" -#: ../../library/zipfile.rst:162 +#: ../../library/zipfile.rst:172 msgid "" "Information about the Info-ZIP project's ZIP archive programs and " "development libraries." msgstr "關於 Info-ZIP 專案的 ZIP 封存程式和開發函式庫的資訊。" -#: ../../library/zipfile.rst:169 +#: ../../library/zipfile.rst:179 msgid "ZipFile Objects" msgstr "ZipFile 物件" -#: ../../library/zipfile.rst:176 +#: ../../library/zipfile.rst:186 msgid "" "Open a ZIP file, where *file* can be a path to a file (a string), a file-" "like object or a :term:`path-like object`." @@ -222,7 +231,7 @@ msgstr "" "開啟一個 ZIP 檔案,其中 *file* 可以是一個檔案的路徑(一個字串)、一個類檔案物" "件或一個 :term:`path-like object`。" -#: ../../library/zipfile.rst:179 +#: ../../library/zipfile.rst:189 msgid "" "The *mode* parameter should be ``'r'`` to read an existing file, ``'w'`` to " "truncate and write a new file, ``'a'`` to append to an existing file, or " @@ -244,7 +253,7 @@ msgstr "" "如 :file:`python.exe`)。如果 *mode* 為 ``'a'`` 且檔案完全不存在,它會被建" "立。如果 *mode* 為 ``'r'`` 或 ``'a'``,該檔案應為可定位的 (seekable)。" -#: ../../library/zipfile.rst:191 +#: ../../library/zipfile.rst:201 msgid "" "*compression* is the ZIP compression method to use when writing the archive, " "and should be :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`, :const:" @@ -263,7 +272,7 @@ msgstr "" "`zlib`、:mod:`bz2`、:mod:`lzma` 或 :mod:`compression.zstd`)不可用,則會引" "發 :exc:`RuntimeError`。預設為 :const:`ZIP_STORED`。" -#: ../../library/zipfile.rst:200 +#: ../../library/zipfile.rst:210 msgid "" "If *allowZip64* is ``True`` (the default) zipfile will create ZIP files that " "use the ZIP64 extensions when the zipfile is larger than 4 GiB. If it is " @@ -274,7 +283,7 @@ msgstr "" "zipfile 將會建立使用 ZIP64 擴充的 ZIP 檔案。如果為 ``false``,當 ZIP 檔案需" "要 ZIP64 擴充時,:mod:`zipfile` 將會引發一個例外。" -#: ../../library/zipfile.rst:205 +#: ../../library/zipfile.rst:215 msgid "" "The *compresslevel* parameter controls the compression level to use when " "writing files to the archive. When using :const:`ZIP_STORED` or :const:" @@ -296,7 +305,7 @@ msgstr "" "及其含義,請參閱 :attr:`CompressionParameter.compression_level `)。" -#: ../../library/zipfile.rst:217 ../../library/zipfile.rst:799 +#: ../../library/zipfile.rst:227 ../../library/zipfile.rst:809 msgid "" "The *strict_timestamps* argument, when set to ``False``, allows to zip files " "older than 1980-01-01 at the cost of setting the timestamp to 1980-01-01. " @@ -307,7 +316,7 @@ msgstr "" "案,代價是將時間戳記設為 1980-01-01。對於晚於 2107-12-31 的檔案,也會有類似的" "行為,時間戳記同樣會被設為極限值。" -#: ../../library/zipfile.rst:223 +#: ../../library/zipfile.rst:233 msgid "" "When mode is ``'r'``, *metadata_encoding* may be set to the name of a codec, " "which will be used to decode metadata such as the names of members and ZIP " @@ -316,7 +325,7 @@ msgstr "" "當 mode 為 ``'r'`` 時,*metadata_encoding* 可以設為一個編解碼器的名稱,該編解" "碼器將被用來解碼元資料,例如成員名稱和 ZIP 註解。" -#: ../../library/zipfile.rst:227 +#: ../../library/zipfile.rst:237 msgid "" "If the file is created with mode ``'w'``, ``'x'`` or ``'a'`` and then :meth:" "`closed ` without adding any files to the archive, the appropriate " @@ -326,7 +335,7 @@ msgstr "" "何檔案的情況下 :meth:`關閉 `,則適用於空封存檔案的 ZIP 結構將被寫入檔" "案中。" -#: ../../library/zipfile.rst:231 +#: ../../library/zipfile.rst:241 msgid "" "ZipFile is also a context manager and therefore supports the :keyword:`with` " "statement. In the example, *myzip* is closed after the :keyword:`!with` " @@ -336,7 +345,7 @@ msgstr "" "*myzip* 在 :keyword:`!with` 陳述式的程式碼區塊執行完畢後會被關閉 --- 即使發生" "例外也是如此: ::" -#: ../../library/zipfile.rst:235 +#: ../../library/zipfile.rst:245 msgid "" "with ZipFile('spam.zip', 'w') as myzip:\n" " myzip.write('eggs.txt')" @@ -344,7 +353,7 @@ msgstr "" "with ZipFile('spam.zip', 'w') as myzip:\n" " myzip.write('eggs.txt')" -#: ../../library/zipfile.rst:240 +#: ../../library/zipfile.rst:250 msgid "" "*metadata_encoding* is an instance-wide setting for the ZipFile. It is not " "currently possible to set this on a per-member basis." @@ -352,7 +361,7 @@ msgstr "" "*metadata_encoding* 是 ZipFile 的一個實例範圍設定。目前無法以每個成員為基礎來" "設定此項。" -#: ../../library/zipfile.rst:243 +#: ../../library/zipfile.rst:253 msgid "" "This attribute is a workaround for legacy implementations which produce " "archives with names in the current locale encoding or code page (mostly on " @@ -366,51 +375,51 @@ msgstr "" "檔案標頭中的一個旗標指定為 IBM 頁碼(預設)或 UTF-8。該旗標的優先級高於 " "*metadata_encoding*,後者是 Python 特有的擴充。" -#: ../../library/zipfile.rst:251 +#: ../../library/zipfile.rst:261 msgid "Added the ability to use :class:`ZipFile` as a context manager." msgstr "新增 :class:`ZipFile` 作為情境管理器使用的能力。" -#: ../../library/zipfile.rst:254 +#: ../../library/zipfile.rst:264 msgid "Added support for :mod:`bzip2 ` and :mod:`lzma` compression." msgstr "新增對於 :mod:`bzip2 ` 和 :mod:`lzma` 壓縮的支援。" -#: ../../library/zipfile.rst:257 ../../library/zipfile.rst:712 +#: ../../library/zipfile.rst:267 ../../library/zipfile.rst:722 msgid "ZIP64 extensions are enabled by default." msgstr "ZIP64 擴充預設為啟用。" -#: ../../library/zipfile.rst:260 +#: ../../library/zipfile.rst:270 msgid "" "Added support for writing to unseekable streams. Added support for the " "``'x'`` mode." msgstr "" "新增了對寫入不可定位的 (unseekable) 串流的支援。新增了對 ``'x'`` 模式的支援。" -#: ../../library/zipfile.rst:264 +#: ../../library/zipfile.rst:274 msgid "" "Previously, a plain :exc:`RuntimeError` was raised for unrecognized " "compression values." msgstr "先前,對於無法識別的壓縮值,會引發一個單純的 :exc:`RuntimeError`。" -#: ../../library/zipfile.rst:268 +#: ../../library/zipfile.rst:278 msgid "The *file* parameter accepts a :term:`path-like object`." msgstr "*file* 參數接受一個 :term:`path-like object`。" -#: ../../library/zipfile.rst:271 +#: ../../library/zipfile.rst:281 msgid "Add the *compresslevel* parameter." msgstr "新增 *compresslevel* 參數。" -#: ../../library/zipfile.rst:274 +#: ../../library/zipfile.rst:284 msgid "The *strict_timestamps* keyword-only parameter." msgstr "*strict_timestamps* 僅限關鍵字參數。" -#: ../../library/zipfile.rst:277 +#: ../../library/zipfile.rst:287 msgid "" "Added support for specifying member name encoding for reading metadata in " "the zipfile's directory and file headers." msgstr "" "新增了在讀取 zipfile 目錄和檔案標頭中的元資料時,可指定成員名稱編碼的支援。" -#: ../../library/zipfile.rst:284 +#: ../../library/zipfile.rst:294 msgid "" "Close the archive file. You must call :meth:`close` before exiting your " "program or essential records will not be written." @@ -418,7 +427,7 @@ msgstr "" "關閉封存檔案。你必須在結束程式前呼叫 :meth:`close`,否則必要的記錄將不會被寫" "入。" -#: ../../library/zipfile.rst:290 +#: ../../library/zipfile.rst:300 msgid "" "Return a :class:`ZipInfo` object with information about the archive member " "*name*. Calling :meth:`getinfo` for a name not currently contained in the " @@ -427,7 +436,7 @@ msgstr "" "回傳一個帶有關於封存成員 *name* 資訊的 :class:`ZipInfo` 物件。對一個目前不包" "含在封存檔案中的名稱呼叫 :meth:`getinfo` 將會引發 :exc:`KeyError`。" -#: ../../library/zipfile.rst:297 +#: ../../library/zipfile.rst:307 msgid "" "Return a list containing a :class:`ZipInfo` object for each member of the " "archive. The objects are in the same order as their entries in the actual " @@ -437,11 +446,11 @@ msgstr "" "一個現有的封存檔案,這些物件的順序與它們在磁碟上實際 ZIP 檔案中的條目順序相" "同。" -#: ../../library/zipfile.rst:304 +#: ../../library/zipfile.rst:314 msgid "Return a list of archive members by name." msgstr "依名稱回傳封存成員的串列。" -#: ../../library/zipfile.rst:309 +#: ../../library/zipfile.rst:319 msgid "" "Access a member of the archive as a binary file-like object. *name* can be " "either the name of a file within the archive or a :class:`ZipInfo` object. " @@ -454,7 +463,7 @@ msgstr "" "``'r'``\\ (預設值)或 ``'w'``。*pwd* 是用於解密加密 ZIP 檔案的密碼,為一個 :" "class:`bytes` 物件。" -#: ../../library/zipfile.rst:315 +#: ../../library/zipfile.rst:325 msgid "" ":meth:`~ZipFile.open` is also a context manager and therefore supports the :" "keyword:`with` statement::" @@ -462,7 +471,7 @@ msgstr "" ":meth:`~ZipFile.open` 也是一個情境管理器,因此支援 :keyword:`with` 陳述" "式: ::" -#: ../../library/zipfile.rst:318 +#: ../../library/zipfile.rst:328 msgid "" "with ZipFile('spam.zip') as myzip:\n" " with myzip.open('eggs.txt') as myfile:\n" @@ -472,7 +481,7 @@ msgstr "" " with myzip.open('eggs.txt') as myfile:\n" " print(myfile.read())" -#: ../../library/zipfile.rst:322 +#: ../../library/zipfile.rst:332 msgid "" "With *mode* ``'r'`` the file-like object (``ZipExtFile``) is read-only and " "provides the following methods: :meth:`~io.BufferedIOBase.read`, :meth:`~io." @@ -486,7 +495,7 @@ msgstr "" "`~container.__iter__`、:meth:`~iterator.__next__`。這些物件可以獨立於 " "ZipFile 運作。" -#: ../../library/zipfile.rst:329 +#: ../../library/zipfile.rst:339 msgid "" "With ``mode='w'``, a writable file handle is returned, which supports the :" "meth:`~io.BufferedIOBase.write` method. While a writable file handle is " @@ -497,7 +506,7 @@ msgstr "" "`~io.BufferedIOBase.write` 方法。當一個可寫的檔案控點開啟時,嘗試讀取或寫入 " "ZIP 檔案中的其他檔案將會引發 :exc:`ValueError`。" -#: ../../library/zipfile.rst:334 +#: ../../library/zipfile.rst:344 msgid "" "In both cases the file-like object has also attributes :attr:`!name`, which " "is equivalent to the name of a file within the archive, and :attr:`!mode`, " @@ -507,7 +516,7 @@ msgstr "" "案名稱,以及 :attr:`!mode` 屬性,其值為 ``'rb'`` 或 ``'wb'``,取決於輸入的模" "式。" -#: ../../library/zipfile.rst:338 +#: ../../library/zipfile.rst:348 msgid "" "When writing a file, if the file size is not known in advance but may exceed " "2 GiB, pass ``force_zip64=True`` to ensure that the header format is capable " @@ -520,7 +529,7 @@ msgstr "" "構一個設定了 :attr:`~ZipInfo.file_size` 的 :class:`ZipInfo` 物件,並將其用作 " "*name* 參數。" -#: ../../library/zipfile.rst:346 +#: ../../library/zipfile.rst:356 msgid "" "The :meth:`.open`, :meth:`read` and :meth:`extract` methods can take a " "filename or a :class:`ZipInfo` object. You will appreciate this when trying " @@ -530,7 +539,7 @@ msgstr "" "class:`ZipInfo` 物件。當你嘗試讀取一個包含重複名稱成員的 ZIP 檔案時,你會發現" "這很有用。" -#: ../../library/zipfile.rst:350 +#: ../../library/zipfile.rst:360 msgid "" "Removed support of ``mode='U'``. Use :class:`io.TextIOWrapper` for reading " "compressed text files in :term:`universal newlines` mode." @@ -538,14 +547,14 @@ msgstr "" "移除了對 ``mode='U'`` 的支援。請使用 :class:`io.TextIOWrapper` 以 :term:" "`universal newlines` 模式讀取壓縮的文字檔。" -#: ../../library/zipfile.rst:354 +#: ../../library/zipfile.rst:364 msgid "" ":meth:`ZipFile.open` can now be used to write files into the archive with " "the ``mode='w'`` option." msgstr "" ":meth:`ZipFile.open` 現在可以用於以 ``mode='w'`` 選項將檔案寫入封存檔案。" -#: ../../library/zipfile.rst:358 +#: ../../library/zipfile.rst:368 msgid "" "Calling :meth:`.open` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." @@ -553,7 +562,7 @@ msgstr "" "在一個已關閉的 ZipFile 上呼叫 :meth:`.open` 將會引發 :exc:`ValueError`。先" "前,會引發一個 :exc:`RuntimeError`。" -#: ../../library/zipfile.rst:362 +#: ../../library/zipfile.rst:372 msgid "" "Added attributes :attr:`!name` and :attr:`!mode` for the writeable file-like " "object. The value of the :attr:`!mode` attribute for the readable file-like " @@ -562,7 +571,7 @@ msgstr "" "為可寫的類檔案物件新增了 :attr:`!name` 和 :attr:`!mode` 屬性。可讀的類檔案物" "件的 :attr:`!mode` 屬性值從 ``'r'`` 變更為 ``'rb'``。" -#: ../../library/zipfile.rst:371 +#: ../../library/zipfile.rst:381 msgid "" "Extract a member from the archive to the current working directory; *member* " "must be its full name or a :class:`ZipInfo` object. Its file information is " @@ -575,11 +584,11 @@ msgstr "" "目錄來解壓縮。*member* 可以是一個檔名或一個 :class:`ZipInfo` 物件。*pwd* 是用" "於加密檔案的密碼,為一個 :class:`bytes` 物件。" -#: ../../library/zipfile.rst:377 +#: ../../library/zipfile.rst:387 msgid "Returns the normalized path created (a directory or new file)." msgstr "回傳建立的正規化路徑(一個目錄或新檔案)。" -#: ../../library/zipfile.rst:381 +#: ../../library/zipfile.rst:391 msgid "" "If a member filename is an absolute path, a drive/UNC sharepoint and leading " "(back)slashes will be stripped, e.g.: ``///foo/bar`` becomes ``foo/bar`` on " @@ -595,7 +604,7 @@ msgstr "" "foo../../ba..r`` 變成 ``foo../ba..r``。在 Windows 上,非法字元(``:``、" "``<``、``>``、``|``、``\"``、``?`` 和 ``*``)會被底線(``_``)取代。" -#: ../../library/zipfile.rst:389 +#: ../../library/zipfile.rst:399 msgid "" "Calling :meth:`extract` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." @@ -603,11 +612,11 @@ msgstr "" "在一個已關閉的 ZipFile 上呼叫 :meth:`extract` 將會引發 :exc:`ValueError`。先" "前,會引發一個 :exc:`RuntimeError`。" -#: ../../library/zipfile.rst:393 ../../library/zipfile.rst:416 +#: ../../library/zipfile.rst:403 ../../library/zipfile.rst:426 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "*path* 參數接受一個 :term:`path-like object`。" -#: ../../library/zipfile.rst:399 +#: ../../library/zipfile.rst:409 msgid "" "Extract all members from the archive to the current working directory. " "*path* specifies a different directory to extract to. *members* is optional " @@ -618,7 +627,7 @@ msgstr "" "*members* 是可選的,且必須是 :meth:`namelist` 回傳的串列的子集。*pwd* 是用於" "加密檔案的密碼,為一個 :class:`bytes` 物件。" -#: ../../library/zipfile.rst:406 +#: ../../library/zipfile.rst:416 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of *path*, e.g. members that have " @@ -629,7 +638,7 @@ msgstr "" "立在 *path* 之外,例如,成員具有以 ``\"/\"`` 開頭的絕對檔名或帶有兩個點 " "``\"..\"`` 的檔名。本模組會試圖防止這種情況。請參閱 :meth:`extract` 的註解。" -#: ../../library/zipfile.rst:412 +#: ../../library/zipfile.rst:422 msgid "" "Calling :meth:`extractall` on a closed ZipFile will raise a :exc:" "`ValueError`. Previously, a :exc:`RuntimeError` was raised." @@ -637,17 +646,17 @@ msgstr "" "在一個已關閉的 ZipFile 上呼叫 :meth:`extractall` 將會引發 :exc:`ValueError`。" "先前,會引發一個 :exc:`RuntimeError`。" -#: ../../library/zipfile.rst:422 +#: ../../library/zipfile.rst:432 msgid "Print a table of contents for the archive to ``sys.stdout``." msgstr "將封存檔案的內容目錄印出到 ``sys.stdout``。" -#: ../../library/zipfile.rst:427 +#: ../../library/zipfile.rst:437 msgid "" "Set *pwd* (a :class:`bytes` object) as default password to extract encrypted " "files." msgstr "設定 *pwd*\\ (一個 :class:`bytes` 物件)為解壓縮加密檔案的預設密碼。" -#: ../../library/zipfile.rst:432 +#: ../../library/zipfile.rst:442 msgid "" "Return the bytes of the file *name* in the archive. *name* is the name of " "the file in the archive, or a :class:`ZipInfo` object. The archive must be " @@ -667,7 +676,7 @@ msgstr "" "的 ZipFile 上呼叫 :meth:`read` 將會引發 :exc:`NotImplementedError`。如果對應" "的壓縮模組不可用,也會引發一個錯誤。" -#: ../../library/zipfile.rst:442 +#: ../../library/zipfile.rst:452 msgid "" "Calling :meth:`read` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." @@ -675,7 +684,7 @@ msgstr "" "在一個已關閉的 ZipFile 上呼叫 :meth:`read` 將會引發 :exc:`ValueError`。先前," "會引發一個 :exc:`RuntimeError`。" -#: ../../library/zipfile.rst:449 +#: ../../library/zipfile.rst:459 msgid "" "Read all the files in the archive and check their CRC's and file headers. " "Return the name of the first bad file, or else return ``None``." @@ -683,7 +692,7 @@ msgstr "" "讀取封存檔案中的所有檔案,並檢查它們的 CRC 和檔案標頭。回傳第一個損壞檔案的名" "稱,否則回傳 ``None``。" -#: ../../library/zipfile.rst:452 +#: ../../library/zipfile.rst:462 msgid "" "Calling :meth:`testzip` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." @@ -691,7 +700,7 @@ msgstr "" "在一個已關閉的 ZipFile 上呼叫 :meth:`testzip` 將會引發 :exc:`ValueError`。先" "前,會引發一個 :exc:`RuntimeError`。" -#: ../../library/zipfile.rst:460 +#: ../../library/zipfile.rst:470 msgid "" "Write the file named *filename* to the archive, giving it the archive name " "*arcname* (by default, this will be the same as *filename*, but without a " @@ -707,7 +716,7 @@ msgstr "" "同樣地,如果給定 *compresslevel*,它將覆寫建構函式。封存檔案必須以 ``'w'``、" "``'x'`` 或 ``'a'`` 模式開啟。" -#: ../../library/zipfile.rst:470 +#: ../../library/zipfile.rst:480 msgid "" "The ZIP file standard historically did not specify a metadata encoding, but " "strongly recommended CP437 (the original IBM PC encoding) for " @@ -721,13 +730,13 @@ msgstr "" "組中,如果成員名稱包含任何非 ASCII 字元,將會自動使用 UTF-8 來寫入。無法以 " "ASCII 或 UTF-8 以外的任何編碼寫入成員名稱。" -#: ../../library/zipfile.rst:479 +#: ../../library/zipfile.rst:489 msgid "" "Archive names should be relative to the archive root, that is, they should " "not start with a path separator." msgstr "封存名稱應相對於封存檔案的根目錄,也就是說,它們不應以路徑分隔符開頭。" -#: ../../library/zipfile.rst:484 +#: ../../library/zipfile.rst:494 msgid "" "If ``arcname`` (or ``filename``, if ``arcname`` is not given) contains a " "null byte, the name of the file in the archive will be truncated at the null " @@ -736,7 +745,7 @@ msgstr "" "如果 ``arcname``\\ (或在未給定 ``arcname`` 時的 ``filename``)包含一個空位元" "組,封存檔案中該檔案的名稱將在空位元組處被截斷。" -#: ../../library/zipfile.rst:489 +#: ../../library/zipfile.rst:499 msgid "" "A leading slash in the filename may lead to the archive being impossible to " "open in some zip programs on Windows systems." @@ -744,7 +753,7 @@ msgstr "" "檔名中開頭的斜線可能導致在 Windows 系統上的某些 zip 程式中無法開啟該封存檔" "案。" -#: ../../library/zipfile.rst:492 +#: ../../library/zipfile.rst:502 msgid "" "Calling :meth:`write` on a ZipFile created with mode ``'r'`` or a closed " "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " @@ -753,7 +762,7 @@ msgstr "" "在以 ``'r'`` 模式建立的 ZipFile 或一個已關閉的 ZipFile 上呼叫 :meth:`write` " "將會引發 :exc:`ValueError`。先前,會引發一個 :exc:`RuntimeError`。" -#: ../../library/zipfile.rst:501 +#: ../../library/zipfile.rst:511 msgid "" "Write a file into the archive. The contents is *data*, which may be either " "a :class:`str` or a :class:`bytes` instance; if it is a :class:`str`, it is " @@ -770,7 +779,7 @@ msgstr "" "個名稱,則日期和時間被設為目前的日期和時間。封存檔案必須以 ``'w'``、``'x'`` " "或 ``'a'`` 模式開啟。" -#: ../../library/zipfile.rst:509 +#: ../../library/zipfile.rst:519 msgid "" "If given, *compress_type* overrides the value given for the *compression* " "parameter to the constructor for the new entry, or in the *zinfo_or_arcname* " @@ -781,7 +790,7 @@ msgstr "" "值,或覆寫 *zinfo_or_arcname*\\ (如果它是一個 :class:`ZipInfo` 實例)中的" "值。同樣地,如果給定 *compresslevel*,它將覆寫建構函式。" -#: ../../library/zipfile.rst:516 +#: ../../library/zipfile.rst:526 msgid "" "When passing a :class:`ZipInfo` instance as the *zinfo_or_arcname* " "parameter, the compression method used will be that specified in the " @@ -792,11 +801,11 @@ msgstr "" "方法將是給定的 :class:`ZipInfo` 實例的 *compress_type* 成員中指定的方法。預設" "情況下,:class:`ZipInfo` 建構函式將此成員設為 :const:`ZIP_STORED`。" -#: ../../library/zipfile.rst:521 +#: ../../library/zipfile.rst:531 msgid "The *compress_type* argument." msgstr "*compress_type* 引數。" -#: ../../library/zipfile.rst:524 +#: ../../library/zipfile.rst:534 msgid "" "Calling :meth:`writestr` on a ZipFile created with mode ``'r'`` or a closed " "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " @@ -805,7 +814,7 @@ msgstr "" "在以 ``'r'`` 模式建立的 ZipFile 或一個已關閉的 ZipFile 上呼叫 :meth:" "`writestr` 將會引發 :exc:`ValueError`。先前,會引發一個 :exc:`RuntimeError`。" -#: ../../library/zipfile.rst:531 +#: ../../library/zipfile.rst:541 msgid "" "Create a directory inside the archive. If *zinfo_or_directory* is a string, " "a directory is created inside the archive with the mode that is specified in " @@ -816,19 +825,19 @@ msgstr "" "案內以 *mode* 引數中指定的模式建立一個目錄。然而,如果 *zinfo_or_directory* " "是一個 :class:`ZipInfo` 實例,則 *mode* 引數會被忽略。" -#: ../../library/zipfile.rst:536 +#: ../../library/zipfile.rst:546 msgid "The archive must be opened with mode ``'w'``, ``'x'`` or ``'a'``." msgstr "封存檔案必須以 ``'w'``、``'x'`` 或 ``'a'`` 模式開啟。" -#: ../../library/zipfile.rst:541 +#: ../../library/zipfile.rst:551 msgid "The following data attributes are also available:" msgstr "以下資料屬性也可用:" -#: ../../library/zipfile.rst:545 +#: ../../library/zipfile.rst:555 msgid "Name of the ZIP file." msgstr "ZIP 檔案的名稱。" -#: ../../library/zipfile.rst:549 +#: ../../library/zipfile.rst:559 msgid "" "The level of debug output to use. This may be set from ``0`` (the default, " "no output) to ``3`` (the most output). Debugging information is written to " @@ -837,7 +846,7 @@ msgstr "" "要使用的偵錯輸出層級。可以從 ``0``\\ (預設,無輸出)設定到 ``3``\\ (最多輸" "出)。偵錯資訊會被寫入到 ``sys.stdout``。" -#: ../../library/zipfile.rst:555 +#: ../../library/zipfile.rst:565 msgid "" "The comment associated with the ZIP file as a :class:`bytes` object. If " "assigning a comment to a :class:`ZipFile` instance created with mode " @@ -848,11 +857,11 @@ msgstr "" "``'x'`` 或 ``'a'`` 模式建立的 :class:`ZipFile` 實例指派註解,其長度不應超過 " "65535 位元組。超過此長度的註解將被截斷。" -#: ../../library/zipfile.rst:565 +#: ../../library/zipfile.rst:575 msgid "Path Objects" msgstr "Path 物件" -#: ../../library/zipfile.rst:569 +#: ../../library/zipfile.rst:579 msgid "" "Construct a Path object from a ``root`` zipfile (which may be a :class:" "`ZipFile` instance or ``file`` suitable for passing to the :class:`ZipFile` " @@ -861,7 +870,7 @@ msgstr "" "從一個 ``root`` zipfile(它可以是一個 :class:`ZipFile` 實例或一個適合傳遞給 :" "class:`ZipFile` 建構函式的 ``file``)建構一個 Path 物件。" -#: ../../library/zipfile.rst:573 +#: ../../library/zipfile.rst:583 msgid "" "``at`` specifies the location of this Path within the zipfile, e.g. 'dir/" "file.txt', 'dir/', or ''. Defaults to the empty string, indicating the root." @@ -869,7 +878,7 @@ msgstr "" "``at`` 指定此 Path 在 zipfile 中的位置,例如 'dir/file.txt'、'dir/' 或 ''。預" "設為空字串,表示根目錄。" -#: ../../library/zipfile.rst:578 +#: ../../library/zipfile.rst:588 msgid "" "The :class:`Path` class does not sanitize filenames within the ZIP archive. " "Unlike the :meth:`ZipFile.extract` and :meth:`ZipFile.extractall` methods, " @@ -885,20 +894,20 @@ msgstr "" "時,請考慮使用 :func:`os.path.abspath` 解析檔名,並使用 :func:`os.path." "commonpath` 與目標目錄進行核對。" -#: ../../library/zipfile.rst:585 +#: ../../library/zipfile.rst:595 msgid "" "Path objects expose the following features of :mod:`pathlib.Path` objects:" msgstr "Path 物件公開了 :mod:`pathlib.Path` 物件的以下特性:" -#: ../../library/zipfile.rst:588 +#: ../../library/zipfile.rst:598 msgid "Path objects are traversable using the ``/`` operator or ``joinpath``." msgstr "Path 物件可以使用 ``/`` 運算子或 ``joinpath`` 來遍歷。" -#: ../../library/zipfile.rst:592 +#: ../../library/zipfile.rst:602 msgid "The final path component." msgstr "最後的路徑元件。" -#: ../../library/zipfile.rst:596 +#: ../../library/zipfile.rst:606 msgid "" "Invoke :meth:`ZipFile.open` on the current path. Allows opening for read or " "write, text or binary through supported modes: 'r', 'w', 'rb', 'wb'. " @@ -911,12 +920,12 @@ msgstr "" "位置引數和關鍵字引數會被傳遞給 :class:`io.TextIOWrapper`,否則會被忽略。" "``pwd`` 是傳遞給 :meth:`ZipFile.open` 的 ``pwd`` 參數。" -#: ../../library/zipfile.rst:605 +#: ../../library/zipfile.rst:615 msgid "" "Added support for text and binary modes for open. Default mode is now text." msgstr "新增了對 open 的文字和二進位模式的支援。預設模式現在是文字模式。" -#: ../../library/zipfile.rst:609 ../../library/zipfile.rst:670 +#: ../../library/zipfile.rst:619 ../../library/zipfile.rst:680 msgid "" "The ``encoding`` parameter can be supplied as a positional argument without " "causing a :exc:`TypeError`. As it could in 3.9. Code needing to be " @@ -927,59 +936,59 @@ msgstr "" "3.9 中一樣。需要與未修補的 3.10 和 3.11 版本相容的程式碼,必須將所有 :class:" "`io.TextIOWrapper` 引數,包括 ``encoding``,作為關鍵字傳遞。" -#: ../../library/zipfile.rst:617 +#: ../../library/zipfile.rst:627 msgid "Enumerate the children of the current directory." msgstr "列舉目前目錄的子項目。" -#: ../../library/zipfile.rst:621 +#: ../../library/zipfile.rst:631 msgid "Return ``True`` if the current context references a directory." msgstr "如果目前情境參照到一個目錄,則回傳 ``True``。" -#: ../../library/zipfile.rst:625 +#: ../../library/zipfile.rst:635 msgid "Return ``True`` if the current context references a file." msgstr "如果目前情境參照到一個檔案,則回傳 ``True``。" -#: ../../library/zipfile.rst:629 +#: ../../library/zipfile.rst:639 msgid "Return ``True`` if the current context references a symbolic link." msgstr "如果目前情境參照到一個符號連結,則回傳 ``True``。" -#: ../../library/zipfile.rst:633 +#: ../../library/zipfile.rst:643 msgid "Previously, ``is_symlink`` would unconditionally return ``False``." msgstr "先前,``is_symlink`` 會無條件地回傳 ``False``。" -#: ../../library/zipfile.rst:638 +#: ../../library/zipfile.rst:648 msgid "" "Return ``True`` if the current context references a file or directory in the " "zip file." msgstr "如果目前情境參照到 zip 檔案中的一個檔案或目錄,則回傳 ``True``。" -#: ../../library/zipfile.rst:643 +#: ../../library/zipfile.rst:653 msgid "" "The last dot-separated portion of the final component, if any. This is " "commonly called the file extension." msgstr "最後一個元件中以點分隔的最後一部分(如果有的話)。這通常被稱為副檔名。" -#: ../../library/zipfile.rst:646 +#: ../../library/zipfile.rst:656 msgid "Added :data:`Path.suffix` property." msgstr "新增 :data:`Path.suffix` 特性。" -#: ../../library/zipfile.rst:651 +#: ../../library/zipfile.rst:661 msgid "The final path component, without its suffix." msgstr "最後的路徑元件,不含其後綴。" -#: ../../library/zipfile.rst:653 +#: ../../library/zipfile.rst:663 msgid "Added :data:`Path.stem` property." msgstr "新增 :data:`Path.stem` 特性。" -#: ../../library/zipfile.rst:658 +#: ../../library/zipfile.rst:668 msgid "A list of the path’s suffixes, commonly called file extensions." msgstr "路徑的後綴串列,通常稱為副檔名。" -#: ../../library/zipfile.rst:660 +#: ../../library/zipfile.rst:670 msgid "Added :data:`Path.suffixes` property." msgstr "新增 :data:`Path.suffixes` 特性。" -#: ../../library/zipfile.rst:665 +#: ../../library/zipfile.rst:675 msgid "" "Read the current file as unicode text. Positional and keyword arguments are " "passed through to :class:`io.TextIOWrapper` (except ``buffer``, which is " @@ -988,17 +997,17 @@ msgstr "" "將目前檔案讀取為 unicode 文字。位置引數和關鍵字引數會被傳遞給 :class:`io." "TextIOWrapper`\\ (但 ``buffer`` 會根據情境隱式處理)。" -#: ../../library/zipfile.rst:678 +#: ../../library/zipfile.rst:688 msgid "Read the current file as bytes." msgstr "將目前檔案讀取為位元組。" -#: ../../library/zipfile.rst:682 +#: ../../library/zipfile.rst:692 msgid "" "Return a new Path object with each of the *other* arguments joined. The " "following are equivalent::" msgstr "回傳一個新的 Path 物件,並將每個 *other* 引數加入。以下是等效的: ::" -#: ../../library/zipfile.rst:685 +#: ../../library/zipfile.rst:695 msgid "" ">>> Path(...).joinpath('child').joinpath('grandchild')\n" ">>> Path(...).joinpath('child', 'grandchild')\n" @@ -1008,13 +1017,13 @@ msgstr "" ">>> Path(...).joinpath('child', 'grandchild')\n" ">>> Path(...) / 'child' / 'grandchild'" -#: ../../library/zipfile.rst:689 +#: ../../library/zipfile.rst:699 msgid "" "Prior to 3.10, ``joinpath`` was undocumented and accepted exactly one " "parameter." msgstr "在 3.10 之前,``joinpath`` 沒有文件記載,且只接受一個參數。" -#: ../../library/zipfile.rst:693 +#: ../../library/zipfile.rst:703 msgid "" "The :pypi:`zipp` project provides backports of the latest path object " "functionality to older Pythons. Use ``zipp.Path`` in place of ``zipfile." @@ -1023,11 +1032,11 @@ msgstr "" ":pypi:`zipp` 專案為舊版 Python 提供了最新的 path 物件功能的向後移植版本。使" "用 ``zipp.Path`` 來取代 ``zipfile.Path`` 以提早使用變更。" -#: ../../library/zipfile.rst:701 +#: ../../library/zipfile.rst:711 msgid "PyZipFile Objects" msgstr "PyZipFile 物件" -#: ../../library/zipfile.rst:703 +#: ../../library/zipfile.rst:713 msgid "" "The :class:`PyZipFile` constructor takes the same parameters as the :class:" "`ZipFile` constructor, and one additional parameter, *optimize*." @@ -1035,22 +1044,22 @@ msgstr "" ":class:`PyZipFile` 建構函式接受與 :class:`ZipFile` 建構函式相同的參數,以及一" "個額外的參數 *optimize*。" -#: ../../library/zipfile.rst:709 +#: ../../library/zipfile.rst:719 msgid "Added the *optimize* parameter." msgstr "新增 *optimize* 參數。" -#: ../../library/zipfile.rst:715 +#: ../../library/zipfile.rst:725 msgid "" "Instances have one method in addition to those of :class:`ZipFile` objects:" msgstr "實例除了 :class:`ZipFile` 物件的方法之外,還有一個額外的方法:" -#: ../../library/zipfile.rst:719 +#: ../../library/zipfile.rst:729 msgid "" "Search for files :file:`\\*.py` and add the corresponding file to the " "archive." msgstr "搜尋 :file:`\\*.py` 檔案,並將對應的檔案加入封存檔案。" -#: ../../library/zipfile.rst:722 +#: ../../library/zipfile.rst:732 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was not given or ``-1``, " "the corresponding file is a :file:`\\*.pyc` file, compiling if necessary." @@ -1058,7 +1067,7 @@ msgstr "" "如果傳給 :class:`PyZipFile` 的 *optimize* 參數未被給定或為 ``-1``,則對應的檔" "案是一個 :file:`\\*.pyc` 檔案,如有必要則進行編譯。" -#: ../../library/zipfile.rst:725 +#: ../../library/zipfile.rst:735 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was ``0``, ``1`` or ``2``, " "only files with that optimization level (see :func:`compile`) are added to " @@ -1068,7 +1077,7 @@ msgstr "" "有具有該最佳化層級(參閱 :func:`compile`)的檔案會被加入封存檔案,如有必要則" "進行編譯。" -#: ../../library/zipfile.rst:729 +#: ../../library/zipfile.rst:739 msgid "" "If *pathname* is a file, the filename must end with :file:`.py`, and just " "the (corresponding :file:`\\*.pyc`) file is added at the top level (no path " @@ -1087,11 +1096,11 @@ msgstr "" "是一個套件目錄,則所有 :file:`\\*.pyc` 都會以檔案路徑的形式被加到套件名稱下," "且如果任何子目錄是套件目錄,所有這些都會以排序後的順序遞迴地加入。" -#: ../../library/zipfile.rst:739 +#: ../../library/zipfile.rst:749 msgid "*basename* is intended for internal use only." msgstr "*basename* 僅供內部使用。" -#: ../../library/zipfile.rst:741 +#: ../../library/zipfile.rst:751 msgid "" "*filterfunc*, if given, must be a function taking a single string argument. " "It will be passed each path (including each individual full file path) " @@ -1107,7 +1116,7 @@ msgstr "" "果我們的測試檔案要嘛在 ``test`` 目錄中,要嘛以字串 ``test_`` 開頭,我們可以使" "用一個 *filterfunc* 來排除它們: ::" -#: ../../library/zipfile.rst:749 +#: ../../library/zipfile.rst:759 msgid "" ">>> zf = PyZipFile('myprog.zip')\n" ">>> def notests(s):\n" @@ -1123,11 +1132,11 @@ msgstr "" "...\n" ">>> zf.writepy('myprog', filterfunc=notests)" -#: ../../library/zipfile.rst:756 +#: ../../library/zipfile.rst:766 msgid "The :meth:`writepy` method makes archives with file names like this::" msgstr ":meth:`writepy` 方法會建立帶有如下檔名的封存檔案: ::" -#: ../../library/zipfile.rst:759 +#: ../../library/zipfile.rst:769 msgid "" "string.pyc # Top level name\n" "test/__init__.pyc # Package directory\n" @@ -1141,23 +1150,23 @@ msgstr "" "test/bogus/__init__.pyc # 子套件目錄\n" "test/bogus/myfile.pyc # 子模組 test.bogus.myfile" -#: ../../library/zipfile.rst:765 +#: ../../library/zipfile.rst:775 msgid "Added the *filterfunc* parameter." msgstr "新增 *filterfunc* 參數。" -#: ../../library/zipfile.rst:768 +#: ../../library/zipfile.rst:778 msgid "The *pathname* parameter accepts a :term:`path-like object`." msgstr "*pathname* 參數接受一個 :term:`path-like object`。" -#: ../../library/zipfile.rst:771 +#: ../../library/zipfile.rst:781 msgid "Recursion sorts directory entries." msgstr "遞迴會對目錄條目進行排序。" -#: ../../library/zipfile.rst:778 +#: ../../library/zipfile.rst:788 msgid "ZipInfo Objects" msgstr "ZipInfo 物件" -#: ../../library/zipfile.rst:780 +#: ../../library/zipfile.rst:790 msgid "" "Instances of the :class:`ZipInfo` class are returned by the :meth:`.getinfo` " "and :meth:`.infolist` methods of :class:`ZipFile` objects. Each object " @@ -1166,13 +1175,13 @@ msgstr "" ":class:`ZipInfo` 類別的實例由 :class:`ZipFile` 物件的 :meth:`.getinfo` 和 :" "meth:`.infolist` 方法回傳。每個物件儲存關於 ZIP 封存檔案單一成員的資訊。" -#: ../../library/zipfile.rst:784 +#: ../../library/zipfile.rst:794 msgid "" "There is one classmethod to make a :class:`ZipInfo` instance for a " "filesystem file:" msgstr "有一個類別方法可以為檔案系統中的檔案建立一個 :class:`ZipInfo` 實例:" -#: ../../library/zipfile.rst:790 +#: ../../library/zipfile.rst:800 msgid "" "Construct a :class:`ZipInfo` instance for a file on the filesystem, in " "preparation for adding it to a zip file." @@ -1180,11 +1189,11 @@ msgstr "" "為檔案系統上的一個檔案建構一個 :class:`ZipInfo` 實例,為將其加入 zip 檔案做準" "備。" -#: ../../library/zipfile.rst:793 +#: ../../library/zipfile.rst:803 msgid "*filename* should be the path to a file or directory on the filesystem." msgstr "*filename* 應為檔案系統上一個檔案或目錄的路徑。" -#: ../../library/zipfile.rst:795 +#: ../../library/zipfile.rst:805 msgid "" "If *arcname* is specified, it is used as the name within the archive. If " "*arcname* is not specified, the name will be the same as *filename*, but " @@ -1193,100 +1202,100 @@ msgstr "" "如果指定了 *arcname*,它將被用作封存檔案內的名稱。如果未指定 *arcname*,名稱" "將與 *filename* 相同,但會移除任何磁碟機代號和開頭的路徑分隔符。" -#: ../../library/zipfile.rst:807 +#: ../../library/zipfile.rst:817 msgid "The *filename* parameter accepts a :term:`path-like object`." msgstr "*filename* 參數接受一個 :term:`path-like object`。" -#: ../../library/zipfile.rst:810 +#: ../../library/zipfile.rst:820 msgid "Added the *strict_timestamps* keyword-only parameter." msgstr "新增了 *strict_timestamps* 僅限關鍵字參數。" -#: ../../library/zipfile.rst:814 +#: ../../library/zipfile.rst:824 msgid "Instances have the following methods and attributes:" msgstr "實例具有以下方法和屬性:" -#: ../../library/zipfile.rst:818 +#: ../../library/zipfile.rst:828 msgid "Return ``True`` if this archive member is a directory." msgstr "如果此封存成員是一個目錄,則回傳 ``True``。" -#: ../../library/zipfile.rst:820 +#: ../../library/zipfile.rst:830 msgid "This uses the entry's name: directories should always end with ``/``." msgstr "這會使用條目的名稱:目錄應總是以 ``/`` 結尾。" -#: ../../library/zipfile.rst:827 +#: ../../library/zipfile.rst:837 msgid "Name of the file in the archive." msgstr "封存檔案中檔案的名稱。" -#: ../../library/zipfile.rst:832 +#: ../../library/zipfile.rst:842 msgid "" "The time and date of the last modification to the archive member. This is a " "tuple of six values representing the \"last [modified] file time\" and " "\"last [modified] file date\" fields from the ZIP file's central directory." msgstr "" -"封存成員的最後修改時間和日期。這是一個包含六個值的元組,代表 ZIP 檔案中" -"中央目錄的「最後 [修改] 檔案時間」和「最後 [修改] 檔案日期」欄位。" +"封存成員的最後修改時間和日期。這是一個包含六個值的元組,代表 ZIP 檔案中中央目" +"錄的「最後 [修改] 檔案時間」和「最後 [修改] 檔案日期」欄位。" -#: ../../library/zipfile.rst:836 +#: ../../library/zipfile.rst:846 msgid "The tuple contains:" msgstr "該元組包含:" -#: ../../library/zipfile.rst:839 +#: ../../library/zipfile.rst:849 msgid "Index" msgstr "索引" -#: ../../library/zipfile.rst:839 +#: ../../library/zipfile.rst:849 msgid "Value" msgstr "值" -#: ../../library/zipfile.rst:841 +#: ../../library/zipfile.rst:851 msgid "``0``" msgstr "``0``" -#: ../../library/zipfile.rst:841 +#: ../../library/zipfile.rst:851 msgid "Year (>= 1980)" msgstr "年(>= 1980)" -#: ../../library/zipfile.rst:843 +#: ../../library/zipfile.rst:853 msgid "``1``" msgstr "``1``" -#: ../../library/zipfile.rst:843 +#: ../../library/zipfile.rst:853 msgid "Month (one-based)" msgstr "月(從 1 開始)" -#: ../../library/zipfile.rst:845 +#: ../../library/zipfile.rst:855 msgid "``2``" msgstr "``2``" -#: ../../library/zipfile.rst:845 +#: ../../library/zipfile.rst:855 msgid "Day of month (one-based)" msgstr "日(從 1 開始)" -#: ../../library/zipfile.rst:847 +#: ../../library/zipfile.rst:857 msgid "``3``" msgstr "``3``" -#: ../../library/zipfile.rst:847 +#: ../../library/zipfile.rst:857 msgid "Hours (zero-based)" msgstr "時(從 0 開始)" -#: ../../library/zipfile.rst:849 +#: ../../library/zipfile.rst:859 msgid "``4``" msgstr "``4``" -#: ../../library/zipfile.rst:849 +#: ../../library/zipfile.rst:859 msgid "Minutes (zero-based)" msgstr "分(從 0 開始)" -#: ../../library/zipfile.rst:851 +#: ../../library/zipfile.rst:861 msgid "``5``" msgstr "``5``" -#: ../../library/zipfile.rst:851 +#: ../../library/zipfile.rst:861 msgid "Seconds (zero-based)" msgstr "秒(從 0 開始)" -#: ../../library/zipfile.rst:856 +#: ../../library/zipfile.rst:866 msgid "" "The ZIP format supports multiple timestamp fields in different locations " "(central directory, extra fields for NTFS/UNIX systems, etc.). This " @@ -1297,21 +1306,21 @@ msgid "" "timestamp." msgstr "" -#: ../../library/zipfile.rst:863 +#: ../../library/zipfile.rst:873 msgid "" "The central directory timestamp is interpreted as representing local time, " "rather than UTC time, to match the behavior of other zip tools." msgstr "" -#: ../../library/zipfile.rst:869 +#: ../../library/zipfile.rst:879 msgid "Type of compression for the archive member." msgstr "封存成員的壓縮型別。" -#: ../../library/zipfile.rst:874 +#: ../../library/zipfile.rst:884 msgid "Comment for the individual archive member as a :class:`bytes` object." msgstr "個別封存成員的註解,為一個 :class:`bytes` 物件。" -#: ../../library/zipfile.rst:879 +#: ../../library/zipfile.rst:889 msgid "" "Expansion field data. The `PKZIP Application Note`_ contains some comments " "on the internal structure of the data contained in this :class:`bytes` " @@ -1320,66 +1329,66 @@ msgstr "" "擴充欄位資料。`PKZIP Application Note`_ 包含一些關於此 :class:`bytes` 物件中" "所含資料內部結構的註解。" -#: ../../library/zipfile.rst:886 +#: ../../library/zipfile.rst:896 msgid "System which created ZIP archive." msgstr "建立 ZIP 封存檔案的系統。" -#: ../../library/zipfile.rst:891 +#: ../../library/zipfile.rst:901 msgid "PKZIP version which created ZIP archive." msgstr "建立 ZIP 封存檔案的 PKZIP 版本。" -#: ../../library/zipfile.rst:896 +#: ../../library/zipfile.rst:906 msgid "PKZIP version needed to extract archive." msgstr "解壓縮封存檔案所需的 PKZIP 版本。" -#: ../../library/zipfile.rst:901 +#: ../../library/zipfile.rst:911 msgid "Must be zero." msgstr "必須為零。" -#: ../../library/zipfile.rst:906 +#: ../../library/zipfile.rst:916 msgid "ZIP flag bits." msgstr "ZIP 旗標位元。" -#: ../../library/zipfile.rst:911 +#: ../../library/zipfile.rst:921 msgid "Volume number of file header." msgstr "檔案標頭的磁碟空間編號。" -#: ../../library/zipfile.rst:916 +#: ../../library/zipfile.rst:926 msgid "Internal attributes." msgstr "內部屬性。" -#: ../../library/zipfile.rst:921 +#: ../../library/zipfile.rst:931 msgid "External file attributes." msgstr "外部檔案屬性。" -#: ../../library/zipfile.rst:926 +#: ../../library/zipfile.rst:936 msgid "Byte offset to the file header." msgstr "到檔案標頭的位元組偏移量。" -#: ../../library/zipfile.rst:931 +#: ../../library/zipfile.rst:941 msgid "CRC-32 of the uncompressed file." msgstr "未壓縮檔案的 CRC-32。" -#: ../../library/zipfile.rst:936 +#: ../../library/zipfile.rst:946 msgid "Size of the compressed data." msgstr "壓縮資料的大小。" -#: ../../library/zipfile.rst:941 +#: ../../library/zipfile.rst:951 msgid "Size of the uncompressed file." msgstr "未壓縮檔案的大小。" -#: ../../library/zipfile.rst:948 +#: ../../library/zipfile.rst:958 msgid "Command-Line Interface" msgstr "命令列介面" -#: ../../library/zipfile.rst:950 +#: ../../library/zipfile.rst:960 msgid "" "The :mod:`zipfile` module provides a simple command-line interface to " "interact with ZIP archives." msgstr "" ":mod:`zipfile` 模組提供了一個簡單的命令列介面,用以與 ZIP 封存檔案互動。" -#: ../../library/zipfile.rst:953 +#: ../../library/zipfile.rst:963 msgid "" "If you want to create a new ZIP archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" @@ -1387,78 +1396,78 @@ msgstr "" "如果你想建立一個新的 ZIP 封存檔案,請在 :option:`-c` 選項後指定其名稱,然後列" "出應包含的檔名:" -#: ../../library/zipfile.rst:956 +#: ../../library/zipfile.rst:966 msgid "$ python -m zipfile -c monty.zip spam.txt eggs.txt" msgstr "$ python -m zipfile -c monty.zip spam.txt eggs.txt" -#: ../../library/zipfile.rst:960 +#: ../../library/zipfile.rst:970 msgid "Passing a directory is also acceptable:" msgstr "傳遞一個目錄也是可以的:" -#: ../../library/zipfile.rst:962 +#: ../../library/zipfile.rst:972 msgid "$ python -m zipfile -c monty.zip life-of-brian_1979/" msgstr "$ python -m zipfile -c monty.zip life-of-brian_1979/" -#: ../../library/zipfile.rst:966 +#: ../../library/zipfile.rst:976 msgid "" "If you want to extract a ZIP archive into the specified directory, use the :" "option:`-e` option:" msgstr "" "如果你想將一個 ZIP 封存檔案解壓縮到指定的目錄,請使用 :option:`-e` 選項:" -#: ../../library/zipfile.rst:969 +#: ../../library/zipfile.rst:979 msgid "$ python -m zipfile -e monty.zip target-dir/" msgstr "$ python -m zipfile -e monty.zip target-dir/" -#: ../../library/zipfile.rst:973 +#: ../../library/zipfile.rst:983 msgid "For a list of the files in a ZIP archive, use the :option:`-l` option:" msgstr "要列出 ZIP 封存檔案中的檔案,請使用 :option:`-l` 選項:" -#: ../../library/zipfile.rst:975 +#: ../../library/zipfile.rst:985 msgid "$ python -m zipfile -l monty.zip" msgstr "$ python -m zipfile -l monty.zip" -#: ../../library/zipfile.rst:981 +#: ../../library/zipfile.rst:991 msgid "Command-line options" msgstr "命令列選項" -#: ../../library/zipfile.rst:986 +#: ../../library/zipfile.rst:996 msgid "List files in a zipfile." msgstr "列出 zipfile 中的檔案。" -#: ../../library/zipfile.rst:991 +#: ../../library/zipfile.rst:1001 msgid "Create zipfile from source files." msgstr "從來源檔案建立 zipfile。" -#: ../../library/zipfile.rst:996 +#: ../../library/zipfile.rst:1006 msgid "Extract zipfile into target directory." msgstr "將 zipfile 解壓縮到目標目錄。" -#: ../../library/zipfile.rst:1001 +#: ../../library/zipfile.rst:1011 msgid "Test whether the zipfile is valid or not." msgstr "測試 zipfile 是否有效。" -#: ../../library/zipfile.rst:1005 +#: ../../library/zipfile.rst:1015 msgid "" "Specify encoding of member names for :option:`-l`, :option:`-e` and :option:" "`-t`." msgstr "為 :option:`-l`、:option:`-e` 和 :option:`-t` 指定成員名稱的編碼。" -#: ../../library/zipfile.rst:1012 +#: ../../library/zipfile.rst:1022 msgid "Decompression pitfalls" msgstr "解壓縮的陷阱" -#: ../../library/zipfile.rst:1014 +#: ../../library/zipfile.rst:1024 msgid "" "The extraction in zipfile module might fail due to some pitfalls listed " "below." msgstr "zipfile 模組中的解壓縮可能會由於下面列出的一些陷阱而失敗。" -#: ../../library/zipfile.rst:1017 +#: ../../library/zipfile.rst:1027 msgid "From file itself" msgstr "來自檔案本身" -#: ../../library/zipfile.rst:1019 +#: ../../library/zipfile.rst:1029 msgid "" "Decompression may fail due to incorrect password / CRC checksum / ZIP format " "or unsupported compression method / decryption." @@ -1466,11 +1475,11 @@ msgstr "" "解壓縮可能由於不正確的密碼 / CRC 校驗和 / ZIP 格式或不支援的壓縮方法 / 解密而" "失敗。" -#: ../../library/zipfile.rst:1023 +#: ../../library/zipfile.rst:1033 msgid "File System limitations" msgstr "檔案系統限制" -#: ../../library/zipfile.rst:1025 +#: ../../library/zipfile.rst:1035 msgid "" "Exceeding limitations on different file systems can cause decompression " "failed. Such as allowable characters in the directory entries, length of the " @@ -1480,11 +1489,11 @@ msgstr "" "超出不同檔案系統的限制可能導致解壓縮失敗。例如目錄條目中允許的字元、檔名長" "度、路徑名長度、單一檔案的大小以及檔案數量等。" -#: ../../library/zipfile.rst:1032 +#: ../../library/zipfile.rst:1042 msgid "Resources limitations" msgstr "資源限制" -#: ../../library/zipfile.rst:1034 +#: ../../library/zipfile.rst:1044 msgid "" "The lack of memory or disk volume would lead to decompression failed. For " "example, decompression bombs (aka `ZIP bomb`_) apply to zipfile library that " @@ -1493,11 +1502,11 @@ msgstr "" "記憶體或磁碟空間不足會導致解壓縮失敗。例如,解壓縮炸彈(又稱 `ZIP bomb`_)適" "用於 zipfile 函式庫,可能導致磁碟空間耗盡。" -#: ../../library/zipfile.rst:1039 +#: ../../library/zipfile.rst:1049 msgid "Interruption" msgstr "中斷" -#: ../../library/zipfile.rst:1041 +#: ../../library/zipfile.rst:1051 msgid "" "Interruption during the decompression, such as pressing control-C or killing " "the decompression process may result in incomplete decompression of the " @@ -1506,11 +1515,11 @@ msgstr "" "在解壓縮過程中斷,例如按下 control-C 或終止解壓縮過程,可能導致封存檔案解壓縮" "不完整。" -#: ../../library/zipfile.rst:1045 +#: ../../library/zipfile.rst:1055 msgid "Default behaviors of extraction" msgstr "解壓縮的預設行為" -#: ../../library/zipfile.rst:1047 +#: ../../library/zipfile.rst:1057 msgid "" "Not knowing the default extraction behaviors can cause unexpected " "decompression results. For example, when extracting the same archive twice, " diff --git a/library/zlib.po b/library/zlib.po index 5599a87b72a..55e4b2d2a14 100644 --- a/library/zlib.po +++ b/library/zlib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-22 00:14+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2022-12-28 20:58+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,18 +25,19 @@ msgstr ":mod:`!zlib` --- 相容於 :program:`gzip` 的壓縮" #: ../../library/zlib.rst:10 msgid "" "For applications that require data compression, the functions in this module " -"allow compression and decompression, using the zlib library. The zlib " -"library has its own home page at https://www.zlib.net. There are known " -"incompatibilities between the Python module and versions of the zlib library " -"earlier than 1.1.3; 1.1.3 has a `security vulnerability `_, so we recommend using 1.1.4 or later." +"allow compression and decompression, using the `zlib library `_." msgstr "" -"對於需要資料壓縮的應用程式,此模組提供了能夠使用 zlib 函式庫進行壓縮和解壓縮" -"的函式。zlib 函式庫有自己的主頁 https://www.zlib.net。已知 Python 模組與早於 " -"1.1.3 的 zlib 函式庫版本之間並不相容;1.1.3 存在\\ `安全漏洞 `_,因此我們建議使用 1.1.4 或更新的版本。" -#: ../../library/zlib.rst:17 +#: ../../includes/optional-module.rst:1 +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." +msgstr "" + +#: ../../library/zlib.rst:15 msgid "" "zlib's functions have many options and often need to be used in a particular " "order. This documentation doesn't attempt to cover all of the permutations; " @@ -44,21 +45,22 @@ msgid "" "authoritative information." msgstr "" "zlib 的函式有很多選項,且通常需要按特定順序使用。本文件並不打算解說所有選項排" -"列組合的效果;相關官方資訊,請參閱 `zlib 手冊 `_。" +"列組合的效果;相關官方資訊,請參閱 `zlib 手冊 `_。" -#: ../../library/zlib.rst:22 +#: ../../library/zlib.rst:20 msgid "For reading and writing ``.gz`` files see the :mod:`gzip` module." msgstr "若要讀寫 ``.gz`` 文件,請參閱 :mod:`gzip` 模組。" -#: ../../library/zlib.rst:24 +#: ../../library/zlib.rst:22 msgid "The available exception and functions in this module are:" msgstr "該模組中可用的例外和函式是:" -#: ../../library/zlib.rst:29 +#: ../../library/zlib.rst:27 msgid "Exception raised on compression and decompression errors." msgstr "當壓縮和解壓縮發生錯誤時引發的例外。" -#: ../../library/zlib.rst:34 +#: ../../library/zlib.rst:32 msgid "" "Computes an Adler-32 checksum of *data*. (An Adler-32 checksum is almost as " "reliable as a CRC32 but can be computed much more quickly.) The result is " @@ -77,11 +79,11 @@ msgstr "" "於身份驗證 (authentication) 或數位簽章 (digital signature)。由於該演算法是為" "核對和演算法而設計的,它並不適合作為通用的雜湊演算法。" -#: ../../library/zlib.rst:44 ../../library/zlib.rst:133 +#: ../../library/zlib.rst:42 ../../library/zlib.rst:131 msgid "The result is always unsigned." msgstr "結果總是為 unsigned。" -#: ../../library/zlib.rst:49 +#: ../../library/zlib.rst:47 msgid "" "Compresses the bytes in *data*, returning a bytes object containing " "compressed data. *level* is an integer from ``0`` to ``9`` or ``-1`` " @@ -91,12 +93,12 @@ msgid "" "about these values." msgstr "" "壓縮 *data* 中的位元組,回傳一個包含壓縮資料的位元組物件。 *level* 是從 " -"``0`` 到 ``9`` 或 ``-1`` 的整數,控制了壓縮的級別;請見 :const:`Z_BEST_SPEED` " -"(``1``)、:const:`Z_BEST_COMPRESSION` (``9``)、:const:`Z_NO_COMPRESSION` " -"(``0``),以及預設值 :const:`Z_DEFAULT_COMPRESSION` (``-1``) 以得到更多關於這些值" -"的資訊。" +"``0`` 到 ``9`` 或 ``-1`` 的整數,控制了壓縮的級別;請見 :const:" +"`Z_BEST_SPEED` (``1``)、:const:`Z_BEST_COMPRESSION` (``9``)、:const:" +"`Z_NO_COMPRESSION` (``0``),以及預設值 :const:`Z_DEFAULT_COMPRESSION` " +"(``-1``) 以得到更多關於這些值的資訊。" -#: ../../library/zlib.rst:57 +#: ../../library/zlib.rst:55 msgid "" "The *wbits* argument controls the size of the history buffer (or the " "\"window size\") used when compressing data, and whether a header and " @@ -107,7 +109,7 @@ msgstr "" "「視窗大小」),以及輸出中是否包含標題和尾末 (trailer)。它可以採用多個值的範" "圍,預設為 ``15`` (:const:`MAX_WBITS`):" -#: ../../library/zlib.rst:62 +#: ../../library/zlib.rst:60 msgid "" "+9 to +15: The base-two logarithm of the window size, which therefore ranges " "between 512 and 32768. Larger values produce better compression at the " @@ -118,7 +120,7 @@ msgstr "" "產生更佳的壓縮,但會佔用更多的記憶體。生成輸出將包含特定於 zlib 的標頭和尾" "末。" -#: ../../library/zlib.rst:67 +#: ../../library/zlib.rst:65 msgid "" "−9 to −15: Uses the absolute value of *wbits* as the window size logarithm, " "while producing a raw output stream with no header or trailing checksum." @@ -126,7 +128,7 @@ msgstr "" "−9 到 −15:使用 *wbits* 的絕對值作為視窗大小的對數,同時生成沒有標頭或尾末核" "對和的原始輸出串流。" -#: ../../library/zlib.rst:71 +#: ../../library/zlib.rst:69 msgid "" "+25 to +31 = 16 + (9 to 15): Uses the low 4 bits of the value as the window " "size logarithm, while including a basic :program:`gzip` header and trailing " @@ -135,27 +137,27 @@ msgstr "" "+25 到 +31 = 16 +(9 到 15):使用數值的最低 4 位元作為視窗大小的對數,同時在" "輸出中包含基本的 gzip 標頭和尾末核對和。" -#: ../../library/zlib.rst:75 +#: ../../library/zlib.rst:73 msgid "Raises the :exc:`error` exception if any error occurs." msgstr "如果發生任何錯誤,則引發 :exc:`error` 例外。" -#: ../../library/zlib.rst:77 +#: ../../library/zlib.rst:75 msgid "*level* can now be used as a keyword parameter." msgstr "*level* 現在可以用作關鍵字參數。" -#: ../../library/zlib.rst:80 +#: ../../library/zlib.rst:78 msgid "" "The *wbits* parameter is now available to set window bits and compression " "type." msgstr "*wbits* 參數現在可用於設定視窗位元和壓縮型別。" -#: ../../library/zlib.rst:86 +#: ../../library/zlib.rst:84 msgid "" "Returns a compression object, to be used for compressing data streams that " "won't fit into memory at once." msgstr "回傳一個壓縮物件,用於壓縮不能一次全部放入記憶體中的資料串流。" -#: ../../library/zlib.rst:89 +#: ../../library/zlib.rst:87 msgid "" "*level* is the compression level -- an integer from ``0`` to ``9`` or " "``-1``. See :const:`Z_BEST_SPEED` (``1``), :const:`Z_BEST_COMPRESSION` " @@ -163,13 +165,13 @@ msgid "" "`Z_DEFAULT_COMPRESSION` (``-1``) for more information about these values." msgstr "" -#: ../../library/zlib.rst:94 +#: ../../library/zlib.rst:92 msgid "" "*method* is the compression algorithm. Currently, the only supported value " "is :const:`DEFLATED`." msgstr "*method* 代表壓縮演算法。目前唯一支援的值是 :const:`DEFLATED`。" -#: ../../library/zlib.rst:97 +#: ../../library/zlib.rst:95 msgid "" "The *wbits* parameter controls the size of the history buffer (or the " "\"window size\"), and what header and trailer format will be used. It has " @@ -178,7 +180,7 @@ msgstr "" "*wbits* 參數控制歷史紀錄緩衝區的大小(或「視窗大小」),以及將使用的標頭和尾" "末格式。它與\\ `前面敘述的 compress() <#compress-wbits>`__ 具有相同的含義。" -#: ../../library/zlib.rst:101 +#: ../../library/zlib.rst:99 msgid "" "The *memLevel* argument controls the amount of memory used for the internal " "compression state. Valid values range from ``1`` to ``9``. Higher values use " @@ -187,17 +189,17 @@ msgstr "" "*memLevel* 引數控制用於內部壓縮狀態的記憶體大小。有效值範圍為 ``1`` 到 " "``9``。較高的值會使用更多的記憶體,但速度更快並產生更小的輸出。" -#: ../../library/zlib.rst:105 +#: ../../library/zlib.rst:103 msgid "" "*strategy* is used to tune the compression algorithm. Possible values are :" "const:`Z_DEFAULT_STRATEGY`, :const:`Z_FILTERED`, :const:`Z_HUFFMAN_ONLY`, :" "const:`Z_RLE` and :const:`Z_FIXED`." msgstr "" "*strategy* 被用於調整壓縮演算法。可用的值為 :const:`Z_DEFAULT_STRATEGY`、:" -"const:`Z_FILTERED`、:const:`Z_HUFFMAN_ONLY`、:const:`Z_RLE` " -"和 :const:`Z_FIXED`。" +"const:`Z_FILTERED`、:const:`Z_HUFFMAN_ONLY`、:const:`Z_RLE` 和 :const:" +"`Z_FIXED`。" -#: ../../library/zlib.rst:109 +#: ../../library/zlib.rst:107 msgid "" "*zdict* is a predefined compression dictionary. This is a sequence of bytes " "(such as a :class:`bytes` object) containing subsequences that are expected " @@ -208,11 +210,11 @@ msgstr "" "`bytes` 物件),其中包含預期在要壓縮的資料中頻繁出現的子序列。那些預期會最常" "見的子序列應該出現在字典的尾末。" -#: ../../library/zlib.rst:114 +#: ../../library/zlib.rst:112 msgid "Added the *zdict* parameter and keyword argument support." msgstr "新增 *zdict* 參數與支援關鍵字引數。" -#: ../../library/zlib.rst:124 +#: ../../library/zlib.rst:122 msgid "" "Computes a CRC (Cyclic Redundancy Check) checksum of *data*. The result is " "an unsigned 32-bit integer. If *value* is present, it is used as the " @@ -229,7 +231,7 @@ msgstr "" "不夠高,不該用於身份驗證或數位簽章。由於該演算法是為核對和演算法而設計的,它" "並不適合作為通用的雜湊演算法。" -#: ../../library/zlib.rst:138 +#: ../../library/zlib.rst:136 msgid "" "Decompresses the bytes in *data*, returning a bytes object containing the " "uncompressed data. The *wbits* parameter depends on the format of *data*, " @@ -241,7 +243,7 @@ msgstr "" "於 *data* 的格式,下面將進一步討論。如果有給定 *bufsize*,它會被用作輸出緩衝" "區的初始大小。如果發生任何錯誤,則引發 :exc:`error` 例外。" -#: ../../library/zlib.rst:146 +#: ../../library/zlib.rst:144 msgid "" "The *wbits* parameter controls the size of the history buffer (or \"window " "size\"), and what header and trailer format is expected. It is similar to " @@ -250,21 +252,21 @@ msgstr "" "*wbits* 參數控制歷史紀錄緩衝區的大小(或「視窗大小」),以及期望的標頭和尾末" "格式。它類似於 :func:`compressobj` 的參數,但接受更多範圍的值:" -#: ../../library/zlib.rst:151 +#: ../../library/zlib.rst:149 msgid "" "+8 to +15: The base-two logarithm of the window size. The input must " "include a zlib header and trailer." msgstr "" "+8 到 +15:視窗大小的以二為底的對數。輸入必須包括一個 zlib 標頭和尾末。" -#: ../../library/zlib.rst:154 +#: ../../library/zlib.rst:152 msgid "" "0: Automatically determine the window size from the zlib header. Only " "supported since zlib 1.2.3.5." msgstr "" "0:根據 zlib 標頭檔自動決定視窗大小。僅有在 zlib 1.2.3.5 或更新的版本支援。" -#: ../../library/zlib.rst:157 +#: ../../library/zlib.rst:155 msgid "" "−8 to −15: Uses the absolute value of *wbits* as the window size logarithm. " "The input must be a raw stream with no header or trailer." @@ -272,7 +274,7 @@ msgstr "" "−8 to −15:使用 *wbits* 的絕對值作為視窗大小的對數,輸入必須是沒有標頭或尾末" "的原始串流。" -#: ../../library/zlib.rst:160 +#: ../../library/zlib.rst:158 msgid "" "+24 to +31 = 16 + (8 to 15): Uses the low 4 bits of the value as the window " "size logarithm. The input must include a gzip header and trailer." @@ -280,7 +282,7 @@ msgstr "" "+24 到 +31 = 16 + (8 到 15):取值的最低4位元作為視窗大小的對數,輸入必須包" "含 gzip 標頭和尾末。" -#: ../../library/zlib.rst:164 +#: ../../library/zlib.rst:162 msgid "" "+40 to +47 = 32 + (8 to 15): Uses the low 4 bits of the value as the window " "size logarithm, and automatically accepts either the zlib or gzip format." @@ -288,7 +290,7 @@ msgstr "" "+40 到 +47 = 32 + (8 到 15):使用值的最低 4 位元作為視窗大小的對數,並自動" "接受 zlib 或 gzip 格式。" -#: ../../library/zlib.rst:168 +#: ../../library/zlib.rst:166 msgid "" "When decompressing a stream, the window size must not be smaller than the " "size originally used to compress the stream; using a too-small value may " @@ -300,7 +302,7 @@ msgstr "" "會導致 :exc:`error` 例外。預設的 *wbits* 值對應於最大的視窗大小,並且需要包" "含 zlib 標頭和尾末。" -#: ../../library/zlib.rst:174 +#: ../../library/zlib.rst:172 msgid "" "*bufsize* is the initial size of the buffer used to hold decompressed data. " "If more space is required, the buffer size will be increased as needed, so " @@ -311,17 +313,17 @@ msgstr "" "小將根據需求來增加,因此你不需要讓該值完全剛好;調整它只會節省幾次對 :c:func:" "`malloc` 的呼叫。" -#: ../../library/zlib.rst:179 +#: ../../library/zlib.rst:177 msgid "*wbits* and *bufsize* can be used as keyword arguments." msgstr "*wbits* 和 *bufsize* 可以用作關鍵字引數。" -#: ../../library/zlib.rst:184 +#: ../../library/zlib.rst:182 msgid "" "Returns a decompression object, to be used for decompressing data streams " "that won't fit into memory at once." msgstr "回傳一個解壓縮物件,用於解壓縮不能一次全部放入記憶體的資料串流。" -#: ../../library/zlib.rst:187 +#: ../../library/zlib.rst:185 msgid "" "The *wbits* parameter controls the size of the history buffer (or the " "\"window size\"), and what header and trailer format is expected. It has " @@ -330,7 +332,7 @@ msgstr "" "*wbits* 引數控制歷史紀錄緩衝區的大小(或「視窗大小」),以及期望的標頭和尾末" "格式。它與\\ `前面敘述的 decompress() <#decompress-wbits>`__ 具有相同的含義。" -#: ../../library/zlib.rst:191 +#: ../../library/zlib.rst:189 msgid "" "The *zdict* parameter specifies a predefined compression dictionary. If " "provided, this must be the same dictionary as was used by the compressor " @@ -339,7 +341,7 @@ msgstr "" "*zdict* 參數指定是先定義好的壓縮字典。如果有提供,這必須與生成要解壓縮資料的" "壓縮器所使用的字典相同。" -#: ../../library/zlib.rst:197 +#: ../../library/zlib.rst:195 msgid "" "If *zdict* is a mutable object (such as a :class:`bytearray`), you must not " "modify its contents between the call to :func:`decompressobj` and the first " @@ -349,15 +351,15 @@ msgstr "" "你不能在呼叫 :func:`decompressobj` 和第一次呼叫解壓縮器的 ``decompress()`` 方" "法之間修改它的內容。" -#: ../../library/zlib.rst:201 +#: ../../library/zlib.rst:199 msgid "Added the *zdict* parameter." msgstr "新增 *zdict* 參數。" -#: ../../library/zlib.rst:205 +#: ../../library/zlib.rst:203 msgid "Compression objects support the following methods:" msgstr "壓縮物件支援以下方法:" -#: ../../library/zlib.rst:210 +#: ../../library/zlib.rst:208 msgid "" "Compress *data*, returning a bytes object containing compressed data for at " "least part of the data in *data*. This data should be concatenated to the " @@ -368,7 +370,7 @@ msgstr "" "資料應串聯到任何先前呼叫 :meth:`compress` 方法所產生的輸出。一些輸入可能會保" "存在內部緩衝區中以供後續處理。" -#: ../../library/zlib.rst:218 +#: ../../library/zlib.rst:216 msgid "" "All pending input is processed, and a bytes object containing the remaining " "compressed output is returned. *mode* can be selected from the constants :" @@ -382,29 +384,29 @@ msgid "" msgstr "" "處理所有待處理的輸入,並回傳包含剩餘壓縮輸出的位元組物件。*mode* 可以從以下常" "數中選擇::const:`Z_NO_FLUSH`、:const:`Z_PARTIAL_FLUSH`、:const:" -"`Z_SYNC_FLUSH`、:const:`Z_FULL_FLUSH`、:const:`Z_BLOCK` 或 :" -"const:`Z_FINISH`,預設為 :const:`Z_FINISH`。除了 :const:`Z_FINISH` 之外,所有" -"常數都允許壓縮更多的資料位元組字串,而 :const:`Z_FINISH` 會完成壓縮串流並同時" -"防止壓縮更多資料。在 *mode* 設定為 :const:`Z_FINISH` 的情況下呼叫 :meth:" -"`flush` 後,無法再次呼叫 :meth:`compress` 方法;唯一可行的作法是刪除物件。" +"`Z_SYNC_FLUSH`、:const:`Z_FULL_FLUSH`、:const:`Z_BLOCK` 或 :const:" +"`Z_FINISH`,預設為 :const:`Z_FINISH`。除了 :const:`Z_FINISH` 之外,所有常數都" +"允許壓縮更多的資料位元組字串,而 :const:`Z_FINISH` 會完成壓縮串流並同時防止壓" +"縮更多資料。在 *mode* 設定為 :const:`Z_FINISH` 的情況下呼叫 :meth:`flush` " +"後,無法再次呼叫 :meth:`compress` 方法;唯一可行的作法是刪除物件。" -#: ../../library/zlib.rst:231 +#: ../../library/zlib.rst:229 msgid "" "Returns a copy of the compression object. This can be used to efficiently " "compress a set of data that share a common initial prefix." msgstr "回傳壓縮物件的副本,這可用於有效壓縮一組共用初始前綴的資料。" -#: ../../library/zlib.rst:235 +#: ../../library/zlib.rst:233 msgid "" "Added :func:`copy.copy` and :func:`copy.deepcopy` support to compression " "objects." msgstr "於壓縮物件新增對 :func:`copy.copy` 和 :func:`copy.deepcopy` 的支援。" -#: ../../library/zlib.rst:240 +#: ../../library/zlib.rst:238 msgid "Decompression objects support the following methods and attributes:" msgstr "解壓縮物件支援以下方法和屬性:" -#: ../../library/zlib.rst:245 +#: ../../library/zlib.rst:243 msgid "" "A bytes object which contains any bytes past the end of the compressed data. " "That is, this remains ``b\"\"`` until the last byte that contains " @@ -415,7 +417,7 @@ msgstr "" "的最後一個位元組可用之前,它會一直保持為 ``b\"\"``。如果整個位元組字串 " "(bytestring) 有包含壓縮資料,這會是 ``b\"\"``,也就是一個空位元組物件。" -#: ../../library/zlib.rst:253 +#: ../../library/zlib.rst:251 msgid "" "A bytes object that contains any data that was not consumed by the last :" "meth:`decompress` call because it exceeded the limit for the uncompressed " @@ -428,19 +430,19 @@ msgstr "" "有和它串聯的其他資料)反饋給後續的 :meth:`decompress` 方法呼叫以獲得正確的輸" "出。" -#: ../../library/zlib.rst:262 +#: ../../library/zlib.rst:260 msgid "" "A boolean indicating whether the end of the compressed data stream has been " "reached." msgstr "一個布林值,代表是否已到達壓縮資料串流的尾末。" -#: ../../library/zlib.rst:265 +#: ../../library/zlib.rst:263 msgid "" "This makes it possible to distinguish between a properly formed compressed " "stream, and an incomplete or truncated one." msgstr "這使其能夠區分有正確建構的壓縮串流和不完整或被截斷的串流。" -#: ../../library/zlib.rst:273 +#: ../../library/zlib.rst:271 msgid "" "Decompress *data*, returning a bytes object containing the uncompressed data " "corresponding to at least part of the data in *string*. This data should be " @@ -452,7 +454,7 @@ msgstr "" "的未壓縮資料。此資料應串聯到任何先前呼叫 :meth:`decompress` 方法所產生的輸" "出。一些輸入資料可能會保存在內部緩衝區中以供後續處理。" -#: ../../library/zlib.rst:279 +#: ../../library/zlib.rst:277 msgid "" "If the optional parameter *max_length* is non-zero then the return value " "will be no longer than *max_length*. This may mean that not all of the " @@ -468,11 +470,11 @@ msgstr "" "meth:`decompress` 的呼叫。如果 *max_length* 為零,則整個輸入會被解壓縮,並" "且 :attr:`unconsumed_tail` 為空。" -#: ../../library/zlib.rst:286 +#: ../../library/zlib.rst:284 msgid "*max_length* can be used as a keyword argument." msgstr "*max_length* 可以用作關鍵字引數。" -#: ../../library/zlib.rst:292 +#: ../../library/zlib.rst:290 msgid "" "All pending input is processed, and a bytes object containing the remaining " "uncompressed output is returned. After calling :meth:`flush`, the :meth:" @@ -483,12 +485,12 @@ msgstr "" "`flush` 後,無法再次呼叫 :meth:`decompress` 方法;唯一可行的方法是刪除該物" "件。" -#: ../../library/zlib.rst:297 +#: ../../library/zlib.rst:295 msgid "" "The optional parameter *length* sets the initial size of the output buffer." msgstr "可選參數 *length* 設定了輸出緩衝區的初始大小。" -#: ../../library/zlib.rst:302 +#: ../../library/zlib.rst:300 msgid "" "Returns a copy of the decompression object. This can be used to save the " "state of the decompressor midway through the data stream in order to speed " @@ -497,135 +499,135 @@ msgstr "" "回傳解壓物件的副本,這可用於在資料串流中途保存解壓縮器的狀態,以便在未來某個" "時間點加速對串流的隨機搜尋 (random seek)。" -#: ../../library/zlib.rst:307 +#: ../../library/zlib.rst:305 msgid "" "Added :func:`copy.copy` and :func:`copy.deepcopy` support to decompression " "objects." msgstr "於解壓縮物件新增對 :func:`copy.copy` 和 :func:`copy.deepcopy` 支援。" -#: ../../library/zlib.rst:312 +#: ../../library/zlib.rst:310 msgid "" "The following constants are available to configure compression and " "decompression behavior:" msgstr "" -#: ../../library/zlib.rst:317 +#: ../../library/zlib.rst:315 msgid "The deflate compression method." msgstr "" -#: ../../library/zlib.rst:322 +#: ../../library/zlib.rst:320 msgid "" "The maximum window size, expressed as a power of 2. For example, if :const:`!" "MAX_WBITS` is ``15`` it results in a window size of ``32 KiB``." msgstr "" -#: ../../library/zlib.rst:329 +#: ../../library/zlib.rst:327 msgid "The default memory level for compression objects." msgstr "" -#: ../../library/zlib.rst:334 +#: ../../library/zlib.rst:332 msgid "The default buffer size for decompression operations." msgstr "" -#: ../../library/zlib.rst:339 +#: ../../library/zlib.rst:337 msgid "Compression level ``0``; no compression." msgstr "" -#: ../../library/zlib.rst:346 +#: ../../library/zlib.rst:344 msgid "Compression level ``1``; fastest and produces the least compression." msgstr "" -#: ../../library/zlib.rst:351 +#: ../../library/zlib.rst:349 msgid "Compression level ``9``; slowest and produces the most compression." msgstr "" -#: ../../library/zlib.rst:356 +#: ../../library/zlib.rst:354 msgid "" "Default compression level (``-1``); a compromise between speed and " "compression. Currently equivalent to compression level ``6``." msgstr "" -#: ../../library/zlib.rst:362 +#: ../../library/zlib.rst:360 msgid "Default compression strategy, for normal data." msgstr "" -#: ../../library/zlib.rst:367 +#: ../../library/zlib.rst:365 msgid "Compression strategy for data produced by a filter (or predictor)." msgstr "" -#: ../../library/zlib.rst:372 +#: ../../library/zlib.rst:370 msgid "Compression strategy that forces Huffman coding only." msgstr "" -#: ../../library/zlib.rst:377 +#: ../../library/zlib.rst:375 msgid "" "Compression strategy that limits match distances to one (run-length " "encoding)." msgstr "" -#: ../../library/zlib.rst:379 +#: ../../library/zlib.rst:377 msgid "" "This constant is only available if Python was compiled with zlib 1.2.0.1 or " "greater." msgstr "" -#: ../../library/zlib.rst:387 +#: ../../library/zlib.rst:385 msgid "Compression strategy that prevents the use of dynamic Huffman codes." msgstr "" -#: ../../library/zlib.rst:389 ../../library/zlib.rst:426 +#: ../../library/zlib.rst:387 ../../library/zlib.rst:424 msgid "" "This constant is only available if Python was compiled with zlib 1.2.2.2 or " "greater." msgstr "" -#: ../../library/zlib.rst:397 +#: ../../library/zlib.rst:395 msgid "Flush mode ``0``. No special flushing behavior." msgstr "" -#: ../../library/zlib.rst:404 +#: ../../library/zlib.rst:402 msgid "Flush mode ``1``. Flush as much output as possible." msgstr "" -#: ../../library/zlib.rst:409 +#: ../../library/zlib.rst:407 msgid "" "Flush mode ``2``. All output is flushed and the output is aligned to a byte " "boundary." msgstr "" -#: ../../library/zlib.rst:414 +#: ../../library/zlib.rst:412 msgid "" "Flush mode ``3``. All output is flushed and the compression state is reset." msgstr "" -#: ../../library/zlib.rst:419 +#: ../../library/zlib.rst:417 msgid "" "Flush mode ``4``. All pending input is processed, no more input is expected." msgstr "" -#: ../../library/zlib.rst:424 +#: ../../library/zlib.rst:422 msgid "Flush mode ``5``. A deflate block is completed and emitted." msgstr "" -#: ../../library/zlib.rst:434 +#: ../../library/zlib.rst:432 msgid "" "Flush mode ``6``, for inflate operations. Instructs inflate to return when " "it gets to the next deflate block boundary." msgstr "" -#: ../../library/zlib.rst:437 +#: ../../library/zlib.rst:435 msgid "" "This constant is only available if Python was compiled with zlib 1.2.3.4 or " "greater." msgstr "" -#: ../../library/zlib.rst:443 +#: ../../library/zlib.rst:441 msgid "" "Information about the version of the zlib library in use is available " "through the following constants:" msgstr "有關正在使用的 zlib 函式庫版本資訊可通過以下常數獲得:" -#: ../../library/zlib.rst:449 +#: ../../library/zlib.rst:447 msgid "" "The version string of the zlib library that was used for building the " "module. This may be different from the zlib library actually used at " @@ -634,12 +636,12 @@ msgstr "" "用於建置模組的 zlib 函式庫版本字串。這可能與實際在執行環境 (runtime) 使用的 " "zlib 函式庫不同,後者以 :const:`ZLIB_RUNTIME_VERSION` 提供。" -#: ../../library/zlib.rst:456 +#: ../../library/zlib.rst:454 msgid "" "The version string of the zlib library actually loaded by the interpreter." msgstr "直譯器實際載入的 zlib 函式庫版本字串。" -#: ../../library/zlib.rst:463 +#: ../../library/zlib.rst:461 msgid "" "The version string of the zlib-ng library that was used for building the " "module if zlib-ng was used. When present, the :data:`ZLIB_VERSION` and :data:" @@ -647,51 +649,66 @@ msgid "" "provided by zlib-ng." msgstr "" -#: ../../library/zlib.rst:468 +#: ../../library/zlib.rst:466 msgid "" "If zlib-ng was not used to build the module, this constant will be absent." msgstr "" -#: ../../library/zlib.rst:475 +#: ../../library/zlib.rst:473 msgid "Module :mod:`gzip`" msgstr ":mod:`gzip` 模組" -#: ../../library/zlib.rst:476 +#: ../../library/zlib.rst:474 msgid "Reading and writing :program:`gzip`\\ -format files." msgstr "讀寫 :program:`gzip` 格式的檔案。" -#: ../../library/zlib.rst:478 +#: ../../library/zlib.rst:476 msgid "https://www.zlib.net" msgstr "https://www.zlib.net" -#: ../../library/zlib.rst:479 +#: ../../library/zlib.rst:477 msgid "The zlib library home page." msgstr "zlib 函式庫首頁。" -#: ../../library/zlib.rst:481 +#: ../../library/zlib.rst:479 msgid "https://www.zlib.net/manual.html" msgstr "https://www.zlib.net/manual.html" -#: ../../library/zlib.rst:482 +#: ../../library/zlib.rst:480 msgid "" "The zlib manual explains the semantics and usage of the library's many " "functions." msgstr "zlib 手冊解釋了函式庫中許多函式的語義和用法。" -#: ../../library/zlib.rst:485 +#: ../../library/zlib.rst:483 msgid "" "In case gzip (de)compression is a bottleneck, the `python-isal`_ package " "speeds up (de)compression with a mostly compatible API." msgstr "" -#: ../../library/zlib.rst:120 +#: ../../library/zlib.rst:118 msgid "Cyclic Redundancy Check" msgstr "Cyclic Redundancy Check(循環冗餘核對)" -#: ../../library/zlib.rst:120 +#: ../../library/zlib.rst:118 msgid "checksum" msgstr "checksum(核對和)" +#~ msgid "" +#~ "For applications that require data compression, the functions in this " +#~ "module allow compression and decompression, using the zlib library. The " +#~ "zlib library has its own home page at https://www.zlib.net. There are " +#~ "known incompatibilities between the Python module and versions of the " +#~ "zlib library earlier than 1.1.3; 1.1.3 has a `security vulnerability " +#~ "`_, so we recommend using 1.1.4 or " +#~ "later." +#~ msgstr "" +#~ "對於需要資料壓縮的應用程式,此模組提供了能夠使用 zlib 函式庫進行壓縮和解壓" +#~ "縮的函式。zlib 函式庫有自己的主頁 https://www.zlib.net。已知 Python 模組與" +#~ "早於 1.1.3 的 zlib 函式庫版本之間並不相容;1.1.3 存在\\ `安全漏洞 " +#~ "`_,因此我們建議使用 1.1.4 或更新的" +#~ "版本。" + #~ msgid "" #~ "*level* is the compression level -- an integer from ``0`` to ``9`` or " #~ "``-1``. A value of ``1`` (Z_BEST_SPEED) is fastest and produces the least " diff --git a/sphinx.po b/sphinx.po index 810b719530a..0ef83aac4c2 100644 --- a/sphinx.po +++ b/sphinx.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-11 00:14+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -54,87 +54,82 @@ msgid "Last updated on: %(last_updated)s." msgstr "最後更新時間:%(last_updated)s。" #: ../../tools/templates/download.html:34 +#, fuzzy msgid "" -"To download an archive containing all the documents for this version of\n" -"Python in one of various formats, follow one of links in this table." +"Download an archive containing all the documentation for this version of " +"Python:" msgstr "" "要下載包含這個 Python 版本所有文件的歸檔,可以遵循這個表格中的其中一個連結," "以取得各種格式的文件。" -#: ../../tools/templates/download.html:39 +#: ../../tools/templates/download.html:38 msgid "Format" msgstr "格式" -#: ../../tools/templates/download.html:40 +#: ../../tools/templates/download.html:39 msgid "Packed as .zip" msgstr "打包成 .zip" -#: ../../tools/templates/download.html:41 +#: ../../tools/templates/download.html:40 msgid "Packed as .tar.bz2" msgstr "打包成 .tar.bz2" -#: ../../tools/templates/download.html:44 +#: ../../tools/templates/download.html:43 msgid "HTML" msgstr "HTML" -#: ../../tools/templates/download.html:45 +#: ../../tools/templates/download.html:44 msgid "" "Download" -msgstr "" -"下載" +msgstr "下載" -#: ../../tools/templates/download.html:46 +#: ../../tools/templates/download.html:45 msgid "" "Download" msgstr "" "下載" -#: ../../tools/templates/download.html:49 +#: ../../tools/templates/download.html:48 msgid "Plain text" msgstr "純文字" -#: ../../tools/templates/download.html:50 +#: ../../tools/templates/download.html:49 msgid "" "Download" -msgstr "" -"下載" +msgstr "下載" -#: ../../tools/templates/download.html:51 +#: ../../tools/templates/download.html:50 msgid "" "Download" msgstr "" "下載" -#: ../../tools/templates/download.html:54 +#: ../../tools/templates/download.html:53 msgid "Texinfo" msgstr "Texinfo" -#: ../../tools/templates/download.html:55 +#: ../../tools/templates/download.html:54 msgid "" "Download" msgstr "" "下載" -#: ../../tools/templates/download.html:56 +#: ../../tools/templates/download.html:55 msgid "" "Download" msgstr "" "下載" -#: ../../tools/templates/download.html:59 +#: ../../tools/templates/download.html:58 msgid "EPUB" msgstr "EPUB" -#: ../../tools/templates/download.html:60 +#: ../../tools/templates/download.html:59 msgid "Download" msgstr "下載" -#: ../../tools/templates/download.html:65 -msgid "These archives contain all the content in the documentation." -msgstr "這些歸檔包含了說明文件中的所有內容。" - -#: ../../tools/templates/download.html:67 +#: ../../tools/templates/download.html:64 msgid "" "\n" "We no longer provide pre-built PDFs of the documentation.\n" @@ -148,10 +143,10 @@ msgstr "" "我們不再提供預先建置好的說明文件 PDF 檔案。\n" "要建立 PDF 歸檔,請遵循\n" "開發者指南中的說明,並在 CPython " -"程式碼儲存庫的 Doc/ 目錄中執行 make dist-pdf。\n" +"#building-the-documentation\">開發者指南中的說明,並在 CPython 程式碼儲存" +"庫的 Doc/ 目錄中執行 make dist-pdf。\n" -#: ../../tools/templates/download.html:74 +#: ../../tools/templates/download.html:71 msgid "" "\n" "See the directory " @@ -162,16 +157,17 @@ msgstr "" "請參閱目錄清單" "以查看檔案大小。" -#: ../../tools/templates/download.html:79 +#: ../../tools/templates/download.html:75 msgid "Problems" msgstr "問題" -#: ../../tools/templates/download.html:81 +#: ../../tools/templates/download.html:77 msgid "" "Open an issue\n" "if you have comments or suggestions for the Python documentation." msgstr "" -"如果你對 Python 說明文件有任何意見或建議,請開啟一個 issue。" +"如果你對 Python 說明文件有任何意見或建議,請開啟一個 " +"issue。" #: ../../tools/templates/dummy.html:6 msgid "Availability" @@ -500,3 +496,6 @@ msgstr "" #: ../../tools/templates/layout.html:16 msgid "the current stable release" msgstr "目前的穩定發行版" + +#~ msgid "These archives contain all the content in the documentation." +#~ msgstr "這些歸檔包含了說明文件中的所有內容。" diff --git a/using/configure.po b/using/configure.po index 937f3d14ad1..b0950092257 100644 --- a/using/configure.po +++ b/using/configure.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-11 00:14+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+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-" @@ -19,15 +19,16 @@ msgstr "" msgid "Configure Python" msgstr "配置 Python" -#: ../../using/configure.rst:8 +#: ../../using/configure.rst:11 msgid "Build Requirements" msgstr "建置需求" -#: ../../using/configure.rst:10 -msgid "Features and minimum versions required to build CPython:" -msgstr "建置 CPython 所需的功能與最小版本:" +#: ../../using/configure.rst:13 +#, fuzzy +msgid "To build CPython, you will need:" +msgstr "建置可選的模組:" -#: ../../using/configure.rst:12 +#: ../../using/configure.rst:15 msgid "" "A `C11 `_ compiler. `Optional C11 " "features `_\\ 並非必要。" -#: ../../using/configure.rst:17 +#: ../../using/configure.rst:20 msgid "On Windows, Microsoft Visual Studio 2017 or later is required." msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" -#: ../../using/configure.rst:19 +#: ../../using/configure.rst:22 msgid "" "Support for `IEEE 754 `_ floating-" "point numbers and `floating-point Not-a-Number (NaN) `_ 浮點數與\\ `浮點數" "非數值 (NaN) `_。" -#: ../../using/configure.rst:23 +#: ../../using/configure.rst:26 msgid "Support for threads." msgstr "thread 的支援。" -#: ../../using/configure.rst:25 -msgid "To build optional modules:" -msgstr "建置可選的模組:" +#: ../../using/configure.rst:28 +#, fuzzy +msgid "On Windows, Visual Studio 2015 or later is now required." +msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" -#: ../../using/configure.rst:27 -msgid "`libbz2 `_ for the :mod:`bz2` module." +#: ../../using/configure.rst:31 +msgid "" +"Selected C99 features, like ```` and ``static inline`` functions, " +"are now required." msgstr "" -#: ../../using/configure.rst:29 +#: ../../using/configure.rst:35 +#, fuzzy +msgid "Thread support is now required." +msgstr "對執行緒與 OpenSSL 1.0.2 的支援現在是必要的。" + +#: ../../using/configure.rst:38 +#, fuzzy +msgid "" +"C11 compiler, IEEE 754 and NaN support are now required. On Windows, Visual " +"Studio 2017 or later is required." +msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" + +#: ../../using/configure.rst:42 msgid "" -"`libb2 `_ (:ref:`BLAKE2 `), " -"used by :mod:`hashlib` module." +"See also :pep:`7` \"Style Guide for C Code\" and :pep:`11` \"CPython " +"platform support\"." msgstr "" -#: ../../using/configure.rst:32 +#: ../../using/configure.rst:49 +#, fuzzy +msgid "Requirements for optional modules" +msgstr "建置可選的模組:" + +#: ../../using/configure.rst:51 msgid "" -"`libffi `_ 3.3.0 is the recommended minimum " -"version for the :mod:`ctypes` module." +"Some :term:`optional modules ` of the standard library " +"require third-party libraries installed for development (for example, header " +"files must be available)." msgstr "" -#: ../../using/configure.rst:35 -msgid "``liblzma``, for the :mod:`lzma` module." +#: ../../using/configure.rst:55 +msgid "" +"Missing requirements are reported in the ``configure`` output. Modules that " +"are missing due to missing dependencies are listed near the end of the " +"``make`` output, sometimes using an internal name, for example, ``_ctypes`` " +"for :mod:`ctypes` module." msgstr "" -#: ../../using/configure.rst:37 +#: ../../using/configure.rst:61 msgid "" -"`libmpdec `_ 2.5.0 for " -"the :mod:`decimal` module." +"If you distribute a CPython interpreter without optional modules, it's best " +"practice to advise users, who generally expect that standard library modules " +"are available." +msgstr "" + +#: ../../using/configure.rst:65 +#, fuzzy +msgid "Dependencies to build optional modules are:" +msgstr "建置可選的模組:" + +#: ../../using/configure.rst:71 +msgid "Dependency" +msgstr "" + +#: ../../using/configure.rst:72 +msgid "Minimum version" +msgstr "" + +#: ../../using/configure.rst:73 +#, fuzzy +msgid "Python module" +msgstr "Python 建置系統" + +#: ../../using/configure.rst:74 +msgid "`libbz2 `_" +msgstr "" + +#: ../../using/configure.rst:76 +msgid ":mod:`bz2`" +msgstr "" + +#: ../../using/configure.rst:77 +msgid "`libffi `_" +msgstr "" + +#: ../../using/configure.rst:78 +msgid "3.3.0 recommended" +msgstr "" + +#: ../../using/configure.rst:79 +msgid ":mod:`ctypes`" +msgstr "" + +#: ../../using/configure.rst:80 +msgid "`liblzma `_" +msgstr "" + +#: ../../using/configure.rst:82 +msgid ":mod:`lzma`" +msgstr "" + +#: ../../using/configure.rst:83 +msgid "`libmpdec `_" msgstr "" -#: ../../using/configure.rst:40 -msgid "``libncurses`` or ``libncursesw``, for the :mod:`curses` module." +#: ../../using/configure.rst:84 +msgid "2.5.0" msgstr "" -#: ../../using/configure.rst:43 -msgid "``libpanel`` or ``libpanelw``, for the :mod:`curses.panel` module." +#: ../../using/configure.rst:85 +msgid ":mod:`decimal` [1]_" msgstr "" -#: ../../using/configure.rst:46 +#: ../../using/configure.rst:86 msgid "" "`libreadline `_ or " -"`libedit `_ for the :mod:`readline` " -"module." +"`libedit `_ [2]_" msgstr "" -#: ../../using/configure.rst:50 -msgid "" -"`libuuid `_, for the :mod:`uuid` module." +#: ../../using/configure.rst:89 +msgid ":mod:`readline`" msgstr "" -#: ../../using/configure.rst:52 -msgid "" -"`OpenSSL `_ 1.1.1 is the minimum version and " -"OpenSSL 3.0.18 is the recommended minimum version for the :mod:`ssl` and :" -"mod:`hashlib` extension modules." +#: ../../using/configure.rst:90 +msgid "`libuuid `_" msgstr "" -"`OpenSSL `_ 1.1.1 是最低版本,OpenSSL 3.0.18 是 :mod:`ssl` 與 " -":mod:`hashlib` 擴充模組的建議最低版本。" -#: ../../using/configure.rst:56 -msgid "" -"`SQLite `_ 3.15.2 for the :mod:`sqlite3` extension " -"module." +#: ../../using/configure.rst:92 +msgid "``_uuid`` [3]_" +msgstr "" + +#: ../../using/configure.rst:93 +msgid "`ncurses `_ [4]_" +msgstr "" + +#: ../../using/configure.rst:95 +msgid ":mod:`curses`" +msgstr "" + +#: ../../using/configure.rst:96 +msgid "`OpenSSL `_" +msgstr "" + +#: ../../using/configure.rst:0 +msgid "3.0.18 recommended" +msgstr "" + +#: ../../using/configure.rst:0 +msgid "(1.1.1 minimum)" +msgstr "" + +#: ../../using/configure.rst:99 +msgid ":mod:`ssl`, :mod:`hashlib` [5]_" +msgstr "" + +#: ../../using/configure.rst:100 +msgid "`SQLite `_" +msgstr "" + +#: ../../using/configure.rst:101 +msgid "3.15.2" +msgstr "" + +#: ../../using/configure.rst:102 +msgid ":mod:`sqlite3`" +msgstr "" + +#: ../../using/configure.rst:103 +msgid "`Tcl/Tk `_" +msgstr "" + +#: ../../using/configure.rst:104 +msgid "8.5.12" +msgstr "" + +#: ../../using/configure.rst:105 +msgid ":mod:`tkinter`, :ref:`IDLE `, :mod:`turtle`" +msgstr "" + +#: ../../using/configure.rst:106 +msgid "`zlib `_" +msgstr "" + +#: ../../using/configure.rst:107 +msgid "1.2.2.1" +msgstr "" + +#: ../../using/configure.rst:108 +msgid ":mod:`zlib`, :mod:`gzip`, :mod:`ensurepip`" msgstr "" -#: ../../using/configure.rst:58 +#: ../../using/configure.rst:109 +msgid "`zstd `_" +msgstr "" + +#: ../../using/configure.rst:110 +msgid "1.4.5" +msgstr "" + +#: ../../using/configure.rst:111 +msgid ":mod:`compression.zstd`" +msgstr "" + +#: ../../using/configure.rst:113 msgid "" -"`Tcl/Tk `_ 8.5.12 for the :mod:`tkinter` module." +"If *libmpdec* is not available, the :mod:`decimal` module will use a pure-" +"Python implementation. See :option:`--with-system-libmpdec` for details." msgstr "" -#: ../../using/configure.rst:60 +#: ../../using/configure.rst:116 msgid "" -"`zlib `_ 1.1.4 is the reccomended minimum version for " -"the :mod:`zlib` module." +"See :option:`--with-readline` for choosing the backend for the :mod:" +"`readline` module." msgstr "" -#: ../../using/configure.rst:63 +#: ../../using/configure.rst:118 msgid "" -"`zstd `_ 1.4.5 is the minimum version for " -"the :mod:`compression.zstd` module." +"The :mod:`uuid` module uses ``_uuid`` to generate \"safe\" UUIDs. See the " +"module documentation for details." msgstr "" -#: ../../using/configure.rst:66 +#: ../../using/configure.rst:120 msgid "" -"For a full list of dependencies required to build all modules and how to " -"install them, see the `devguide `_." +"The :mod:`curses` module requires the ``libncurses`` or ``libncursesw`` " +"library. The :mod:`curses.panel` module additionally requires the " +"``libpanel`` or ``libpanelw`` library." msgstr "" -#: ../../using/configure.rst:70 +#: ../../using/configure.rst:124 msgid "" -"Autoconf 2.72 and aclocal 1.16.5 are required to regenerate the :file:" -"`configure` script." +"If OpenSSL is not available, the :mod:`hashlib` module will use bundled " +"implementations of several hash functions. See :option:`--with-builtin-" +"hashlib-hashes` for *forcing* usage of OpenSSL." msgstr "" -#: ../../using/configure.rst:73 -msgid "Tcl/Tk version 8.3.1 is now required." -msgstr "Tcl/Tk version 8.3.1 現在是必要的。" +#: ../../using/configure.rst:128 +msgid "" +"Note that the table does not include all optional modules; in particular, " +"platform-specific modules like :mod:`winreg` are not listed here." +msgstr "" -#: ../../using/configure.rst:76 +#: ../../using/configure.rst:133 msgid "" -"On Windows, Visual Studio 2015 or later is now required. Tcl/Tk version 8.4 " -"is now required." +"The `devguide `_ includes a full list of dependencies required to " +"build all modules and instructions on how to install them on common " +"platforms." msgstr "" -"在 Windows 上,Visual Studio 2015 或更新版本與 Tcl/Tk version 8.4 現在是必要" -"的。" -#: ../../using/configure.rst:80 +#: ../../using/configure.rst:136 msgid "" -"Selected C99 features are now required, like ```` and ``static " -"inline`` functions." +":option:`--with-system-expat` allows building with an external `libexpat " +"`_ library." msgstr "" -#: ../../using/configure.rst:84 -msgid "Thread support and OpenSSL 1.0.2 are now required." -msgstr "對執行緒與 OpenSSL 1.0.2 的支援現在是必要的。" +#: ../../using/configure.rst:138 +msgid ":ref:`configure-options-for-dependencies`" +msgstr "" -#: ../../using/configure.rst:87 -msgid "OpenSSL 1.1.1 is now required. Require SQLite 3.7.15." -msgstr "OpenSSL 1.1.1 現在是必要的。需要 SQLite 3.7.15。" +#: ../../using/configure.rst:140 +#, fuzzy +msgid "Tcl/Tk version 8.3.1 is now required for :mod:`tkinter`." +msgstr "Tcl/Tk version 8.3.1 現在是必要的。" -#: ../../using/configure.rst:91 -msgid "" -"C11 compiler, IEEE 754 and NaN support are now required. On Windows, Visual " -"Studio 2017 or later is required. Tcl/Tk version 8.5.12 is now required for " -"the :mod:`tkinter` module." +#: ../../using/configure.rst:143 +#, fuzzy +msgid "Tcl/Tk version 8.4 is now required for :mod:`tkinter`." +msgstr "Tcl/Tk version 8.3.1 現在是必要的。" + +#: ../../using/configure.rst:146 +msgid "OpenSSL 1.0.2 is now required for :mod:`hashlib` and :mod:`ssl`." msgstr "" -#: ../../using/configure.rst:96 -msgid "Autoconf 2.71, aclocal 1.16.5 and SQLite 3.15.2 are now required." +#: ../../using/configure.rst:149 +msgid "" +"OpenSSL 1.1.1 is now required for :mod:`hashlib` and :mod:`ssl`. SQLite " +"3.7.15 is now required for :mod:`sqlite3`." msgstr "" -#: ../../using/configure.rst:99 -msgid "Autoconf 2.72 is now required." -msgstr "Autoconf 2.72 現在是必要的。" +#: ../../using/configure.rst:153 +#, fuzzy +msgid "Tcl/Tk version 8.5.12 is now required for :mod:`tkinter`." +msgstr "Tcl/Tk version 8.3.1 現在是必要的。" -#: ../../using/configure.rst:102 -msgid "" -"See also :pep:`7` \"Style Guide for C Code\" and :pep:`11` \"CPython " -"platform support\"." +#: ../../using/configure.rst:156 +msgid "SQLite 3.15.2 is now required for :mod:`sqlite3`." msgstr "" -#: ../../using/configure.rst:107 +#: ../../using/configure.rst:161 msgid "Generated files" msgstr "產生的檔案" -#: ../../using/configure.rst:109 +#: ../../using/configure.rst:163 msgid "" "To reduce build dependencies, Python source code contains multiple generated " "files. Commands to regenerate all generated files::" msgstr "" -#: ../../using/configure.rst:112 +#: ../../using/configure.rst:166 msgid "" "make regen-all\n" "make regen-stdlib-module-names\n" @@ -218,17 +366,17 @@ msgstr "" "make regen-limited-abi\n" "make regen-configure" -#: ../../using/configure.rst:117 +#: ../../using/configure.rst:171 msgid "" "The ``Makefile.pre.in`` file documents generated files, their inputs, and " "tools used to regenerate them. Search for ``regen-*`` make targets." msgstr "" -#: ../../using/configure.rst:121 +#: ../../using/configure.rst:175 msgid "configure script" msgstr "設定腳本" -#: ../../using/configure.rst:123 +#: ../../using/configure.rst:177 msgid "" "The ``make regen-configure`` command regenerates the ``aclocal.m4`` file and " "the ``configure`` script using the ``Tools/build/regen-configure.sh`` shell " @@ -236,49 +384,63 @@ msgid "" "have a reproducible output." msgstr "" -#: ../../using/configure.rst:128 +#: ../../using/configure.rst:182 msgid "The container is optional, the following command can be run locally::" msgstr "" -#: ../../using/configure.rst:130 +#: ../../using/configure.rst:184 msgid "autoreconf -ivf -Werror" msgstr "autoreconf -ivf -Werror" -#: ../../using/configure.rst:132 +#: ../../using/configure.rst:186 +msgid "" +"The generated files can change depending on the exact versions of the tools " +"used. The container that CPython uses has `Autoconf `_ 2.72, ``aclocal`` from `Automake `_ 1.16.5, and `pkg-config `_ 1.8.1." +msgstr "" + +#: ../../using/configure.rst:193 msgid "" -"The generated files can change depending on the exact ``autoconf-archive``, " -"``aclocal`` and ``pkg-config`` versions." +"Autoconf 2.71 and aclocal 1.16.5 and are now used to regenerate :file:" +"`configure`." msgstr "" -#: ../../using/configure.rst:139 +#: ../../using/configure.rst:197 +#, fuzzy +msgid "Autoconf 2.72 is now used to regenerate :file:`configure`." +msgstr "Autoconf 2.72 現在是必要的。" + +#: ../../using/configure.rst:204 msgid "Configure Options" msgstr "設定選項" -#: ../../using/configure.rst:141 +#: ../../using/configure.rst:206 msgid "List all :file:`configure` script options using::" msgstr "使用以下命令列出所有 :file:`configure` 腳本選項: ::" -#: ../../using/configure.rst:143 +#: ../../using/configure.rst:208 msgid "./configure --help" msgstr "./configure --help" -#: ../../using/configure.rst:145 +#: ../../using/configure.rst:210 msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." msgstr "請見 Python 原始碼發行版中的 :file:`Misc/SpecialBuilds.txt`。" -#: ../../using/configure.rst:148 +#: ../../using/configure.rst:213 msgid "General Options" msgstr "一般選項" -#: ../../using/configure.rst:152 +#: ../../using/configure.rst:217 msgid "" "Support loadable extensions in the :mod:`!_sqlite` extension module (default " "is no) of the :mod:`sqlite3` module." msgstr "" -#: ../../using/configure.rst:155 +#: ../../using/configure.rst:220 msgid "" "See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" "`sqlite3` module." @@ -286,33 +448,33 @@ msgstr "" "請見 :mod:`sqlite3` 模組的 :meth:`sqlite3.Connection.enable_load_extension` " "方法。" -#: ../../using/configure.rst:162 +#: ../../using/configure.rst:227 msgid "" "Disable IPv6 support (enabled by default if supported), see the :mod:" "`socket` module." msgstr "停用 IPv6 支援(如果支援的話預設是啟用的),請見 :mod:`socket` 模組。" -#: ../../using/configure.rst:167 +#: ../../using/configure.rst:232 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." msgstr "" -#: ../../using/configure.rst:169 +#: ../../using/configure.rst:234 msgid "By default, the digit size is 30." msgstr "" -#: ../../using/configure.rst:171 +#: ../../using/configure.rst:236 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``。" -#: ../../using/configure.rst:173 +#: ../../using/configure.rst:238 msgid "See :data:`sys.int_info.bits_per_digit `." msgstr "參閱 :data:`sys.int_info.bits_per_digit `。" -#: ../../using/configure.rst:177 +#: ../../using/configure.rst:242 msgid "Set the Python executable suffix to *SUFFIX*." msgstr "將 Python 執行檔的後綴設定為 *SUFFIX*。" -#: ../../using/configure.rst:179 +#: ../../using/configure.rst:244 msgid "" "The default suffix is ``.exe`` on Windows and macOS (``python.exe`` " "executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, ``." @@ -323,20 +485,20 @@ msgstr "" "Emscripten node 上為 ``.js``、在 Emscripten 瀏覽器為 ``.html``、在 WASI 上為 " "``.wasm``,以及在其他平台為空字串(``python`` 執行檔)。" -#: ../../using/configure.rst:184 +#: ../../using/configure.rst:249 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." msgstr "在 WASM 平台上預設的後綴是 ``.js``、``.html`` 或 ``.wasm`` 中的一個。" -#: ../../using/configure.rst:190 +#: ../../using/configure.rst:255 msgid "" "Select the default time zone search path for :const:`zoneinfo.TZPATH`. See " "the :ref:`Compile-time configuration ` of " "the :mod:`zoneinfo` module." msgstr "" -#: ../../using/configure.rst:194 +#: ../../using/configure.rst:259 msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." @@ -344,72 +506,72 @@ msgstr "" "預設值:``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/" "zoneinfo``。" -#: ../../using/configure.rst:196 +#: ../../using/configure.rst:261 msgid "See :data:`os.pathsep` path separator." msgstr "請見 :data:`os.pathsep` 路徑分隔符號。" -#: ../../using/configure.rst:202 +#: ../../using/configure.rst:267 msgid "" "Build the ``_decimal`` extension module using a thread-local context rather " "than a coroutine-local context (default), see the :mod:`decimal` module." msgstr "" -#: ../../using/configure.rst:205 +#: ../../using/configure.rst:270 msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." msgstr "請見 :const:`decimal.HAVE_CONTEXTVAR` 與 :mod:`contextvars` 模組。" -#: ../../using/configure.rst:211 +#: ../../using/configure.rst:276 msgid "Override order to check db backends for the :mod:`dbm` module" msgstr "" -#: ../../using/configure.rst:213 +#: ../../using/configure.rst:278 msgid "" "A valid value is a colon (``:``) separated string with the backend names:" msgstr "" -#: ../../using/configure.rst:215 +#: ../../using/configure.rst:280 msgid "``ndbm``;" msgstr "``ndbm``;" -#: ../../using/configure.rst:216 +#: ../../using/configure.rst:281 msgid "``gdbm``;" msgstr "``gdbm``;" -#: ../../using/configure.rst:217 +#: ../../using/configure.rst:282 msgid "``bdb``." msgstr "``bdb``." -#: ../../using/configure.rst:221 +#: ../../using/configure.rst:286 msgid "Disable C locale coercion to a UTF-8 based locale (enabled by default)." msgstr "" -#: ../../using/configure.rst:223 +#: ../../using/configure.rst:288 msgid "Don't define the ``PY_COERCE_C_LOCALE`` macro." msgstr "不要定義 ``PY_COERCE_C_LOCALE`` 巨集。" -#: ../../using/configure.rst:225 +#: ../../using/configure.rst:290 msgid "See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`." msgstr "請見 :envvar:`PYTHONCOERCECLOCALE` 與 :pep:`538`。" -#: ../../using/configure.rst:229 +#: ../../using/configure.rst:294 msgid "Python library directory name (default is ``lib``)." msgstr "Python 函式庫目錄名稱(預設為 ``lib`` )。" -#: ../../using/configure.rst:231 +#: ../../using/configure.rst:296 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." msgstr "Fedora 和 SuSE 在 64 位元平台上使用 ``lib64``。" -#: ../../using/configure.rst:233 +#: ../../using/configure.rst:298 msgid "See :data:`sys.platlibdir`." msgstr "參閱 :data:`sys.platlibdir`。" -#: ../../using/configure.rst:239 +#: ../../using/configure.rst:304 msgid "" "Directory of wheel packages used by the :mod:`ensurepip` module (none by " "default)." msgstr "" -#: ../../using/configure.rst:242 +#: ../../using/configure.rst:307 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -417,79 +579,79 @@ msgid "" "_bundled` package." msgstr "" -#: ../../using/configure.rst:251 +#: ../../using/configure.rst:316 msgid "" "Whether configure should use :program:`pkg-config` to detect build " "dependencies." msgstr "" -#: ../../using/configure.rst:254 +#: ../../using/configure.rst:319 msgid "``check`` (default): :program:`pkg-config` is optional" msgstr "``check``\\ (預設)::program:`pkg-config` 是可選的" -#: ../../using/configure.rst:255 +#: ../../using/configure.rst:320 msgid "``yes``: :program:`pkg-config` is mandatory" msgstr "``yes``::program:`pkg-config` 是必要的" -#: ../../using/configure.rst:256 +#: ../../using/configure.rst:321 msgid "``no``: configure does not use :program:`pkg-config` even when present" msgstr "``no``:即使存在也不使用 :program:`pkg-config` 來配置" -#: ../../using/configure.rst:262 +#: ../../using/configure.rst:327 msgid "Turn on internal Python performance statistics gathering." msgstr "" -#: ../../using/configure.rst:264 +#: ../../using/configure.rst:329 msgid "" "By default, statistics gathering is off. Use ``python3 -X pystats`` command " "or set ``PYTHONSTATS=1`` environment variable to turn on statistics " "gathering at Python startup." msgstr "" -#: ../../using/configure.rst:268 +#: ../../using/configure.rst:333 msgid "" "At Python exit, dump statistics if statistics gathering was on and not " "cleared." msgstr "" -#: ../../using/configure.rst:271 ../../using/configure.rst:794 +#: ../../using/configure.rst:336 ../../using/configure.rst:855 msgid "Effects:" msgstr "效果:" -#: ../../using/configure.rst:273 +#: ../../using/configure.rst:338 msgid "Add :option:`-X pystats <-X>` command line option." msgstr "新增 :option:`-X pystats <-X>` 命令列選項。" -#: ../../using/configure.rst:274 +#: ../../using/configure.rst:339 msgid "Add :envvar:`!PYTHONSTATS` environment variable." msgstr "新增 :envvar:`!PYTHONSTATS` 環境變數。" -#: ../../using/configure.rst:275 +#: ../../using/configure.rst:340 msgid "Define the ``Py_STATS`` macro." msgstr "定義 ``Py_STATS`` 巨集。" -#: ../../using/configure.rst:276 +#: ../../using/configure.rst:341 msgid "Add functions to the :mod:`sys` module:" msgstr "新增函式到 :mod:`sys` 模組。" -#: ../../using/configure.rst:278 +#: ../../using/configure.rst:343 msgid ":func:`!sys._stats_on`: Turns on statistics gathering." msgstr ":func:`!sys._stats_on`:啟用統計資料收集。" -#: ../../using/configure.rst:279 +#: ../../using/configure.rst:344 msgid ":func:`!sys._stats_off`: Turns off statistics gathering." msgstr ":func:`!sys._stats_off`:關閉統計資料收集。" -#: ../../using/configure.rst:280 +#: ../../using/configure.rst:345 msgid ":func:`!sys._stats_clear`: Clears the statistics." msgstr ":func:`!sys._stats_clear`:清除統計資料。" -#: ../../using/configure.rst:281 +#: ../../using/configure.rst:346 msgid "" ":func:`!sys._stats_dump`: Dump statistics to file, and clears the statistics." msgstr ":func:`!sys._stats_dump`:將統計資料轉儲到檔案,並清除統計資料。" -#: ../../using/configure.rst:283 +#: ../../using/configure.rst:348 msgid "" "The statistics will be dumped to a arbitrary (probably unique) file in ``/" "tmp/py_stats/`` (Unix) or ``C:\\temp\\py_stats\\`` (Windows). If that " @@ -499,162 +661,162 @@ msgstr "" "(Windows) 中的任意(可能是唯一的)檔案。如果該目錄不存在,結果將被列印到 " "stderr。" -#: ../../using/configure.rst:287 +#: ../../using/configure.rst:352 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." msgstr "使用 ``Tools/scripts/summarize_stats.py`` 來讀取統計資料。" -#: ../../using/configure.rst:289 +#: ../../using/configure.rst:354 msgid "Statistics:" msgstr "" -#: ../../using/configure.rst:291 +#: ../../using/configure.rst:356 msgid "Opcode:" msgstr "" -#: ../../using/configure.rst:293 +#: ../../using/configure.rst:358 msgid "Specialization: success, failure, hit, deferred, miss, deopt, failures;" msgstr "" -#: ../../using/configure.rst:294 +#: ../../using/configure.rst:359 msgid "Execution count;" msgstr "" -#: ../../using/configure.rst:295 +#: ../../using/configure.rst:360 msgid "Pair count." msgstr "" -#: ../../using/configure.rst:297 +#: ../../using/configure.rst:362 msgid "Call:" msgstr "" -#: ../../using/configure.rst:299 +#: ../../using/configure.rst:364 msgid "Inlined Python calls;" msgstr "" -#: ../../using/configure.rst:300 +#: ../../using/configure.rst:365 msgid "PyEval calls;" msgstr "" -#: ../../using/configure.rst:301 +#: ../../using/configure.rst:366 msgid "Frames pushed;" msgstr "" -#: ../../using/configure.rst:302 +#: ../../using/configure.rst:367 msgid "Frame object created;" msgstr "" -#: ../../using/configure.rst:303 +#: ../../using/configure.rst:368 msgid "" "Eval calls: vector, generator, legacy, function VECTORCALL, build class, " "slot, function \"ex\", API, method." msgstr "" -#: ../../using/configure.rst:306 +#: ../../using/configure.rst:371 msgid "Object:" msgstr "物件:" -#: ../../using/configure.rst:308 +#: ../../using/configure.rst:373 msgid "incref and decref;" msgstr "" -#: ../../using/configure.rst:309 +#: ../../using/configure.rst:374 msgid "interpreter incref and decref;" msgstr "" -#: ../../using/configure.rst:310 +#: ../../using/configure.rst:375 msgid "allocations: all, 512 bytes, 4 kiB, big;" msgstr "" -#: ../../using/configure.rst:311 +#: ../../using/configure.rst:376 msgid "free;" msgstr "" -#: ../../using/configure.rst:312 +#: ../../using/configure.rst:377 msgid "to/from free lists;" msgstr "" -#: ../../using/configure.rst:313 +#: ../../using/configure.rst:378 msgid "dictionary materialized/dematerialized;" msgstr "" -#: ../../using/configure.rst:314 +#: ../../using/configure.rst:379 msgid "type cache;" msgstr "" -#: ../../using/configure.rst:315 +#: ../../using/configure.rst:380 msgid "optimization attempts;" msgstr "最佳化嘗試;" -#: ../../using/configure.rst:316 +#: ../../using/configure.rst:381 msgid "optimization traces created/executed;" msgstr "" -#: ../../using/configure.rst:317 +#: ../../using/configure.rst:382 msgid "uops executed." msgstr "" -#: ../../using/configure.rst:319 +#: ../../using/configure.rst:384 msgid "Garbage collector:" msgstr "垃圾回收器:" -#: ../../using/configure.rst:321 +#: ../../using/configure.rst:386 msgid "Garbage collections;" msgstr "垃圾回收;" -#: ../../using/configure.rst:322 +#: ../../using/configure.rst:387 msgid "Objects visited;" msgstr "" -#: ../../using/configure.rst:323 +#: ../../using/configure.rst:388 msgid "Objects collected." msgstr "" -#: ../../using/configure.rst:331 +#: ../../using/configure.rst:396 msgid "" "Enables support for running Python without the :term:`global interpreter " "lock` (GIL): free threading build." msgstr "" -#: ../../using/configure.rst:334 +#: ../../using/configure.rst:399 msgid "" "Defines the ``Py_GIL_DISABLED`` macro and adds ``\"t\"`` to :data:`sys." "abiflags`." msgstr "" -#: ../../using/configure.rst:337 +#: ../../using/configure.rst:402 msgid "See :ref:`whatsnew313-free-threaded-cpython` for more detail." msgstr "" -#: ../../using/configure.rst:343 +#: ../../using/configure.rst:408 msgid "" "Indicate how to integrate the :ref:`experimental just-in-time compiler " "`." msgstr "" -#: ../../using/configure.rst:345 +#: ../../using/configure.rst:410 msgid "``no``: Don't build the JIT." msgstr "" -#: ../../using/configure.rst:346 +#: ../../using/configure.rst:411 msgid "" "``yes``: Enable the JIT. To disable it at runtime, set the environment " "variable :envvar:`PYTHON_JIT=0 `." msgstr "" -#: ../../using/configure.rst:348 +#: ../../using/configure.rst:413 msgid "" "``yes-off``: Build the JIT, but disable it by default. To enable it at " "runtime, set the environment variable :envvar:`PYTHON_JIT=1 `." msgstr "" -#: ../../using/configure.rst:350 +#: ../../using/configure.rst:415 msgid "" "``interpreter``: Enable the \"JIT interpreter\" (only useful for those " "debugging the JIT itself). To disable it at runtime, set the environment " "variable :envvar:`PYTHON_JIT=0 `." msgstr "" -#: ../../using/configure.rst:354 +#: ../../using/configure.rst:419 msgid "" "``--enable-experimental-jit=no`` is the default behavior if the option is " "not provided, and ``--enable-experimental-jit`` is shorthand for ``--enable-" @@ -662,215 +824,209 @@ msgid "" "information, including how to install the necessary build-time dependencies." msgstr "" -#: ../../using/configure.rst:361 +#: ../../using/configure.rst:426 msgid "" "When building CPython with JIT enabled, ensure that your system has Python " "3.11 or later installed." msgstr "" -#: ../../using/configure.rst:367 +#: ../../using/configure.rst:432 msgid "Path to ``pkg-config`` utility." msgstr "" -#: ../../using/configure.rst:372 +#: ../../using/configure.rst:437 msgid "``pkg-config`` options." msgstr "``pkg-config`` 選項。" -#: ../../using/configure.rst:376 +#: ../../using/configure.rst:441 msgid "C compiler options" msgstr "C 編譯器選項。" -#: ../../using/configure.rst:380 ../../using/configure.rst:1364 +#: ../../using/configure.rst:445 ../../using/configure.rst:1432 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:384 ../../using/configure.rst:1376 +#: ../../using/configure.rst:449 ../../using/configure.rst:1444 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:388 +#: ../../using/configure.rst:453 msgid "C preprocessor command." msgstr "C 預處理器指令。" -#: ../../using/configure.rst:392 +#: ../../using/configure.rst:457 msgid "C preprocessor flags, e.g. :samp:`-I{include_dir}`." msgstr "C 預處理器旗標,例如::samp:`-I{include_dir}`。" -#: ../../using/configure.rst:396 ../../using/configure.rst:868 +#: ../../using/configure.rst:461 ../../using/configure.rst:929 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:400 +#: ../../using/configure.rst:465 msgid "Linker flags, e.g. :samp:`-L{library_directory}`." msgstr "" -#: ../../using/configure.rst:404 +#: ../../using/configure.rst:469 msgid "Libraries to pass to the linker, e.g. :samp:`-l{library}`." msgstr "" -#: ../../using/configure.rst:408 +#: ../../using/configure.rst:473 msgid "Name for machine-dependent library files." msgstr "" -#: ../../using/configure.rst:412 +#: ../../using/configure.rst:479 msgid "Options for third-party dependencies" msgstr "" -#: ../../using/configure.rst:419 +#: ../../using/configure.rst:486 msgid "" "C compiler and linker flags to link Python to ``libbz2``, used by :mod:`bz2` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:425 +#: ../../using/configure.rst:492 msgid "" "C compiler and linker flags for ``libncurses`` or ``libncursesw``, used by :" "mod:`curses` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:431 +#: ../../using/configure.rst:498 msgid "C compiler and linker flags for ``gdbm``." msgstr "" -#: ../../using/configure.rst:436 -msgid "" -"C compiler and linker flags for ``libb2`` (:ref:`BLAKE2 `), " -"used by :mod:`hashlib` module, overriding ``pkg-config``." -msgstr "" - -#: ../../using/configure.rst:442 +#: ../../using/configure.rst:503 msgid "" "C compiler and linker flags for ``libedit``, used by :mod:`readline` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:448 +#: ../../using/configure.rst:509 msgid "" "C compiler and linker flags for ``libffi``, used by :mod:`ctypes` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:454 +#: ../../using/configure.rst:515 msgid "" "C compiler and linker flags for ``libmpdec``, used by :mod:`decimal` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:459 +#: ../../using/configure.rst:520 msgid "" "These environment variables have no effect unless :option:`--with-system-" "libmpdec` is specified." msgstr "" -#: ../../using/configure.rst:465 +#: ../../using/configure.rst:526 msgid "" "C compiler and linker flags for ``liblzma``, used by :mod:`lzma` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:471 +#: ../../using/configure.rst:532 msgid "" "C compiler and linker flags for ``libreadline``, used by :mod:`readline` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:477 +#: ../../using/configure.rst:538 msgid "" "C compiler and linker flags for ``libsqlite3``, used by :mod:`sqlite3` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:483 +#: ../../using/configure.rst:544 msgid "" "C compiler and linker flags for ``libuuid``, used by :mod:`uuid` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:489 +#: ../../using/configure.rst:550 msgid "" "C compiler and linker flags for ``libzstd``, used by :mod:`compression.zstd` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:497 +#: ../../using/configure.rst:558 msgid "C compiler and linker flags for PANEL, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:499 +#: ../../using/configure.rst:560 msgid "" "C compiler and linker flags for ``libpanel`` or ``libpanelw``, used by :mod:" "`curses.panel` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:505 +#: ../../using/configure.rst:566 msgid "C compiler and linker flags for TCLTK, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:510 +#: ../../using/configure.rst:571 msgid "" "C compiler and linker flags for ``libzlib``, used by :mod:`gzip` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:515 +#: ../../using/configure.rst:576 msgid "WebAssembly Options" msgstr "WebAssembly 選項" -#: ../../using/configure.rst:519 +#: ../../using/configure.rst:580 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:521 +#: ../../using/configure.rst:582 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:528 +#: ../../using/configure.rst:589 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:534 +#: ../../using/configure.rst:595 msgid "Install Options" msgstr "安裝選項" -#: ../../using/configure.rst:538 +#: ../../using/configure.rst:599 msgid "" "Install architecture-independent files in PREFIX. On Unix, it defaults to :" "file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:541 +#: ../../using/configure.rst:602 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" -#: ../../using/configure.rst:543 +#: ../../using/configure.rst:604 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:548 +#: ../../using/configure.rst:609 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:550 +#: ../../using/configure.rst:611 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" -#: ../../using/configure.rst:554 +#: ../../using/configure.rst:615 msgid "" "Don't build nor install test modules, like the :mod:`test` package or the :" "mod:`!_testcapi` extension module (built and installed by default)." msgstr "" -#: ../../using/configure.rst:561 +#: ../../using/configure.rst:622 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" -#: ../../using/configure.rst:563 +#: ../../using/configure.rst:624 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." @@ -878,45 +1034,45 @@ msgstr "" "``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" "令。" -#: ../../using/configure.rst:565 +#: ../../using/configure.rst:626 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" -#: ../../using/configure.rst:566 +#: ../../using/configure.rst:627 msgid "``no``: don't run ensurepip;" msgstr "``no``:不要執行 ensurepip;" -#: ../../using/configure.rst:572 +#: ../../using/configure.rst:633 msgid "Performance options" msgstr "效能選項" -#: ../../using/configure.rst:574 +#: ../../using/configure.rst:635 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " "is recommended for best performance. The experimental ``--enable-bolt`` flag " "can also be used to improve performance." msgstr "" -#: ../../using/configure.rst:580 +#: ../../using/configure.rst:641 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:583 +#: ../../using/configure.rst:644 msgid "" "The C compiler Clang requires ``llvm-profdata`` program for PGO. On macOS, " "GCC also requires it: GCC is just an alias to Clang on macOS." msgstr "" -#: ../../using/configure.rst:586 +#: ../../using/configure.rst:647 msgid "" "Disable also semantic interposition in libpython if ``--enable-shared`` and " "GCC is used: add ``-fno-semantic-interposition`` to the compiler and linker " "flags." msgstr "" -#: ../../using/configure.rst:592 +#: ../../using/configure.rst:653 msgid "" "During the build, you may encounter compiler warnings about profile data not " "being available for some source files. These warnings are harmless, as only " @@ -925,58 +1081,58 @@ msgid "" "profile-instr-unprofiled`` to :envvar:`CFLAGS`." msgstr "" -#: ../../using/configure.rst:601 +#: ../../using/configure.rst:662 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" -#: ../../using/configure.rst:606 +#: ../../using/configure.rst:667 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:609 +#: ../../using/configure.rst:670 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" -#: ../../using/configure.rst:613 +#: ../../using/configure.rst:674 msgid "Task failure is no longer ignored silently." msgstr "" -#: ../../using/configure.rst:618 +#: ../../using/configure.rst:679 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:620 +#: ../../using/configure.rst:681 msgid "" "The C compiler Clang requires ``llvm-ar`` for LTO (``ar`` on macOS), as well " "as an LTO-aware linker (``ld.gold`` or ``lld``)." msgstr "" -#: ../../using/configure.rst:625 +#: ../../using/configure.rst:686 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:628 +#: ../../using/configure.rst:689 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:633 +#: ../../using/configure.rst:694 msgid "" "Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:637 +#: ../../using/configure.rst:698 msgid "" "BOLT is part of the LLVM project but is not always included in their binary " "distributions. This flag requires that ``llvm-bolt`` and ``merge-fdata`` are " "available." msgstr "" -#: ../../using/configure.rst:641 +#: ../../using/configure.rst:702 msgid "" "BOLT is still a fairly new project so this flag should be considered " "experimental for now. Because this tool operates on machine code its success " @@ -987,7 +1143,7 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:649 +#: ../../using/configure.rst:710 msgid "" "The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" "program:`configure` variables can be defined to override the default set of " @@ -995,23 +1151,23 @@ msgid "" "binaries, respectively." msgstr "" -#: ../../using/configure.rst:658 +#: ../../using/configure.rst:719 msgid "" "Arguments to ``llvm-bolt`` when creating a `BOLT optimized binary `_." msgstr "" -#: ../../using/configure.rst:665 +#: ../../using/configure.rst:726 msgid "Arguments to ``llvm-bolt`` when instrumenting binaries." msgstr "" -#: ../../using/configure.rst:671 +#: ../../using/configure.rst:732 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:676 +#: ../../using/configure.rst:737 msgid "" "Enable interpreters using tail calls in CPython. If enabled, enabling PGO (:" "option:`--enable-optimizations`) is highly recommended. This option " @@ -1021,46 +1177,46 @@ msgid "" "feature." msgstr "" -#: ../../using/configure.rst:686 +#: ../../using/configure.rst:747 msgid "" "Disable the fast :ref:`mimalloc ` allocator (enabled by default)." msgstr "" -#: ../../using/configure.rst:689 ../../using/configure.rst:696 +#: ../../using/configure.rst:750 ../../using/configure.rst:757 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:693 +#: ../../using/configure.rst:754 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:700 +#: ../../using/configure.rst:761 msgid "" "Disable static documentation strings to reduce the memory footprint (enabled " "by default). Documentation strings defined in Python are not affected." msgstr "" -#: ../../using/configure.rst:703 +#: ../../using/configure.rst:764 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" -#: ../../using/configure.rst:705 +#: ../../using/configure.rst:766 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" -#: ../../using/configure.rst:709 +#: ../../using/configure.rst:770 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:713 +#: ../../using/configure.rst:774 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:718 +#: ../../using/configure.rst:779 msgid "" "Deactivate remote debugging support described in :pep:`768` (enabled by " "default). When this flag is provided the code that allows the interpreter to " @@ -1070,73 +1226,73 @@ msgid "" "executed." msgstr "" -#: ../../using/configure.rst:726 +#: ../../using/configure.rst:787 msgid "" "This macro is defined by default, unless Python is configured with :option:" "`--without-remote-debug`." msgstr "" -#: ../../using/configure.rst:729 +#: ../../using/configure.rst:790 msgid "" "Note that even if the macro is defined, remote debugging may not be " "available (for example, on an incompatible platform)." msgstr "" -#: ../../using/configure.rst:738 +#: ../../using/configure.rst:799 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:740 +#: ../../using/configure.rst:801 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:743 +#: ../../using/configure.rst:804 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:745 +#: ../../using/configure.rst:806 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:747 +#: ../../using/configure.rst:808 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" -#: ../../using/configure.rst:748 +#: ../../using/configure.rst:809 msgid "Add :func:`!sys.gettotalrefcount` function." msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:749 +#: ../../using/configure.rst:810 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:750 +#: ../../using/configure.rst:811 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:752 +#: ../../using/configure.rst:813 msgid "" "Add support for the ``__lltrace__`` variable: enable low-level tracing in " "the bytecode evaluation loop if the variable is defined." msgstr "" -#: ../../using/configure.rst:754 +#: ../../using/configure.rst:815 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:756 +#: ../../using/configure.rst:817 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:757 +#: ../../using/configure.rst:818 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -1144,56 +1300,56 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:762 +#: ../../using/configure.rst:823 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:763 +#: ../../using/configure.rst:824 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:765 +#: ../../using/configure.rst:826 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:767 +#: ../../using/configure.rst:828 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:768 +#: ../../using/configure.rst:829 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:770 +#: ../../using/configure.rst:831 msgid "" "The :c:macro:`!Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" -#: ../../using/configure.rst:773 +#: ../../using/configure.rst:834 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:776 +#: ../../using/configure.rst:837 msgid "" "Release builds and debug builds are now ABI compatible: defining the " "``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the :" "option:`--with-trace-refs` option)." msgstr "" -#: ../../using/configure.rst:783 +#: ../../using/configure.rst:844 msgid "Debug options" msgstr "偵錯選項" -#: ../../using/configure.rst:787 +#: ../../using/configure.rst:848 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." @@ -1201,23 +1357,23 @@ msgstr "" ":ref:`以偵錯模式建置 Python `:定義 ``Py_DEBUG`` 巨集(預設不啟" "用)。" -#: ../../using/configure.rst:792 +#: ../../using/configure.rst:853 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "以偵錯為目的啟用參照追蹤(預設不啟用)。" -#: ../../using/configure.rst:796 +#: ../../using/configure.rst:857 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:797 +#: ../../using/configure.rst:858 msgid "Add :func:`sys.getobjects` function." msgstr "新增 :func:`sys.getobjects` 函式。" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:859 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:800 +#: ../../using/configure.rst:861 msgid "" "The :envvar:`PYTHONDUMPREFS` environment variable can be used to dump " "objects and reference counts still alive at Python exit." @@ -1225,11 +1381,11 @@ msgstr "" ":envvar:`PYTHONDUMPREFS` 環境變數可以用來在 Python 結束時轉儲仍然有效的物件和" "參照計數。" -#: ../../using/configure.rst:803 +#: ../../using/configure.rst:864 msgid ":ref:`Statically allocated objects ` are not traced." msgstr "不追蹤\\ :ref:`靜態配置的物件 `。" -#: ../../using/configure.rst:807 +#: ../../using/configure.rst:868 msgid "" "This build is now ABI compatible with release build and :ref:`debug build " "`." @@ -1237,7 +1393,7 @@ msgstr "" "這個建置現在與發佈版本建置和\\ :ref:`偵錯建置 `\\ 具有 ABI 相容" "性。" -#: ../../using/configure.rst:813 +#: ../../using/configure.rst:874 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." @@ -1245,13 +1401,13 @@ msgstr "" "啟用 C 斷言建置(預設不啟用):``assert(...);`` 和 ``_PyObject_ASSERT(...);" "``。" -#: ../../using/configure.rst:816 +#: ../../using/configure.rst:877 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "如果設定,``NDEBUG`` 巨集不會在 :envvar:`OPT` 編譯器變數中定義。" -#: ../../using/configure.rst:819 +#: ../../using/configure.rst:880 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." @@ -1259,21 +1415,21 @@ msgstr "" "另請參閱 :option:`--with-pydebug` 選項(:ref:`debug build `)," "它也啟用了斷言。" -#: ../../using/configure.rst:826 +#: ../../using/configure.rst:887 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:830 +#: ../../using/configure.rst:891 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:832 +#: ../../using/configure.rst:893 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" "請參閱\\ :ref:`使用 DTrace 和 SystemTap 檢測 CPython `。" -#: ../../using/configure.rst:839 +#: ../../using/configure.rst:900 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no). To " "improve ASan detection capabilities you may also want to combine this with :" @@ -1281,27 +1437,27 @@ msgid "" "allocator whose allocations are not tracked by ASan." msgstr "" -#: ../../using/configure.rst:848 +#: ../../using/configure.rst:909 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "啟用 MemorySanitizer 分配錯誤偵測器 ``msan``\\ (預設不啟用)。" -#: ../../using/configure.rst:854 +#: ../../using/configure.rst:915 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" "啟用 UndefinedBehaviorSanitizer 未定義行為偵測器 ``ubsan``\\ (預設不啟用)。" -#: ../../using/configure.rst:861 +#: ../../using/configure.rst:922 msgid "Enable ThreadSanitizer data race detector, ``tsan`` (default is no)." msgstr "啟用 ThreadSanitizer 資料競爭偵測器 ``tsan``\\ (預設不啟用)。" -#: ../../using/configure.rst:872 +#: ../../using/configure.rst:933 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "啟用建置共享 Python 函式庫:``libpython``\\ (預設不啟用)。" -#: ../../using/configure.rst:876 +#: ../../using/configure.rst:937 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." @@ -1309,21 +1465,21 @@ msgstr "" "不要建置 ``libpythonMAJOR.MINOR.a`` 並且不要安裝 ``python.o``\\ (預設會建置" "並啟用)。" -#: ../../using/configure.rst:883 +#: ../../using/configure.rst:944 msgid "Libraries options" msgstr "函式庫選項" -#: ../../using/configure.rst:887 +#: ../../using/configure.rst:948 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:891 +#: ../../using/configure.rst:952 msgid "" "Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "使用已安裝的 ``expat`` 函式庫建置 :mod:`!pyexpat` 模組(預設不建置)。" -#: ../../using/configure.rst:896 +#: ../../using/configure.rst:957 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdecimal`` " "library, see the :mod:`decimal` module (default is yes)." @@ -1331,149 +1487,157 @@ msgstr "" "使用已安裝的 ``mpdecimal`` 函式庫建置 ``_decimal`` 擴充模組,請參閱 :mod:" "`decimal` 模組(預設建置)。" -#: ../../using/configure.rst:901 +#: ../../using/configure.rst:962 msgid "Default to using the installed ``mpdecimal`` library." msgstr "預設使用已安裝的 ``mpdecimal`` 函式庫。" -#: ../../using/configure.rst:904 +#: ../../using/configure.rst:967 +msgid "" +"A bundled copy of the library will no longer be selected implicitly if an " +"installed ``mpdecimal`` library is not found. In Python 3.15 only, it can " +"still be selected explicitly using ``--with-system-libmpdec=no`` or ``--" +"without-system-libmpdec``." +msgstr "" + +#: ../../using/configure.rst:972 msgid "" "A copy of the ``mpdecimal`` library sources will no longer be distributed " "with Python 3.16." msgstr "Python 3.16 不再隨附 ``mpdecimal`` 函式庫的原始碼副本。" -#: ../../using/configure.rst:908 +#: ../../using/configure.rst:976 msgid ":option:`LIBMPDEC_CFLAGS` and :option:`LIBMPDEC_LIBS`." msgstr ":option:`LIBMPDEC_CFLAGS` 和 :option:`LIBMPDEC_LIBS`。" -#: ../../using/configure.rst:912 +#: ../../using/configure.rst:980 msgid "Designate a backend library for the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:914 +#: ../../using/configure.rst:982 msgid "readline: Use readline as the backend." msgstr "" -#: ../../using/configure.rst:915 +#: ../../using/configure.rst:983 msgid "editline: Use editline as the backend." msgstr "" -#: ../../using/configure.rst:921 +#: ../../using/configure.rst:989 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "不要建置 :mod:`readline` 模組(預設會建置)。" -#: ../../using/configure.rst:923 +#: ../../using/configure.rst:991 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:929 +#: ../../using/configure.rst:997 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:933 +#: ../../using/configure.rst:1001 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:937 +#: ../../using/configure.rst:1005 msgid "Root of the OpenSSL directory." msgstr "OpenSSL 目錄的根目錄。" -#: ../../using/configure.rst:943 +#: ../../using/configure.rst:1011 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:945 +#: ../../using/configure.rst:1013 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:946 +#: ../../using/configure.rst:1014 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:948 +#: ../../using/configure.rst:1016 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:954 +#: ../../using/configure.rst:1022 msgid "Security Options" msgstr "安全性選項" -#: ../../using/configure.rst:958 +#: ../../using/configure.rst:1026 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:960 +#: ../../using/configure.rst:1028 msgid "``siphash13`` (default);" msgstr "``siphash13``\\ (預設);" -#: ../../using/configure.rst:961 +#: ../../using/configure.rst:1029 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:962 +#: ../../using/configure.rst:1030 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:966 +#: ../../using/configure.rst:1034 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:971 +#: ../../using/configure.rst:1039 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:973 +#: ../../using/configure.rst:1041 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:974 +#: ../../using/configure.rst:1042 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:975 +#: ../../using/configure.rst:1043 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:976 +#: ../../using/configure.rst:1044 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:977 +#: ../../using/configure.rst:1045 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:978 +#: ../../using/configure.rst:1046 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:984 +#: ../../using/configure.rst:1052 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:986 +#: ../../using/configure.rst:1054 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:987 +#: ../../using/configure.rst:1055 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:988 +#: ../../using/configure.rst:1056 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:990 +#: ../../using/configure.rst:1058 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:996 +#: ../../using/configure.rst:1064 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:1001 +#: ../../using/configure.rst:1069 msgid "" "Disable compiler options that are `recommended by OpenSSF`_ for security " "reasons with no performance overhead. If this option is not enabled, CPython " @@ -1482,24 +1646,24 @@ msgid "" "listed below." msgstr "" -#: ../../using/configure.rst:1005 +#: ../../using/configure.rst:1073 msgid "" "The following compiler options are disabled with :option:`!--disable-safety`:" msgstr "" -#: ../../using/configure.rst:1007 +#: ../../using/configure.rst:1075 msgid "" "`-fstack-protector-strong`_: Enable run-time checks for stack-based buffer " "overflows." msgstr "" -#: ../../using/configure.rst:1008 +#: ../../using/configure.rst:1076 msgid "" "`-Wtrampolines`_: Enable warnings about trampolines that require executable " "stacks." msgstr "" -#: ../../using/configure.rst:1018 +#: ../../using/configure.rst:1086 msgid "" "Enable compiler options that are `recommended by OpenSSF`_ for security " "reasons which require overhead. If this option is not enabled, CPython will " @@ -1508,81 +1672,81 @@ msgid "" "listed below." msgstr "" -#: ../../using/configure.rst:1022 +#: ../../using/configure.rst:1090 msgid "" "The following compiler options are enabled with :option:`!--enable-slower-" "safety`:" msgstr "" -#: ../../using/configure.rst:1024 +#: ../../using/configure.rst:1092 msgid "" "`-D_FORTIFY_SOURCE=3`_: Fortify sources with compile- and run-time checks " "for unsafe libc usage and buffer overflows." msgstr "" -#: ../../using/configure.rst:1032 +#: ../../using/configure.rst:1100 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:1034 +#: ../../using/configure.rst:1102 msgid "See :source:`Mac/README.rst`." msgstr "參閱 :source:`Mac/README.rst`。" -#: ../../using/configure.rst:1039 +#: ../../using/configure.rst:1107 msgid "" "Create a universal binary build. *SDKDIR* specifies which macOS SDK should " "be used to perform the build (default is no)." msgstr "" -#: ../../using/configure.rst:1045 +#: ../../using/configure.rst:1113 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:1050 +#: ../../using/configure.rst:1118 msgid "" "Specify the kind of universal binary that should be created. This option is " "only valid when :option:`--enable-universalsdk` is set." msgstr "" -#: ../../using/configure.rst:1053 +#: ../../using/configure.rst:1121 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:1055 +#: ../../using/configure.rst:1123 msgid "``universal2`` (x86-64 and arm64);" msgstr "``universal2``\\ (x86-64 與 arm64);" -#: ../../using/configure.rst:1056 +#: ../../using/configure.rst:1124 msgid "``32-bit`` (PPC and i386);" msgstr "``32-bit``\\ (PPC 與 i386);" -#: ../../using/configure.rst:1057 +#: ../../using/configure.rst:1125 msgid "``64-bit`` (PPC64 and x86-64);" msgstr "``64-bit``\\ (PPC64 與 x86-64);" -#: ../../using/configure.rst:1058 +#: ../../using/configure.rst:1126 msgid "``3-way`` (i386, PPC and x86-64);" msgstr "``3-way``\\ (i386、PPC 與 x86-64);" -#: ../../using/configure.rst:1059 +#: ../../using/configure.rst:1127 msgid "``intel`` (i386 and x86-64);" msgstr "``intel``\\ (i386 與 x86-64);" -#: ../../using/configure.rst:1060 +#: ../../using/configure.rst:1128 msgid "``intel-32`` (i386);" msgstr "``intel-32``\\ (i386);" -#: ../../using/configure.rst:1061 +#: ../../using/configure.rst:1129 msgid "``intel-64`` (x86-64);" msgstr "``intel-64``\\ (x86-64);" -#: ../../using/configure.rst:1062 +#: ../../using/configure.rst:1130 msgid "``all`` (PPC, i386, PPC64 and x86-64)." msgstr "``all``\\ (PPC、i386、PPC64 與 x86-64)。" -#: ../../using/configure.rst:1064 +#: ../../using/configure.rst:1132 msgid "" "Note that values for this configuration item are *not* the same as the " "identifiers used for universal binary wheels on macOS. See the Python " @@ -1591,13 +1755,13 @@ msgid "" "platform-compatibility-tags/#macos>`_" msgstr "" -#: ../../using/configure.rst:1072 +#: ../../using/configure.rst:1140 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:1078 +#: ../../using/configure.rst:1146 msgid "" "The Python standard library contains strings that are known to trigger " "automated inspection tool errors when submitted for distribution by the " @@ -1606,29 +1770,29 @@ msgid "" "can also be specified. This option is disabled by default." msgstr "" -#: ../../using/configure.rst:1087 +#: ../../using/configure.rst:1155 msgid "iOS Options" msgstr "iOS 選項" -#: ../../using/configure.rst:1089 +#: ../../using/configure.rst:1157 msgid "See :source:`iOS/README.rst`." msgstr "參閱 :source:`iOS/README.rst`。" -#: ../../using/configure.rst:1093 +#: ../../using/configure.rst:1161 msgid "" "Create a Python.framework. Unlike macOS, the *INSTALLDIR* argument " "specifying the installation path is mandatory." msgstr "" -#: ../../using/configure.rst:1098 +#: ../../using/configure.rst:1166 msgid "Specify the name for the framework (default: ``Python``)." msgstr "指定框架的名稱(預設值:``Python``)。" -#: ../../using/configure.rst:1102 +#: ../../using/configure.rst:1170 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:1104 +#: ../../using/configure.rst:1172 msgid "" "Cross compiling, also known as cross building, can be used to build Python " "for another CPU architecture or platform. Cross compiling requires a Python " @@ -1636,28 +1800,28 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:1111 +#: ../../using/configure.rst:1179 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:1115 +#: ../../using/configure.rst:1183 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:1119 +#: ../../using/configure.rst:1187 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:1125 +#: ../../using/configure.rst:1193 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:1127 +#: ../../using/configure.rst:1195 msgid "Example *config.site* file:" msgstr "範例 *config.site* 檔案:" -#: ../../using/configure.rst:1129 +#: ../../using/configure.rst:1197 msgid "" "# config.site-aarch64\n" "ac_cv_buggy_getaddrinfo=no\n" @@ -1669,15 +1833,15 @@ msgstr "" "ac_cv_file__dev_ptmx=yes\n" "ac_cv_file__dev_ptc=no" -#: ../../using/configure.rst:1138 +#: ../../using/configure.rst:1206 msgid "Program to run CPython for the host platform for cross-compilation." msgstr "" -#: ../../using/configure.rst:1143 +#: ../../using/configure.rst:1211 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:1145 +#: ../../using/configure.rst:1213 msgid "" "CONFIG_SITE=config.site-aarch64 ../configure \\\n" " --build=x86_64-pc-linux-gnu \\\n" @@ -1689,65 +1853,65 @@ msgstr "" " --host=aarch64-unknown-linux-gnu \\\n" " --with-build-python=../x86_64/python" -#: ../../using/configure.rst:1152 +#: ../../using/configure.rst:1220 msgid "Python Build System" msgstr "Python 建置系統" -#: ../../using/configure.rst:1155 +#: ../../using/configure.rst:1223 msgid "Main files of the build system" msgstr "建置系統的主要檔案" -#: ../../using/configure.rst:1157 +#: ../../using/configure.rst:1225 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`;" -#: ../../using/configure.rst:1158 +#: ../../using/configure.rst:1226 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" ":file:`Makefile.pre.in` => :file:`Makefile`\\ (由 :file:`configure` 建立);" -#: ../../using/configure.rst:1159 +#: ../../using/configure.rst:1227 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h`\\ (由 :file:`configure` 建立);" -#: ../../using/configure.rst:1160 +#: ../../using/configure.rst:1228 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:1164 +#: ../../using/configure.rst:1232 msgid "Main build steps" msgstr "主要建置步驟" -#: ../../using/configure.rst:1166 +#: ../../using/configure.rst:1234 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "C 檔案(``.c``)被建置為目的檔(``.o``)。" -#: ../../using/configure.rst:1167 +#: ../../using/configure.rst:1235 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:1168 +#: ../../using/configure.rst:1236 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:1170 +#: ../../using/configure.rst:1238 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:1173 +#: ../../using/configure.rst:1241 msgid "Main Makefile targets" msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:1176 +#: ../../using/configure.rst:1244 msgid "make" msgstr "make" -#: ../../using/configure.rst:1178 +#: ../../using/configure.rst:1246 msgid "" "For the most part, when rebuilding after editing some code or refreshing " "your checkout from upstream, all you need to do is execute ``make``, which " @@ -1758,22 +1922,22 @@ msgid "" "all`` will build. The three choices are:" msgstr "" -#: ../../using/configure.rst:1187 +#: ../../using/configure.rst:1255 msgid "``profile-opt`` (configured with ``--enable-optimizations``)" msgstr "``profile-opt``\\ (使用 ``--enable-optimizations`` 配置)" -#: ../../using/configure.rst:1188 +#: ../../using/configure.rst:1256 msgid "" "``build_wasm`` (chosen if the host platform matches ``wasm32-wasi*`` or " "``wasm32-emscripten``)" msgstr "" -#: ../../using/configure.rst:1190 +#: ../../using/configure.rst:1258 msgid "" "``build_all`` (configured without explicitly using either of the others)" msgstr "``build_all``\\ (未明確使用其他選項進行配置)" -#: ../../using/configure.rst:1192 +#: ../../using/configure.rst:1260 msgid "" "Depending on the most recent source file changes, Make will rebuild any " "targets (object files and executables) deemed out-of-date, including running " @@ -1786,11 +1950,11 @@ msgid "" "problems, at the expense of longer build times." msgstr "" -#: ../../using/configure.rst:1205 +#: ../../using/configure.rst:1273 msgid "make platform" msgstr "make platform" -#: ../../using/configure.rst:1207 +#: ../../using/configure.rst:1275 msgid "" "Build the ``python`` program, but don't build the standard library extension " "modules. This generates a file named ``platform`` which contains a single " @@ -1798,91 +1962,91 @@ msgid "" "arm64-3.12`` or ``linux-x86_64-3.13``." msgstr "" -#: ../../using/configure.rst:1214 +#: ../../using/configure.rst:1282 msgid "make profile-opt" msgstr "make profile-opt" -#: ../../using/configure.rst:1216 +#: ../../using/configure.rst:1284 msgid "" "Build Python using profile-guided optimization (PGO). You can use the " "configure :option:`--enable-optimizations` option to make this the default " "target of the ``make`` command (``make all`` or just ``make``)." msgstr "" -#: ../../using/configure.rst:1224 +#: ../../using/configure.rst:1292 msgid "make clean" msgstr "make clean" -#: ../../using/configure.rst:1226 +#: ../../using/configure.rst:1294 msgid "Remove built files." msgstr "移除建置的檔案。" -#: ../../using/configure.rst:1230 +#: ../../using/configure.rst:1298 msgid "make distclean" msgstr "make distclean" -#: ../../using/configure.rst:1232 +#: ../../using/configure.rst:1300 msgid "" "In addition to the work done by ``make clean``, remove files created by the " "configure script. ``configure`` will have to be run before building again. " "[#]_" msgstr "" -#: ../../using/configure.rst:1238 +#: ../../using/configure.rst:1306 msgid "make install" msgstr "make install" -#: ../../using/configure.rst:1240 +#: ../../using/configure.rst:1308 msgid "Build the ``all`` target and install Python." msgstr "建置 ``all`` 目標並安裝 Python。" -#: ../../using/configure.rst:1244 +#: ../../using/configure.rst:1312 msgid "make test" msgstr "make test" -#: ../../using/configure.rst:1246 +#: ../../using/configure.rst:1314 msgid "" "Build the ``all`` target and run the Python test suite with the ``--fast-" "ci`` option without GUI tests. Variables:" msgstr "" -#: ../../using/configure.rst:1249 +#: ../../using/configure.rst:1317 msgid "``TESTOPTS``: additional regrtest command-line options." msgstr "``TESTOPTS``:額外的 regrtest 命令列選項。" -#: ../../using/configure.rst:1250 +#: ../../using/configure.rst:1318 msgid "``TESTPYTHONOPTS``: additional Python command-line options." msgstr "``TESTPYTHONOPTS``:額外的 Python 命令列選項。" -#: ../../using/configure.rst:1251 +#: ../../using/configure.rst:1319 msgid "``TESTTIMEOUT``: timeout in seconds (default: 10 minutes)." msgstr "``TESTTIMEOUT``:秒數表示的超時設定(預設值:10 分鐘)。" -#: ../../using/configure.rst:1255 +#: ../../using/configure.rst:1323 msgid "make ci" msgstr "make ci" -#: ../../using/configure.rst:1257 +#: ../../using/configure.rst:1325 msgid "" "This is similar to ``make test``, but uses the ``-ugui`` to also run GUI " "tests." msgstr "" -#: ../../using/configure.rst:1263 +#: ../../using/configure.rst:1331 msgid "make buildbottest" msgstr "make buildbottest" -#: ../../using/configure.rst:1265 +#: ../../using/configure.rst:1333 msgid "" "This is similar to ``make test``, but uses the ``--slow-ci`` option and " "default timeout of 20 minutes, instead of ``--fast-ci`` option." msgstr "" -#: ../../using/configure.rst:1270 +#: ../../using/configure.rst:1338 msgid "make regen-all" msgstr "make regen-all" -#: ../../using/configure.rst:1272 +#: ../../using/configure.rst:1340 msgid "" "Regenerate (almost) all generated files. These include (but are not limited " "to) bytecode cases, and parser generator file. ``make regen-stdlib-module-" @@ -1890,18 +2054,18 @@ msgid "" "files <#generated-files>`_." msgstr "" -#: ../../using/configure.rst:1279 +#: ../../using/configure.rst:1347 msgid "C extensions" msgstr "C 擴充模組" -#: ../../using/configure.rst:1281 +#: ../../using/configure.rst:1349 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute:" msgstr "" -#: ../../using/configure.rst:1285 +#: ../../using/configure.rst:1353 msgid "" ">>> import sys\n" ">>> sys\n" @@ -1919,14 +2083,14 @@ msgstr "" " File \"\", line 1, in \n" "AttributeError: module 'sys' has no attribute '__file__'" -#: ../../using/configure.rst:1295 +#: ../../using/configure.rst:1363 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64:" msgstr "" -#: ../../using/configure.rst:1299 +#: ../../using/configure.rst:1367 msgid "" ">>> import _asyncio\n" ">>> _asyncio\n" @@ -1942,7 +2106,7 @@ msgstr "" ">>> _asyncio.__file__\n" "'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" -#: ../../using/configure.rst:1307 +#: ../../using/configure.rst:1375 msgid "" ":file:`Modules/Setup` is used to generate Makefile targets to build C " "extensions. At the beginning of the files, C extensions are built as built-" @@ -1950,164 +2114,164 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:1311 +#: ../../using/configure.rst:1379 msgid "" "The :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` and :c:macro:" "`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are defined differently " "depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:1315 +#: ../../using/configure.rst:1383 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:1316 +#: ../../using/configure.rst:1384 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:1318 +#: ../../using/configure.rst:1386 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its :samp:`PyInit_{xxx}()` function is not " "exported, causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:1324 +#: ../../using/configure.rst:1392 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:1326 +#: ../../using/configure.rst:1394 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:1330 +#: ../../using/configure.rst:1398 msgid "Preprocessor flags" msgstr "預處理器旗標" -#: ../../using/configure.rst:1334 +#: ../../using/configure.rst:1402 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1340 +#: ../../using/configure.rst:1408 msgid "" "(Objective) C/C++ preprocessor flags, e.g. :samp:`-I{include_dir}` if you " "have headers in a nonstandard directory *include_dir*." msgstr "" -#: ../../using/configure.rst:1343 ../../using/configure.rst:1533 +#: ../../using/configure.rst:1411 ../../using/configure.rst:1601 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value to be able to build extension modules using the directories specified " "in the environment variables." msgstr "" -#: ../../using/configure.rst:1353 +#: ../../using/configure.rst:1421 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1355 +#: ../../using/configure.rst:1423 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:1360 +#: ../../using/configure.rst:1428 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:1366 +#: ../../using/configure.rst:1434 msgid "Example: ``gcc -pthread``." msgstr "範例:``gcc -pthread``。" -#: ../../using/configure.rst:1370 +#: ../../using/configure.rst:1438 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:1372 +#: ../../using/configure.rst:1440 msgid "Example: ``g++ -pthread``." msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:1380 +#: ../../using/configure.rst:1448 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " "extensions. Use it when a compiler flag should *not* be part of :envvar:" "`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1384 +#: ../../using/configure.rst:1452 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1386 +#: ../../using/configure.rst:1454 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" -#: ../../using/configure.rst:1391 +#: ../../using/configure.rst:1459 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:1399 +#: ../../using/configure.rst:1467 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:1406 +#: ../../using/configure.rst:1474 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:1410 +#: ../../using/configure.rst:1478 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1417 +#: ../../using/configure.rst:1485 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1424 +#: ../../using/configure.rst:1492 msgid "Base compiler flags." msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:1428 +#: ../../using/configure.rst:1496 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:1432 +#: ../../using/configure.rst:1500 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:1438 +#: ../../using/configure.rst:1506 msgid "Compiler flags used to build a shared library." msgstr "用於建置共享函式庫的編譯器旗標。" -#: ../../using/configure.rst:1440 +#: ../../using/configure.rst:1508 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:1444 +#: ../../using/configure.rst:1512 msgid "Extra C flags added for building the interpreter object files." msgstr "用於建置直譯器目的檔的額外 C 旗標。" -#: ../../using/configure.rst:1446 +#: ../../using/configure.rst:1514 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" "預設值:當使用 :option:`--enable-shared` 時為 ``$(CCSHARED)``,否則為空字串。" -#: ../../using/configure.rst:1451 +#: ../../using/configure.rst:1519 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." @@ -2115,7 +2279,7 @@ msgstr "" "預設值:``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``。" -#: ../../using/configure.rst:1455 +#: ../../using/configure.rst:1523 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." @@ -2123,11 +2287,11 @@ msgstr "" "預設值:``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``。" -#: ../../using/configure.rst:1461 +#: ../../using/configure.rst:1529 msgid "C flags used for building the interpreter object files." msgstr "用於建置直譯器目的檔的 C 旗標。" -#: ../../using/configure.rst:1463 +#: ../../using/configure.rst:1531 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." @@ -2135,126 +2299,126 @@ msgstr "" "預設值:``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``。" -#: ../../using/configure.rst:1469 +#: ../../using/configure.rst:1537 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "預設值:``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``。" -#: ../../using/configure.rst:1475 +#: ../../using/configure.rst:1543 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:1478 +#: ../../using/configure.rst:1546 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "預設值:``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``。" -#: ../../using/configure.rst:1484 +#: ../../using/configure.rst:1552 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:1486 +#: ../../using/configure.rst:1554 msgid "Default: empty string (not used)." msgstr "預設值:空字串(未使用)。" -#: ../../using/configure.rst:1490 +#: ../../using/configure.rst:1558 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:1494 +#: ../../using/configure.rst:1562 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:1496 +#: ../../using/configure.rst:1564 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "預設值:``$(PURIFY) $(CC)``。" -#: ../../using/configure.rst:1500 +#: ../../using/configure.rst:1568 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1502 +#: ../../using/configure.rst:1570 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" -#: ../../using/configure.rst:1510 +#: ../../using/configure.rst:1578 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" "`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of :envvar:" "`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1514 +#: ../../using/configure.rst:1582 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1516 +#: ../../using/configure.rst:1584 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" -#: ../../using/configure.rst:1523 +#: ../../using/configure.rst:1591 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1530 +#: ../../using/configure.rst:1598 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" -#: ../../using/configure.rst:1539 +#: ../../using/configure.rst:1607 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:1542 +#: ../../using/configure.rst:1610 msgid "Example: ``-lrt``." msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:1546 +#: ../../using/configure.rst:1614 msgid "Command to build a shared library." msgstr "建置共享函式庫的指令。" -#: ../../using/configure.rst:1548 +#: ../../using/configure.rst:1616 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1552 +#: ../../using/configure.rst:1620 msgid "Command to build ``libpython`` shared library." msgstr "建置 ``libpython`` 共享函式庫的指令。" -#: ../../using/configure.rst:1554 +#: ../../using/configure.rst:1622 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1558 +#: ../../using/configure.rst:1626 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1562 +#: ../../using/configure.rst:1630 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1568 +#: ../../using/configure.rst:1636 msgid "Linker flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1574 +#: ../../using/configure.rst:1642 msgid "Footnotes" msgstr "註腳" -#: ../../using/configure.rst:1575 +#: ../../using/configure.rst:1643 msgid "" "``git clean -fdx`` is an even more extreme way to \"clean\" your checkout. " "It removes all files not known to Git. When bug hunting using ``git " @@ -2263,3 +2427,24 @@ msgid "" "clean build. **Use with care**, as it will delete all files not checked into " "Git, including your new, uncommitted work." msgstr "" + +#~ msgid "Features and minimum versions required to build CPython:" +#~ msgstr "建置 CPython 所需的功能與最小版本:" + +#~ msgid "" +#~ "`OpenSSL `_ 1.1.1 is the minimum version and " +#~ "OpenSSL 3.0.18 is the recommended minimum version for the :mod:`ssl` and :" +#~ "mod:`hashlib` extension modules." +#~ msgstr "" +#~ "`OpenSSL `_ 1.1.1 是最低版本,OpenSSL 3.0.18 " +#~ "是 :mod:`ssl` 與 :mod:`hashlib` 擴充模組的建議最低版本。" + +#~ msgid "" +#~ "On Windows, Visual Studio 2015 or later is now required. Tcl/Tk version " +#~ "8.4 is now required." +#~ msgstr "" +#~ "在 Windows 上,Visual Studio 2015 或更新版本與 Tcl/Tk version 8.4 現在是必" +#~ "要的。" + +#~ msgid "OpenSSL 1.1.1 is now required. Require SQLite 3.7.15." +#~ msgstr "OpenSSL 1.1.1 現在是必要的。需要 SQLite 3.7.15。" diff --git a/using/unix.po b/using/unix.po index cc436ee93e8..864741b34b6 100644 --- a/using/unix.po +++ b/using/unix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-03-20 00:14+0000\n" +"POT-Creation-Date: 2025-11-10 16:45+0000\n" "PO-Revision-Date: 2023-03-27 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -165,34 +165,42 @@ msgstr "例如 i386 使用者要取得 Python 2.5.1 的可用版本: ::" #: ../../using/unix.rst:79 msgid "" -"pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/" -"python-2.5.1p2.tgz" +"pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2." +"tgz" msgstr "" -"pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/" -"python-2.5.1p2.tgz" +"pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2." +"tgz" #: ../../using/unix.rst:85 msgid "Building Python" msgstr "建置 Python" -#: ../../using/unix.rst:87 +#: ../../using/unix.rst:89 +msgid "" +"If you want to contribute to CPython, refer to the `devguide `_, which includes build " +"instructions and other tips on setting up environment." +msgstr "" + +#: ../../using/unix.rst:93 +#, fuzzy msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " -"either the latest release's source or just grab a fresh `clone `_. (If you want to " -"contribute patches, you will need a clone.)" +"either the latest release's source or grab a fresh `clone `_. You will also need to install the :" +"ref:`build requirements `." msgstr "" "如果你想自己編譯 CPython,首先要做的是取得\\ `原始碼 `_。你可以下載最新版本的原始碼,也可以直接提取最新的 `clone" "(克隆) `_。(如" "果你想要貢獻修補程式碼,也會需要一份 clone。)" -#: ../../using/unix.rst:93 +#: ../../using/unix.rst:99 msgid "The build process consists of the usual commands::" msgstr "建置過程由幾個常用命令組成: ::" -#: ../../using/unix.rst:95 +#: ../../using/unix.rst:101 msgid "" "./configure\n" "make\n" @@ -202,7 +210,7 @@ msgstr "" "make\n" "make install" -#: ../../using/unix.rst:99 +#: ../../using/unix.rst:105 msgid "" ":ref:`Configuration options ` and caveats for specific " "Unix platforms are extensively documented in the :source:`README.rst` file " @@ -212,21 +220,21 @@ msgstr "" "地記錄在 Python 原始碼樹 (source tree) 根目錄下的 :source:`README.rst` 檔案" "中。" -#: ../../using/unix.rst:105 +#: ../../using/unix.rst:111 msgid "" "``make install`` can overwrite or masquerade the :file:`python3` binary. " "``make altinstall`` is therefore recommended instead of ``make install`` " "since it only installs :file:`{exec_prefix}/bin/python{version}`." msgstr "" "``make install`` 可以覆蓋或偽裝 :file:`python3` 二進位制檔案。因此,建議使用 " -"``make altinstall`` 而不是 ``make install``,因為它只安" -"裝 :file:`{exec_prefix}/bin/python{version}`。" +"``make altinstall`` 而不是 ``make install``,因為它只安裝 :file:" +"`{exec_prefix}/bin/python{version}`。" -#: ../../using/unix.rst:111 +#: ../../using/unix.rst:117 msgid "Python-related paths and files" msgstr "與 Python 相關的路徑和檔案" -#: ../../using/unix.rst:113 +#: ../../using/unix.rst:119 msgid "" "These are subject to difference depending on local installation " "conventions; :option:`prefix <--prefix>` and :option:`exec_prefix <--exec-" @@ -236,28 +244,28 @@ msgstr "" "這取決於本地安裝慣例;:option:`prefix <--prefix>` 和 :option:`exec_prefix <--" "exec-prefix>` 相依於安裝方式,應被直譯來讓 GNU 軟體使用;它們也可能相同。" -#: ../../using/unix.rst:118 +#: ../../using/unix.rst:124 msgid "" "For example, on most Linux systems, the default for both is :file:`/usr`." msgstr "例如,在大多數 Linux 系統上,兩者的預設值皆是 :file:`/usr`。" -#: ../../using/unix.rst:121 +#: ../../using/unix.rst:127 msgid "File/directory" msgstr "檔案/目錄" -#: ../../using/unix.rst:121 +#: ../../using/unix.rst:127 msgid "Meaning" msgstr "含意" -#: ../../using/unix.rst:123 +#: ../../using/unix.rst:129 msgid ":file:`{exec_prefix}/bin/python3`" msgstr ":file:`{exec_prefix}/bin/python3`" -#: ../../using/unix.rst:123 +#: ../../using/unix.rst:129 msgid "Recommended location of the interpreter." msgstr "直譯器的推薦位置。" -#: ../../using/unix.rst:125 +#: ../../using/unix.rst:131 msgid "" ":file:`{prefix}/lib/python{version}`, :file:`{exec_prefix}/lib/" "python{version}`" @@ -265,12 +273,12 @@ msgstr "" ":file:`{prefix}/lib/python{version}`、:file:`{exec_prefix}/lib/" "python{version}`" -#: ../../using/unix.rst:125 +#: ../../using/unix.rst:131 msgid "" "Recommended locations of the directories containing the standard modules." msgstr "包含標準模組目錄的推薦位置。" -#: ../../using/unix.rst:128 +#: ../../using/unix.rst:134 msgid "" ":file:`{prefix}/include/python{version}`, :file:`{exec_prefix}/include/" "python{version}`" @@ -278,59 +286,59 @@ msgstr "" ":file:`{prefix}/include/python{version}`、:file:`{exec_prefix}/include/" "python{version}`" -#: ../../using/unix.rst:128 +#: ../../using/unix.rst:134 msgid "" "Recommended locations of the directories containing the include files needed " "for developing Python extensions and embedding the interpreter." msgstr "" "包含開發 Python 擴充套件和嵌入直譯器所需 include 檔案之目錄的推薦位置。" -#: ../../using/unix.rst:136 +#: ../../using/unix.rst:142 msgid "Miscellaneous" msgstr "雜項" -#: ../../using/unix.rst:138 +#: ../../using/unix.rst:144 msgid "" "To easily use Python scripts on Unix, you need to make them executable, e.g. " "with" msgstr "" "要在 Unix 上使用 Python 腳本,你需要讓他們是可執行的 (executable),例如用" -#: ../../using/unix.rst:141 +#: ../../using/unix.rst:147 msgid "$ chmod +x script" msgstr "$ chmod +x script" -#: ../../using/unix.rst:145 +#: ../../using/unix.rst:151 msgid "" "and put an appropriate Shebang line at the top of the script. A good choice " "is usually ::" msgstr "並在腳本的頂部放一個合適的 Shebang。以下通常是個好選擇: ::" -#: ../../using/unix.rst:148 +#: ../../using/unix.rst:154 msgid "#!/usr/bin/env python3" msgstr "#!/usr/bin/env python3" -#: ../../using/unix.rst:150 +#: ../../using/unix.rst:156 msgid "" "which searches for the Python interpreter in the whole :envvar:`PATH`. " "However, some Unices may not have the :program:`env` command, so you may " "need to hardcode ``/usr/bin/python3`` as the interpreter path." msgstr "" -"將在整個 :envvar:`PATH` 中搜尋 Python 直譯器。然而某些 Unix 系統可能沒" -"有 :program:`env` 命令,因此你可能需要將 ``/usr/bin/python3`` 寫死 " -"(hardcode) 成直譯器路徑。" +"將在整個 :envvar:`PATH` 中搜尋 Python 直譯器。然而某些 Unix 系統可能沒有 :" +"program:`env` 命令,因此你可能需要將 ``/usr/bin/python3`` 寫死 (hardcode) 成" +"直譯器路徑。" -#: ../../using/unix.rst:154 +#: ../../using/unix.rst:160 msgid "" "To use shell commands in your Python scripts, look at the :mod:`subprocess` " "module." msgstr "要在 Python 腳本中使用 shell 命令,請見 :mod:`subprocess` 模組。" -#: ../../using/unix.rst:159 +#: ../../using/unix.rst:165 msgid "Custom OpenSSL" msgstr "客製化 OpenSSL" -#: ../../using/unix.rst:161 +#: ../../using/unix.rst:167 msgid "" "To use your vendor's OpenSSL configuration and system trust store, locate " "the directory with ``openssl.cnf`` file or symlink in ``/etc``. On most " @@ -343,7 +351,7 @@ msgstr "" "(symlink)。在大多數發行版上,該檔案會是在 ``/etc/ssl`` 或者 ``/etc/pki/tls`` " "中。該目錄亦應包含一個 ``cert.pem`` 檔案和/或一個 ``certs`` 目錄。" -#: ../../using/unix.rst:167 +#: ../../using/unix.rst:173 msgid "" "$ find /etc/ -name openssl.cnf -printf \"%h\\n\"\n" "/etc/ssl" @@ -351,7 +359,7 @@ msgstr "" "$ find /etc/ -name openssl.cnf -printf \"%h\\n\"\n" "/etc/ssl" -#: ../../using/unix.rst:172 +#: ../../using/unix.rst:178 msgid "" "Download, build, and install OpenSSL. Make sure you use ``install_sw`` and " "not ``install``. The ``install_sw`` target does not override ``openssl.cnf``." @@ -359,7 +367,7 @@ msgstr "" "下載、建置並安裝 OpenSSL。請確保你使用 ``install_sw`` 而不是 ``install``。" "``install_sw`` 的目標不會覆蓋 ``openssl.cnf``。" -#: ../../using/unix.rst:176 +#: ../../using/unix.rst:182 msgid "" "$ curl -O https://www.openssl.org/source/openssl-VERSION.tar.gz\n" "$ tar xzf openssl-VERSION\n" @@ -385,7 +393,7 @@ msgstr "" "$ make install_sw\n" "$ popd" -#: ../../using/unix.rst:190 +#: ../../using/unix.rst:196 msgid "" "Build Python with custom OpenSSL (see the configure ``--with-openssl`` and " "``--with-openssl-rpath`` options)" @@ -393,7 +401,7 @@ msgstr "" "使用客製化 OpenSSL 建置 Python(參見配置 ``--with-openssl`` 和 ``--with-" "openssl-rpath`` 選項)" -#: ../../using/unix.rst:193 +#: ../../using/unix.rst:199 msgid "" "$ pushd python-3.x.x\n" "$ ./configure -C \\\n" @@ -411,7 +419,7 @@ msgstr "" "$ make -j8\n" "$ make altinstall" -#: ../../using/unix.rst:205 +#: ../../using/unix.rst:211 msgid "" "Patch releases of OpenSSL have a backwards compatible ABI. You don't need to " "recompile Python to update OpenSSL. It's sufficient to replace the custom " diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 80e81986743..2db10815b6f 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -6,7 +6,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-11-10 16:45+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1314,7 +1314,7 @@ msgid "" "d'Arc, after a suggestion by George Sakkis; :issue:`5982`.)" msgstr "" -#: ../../whatsnew/2.7.rst:869 ../../whatsnew/2.7.rst:2466 +#: ../../whatsnew/2.7.rst:869 ../../whatsnew/2.7.rst:2464 msgid "" "When a restricted set of attributes were set using ``__slots__``, deleting " "an unset attribute would not raise :exc:`AttributeError` as you would " @@ -1816,7 +1816,7 @@ msgid "" "types. (Changed by Mark Dickinson; :issue:`6857`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1220 ../../whatsnew/2.7.rst:2484 +#: ../../whatsnew/2.7.rst:1220 ../../whatsnew/2.7.rst:2482 msgid "" "Comparisons involving a signaling NaN value (or ``sNAN``) now signal :const:" "`~decimal.InvalidOperation` instead of silently returning a true or false " @@ -2379,7 +2379,7 @@ msgid "" "Hylton.)" msgstr "" -#: ../../whatsnew/2.7.rst:1601 ../../whatsnew/2.7.rst:2500 +#: ../../whatsnew/2.7.rst:1601 ../../whatsnew/2.7.rst:2498 msgid "" "The :mod:`syslog` module will now use the value of ``sys.argv[0]`` as the " "identifier instead of the previous default value of ``'python'``. (Changed " @@ -2402,7 +2402,7 @@ msgid "" "(Contributed by Brian Curtin; :issue:`7766`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1616 ../../whatsnew/2.7.rst:2504 +#: ../../whatsnew/2.7.rst:1616 ../../whatsnew/2.7.rst:2502 msgid "" "The :mod:`tarfile` module's default error handling has changed, to no longer " "suppress fatal errors. The default error level was previously 0, which " @@ -2446,7 +2446,7 @@ msgid "" "Florent Xicluna; :issue:`8024`)." msgstr "" -#: ../../whatsnew/2.7.rst:1651 ../../whatsnew/2.7.rst:2512 +#: ../../whatsnew/2.7.rst:1651 ../../whatsnew/2.7.rst:2510 msgid "" "The :mod:`urlparse ` module's :func:`~urllib.parse.urlsplit` " "now handles unknown URL schemes in a fashion compliant with :rfc:`3986`: if " @@ -2456,7 +2456,7 @@ msgid "" "behaviour. For example, Python 2.6.4 or 2.5 will return the following:" msgstr "" -#: ../../whatsnew/2.7.rst:1659 ../../whatsnew/2.7.rst:2520 +#: ../../whatsnew/2.7.rst:1659 ../../whatsnew/2.7.rst:2518 msgid "" ">>> import urlparse\n" ">>> urlparse.urlsplit('invented://host/filename?query')\n" @@ -2466,11 +2466,11 @@ msgstr "" ">>> urlparse.urlsplit('invented://host/filename?query')\n" "('invented', '', '//host/filename?query', '', '')" -#: ../../whatsnew/2.7.rst:1666 ../../whatsnew/2.7.rst:2527 +#: ../../whatsnew/2.7.rst:1666 ../../whatsnew/2.7.rst:2525 msgid "Python 2.7 (and Python 2.6.5) will return:" msgstr "" -#: ../../whatsnew/2.7.rst:1668 ../../whatsnew/2.7.rst:2529 +#: ../../whatsnew/2.7.rst:1668 ../../whatsnew/2.7.rst:2527 msgid "" ">>> import urlparse\n" ">>> urlparse.urlsplit('invented://host/filename?query')\n" @@ -2480,7 +2480,7 @@ msgstr "" ">>> urlparse.urlsplit('invented://host/filename?query')\n" "('invented', 'host', '/filename?query', '', '')" -#: ../../whatsnew/2.7.rst:1675 ../../whatsnew/2.7.rst:2536 +#: ../../whatsnew/2.7.rst:1675 ../../whatsnew/2.7.rst:2534 msgid "" "(Python 2.7 actually produces slightly different output, since it returns a " "named tuple instead of a standard tuple.)" @@ -3257,16 +3257,16 @@ msgstr "" #: ../../whatsnew/2.7.rst:2183 msgid "" "New macros: the Python header files now define the following macros: :c:" -"macro:`!Py_ISALNUM`, :c:macro:`!Py_ISALPHA`, :c:macro:`!Py_ISDIGIT`, :c:" -"macro:`!Py_ISLOWER`, :c:macro:`!Py_ISSPACE`, :c:macro:`!Py_ISUPPER`, :c:" -"macro:`!Py_ISXDIGIT`, :c:macro:`!Py_TOLOWER`, and :c:macro:`!Py_TOUPPER`. " -"All of these functions are analogous to the C standard macros for " -"classifying characters, but ignore the current locale setting, because in " -"several places Python needs to analyze characters in a locale-independent " -"way. (Added by Eric Smith; :issue:`5793`.)" +"macro:`Py_ISALNUM`, :c:macro:`Py_ISALPHA`, :c:macro:`Py_ISDIGIT`, :c:macro:" +"`Py_ISLOWER`, :c:macro:`Py_ISSPACE`, :c:macro:`Py_ISUPPER`, :c:macro:" +"`Py_ISXDIGIT`, :c:macro:`Py_TOLOWER`, and :c:macro:`Py_TOUPPER`. All of " +"these functions are analogous to the C standard macros for classifying " +"characters, but ignore the current locale setting, because in several places " +"Python needs to analyze characters in a locale-independent way. (Added by " +"Eric Smith; :issue:`5793`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2201 +#: ../../whatsnew/2.7.rst:2199 msgid "" "Removed function: :c:func:`!PyEval_CallObject` is now only available as a " "macro. A function version was being kept around to preserve ABI linking " @@ -3274,7 +3274,7 @@ msgid "" "(Removed by Antoine Pitrou; :issue:`8276`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2206 +#: ../../whatsnew/2.7.rst:2204 msgid "" "New format codes: the :c:func:`!PyString_FromFormat`, :c:func:`!" "PyString_FromFormatV`, and :c:func:`PyErr_Format` functions now accept " @@ -3282,7 +3282,7 @@ msgid "" "types. (Contributed by Mark Dickinson; :issue:`7228`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2212 +#: ../../whatsnew/2.7.rst:2210 msgid "" "The complicated interaction between threads and process forking has been " "changed. Previously, the child process created by :func:`os.fork` might " @@ -3294,7 +3294,7 @@ msgid "" "replicated, and the child process would no longer be able to perform imports." msgstr "" -#: ../../whatsnew/2.7.rst:2222 +#: ../../whatsnew/2.7.rst:2220 msgid "" "Python 2.7 acquires the import lock before performing an :func:`os.fork`, " "and will also clean up any locks created using the :mod:`threading` module. " @@ -3302,31 +3302,31 @@ msgid "" "themselves, will not benefit from this clean-up." msgstr "" -#: ../../whatsnew/2.7.rst:2228 +#: ../../whatsnew/2.7.rst:2226 msgid "(Fixed by Thomas Wouters; :issue:`1590864`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2230 +#: ../../whatsnew/2.7.rst:2228 msgid "" "The :c:func:`Py_Finalize` function now calls the internal :func:`!threading." "_shutdown` function; this prevents some exceptions from being raised when an " "interpreter shuts down. (Patch by Adam Olsen; :issue:`1722344`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2235 +#: ../../whatsnew/2.7.rst:2233 msgid "" "When using the :c:type:`PyMemberDef` structure to define attributes of a " "type, Python will no longer let you try to delete or set a :c:macro:`!" "T_STRING_INPLACE` attribute." msgstr "" -#: ../../whatsnew/2.7.rst:2241 +#: ../../whatsnew/2.7.rst:2239 msgid "" "Global symbols defined by the :mod:`ctypes` module are now prefixed with " "``Py``, or with ``_ctypes``. (Implemented by Thomas Heller; :issue:`3102`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2245 +#: ../../whatsnew/2.7.rst:2243 msgid "" "New configure option: the :option:`!--with-system-expat` switch allows " "building the :mod:`pyexpat ` module to use the system " @@ -3334,7 +3334,7 @@ msgid "" "`7609`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2249 +#: ../../whatsnew/2.7.rst:2247 msgid "" "New configure option: the :option:`!--with-valgrind` option will now disable " "the pymalloc allocator, which is difficult for the Valgrind memory-error " @@ -3343,14 +3343,14 @@ msgid "" "issue:`2422`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2256 +#: ../../whatsnew/2.7.rst:2254 msgid "" "New configure option: you can now supply an empty string to :option:`!--with-" "dbmliborder=` in order to disable all of the various DBM modules. (Added by " "Arfrever Frehtes Taifersar Arahesis; :issue:`6491`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2261 +#: ../../whatsnew/2.7.rst:2259 msgid "" "The :program:`configure` script now checks for floating-point rounding bugs " "on certain 32-bit Intel chips and defines a :c:macro:`!X87_DOUBLE_ROUNDING` " @@ -3359,30 +3359,30 @@ msgid "" "`2937`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2267 +#: ../../whatsnew/2.7.rst:2265 msgid "" ":program:`configure` also now sets a :envvar:`!LDCXXSHARED` Makefile " "variable for supporting C++ linking. (Contributed by Arfrever Frehtes " "Taifersar Arahesis; :issue:`1222585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2271 +#: ../../whatsnew/2.7.rst:2269 msgid "" "The build process now creates the necessary files for pkg-config support. " "(Contributed by Clinton Roy; :issue:`3585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2274 +#: ../../whatsnew/2.7.rst:2272 msgid "" "The build process now supports Subversion 1.7. (Contributed by Arfrever " "Frehtes Taifersar Arahesis; :issue:`6094`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2281 +#: ../../whatsnew/2.7.rst:2279 msgid "Capsules" msgstr "" -#: ../../whatsnew/2.7.rst:2283 +#: ../../whatsnew/2.7.rst:2281 msgid "" "Python 3.1 adds a new C datatype, :c:type:`PyCapsule`, for providing a C API " "to an extension module. A capsule is essentially the holder of a C ``void " @@ -3394,7 +3394,7 @@ msgid "" "module's various API functions." msgstr "" -#: ../../whatsnew/2.7.rst:2292 +#: ../../whatsnew/2.7.rst:2290 msgid "" "There is an existing data type already used for this, :c:type:`!PyCObject`, " "but it doesn't provide type safety. Evil code written in pure Python could " @@ -3404,7 +3404,7 @@ msgid "" "name:" msgstr "" -#: ../../whatsnew/2.7.rst:2299 +#: ../../whatsnew/2.7.rst:2297 msgid "" "void *vtable;\n" "\n" @@ -3416,7 +3416,7 @@ msgid "" "vtable = PyCapsule_GetPointer(capsule, \"mymodule.CAPI\");" msgstr "" -#: ../../whatsnew/2.7.rst:2310 +#: ../../whatsnew/2.7.rst:2308 msgid "" "You are assured that ``vtable`` points to whatever you're expecting. If a " "different capsule was passed in, :c:func:`PyCapsule_IsValid` would detect " @@ -3424,7 +3424,7 @@ msgid "" "more information on using these objects." msgstr "" -#: ../../whatsnew/2.7.rst:2315 +#: ../../whatsnew/2.7.rst:2313 msgid "" "Python 2.7 now uses capsules internally to provide various extension-module " "APIs, but the :c:func:`!PyCObject_AsVoidPtr` was modified to handle " @@ -3433,17 +3433,17 @@ msgid "" "exc:`PendingDeprecationWarning`, which is silent by default." msgstr "" -#: ../../whatsnew/2.7.rst:2322 +#: ../../whatsnew/2.7.rst:2320 msgid "" "Implemented in Python 3.1 and backported to 2.7 by Larry Hastings; discussed " "in :issue:`5630`." msgstr "" -#: ../../whatsnew/2.7.rst:2329 +#: ../../whatsnew/2.7.rst:2327 msgid "Port-Specific Changes: Windows" msgstr "" -#: ../../whatsnew/2.7.rst:2331 +#: ../../whatsnew/2.7.rst:2329 msgid "" "The :mod:`msvcrt` module now contains some constants from the :file:" "`crtassem.h` header file: :data:`~msvcrt.CRT_ASSEMBLY_VERSION`, :data:" @@ -3452,7 +3452,7 @@ msgid "" "`4365`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2338 +#: ../../whatsnew/2.7.rst:2336 msgid "" "The :mod:`_winreg ` module for accessing the registry now implements " "the :func:`~winreg.CreateKeyEx` and :func:`~winreg.DeleteKeyEx` functions, " @@ -3462,14 +3462,14 @@ msgid "" "tested and documented. (Implemented by Brian Curtin: :issue:`7347`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2346 +#: ../../whatsnew/2.7.rst:2344 msgid "" "The new :c:func:`!_beginthreadex` API is used to start threads, and the " "native thread-local storage functions are now used. (Contributed by Kristján " "Valur Jónsson; :issue:`3582`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2350 +#: ../../whatsnew/2.7.rst:2348 msgid "" "The :func:`os.kill` function now works on Windows. The signal value can be " "the constants :const:`~signal.CTRL_C_EVENT`, :const:`~signal." @@ -3479,23 +3479,23 @@ msgid "" "Miki Tebeka; :issue:`1220212`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2357 +#: ../../whatsnew/2.7.rst:2355 msgid "" "The :func:`os.listdir` function now correctly fails for an empty path. " "(Fixed by Hirokazu Yamamoto; :issue:`5913`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2360 +#: ../../whatsnew/2.7.rst:2358 msgid "" "The :mod:`mimetypes` module will now read the MIME database from the Windows " "registry when initializing. (Patch by Gabriel Genellina; :issue:`4969`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2367 +#: ../../whatsnew/2.7.rst:2365 msgid "Port-Specific Changes: Mac OS X" msgstr "" -#: ../../whatsnew/2.7.rst:2369 +#: ../../whatsnew/2.7.rst:2367 msgid "" "The path ``/Library/Python/2.7/site-packages`` is now appended to ``sys." "path``, in order to share added packages between the system installation and " @@ -3503,7 +3503,7 @@ msgid "" "issue:`4865`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2376 +#: ../../whatsnew/2.7.rst:2374 msgid "" "As of 2.7.13, this change was removed. ``/Library/Python/2.7/site-" "packages``, the site-packages directory used by the Apple-supplied system " @@ -3515,11 +3515,11 @@ msgid "" "Pythons. (:issue:`28440`)" msgstr "" -#: ../../whatsnew/2.7.rst:2387 +#: ../../whatsnew/2.7.rst:2385 msgid "Port-Specific Changes: FreeBSD" msgstr "" -#: ../../whatsnew/2.7.rst:2389 +#: ../../whatsnew/2.7.rst:2387 msgid "" "FreeBSD 7.1's :const:`!SO_SETFIB` constant, used with the :func:`~socket." "socket` methods :func:`~socket.socket.getsockopt`/:func:`~socket.socket." @@ -3527,11 +3527,11 @@ msgid "" "mod:`socket` module. (Added by Kyle VanderBeek; :issue:`8235`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2395 +#: ../../whatsnew/2.7.rst:2393 msgid "Other Changes and Fixes" msgstr "" -#: ../../whatsnew/2.7.rst:2397 +#: ../../whatsnew/2.7.rst:2395 msgid "" "Two benchmark scripts, :file:`iobench` and :file:`ccbench`, were added to " "the :file:`Tools` directory. :file:`iobench` measures the speed of the " @@ -3541,13 +3541,13 @@ msgid "" "bandwidth when performing several tasks using a varying number of threads." msgstr "" -#: ../../whatsnew/2.7.rst:2405 +#: ../../whatsnew/2.7.rst:2403 msgid "" "The :file:`Tools/i18n/msgfmt.py` script now understands plural forms in :" "file:`.po` files. (Fixed by Martin von Löwis; :issue:`5464`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2409 +#: ../../whatsnew/2.7.rst:2407 msgid "" "When importing a module from a :file:`.pyc` or :file:`.pyo` file with an " "existing :file:`.py` counterpart, the :attr:`~codeobject.co_filename` " @@ -3557,7 +3557,7 @@ msgid "" "Paul Calderone; :issue:`1180193`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2416 +#: ../../whatsnew/2.7.rst:2414 msgid "" "The :file:`regrtest.py` script now takes a :option:`!--randseed=` switch " "that takes an integer that will be used as the random seed for the :option:" @@ -3565,7 +3565,7 @@ msgid "" "also reports the seed that was used (Added by Collin Winter.)" msgstr "" -#: ../../whatsnew/2.7.rst:2422 +#: ../../whatsnew/2.7.rst:2420 msgid "" "Another :file:`regrtest.py` switch is :option:`!-j`, which takes an integer " "specifying how many tests run in parallel. This allows reducing the total " @@ -3576,31 +3576,31 @@ msgid "" "they fail. (Added by Antoine Pitrou; :issue:`7312`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2431 +#: ../../whatsnew/2.7.rst:2429 msgid "" "When executed as a script, the :file:`py_compile.py` module now accepts " "``'-'`` as an argument, which will read standard input for the list of " "filenames to be compiled. (Contributed by Piotr Ożarowski; :issue:`8233`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2439 +#: ../../whatsnew/2.7.rst:2437 msgid "Porting to Python 2.7" msgstr "移植至 Python 2.7" -#: ../../whatsnew/2.7.rst:2441 +#: ../../whatsnew/2.7.rst:2439 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/2.7.rst:2444 +#: ../../whatsnew/2.7.rst:2442 msgid "" "The :func:`range` function processes its arguments more consistently; it " "will now call :meth:`~object.__int__` on non-float, non-integer arguments " "that are supplied to it. (Fixed by Alexander Belopolsky; :issue:`1533`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2449 +#: ../../whatsnew/2.7.rst:2447 msgid "" "The string :meth:`format` method changed the default precision used for " "floating-point and complex numbers from 6 decimal places to 12, which " @@ -3608,7 +3608,7 @@ msgid "" "`5920`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2454 +#: ../../whatsnew/2.7.rst:2452 msgid "" "Because of an optimization for the :keyword:`with` statement, the special " "methods :meth:`~object.__enter__` and :meth:`~object.__exit__` must belong " @@ -3617,7 +3617,7 @@ msgid "" "C extension types. (:issue:`6101`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2460 +#: ../../whatsnew/2.7.rst:2458 msgid "" "Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`~object." "__exit__` methods was often the string representation of the exception, not " @@ -3625,11 +3625,11 @@ msgid "" "expected. (Fixed by Florent Xicluna; :issue:`7853`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2470 +#: ../../whatsnew/2.7.rst:2468 msgid "In the standard library:" msgstr "標準函式庫中:" -#: ../../whatsnew/2.7.rst:2472 +#: ../../whatsnew/2.7.rst:2470 msgid "" "Operations with :class:`~datetime.datetime` instances that resulted in a " "year falling outside the supported range didn't always raise :exc:" @@ -3638,7 +3638,7 @@ msgid "" "Alexander Belopolsky; :issue:`7150`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2478 +#: ../../whatsnew/2.7.rst:2476 msgid "" "When using :class:`~decimal.Decimal` instances with a string's :meth:" "`format` method, the default alignment was previously left-alignment. This " @@ -3646,7 +3646,7 @@ msgid "" "programs. (Changed by Mark Dickinson; :issue:`6857`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2490 +#: ../../whatsnew/2.7.rst:2488 msgid "" "The :mod:`xml.etree.ElementTree` library no longer escapes ampersands and " "angle brackets when outputting an XML processing instruction (which looks " @@ -3654,36 +3654,36 @@ msgid "" "````). (Patch by Neil Muller; :issue:`2746`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2496 +#: ../../whatsnew/2.7.rst:2494 msgid "" "The :meth:`!readline` method of :class:`~io.StringIO` objects now does " "nothing when a negative length is requested, as other file-like objects do. " "(:issue:`7348`)." msgstr "" -#: ../../whatsnew/2.7.rst:2539 +#: ../../whatsnew/2.7.rst:2537 msgid "For C extensions:" msgstr "" -#: ../../whatsnew/2.7.rst:2541 +#: ../../whatsnew/2.7.rst:2539 msgid "" "C extensions that use integer format codes with the ``PyArg_Parse*`` family " "of functions will now raise a :exc:`TypeError` exception instead of " "triggering a :exc:`DeprecationWarning` (:issue:`5080`)." msgstr "" -#: ../../whatsnew/2.7.rst:2545 +#: ../../whatsnew/2.7.rst:2543 msgid "" "Use the new :c:func:`PyOS_string_to_double` function instead of the old :c:" "func:`!PyOS_ascii_strtod` and :c:func:`!PyOS_ascii_atof` functions, which " "are now deprecated." msgstr "" -#: ../../whatsnew/2.7.rst:2549 +#: ../../whatsnew/2.7.rst:2547 msgid "For applications that embed Python:" msgstr "" -#: ../../whatsnew/2.7.rst:2551 +#: ../../whatsnew/2.7.rst:2549 msgid "" "The :c:func:`!PySys_SetArgvEx` function was added, letting applications " "close a security hole when the existing :c:func:`!PySys_SetArgv` function " @@ -3692,11 +3692,11 @@ msgid "" "PySys_SetArgvEx` with *updatepath* set to false." msgstr "" -#: ../../whatsnew/2.7.rst:2564 +#: ../../whatsnew/2.7.rst:2562 msgid "New Features Added to Python 2.7 Maintenance Releases" msgstr "" -#: ../../whatsnew/2.7.rst:2566 +#: ../../whatsnew/2.7.rst:2564 msgid "" "New features may be added to Python 2.7 maintenance releases when the " "situation genuinely calls for it. Any such additions must go through the " @@ -3705,25 +3705,25 @@ msgid "" "Python 3, or else by publishing it on the Python Package Index." msgstr "" -#: ../../whatsnew/2.7.rst:2572 +#: ../../whatsnew/2.7.rst:2570 msgid "" "In addition to the specific proposals listed below, there is a general " "exemption allowing new ``-3`` warnings to be added in any Python 2.7 " "maintenance release." msgstr "" -#: ../../whatsnew/2.7.rst:2578 +#: ../../whatsnew/2.7.rst:2576 msgid "Two new environment variables for debug mode" msgstr "偵錯模式下的兩個新環境變數" -#: ../../whatsnew/2.7.rst:2580 +#: ../../whatsnew/2.7.rst:2578 msgid "" "In debug mode, the ``[xxx refs]`` statistic is not written by default, the :" "envvar:`!PYTHONSHOWREFCOUNT` environment variable now must also be set. " "(Contributed by Victor Stinner; :issue:`31733`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2584 +#: ../../whatsnew/2.7.rst:2582 msgid "" "When Python is compiled with ``COUNT_ALLOC`` defined, allocation counts are " "no longer dumped by default anymore: the :envvar:`!PYTHONSHOWALLOCCOUNT` " @@ -3732,11 +3732,11 @@ msgid "" "issue:`31692`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2593 +#: ../../whatsnew/2.7.rst:2591 msgid "PEP 434: IDLE Enhancement Exception for All Branches" msgstr "" -#: ../../whatsnew/2.7.rst:2595 +#: ../../whatsnew/2.7.rst:2593 msgid "" ":pep:`434` describes a general exemption for changes made to the IDLE " "development environment shipped along with Python. This exemption makes it " @@ -3744,63 +3744,63 @@ msgid "" "experience across all supported versions of Python 2 and 3." msgstr "" -#: ../../whatsnew/2.7.rst:2600 +#: ../../whatsnew/2.7.rst:2598 msgid "" "For details of any IDLE changes, refer to the NEWS file for the specific " "release." msgstr "" -#: ../../whatsnew/2.7.rst:2605 +#: ../../whatsnew/2.7.rst:2603 msgid "PEP 466: Network Security Enhancements for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2607 +#: ../../whatsnew/2.7.rst:2605 msgid "" ":pep:`466` describes a number of network security enhancement proposals that " "have been approved for inclusion in Python 2.7 maintenance releases, with " "the first of those changes appearing in the Python 2.7.7 release." msgstr "" -#: ../../whatsnew/2.7.rst:2611 +#: ../../whatsnew/2.7.rst:2609 msgid ":pep:`466` related features added in Python 2.7.7:" msgstr "Python 2.7.7 中新增的 :pep:`466` 相關功能:" -#: ../../whatsnew/2.7.rst:2613 +#: ../../whatsnew/2.7.rst:2611 msgid "" ":func:`hmac.compare_digest` was backported from Python 3 to make a timing " "attack resistant comparison operation available to Python 2 applications. " "(Contributed by Alex Gaynor; :issue:`21306`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2617 +#: ../../whatsnew/2.7.rst:2615 msgid "" "OpenSSL 1.0.1g was upgraded in the official Windows installers published on " "python.org. (Contributed by Zachary Ware; :issue:`21462`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2620 +#: ../../whatsnew/2.7.rst:2618 msgid ":pep:`466` related features added in Python 2.7.8:" msgstr "Python 2.7.8 中新增的 :pep:`466` 相關功能:" -#: ../../whatsnew/2.7.rst:2622 +#: ../../whatsnew/2.7.rst:2620 msgid "" ":func:`hashlib.pbkdf2_hmac` was backported from Python 3 to make a hashing " "algorithm suitable for secure password storage broadly available to Python 2 " "applications. (Contributed by Alex Gaynor; :issue:`21304`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2626 +#: ../../whatsnew/2.7.rst:2624 msgid "" "OpenSSL 1.0.1h was upgraded for the official Windows installers published on " "python.org. (Contributed by Zachary Ware in :issue:`21671` for :cve:" "`2014-0224`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2629 +#: ../../whatsnew/2.7.rst:2627 msgid ":pep:`466` related features added in Python 2.7.9:" msgstr "Python 2.7.9 中新增的 :pep:`466` 相關功能:" -#: ../../whatsnew/2.7.rst:2631 +#: ../../whatsnew/2.7.rst:2629 msgid "" "Most of Python 3.4's :mod:`ssl` module was backported. This means :mod:`ssl` " "now supports Server Name Indication, TLS1.x settings, access to the platform " @@ -3808,20 +3808,20 @@ msgid "" "(Contributed by Alex Gaynor and David Reid; :issue:`21308`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2636 +#: ../../whatsnew/2.7.rst:2634 msgid "" "Refer to the \"Version added: 2.7.9\" notes in the module documentation for " "specific details." msgstr "" -#: ../../whatsnew/2.7.rst:2639 +#: ../../whatsnew/2.7.rst:2637 msgid "" ":func:`os.urandom` was changed to cache a file descriptor to ``/dev/" "urandom`` instead of reopening ``/dev/urandom`` on every call. (Contributed " "by Alex Gaynor; :issue:`21305`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2643 +#: ../../whatsnew/2.7.rst:2641 msgid "" ":data:`hashlib.algorithms_guaranteed` and :data:`hashlib." "algorithms_available` were backported from Python 3 to make it easier for " @@ -3829,22 +3829,22 @@ msgid "" "(Contributed by Alex Gaynor in :issue:`21307`)" msgstr "" -#: ../../whatsnew/2.7.rst:2650 +#: ../../whatsnew/2.7.rst:2648 msgid "PEP 477: Backport ensurepip (PEP 453) to Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2652 +#: ../../whatsnew/2.7.rst:2650 msgid "" ":pep:`477` approves the inclusion of the :pep:`453` ensurepip module and the " "improved documentation that was enabled by it in the Python 2.7 maintenance " "releases, appearing first in the Python 2.7.9 release." msgstr "" -#: ../../whatsnew/2.7.rst:2658 +#: ../../whatsnew/2.7.rst:2656 msgid "Bootstrapping pip By Default" msgstr "" -#: ../../whatsnew/2.7.rst:2660 +#: ../../whatsnew/2.7.rst:2658 msgid "" "The new :mod:`ensurepip` module (defined in :pep:`453`) provides a standard " "cross-platform mechanism to bootstrap the pip installer into Python " @@ -3854,14 +3854,14 @@ msgid "" "the release candidate." msgstr "" -#: ../../whatsnew/2.7.rst:2667 +#: ../../whatsnew/2.7.rst:2665 msgid "" "By default, the commands ``pip``, ``pipX`` and ``pipX.Y`` will be installed " "on all platforms (where X.Y stands for the version of the Python " "installation), along with the ``pip`` Python package and its dependencies." msgstr "" -#: ../../whatsnew/2.7.rst:2671 +#: ../../whatsnew/2.7.rst:2669 msgid "" "For CPython :ref:`source builds on POSIX systems `, " "the ``make install`` and ``make altinstall`` commands do not bootstrap " @@ -3869,7 +3869,7 @@ msgid "" "options, and overridden through Makefile options." msgstr "" -#: ../../whatsnew/2.7.rst:2676 +#: ../../whatsnew/2.7.rst:2674 msgid "" "On Windows and Mac OS X, the CPython installers now default to installing " "``pip`` along with CPython itself (users may opt out of installing it during " @@ -3879,7 +3879,7 @@ msgid "" "Windows as ``py -m pip``." msgstr "" -#: ../../whatsnew/2.7.rst:2683 +#: ../../whatsnew/2.7.rst:2681 msgid "" "As :pep:`discussed in the PEP <0477#disabling-ensurepip-by-downstream-" "distributors>`, platform packagers may choose not to install these commands " @@ -3888,11 +3888,11 @@ msgid "" "package manager)." msgstr "" -#: ../../whatsnew/2.7.rst:2690 +#: ../../whatsnew/2.7.rst:2688 msgid "Documentation Changes" msgstr "文件更動" -#: ../../whatsnew/2.7.rst:2692 +#: ../../whatsnew/2.7.rst:2690 msgid "" "As part of this change, the :ref:`installing-index` and :ref:`distributing-" "index` sections of the documentation have been completely redesigned as " @@ -3902,29 +3902,29 @@ msgid "" "of the individual projects." msgstr "" -#: ../../whatsnew/2.7.rst:2700 +#: ../../whatsnew/2.7.rst:2698 msgid "" "However, as this migration is currently still incomplete, the legacy " "versions of those guides remaining available as :ref:`install-index` and :" "ref:`setuptools-index`." msgstr "" -#: ../../whatsnew/2.7.rst:2706 +#: ../../whatsnew/2.7.rst:2704 msgid ":pep:`453` -- Explicit bootstrapping of pip in Python installations" msgstr "" -#: ../../whatsnew/2.7.rst:2707 +#: ../../whatsnew/2.7.rst:2705 msgid "" "PEP written by Donald Stufft and Nick Coghlan, implemented by Donald Stufft, " "Nick Coghlan, Martin von Löwis and Ned Deily." msgstr "" -#: ../../whatsnew/2.7.rst:2711 +#: ../../whatsnew/2.7.rst:2709 msgid "" "PEP 476: Enabling certificate verification by default for stdlib http clients" msgstr "" -#: ../../whatsnew/2.7.rst:2713 +#: ../../whatsnew/2.7.rst:2711 msgid "" ":pep:`476` updated :mod:`httplib ` and modules which use it, such as :" "mod:`urllib2 ` and :mod:`xmlrpclib `, to now " @@ -3934,13 +3934,13 @@ msgid "" "for many applications. This change was made in the Python 2.7.9 release." msgstr "" -#: ../../whatsnew/2.7.rst:2721 +#: ../../whatsnew/2.7.rst:2719 msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -#: ../../whatsnew/2.7.rst:2724 +#: ../../whatsnew/2.7.rst:2722 msgid "" "import urllib2\n" "import ssl\n" @@ -3955,11 +3955,11 @@ msgid "" "urllib2.urlopen(\"https://invalid-cert\", context=context)" msgstr "" -#: ../../whatsnew/2.7.rst:2738 +#: ../../whatsnew/2.7.rst:2736 msgid "PEP 493: HTTPS verification migration tools for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2740 +#: ../../whatsnew/2.7.rst:2738 msgid "" ":pep:`493` provides additional migration tools to support a more incremental " "infrastructure upgrade process for environments containing applications and " @@ -3968,14 +3968,14 @@ msgid "" "were made in the Python 2.7.12 release." msgstr "" -#: ../../whatsnew/2.7.rst:2746 +#: ../../whatsnew/2.7.rst:2744 msgid "" "These tools are intended for use in cases where affected applications and " "services can't be modified to explicitly pass a more permissive SSL context " "when establishing the connection." msgstr "" -#: ../../whatsnew/2.7.rst:2750 +#: ../../whatsnew/2.7.rst:2748 msgid "" "For applications and services which can't be modified at all, the new " "``PYTHONHTTPSVERIFY`` environment variable may be set to ``0`` to revert an " @@ -3983,18 +3983,18 @@ msgid "" "2.7.8 and earlier." msgstr "" -#: ../../whatsnew/2.7.rst:2755 +#: ../../whatsnew/2.7.rst:2753 msgid "" "For cases where the connection establishment code can't be modified, but the " "overall application can be, the new :func:`!ssl._https_verify_certificates` " "function can be used to adjust the default behaviour at runtime." msgstr "" -#: ../../whatsnew/2.7.rst:2761 +#: ../../whatsnew/2.7.rst:2759 msgid "New ``make regen-all`` build target" msgstr "新增 ``make regen-all`` 建置目標" -#: ../../whatsnew/2.7.rst:2763 +#: ../../whatsnew/2.7.rst:2761 msgid "" "To simplify cross-compilation, and to ensure that CPython can reliably be " "compiled without requiring an existing version of Python to already be " @@ -4002,43 +4002,43 @@ msgid "" "recompile generated files based on file modification times." msgstr "" -#: ../../whatsnew/2.7.rst:2768 +#: ../../whatsnew/2.7.rst:2766 msgid "" "Instead, a new ``make regen-all`` command has been added to force " "regeneration of these files when desired (e.g. after an initial version of " "Python has already been built based on the pregenerated versions)." msgstr "" -#: ../../whatsnew/2.7.rst:2772 +#: ../../whatsnew/2.7.rst:2770 msgid "" "More selective regeneration targets are also defined - see :source:`Makefile." "pre.in` for details." msgstr "" -#: ../../whatsnew/2.7.rst:2775 ../../whatsnew/2.7.rst:2788 +#: ../../whatsnew/2.7.rst:2773 ../../whatsnew/2.7.rst:2786 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" -#: ../../whatsnew/2.7.rst:2781 +#: ../../whatsnew/2.7.rst:2779 msgid "Removal of ``make touch`` build target" msgstr "移除 ``make touch`` 建置目標" -#: ../../whatsnew/2.7.rst:2783 +#: ../../whatsnew/2.7.rst:2781 msgid "" "The ``make touch`` build target previously used to request implicit " "regeneration of generated files by updating their modification times has " "been removed." msgstr "" -#: ../../whatsnew/2.7.rst:2786 +#: ../../whatsnew/2.7.rst:2784 msgid "It has been replaced by the new ``make regen-all`` target." msgstr "已被新的 ``make regen-all`` 目標取代。" -#: ../../whatsnew/2.7.rst:2797 +#: ../../whatsnew/2.7.rst:2795 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.7.rst:2799 +#: ../../whatsnew/2.7.rst:2797 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " From 9833f261a6e73a8ab6ddd516f54cad385695220e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 11 Nov 2025 00:17:02 +0000 Subject: [PATCH 8/9] sync with cpython 462e2255 --- c-api/frame.po | 123 ++++++++++---- c-api/type.po | 434 ++++++++++++++++++++++++----------------------- c-api/typeobj.po | 15 +- 3 files changed, 321 insertions(+), 251 deletions(-) diff --git a/c-api/frame.po b/c-api/frame.po index c8ea01bfab7..175cdbcce49 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-12 00:15+0000\n" +"POT-Creation-Date: 2025-11-11 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -56,95 +56,102 @@ msgid "" msgstr "" #: ../../c-api/frame.rst:34 +msgid "" +"Create a new frame object. This function returns a :term:`strong reference` " +"to the new frame object on success, and returns ``NULL`` with an exception " +"set on failure." +msgstr "" + +#: ../../c-api/frame.rst:40 msgid "Return non-zero if *obj* is a frame object." msgstr "" -#: ../../c-api/frame.rst:38 +#: ../../c-api/frame.rst:44 msgid "" "Previously, this function was only available after including ````." msgstr "" -#: ../../c-api/frame.rst:43 +#: ../../c-api/frame.rst:49 msgid "Get the *frame* next outer frame." msgstr "" -#: ../../c-api/frame.rst:45 +#: ../../c-api/frame.rst:51 msgid "" "Return a :term:`strong reference`, or ``NULL`` if *frame* has no outer frame." msgstr "" -#: ../../c-api/frame.rst:53 +#: ../../c-api/frame.rst:59 msgid "Get the *frame*'s :attr:`~frame.f_builtins` attribute." msgstr "取得 *frame* 的 :attr:`~frame.f_builtins` 屬性。" -#: ../../c-api/frame.rst:55 ../../c-api/frame.rst:86 +#: ../../c-api/frame.rst:61 ../../c-api/frame.rst:92 msgid "Return a :term:`strong reference`. The result cannot be ``NULL``." msgstr "回傳 :term:`strong reference`。結果不能為 ``NULL``。" -#: ../../c-api/frame.rst:62 +#: ../../c-api/frame.rst:68 msgid "Get the *frame* code." msgstr "" -#: ../../c-api/frame.rst:64 ../../c-api/frame.rst:130 +#: ../../c-api/frame.rst:70 ../../c-api/frame.rst:136 msgid "Return a :term:`strong reference`." msgstr "回傳 :term:`strong reference`。" -#: ../../c-api/frame.rst:66 +#: ../../c-api/frame.rst:72 msgid "The result (frame code) cannot be ``NULL``." msgstr "" -#: ../../c-api/frame.rst:73 +#: ../../c-api/frame.rst:79 msgid "" "Get the generator, coroutine, or async generator that owns this frame, or " "``NULL`` if this frame is not owned by a generator. Does not raise an " "exception, even if the return value is ``NULL``." msgstr "" -#: ../../c-api/frame.rst:77 +#: ../../c-api/frame.rst:83 msgid "Return a :term:`strong reference`, or ``NULL``." msgstr "回傳 :term:`strong reference` 或 ``NULL``。" -#: ../../c-api/frame.rst:84 +#: ../../c-api/frame.rst:90 msgid "Get the *frame*'s :attr:`~frame.f_globals` attribute." msgstr "取得 *frame* 的 :attr:`~frame.f_globals` 屬性。" -#: ../../c-api/frame.rst:93 +#: ../../c-api/frame.rst:99 msgid "Get the *frame*'s :attr:`~frame.f_lasti` attribute." msgstr "取得 *frame* 的 :attr:`~frame.f_lasti` 屬性。" -#: ../../c-api/frame.rst:95 +#: ../../c-api/frame.rst:101 msgid "Returns -1 if ``frame.f_lasti`` is ``None``." msgstr "如果 ``frame.f_lasti`` 是 ``None`` 則回傳 -1。" -#: ../../c-api/frame.rst:102 +#: ../../c-api/frame.rst:108 msgid "Get the variable *name* of *frame*." msgstr "取得 *frame* 的變數 *name*。" -#: ../../c-api/frame.rst:104 +#: ../../c-api/frame.rst:110 msgid "Return a :term:`strong reference` to the variable value on success." msgstr "在成功時回傳變數值的 :term:`strong reference`。" -#: ../../c-api/frame.rst:105 +#: ../../c-api/frame.rst:111 msgid "" "Raise :exc:`NameError` and return ``NULL`` if the variable does not exist." msgstr "如果變數不存在,則引發 :exc:`NameError` 並回傳 ``NULL``。" -#: ../../c-api/frame.rst:106 +#: ../../c-api/frame.rst:112 msgid "Raise an exception and return ``NULL`` on error." msgstr "在錯誤時引發例外並回傳 ``NULL``。" -#: ../../c-api/frame.rst:108 +#: ../../c-api/frame.rst:114 msgid "*name* type must be a :class:`str`." msgstr "*name* 的型別必須是 :class:`str`。" -#: ../../c-api/frame.rst:115 +#: ../../c-api/frame.rst:121 msgid "" "Similar to :c:func:`PyFrame_GetVar`, but the variable name is a C string " "encoded in UTF-8." msgstr "" -#: ../../c-api/frame.rst:123 +#: ../../c-api/frame.rst:129 msgid "" "Get the *frame*'s :attr:`~frame.f_locals` attribute. If the frame refers to " "an :term:`optimized scope`, this returns a write-through proxy object that " @@ -153,21 +160,21 @@ msgid "" "directly (as described for :func:`locals`)." msgstr "" -#: ../../c-api/frame.rst:134 +#: ../../c-api/frame.rst:140 msgid "" "As part of :pep:`667`, return an instance of :c:var:" "`PyFrameLocalsProxy_Type`." msgstr "" -#: ../../c-api/frame.rst:140 +#: ../../c-api/frame.rst:146 msgid "Return the line number that *frame* is currently executing." msgstr "" -#: ../../c-api/frame.rst:144 +#: ../../c-api/frame.rst:150 msgid "Frame Locals Proxies" msgstr "" -#: ../../c-api/frame.rst:148 +#: ../../c-api/frame.rst:154 msgid "" "The :attr:`~frame.f_locals` attribute on a :ref:`frame object ` is an instance of a \"frame-locals proxy\". The proxy object " @@ -176,39 +183,87 @@ msgid "" "to date with the live local variables in the frame itself." msgstr "" -#: ../../c-api/frame.rst:154 +#: ../../c-api/frame.rst:160 msgid "See :pep:`667` for more information." msgstr "" -#: ../../c-api/frame.rst:158 +#: ../../c-api/frame.rst:164 msgid "The type of frame :func:`locals` proxy objects." msgstr "" -#: ../../c-api/frame.rst:162 +#: ../../c-api/frame.rst:168 msgid "Return non-zero if *obj* is a frame :func:`locals` proxy." msgstr "" -#: ../../c-api/frame.rst:165 +#: ../../c-api/frame.rst:172 +msgid "Legacy Local Variable APIs" +msgstr "" + +#: ../../c-api/frame.rst:174 +msgid "" +"These APIs are :term:`soft deprecated`. As of Python 3.13, they do nothing. " +"They exist solely for backwards compatibility." +msgstr "" + +#: ../../c-api/frame.rst:180 ../../c-api/frame.rst:194 +#: ../../c-api/frame.rst:207 +msgid "This function is :term:`soft deprecated` and does nothing." +msgstr "" + +#: ../../c-api/frame.rst:182 +msgid "" +"Prior to Python 3.13, this function would copy the :attr:`~frame.f_locals` " +"attribute of *f* to the internal \"fast\" array of local variables, allowing " +"changes in frame objects to be visible to the interpreter. If *clear* was " +"true, this function would process variables that were unset in the locals " +"dictionary." +msgstr "" + +#: ../../c-api/frame.rst:188 ../../c-api/frame.rst:201 +#: ../../c-api/frame.rst:213 +msgid "This function now does nothing." +msgstr "" + +#: ../../c-api/frame.rst:196 +msgid "" +"Prior to Python 3.13, this function would copy the internal \"fast\" array " +"of local variables (which is used by the interpreter) to the :attr:`~frame." +"f_locals` attribute of *f*, allowing changes in local variables to be " +"visible to frame objects." +msgstr "" + +#: ../../c-api/frame.rst:209 +msgid "" +"Prior to Python 3.13, this function was similar to :c:func:" +"`PyFrame_FastToLocals`, but would return ``0`` on success, and ``-1`` with " +"an exception set on failure." +msgstr "" + +#: ../../c-api/frame.rst:218 +msgid ":pep:`667`" +msgstr "" + +#: ../../c-api/frame.rst:222 msgid "Internal Frames" msgstr "" -#: ../../c-api/frame.rst:167 +#: ../../c-api/frame.rst:224 msgid "Unless using :pep:`523`, you will not need this." msgstr "" -#: ../../c-api/frame.rst:171 +#: ../../c-api/frame.rst:228 msgid "The interpreter's internal frame representation." msgstr "" -#: ../../c-api/frame.rst:177 +#: ../../c-api/frame.rst:234 msgid "Return a :term:`strong reference` to the code object for the frame." msgstr "" -#: ../../c-api/frame.rst:184 +#: ../../c-api/frame.rst:241 msgid "Return the byte offset into the last executed instruction." msgstr "" -#: ../../c-api/frame.rst:191 +#: ../../c-api/frame.rst:248 msgid "" "Return the currently executing line number, or -1 if there is no line number." msgstr "" diff --git a/c-api/type.po b/c-api/type.po index d0ee103697a..9c2a297f438 100644 --- a/c-api/type.po +++ b/c-api/type.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-11-11 00:15+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-" @@ -27,8 +27,8 @@ msgstr "" #: ../../c-api/type.rst:18 msgid "" -"This is the type object for type objects; it is the same object " -"as :class:`type` in the Python layer." +"This is the type object for type objects; it is the same object as :class:" +"`type` in the Python layer." msgstr "" #: ../../c-api/type.rst:24 @@ -53,9 +53,9 @@ msgstr "" msgid "" "Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This " "function is primarily meant for use with ``Py_LIMITED_API``; the individual " -"flag bits are guaranteed to be stable across Python releases, but access " -"to :c:member:`~PyTypeObject.tp_flags` itself is not part of " -"the :ref:`limited API `." +"flag bits are guaranteed to be stable across Python releases, but access to :" +"c:member:`~PyTypeObject.tp_flags` itself is not part of the :ref:`limited " +"API `." msgstr "" #: ../../c-api/type.rst:49 @@ -106,26 +106,26 @@ msgstr "" #: ../../c-api/type.rst:93 msgid "" -"Clear watcher identified by *watcher_id* (previously returned " -"from :c:func:`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error " -"(e.g. if *watcher_id* was never registered.)" +"Clear watcher identified by *watcher_id* (previously returned from :c:func:" +"`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g. if " +"*watcher_id* was never registered.)" msgstr "" #: ../../c-api/type.rst:97 msgid "" "An extension should never call ``PyType_ClearWatcher`` with a *watcher_id* " -"that was not returned to it by a previous call " -"to :c:func:`PyType_AddWatcher`." +"that was not returned to it by a previous call to :c:func:" +"`PyType_AddWatcher`." msgstr "" #: ../../c-api/type.rst:106 msgid "" -"Mark *type* as watched. The callback granted *watcher_id* " -"by :c:func:`PyType_AddWatcher` will be called " -"whenever :c:func:`PyType_Modified` reports a change to *type*. (The callback " -"may be called only once for a series of consecutive modifications to *type*, " -"if :c:func:`!_PyType_Lookup` is not called on *type* between the " -"modifications; this is an implementation detail and subject to change.)" +"Mark *type* as watched. The callback granted *watcher_id* by :c:func:" +"`PyType_AddWatcher` will be called whenever :c:func:`PyType_Modified` " +"reports a change to *type*. (The callback may be called only once for a " +"series of consecutive modifications to *type*, if :c:func:`!_PyType_Lookup` " +"is not called on *type* between the modifications; this is an implementation " +"detail and subject to change.)" msgstr "" #: ../../c-api/type.rst:113 @@ -153,23 +153,36 @@ msgstr "" #: ../../c-api/type.rst:138 msgid "" +"Return non-zero if the type object *type* sets the subclass flag *flag*. " +"Subclass flags are denoted by :c:macro:`Py_TPFLAGS_*_SUBCLASS " +"`. This function is used by many ``_Check`` " +"functions for common types." +msgstr "" + +#: ../../c-api/type.rst:144 +msgid "" +":c:func:`PyObject_TypeCheck`, which is used as a slower alternative in " +"``_Check`` functions for types that don't come with subclass flags." +msgstr "" + +#: ../../c-api/type.rst:150 +msgid "" "Return true if the type object includes support for the cycle detector; this " "tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`." msgstr "" -#: ../../c-api/type.rst:144 +#: ../../c-api/type.rst:156 msgid "Return true if *a* is a subtype of *b*." msgstr "" -#: ../../c-api/type.rst:146 +#: ../../c-api/type.rst:158 msgid "" -"This function only checks for actual subtypes, which means " -"that :meth:`~type.__subclasscheck__` is not called on *b*. " -"Call :c:func:`PyObject_IsSubclass` to do the same check " -"that :func:`issubclass` would do." +"This function only checks for actual subtypes, which means that :meth:`~type." +"__subclasscheck__` is not called on *b*. Call :c:func:`PyObject_IsSubclass` " +"to do the same check that :func:`issubclass` would do." msgstr "" -#: ../../c-api/type.rst:154 +#: ../../c-api/type.rst:166 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_alloc` slot of a type " "object. Uses Python's default memory allocation mechanism to allocate " @@ -177,34 +190,32 @@ msgid "" "if by calling :c:func:`PyObject_Init` or :c:func:`PyObject_InitVar`." msgstr "" -#: ../../c-api/type.rst:159 +#: ../../c-api/type.rst:171 msgid "" -"Do not call this directly to allocate memory for an object; call the " -"type's :c:member:`~PyTypeObject.tp_alloc` slot instead." +"Do not call this directly to allocate memory for an object; call the type's :" +"c:member:`~PyTypeObject.tp_alloc` slot instead." msgstr "" -#: ../../c-api/type.rst:162 +#: ../../c-api/type.rst:174 msgid "" -"For types that support garbage collection (i.e., " -"the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set), this function behaves " -"like :c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar` (except the " -"memory is guaranteed to be zeroed before initialization), and should be " -"paired with :c:func:`PyObject_GC_Del` in :c:member:`~PyTypeObject.tp_free`. " -"Otherwise, it behaves like :c:macro:`PyObject_New` " -"or :c:macro:`PyObject_NewVar` (except the memory is guaranteed to be zeroed " -"before initialization) and should be paired with :c:func:`PyObject_Free` " -"in :c:member:`~PyTypeObject.tp_free`." +"For types that support garbage collection (i.e., the :c:macro:" +"`Py_TPFLAGS_HAVE_GC` flag is set), this function behaves like :c:macro:" +"`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar` (except the memory is " +"guaranteed to be zeroed before initialization), and should be paired with :c:" +"func:`PyObject_GC_Del` in :c:member:`~PyTypeObject.tp_free`. Otherwise, it " +"behaves like :c:macro:`PyObject_New` or :c:macro:`PyObject_NewVar` (except " +"the memory is guaranteed to be zeroed before initialization) and should be " +"paired with :c:func:`PyObject_Free` in :c:member:`~PyTypeObject.tp_free`." msgstr "" -#: ../../c-api/type.rst:174 +#: ../../c-api/type.rst:186 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type " -"object. Creates a new instance using the " -"type's :c:member:`~PyTypeObject.tp_alloc` slot and returns the resulting " -"object." +"object. Creates a new instance using the type's :c:member:`~PyTypeObject." +"tp_alloc` slot and returns the resulting object." msgstr "" -#: ../../c-api/type.rst:180 +#: ../../c-api/type.rst:192 msgid "" "Finalize a type object. This should be called on all type objects to finish " "their initialization. This function is responsible for adding inherited " @@ -212,43 +223,43 @@ msgid "" "and sets an exception on error." msgstr "" -#: ../../c-api/type.rst:186 +#: ../../c-api/type.rst:198 msgid "" "If some of the base classes implements the GC protocol and the provided type " "does not include the :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " "protocol will be automatically implemented from its parents. On the " -"contrary, if the type being created does " -"include :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags then it **must** " -"implement the GC protocol itself by at least implementing " -"the :c:member:`~PyTypeObject.tp_traverse` handle." +"contrary, if the type being created does include :c:macro:" +"`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the GC protocol " +"itself by at least implementing the :c:member:`~PyTypeObject.tp_traverse` " +"handle." msgstr "" -#: ../../c-api/type.rst:196 +#: ../../c-api/type.rst:208 msgid "" -"Return the type's name. Equivalent to getting the " -"type's :attr:`~type.__name__` attribute." +"Return the type's name. Equivalent to getting the type's :attr:`~type." +"__name__` attribute." msgstr "" -#: ../../c-api/type.rst:203 +#: ../../c-api/type.rst:215 msgid "" -"Return the type's qualified name. Equivalent to getting the " -"type's :attr:`~type.__qualname__` attribute." +"Return the type's qualified name. Equivalent to getting the type's :attr:" +"`~type.__qualname__` attribute." msgstr "" -#: ../../c-api/type.rst:210 +#: ../../c-api/type.rst:222 msgid "" "Return the type's fully qualified name. Equivalent to ``f\"{type.__module__}." -"{type.__qualname__}\"``, or :attr:`type.__qualname__` " -"if :attr:`type.__module__` is not a string or is equal to ``\"builtins\"``." +"{type.__qualname__}\"``, or :attr:`type.__qualname__` if :attr:`type." +"__module__` is not a string or is equal to ``\"builtins\"``." msgstr "" -#: ../../c-api/type.rst:218 +#: ../../c-api/type.rst:230 msgid "" -"Return the type's module name. Equivalent to getting " -"the :attr:`type.__module__` attribute." +"Return the type's module name. Equivalent to getting the :attr:`type." +"__module__` attribute." msgstr "" -#: ../../c-api/type.rst:225 +#: ../../c-api/type.rst:237 msgid "" "Return the function pointer stored in the given slot. If the result is " "``NULL``, this indicates that either the slot is ``NULL``, or that the " @@ -256,153 +267,155 @@ msgid "" "result pointer into the appropriate function type." msgstr "" -#: ../../c-api/type.rst:231 +#: ../../c-api/type.rst:243 msgid "" "See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument." msgstr "" -#: ../../c-api/type.rst:235 +#: ../../c-api/type.rst:247 msgid "" ":c:func:`PyType_GetSlot` can now accept all types. Previously, it was " "limited to :ref:`heap types `." msgstr "" -#: ../../c-api/type.rst:241 +#: ../../c-api/type.rst:253 msgid "" "Return the module object associated with the given type when the type was " "created using :c:func:`PyType_FromModuleAndSpec`." msgstr "" -#: ../../c-api/type.rst:244 ../../c-api/type.rst:264 +#: ../../c-api/type.rst:256 ../../c-api/type.rst:276 msgid "" "If no module is associated with the given type, sets :py:class:`TypeError` " "and returns ``NULL``." msgstr "" -#: ../../c-api/type.rst:247 +#: ../../c-api/type.rst:259 msgid "" "This function is usually used to get the module in which a method is " "defined. Note that in such a method, ``PyType_GetModule(Py_TYPE(self))`` may " "not return the intended result. ``Py_TYPE(self)`` may be a *subclass* of the " "intended class, and subclasses are not necessarily defined in the same " "module as their superclass. See :c:type:`PyCMethod` to get the class that " -"defines the method. See :c:func:`PyType_GetModuleByDef` for cases " -"when :c:type:`!PyCMethod` cannot be used." +"defines the method. See :c:func:`PyType_GetModuleByDef` for cases when :c:" +"type:`!PyCMethod` cannot be used." msgstr "" -#: ../../c-api/type.rst:260 +#: ../../c-api/type.rst:272 msgid "" "Return the state of the module object associated with the given type. This " -"is a shortcut for calling :c:func:`PyModule_GetState()` on the result " -"of :c:func:`PyType_GetModule`." +"is a shortcut for calling :c:func:`PyModule_GetState()` on the result of :c:" +"func:`PyType_GetModule`." msgstr "" -#: ../../c-api/type.rst:267 +#: ../../c-api/type.rst:279 msgid "" "If the *type* has an associated module but its state is ``NULL``, returns " "``NULL`` without setting an exception." msgstr "" -#: ../../c-api/type.rst:274 +#: ../../c-api/type.rst:286 msgid "" -"Find the first superclass whose module was created from the " -"given :c:type:`PyModuleDef` *def*, and return that module." +"Find the first superclass whose module was created from the given :c:type:" +"`PyModuleDef` *def*, and return that module." msgstr "" -#: ../../c-api/type.rst:277 +#: ../../c-api/type.rst:289 msgid "" "If no module is found, raises a :py:class:`TypeError` and returns ``NULL``." msgstr "" -#: ../../c-api/type.rst:279 +#: ../../c-api/type.rst:291 msgid "" -"This function is intended to be used together " -"with :c:func:`PyModule_GetState()` to get module state from slot methods " -"(such as :c:member:`~PyTypeObject.tp_init` " -"or :c:member:`~PyNumberMethods.nb_add`) and other places where a method's " -"defining class cannot be passed using the :c:type:`PyCMethod` calling " -"convention." +"This function is intended to be used together with :c:func:" +"`PyModule_GetState()` to get module state from slot methods (such as :c:" +"member:`~PyTypeObject.tp_init` or :c:member:`~PyNumberMethods.nb_add`) and " +"other places where a method's defining class cannot be passed using the :c:" +"type:`PyCMethod` calling convention." msgstr "" -#: ../../c-api/type.rst:285 +#: ../../c-api/type.rst:297 msgid "" "The returned reference is :term:`borrowed ` from *type*, " "and will be valid as long as you hold a reference to *type*. Do not release " "it with :c:func:`Py_DECREF` or similar." msgstr "" -#: ../../c-api/type.rst:293 +#: ../../c-api/type.rst:305 msgid "" -"Find the first superclass in *type*'s :term:`method resolution order` " -"whose :c:macro:`Py_tp_token` token is equal to the given one." +"Find the first superclass in *type*'s :term:`method resolution order` whose :" +"c:macro:`Py_tp_token` token is equal to the given one." msgstr "" -#: ../../c-api/type.rst:296 +#: ../../c-api/type.rst:308 msgid "" "If found, set *\\*result* to a new :term:`strong reference` to it and return " "``1``." msgstr "" -#: ../../c-api/type.rst:298 +#: ../../c-api/type.rst:310 msgid "If not found, set *\\*result* to ``NULL`` and return ``0``." msgstr "如果沒找到,則將 *\\*result* 設為 ``NULL`` 並回傳 ``0``。" -#: ../../c-api/type.rst:299 +#: ../../c-api/type.rst:311 msgid "" "On error, set *\\*result* to ``NULL`` and return ``-1`` with an exception " "set." -msgstr "在發生錯誤時,將 *\\*result* 設為 ``NULL`` 並回傳 ``-1``,同時設定例外。" +msgstr "" +"在發生錯誤時,將 *\\*result* 設為 ``NULL`` 並回傳 ``-1``,同時設定例外。" -#: ../../c-api/type.rst:302 +#: ../../c-api/type.rst:314 msgid "" "The *result* argument may be ``NULL``, in which case *\\*result* is not set. " "Use this if you need only the return value." -msgstr "如果 *result* 引數為 ``NULL``,則不會設定 *\\*result*。如果你只需要回傳值,請使用此選項。" +msgstr "" +"如果 *result* 引數為 ``NULL``,則不會設定 *\\*result*。如果你只需要回傳值,請" +"使用此選項。" -#: ../../c-api/type.rst:305 +#: ../../c-api/type.rst:317 msgid "The *token* argument may not be ``NULL``." msgstr "*token* 引數不可為 ``NULL``。" -#: ../../c-api/type.rst:311 +#: ../../c-api/type.rst:323 msgid "Attempt to assign a version tag to the given type." msgstr "" -#: ../../c-api/type.rst:313 +#: ../../c-api/type.rst:325 msgid "" "Returns 1 if the type already had a valid version tag or a new one was " "assigned, or 0 if a new tag could not be assigned." msgstr "" -#: ../../c-api/type.rst:320 +#: ../../c-api/type.rst:332 msgid "Creating Heap-Allocated Types" msgstr "" -#: ../../c-api/type.rst:322 +#: ../../c-api/type.rst:334 msgid "" "The following functions and structs are used to create :ref:`heap types " "`." msgstr "" -#: ../../c-api/type.rst:327 +#: ../../c-api/type.rst:339 msgid "" -"Create and return a :ref:`heap type ` from the *spec* " -"(see :c:macro:`Py_TPFLAGS_HEAPTYPE`)." +"Create and return a :ref:`heap type ` from the *spec* (see :c:" +"macro:`Py_TPFLAGS_HEAPTYPE`)." msgstr "" -#: ../../c-api/type.rst:330 +#: ../../c-api/type.rst:342 msgid "" "The metaclass *metaclass* is used to construct the resulting type object. " "When *metaclass* is ``NULL``, the metaclass is derived from *bases* (or " "*Py_tp_base[s]* slots if *bases* is ``NULL``, see below)." msgstr "" -#: ../../c-api/type.rst:334 +#: ../../c-api/type.rst:346 msgid "" "Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not " "supported, except if ``tp_new`` is ``NULL``." msgstr "" -#: ../../c-api/type.rst:337 +#: ../../c-api/type.rst:349 msgid "" "The *bases* argument can be used to specify base classes; it can either be " "only one class or a tuple of classes. If *bases* is ``NULL``, the " @@ -411,151 +424,150 @@ msgid "" "derives from :class:`object`." msgstr "" -#: ../../c-api/type.rst:343 +#: ../../c-api/type.rst:355 msgid "" "The *module* argument can be used to record the module in which the new " "class is defined. It must be a module object or ``NULL``. If not ``NULL``, " -"the module is associated with the new type and can later be retrieved " -"with :c:func:`PyType_GetModule`. The associated module is not inherited by " +"the module is associated with the new type and can later be retrieved with :" +"c:func:`PyType_GetModule`. The associated module is not inherited by " "subclasses; it must be specified for each class individually." msgstr "" -#: ../../c-api/type.rst:350 +#: ../../c-api/type.rst:362 msgid "This function calls :c:func:`PyType_Ready` on the new type." msgstr "" -#: ../../c-api/type.rst:352 +#: ../../c-api/type.rst:364 msgid "" -"Note that this function does *not* fully match the behavior of " -"calling :py:class:`type() ` or using the :keyword:`class` statement. " -"With user-provided base types or metaclasses, prefer :ref:`calling ` :py:class:`type` (or the metaclass) over ``PyType_From*`` functions. " +"Note that this function does *not* fully match the behavior of calling :py:" +"class:`type() ` or using the :keyword:`class` statement. With user-" +"provided base types or metaclasses, prefer :ref:`calling ` :py:" +"class:`type` (or the metaclass) over ``PyType_From*`` functions. " "Specifically:" msgstr "" -#: ../../c-api/type.rst:359 +#: ../../c-api/type.rst:371 msgid "" ":py:meth:`~object.__new__` is not called on the new class (and it must be " "set to ``type.__new__``)." msgstr "" -#: ../../c-api/type.rst:361 +#: ../../c-api/type.rst:373 msgid ":py:meth:`~object.__init__` is not called on the new class." msgstr "" -#: ../../c-api/type.rst:362 +#: ../../c-api/type.rst:374 msgid ":py:meth:`~object.__init_subclass__` is not called on any bases." msgstr "" -#: ../../c-api/type.rst:363 +#: ../../c-api/type.rst:375 msgid ":py:meth:`~object.__set_name__` is not called on new descriptors." msgstr "" -#: ../../c-api/type.rst:369 +#: ../../c-api/type.rst:381 msgid "Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases)``." msgstr "等價於 ``PyType_FromMetaclass(NULL, module, spec, bases)``。" -#: ../../c-api/type.rst:375 +#: ../../c-api/type.rst:387 msgid "" "The function now accepts a single class as the *bases* argument and ``NULL`` " "as the ``tp_doc`` slot." msgstr "" -#: ../../c-api/type.rst:380 ../../c-api/type.rst:401 +#: ../../c-api/type.rst:392 ../../c-api/type.rst:413 msgid "" "The function now finds and uses a metaclass corresponding to the provided " "base classes. Previously, only :class:`type` instances were returned." msgstr "" -#: ../../c-api/type.rst:383 ../../c-api/type.rst:404 ../../c-api/type.rst:424 +#: ../../c-api/type.rst:395 ../../c-api/type.rst:416 ../../c-api/type.rst:436 msgid "" "The :c:member:`~PyTypeObject.tp_new` of the metaclass is *ignored*. which " "may result in incomplete initialization. Creating classes whose metaclass " "overrides :c:member:`~PyTypeObject.tp_new` is deprecated." msgstr "" -#: ../../c-api/type.rst:390 ../../c-api/type.rst:411 ../../c-api/type.rst:431 +#: ../../c-api/type.rst:402 ../../c-api/type.rst:423 ../../c-api/type.rst:443 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is no longer allowed." msgstr "" -#: ../../c-api/type.rst:395 +#: ../../c-api/type.rst:407 msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases)``." msgstr "等價於 ``PyType_FromMetaclass(NULL, NULL, spec, bases)``。" -#: ../../c-api/type.rst:416 +#: ../../c-api/type.rst:428 msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``." msgstr "等價於 ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``。" -#: ../../c-api/type.rst:420 +#: ../../c-api/type.rst:432 msgid "" "The function now finds and uses a metaclass corresponding to the base " "classes provided in *Py_tp_base[s]* slots. Previously, only :class:`type` " "instances were returned." msgstr "" -#: ../../c-api/type.rst:436 +#: ../../c-api/type.rst:448 msgid "" "Make a type immutable: set the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag." msgstr "" -#: ../../c-api/type.rst:438 +#: ../../c-api/type.rst:450 msgid "All base classes of *type* must be immutable." msgstr "" -#: ../../c-api/type.rst:440 +#: ../../c-api/type.rst:452 msgid "On success, return ``0``. On error, set an exception and return ``-1``." msgstr "" -#: ../../c-api/type.rst:443 +#: ../../c-api/type.rst:455 msgid "" "The type must not be used before it's made immutable. For example, type " "instances must not be created before the type is made immutable." msgstr "" -#: ../../c-api/type.rst:459 +#: ../../c-api/type.rst:471 msgid "Structure defining a type's behavior." msgstr "" -#: ../../c-api/type.rst:463 +#: ../../c-api/type.rst:475 msgid "Name of the type, used to set :c:member:`PyTypeObject.tp_name`." msgstr "" -#: ../../c-api/type.rst:467 +#: ../../c-api/type.rst:479 msgid "" -"If positive, specifies the size of the instance in bytes. It is used to " -"set :c:member:`PyTypeObject.tp_basicsize`." +"If positive, specifies the size of the instance in bytes. It is used to set :" +"c:member:`PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/type.rst:470 +#: ../../c-api/type.rst:482 msgid "" "If zero, specifies that :c:member:`~PyTypeObject.tp_basicsize` should be " "inherited." msgstr "" -#: ../../c-api/type.rst:473 +#: ../../c-api/type.rst:485 msgid "" "If negative, the absolute value specifies how much space instances of the " -"class need *in addition* to the superclass. " -"Use :c:func:`PyObject_GetTypeData` to get a pointer to subclass-specific " -"memory reserved this way. For negative :c:member:`!basicsize`, Python will " -"insert padding when needed to meet :c:member:`~PyTypeObject.tp_basicsize`'s " -"alignment requirements." +"class need *in addition* to the superclass. Use :c:func:" +"`PyObject_GetTypeData` to get a pointer to subclass-specific memory reserved " +"this way. For negative :c:member:`!basicsize`, Python will insert padding " +"when needed to meet :c:member:`~PyTypeObject.tp_basicsize`'s alignment " +"requirements." msgstr "" -#: ../../c-api/type.rst:483 +#: ../../c-api/type.rst:495 msgid "Previously, this field could not be negative." msgstr "" -#: ../../c-api/type.rst:487 +#: ../../c-api/type.rst:499 msgid "" -"Size of one element of a variable-size type, in bytes. Used to " -"set :c:member:`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation " -"for caveats." +"Size of one element of a variable-size type, in bytes. Used to set :c:member:" +"`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for caveats." msgstr "" -#: ../../c-api/type.rst:491 +#: ../../c-api/type.rst:503 msgid "" "If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending " "arbitrary variable-sized classes is dangerous, since some types use a fixed " @@ -564,106 +576,107 @@ msgid "" "only possible in the following situations:" msgstr "" -#: ../../c-api/type.rst:498 +#: ../../c-api/type.rst:510 msgid "" "The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize`)." msgstr "" -#: ../../c-api/type.rst:500 +#: ../../c-api/type.rst:512 msgid "" "The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that " "the memory layout of the base class is known." msgstr "" -#: ../../c-api/type.rst:502 +#: ../../c-api/type.rst:514 msgid "" "The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the " "subclass does not access the instance's memory directly." msgstr "" -#: ../../c-api/type.rst:505 +#: ../../c-api/type.rst:517 msgid "With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag." msgstr "" -#: ../../c-api/type.rst:509 +#: ../../c-api/type.rst:521 msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`." msgstr "" -#: ../../c-api/type.rst:511 +#: ../../c-api/type.rst:523 msgid "" -"If the ``Py_TPFLAGS_HEAPTYPE`` flag is not " -"set, :c:func:`PyType_FromSpecWithBases` sets it automatically." +"If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:" +"`PyType_FromSpecWithBases` sets it automatically." msgstr "" -#: ../../c-api/type.rst:516 +#: ../../c-api/type.rst:528 msgid "" "Array of :c:type:`PyType_Slot` structures. Terminated by the special slot " "value ``{0, NULL}``." msgstr "" -#: ../../c-api/type.rst:519 +#: ../../c-api/type.rst:531 msgid "Each slot ID should be specified at most once." msgstr "" -#: ../../c-api/type.rst:529 +#: ../../c-api/type.rst:541 msgid "" "Structure defining optional functionality of a type, containing a slot ID " "and a value pointer." msgstr "" -#: ../../c-api/type.rst:534 +#: ../../c-api/type.rst:546 msgid "A slot ID." msgstr "" -#: ../../c-api/type.rst:536 +#: ../../c-api/type.rst:548 msgid "" -"Slot IDs are named like the field names of the " -"structures :c:type:`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:type:`PyMappingMethods` " -"and :c:type:`PyAsyncMethods` with an added ``Py_`` prefix. For example, use:" +"Slot IDs are named like the field names of the structures :c:type:" +"`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:" +"type:`PyMappingMethods` and :c:type:`PyAsyncMethods` with an added ``Py_`` " +"prefix. For example, use:" msgstr "" -#: ../../c-api/type.rst:542 +#: ../../c-api/type.rst:554 msgid "``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`" msgstr "" -#: ../../c-api/type.rst:543 +#: ../../c-api/type.rst:555 msgid "``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`" msgstr "" -#: ../../c-api/type.rst:544 +#: ../../c-api/type.rst:556 msgid "``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`" msgstr "" -#: ../../c-api/type.rst:546 +#: ../../c-api/type.rst:558 msgid "" "An additional slot is supported that does not correspond to a :c:type:`!" "PyTypeObject` struct field:" msgstr "" -#: ../../c-api/type.rst:549 +#: ../../c-api/type.rst:561 msgid ":c:data:`Py_tp_token`" msgstr ":c:data:`Py_tp_token`" -#: ../../c-api/type.rst:551 +#: ../../c-api/type.rst:563 msgid "" "The following “offset” fields cannot be set using :c:type:`PyType_Slot`:" msgstr "" -#: ../../c-api/type.rst:553 +#: ../../c-api/type.rst:565 msgid "" -":c:member:`~PyTypeObject.tp_weaklistoffset` " -"(use :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" +":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" +"`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" msgstr "" -#: ../../c-api/type.rst:555 +#: ../../c-api/type.rst:567 msgid "" -":c:member:`~PyTypeObject.tp_dictoffset` " -"(use :c:macro:`Py_TPFLAGS_MANAGED_DICT` instead if possible)" +":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT` instead if possible)" msgstr "" -":c:member:`~PyTypeObject.tp_dictoffset`\\ (如果可能,請改" -"用 :c:macro:`Py_TPFLAGS_MANAGED_DICT`)" +":c:member:`~PyTypeObject.tp_dictoffset`\\ (如果可能,請改用 :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT`)" -#: ../../c-api/type.rst:557 +#: ../../c-api/type.rst:569 msgid "" ":c:member:`~PyTypeObject.tp_vectorcall_offset` (use " "``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)" @@ -671,119 +684,120 @@ msgstr "" ":c:member:`~PyTypeObject.tp_vectorcall_offset`\\ (請用 :ref:`PyMemberDef " "` 中的 ``\"__vectorcalloffset__\"``)" -#: ../../c-api/type.rst:561 +#: ../../c-api/type.rst:573 msgid "" "If it is not possible to switch to a ``MANAGED`` flag (for example, for " -"vectorcall or to support Python older than 3.12), specify the offset " -"in :c:member:`Py_tp_members `. " -"See :ref:`PyMemberDef documentation ` for details." +"vectorcall or to support Python older than 3.12), specify the offset in :c:" +"member:`Py_tp_members `. See :ref:`PyMemberDef " +"documentation ` for details." msgstr "" -#: ../../c-api/type.rst:567 +#: ../../c-api/type.rst:579 msgid "" "The following internal fields cannot be set at all when creating a heap type:" msgstr "" -#: ../../c-api/type.rst:570 +#: ../../c-api/type.rst:582 msgid "" -":c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject.tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject.tp_subclasses`, " +":c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject.tp_mro`, :c:" +"member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject.tp_subclasses`, " "and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" -#: ../../c-api/type.rst:576 +#: ../../c-api/type.rst:588 msgid "" "Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " -"some platforms. To avoid issues, use the *bases* argument " -"of :c:func:`PyType_FromSpecWithBases` instead." +"some platforms. To avoid issues, use the *bases* argument of :c:func:" +"`PyType_FromSpecWithBases` instead." msgstr "" -#: ../../c-api/type.rst:581 +#: ../../c-api/type.rst:593 msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." msgstr "" -#: ../../c-api/type.rst:584 +#: ../../c-api/type.rst:596 msgid "" -":c:member:`~PyBufferProcs.bf_getbuffer` " -"and :c:member:`~PyBufferProcs.bf_releasebuffer` are now available under " -"the :ref:`limited API `." +":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." +"bf_releasebuffer` are now available under the :ref:`limited API `." msgstr "" -#: ../../c-api/type.rst:589 +#: ../../c-api/type.rst:601 msgid "" "The field :c:member:`~PyTypeObject.tp_vectorcall` can now set using " "``Py_tp_vectorcall``. See the field's documentation for details." msgstr "" -#: ../../c-api/type.rst:596 +#: ../../c-api/type.rst:608 msgid "" "The desired value of the slot. In most cases, this is a pointer to a " "function." msgstr "" -#: ../../c-api/type.rst:599 +#: ../../c-api/type.rst:611 msgid "*pfunc* values may not be ``NULL``, except for the following slots:" msgstr "" -#: ../../c-api/type.rst:601 +#: ../../c-api/type.rst:613 msgid "``Py_tp_doc``" msgstr "``Py_tp_doc``" -#: ../../c-api/type.rst:602 +#: ../../c-api/type.rst:614 msgid "" ":c:data:`Py_tp_token` (for clarity, prefer :c:data:`Py_TP_USE_SPEC` rather " "than ``NULL``)" msgstr "" -#: ../../c-api/type.rst:607 +#: ../../c-api/type.rst:619 msgid "" "A :c:member:`~PyType_Slot.slot` that records a static memory layout ID for a " "class." msgstr "" -#: ../../c-api/type.rst:610 +#: ../../c-api/type.rst:622 msgid "" "If the :c:type:`PyType_Spec` of the class is statically allocated, the token " "can be set to the spec using the special value :c:data:`Py_TP_USE_SPEC`:" msgstr "" -#: ../../c-api/type.rst:614 +#: ../../c-api/type.rst:626 msgid "" "static PyType_Slot foo_slots[] = {\n" " {Py_tp_token, Py_TP_USE_SPEC}," msgstr "" -#: ../../c-api/type.rst:619 +#: ../../c-api/type.rst:631 msgid "It can also be set to an arbitrary pointer, but you must ensure that:" msgstr "" -#: ../../c-api/type.rst:621 +#: ../../c-api/type.rst:633 msgid "" "The pointer outlives the class, so it's not reused for something else while " "the class exists." msgstr "" -#: ../../c-api/type.rst:623 +#: ../../c-api/type.rst:635 msgid "" "It \"belongs\" to the extension module where the class lives, so it will not " "clash with other extensions." msgstr "" -#: ../../c-api/type.rst:626 +#: ../../c-api/type.rst:638 msgid "" "Use :c:func:`PyType_GetBaseByToken` to check if a class's superclass has a " "given token -- that is, check whether the memory layout is compatible." msgstr "" -#: ../../c-api/type.rst:629 +#: ../../c-api/type.rst:641 msgid "" -"To get the token for a given class (without considering superclasses), " -"use :c:func:`PyType_GetSlot` with ``Py_tp_token``." +"To get the token for a given class (without considering superclasses), use :" +"c:func:`PyType_GetSlot` with ``Py_tp_token``." msgstr "" -#: ../../c-api/type.rst:638 +#: ../../c-api/type.rst:650 msgid "" -"Used as a value with :c:data:`Py_tp_token` to set the token to the " -"class's :c:type:`PyType_Spec`. Expands to ``NULL``." +"Used as a value with :c:data:`Py_tp_token` to set the token to the class's :" +"c:type:`PyType_Spec`. Expands to ``NULL``." msgstr "" #: ../../c-api/type.rst:8 diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 116fe979323..a67a3c066f6 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-07 00:14+0000\n" +"POT-Creation-Date: 2025-11-11 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2386,12 +2386,13 @@ msgstr "" #: ../../c-api/typeobj.rst:1339 msgid "" -"These flags are used by functions such as :c:func:`PyLong_Check` to quickly " -"determine if a type is a subclass of a built-in type; such specific checks " -"are faster than a generic check, like :c:func:`PyObject_IsInstance`. Custom " -"types that inherit from built-ins should have their :c:member:`~PyTypeObject." -"tp_flags` set appropriately, or the code that interacts with such types will " -"behave differently depending on what kind of check is used." +"Functions such as :c:func:`PyLong_Check` will call :c:func:" +"`PyType_FastSubclass` with one of these flags to quickly determine if a type " +"is a subclass of a built-in type; such specific checks are faster than a " +"generic check, like :c:func:`PyObject_IsInstance`. Custom types that inherit " +"from built-ins should have their :c:member:`~PyTypeObject.tp_flags` set " +"appropriately, or the code that interacts with such types will behave " +"differently depending on what kind of check is used." msgstr "" #: ../../c-api/typeobj.rst:1350 From 3c685fbb2a3c502e8e404ebd46d383502e08cc3f Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 11 Nov 2025 14:30:13 +0800 Subject: [PATCH 9/9] Resolve fuzzy translation entries from CPython 3.14 sync (#1163) * Initial plan * Fix all fuzzy translation tags introduced in recent syncs Co-authored-by: mattwang44 <24987826+mattwang44@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mattwang44 <24987826+mattwang44@users.noreply.github.com> --- c-api/frame.po | 1 - glossary.po | 3 +-- library/compression.zstd.po | 1 - library/ssl.po | 4 +--- sphinx.po | 5 +---- using/configure.po | 35 +++++++++++++---------------------- using/unix.po | 5 ++--- 7 files changed, 18 insertions(+), 36 deletions(-) diff --git a/c-api/frame.po b/c-api/frame.po index 175cdbcce49..c0441207853 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -1,7 +1,6 @@ # Copyright (C) 2001 Python Software Foundation # This file is distributed under the same license as the Python package. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" diff --git a/glossary.po b/glossary.po index 676ace2fe06..2512332f511 100644 --- a/glossary.po +++ b/glossary.po @@ -2327,9 +2327,8 @@ msgid "" msgstr "" #: ../../glossary.rst:1027 -#, fuzzy msgid "optional module" -msgstr "extension module(擴充模組)" +msgstr "optional module(可選模組)" #: ../../glossary.rst:1029 msgid "" diff --git a/library/compression.zstd.po b/library/compression.zstd.po index 03ce8321f4b..5025aec25c5 100644 --- a/library/compression.zstd.po +++ b/library/compression.zstd.po @@ -2,7 +2,6 @@ # 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" diff --git a/library/ssl.po b/library/ssl.po index 9afef5dd0e5..c586dcc23f8 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -27,7 +27,6 @@ msgid "**Source code:** :source:`Lib/ssl.py`" msgstr "**原始碼:**\\ :source:`Lib/ssl.py`" #: ../../library/ssl.rst:18 -#, fuzzy msgid "" "This module provides access to Transport Layer Security (often known as " "\"Secure Sockets Layer\") encryption and peer authentication facilities for " @@ -36,8 +35,7 @@ msgid "" msgstr "" "這個模組向用戶端及伺服器端提供了對於網路 socket 的傳輸層安全性協定(或稱為" "「安全通訊協定 (Secure Sockets Layer)」)加密及身分驗證功能。這個模組使用 " -"OpenSSL 套件,它可以在所有的 Unix 系統、Windows、macOS、以及其他任何可能的平" -"台上使用,只要事先在該平台上安裝 OpenSSL。" +"OpenSSL 套件。" #: ../../includes/optional-module.rst:1 msgid "" diff --git a/sphinx.po b/sphinx.po index 0ef83aac4c2..9a41dadd4cf 100644 --- a/sphinx.po +++ b/sphinx.po @@ -54,13 +54,10 @@ msgid "Last updated on: %(last_updated)s." msgstr "最後更新時間:%(last_updated)s。" #: ../../tools/templates/download.html:34 -#, fuzzy msgid "" "Download an archive containing all the documentation for this version of " "Python:" -msgstr "" -"要下載包含這個 Python 版本所有文件的歸檔,可以遵循這個表格中的其中一個連結," -"以取得各種格式的文件。" +msgstr "下載包含這個 Python 版本所有文件的歸檔:" #: ../../tools/templates/download.html:38 msgid "Format" diff --git a/using/configure.po b/using/configure.po index b0950092257..4a6dca12505 100644 --- a/using/configure.po +++ b/using/configure.po @@ -24,9 +24,8 @@ msgid "Build Requirements" msgstr "建置需求" #: ../../using/configure.rst:13 -#, fuzzy msgid "To build CPython, you will need:" -msgstr "建置可選的模組:" +msgstr "要建置 CPython,你將需要:" #: ../../using/configure.rst:15 msgid "" @@ -56,9 +55,8 @@ msgid "Support for threads." msgstr "thread 的支援。" #: ../../using/configure.rst:28 -#, fuzzy msgid "On Windows, Visual Studio 2015 or later is now required." -msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" +msgstr "在 Windows 上現在需要 Visual Studio 2015 或更新版本。" #: ../../using/configure.rst:31 msgid "" @@ -67,16 +65,16 @@ msgid "" msgstr "" #: ../../using/configure.rst:35 -#, fuzzy msgid "Thread support is now required." -msgstr "對執行緒與 OpenSSL 1.0.2 的支援現在是必要的。" +msgstr "執行緒支援現在是必要的。" #: ../../using/configure.rst:38 -#, fuzzy msgid "" "C11 compiler, IEEE 754 and NaN support are now required. On Windows, Visual " "Studio 2017 or later is required." -msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" +msgstr "" +"現在需要 C11 編譯器、IEEE 754 和 NaN 支援。在 Windows 上需要 Visual Studio " +"2017 或更新版本。" #: ../../using/configure.rst:42 msgid "" @@ -85,9 +83,8 @@ msgid "" msgstr "" #: ../../using/configure.rst:49 -#, fuzzy msgid "Requirements for optional modules" -msgstr "建置可選的模組:" +msgstr "可選模組的需求" #: ../../using/configure.rst:51 msgid "" @@ -112,9 +109,8 @@ msgid "" msgstr "" #: ../../using/configure.rst:65 -#, fuzzy msgid "Dependencies to build optional modules are:" -msgstr "建置可選的模組:" +msgstr "建置可選模組的依賴項目為:" #: ../../using/configure.rst:71 msgid "Dependency" @@ -125,9 +121,8 @@ msgid "Minimum version" msgstr "" #: ../../using/configure.rst:73 -#, fuzzy msgid "Python module" -msgstr "Python 建置系統" +msgstr "Python 模組" #: ../../using/configure.rst:74 msgid "`libbz2 `_" @@ -316,14 +311,12 @@ msgid ":ref:`configure-options-for-dependencies`" msgstr "" #: ../../using/configure.rst:140 -#, fuzzy msgid "Tcl/Tk version 8.3.1 is now required for :mod:`tkinter`." -msgstr "Tcl/Tk version 8.3.1 現在是必要的。" +msgstr ":mod:`tkinter` 現在需要 Tcl/Tk version 8.3.1。" #: ../../using/configure.rst:143 -#, fuzzy msgid "Tcl/Tk version 8.4 is now required for :mod:`tkinter`." -msgstr "Tcl/Tk version 8.3.1 現在是必要的。" +msgstr ":mod:`tkinter` 現在需要 Tcl/Tk version 8.4。" #: ../../using/configure.rst:146 msgid "OpenSSL 1.0.2 is now required for :mod:`hashlib` and :mod:`ssl`." @@ -336,9 +329,8 @@ msgid "" msgstr "" #: ../../using/configure.rst:153 -#, fuzzy msgid "Tcl/Tk version 8.5.12 is now required for :mod:`tkinter`." -msgstr "Tcl/Tk version 8.3.1 現在是必要的。" +msgstr ":mod:`tkinter` 現在需要 Tcl/Tk version 8.5.12。" #: ../../using/configure.rst:156 msgid "SQLite 3.15.2 is now required for :mod:`sqlite3`." @@ -408,9 +400,8 @@ msgid "" msgstr "" #: ../../using/configure.rst:197 -#, fuzzy msgid "Autoconf 2.72 is now used to regenerate :file:`configure`." -msgstr "Autoconf 2.72 現在是必要的。" +msgstr "現在使用 Autoconf 2.72 來重新產生 :file:`configure`。" #: ../../using/configure.rst:204 msgid "Configure Options" diff --git a/using/unix.po b/using/unix.po index 864741b34b6..a557c71c24a 100644 --- a/using/unix.po +++ b/using/unix.po @@ -183,7 +183,6 @@ msgid "" msgstr "" #: ../../using/unix.rst:93 -#, fuzzy msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -193,8 +192,8 @@ msgid "" msgstr "" "如果你想自己編譯 CPython,首先要做的是取得\\ `原始碼 `_。你可以下載最新版本的原始碼,也可以直接提取最新的 `clone" -"(克隆) `_。(如" -"果你想要貢獻修補程式碼,也會需要一份 clone。)" +"(克隆) `_。你還需要" +"安裝\\ :ref:`建置需求 `。" #: ../../using/unix.rst:99 msgid "The build process consists of the usual commands::"