diff --git a/about.po b/about.po index f69f9b8a87..63f33f9982 100644 --- a/about.po +++ b/about.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2022-05-12 00:11+0800\n" "Last-Translator: hsiao yi \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -62,11 +62,10 @@ msgstr "" #: ../../about.rst:24 msgid "" -"the `Docutils `_ project for creating " +"the `Docutils `_ project for creating " "reStructuredText and the Docutils suite;" msgstr "" -"創造 reStructuredText 和 Docutils 工具組的 `Docutils `_ 專案;" +"創造 reStructuredText 和 Docutils 工具組的 `Docutils `_ 專案;" #: ../../about.rst:26 msgid "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index c193bf5b0b..dec64a5c60 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-31 00:21+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-" @@ -1191,7 +1191,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1904 ../../c-api/typeobj.rst:1915 #: ../../c-api/typeobj.rst:1925 ../../c-api/typeobj.rst:1934 #: ../../c-api/typeobj.rst:1944 ../../c-api/typeobj.rst:1958 -#: ../../c-api/typeobj.rst:2007 ../../c-api/typeobj.rst:2024 +#: ../../c-api/typeobj.rst:2004 ../../c-api/typeobj.rst:2027 msgid "**Inheritance:**" msgstr "" @@ -1225,7 +1225,7 @@ msgstr "" #: ../../c-api/typeobj.rst:928 ../../c-api/typeobj.rst:1527 #: ../../c-api/typeobj.rst:1550 ../../c-api/typeobj.rst:1668 #: ../../c-api/typeobj.rst:1686 ../../c-api/typeobj.rst:1777 -#: ../../c-api/typeobj.rst:1889 ../../c-api/typeobj.rst:2009 +#: ../../c-api/typeobj.rst:1889 ../../c-api/typeobj.rst:2006 msgid "This field is inherited by subtypes." msgstr "" @@ -2867,12 +2867,6 @@ msgstr "" #: ../../c-api/typeobj.rst:1993 msgid "" -"For this field to be taken into account (even through inheritance), you must " -"also set the :const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit." -msgstr "" - -#: ../../c-api/typeobj.rst:1996 -msgid "" "Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." "tp_dealloc` may be called from any Python thread, not just the thread which " "created the object (if the object becomes part of a refcount cycle, that " @@ -2884,11 +2878,18 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2013 +#: ../../c-api/typeobj.rst:2012 +msgid "" +"Before version 3.8 it was necessary to set the :const:" +"`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " +"This is no longer required." +msgstr "" + +#: ../../c-api/typeobj.rst:2016 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2018 +#: ../../c-api/typeobj.rst:2021 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -2896,61 +2897,61 @@ msgid "" "attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2026 +#: ../../c-api/typeobj.rst:2029 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2028 +#: ../../c-api/typeobj.rst:2031 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2034 +#: ../../c-api/typeobj.rst:2037 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2036 +#: ../../c-api/typeobj.rst:2039 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2040 +#: ../../c-api/typeobj.rst:2043 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2042 +#: ../../c-api/typeobj.rst:2045 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2044 +#: ../../c-api/typeobj.rst:2047 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: ../../c-api/typeobj.rst:2046 +#: ../../c-api/typeobj.rst:2049 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2050 +#: ../../c-api/typeobj.rst:2053 msgid "" -"Also, since :c:type:`PyTypeObject` is not part of the :ref:`stable ABI " -"`, any extension modules using static types must be compiled for a " -"specific Python minor version." +"Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " +"` as an opaque struct, any extension modules using static types must " +"be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2058 +#: ../../c-api/typeobj.rst:2061 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2060 +#: ../../c-api/typeobj.rst:2063 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -2958,29 +2959,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2065 +#: ../../c-api/typeobj.rst:2068 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, or :c:func:" "`PyType_FromModuleAndSpec`." msgstr "" -#: ../../c-api/typeobj.rst:2073 +#: ../../c-api/typeobj.rst:2076 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2080 +#: ../../c-api/typeobj.rst:2083 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " "similar name documented in the :ref:`number` section." msgstr "" -#: ../../c-api/typeobj.rst:2086 ../../c-api/typeobj.rst:2410 +#: ../../c-api/typeobj.rst:2089 ../../c-api/typeobj.rst:2413 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2133 +#: ../../c-api/typeobj.rst:2136 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -2990,30 +2991,30 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2142 +#: ../../c-api/typeobj.rst:2145 msgid "" "The :c:data:`nb_reserved` field should always be ``NULL``. It was " "previously called :c:data:`nb_long`, and was renamed in Python 3.0.1." msgstr "" -#: ../../c-api/typeobj.rst:2187 +#: ../../c-api/typeobj.rst:2190 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2194 +#: ../../c-api/typeobj.rst:2197 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" msgstr "" -#: ../../c-api/typeobj.rst:2199 +#: ../../c-api/typeobj.rst:2202 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " "``NULL`` if the object has no defined length." msgstr "" -#: ../../c-api/typeobj.rst:2205 +#: ../../c-api/typeobj.rst:2208 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3021,7 +3022,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2213 +#: ../../c-api/typeobj.rst:2216 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" @@ -3031,17 +3032,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2224 +#: ../../c-api/typeobj.rst:2227 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2231 +#: ../../c-api/typeobj.rst:2234 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2236 +#: ../../c-api/typeobj.rst:2239 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -3049,21 +3050,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2243 +#: ../../c-api/typeobj.rst:2246 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " "addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2249 +#: ../../c-api/typeobj.rst:2252 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " "multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2255 +#: ../../c-api/typeobj.rst:2258 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -3072,7 +3073,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2261 +#: ../../c-api/typeobj.rst:2264 msgid "" "Negative indexes are handled as follows: if the :attr:`sq_length` slot is " "filled, it is called and the sequence length is used to compute a positive " @@ -3080,7 +3081,7 @@ msgid "" "the index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2268 +#: ../../c-api/typeobj.rst:2271 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -3089,14 +3090,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2277 +#: ../../c-api/typeobj.rst:2280 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" "PySequence_Contains` simply traverses the sequence until it finds a match." msgstr "" -#: ../../c-api/typeobj.rst:2284 +#: ../../c-api/typeobj.rst:2287 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3106,7 +3107,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2293 +#: ../../c-api/typeobj.rst:2296 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3116,72 +3117,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2304 +#: ../../c-api/typeobj.rst:2307 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2312 +#: ../../c-api/typeobj.rst:2315 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " "expose its internal data to consumer objects." msgstr "" -#: ../../c-api/typeobj.rst:2318 ../../c-api/typeobj.rst:2367 -#: ../../c-api/typeobj.rst:2421 ../../c-api/typeobj.rst:2432 -#: ../../c-api/typeobj.rst:2444 ../../c-api/typeobj.rst:2453 +#: ../../c-api/typeobj.rst:2321 ../../c-api/typeobj.rst:2370 +#: ../../c-api/typeobj.rst:2424 ../../c-api/typeobj.rst:2435 +#: ../../c-api/typeobj.rst:2447 ../../c-api/typeobj.rst:2456 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2322 +#: ../../c-api/typeobj.rst:2325 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " "steps:" msgstr "" -#: ../../c-api/typeobj.rst:2326 +#: ../../c-api/typeobj.rst:2329 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " "set :c:data:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2329 +#: ../../c-api/typeobj.rst:2332 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2331 +#: ../../c-api/typeobj.rst:2334 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2333 +#: ../../c-api/typeobj.rst:2336 msgid "" "Set :c:data:`view->obj` to *exporter* and increment :c:data:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2335 +#: ../../c-api/typeobj.rst:2338 msgid "Return ``0``." msgstr "" -#: ../../c-api/typeobj.rst:2337 +#: ../../c-api/typeobj.rst:2340 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2340 +#: ../../c-api/typeobj.rst:2343 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "data:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2343 +#: ../../c-api/typeobj.rst:2346 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:data:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2347 +#: ../../c-api/typeobj.rst:2350 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3189,7 +3190,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2352 +#: ../../c-api/typeobj.rst:2355 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -3198,19 +3199,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2359 +#: ../../c-api/typeobj.rst:2362 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." msgstr "" -#: ../../c-api/typeobj.rst:2362 +#: ../../c-api/typeobj.rst:2365 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2371 +#: ../../c-api/typeobj.rst:2374 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -3218,15 +3219,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2376 +#: ../../c-api/typeobj.rst:2379 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2378 +#: ../../c-api/typeobj.rst:2381 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2380 +#: ../../c-api/typeobj.rst:2383 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -3234,68 +3235,68 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2386 +#: ../../c-api/typeobj.rst:2389 msgid "" "This function MUST NOT decrement :c:data:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2391 +#: ../../c-api/typeobj.rst:2394 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2399 +#: ../../c-api/typeobj.rst:2402 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2407 +#: ../../c-api/typeobj.rst:2410 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2425 +#: ../../c-api/typeobj.rst:2428 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " "must return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2428 +#: ../../c-api/typeobj.rst:2431 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2436 +#: ../../c-api/typeobj.rst:2439 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`__anext__` " "for details." msgstr "" -#: ../../c-api/typeobj.rst:2439 +#: ../../c-api/typeobj.rst:2442 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2448 +#: ../../c-api/typeobj.rst:2451 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " "This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2457 +#: ../../c-api/typeobj.rst:2460 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2466 +#: ../../c-api/typeobj.rst:2469 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2470 +#: ../../c-api/typeobj.rst:2473 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " @@ -3309,80 +3310,80 @@ msgid "" "member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2480 +#: ../../c-api/typeobj.rst:2483 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." "tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2487 +#: ../../c-api/typeobj.rst:2490 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2491 +#: ../../c-api/typeobj.rst:2494 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2495 +#: ../../c-api/typeobj.rst:2498 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2499 +#: ../../c-api/typeobj.rst:2502 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2503 ../../c-api/typeobj.rst:2512 +#: ../../c-api/typeobj.rst:2506 ../../c-api/typeobj.rst:2515 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2507 ../../c-api/typeobj.rst:2518 +#: ../../c-api/typeobj.rst:2510 ../../c-api/typeobj.rst:2521 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." msgstr "" -#: ../../c-api/typeobj.rst:2514 +#: ../../c-api/typeobj.rst:2517 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2521 +#: ../../c-api/typeobj.rst:2524 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2525 +#: ../../c-api/typeobj.rst:2528 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:2529 +#: ../../c-api/typeobj.rst:2532 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:2533 +#: ../../c-api/typeobj.rst:2536 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:2537 +#: ../../c-api/typeobj.rst:2540 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:2541 +#: ../../c-api/typeobj.rst:2544 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:2545 +#: ../../c-api/typeobj.rst:2548 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:2559 +#: ../../c-api/typeobj.rst:2562 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:2575 +#: ../../c-api/typeobj.rst:2578 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2577 +#: ../../c-api/typeobj.rst:2580 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3390,33 +3391,33 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2582 +#: ../../c-api/typeobj.rst:2585 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2599 +#: ../../c-api/typeobj.rst:2602 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2643 +#: ../../c-api/typeobj.rst:2646 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2670 +#: ../../c-api/typeobj.rst:2673 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func) using :c:data:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:2689 +#: ../../c-api/typeobj.rst:2692 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2700 +#: ../../c-api/typeobj.rst:2703 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" diff --git a/extending/index.po b/extending/index.po index e109abf99c..b41c0f6dbe 100644 --- a/extending/index.po +++ b/extending/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2021-07-06 22:18+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,8 +50,8 @@ msgid "" msgstr "" "這份說明文件假設您具備 Python 的基礎知識。關於此語言的非正式介紹,請參閱 :" "ref:`tutorial-index`\\ 。\\ :ref:`reference-index`\\ 給予此語言更為正式的定" -"義。\\ :ref:`library-index` 記錄了賦予此語言廣泛應用範圍的物件型別、函式" -"與(內建的和以 Python 編寫的)模組。" +"義。\\ :ref:`library-index` 記錄了賦予此語言廣泛應用範圍的物件型別、函式與" +"(內建的和以 Python 編寫的)模組。" #: ../../extending/index.rst:21 msgid "" @@ -67,14 +67,14 @@ msgstr "推薦的第三方工具" #: ../../extending/index.rst:28 msgid "" "This guide only covers the basic tools for creating extensions provided as " -"part of this version of CPython. Third party tools like `Cython `_, `cffi `_, `SWIG `_, `cffi `_, `SWIG `_ and `Numba `_ offer both simpler and " "more sophisticated approaches to creating C and C++ extensions for Python." msgstr "" "這份指南僅涵蓋了此 CPython 版本所提供的、用以建立擴充的基本工具。第三方工具," -"例如 `Cython `_\\ 、\\ `cffi `_\\ 、\\ `SWIG `_ 和 `Numba `_\\ 、\\ `cffi `_\\ 、\\ `SWIG `_ 和 `Numba `_\\ ,提供了更為簡單及更為複雜的多種方法,來為 Python 建立 C 和 C ++ 擴" "充。" @@ -122,5 +122,5 @@ msgid "" "details involved in doing that successfully." msgstr "" "有時候,相較於建立一個擴充,使其在 Python 直譯器中可作為主應用程式運行,還不" -"如將 CPython 運行環境嵌入至一個更大的應用程式中更可取。本節將涵蓋一些要" -"成功完成此任務所涉及的細節。" +"如將 CPython 運行環境嵌入至一個更大的應用程式中更可取。本節將涵蓋一些要成功完" +"成此任務所涉及的細節。" diff --git a/faq/design.po b/faq/design.po index 97ad2b7df2..3cb0de6e51 100644 --- a/faq/design.po +++ b/faq/design.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-07-06 00:17+0000\n" -"PO-Revision-Date: 2022-08-29 22:27+0800\n" +"PO-Revision-Date: 2022-08-31 22:38+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -39,8 +39,8 @@ msgid "" "elegant and contributes a lot to the clarity of the average Python program. " "Most people learn to love this feature after a while." msgstr "" -"Guido van Rossum 相信使用縮排來分組超級優雅,並且對提高一般 Python 程式的清晰度有許多貢獻。" -"許多人在學習一段時間之後就愛上了這個功能。" +"Guido van Rossum 相信使用縮排來分組超級優雅,並且對提高一般 Python 程式的清晰" +"度有許多貢獻。許多人在學習一段時間之後就愛上了這個功能。" #: ../../faq/design.rst:17 msgid "" @@ -48,8 +48,8 @@ msgid "" "grouping perceived by the parser and the human reader. Occasionally C " "programmers will encounter a fragment of code like this::" msgstr "" -"因為沒有開始/結束括號,因此剖析器和人類讀者感知到的分組就不存在分歧。" -"偶爾 C 語言的程式設計師會遇到這樣的程式碼片段:\n" +"因為沒有開始/結束括號,因此剖析器和人類讀者感知到的分組就不存在分歧。偶爾 C " +"語言的程式設計師會遇到這樣的程式碼片段:\n" "\n" "::" @@ -64,7 +64,6 @@ msgstr "" "即使是資深的 C 語言開發者有時也會盯著他許久,思考為何即便 ``x > y``\\ ,但 " "``y`` 還是減少了。" - #: ../../faq/design.rst:31 msgid "" "Because there are no begin/end brackets, Python is much less prone to coding-" @@ -90,8 +89,8 @@ msgstr "" "很多程式碼風格會把 begin/end 獨立放在一行。這會讓程式碼很長且浪費珍貴的螢幕空" "間,要概覽程式時也變得較為困難。理想上來說,一個函式應該要佔一個螢幕(大概 " "20 至 30 行)。20 行的 Python 程式碼比起 20 行的 C 程式碼可以做更多事。雖然沒" -"有開頭與結尾的括號並非單一原因(沒有變數宣告及高階的資料型別同樣有關),但縮排式的" -"語法確實給了幫助。" +"有開頭與結尾的括號並非單一原因(沒有變數宣告及高階的資料型別同樣有關),但縮" +"排式的語法確實給了幫助。" #: ../../faq/design.rst:48 msgid "Why am I getting strange results with simple arithmetic operations?" @@ -107,7 +106,8 @@ msgstr "為何浮點數運算如此不精確?" #: ../../faq/design.rst:56 msgid "Users are often surprised by results like this::" -msgstr "使用者時常對這樣的結果感到驚訝:\n" +msgstr "" +"使用者時常對這樣的結果感到驚訝:\n" "\n" "::" @@ -192,8 +192,8 @@ msgid "" "tuples and lists." msgstr "" "其一是效能:知道字串不可變動後,我們就可以在創造他的時候就分配好空間,而後他" -"的儲存空間需求就是固定不變的。這也是元組 (tuple) 和串列 (list) 相異的其中一" -"個原因。" +"的儲存空間需求就是固定不變的。這也是元組 (tuple) 和串列 (list) 相異的其中一個" +"原因。" #: ../../faq/design.rst:104 msgid "" @@ -382,9 +382,9 @@ msgid "" "on names bound to strings there is no logical reason to make them " "unavailable on literals." msgstr "" -"第一項這麼說:「用字串文本 (string literal) (字串常數)看起來真的很醜」,也許真的" -"如此,但字串文本就只是一個固定值。如果方法可以用在值為字串的變數上," -"那沒道理字串文本不能被使用。" +"第一項這麼說:「用字串文本 (string literal) (字串常數)看起來真的很醜」,也" +"許真的如此,但字串文本就只是一個固定值。如果方法可以用在值為字串的變數上,那" +"沒道理字串文本不能被使用。" #: ../../faq/design.rst:215 msgid "" @@ -591,15 +591,14 @@ msgstr "" #: ../../faq/design.rst:341 msgid "" "Other implementations (such as `Jython `_ or `PyPy " -"`_), however, can rely on a different mechanism such as " -"a full-blown garbage collector. This difference can cause some subtle " +"`_), however, can rely on a different mechanism such " +"as a full-blown garbage collector. This difference can cause some subtle " "porting problems if your Python code depends on the behavior of the " "reference counting implementation." msgstr "" "然而,在其他實作(像是 `Jython `_ 或 `PyPy `_)中,會使用像是成熟的垃圾收集器等不同機制。如果你的 Python 程" -"式碼的表現取決於參照計次的實作,這個相異處會導致一些微" -"小的移植問題。" +"式碼的表現取決於參照計次的實作,這個相異處會導致一些微小的移植問題。" #: ../../faq/design.rst:347 msgid "" @@ -618,9 +617,9 @@ msgid "" "those file objects will only get collected (and closed) at varying and " "possibly long intervals." msgstr "" -"實際上,使用 CPython 的參照計次和解構方案 (destructor " -"scheme),每個對\\ *f*\\ 的新指派都會關閉前面打開的檔案。然而用傳統的垃圾回收 " -"(GC) 的話,這些檔案物件只會在不固定且有可能很長的時間後被收集(並關閉)。" +"實際上,使用 CPython 的參照計次和解構方案 (destructor scheme),每個對\\ *f*" +"\\ 的新指派都會關閉前面打開的檔案。然而用傳統的垃圾回收 (GC) 的話,這些檔案物" +"件只會在不固定且有可能很長的時間後被收集(並關閉)。" #: ../../faq/design.rst:359 msgid "" @@ -705,9 +704,9 @@ msgid "" "numbers." msgstr "" "串列和元組在很多方面相當相似,但通常用在完全不同的地方。元組可以想成 Pascal " -"的紀錄 (record) 或是 C 的結構 (struct),是一小群相關聯但可能是不同型別的資" -"料集合,以一組為單位進行操作。舉例來說,一個笛卡兒坐標系可以適當地表示成一個" -"有二或三個值的元組。" +"的紀錄 (record) 或是 C 的結構 (struct),是一小群相關聯但可能是不同型別的資料" +"集合,以一組為單位進行操作。舉例來說,一個笛卡兒坐標系可以適當地表示成一個有" +"二或三個值的元組。" #: ../../faq/design.rst:409 msgid "" @@ -746,8 +745,8 @@ msgid "" "head structure." msgstr "" "CPython 的串列 (list) 事實上是可變長度的陣列 (array),而不是像 Lisp 語言的鏈" -"接串列 (linked list)。實作上,他是一個連續的物件參照 (reference) 陣列,並把" -"指向此陣列的指標 (pointer) 和陣列長度存在串列的標頭結構內。" +"接串列 (linked list)。實作上,他是一個連續的物件參照 (reference) 陣列,並把指" +"向此陣列的指標 (pointer) 和陣列長度存在串列的標頭結構內。" #: ../../faq/design.rst:429 msgid "" @@ -794,9 +793,9 @@ msgid "" msgstr "" "字典利用內建 :func:`hash` 函式,對每個鍵做雜湊計算。雜湊結果依據鍵的值和個別" "執行緒 (processes) 的種子而有相當大的差距。例如,\"Python\" 的雜湊是 " -"-539294296,而只差一個字的 \"python\" 則是 1142331976。雜湊結果接著被用來計算值" -"在內部陣列儲存的位置。假設你存的鍵都有不同的雜湊值,那字典只需要常數時間 — 用" -"大 O 表示法 (Big-O notation) 就是 O(1) — 來找任意一個鍵。" +"-539294296,而只差一個字的 \"python\" 則是 1142331976。雜湊結果接著被用來計算" +"值在內部陣列儲存的位置。假設你存的鍵都有不同的雜湊值,那字典只需要常數時間 — " +"用大 O 表示法 (Big-O notation) 就是 O(1) — 來找任意一個鍵。" #: ../../faq/design.rst:456 msgid "Why must dictionary keys be immutable?" @@ -990,11 +989,10 @@ msgid "" "`~collections.abc.MutableMapping`." msgstr "" "Python 2.6 加入了 :mod:`abc` 模組,讓你可以定義抽象基底類別 (Abstract Base " -"Class, ABC)。你可以使用 :func:`isinstance` 和 :func:`issubclass` 來確認一" -"個實例或是類別是否實作了某個抽象基底類別。而 :mod:`collections." -"abc` 模組定義了一系列好用的抽象基底類別,像是 :class:`~collections.abc." -"Iterable`、:class:`~collections.abc.Container` 和 :class:`~collections.abc." -"MutableMapping`。" +"Class, ABC)。你可以使用 :func:`isinstance` 和 :func:`issubclass` 來確認一個實" +"例或是類別是否實作了某個抽象基底類別。而 :mod:`collections.abc` 模組定義了一" +"系列好用的抽象基底類別,像是 :class:`~collections.abc.Iterable`、:class:" +"`~collections.abc.Container` 和 :class:`~collections.abc.MutableMapping`。" #: ../../faq/design.rst:570 msgid "" @@ -1229,9 +1227,9 @@ msgid "" "iterator run to completion, no closing is needed. When it is, wrap it as " "\"contextlib.closing(generator)\" in the 'with' statement." msgstr "" -"出於技術原因,把產生器直接用作情境 (context) 管理器會無法正常運作。因為通常" -"來說,產生器是被當成疊代器 (iterator),到最後完成時不需要被手動關閉。但如果你" -"需要的話,你可以在 with 陳述式裡用「contextlib.closing(generator)」來包裝他。" +"出於技術原因,把產生器直接用作情境 (context) 管理器會無法正常運作。因為通常來" +"說,產生器是被當成疊代器 (iterator),到最後完成時不需要被手動關閉。但如果你需" +"要的話,你可以在 with 陳述式裡用「contextlib.closing(generator)」來包裝他。" #: ../../faq/design.rst:717 msgid "Why are colons required for the if/while/def/class statements?" diff --git a/faq/extending.po b/faq/extending.po index 96c85e4a7e..0b69f6a4d4 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-27 07:52+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -65,7 +65,7 @@ msgstr "" #: ../../faq/extending.rst:44 msgid "" -"`Cython `_ and its relative `Pyrex `_ and its relative `Pyrex `_ are compilers that accept a " "slightly modified form of Python and generate the corresponding C code. " "Cython and Pyrex make it possible to write an extension without having to " @@ -76,9 +76,9 @@ msgstr "" msgid "" "If you need to interface to some C or C++ library for which no Python " "extension currently exists, you can try wrapping the library's data types " -"and functions with a tool such as `SWIG `_. `SIP " +"and functions with a tool such as `SWIG `_. `SIP " "`__, `CXX `_ `Boost `_ `Boost `_, or `Weave `_ are also alternatives " "for wrapping C++ libraries." msgstr "" @@ -358,7 +358,7 @@ msgstr "" #: ../../faq/extending.rst:289 msgid "" -"The Boost Python Library (BPL, http://www.boost.org/libs/python/doc/index." +"The Boost Python Library (BPL, https://www.boost.org/libs/python/doc/index." "html) provides a way of doing this from C++ (i.e. you can inherit from an " "extension class written in C++ using the BPL)." msgstr "" diff --git a/faq/general.po b/faq/general.po index 7f298644fd..25aca14fb0 100644 --- a/faq/general.po +++ b/faq/general.po @@ -661,8 +661,8 @@ msgstr "" #: ../../faq/general.rst:337 msgid "" "High-profile Python projects include `the Mailman mailing list manager " -"`_ and `the Zope application server `_. Several Linux distributions, most notably `Red Hat `_ and `the Zope application server `_. Several Linux distributions, most notably `Red Hat `_, have written part or all of their installer and system " "administration software in Python. Companies that use Python internally " "include Google, Yahoo, and Lucasfilm Ltd." diff --git a/faq/programming.po b/faq/programming.po index e39a58a296..a9619f17d1 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -173,8 +173,8 @@ msgid "`Nuitka `_ (Cross-platform)" msgstr "`Nuitka `_\\ (跨平台)" #: ../../faq/programming.rst:98 -msgid "`PyInstaller `_ (Cross-platform)" -msgstr "`PyInstaller `_\\ (跨平台)" +msgid "`PyInstaller `_ (Cross-platform)" +msgstr "`PyInstaller `_\\ (跨平台)" #: ../../faq/programming.rst:99 msgid "" @@ -1207,7 +1207,7 @@ msgstr "" #: ../../faq/programming.rst:1068 msgid "" "If you have reached the limit of what pure Python can allow, there are tools " -"to take you further away. For example, `Cython `_ can " +"to take you further away. For example, `Cython `_ can " "compile a slightly modified version of Python code into a C extension, and " "can be used on many different platforms. Cython can take advantage of " "compilation (and optional type annotations) to make your code significantly " diff --git a/glossary.po b/glossary.po index be7a841c4f..0c0cc29f09 100644 --- a/glossary.po +++ b/glossary.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" -"PO-Revision-Date: 2022-06-09 21:52+0800\n" +"POT-Creation-Date: 2022-08-12 00:15+0000\n" +"PO-Revision-Date: 2022-08-31 22:55+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1\n" +"X-Generator: Poedit 3.1.1\n" #: ../../glossary.rst:5 msgid "Glossary" @@ -1292,12 +1292,12 @@ msgstr "IDLE" #: ../../glossary.rst:579 msgid "" -"An Integrated Development Environment for Python. IDLE is a basic editor " -"and interpreter environment which ships with the standard distribution of " -"Python." +"An Integrated Development and Learning Environment for Python. :ref:`idle` " +"is a basic editor and interpreter environment which ships with the standard " +"distribution of Python." msgstr "" -"Python 的 Integrated Development Environment(整合開發環境)。IDLE 是一個基本" -"的編輯器和直譯器環境,它和 Python 的標準發行版本一起被提供。" +"Python 的 Integrated Development Environment(整合開發與學習環境)。:ref:" +"`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本一起被提供。" #: ../../glossary.rst:582 msgid "immutable" @@ -1568,7 +1568,7 @@ msgid "" msgstr "" "由單一 :term:`expression`\\ (運算式)所組成的一個匿名行內函式 (inline " "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " -"[parameters]: expression``\\ 。" +"[parameters]: expression``" #: ../../glossary.rst:705 msgid "LBYL" diff --git a/howto/curses.po b/howto/curses.po index 6e4246f02f..939fb12b39 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-03 00:13+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -710,7 +710,7 @@ msgstr "" #: ../../howto/curses.rst:540 msgid "" -"`Writing Programs with NCURSES `_: a lengthy tutorial for C programmers." msgstr "" @@ -720,9 +720,9 @@ msgstr "`ncurses 使用者手冊 `_" #: ../../howto/curses.rst:543 msgid "" -"`The ncurses FAQ `_" +"`The ncurses FAQ `_" msgstr "" -"`ncurses 問答集 `_" +"`ncurses 問答集 `_" #: ../../howto/curses.rst:544 msgid "" @@ -733,7 +733,7 @@ msgstr "" #: ../../howto/curses.rst:546 msgid "" -"`\"Console Applications with Urwid\" `_: video of a PyCon CA 2012 talk " -"demonstrating some applications written using Urwid." +"`\"Console Applications with Urwid\" `_: video of a PyCon CA 2012 talk demonstrating some " +"applications written using Urwid." msgstr "" diff --git a/howto/descriptor.po b/howto/descriptor.po index de4536043e..34d0244055 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-20 05:59+0000\n" +"POT-Creation-Date: 2022-08-20 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -518,14 +518,14 @@ msgid "" "is a pure Python equivalent:" msgstr "" -#: ../../howto/descriptor.rst:699 +#: ../../howto/descriptor.rst:719 msgid "" "Note, there is no :meth:`__getattr__` hook in the :meth:`__getattribute__` " "code. That is why calling :meth:`__getattribute__` directly or with " "``super().__getattribute__`` will bypass :meth:`__getattr__` entirely." msgstr "" -#: ../../howto/descriptor.rst:703 +#: ../../howto/descriptor.rst:723 msgid "" "Instead, it is the dot operator and the :func:`getattr` function that are " "responsible for invoking :meth:`__getattr__` whenever :meth:" @@ -533,11 +533,11 @@ msgid "" "encapsulated in a helper function:" msgstr "" -#: ../../howto/descriptor.rst:753 +#: ../../howto/descriptor.rst:773 msgid "Invocation from a class" msgstr "" -#: ../../howto/descriptor.rst:755 +#: ../../howto/descriptor.rst:775 msgid "" "The logic for a dotted lookup such as ``A.x`` is in :meth:`type." "__getattribute__`. The steps are similar to those for :meth:`object." @@ -545,27 +545,27 @@ msgid "" "through the class's :term:`method resolution order`." msgstr "" -#: ../../howto/descriptor.rst:760 +#: ../../howto/descriptor.rst:780 msgid "If a descriptor is found, it is invoked with ``desc.__get__(None, A)``." msgstr "" -#: ../../howto/descriptor.rst:762 +#: ../../howto/descriptor.rst:782 msgid "" "The full C implementation can be found in :c:func:`type_getattro()` and :c:" "func:`_PyType_Lookup()` in :source:`Objects/typeobject.c`." msgstr "" -#: ../../howto/descriptor.rst:767 +#: ../../howto/descriptor.rst:787 msgid "Invocation from super" msgstr "" -#: ../../howto/descriptor.rst:769 +#: ../../howto/descriptor.rst:789 msgid "" "The logic for super's dotted lookup is in the :meth:`__getattribute__` " "method for object returned by :class:`super()`." msgstr "" -#: ../../howto/descriptor.rst:772 +#: ../../howto/descriptor.rst:792 msgid "" "A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__." "__mro__`` for the base class ``B`` immediately following ``A`` and then " @@ -573,7 +573,7 @@ msgid "" "returned unchanged." msgstr "" -#: ../../howto/descriptor.rst:777 +#: ../../howto/descriptor.rst:797 msgid "" "The full C implementation can be found in :c:func:`super_getattro()` in :" "source:`Objects/typeobject.c`. A pure Python equivalent can be found in " @@ -581,37 +581,37 @@ msgid "" "#cooperation>`_." msgstr "" -#: ../../howto/descriptor.rst:784 +#: ../../howto/descriptor.rst:804 msgid "Summary of invocation logic" msgstr "" -#: ../../howto/descriptor.rst:786 +#: ../../howto/descriptor.rst:806 msgid "" "The mechanism for descriptors is embedded in the :meth:`__getattribute__()` " "methods for :class:`object`, :class:`type`, and :func:`super`." msgstr "" -#: ../../howto/descriptor.rst:789 +#: ../../howto/descriptor.rst:809 msgid "The important points to remember are:" msgstr "" -#: ../../howto/descriptor.rst:791 +#: ../../howto/descriptor.rst:811 msgid "Descriptors are invoked by the :meth:`__getattribute__` method." msgstr "" -#: ../../howto/descriptor.rst:793 +#: ../../howto/descriptor.rst:813 msgid "" "Classes inherit this machinery from :class:`object`, :class:`type`, or :func:" "`super`." msgstr "" -#: ../../howto/descriptor.rst:796 +#: ../../howto/descriptor.rst:816 msgid "" "Overriding :meth:`__getattribute__` prevents automatic descriptor calls " "because all the descriptor logic is in that method." msgstr "" -#: ../../howto/descriptor.rst:799 +#: ../../howto/descriptor.rst:819 msgid "" ":meth:`object.__getattribute__` and :meth:`type.__getattribute__` make " "different calls to :meth:`__get__`. The first includes the instance and may " @@ -619,19 +619,19 @@ msgid "" "includes the class." msgstr "" -#: ../../howto/descriptor.rst:804 +#: ../../howto/descriptor.rst:824 msgid "Data descriptors always override instance dictionaries." msgstr "" -#: ../../howto/descriptor.rst:806 +#: ../../howto/descriptor.rst:826 msgid "Non-data descriptors may be overridden by instance dictionaries." msgstr "" -#: ../../howto/descriptor.rst:810 +#: ../../howto/descriptor.rst:830 msgid "Automatic name notification" msgstr "" -#: ../../howto/descriptor.rst:812 +#: ../../howto/descriptor.rst:832 msgid "" "Sometimes it is desirable for a descriptor to know what class variable name " "it was assigned to. When a new class is created, the :class:`type` " @@ -641,59 +641,59 @@ msgid "" "and the *name* is the class variable the descriptor was assigned to." msgstr "" -#: ../../howto/descriptor.rst:819 +#: ../../howto/descriptor.rst:839 msgid "" "The implementation details are in :c:func:`type_new()` and :c:func:" "`set_names()` in :source:`Objects/typeobject.c`." msgstr "" -#: ../../howto/descriptor.rst:822 +#: ../../howto/descriptor.rst:842 msgid "" "Since the update logic is in :meth:`type.__new__`, notifications only take " "place at the time of class creation. If descriptors are added to the class " "afterwards, :meth:`__set_name__` will need to be called manually." msgstr "" -#: ../../howto/descriptor.rst:828 +#: ../../howto/descriptor.rst:848 msgid "ORM example" msgstr "ORM 範例" -#: ../../howto/descriptor.rst:830 +#: ../../howto/descriptor.rst:850 msgid "" "The following code is simplified skeleton showing how data descriptors could " "be used to implement an `object relational mapping `_." msgstr "" -#: ../../howto/descriptor.rst:834 +#: ../../howto/descriptor.rst:854 msgid "" "The essential idea is that the data is stored in an external database. The " "Python instances only hold keys to the database's tables. Descriptors take " "care of lookups or updates:" msgstr "" -#: ../../howto/descriptor.rst:853 +#: ../../howto/descriptor.rst:873 msgid "" "We can use the :class:`Field` class to define `models `_ that describe the schema for each table in a " "database:" msgstr "" -#: ../../howto/descriptor.rst:878 +#: ../../howto/descriptor.rst:898 msgid "To use the models, first connect to the database::" msgstr "" -#: ../../howto/descriptor.rst:883 +#: ../../howto/descriptor.rst:903 msgid "" "An interactive session shows how data is retrieved from the database and how " "it can be updated:" msgstr "" -#: ../../howto/descriptor.rst:928 +#: ../../howto/descriptor.rst:948 msgid "Pure Python Equivalents" msgstr "" -#: ../../howto/descriptor.rst:930 +#: ../../howto/descriptor.rst:950 msgid "" "The descriptor protocol is simple and offers exciting possibilities. " "Several use cases are so common that they have been prepackaged into built-" @@ -701,36 +701,36 @@ msgid "" "\\_slots\\_\\_ are all based on the descriptor protocol." msgstr "" -#: ../../howto/descriptor.rst:937 +#: ../../howto/descriptor.rst:957 msgid "Properties" msgstr "" -#: ../../howto/descriptor.rst:939 +#: ../../howto/descriptor.rst:959 msgid "" "Calling :func:`property` is a succinct way of building a data descriptor " "that triggers a function call upon access to an attribute. Its signature " "is::" msgstr "" -#: ../../howto/descriptor.rst:944 +#: ../../howto/descriptor.rst:964 msgid "" "The documentation shows a typical use to define a managed attribute ``x``:" msgstr "" -#: ../../howto/descriptor.rst:968 +#: ../../howto/descriptor.rst:988 msgid "" "To see how :func:`property` is implemented in terms of the descriptor " "protocol, here is a pure Python equivalent:" msgstr "" -#: ../../howto/descriptor.rst:1071 +#: ../../howto/descriptor.rst:1091 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " "attribute access and then subsequent changes require the intervention of a " "method." msgstr "" -#: ../../howto/descriptor.rst:1075 +#: ../../howto/descriptor.rst:1095 msgid "" "For instance, a spreadsheet class may grant access to a cell value through " "``Cell('b10').value``. Subsequent improvements to the program require the " @@ -740,23 +740,23 @@ msgid "" "descriptor:" msgstr "" -#: ../../howto/descriptor.rst:1092 +#: ../../howto/descriptor.rst:1112 msgid "" "Either the built-in :func:`property` or our :func:`Property` equivalent " "would work in this example." msgstr "" -#: ../../howto/descriptor.rst:1097 +#: ../../howto/descriptor.rst:1117 msgid "Functions and methods" msgstr "" -#: ../../howto/descriptor.rst:1099 +#: ../../howto/descriptor.rst:1119 msgid "" "Python's object oriented features are built upon a function based " "environment. Using non-data descriptors, the two are merged seamlessly." msgstr "" -#: ../../howto/descriptor.rst:1102 +#: ../../howto/descriptor.rst:1122 msgid "" "Functions stored in class dictionaries get turned into methods when invoked. " "Methods only differ from regular functions in that the object instance is " @@ -764,13 +764,13 @@ msgid "" "*self* but could be called *this* or any other variable name." msgstr "" -#: ../../howto/descriptor.rst:1107 +#: ../../howto/descriptor.rst:1127 msgid "" "Methods can be created manually with :class:`types.MethodType` which is " "roughly equivalent to:" msgstr "" -#: ../../howto/descriptor.rst:1124 +#: ../../howto/descriptor.rst:1144 msgid "" "To support automatic creation of methods, functions include the :meth:" "`__get__` method for binding methods during attribute access. This means " @@ -778,58 +778,58 @@ msgid "" "dotted lookup from an instance. Here's how it works:" msgstr "" -#: ../../howto/descriptor.rst:1140 +#: ../../howto/descriptor.rst:1160 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" msgstr "" -#: ../../howto/descriptor.rst:1149 +#: ../../howto/descriptor.rst:1169 msgid "" "The function has a :term:`qualified name` attribute to support introspection:" msgstr "" -#: ../../howto/descriptor.rst:1156 +#: ../../howto/descriptor.rst:1176 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" "`__get__`. Instead, it just returns the underlying function object::" msgstr "" -#: ../../howto/descriptor.rst:1162 +#: ../../howto/descriptor.rst:1182 msgid "" "Dotted access from a class calls :meth:`__get__` which just returns the " "underlying function unchanged::" msgstr "" -#: ../../howto/descriptor.rst:1168 +#: ../../howto/descriptor.rst:1188 msgid "" "The interesting behavior occurs during dotted access from an instance. The " "dotted lookup calls :meth:`__get__` which returns a bound method object::" msgstr "" -#: ../../howto/descriptor.rst:1175 +#: ../../howto/descriptor.rst:1195 msgid "" "Internally, the bound method stores the underlying function and the bound " "instance::" msgstr "" -#: ../../howto/descriptor.rst:1184 +#: ../../howto/descriptor.rst:1204 msgid "" "If you have ever wondered where *self* comes from in regular methods or " "where *cls* comes from in class methods, this is it!" msgstr "" -#: ../../howto/descriptor.rst:1189 +#: ../../howto/descriptor.rst:1209 msgid "Kinds of methods" msgstr "" -#: ../../howto/descriptor.rst:1191 +#: ../../howto/descriptor.rst:1211 msgid "" "Non-data descriptors provide a simple mechanism for variations on the usual " "patterns of binding functions into methods." msgstr "" -#: ../../howto/descriptor.rst:1194 +#: ../../howto/descriptor.rst:1214 msgid "" "To recap, functions have a :meth:`__get__` method so that they can be " "converted to a method when accessed as attributes. The non-data descriptor " @@ -837,55 +837,55 @@ msgid "" "f(*args)`` becomes ``f(*args)``." msgstr "" -#: ../../howto/descriptor.rst:1199 +#: ../../howto/descriptor.rst:1219 msgid "This chart summarizes the binding and its two most useful variants:" msgstr "" -#: ../../howto/descriptor.rst:1202 +#: ../../howto/descriptor.rst:1222 msgid "Transformation" msgstr "" -#: ../../howto/descriptor.rst:1202 +#: ../../howto/descriptor.rst:1222 msgid "Called from an object" msgstr "" -#: ../../howto/descriptor.rst:1202 +#: ../../howto/descriptor.rst:1222 msgid "Called from a class" msgstr "" -#: ../../howto/descriptor.rst:1205 +#: ../../howto/descriptor.rst:1225 msgid "function" msgstr "函式" -#: ../../howto/descriptor.rst:1205 +#: ../../howto/descriptor.rst:1225 msgid "f(obj, \\*args)" msgstr "f(obj, \\*args)" -#: ../../howto/descriptor.rst:1205 ../../howto/descriptor.rst:1207 +#: ../../howto/descriptor.rst:1225 ../../howto/descriptor.rst:1227 msgid "f(\\*args)" msgstr "f(\\*args)" -#: ../../howto/descriptor.rst:1207 +#: ../../howto/descriptor.rst:1227 msgid "staticmethod" msgstr "staticmethod" -#: ../../howto/descriptor.rst:1209 +#: ../../howto/descriptor.rst:1229 msgid "classmethod" msgstr "classmethod" -#: ../../howto/descriptor.rst:1209 +#: ../../howto/descriptor.rst:1229 msgid "f(type(obj), \\*args)" msgstr "f(type(obj), \\*args)" -#: ../../howto/descriptor.rst:1209 +#: ../../howto/descriptor.rst:1229 msgid "f(cls, \\*args)" msgstr "f(cls, \\*args)" -#: ../../howto/descriptor.rst:1214 +#: ../../howto/descriptor.rst:1234 msgid "Static methods" msgstr "" -#: ../../howto/descriptor.rst:1216 +#: ../../howto/descriptor.rst:1236 msgid "" "Static methods return the underlying function without changes. Calling " "either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object." @@ -894,13 +894,13 @@ msgid "" "a class." msgstr "" -#: ../../howto/descriptor.rst:1222 +#: ../../howto/descriptor.rst:1242 msgid "" "Good candidates for static methods are methods that do not reference the " "``self`` variable." msgstr "" -#: ../../howto/descriptor.rst:1225 +#: ../../howto/descriptor.rst:1245 msgid "" "For instance, a statistics package may include a container class for " "experimental data. The class provides normal methods for computing the " @@ -912,30 +912,30 @@ msgid "" "``s.erf(1.5) --> .9332`` or ``Sample.erf(1.5) --> .9332``." msgstr "" -#: ../../howto/descriptor.rst:1234 +#: ../../howto/descriptor.rst:1254 msgid "" "Since static methods return the underlying function with no changes, the " "example calls are unexciting:" msgstr "" -#: ../../howto/descriptor.rst:1251 +#: ../../howto/descriptor.rst:1271 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`staticmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1290 +#: ../../howto/descriptor.rst:1310 msgid "Class methods" msgstr "" -#: ../../howto/descriptor.rst:1292 +#: ../../howto/descriptor.rst:1312 msgid "" "Unlike static methods, class methods prepend the class reference to the " "argument list before calling the function. This format is the same for " "whether the caller is an object or a class:" msgstr "" -#: ../../howto/descriptor.rst:1310 +#: ../../howto/descriptor.rst:1330 msgid "" "This behavior is useful whenever the method only needs to have a class " "reference and does not rely on data stored in a specific instance. One use " @@ -944,17 +944,17 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" -#: ../../howto/descriptor.rst:1327 +#: ../../howto/descriptor.rst:1347 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" -#: ../../howto/descriptor.rst:1337 +#: ../../howto/descriptor.rst:1357 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1386 +#: ../../howto/descriptor.rst:1406 msgid "" "The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " "3.9 and makes it possible for :func:`classmethod` to support chained " @@ -962,30 +962,30 @@ msgid "" "together:" msgstr "" -#: ../../howto/descriptor.rst:1406 +#: ../../howto/descriptor.rst:1426 msgid "Member objects and __slots__" msgstr "" -#: ../../howto/descriptor.rst:1408 +#: ../../howto/descriptor.rst:1428 msgid "" "When a class defines ``__slots__``, it replaces instance dictionaries with a " "fixed-length array of slot values. From a user point of view that has " "several effects:" msgstr "" -#: ../../howto/descriptor.rst:1412 +#: ../../howto/descriptor.rst:1432 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" -#: ../../howto/descriptor.rst:1428 +#: ../../howto/descriptor.rst:1448 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" -#: ../../howto/descriptor.rst:1463 +#: ../../howto/descriptor.rst:1483 msgid "" "3. Saves memory. On a 64-bit Linux build, an instance with two attributes " "takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " @@ -993,19 +993,19 @@ msgid "" "only matters when a large number of instances are going to be created." msgstr "" -#: ../../howto/descriptor.rst:1468 +#: ../../howto/descriptor.rst:1488 msgid "" "4. Improves speed. Reading instance variables is 35% faster with " "``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." msgstr "" -#: ../../howto/descriptor.rst:1471 +#: ../../howto/descriptor.rst:1491 msgid "" "5. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -#: ../../howto/descriptor.rst:1493 +#: ../../howto/descriptor.rst:1513 msgid "" "It is not possible to create an exact drop-in pure Python version of " "``__slots__`` because it requires direct access to C structures and control " @@ -1015,36 +1015,36 @@ msgid "" "managed by member descriptors:" msgstr "" -#: ../../howto/descriptor.rst:1536 +#: ../../howto/descriptor.rst:1556 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" -#: ../../howto/descriptor.rst:1552 +#: ../../howto/descriptor.rst:1572 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " "slots instead of an instance dictionary. Here is a rough simulation in pure " "Python:" msgstr "" -#: ../../howto/descriptor.rst:1587 +#: ../../howto/descriptor.rst:1607 msgid "" "To use the simulation in a real class, just inherit from :class:`Object` and " "set the :term:`metaclass` to :class:`Type`:" msgstr "" -#: ../../howto/descriptor.rst:1601 +#: ../../howto/descriptor.rst:1621 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: ../../howto/descriptor.rst:1622 +#: ../../howto/descriptor.rst:1642 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: ../../howto/descriptor.rst:1634 +#: ../../howto/descriptor.rst:1654 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" diff --git a/howto/functional.po b/howto/functional.po index f30172f982..314ad47267 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1317,7 +1317,7 @@ msgstr "" #: ../../howto/functional.rst:1218 msgid "" -"http://www.defmacro.org/ramblings/fp.html: A general introduction to " +"https://www.defmacro.org/ramblings/fp.html: A general introduction to " "functional programming that uses Java examples and has a lengthy historical " "introduction." msgstr "" @@ -1343,7 +1343,7 @@ msgstr "" #: ../../howto/functional.rst:1231 msgid "" -"http://gnosis.cx/TPiP/: The first chapter of David Mertz's book :title-" +"https://gnosis.cx/TPiP/: The first chapter of David Mertz's book :title-" "reference:`Text Processing in Python` discusses functional programming for " "text processing, in the section titled \"Utilizing Higher-Order Functions in " "Text Processing\"." diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index df01a330e1..9e6e455218 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-16 00:17+0000\n" +"POT-Creation-Date: 2022-08-28 00:21+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -849,27 +849,27 @@ msgid "" "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1630 ../../howto/logging-cookbook.rst:3430 +#: ../../howto/logging-cookbook.rst:1630 ../../howto/logging-cookbook.rst:3512 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:1630 ../../howto/logging-cookbook.rst:3430 +#: ../../howto/logging-cookbook.rst:1630 ../../howto/logging-cookbook.rst:3512 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1633 ../../howto/logging-cookbook.rst:3433 +#: ../../howto/logging-cookbook.rst:1633 ../../howto/logging-cookbook.rst:3515 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:1633 ../../howto/logging-cookbook.rst:3433 +#: ../../howto/logging-cookbook.rst:1633 ../../howto/logging-cookbook.rst:3515 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1636 ../../howto/logging-cookbook.rst:3436 +#: ../../howto/logging-cookbook.rst:1636 ../../howto/logging-cookbook.rst:3518 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:1636 ../../howto/logging-cookbook.rst:3436 +#: ../../howto/logging-cookbook.rst:1636 ../../howto/logging-cookbook.rst:3518 msgid "Useful handlers included with the logging module." msgstr "" @@ -1417,16 +1417,39 @@ msgid "You can of course use the conventional means of decoration::" msgstr "" #: ../../howto/logging-cookbook.rst:2684 -msgid "Formatting times using UTC (GMT) via configuration" +msgid "Sending logging messages to email, with buffering" msgstr "" #: ../../howto/logging-cookbook.rst:2686 msgid "" +"To illustrate how you can send log messages via email, so that a set number " +"of messages are sent per email, you can subclass :class:`~logging.handlers." +"BufferingHandler`. In the following example, which you can adapt to suit " +"your specific needs, a simple test harness is provided which allows you to " +"run the script with command line arguments specifying what you typically " +"need to send things via SMTP. (Run the downloaded script with the ``-h`` " +"argument to see the required and optional arguments.)" +msgstr "" + +#: ../../howto/logging-cookbook.rst:2758 +msgid "" +"If you run this script and your SMTP server is correctly set up, you should " +"find that it sends eleven emails to the addressee you specify. The first ten " +"emails will each have ten log messages, and the eleventh will have two " +"messages. That makes up 102 messages as specified in the script." +msgstr "" + +#: ../../howto/logging-cookbook.rst:2766 +msgid "Formatting times using UTC (GMT) via configuration" +msgstr "" + +#: ../../howto/logging-cookbook.rst:2768 +msgid "" "Sometimes you want to format times using UTC, which can be done using a " "class such as `UTCFormatter`, shown below::" msgstr "" -#: ../../howto/logging-cookbook.rst:2695 +#: ../../howto/logging-cookbook.rst:2777 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" "`~logging.Formatter`. If you want to do that via configuration, you can use " @@ -1434,21 +1457,21 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2738 +#: ../../howto/logging-cookbook.rst:2820 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:2745 +#: ../../howto/logging-cookbook.rst:2827 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:2752 +#: ../../howto/logging-cookbook.rst:2834 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2754 +#: ../../howto/logging-cookbook.rst:2836 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -1458,7 +1481,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:2787 +#: ../../howto/logging-cookbook.rst:2869 msgid "" "If you specify a level value, the logger's level is set to that value in the " "scope of the with block covered by the context manager. If you specify a " @@ -1467,13 +1490,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:2793 +#: ../../howto/logging-cookbook.rst:2875 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:2811 +#: ../../howto/logging-cookbook.rst:2893 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " "message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " @@ -1486,56 +1509,56 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:2821 +#: ../../howto/logging-cookbook.rst:2903 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:2832 +#: ../../howto/logging-cookbook.rst:2914 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2840 +#: ../../howto/logging-cookbook.rst:2922 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:2850 +#: ../../howto/logging-cookbook.rst:2932 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:2852 +#: ../../howto/logging-cookbook.rst:2934 msgid "" "Of course, the approach described here can be generalised, for example to " "attach logging filters temporarily. Note that the above code works in Python " "2 as well as Python 3." msgstr "" -#: ../../howto/logging-cookbook.rst:2860 +#: ../../howto/logging-cookbook.rst:2942 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:2862 +#: ../../howto/logging-cookbook.rst:2944 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:2864 +#: ../../howto/logging-cookbook.rst:2946 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:2865 +#: ../../howto/logging-cookbook.rst:2947 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:2867 +#: ../../howto/logging-cookbook.rst:2949 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:2869 +#: ../../howto/logging-cookbook.rst:2951 msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " @@ -1546,53 +1569,53 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:2918 +#: ../../howto/logging-cookbook.rst:3000 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:2931 +#: ../../howto/logging-cookbook.rst:3013 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:2952 +#: ../../howto/logging-cookbook.rst:3034 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:2973 +#: ../../howto/logging-cookbook.rst:3055 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:2986 +#: ../../howto/logging-cookbook.rst:3068 msgid "" "The first word is the logging level, and the second word is the module or " "package name of the place where the event was logged." msgstr "" -#: ../../howto/logging-cookbook.rst:2989 +#: ../../howto/logging-cookbook.rst:3071 msgid "" "If we change the logging level, then we can change the information sent to " "the log. For example, if we want more information:" msgstr "" -#: ../../howto/logging-cookbook.rst:3006 +#: ../../howto/logging-cookbook.rst:3088 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3014 +#: ../../howto/logging-cookbook.rst:3096 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." msgstr "" -#: ../../howto/logging-cookbook.rst:3020 +#: ../../howto/logging-cookbook.rst:3102 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3022 +#: ../../howto/logging-cookbook.rst:3104 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" @@ -1600,7 +1623,7 @@ msgid "" "project/PySide2/>`_ or `PyQt5 `_ libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3028 +#: ../../howto/logging-cookbook.rst:3110 msgid "" "The following example shows how to log to a Qt GUI. This introduces a simple " "``QtHandler`` class which takes a callable, which should be a slot in the " @@ -1610,14 +1633,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3035 +#: ../../howto/logging-cookbook.rst:3117 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " "``QThread``, which offers better integration with other ``Qt`` components." msgstr "" -#: ../../howto/logging-cookbook.rst:3039 +#: ../../howto/logging-cookbook.rst:3121 msgid "" "The code should work with recent releases of either ``PySide2`` or " "``PyQt5``. You should be able to adapt the approach to earlier versions of " @@ -1625,11 +1648,11 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3253 +#: ../../howto/logging-cookbook.rst:3335 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3255 +#: ../../howto/logging-cookbook.rst:3337 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "detault to use the older :rfc:`3164`, which hails from 2001. When " @@ -1639,14 +1662,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3262 +#: ../../howto/logging-cookbook.rst:3344 msgid "" "RFC 5424 contains some useful features such as support for structured data, " "and if you need to be able to log to a syslog server with support for it, " "you can do so with a subclassed handler which looks something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3328 +#: ../../howto/logging-cookbook.rst:3410 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " "and it may be that you have slightly different needs (e.g. for how you pass " @@ -1655,11 +1678,11 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3345 +#: ../../howto/logging-cookbook.rst:3427 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3347 +#: ../../howto/logging-cookbook.rst:3429 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -1667,11 +1690,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3354 +#: ../../howto/logging-cookbook.rst:3436 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3356 +#: ../../howto/logging-cookbook.rst:3438 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -1679,32 +1702,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3361 +#: ../../howto/logging-cookbook.rst:3443 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -#: ../../howto/logging-cookbook.rst:3364 +#: ../../howto/logging-cookbook.rst:3446 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." msgstr "" -#: ../../howto/logging-cookbook.rst:3367 +#: ../../howto/logging-cookbook.rst:3449 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " "module, for example." msgstr "" -#: ../../howto/logging-cookbook.rst:3371 +#: ../../howto/logging-cookbook.rst:3453 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" msgstr "" -#: ../../howto/logging-cookbook.rst:3374 +#: ../../howto/logging-cookbook.rst:3456 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -1713,7 +1736,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3380 +#: ../../howto/logging-cookbook.rst:3462 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " @@ -1723,17 +1746,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:3387 +#: ../../howto/logging-cookbook.rst:3469 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3391 +#: ../../howto/logging-cookbook.rst:3473 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3393 +#: ../../howto/logging-cookbook.rst:3475 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -1744,12 +1767,12 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3403 +#: ../../howto/logging-cookbook.rst:3485 msgid "" "Adding handlers other than :class:`NullHandler` to a logger in a library" msgstr "" -#: ../../howto/logging-cookbook.rst:3405 +#: ../../howto/logging-cookbook.rst:3487 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -1757,11 +1780,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:3412 +#: ../../howto/logging-cookbook.rst:3494 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3414 +#: ../../howto/logging-cookbook.rst:3496 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " @@ -1772,14 +1795,14 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:3425 +#: ../../howto/logging-cookbook.rst:3507 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:3438 +#: ../../howto/logging-cookbook.rst:3520 msgid ":ref:`Basic Tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:3440 +#: ../../howto/logging-cookbook.rst:3522 msgid ":ref:`Advanced Tutorial `" msgstr "" diff --git a/howto/unicode.po b/howto/unicode.po index 08b1d20136..5f13f059d8 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -251,7 +251,7 @@ msgstr "" #: ../../howto/unicode.rst:169 msgid "" "To help understand the standard, Jukka Korpela has written `an introductory " -"guide `_ to reading the Unicode " +"guide `_ to reading the Unicode " "character tables." msgstr "" @@ -832,7 +832,7 @@ msgstr "" #: ../../howto/unicode.rst:737 msgid "" -"One section of `Mastering Python 3 Input/Output `_, a PyCon 2010 talk by David " "Beazley, discusses text processing and binary data handling." msgstr "" @@ -848,7 +848,7 @@ msgstr "" #: ../../howto/unicode.rst:747 msgid "" -"`The Guts of Unicode in Python `_ is a PyCon 2013 talk by Benjamin Peterson that " "discusses the internal Unicode representation in Python 3.3." msgstr "" diff --git a/howto/urllib2.po b/howto/urllib2.po index 3fc3feb0ab..4a3e5a39fb 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -375,7 +375,7 @@ msgstr "" #: ../../howto/urllib2.rst:413 msgid "" "Typical headers include 'Content-length', 'Content-type', and so on. See the " -"`Quick Reference to HTTP Headers `_ for a " +"`Quick Reference to HTTP Headers `_ for a " "useful listing of HTTP headers with brief explanations of their meaning and " "use." msgstr "" diff --git a/install/index.po b/install/index.po index 566b5c75de..a27304f7a8 100644 --- a/install/index.po +++ b/install/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1449,8 +1449,8 @@ msgstr "" #: ../../install/index.rst:1065 msgid "" -"`Building Python modules on MS Windows platform with MinGW `_" +"`Building Python modules on MS Windows platform with MinGW `_" msgstr "" #: ../../install/index.rst:1066 diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index b8a07461c2..c96c3e2044 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-19 00:13+0000\n" +"POT-Creation-Date: 2022-08-10 00:15+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -431,7 +431,8 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:335 msgid "" -"Schedule the execution of a :ref:`coroutine`. Return a :class:`Task` object." +"Schedule the execution of :ref:`coroutine ` *coro*. Return a :" +"class:`Task` object." msgstr "" #: ../../library/asyncio-eventloop.rst:338 diff --git a/library/difflib.po b/library/difflib.po index 3d70404350..ae0b82c3f4 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -406,14 +406,14 @@ msgstr "" #: ../../library/difflib.rst:357 msgid "" -"`Pattern Matching: The Gestalt Approach `_" msgstr "" #: ../../library/difflib.rst:357 msgid "" "Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " -"This was published in `Dr. Dobb's Journal `_ in " +"This was published in `Dr. Dobb's Journal `_ in " "July, 1988." msgstr "" diff --git a/library/functions.po b/library/functions.po index bb53d7004b..2045a69219 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-08-27 00:16+0000\n" "PO-Revision-Date: 2022-05-22 02:44+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -482,8 +482,8 @@ msgid "" "ways." msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" -#: ../../library/functions.rst:139 ../../library/functions.rst:804 -#: ../../library/functions.rst:1100 +#: ../../library/functions.rst:139 ../../library/functions.rst:806 +#: ../../library/functions.rst:1102 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" @@ -502,8 +502,8 @@ msgstr "" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " "``True`` 兩個實例(參見 :ref:`bltin-boolean-values`)。" -#: ../../library/functions.rst:153 ../../library/functions.rst:672 -#: ../../library/functions.rst:888 +#: ../../library/functions.rst:153 ../../library/functions.rst:674 +#: ../../library/functions.rst:890 msgid "*x* is now a positional-only parameter." msgstr "" @@ -516,16 +516,17 @@ msgid "" "so you don't have to explicitly import :mod:`pdb` or type as much code to " "enter the debugger. However, :func:`sys.breakpointhook` can be set to some " "other function and :func:`breakpoint` will automatically call that, allowing " -"you to drop into the debugger of choice." +"you to drop into the debugger of choice. If :func:`sys.breakpointhook` is " +"not accessible, this function will raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:168 +#: ../../library/functions.rst:170 msgid "" "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " "argument ``breakpointhook``." msgstr "" -#: ../../library/functions.rst:176 +#: ../../library/functions.rst:178 msgid "" "Return a new array of bytes. The :class:`bytearray` class is a mutable " "sequence of integers in the range 0 <= x < 256. It has most of the usual " @@ -537,13 +538,13 @@ msgstr "" "`typesseq-mutable` 中所述),同時也有 :class:`bytes` 型別大部分的 method,參" "見 :ref:`bytes-methods`。" -#: ../../library/functions.rst:181 +#: ../../library/functions.rst:183 msgid "" "The optional *source* parameter can be used to initialize the array in a few " "different ways:" msgstr "選擇性參數 *source* 可以被用來以不同的方式初始化陣列:" -#: ../../library/functions.rst:184 +#: ../../library/functions.rst:186 msgid "" "If it is a *string*, you must also give the *encoding* (and optionally, " "*errors*) parameters; :func:`bytearray` then converts the string to bytes " @@ -553,14 +554,14 @@ msgstr "" "*errors* );\\ :func:`bytearray` 會使用 :meth:`str.encode` method 來將 " "string 轉變成 bytes。" -#: ../../library/functions.rst:188 +#: ../../library/functions.rst:190 msgid "" "If it is an *integer*, the array will have that size and will be initialized " "with null bytes." msgstr "" "如果是一個 *integer*,陣列則會有該數值的長度,並以 null bytes 來當作初始值。" -#: ../../library/functions.rst:191 +#: ../../library/functions.rst:193 msgid "" "If it is an object conforming to the :ref:`buffer interface " "`, a read-only buffer of the object will be used to " @@ -569,7 +570,7 @@ msgstr "" "如果是一個符合 :ref:`buffer 介面 `\\ 的物件,該物件的唯讀 " "buffer 會被用來初始化 bytes 陣列。" -#: ../../library/functions.rst:194 +#: ../../library/functions.rst:196 msgid "" "If it is an *iterable*, it must be an iterable of integers in the range ``0 " "<= x < 256``, which are used as the initial contents of the array." @@ -577,15 +578,15 @@ msgstr "" "如果是一個 *iterable*,它的元素必須是範圍為 ``0 <= x < 256`` 的整數,並且會被" "用作陣列的初始值。" -#: ../../library/functions.rst:197 +#: ../../library/functions.rst:199 msgid "Without an argument, an array of size 0 is created." msgstr "如果沒有引數,則建立長度為 0 的陣列。" -#: ../../library/functions.rst:199 +#: ../../library/functions.rst:201 msgid "See also :ref:`binaryseq` and :ref:`typebytearray`." msgstr "可參考 :ref:`binaryseq` 和 :ref:`typebytearray`。" -#: ../../library/functions.rst:206 +#: ../../library/functions.rst:208 msgid "" "Return a new \"bytes\" object which is an immutable sequence of integers in " "the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :" @@ -596,20 +597,20 @@ msgstr "" "變序列。:class:`bytes` 是 :class:`bytearray` 的不可變版本 — 它的同樣具備不改" "變物件的 method,也有相同的索引和切片操作。" -#: ../../library/functions.rst:211 +#: ../../library/functions.rst:213 msgid "" "Accordingly, constructor arguments are interpreted as for :func:`bytearray`." msgstr "因此,建構函式的引數和 :func:`bytearray` 相同。" -#: ../../library/functions.rst:213 +#: ../../library/functions.rst:215 msgid "Bytes objects can also be created with literals, see :ref:`strings`." msgstr "Bytes 物件還可以用文字建立,參見 :ref:`strings`。" -#: ../../library/functions.rst:215 +#: ../../library/functions.rst:217 msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." msgstr "可參考 :ref:`binaryseq`、\\ :ref:`typebytes` 和 :ref:`bytes-methods`。" -#: ../../library/functions.rst:220 +#: ../../library/functions.rst:222 msgid "" "Return :const:`True` if the *object* argument appears callable, :const:" "`False` if not. If this returns ``True``, it is still possible that a call " @@ -622,13 +623,13 @@ msgstr "" "會失敗。注意 class 是可呼叫的(呼叫 class 會回傳一個新的實例);如果實例的 " "class 有定義 :meth:`__call__` method,則它是可呼叫的。" -#: ../../library/functions.rst:226 +#: ../../library/functions.rst:228 msgid "" "This function was first removed in Python 3.0 and then brought back in " "Python 3.2." msgstr "這個函式一開始在 Python 3.0 被移除,但在 Python 3.2 又被重新加入。" -#: ../../library/functions.rst:233 +#: ../../library/functions.rst:235 msgid "" "Return the string representing a character whose Unicode code point is the " "integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while " @@ -637,7 +638,7 @@ msgstr "" "回傳代表字元之 Unicode 編碼位置為整數 *i* 的字串。例如,``chr(97)`` 回傳字串 " "``'a'``,而 ``chr(8364)`` 回傳字串 ``'€'``。這是 :func:`ord` 的逆函式。" -#: ../../library/functions.rst:237 +#: ../../library/functions.rst:239 msgid "" "The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in " "base 16). :exc:`ValueError` will be raised if *i* is outside that range." @@ -645,11 +646,11 @@ msgstr "" "引數的有效範圍是 0 到 1,114,111(16 進制表示為 0x10FFFF)。如果 *i* 超過這個" "範圍,會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:243 +#: ../../library/functions.rst:245 msgid "Transform a method into a class method." msgstr "把一個 method 封裝成 class method(類別方法)。" -#: ../../library/functions.rst:245 +#: ../../library/functions.rst:247 msgid "" "A class method receives the class as an implicit first argument, just like " "an instance method receives the instance. To declare a class method, use " @@ -660,7 +661,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:253 +#: ../../library/functions.rst:255 msgid "" "The ``@classmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -668,7 +669,7 @@ msgstr "" "``@classmethod`` 語法是一個函式 :term:`decorator` — 參見 :ref:`function` 中關" "於函式定義的詳細介紹。" -#: ../../library/functions.rst:256 +#: ../../library/functions.rst:258 msgid "" "A class method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). The instance is ignored except for its " @@ -679,7 +680,7 @@ msgstr "" "叫。實例除了它的 class 資訊,其他都會被忽略。如果一個 class method 在 " "subclass 上呼叫,subclass 會作為第一個引數傳入。" -#: ../../library/functions.rst:261 +#: ../../library/functions.rst:263 msgid "" "Class methods are different than C++ or Java static methods. If you want " "those, see :func:`staticmethod` in this section. For more information on " @@ -689,20 +690,20 @@ msgstr "" "method,請看本節的 :func:`staticmethod`。關於 class method 的更多資訊,請參" "考 :ref:`types`。" -#: ../../library/functions.rst:265 +#: ../../library/functions.rst:267 msgid "" "Class methods can now wrap other :term:`descriptors ` such as :" "func:`property`." msgstr "" -#: ../../library/functions.rst:269 +#: ../../library/functions.rst:271 msgid "" "Class methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``) and " "have a new ``__wrapped__`` attribute." msgstr "" -#: ../../library/functions.rst:276 +#: ../../library/functions.rst:278 msgid "" "Compile the *source* into a code or AST object. Code objects can be " "executed by :func:`exec` or :func:`eval`. *source* can either be a normal " @@ -713,7 +714,7 @@ msgstr "" "`eval` 執行。*source* 可以是一般的字串、bytes 字串、或者 AST 物件。參見 :mod:" "`ast` module(模組)的文件瞭解如何使用 AST 物件。" -#: ../../library/functions.rst:281 +#: ../../library/functions.rst:283 msgid "" "The *filename* argument should give the file from which the code was read; " "pass some recognizable value if it wasn't read from a file (``''`` " @@ -722,7 +723,7 @@ msgstr "" "*filename* 引數必須是程式碼的檔名;如果程式碼不是從檔案中讀取,可以傳入一些可" "辨識的值(經常會使用 ``''`` 來替代)。" -#: ../../library/functions.rst:285 +#: ../../library/functions.rst:287 msgid "" "The *mode* argument specifies what kind of code must be compiled; it can be " "``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if " @@ -735,7 +736,7 @@ msgstr "" "式,可以是 ``'single'``(在最後一種情況下,如果運算式執行結果不是 ``None`` 則" "會被印出來)。" -#: ../../library/functions.rst:291 +#: ../../library/functions.rst:293 msgid "" "The optional arguments *flags* and *dont_inherit* control which :ref:" "`compiler options ` should be activated and which :ref:" @@ -749,7 +750,7 @@ msgid "" "in the surrounding code are ignored." msgstr "" -#: ../../library/functions.rst:302 +#: ../../library/functions.rst:304 msgid "" "Compiler options and future statements are specified by bits which can be " "bitwise ORed together to specify multiple options. The bitfield required to " @@ -764,7 +765,7 @@ msgstr "" "compiler_flag` 屬性來獲得。\\ :ref:`編譯器旗標 `\\ 可以" "在 :mod:`ast` module 中搜尋有 ``PyCF_`` 前綴的名稱。" -#: ../../library/functions.rst:310 +#: ../../library/functions.rst:312 msgid "" "The argument *optimize* specifies the optimization level of the compiler; " "the default value of ``-1`` selects the optimization level of the " @@ -777,7 +778,7 @@ msgstr "" "``__debug__`` 為真值)、\\ ``1``\\ (assert 被刪除,\\ ``__debug__`` 為假值)" "或 ``2``\\ (文件字串也被刪除)。" -#: ../../library/functions.rst:316 +#: ../../library/functions.rst:318 msgid "" "This function raises :exc:`SyntaxError` if the compiled source is invalid, " "and :exc:`ValueError` if the source contains null bytes." @@ -785,26 +786,26 @@ msgstr "" "如果編譯的原始碼無效,此函式會觸發 :exc:`SyntaxError`,如果原始碼包含 null " "bytes,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:319 +#: ../../library/functions.rst:321 msgid "" "If you want to parse Python code into its AST representation, see :func:`ast." "parse`." msgstr "如果您想解析 Python 程式碼為 AST 運算式,請參閱 :func:`ast.parse`。" -#: ../../library/functions.rst:322 +#: ../../library/functions.rst:324 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source``, ``filename``." msgstr "" -#: ../../library/functions.rst:324 +#: ../../library/functions.rst:326 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source`` and ``filename``. This event may also be raised by implicit " "compilation." msgstr "" -#: ../../library/functions.rst:330 +#: ../../library/functions.rst:332 msgid "" "When compiling a string with multi-line code in ``'single'`` or ``'eval'`` " "mode, input must be terminated by at least one newline character. This is " @@ -814,7 +815,7 @@ msgstr "" "在 ``'single'`` 或 ``'eval'`` 模式編譯多行程式碼時,輸入必須以至少一個換行符" "結尾。這使 :mod:`code` module 更容易檢測陳述式的完整性。" -#: ../../library/functions.rst:337 +#: ../../library/functions.rst:339 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string when compiling to an AST object due to stack depth " @@ -823,7 +824,7 @@ msgstr "" "如果編譯足夠大或者足夠複雜的字串成 AST 物件時,Python 直譯器會因為 Python " "AST 編譯器的 stack 深度限制而崩潰。" -#: ../../library/functions.rst:341 +#: ../../library/functions.rst:343 msgid "" "Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode " "does not have to end in a newline anymore. Added the *optimize* parameter." @@ -831,20 +832,20 @@ msgstr "" "允許使用 Windows 和 Mac 的換行符號。在 ``'exec'`` 模式不需要以換行符號結尾。" "增加了 *optimize* 參數。" -#: ../../library/functions.rst:345 +#: ../../library/functions.rst:347 msgid "" "Previously, :exc:`TypeError` was raised when null bytes were encountered in " "*source*." msgstr "" "在之前的版本,*source* 中包含 null bytes 會觸發 :exc:`TypeError` 異常。" -#: ../../library/functions.rst:349 +#: ../../library/functions.rst:351 msgid "" "``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable " "support for top-level ``await``, ``async for``, and ``async with``." msgstr "" -#: ../../library/functions.rst:356 +#: ../../library/functions.rst:358 msgid "" "Return a complex number with the value *real* + *imag*\\*1j or convert a " "string or number to a complex number. If the first parameter is a string, " @@ -861,7 +862,7 @@ msgstr "" "預設值為零,建構函式會像 :class:`int` 和 :class:`float` 一樣進行數值轉換。如" "果兩個引數都省略,則回傳 ``0j``。" -#: ../../library/functions.rst:365 +#: ../../library/functions.rst:367 msgid "" "For a general Python object ``x``, ``complex(x)`` delegates to ``x." "__complex__()``. If ``__complex__()`` is not defined then it falls back to :" @@ -869,7 +870,7 @@ msgid "" "meth:`__index__`." msgstr "" -#: ../../library/functions.rst:372 +#: ../../library/functions.rst:374 msgid "" "When converting from a string, the string must not contain whitespace around " "the central ``+`` or ``-`` operator. For example, ``complex('1+2j')`` is " @@ -879,22 +880,22 @@ msgstr "" "``complex('1+2j')`` 是有效的,但 ``complex('1 + 2j')`` 會觸發 :exc:" "`ValueError`。" -#: ../../library/functions.rst:377 +#: ../../library/functions.rst:379 msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" -#: ../../library/functions.rst:379 ../../library/functions.rst:669 -#: ../../library/functions.rst:885 +#: ../../library/functions.rst:381 ../../library/functions.rst:671 +#: ../../library/functions.rst:887 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "可以使用底線將程式碼文字中的數字進行分組。" -#: ../../library/functions.rst:382 +#: ../../library/functions.rst:384 msgid "" "Falls back to :meth:`__index__` if :meth:`__complex__` and :meth:`__float__` " "are not defined." msgstr "" -#: ../../library/functions.rst:389 +#: ../../library/functions.rst:391 msgid "" "This is a relative of :func:`setattr`. The arguments are an object and a " "string. The string must be the name of one of the object's attributes. The " @@ -905,7 +906,7 @@ msgstr "" "某個屬性名稱。如果物件允許,該函式將刪除指定的屬性。例如 ``delattr(x, " "'foobar')`` 等價於 ``del x.foobar``。" -#: ../../library/functions.rst:401 +#: ../../library/functions.rst:403 msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " "See :class:`dict` and :ref:`typesmapping` for documentation about this class." @@ -913,7 +914,7 @@ msgstr "" "建立一個新的 dictionary(字典)。\\ :class:`dict` 物件是一個 dictionary " "class。參見 :class:`dict` 和 :ref:`typesmapping` 來瞭解這個 class。" -#: ../../library/functions.rst:404 +#: ../../library/functions.rst:406 msgid "" "For other containers see the built-in :class:`list`, :class:`set`, and :" "class:`tuple` classes, as well as the :mod:`collections` module." @@ -921,7 +922,7 @@ msgstr "" "其他容器型別,請參見內建的 :class:`list`、:class:`set` 和 :class:`tuple` " "class,以及 :mod:`collections` module。" -#: ../../library/functions.rst:410 +#: ../../library/functions.rst:412 msgid "" "Without arguments, return the list of names in the current local scope. " "With an argument, attempt to return a list of valid attributes for that " @@ -930,7 +931,7 @@ msgstr "" "如果沒有引數,則回傳當前本地作用域中的名稱列表。如果有引數,它會嘗試回傳該物" "件的有效屬性列表。" -#: ../../library/functions.rst:413 +#: ../../library/functions.rst:415 msgid "" "If the object has a method named :meth:`__dir__`, this method will be called " "and must return the list of attributes. This allows objects that implement a " @@ -941,7 +942,7 @@ msgstr "" "須回傳一個屬性列表。這允許實現自定義 :func:`__getattr__` 或 :func:" "`__getattribute__` 函式的物件能夠自定義 :func:`dir` 來報告它們的屬性。" -#: ../../library/functions.rst:418 +#: ../../library/functions.rst:420 msgid "" "If the object does not provide :meth:`__dir__`, the function tries its best " "to gather information from the object's :attr:`~object.__dict__` attribute, " @@ -953,7 +954,7 @@ msgstr "" "__dict__` 屬性和型別物件收集資訊。結果列表並不總是完整的,如果物件有自定義 :" "func:`__getattr__`,那結果可能不準確。" -#: ../../library/functions.rst:423 +#: ../../library/functions.rst:425 msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " @@ -962,13 +963,13 @@ msgstr "" "預設的 :func:`dir` 機制對不同型別的物件有不同行為,它會試圖回傳最相關而非最完" "整的資訊:" -#: ../../library/functions.rst:427 +#: ../../library/functions.rst:429 msgid "" "If the object is a module object, the list contains the names of the " "module's attributes." msgstr "如果物件是 module 物件,則列表包含 module 的屬性名稱。" -#: ../../library/functions.rst:430 +#: ../../library/functions.rst:432 msgid "" "If the object is a type or class object, the list contains the names of its " "attributes, and recursively of the attributes of its bases." @@ -976,7 +977,7 @@ msgstr "" "如果物件是型別或 class 物件,則列表包含它們的屬性名稱,並且遞迴查詢其基礎的所" "有屬性。" -#: ../../library/functions.rst:433 +#: ../../library/functions.rst:435 msgid "" "Otherwise, the list contains the object's attributes' names, the names of " "its class's attributes, and recursively of the attributes of its class's " @@ -985,11 +986,11 @@ msgstr "" "否則,包含物件的屬性名稱列表、它的 class 屬性名稱,並且遞迴查詢它的 class 的" "所有基礎 class 的屬性。" -#: ../../library/functions.rst:437 +#: ../../library/functions.rst:439 msgid "The resulting list is sorted alphabetically. For example:" msgstr "回傳的列表按字母表排序,例如:" -#: ../../library/functions.rst:456 +#: ../../library/functions.rst:458 msgid "" "Because :func:`dir` is supplied primarily as a convenience for use at an " "interactive prompt, it tries to supply an interesting set of names more than " @@ -1002,7 +1003,7 @@ msgstr "" "版本之間改變。例如,當引數是一個 class 時,metaclass 的屬性不包含在結果列表" "中。" -#: ../../library/functions.rst:466 +#: ../../library/functions.rst:468 msgid "" "Take two (non-complex) numbers as arguments and return a pair of numbers " "consisting of their quotient and remainder when using integer division. " @@ -1020,7 +1021,7 @@ msgstr "" "等,如果 ``a % b`` 非零,則它的符號和 *b* 一樣,且 ``0 <= abs(a % b) < " "abs(b)``。" -#: ../../library/functions.rst:478 +#: ../../library/functions.rst:480 msgid "" "Return an enumerate object. *iterable* must be a sequence, an :term:" "`iterator`, or some other object which supports iteration. The :meth:" @@ -1033,14 +1034,14 @@ msgstr "" "meth:`~iterator.__next__` method 回傳一個 tuple(元組),裡面包含一個計數值" "(從 *start* 開始,預設為 0)和通過疊代 *iterable* 獲得的值。" -#: ../../library/functions.rst:490 +#: ../../library/functions.rst:492 msgid "Equivalent to::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/functions.rst:501 +#: ../../library/functions.rst:503 msgid "" "The arguments are a string and optional globals and locals. If provided, " "*globals* must be a dictionary. If provided, *locals* can be any mapping " @@ -1049,7 +1050,7 @@ msgstr "" "引數是一個字串,以及選擇性的 globals 和 locals。如果有提供選擇性引數," "*globals* 必須是一個 dictionary。*locals* 可以是任何映射 (mapping) 物件。" -#: ../../library/functions.rst:505 +#: ../../library/functions.rst:507 msgid "" "The *expression* argument is parsed and evaluated as a Python expression " "(technically speaking, a condition list) using the *globals* and *locals* " @@ -1075,13 +1076,13 @@ msgstr "" "呼叫的環境中執行運算式。請注意,*eval()* 在封閉環境中無法存取\\ :term:`巢狀" "域 ` (non-locals)。" -#: ../../library/functions.rst:520 +#: ../../library/functions.rst:522 msgid "" "The return value is the result of the evaluated expression. Syntax errors " "are reported as exceptions. Example:" msgstr "" -#: ../../library/functions.rst:527 +#: ../../library/functions.rst:529 msgid "" "This function can also be used to execute arbitrary code objects (such as " "those created by :func:`compile`). In this case, pass a code object instead " @@ -1092,7 +1093,7 @@ msgstr "" "情況下,傳入的引數是程式碼物件而不是字串。如果編譯該物件時的 *mode* 引數是 " "``'exec'``,那麼 :func:`eval` 回傳值為 ``None``。" -#: ../../library/functions.rst:532 +#: ../../library/functions.rst:534 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " @@ -1103,13 +1104,13 @@ msgstr "" "`locals` 函式分別回傳當前的全域性和局部性 dictionary,它們對於將引數傳遞給 :" "func:`eval` 或 :func:`exec` 可能會方便許多。" -#: ../../library/functions.rst:537 +#: ../../library/functions.rst:539 msgid "" "If the given source is a string, then leading and trailing spaces and tabs " "are stripped." msgstr "" -#: ../../library/functions.rst:540 +#: ../../library/functions.rst:542 msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." @@ -1117,19 +1118,19 @@ msgstr "" "另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的運算式字" "串。" -#: ../../library/functions.rst:543 ../../library/functions.rst:579 +#: ../../library/functions.rst:545 ../../library/functions.rst:581 msgid "" "Raises an :ref:`auditing event ` ``exec`` with argument " "``code_object``." msgstr "" -#: ../../library/functions.rst:545 ../../library/functions.rst:581 +#: ../../library/functions.rst:547 ../../library/functions.rst:583 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." msgstr "" -#: ../../library/functions.rst:552 +#: ../../library/functions.rst:554 msgid "" "This function supports dynamic execution of Python code. *object* must be " "either a string or a code object. If it is a string, the string is parsed " @@ -1149,7 +1150,7 @@ msgstr "" "`yield` 和 :keyword:`return` 陳述式也不能在函式之外使用。該函式回傳值是 " "``None``。" -#: ../../library/functions.rst:563 +#: ../../library/functions.rst:565 msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " "current scope. If only *globals* is provided, it must be a dictionary (and " @@ -1168,7 +1169,7 @@ msgstr "" "地變數是相同的 dictionary。如果 exec 有兩個不同的 *globals* 和 *locals* 物" "件,程式碼就像嵌入在 class 定義中一樣執行。" -#: ../../library/functions.rst:573 +#: ../../library/functions.rst:575 msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1181,7 +1182,7 @@ msgstr "" "func:`exec` 之前,可以通過將自己的 ``__builtins__`` dictionary 插入到 " "*globals* 中來控制可以使用哪些內建程式碼。" -#: ../../library/functions.rst:586 +#: ../../library/functions.rst:588 msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " "global and local dictionary, respectively, which may be useful to pass " @@ -1190,7 +1191,7 @@ msgstr "" "內建 :func:`globals` 和 :func:`locals` 函式各自回傳當前的全域性和本地 " "dictionary,因此可以將它們傳遞給 :func:`exec` 的第二個和第三個引數。" -#: ../../library/functions.rst:592 +#: ../../library/functions.rst:594 msgid "" "The default *locals* act as described for function :func:`locals` below: " "modifications to the default *locals* dictionary should not be attempted. " @@ -1201,7 +1202,7 @@ msgstr "" "預設的 *locals* dictionary。如果您想在 :func:`exec` 函式回傳時知道程式碼對 " "*locals* 的變動,請明確地傳遞 *locals* dictionary 。" -#: ../../library/functions.rst:600 +#: ../../library/functions.rst:602 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "returns true. *iterable* may be either a sequence, a container which " @@ -1214,7 +1215,7 @@ msgstr "" "*function* 是 ``None``,則會假設它是一個恆等函數,即 *iterable* 中所有假值元" "素會被移除。" -#: ../../library/functions.rst:606 +#: ../../library/functions.rst:608 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1225,7 +1226,7 @@ msgstr "" "是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" -#: ../../library/functions.rst:611 +#: ../../library/functions.rst:613 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* returns false." @@ -1233,11 +1234,11 @@ msgstr "" "請參閱 :func:`itertools.filterfalse`,只有 *function* 回傳 false 時才選取 " "*iterable* 中元素的互補函數。" -#: ../../library/functions.rst:621 +#: ../../library/functions.rst:623 msgid "Return a floating point number constructed from a number or string *x*." msgstr "回傳從數字或字串 *x* 生成的浮點數。" -#: ../../library/functions.rst:623 +#: ../../library/functions.rst:625 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " @@ -1252,7 +1253,7 @@ msgstr "" "數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法:" -#: ../../library/functions.rst:638 +#: ../../library/functions.rst:640 msgid "" "Here ``floatnumber`` is the form of a Python floating-point literal, " "described in :ref:`floating`. Case is not significant, so, for example, " @@ -1263,7 +1264,7 @@ msgstr "" "都可以,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表示正無窮" "大。" -#: ../../library/functions.rst:643 +#: ../../library/functions.rst:645 msgid "" "Otherwise, if the argument is an integer or a floating point number, a " "floating point number with the same value (within Python's floating point " @@ -1273,7 +1274,7 @@ msgstr "" "否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" "浮點數。如果引數在 Python 浮點精度範圍外,則會觸發 :exc:`OverflowError`。" -#: ../../library/functions.rst:648 +#: ../../library/functions.rst:650 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If ``__float__()`` is not defined then it falls back to :" @@ -1282,26 +1283,26 @@ msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 指派給 ``x.__float__()``。如果未定" "義 ``__float__()`` 則使用 :meth:`__index__`。" -#: ../../library/functions.rst:652 +#: ../../library/functions.rst:654 msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有引數,則回傳 ``0.0``。" -#: ../../library/functions.rst:654 +#: ../../library/functions.rst:656 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:667 +#: ../../library/functions.rst:669 msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" -#: ../../library/functions.rst:675 +#: ../../library/functions.rst:677 msgid "Falls back to :meth:`__index__` if :meth:`__float__` is not defined." msgstr "" -#: ../../library/functions.rst:685 +#: ../../library/functions.rst:687 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1312,7 +1313,7 @@ msgstr "" "取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:690 +#: ../../library/functions.rst:692 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1320,7 +1321,7 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" -#: ../../library/functions.rst:693 +#: ../../library/functions.rst:695 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1334,7 +1335,7 @@ msgstr "" "字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空,或是 " "*format_spec* 或回傳值不是字串,則會觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:700 +#: ../../library/functions.rst:702 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1342,7 +1343,7 @@ msgstr "" "當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會觸發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:709 +#: ../../library/functions.rst:711 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1352,7 +1353,7 @@ msgstr "" "素。\\ ``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" "`frozenset` 和 :ref:`types-set`。" -#: ../../library/functions.rst:713 +#: ../../library/functions.rst:715 msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" "`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." @@ -1360,7 +1361,7 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" -#: ../../library/functions.rst:720 +#: ../../library/functions.rst:722 msgid "" "Return the value of the named attribute of *object*. *name* must be a " "string. If the string is the name of one of the object's attributes, the " @@ -1374,7 +1375,7 @@ msgstr "" "果指定的屬性不存在,且提供了 *default* 值,則回傳其值,否則觸發 :exc:" "`AttributeError`。" -#: ../../library/functions.rst:728 +#: ../../library/functions.rst:730 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1382,7 +1383,7 @@ msgid "" "`getattr`." msgstr "" -#: ../../library/functions.rst:736 +#: ../../library/functions.rst:738 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1391,7 +1392,7 @@ msgstr "" "回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" "函式時設定且不論該函式是在何處呼叫都會保持相同。" -#: ../../library/functions.rst:743 +#: ../../library/functions.rst:745 msgid "" "The arguments are an object and a string. The result is ``True`` if the " "string is the name of one of the object's attributes, ``False`` if not. " @@ -1402,7 +1403,7 @@ msgstr "" "則回傳 ``False``。(此功能是通過呼叫 ``getattr(object, name)`` 看是否有 :exc:" "`AttributeError` 來實現的。)" -#: ../../library/functions.rst:751 +#: ../../library/functions.rst:753 msgid "" "Return the hash value of the object (if it has one). Hash values are " "integers. They are used to quickly compare dictionary keys during a " @@ -1413,7 +1414,7 @@ msgstr "" "時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" "別不同,如 1 和 1.0)。" -#: ../../library/functions.rst:758 +#: ../../library/functions.rst:760 msgid "" "For objects with custom :meth:`__hash__` methods, note that :func:`hash` " "truncates the return value based on the bit width of the host machine. See :" @@ -1422,7 +1423,7 @@ msgstr "" "請注意,如果物件實現了自己的 :meth:`__hash__` method,:func:`hash` 根據執行機" "器的位元長度來擷取回傳值。另請參閱 :meth:`__hash__`。" -#: ../../library/functions.rst:764 +#: ../../library/functions.rst:766 msgid "" "Invoke the built-in help system. (This function is intended for interactive " "use.) If no argument is given, the interactive help system starts on the " @@ -1436,7 +1437,7 @@ msgstr "" "鍵字或文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任意物" "件,則會生成該物件的幫助頁。" -#: ../../library/functions.rst:771 +#: ../../library/functions.rst:773 msgid "" "Note that if a slash(/) appears in the parameter list of a function when " "invoking :func:`help`, it means that the parameters prior to the slash are " @@ -1444,12 +1445,12 @@ msgid "" "parameters `." msgstr "" -#: ../../library/functions.rst:776 +#: ../../library/functions.rst:778 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "該函式透過 :mod:`site` module 加入到內建命名空間。" -#: ../../library/functions.rst:778 +#: ../../library/functions.rst:780 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1457,7 +1458,7 @@ msgstr "" "變更至 :mod:`pydoc` 和 :mod:`inspect` 使得可呼叫物件的簽名信息 (signature) 更" "加全面和一致。" -#: ../../library/functions.rst:785 +#: ../../library/functions.rst:787 msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" @@ -1467,7 +1468,7 @@ msgstr "" "class:`int` 物件,則必須定義一個 :meth:`__index__` method 並且回傳一個整數。" "舉例來說:" -#: ../../library/functions.rst:794 +#: ../../library/functions.rst:796 msgid "" "If you want to convert an integer number to an uppercase or lower " "hexadecimal string with prefix or not, you can use either of the following " @@ -1476,20 +1477,20 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" "以使用如下方法:" -#: ../../library/functions.rst:806 +#: ../../library/functions.rst:808 msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." msgstr "另請參閱 :func:`int` 將十六進位制字串轉換為以 16 為基數的整數。" -#: ../../library/functions.rst:811 +#: ../../library/functions.rst:813 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "" "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" -#: ../../library/functions.rst:817 +#: ../../library/functions.rst:819 msgid "" "Return the \"identity\" of an object. This is an integer which is " "guaranteed to be unique and constant for this object during its lifetime. " @@ -1499,13 +1500,13 @@ msgstr "" "回傳物件的 \"標識值\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:824 +#: ../../library/functions.rst:826 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" -#: ../../library/functions.rst:829 +#: ../../library/functions.rst:831 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " @@ -1518,7 +1519,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:839 +#: ../../library/functions.rst:841 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1526,31 +1527,31 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:842 +#: ../../library/functions.rst:844 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt``." msgstr "" -#: ../../library/functions.rst:844 +#: ../../library/functions.rst:846 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" msgstr "" -#: ../../library/functions.rst:847 +#: ../../library/functions.rst:849 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "argument ``result``." msgstr "" -#: ../../library/functions.rst:849 +#: ../../library/functions.rst:851 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." msgstr "" -#: ../../library/functions.rst:856 +#: ../../library/functions.rst:858 msgid "" "Return an integer object constructed from a number or string *x*, or return " "``0`` if no arguments are given. If *x* defines :meth:`__int__`, ``int(x)`` " @@ -1563,7 +1564,7 @@ msgstr "" "了 :meth:`__index__` 則回傳 ``x.__index__()``。如果 *x* 定義了 :meth:" "`__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數則向零舍入。" -#: ../../library/functions.rst:863 +#: ../../library/functions.rst:865 msgid "" "If *x* is not a number or if *base* is given, then *x* must be a string, :" "class:`bytes`, or :class:`bytearray` instance representing an :ref:`integer " @@ -1588,11 +1589,11 @@ msgstr "" "2、8、10、16 進制中的一個,所以 ``int('010', 0)`` 是非法的,但 " "``int('010')`` 和 ``int('010', 8)`` 是有效的。" -#: ../../library/functions.rst:876 +#: ../../library/functions.rst:878 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱 :ref:`typesnumeric`。" -#: ../../library/functions.rst:878 +#: ../../library/functions.rst:880 msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" "meth:`base.__index__ ` method, that method is called to " @@ -1604,11 +1605,11 @@ msgstr "" "使用 :meth:`base.__int__ ` 而不是 :meth:`base.__index__ " "`。" -#: ../../library/functions.rst:891 +#: ../../library/functions.rst:893 msgid "Falls back to :meth:`__index__` if :meth:`__int__` is not defined." msgstr "" -#: ../../library/functions.rst:897 +#: ../../library/functions.rst:899 msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " "argument, or of a (direct, indirect, or :term:`virtual `) of *classinfo*. A class is considered a " @@ -1646,7 +1647,7 @@ msgstr "" "*class* 是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會" "觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:927 +#: ../../library/functions.rst:929 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1669,18 +1670,18 @@ msgstr "" "帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸發 :exc:" "`StopIteration`,否則回傳呼叫結果。" -#: ../../library/functions.rst:940 +#: ../../library/functions.rst:942 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:942 +#: ../../library/functions.rst:944 msgid "" "One useful application of the second form of :func:`iter` is to build a " "block-reader. For example, reading fixed-width blocks from a binary database " "file until the end of file is reached::" msgstr "" -#: ../../library/functions.rst:954 +#: ../../library/functions.rst:956 msgid "" "Return the length (the number of items) of an object. The argument may be a " "sequence (such as a string, bytes, tuple, list, or range) or a collection " @@ -1689,13 +1690,13 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:960 +#: ../../library/functions.rst:962 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." msgstr "" -#: ../../library/functions.rst:968 +#: ../../library/functions.rst:970 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -1703,7 +1704,7 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:974 +#: ../../library/functions.rst:976 msgid "" "Update and return a dictionary representing the current local symbol table. " "Free variables are returned by :func:`locals` when it is called in function " @@ -1714,7 +1715,7 @@ msgstr "" "叫 :func:`locals` 時會回傳自由變數。請注意,在 module 階層中,\\ :func:" "`locals` 和 :func:`globals` 是相同的 dictionary。" -#: ../../library/functions.rst:980 +#: ../../library/functions.rst:982 msgid "" "The contents of this dictionary should not be modified; changes may not " "affect the values of local and free variables used by the interpreter." @@ -1722,7 +1723,7 @@ msgstr "" "此 dictionary 的內容不應該被更動;更改可能不會影響直譯器使用的本地變數或自由" "變數的值。" -#: ../../library/functions.rst:985 +#: ../../library/functions.rst:987 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterable* arguments are passed, " @@ -1737,13 +1738,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經是 tuple 的引數,請參" "閱 :func:`itertools.starmap`\\。" -#: ../../library/functions.rst:996 +#: ../../library/functions.rst:998 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個及以上引數中最大的。" -#: ../../library/functions.rst:999 +#: ../../library/functions.rst:1001 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " @@ -1752,7 +1753,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1004 ../../library/functions.rst:1041 +#: ../../library/functions.rst:1006 ../../library/functions.rst:1043 msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " @@ -1764,7 +1765,7 @@ msgstr "" "式,如同 :meth:`list.sort` 使用方式。*default* 引數是當 iterable 為空時回傳的" "值。如果 iterable 為空,並且沒有提供 *default*,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:1010 +#: ../../library/functions.rst:1012 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1775,15 +1776,15 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1015 ../../library/functions.rst:1052 +#: ../../library/functions.rst:1017 ../../library/functions.rst:1054 msgid "The *default* keyword-only argument." msgstr "*default* 僅限關鍵字引數。" -#: ../../library/functions.rst:1018 ../../library/functions.rst:1055 +#: ../../library/functions.rst:1020 ../../library/functions.rst:1057 msgid "The *key* can be ``None``." msgstr "" -#: ../../library/functions.rst:1026 +#: ../../library/functions.rst:1028 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -1791,13 +1792,13 @@ msgstr "" "回傳由給定的引數建立之 \"memory view\" 物件。有關詳細資訊,請參閱 :ref:" "`typememoryview`。" -#: ../../library/functions.rst:1033 +#: ../../library/functions.rst:1035 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個及以上引數中最小的。" -#: ../../library/functions.rst:1036 +#: ../../library/functions.rst:1038 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " @@ -1806,7 +1807,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個或以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1047 +#: ../../library/functions.rst:1049 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1817,7 +1818,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1061 +#: ../../library/functions.rst:1063 msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " @@ -1827,7 +1828,7 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則觸發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1068 +#: ../../library/functions.rst:1070 msgid "" "Return a new featureless object. :class:`object` is a base for all classes. " "It has methods that are common to all instances of Python classes. This " @@ -1836,7 +1837,7 @@ msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1074 +#: ../../library/functions.rst:1076 msgid "" ":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " "assign arbitrary attributes to an instance of the :class:`object` class." @@ -1844,7 +1845,7 @@ msgstr "" "由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" "給 :class:`object` class 的實例。" -#: ../../library/functions.rst:1080 +#: ../../library/functions.rst:1082 msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " @@ -1855,7 +1856,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1090 +#: ../../library/functions.rst:1092 msgid "" "If you want to convert an integer number to an octal string either with the " "prefix \"0o\" or not, you can use either of the following ways." @@ -1863,7 +1864,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1107 +#: ../../library/functions.rst:1109 msgid "" "Open *file* and return a corresponding :term:`file object`. If the file " "cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more " @@ -1872,7 +1873,7 @@ msgstr "" "開啟 *file* 並回傳對應的 :term:`file object`。如果該檔案不能開啟,則觸發 :" "exc:`OSError`。關於使用此函式的更多方法請參閱\\ :ref:`tut-files`。" -#: ../../library/functions.rst:1111 +#: ../../library/functions.rst:1113 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -1885,7 +1886,7 @@ msgstr "" "果有提供檔案描述器,它會隨著回傳的 I/O 物件關閉而關閉,除非 *closefd* 被設為 " "``False``。)" -#: ../../library/functions.rst:1117 +#: ../../library/functions.rst:1119 msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " @@ -1906,71 +1907,71 @@ msgstr "" "getpreferredencoding(False)`` 來獲取當前的本地編碼。(要讀取和寫入原始 " "bytes,請使用二進位制模式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1134 +#: ../../library/functions.rst:1136 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1134 +#: ../../library/functions.rst:1136 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1136 +#: ../../library/functions.rst:1138 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1136 +#: ../../library/functions.rst:1138 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1137 +#: ../../library/functions.rst:1139 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1137 +#: ../../library/functions.rst:1139 msgid "open for writing, truncating the file first" msgstr "" -#: ../../library/functions.rst:1138 +#: ../../library/functions.rst:1140 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1138 +#: ../../library/functions.rst:1140 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性創建,如果文件已存在則會失敗" -#: ../../library/functions.rst:1139 +#: ../../library/functions.rst:1141 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1139 +#: ../../library/functions.rst:1141 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果文件存在則在末尾追加寫入內容" -#: ../../library/functions.rst:1140 +#: ../../library/functions.rst:1142 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1140 +#: ../../library/functions.rst:1142 msgid "binary mode" msgstr "二進制模式" -#: ../../library/functions.rst:1141 +#: ../../library/functions.rst:1143 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1141 +#: ../../library/functions.rst:1143 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1142 +#: ../../library/functions.rst:1144 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1142 +#: ../../library/functions.rst:1144 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1145 +#: ../../library/functions.rst:1147 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " @@ -1979,7 +1980,7 @@ msgstr "" "預設的模式是 ``'r'``\\ (開啟並讀取文字,同 ``'rt'``)。對於二進位制寫入," "``'w+b'`` 模式開啟並把檔案內容變成 0 bytes,``'r+b'`` 則不會捨棄原始內容。" -#: ../../library/functions.rst:1149 +#: ../../library/functions.rst:1151 msgid "" "As mentioned in the :ref:`io-overview`, Python distinguishes between binary " "and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* " @@ -1990,7 +1991,7 @@ msgid "" "specified *encoding* if given." msgstr "" -#: ../../library/functions.rst:1157 +#: ../../library/functions.rst:1159 msgid "" "There is an additional mode character permitted, ``'U'``, which no longer " "has any effect, and is considered deprecated. It previously enabled :term:" @@ -1999,14 +2000,14 @@ msgid "" "parameter>` parameter for further details." msgstr "" -#: ../../library/functions.rst:1165 +#: ../../library/functions.rst:1167 msgid "" "Python doesn't depend on the underlying operating system's notion of text " "files; all the processing is done by Python itself, and is therefore " "platform-independent." msgstr "" -#: ../../library/functions.rst:1169 +#: ../../library/functions.rst:1171 msgid "" "*buffering* is an optional integer used to set the buffering policy. Pass 0 " "to switch buffering off (only allowed in binary mode), 1 to select line " @@ -2019,7 +2020,7 @@ msgid "" "given, the default buffering policy works as follows:" msgstr "" -#: ../../library/functions.rst:1179 +#: ../../library/functions.rst:1181 msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " "chosen using a heuristic trying to determine the underlying device's \"block " @@ -2027,14 +2028,14 @@ msgid "" "the buffer will typically be 4096 or 8192 bytes long." msgstr "" -#: ../../library/functions.rst:1184 +#: ../../library/functions.rst:1186 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " "described above for binary files." msgstr "" -#: ../../library/functions.rst:1188 +#: ../../library/functions.rst:1190 msgid "" "*encoding* is the name of the encoding used to decode or encode the file. " "This should only be used in text mode. The default encoding is platform " @@ -2043,7 +2044,7 @@ msgid "" "module for the list of supported encodings." msgstr "" -#: ../../library/functions.rst:1195 +#: ../../library/functions.rst:1197 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2052,25 +2053,25 @@ msgid "" "register_error` is also valid. The standard names include:" msgstr "" -#: ../../library/functions.rst:1203 +#: ../../library/functions.rst:1205 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." msgstr "" -#: ../../library/functions.rst:1207 +#: ../../library/functions.rst:1209 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "" -#: ../../library/functions.rst:1210 +#: ../../library/functions.rst:1212 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" -#: ../../library/functions.rst:1213 +#: ../../library/functions.rst:1215 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2079,33 +2080,33 @@ msgid "" "an unknown encoding." msgstr "" -#: ../../library/functions.rst:1220 +#: ../../library/functions.rst:1222 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " "character reference ``&#nnn;``." msgstr "" -#: ../../library/functions.rst:1224 +#: ../../library/functions.rst:1226 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." msgstr "" -#: ../../library/functions.rst:1227 +#: ../../library/functions.rst:1229 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." msgstr "" -#: ../../library/functions.rst:1235 +#: ../../library/functions.rst:1237 msgid "" "*newline* controls how :term:`universal newlines` mode works (it only " "applies to text mode). It can be ``None``, ``''``, ``'\\n'``, ``'\\r'``, " "and ``'\\r\\n'``. It works as follows:" msgstr "" -#: ../../library/functions.rst:1239 +#: ../../library/functions.rst:1241 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2116,7 +2117,7 @@ msgid "" "given string, and the line ending is returned to the caller untranslated." msgstr "" -#: ../../library/functions.rst:1247 +#: ../../library/functions.rst:1249 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2125,7 +2126,7 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/functions.rst:1253 +#: ../../library/functions.rst:1255 msgid "" "If *closefd* is ``False`` and a file descriptor rather than a filename was " "given, the underlying file descriptor will be kept open when the file is " @@ -2133,7 +2134,7 @@ msgid "" "otherwise, an error will be raised." msgstr "" -#: ../../library/functions.rst:1258 +#: ../../library/functions.rst:1260 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -2142,11 +2143,11 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/functions.rst:1264 +#: ../../library/functions.rst:1266 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1266 +#: ../../library/functions.rst:1268 msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" "`os.open` function to open a file relative to a given directory::" @@ -2156,7 +2157,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:1279 +#: ../../library/functions.rst:1281 msgid "" "The type of :term:`file object` returned by the :func:`open` function " "depends on the mode. When :func:`open` is used to open a file in a text " @@ -2171,7 +2172,7 @@ msgid "" "FileIO`, is returned." msgstr "" -#: ../../library/functions.rst:1300 +#: ../../library/functions.rst:1302 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2181,31 +2182,31 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1304 +#: ../../library/functions.rst:1306 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." msgstr "" -#: ../../library/functions.rst:1306 +#: ../../library/functions.rst:1308 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "" -#: ../../library/functions.rst:1312 +#: ../../library/functions.rst:1314 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1313 +#: ../../library/functions.rst:1315 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1314 +#: ../../library/functions.rst:1316 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去觸發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1315 +#: ../../library/functions.rst:1317 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2213,15 +2214,15 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (\\ ``'x'``\\ ),現在會觸發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1321 +#: ../../library/functions.rst:1323 msgid "The file is now non-inheritable." msgstr "檔案在當前版本開始禁止繼承。" -#: ../../library/functions.rst:1325 +#: ../../library/functions.rst:1327 msgid "The ``'U'`` mode." msgstr "``'U'`` 模式。" -#: ../../library/functions.rst:1330 +#: ../../library/functions.rst:1332 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 :" @@ -2230,15 +2231,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程序沒有觸發例外,此函式現在會重試系統呼叫,而" "不是觸發 :exc:`InterruptedError`\\ (原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1333 +#: ../../library/functions.rst:1335 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1338 +#: ../../library/functions.rst:1340 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對實現了 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1339 +#: ../../library/functions.rst:1341 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2246,7 +2247,7 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1344 +#: ../../library/functions.rst:1346 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2257,7 +2258,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、\\ ``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1352 +#: ../../library/functions.rst:1354 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " @@ -2268,7 +2269,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1359 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2281,7 +2282,7 @@ msgid "" "close to ``3j``." msgstr "" -#: ../../library/functions.rst:1367 +#: ../../library/functions.rst:1369 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -2290,29 +2291,29 @@ msgid "" "*base* modulo *mod*." msgstr "" -#: ../../library/functions.rst:1373 +#: ../../library/functions.rst:1375 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" -#: ../../library/functions.rst:1380 +#: ../../library/functions.rst:1382 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." msgstr "" -#: ../../library/functions.rst:1385 +#: ../../library/functions.rst:1387 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" -#: ../../library/functions.rst:1392 +#: ../../library/functions.rst:1394 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " "by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as " "keyword arguments." msgstr "" -#: ../../library/functions.rst:1396 +#: ../../library/functions.rst:1398 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -2321,7 +2322,7 @@ msgid "" "*end*." msgstr "" -#: ../../library/functions.rst:1402 +#: ../../library/functions.rst:1404 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -2329,38 +2330,38 @@ msgid "" "binary mode file objects. For these, use ``file.write(...)`` instead." msgstr "" -#: ../../library/functions.rst:1407 +#: ../../library/functions.rst:1409 msgid "" "Whether the output is buffered is usually determined by *file*, but if the " "*flush* keyword argument is true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1410 +#: ../../library/functions.rst:1412 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1416 +#: ../../library/functions.rst:1418 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1418 +#: ../../library/functions.rst:1420 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " "attribute value. And *doc* creates a docstring for the attribute." msgstr "" -#: ../../library/functions.rst:1422 +#: ../../library/functions.rst:1424 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1439 +#: ../../library/functions.rst:1441 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter, and ``del c.x`` the deleter." msgstr "" -#: ../../library/functions.rst:1442 +#: ../../library/functions.rst:1444 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2368,14 +2369,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1455 +#: ../../library/functions.rst:1457 msgid "" "The ``@property`` decorator turns the :meth:`voltage` method into a \"getter" "\" for a read-only attribute with the same name, and it sets the docstring " "for *voltage* to \"Get the current voltage.\"" msgstr "" -#: ../../library/functions.rst:1459 +#: ../../library/functions.rst:1461 msgid "" "A property object has :attr:`~property.getter`, :attr:`~property.setter`, " "and :attr:`~property.deleter` methods usable as decorators that create a " @@ -2383,30 +2384,30 @@ msgid "" "decorated function. This is best explained with an example::" msgstr "" -#: ../../library/functions.rst:1481 +#: ../../library/functions.rst:1483 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " "case.)" msgstr "" -#: ../../library/functions.rst:1485 +#: ../../library/functions.rst:1487 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1488 +#: ../../library/functions.rst:1490 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1497 +#: ../../library/functions.rst:1499 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1503 +#: ../../library/functions.rst:1505 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2414,10 +2415,12 @@ msgid "" "the representation is a string enclosed in angle brackets that contains the " "name of the type of the object together with additional information often " "including the name and address of the object. A class can control what this " -"function returns for its instances by defining a :meth:`__repr__` method." +"function returns for its instances by defining a :meth:`__repr__` method. " +"If :func:`sys.displayhook` is not accessible, this function will raise :exc:" +"`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1514 +#: ../../library/functions.rst:1518 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" @@ -2425,14 +2428,14 @@ msgid "" "starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1522 +#: ../../library/functions.rst:1526 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -#: ../../library/functions.rst:1526 +#: ../../library/functions.rst:1530 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2443,13 +2446,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1535 +#: ../../library/functions.rst:1539 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1540 +#: ../../library/functions.rst:1544 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2458,21 +2461,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1551 +#: ../../library/functions.rst:1555 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" "set` for documentation about this class." msgstr "" -#: ../../library/functions.rst:1555 +#: ../../library/functions.rst:1559 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " "module." msgstr "" -#: ../../library/functions.rst:1562 +#: ../../library/functions.rst:1566 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string, and an arbitrary value. The string may name an existing attribute " @@ -2481,14 +2484,14 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1570 +#: ../../library/functions.rst:1574 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -#: ../../library/functions.rst:1579 +#: ../../library/functions.rst:1583 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -2501,35 +2504,35 @@ msgid "" "func:`itertools.islice` for an alternate version that returns an iterator." msgstr "" -#: ../../library/functions.rst:1592 +#: ../../library/functions.rst:1596 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1594 +#: ../../library/functions.rst:1598 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1596 +#: ../../library/functions.rst:1600 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -#: ../../library/functions.rst:1600 +#: ../../library/functions.rst:1604 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/functions.rst:1603 +#: ../../library/functions.rst:1607 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1606 +#: ../../library/functions.rst:1610 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -2537,7 +2540,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1611 +#: ../../library/functions.rst:1615 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2549,22 +2552,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1620 +#: ../../library/functions.rst:1624 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1624 +#: ../../library/functions.rst:1628 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1626 +#: ../../library/functions.rst:1630 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1633 +#: ../../library/functions.rst:1637 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -2572,21 +2575,21 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1636 +#: ../../library/functions.rst:1640 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, they can be called as regular " "functions (such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1640 +#: ../../library/functions.rst:1644 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" -#: ../../library/functions.rst:1644 +#: ../../library/functions.rst:1648 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -2595,36 +2598,36 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1656 +#: ../../library/functions.rst:1660 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1658 +#: ../../library/functions.rst:1662 msgid "" "Static methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), have a " "new ``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" -#: ../../library/functions.rst:1673 +#: ../../library/functions.rst:1677 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1675 +#: ../../library/functions.rst:1679 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1681 +#: ../../library/functions.rst:1685 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -#: ../../library/functions.rst:1685 +#: ../../library/functions.rst:1689 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -2633,31 +2636,31 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1691 +#: ../../library/functions.rst:1695 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1696 +#: ../../library/functions.rst:1700 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " "been overridden in a class." msgstr "" -#: ../../library/functions.rst:1700 +#: ../../library/functions.rst:1704 msgid "" "The *object-or-type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -#: ../../library/functions.rst:1704 +#: ../../library/functions.rst:1708 msgid "" "For example, if :attr:`~class.__mro__` of *object-or-type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1708 +#: ../../library/functions.rst:1712 msgid "" "The :attr:`~class.__mro__` attribute of the *object-or-type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2665,7 +2668,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1713 +#: ../../library/functions.rst:1717 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -2673,7 +2676,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1718 +#: ../../library/functions.rst:1722 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -2681,7 +2684,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1723 +#: ../../library/functions.rst:1727 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -2694,18 +2697,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1733 +#: ../../library/functions.rst:1737 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1740 +#: ../../library/functions.rst:1744 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " "` in a parent or sibling class." msgstr "" -#: ../../library/functions.rst:1744 +#: ../../library/functions.rst:1748 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2715,7 +2718,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1751 +#: ../../library/functions.rst:1755 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -2725,33 +2728,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1758 +#: ../../library/functions.rst:1762 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1767 +#: ../../library/functions.rst:1771 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1776 +#: ../../library/functions.rst:1780 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." "__class__ `." msgstr "" -#: ../../library/functions.rst:1780 +#: ../../library/functions.rst:1784 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." msgstr "" -#: ../../library/functions.rst:1784 +#: ../../library/functions.rst:1788 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -2764,11 +2767,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1799 +#: ../../library/functions.rst:1803 msgid "See also :ref:`bltin-type-objects`." msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:1801 +#: ../../library/functions.rst:1805 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2776,23 +2779,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1806 +#: ../../library/functions.rst:1810 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:1808 +#: ../../library/functions.rst:1812 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../library/functions.rst:1814 +#: ../../library/functions.rst:1818 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/functions.rst:1817 +#: ../../library/functions.rst:1821 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2800,54 +2803,54 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1822 +#: ../../library/functions.rst:1826 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " "dictionary are ignored." msgstr "" -#: ../../library/functions.rst:1826 +#: ../../library/functions.rst:1830 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " "defines the :attr:`~object.__slots__` attribute)." msgstr "" -#: ../../library/functions.rst:1832 +#: ../../library/functions.rst:1836 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:1835 +#: ../../library/functions.rst:1839 msgid "Example::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:1844 +#: ../../library/functions.rst:1848 msgid "" "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " "tuple contains the *i*-th element from each of the argument iterables." msgstr "" -#: ../../library/functions.rst:1847 +#: ../../library/functions.rst:1851 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " "columns into rows. This is similar to `transposing a matrix `_." msgstr "" -#: ../../library/functions.rst:1851 +#: ../../library/functions.rst:1855 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " "iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" "`list`." msgstr "" -#: ../../library/functions.rst:1855 +#: ../../library/functions.rst:1859 msgid "" "One thing to consider is that the iterables passed to :func:`zip` could have " "different lengths; sometimes by design, and sometimes because of a bug in " @@ -2855,51 +2858,51 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:1860 +#: ../../library/functions.rst:1864 msgid "" "By default, :func:`zip` stops when the shortest iterable is exhausted. It " "will ignore the remaining items in the longer iterables, cutting off the " "result to the length of the shortest iterable::" msgstr "" -#: ../../library/functions.rst:1867 +#: ../../library/functions.rst:1871 msgid "" ":func:`zip` is often used in cases where the iterables are assumed to be of " "equal length. In such cases, it's recommended to use the ``strict=True`` " "option. Its output is the same as regular :func:`zip`::" msgstr "" -#: ../../library/functions.rst:1874 +#: ../../library/functions.rst:1878 msgid "" "Unlike the default behavior, it checks that the lengths of iterables are " "identical, raising a :exc:`ValueError` if they aren't:" msgstr "" -#: ../../library/functions.rst:1882 +#: ../../library/functions.rst:1886 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " "bug in another part of the program." msgstr "" -#: ../../library/functions.rst:1886 +#: ../../library/functions.rst:1890 msgid "" "Shorter iterables can be padded with a constant value to make all the " "iterables have the same length. This is done by :func:`itertools." "zip_longest`." msgstr "" -#: ../../library/functions.rst:1890 +#: ../../library/functions.rst:1894 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." msgstr "" -#: ../../library/functions.rst:1893 +#: ../../library/functions.rst:1897 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:1895 +#: ../../library/functions.rst:1899 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -2908,23 +2911,23 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1901 +#: ../../library/functions.rst:1905 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1912 +#: ../../library/functions.rst:1916 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:1924 +#: ../../library/functions.rst:1928 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1927 +#: ../../library/functions.rst:1931 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -2936,7 +2939,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1936 +#: ../../library/functions.rst:1940 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -2946,7 +2949,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1943 +#: ../../library/functions.rst:1947 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -2955,7 +2958,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:1949 +#: ../../library/functions.rst:1953 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -2963,58 +2966,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:1954 +#: ../../library/functions.rst:1958 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:1959 +#: ../../library/functions.rst:1963 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:1963 +#: ../../library/functions.rst:1967 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1966 +#: ../../library/functions.rst:1970 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:1973 +#: ../../library/functions.rst:1977 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " "respective names." msgstr "" -#: ../../library/functions.rst:1977 +#: ../../library/functions.rst:1981 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1980 +#: ../../library/functions.rst:1984 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:1984 +#: ../../library/functions.rst:1988 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -#: ../../library/functions.rst:1989 +#: ../../library/functions.rst:1993 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:1990 +#: ../../library/functions.rst:1994 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " diff --git a/library/functools.po b/library/functools.po index 575e34e015..49e12e7f0e 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-19 00:09+0000\n" +"POT-Creation-Date: 2022-08-11 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -134,7 +134,7 @@ msgstr "" #: ../../library/functools.rst:122 msgid "" -"A comparison function is any callable that accept two arguments, compares " +"A comparison function is any callable that accepts two arguments, compares " "them, and returns a negative number for less-than, zero for equality, or a " "positive number for greater-than. A key function is a callable that accepts " "one argument and returns another value to be used as the sort key." diff --git a/library/gettext.po b/library/gettext.po index 30fd06eafe..6d5d91dd60 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -601,7 +601,7 @@ msgid "" "original GNU :program:`gettext` only supported C or C++ source code but its " "extended version :program:`xgettext` scans code written in a number of " "languages, including Python, to find strings marked as translatable. `Babel " -"`__ is a Python internationalization library that " +"`__ is a Python internationalization library that " "includes a :file:`pybabel` script to extract and compile message catalogs. " "François Pinard's program called :program:`xpot` does a similar job and is " "available as part of his `po-utils package \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -118,32 +118,31 @@ msgstr "" #: ../../library/grp.rst:46 msgid "" -"Since Python 3.6 the support of non-integer arguments like floats or strings " -"in :func:`getgrgid` is deprecated." +":exc:`TypeError` is raised for non-integer arguments like floats or strings." msgstr "" -#: ../../library/grp.rst:52 +#: ../../library/grp.rst:51 msgid "" "Return the group database entry for the given group name. :exc:`KeyError` is " "raised if the entry asked for cannot be found." msgstr "" -#: ../../library/grp.rst:58 +#: ../../library/grp.rst:57 msgid "Return a list of all available group entries, in arbitrary order." msgstr "" -#: ../../library/grp.rst:64 +#: ../../library/grp.rst:63 msgid "Module :mod:`pwd`" msgstr ":mod:`pwd` 模組" -#: ../../library/grp.rst:64 +#: ../../library/grp.rst:63 msgid "An interface to the user database, similar to this." msgstr "" -#: ../../library/grp.rst:66 +#: ../../library/grp.rst:65 msgid "Module :mod:`spwd`" msgstr ":mod:`spwd` 模組" -#: ../../library/grp.rst:67 +#: ../../library/grp.rst:66 msgid "An interface to the shadow password database, similar to this." msgstr "" diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index c2bbaeb9cb..d81c44d846 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-08-06 00:16+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -103,7 +103,7 @@ msgid "" "this class are documented in section :ref:`file-cookie-jar-classes`." msgstr "" -#: ../../library/http.cookiejar.rst:76 ../../library/http.cookiejar.rst:350 +#: ../../library/http.cookiejar.rst:76 ../../library/http.cookiejar.rst:349 msgid "The filename parameter supports a :term:`path-like object`." msgstr "" @@ -235,25 +235,25 @@ msgstr "" #: ../../library/http.cookiejar.rst:162 msgid "" "The *request* object (usually a :class:`urllib.request.Request` instance) " -"must support the methods :meth:`get_full_url`, :meth:`get_host`, :meth:" -"`get_type`, :meth:`unverifiable`, :meth:`has_header`, :meth:`get_header`, :" -"meth:`header_items`, :meth:`add_unredirected_header` and :attr:" -"`origin_req_host` attribute as documented by :mod:`urllib.request`." +"must support the methods :meth:`get_full_url`, :meth:`has_header`, :meth:" +"`get_header`, :meth:`header_items`, :meth:`add_unredirected_header` and the " +"attributes :attr:`host`, :attr:`!type`, :attr:`unverifiable` and :attr:" +"`origin_req_host` as documented by :mod:`urllib.request`." msgstr "" -#: ../../library/http.cookiejar.rst:171 ../../library/http.cookiejar.rst:197 +#: ../../library/http.cookiejar.rst:170 ../../library/http.cookiejar.rst:196 msgid "" "*request* object needs :attr:`origin_req_host` attribute. Dependency on a " "deprecated method :meth:`get_origin_req_host` has been removed." msgstr "" -#: ../../library/http.cookiejar.rst:177 +#: ../../library/http.cookiejar.rst:176 msgid "" "Extract cookies from HTTP *response* and store them in the :class:" "`CookieJar`, where allowed by policy." msgstr "" -#: ../../library/http.cookiejar.rst:180 +#: ../../library/http.cookiejar.rst:179 msgid "" "The :class:`CookieJar` will look for allowable :mailheader:`Set-Cookie` and :" "mailheader:`Set-Cookie2` headers in the *response* argument, and store " @@ -261,52 +261,52 @@ msgid "" "approval)." msgstr "" -#: ../../library/http.cookiejar.rst:184 +#: ../../library/http.cookiejar.rst:183 msgid "" "The *response* object (usually the result of a call to :meth:`urllib.request." "urlopen`, or similar) should support an :meth:`info` method, which returns " "an :class:`email.message.Message` instance." msgstr "" -#: ../../library/http.cookiejar.rst:188 +#: ../../library/http.cookiejar.rst:187 msgid "" "The *request* object (usually a :class:`urllib.request.Request` instance) " -"must support the methods :meth:`get_full_url`, :meth:`get_host`, :meth:" -"`unverifiable`, and :attr:`origin_req_host` attribute, as documented by :mod:" -"`urllib.request`. The request is used to set default values for cookie-" +"must support the method :meth:`get_full_url` and the attributes :attr:" +"`host`, :attr:`unverifiable` and :attr:`origin_req_host`, as documented by :" +"mod:`urllib.request`. The request is used to set default values for cookie-" "attributes as well as for checking that the cookie is allowed to be set." msgstr "" -#: ../../library/http.cookiejar.rst:202 +#: ../../library/http.cookiejar.rst:201 msgid "Set the :class:`CookiePolicy` instance to be used." msgstr "" -#: ../../library/http.cookiejar.rst:207 +#: ../../library/http.cookiejar.rst:206 msgid "" "Return sequence of :class:`Cookie` objects extracted from *response* object." msgstr "" -#: ../../library/http.cookiejar.rst:209 +#: ../../library/http.cookiejar.rst:208 msgid "" "See the documentation for :meth:`extract_cookies` for the interfaces " "required of the *response* and *request* arguments." msgstr "" -#: ../../library/http.cookiejar.rst:215 +#: ../../library/http.cookiejar.rst:214 msgid "Set a :class:`Cookie` if policy says it's OK to do so." msgstr "" -#: ../../library/http.cookiejar.rst:220 +#: ../../library/http.cookiejar.rst:219 msgid "" "Set a :class:`Cookie`, without checking with policy to see whether or not it " "should be set." msgstr "" -#: ../../library/http.cookiejar.rst:226 +#: ../../library/http.cookiejar.rst:225 msgid "Clear some cookies." msgstr "" -#: ../../library/http.cookiejar.rst:228 +#: ../../library/http.cookiejar.rst:227 msgid "" "If invoked without arguments, clear all cookies. If given a single " "argument, only cookies belonging to that *domain* will be removed. If given " @@ -315,15 +315,15 @@ msgid "" "*domain*, *path* and *name* is removed." msgstr "" -#: ../../library/http.cookiejar.rst:234 +#: ../../library/http.cookiejar.rst:233 msgid "Raises :exc:`KeyError` if no matching cookie exists." msgstr "" -#: ../../library/http.cookiejar.rst:239 +#: ../../library/http.cookiejar.rst:238 msgid "Discard all session cookies." msgstr "" -#: ../../library/http.cookiejar.rst:241 +#: ../../library/http.cookiejar.rst:240 msgid "" "Discards all contained cookies that have a true :attr:`discard` attribute " "(usually because they had either no ``max-age`` or ``expires`` cookie-" @@ -332,27 +332,27 @@ msgid "" "window." msgstr "" -#: ../../library/http.cookiejar.rst:246 +#: ../../library/http.cookiejar.rst:245 msgid "" "Note that the :meth:`save` method won't save session cookies anyway, unless " "you ask otherwise by passing a true *ignore_discard* argument." msgstr "" -#: ../../library/http.cookiejar.rst:249 +#: ../../library/http.cookiejar.rst:248 msgid ":class:`FileCookieJar` implements the following additional methods:" msgstr "" -#: ../../library/http.cookiejar.rst:254 +#: ../../library/http.cookiejar.rst:253 msgid "Save cookies to a file." msgstr "" -#: ../../library/http.cookiejar.rst:256 +#: ../../library/http.cookiejar.rst:255 msgid "" "This base class raises :exc:`NotImplementedError`. Subclasses may leave " "this method unimplemented." msgstr "" -#: ../../library/http.cookiejar.rst:259 +#: ../../library/http.cookiejar.rst:258 msgid "" "*filename* is the name of file in which to save cookies. If *filename* is " "not specified, :attr:`self.filename` is used (whose default is the value " @@ -360,63 +360,63 @@ msgid "" "`None`, :exc:`ValueError` is raised." msgstr "" -#: ../../library/http.cookiejar.rst:264 +#: ../../library/http.cookiejar.rst:263 msgid "" "*ignore_discard*: save even cookies set to be discarded. *ignore_expires*: " "save even cookies that have expired" msgstr "" -#: ../../library/http.cookiejar.rst:267 +#: ../../library/http.cookiejar.rst:266 msgid "" "The file is overwritten if it already exists, thus wiping all the cookies it " "contains. Saved cookies can be restored later using the :meth:`load` or :" "meth:`revert` methods." msgstr "" -#: ../../library/http.cookiejar.rst:274 +#: ../../library/http.cookiejar.rst:273 msgid "Load cookies from a file." msgstr "" -#: ../../library/http.cookiejar.rst:276 +#: ../../library/http.cookiejar.rst:275 msgid "Old cookies are kept unless overwritten by newly loaded ones." msgstr "" -#: ../../library/http.cookiejar.rst:278 +#: ../../library/http.cookiejar.rst:277 msgid "Arguments are as for :meth:`save`." msgstr "" -#: ../../library/http.cookiejar.rst:280 +#: ../../library/http.cookiejar.rst:279 msgid "" "The named file must be in the format understood by the class, or :exc:" "`LoadError` will be raised. Also, :exc:`OSError` may be raised, for example " "if the file does not exist." msgstr "" -#: ../../library/http.cookiejar.rst:284 +#: ../../library/http.cookiejar.rst:283 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" -#: ../../library/http.cookiejar.rst:290 +#: ../../library/http.cookiejar.rst:289 msgid "Clear all cookies and reload cookies from a saved file." msgstr "" -#: ../../library/http.cookiejar.rst:292 +#: ../../library/http.cookiejar.rst:291 msgid "" ":meth:`revert` can raise the same exceptions as :meth:`load`. If there is a " "failure, the object's state will not be altered." msgstr "" -#: ../../library/http.cookiejar.rst:295 +#: ../../library/http.cookiejar.rst:294 msgid ":class:`FileCookieJar` instances have the following public attributes:" msgstr "" -#: ../../library/http.cookiejar.rst:300 +#: ../../library/http.cookiejar.rst:299 msgid "" "Filename of default file in which to keep cookies. This attribute may be " "assigned to." msgstr "" -#: ../../library/http.cookiejar.rst:306 +#: ../../library/http.cookiejar.rst:305 msgid "" "If true, load cookies lazily from disk. This attribute should not be " "assigned to. This is only a hint, since this only affects performance, not " @@ -425,43 +425,43 @@ msgid "" "in the standard library lazily loads cookies." msgstr "" -#: ../../library/http.cookiejar.rst:316 +#: ../../library/http.cookiejar.rst:315 msgid "FileCookieJar subclasses and co-operation with web browsers" msgstr "" -#: ../../library/http.cookiejar.rst:318 +#: ../../library/http.cookiejar.rst:317 msgid "" "The following :class:`CookieJar` subclasses are provided for reading and " "writing." msgstr "" -#: ../../library/http.cookiejar.rst:323 +#: ../../library/http.cookiejar.rst:322 msgid "" "A :class:`FileCookieJar` that can load from and save cookies to disk in the " "Mozilla ``cookies.txt`` file format (which is also used by the Lynx and " "Netscape browsers)." msgstr "" -#: ../../library/http.cookiejar.rst:329 +#: ../../library/http.cookiejar.rst:328 msgid "" "This loses information about :rfc:`2965` cookies, and also about newer or " "non-standard cookie-attributes such as ``port``." msgstr "" -#: ../../library/http.cookiejar.rst:334 +#: ../../library/http.cookiejar.rst:333 msgid "" "Back up your cookies before saving if you have cookies whose loss / " "corruption would be inconvenient (there are some subtleties which may lead " "to slight changes in the file over a load / save round-trip)." msgstr "" -#: ../../library/http.cookiejar.rst:338 +#: ../../library/http.cookiejar.rst:337 msgid "" "Also note that cookies saved while Mozilla is running will get clobbered by " "Mozilla." msgstr "" -#: ../../library/http.cookiejar.rst:344 +#: ../../library/http.cookiejar.rst:343 msgid "" "A :class:`FileCookieJar` that can load from and save cookies to disk in " "format compatible with the libwww-perl library's ``Set-Cookie3`` file " @@ -469,47 +469,47 @@ msgid "" "file." msgstr "" -#: ../../library/http.cookiejar.rst:355 +#: ../../library/http.cookiejar.rst:354 msgid "CookiePolicy Objects" msgstr "CookiePolicy 物件" -#: ../../library/http.cookiejar.rst:357 +#: ../../library/http.cookiejar.rst:356 msgid "" "Objects implementing the :class:`CookiePolicy` interface have the following " "methods:" msgstr "" -#: ../../library/http.cookiejar.rst:363 +#: ../../library/http.cookiejar.rst:362 msgid "" "Return boolean value indicating whether cookie should be accepted from " "server." msgstr "" -#: ../../library/http.cookiejar.rst:365 +#: ../../library/http.cookiejar.rst:364 msgid "" "*cookie* is a :class:`Cookie` instance. *request* is an object implementing " "the interface defined by the documentation for :meth:`CookieJar." "extract_cookies`." msgstr "" -#: ../../library/http.cookiejar.rst:372 +#: ../../library/http.cookiejar.rst:371 msgid "" "Return boolean value indicating whether cookie should be returned to server." msgstr "" -#: ../../library/http.cookiejar.rst:374 +#: ../../library/http.cookiejar.rst:373 msgid "" "*cookie* is a :class:`Cookie` instance. *request* is an object implementing " "the interface defined by the documentation for :meth:`CookieJar." "add_cookie_header`." msgstr "" -#: ../../library/http.cookiejar.rst:381 +#: ../../library/http.cookiejar.rst:380 msgid "" "Return ``False`` if cookies should not be returned, given cookie domain." msgstr "" -#: ../../library/http.cookiejar.rst:383 +#: ../../library/http.cookiejar.rst:382 msgid "" "This method is an optimization. It removes the need for checking every " "cookie with a particular domain (which might involve reading many files). " @@ -517,7 +517,7 @@ msgid "" "leaves all the work to :meth:`return_ok`." msgstr "" -#: ../../library/http.cookiejar.rst:388 +#: ../../library/http.cookiejar.rst:387 msgid "" "If :meth:`domain_return_ok` returns true for the cookie domain, :meth:" "`path_return_ok` is called for the cookie path. Otherwise, :meth:" @@ -527,7 +527,7 @@ msgid "" "`return_ok` is never called for that cookie path." msgstr "" -#: ../../library/http.cookiejar.rst:395 +#: ../../library/http.cookiejar.rst:394 msgid "" "Note that :meth:`domain_return_ok` is called for every *cookie* domain, not " "just for the *request* domain. For example, the function might be called " @@ -535,19 +535,19 @@ msgid "" "domain is ``\"www.example.com\"``. The same goes for :meth:`path_return_ok`." msgstr "" -#: ../../library/http.cookiejar.rst:400 +#: ../../library/http.cookiejar.rst:399 msgid "The *request* argument is as documented for :meth:`return_ok`." msgstr "" -#: ../../library/http.cookiejar.rst:405 +#: ../../library/http.cookiejar.rst:404 msgid "Return ``False`` if cookies should not be returned, given cookie path." msgstr "" -#: ../../library/http.cookiejar.rst:407 +#: ../../library/http.cookiejar.rst:406 msgid "See the documentation for :meth:`domain_return_ok`." msgstr "關於 :meth:`domain_return_ok` 請見文件。" -#: ../../library/http.cookiejar.rst:409 +#: ../../library/http.cookiejar.rst:408 msgid "" "In addition to implementing the methods above, implementations of the :class:" "`CookiePolicy` interface must also supply the following attributes, " @@ -555,21 +555,21 @@ msgid "" "may be assigned to." msgstr "" -#: ../../library/http.cookiejar.rst:417 +#: ../../library/http.cookiejar.rst:416 msgid "Implement Netscape protocol." msgstr "" -#: ../../library/http.cookiejar.rst:422 +#: ../../library/http.cookiejar.rst:421 msgid "Implement :rfc:`2965` protocol." msgstr "" -#: ../../library/http.cookiejar.rst:427 +#: ../../library/http.cookiejar.rst:426 msgid "" "Don't add :mailheader:`Cookie2` header to requests (the presence of this " "header indicates to the server that we understand :rfc:`2965` cookies)." msgstr "" -#: ../../library/http.cookiejar.rst:430 +#: ../../library/http.cookiejar.rst:429 msgid "" "The most useful way to define a :class:`CookiePolicy` class is by " "subclassing from :class:`DefaultCookiePolicy` and overriding some or all of " @@ -578,28 +578,28 @@ msgid "" "to be useful)." msgstr "" -#: ../../library/http.cookiejar.rst:439 +#: ../../library/http.cookiejar.rst:438 msgid "DefaultCookiePolicy Objects" msgstr "DefaultCookiePolicy 物件" -#: ../../library/http.cookiejar.rst:441 +#: ../../library/http.cookiejar.rst:440 msgid "Implements the standard rules for accepting and returning cookies." msgstr "" -#: ../../library/http.cookiejar.rst:443 +#: ../../library/http.cookiejar.rst:442 msgid "" "Both :rfc:`2965` and Netscape cookies are covered. RFC 2965 handling is " "switched off by default." msgstr "" -#: ../../library/http.cookiejar.rst:446 +#: ../../library/http.cookiejar.rst:445 msgid "" "The easiest way to provide your own policy is to override this class and " "call its methods in your overridden implementations before adding your own " "additional checks::" msgstr "" -#: ../../library/http.cookiejar.rst:459 +#: ../../library/http.cookiejar.rst:458 msgid "" "In addition to the features required to implement the :class:`CookiePolicy` " "interface, this class allows you to block and allow domains from setting and " @@ -608,7 +608,7 @@ msgid "" "cost of blocking some benign cookies)." msgstr "" -#: ../../library/http.cookiejar.rst:465 +#: ../../library/http.cookiejar.rst:464 msgid "" "A domain blocklist and allowlist is provided (both off by default). Only " "domains not in the blocklist and present in the allowlist (if the allowlist " @@ -619,7 +619,7 @@ msgid "" "off again by setting it to :const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:473 +#: ../../library/http.cookiejar.rst:472 msgid "" "Domains in block or allow lists that do not start with a dot must equal the " "cookie domain to be matched. For example, ``\"example.com\"`` matches a " @@ -632,46 +632,46 @@ msgid "" "192.168.1.2 is blocked, but 193.168.1.2 is not." msgstr "" -#: ../../library/http.cookiejar.rst:482 +#: ../../library/http.cookiejar.rst:481 msgid "" ":class:`DefaultCookiePolicy` implements the following additional methods:" msgstr "" -#: ../../library/http.cookiejar.rst:487 +#: ../../library/http.cookiejar.rst:486 msgid "Return the sequence of blocked domains (as a tuple)." msgstr "" -#: ../../library/http.cookiejar.rst:492 +#: ../../library/http.cookiejar.rst:491 msgid "Set the sequence of blocked domains." msgstr "" -#: ../../library/http.cookiejar.rst:497 +#: ../../library/http.cookiejar.rst:496 msgid "" "Return whether *domain* is on the blocklist for setting or receiving cookies." msgstr "" -#: ../../library/http.cookiejar.rst:502 +#: ../../library/http.cookiejar.rst:501 msgid "Return :const:`None`, or the sequence of allowed domains (as a tuple)." msgstr "" -#: ../../library/http.cookiejar.rst:507 +#: ../../library/http.cookiejar.rst:506 msgid "Set the sequence of allowed domains, or :const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:512 +#: ../../library/http.cookiejar.rst:511 msgid "" "Return whether *domain* is not on the allowlist for setting or receiving " "cookies." msgstr "" -#: ../../library/http.cookiejar.rst:515 +#: ../../library/http.cookiejar.rst:514 msgid "" ":class:`DefaultCookiePolicy` instances have the following attributes, which " "are all initialised from the constructor arguments of the same name, and " "which may all be assigned to." msgstr "" -#: ../../library/http.cookiejar.rst:522 +#: ../../library/http.cookiejar.rst:521 msgid "" "If true, request that the :class:`CookieJar` instance downgrade :rfc:`2109` " "cookies (ie. cookies received in a :mailheader:`Set-Cookie` header with a " @@ -682,22 +682,22 @@ msgid "" "by default." msgstr "" -#: ../../library/http.cookiejar.rst:530 +#: ../../library/http.cookiejar.rst:529 msgid "General strictness switches:" msgstr "" -#: ../../library/http.cookiejar.rst:534 +#: ../../library/http.cookiejar.rst:533 msgid "" "Don't allow sites to set two-component domains with country-code top-level " "domains like ``.co.uk``, ``.gov.uk``, ``.co.nz``.etc. This is far from " "perfect and isn't guaranteed to work!" msgstr "" -#: ../../library/http.cookiejar.rst:539 +#: ../../library/http.cookiejar.rst:538 msgid ":rfc:`2965` protocol strictness switches:" msgstr "" -#: ../../library/http.cookiejar.rst:543 +#: ../../library/http.cookiejar.rst:542 msgid "" "Follow :rfc:`2965` rules on unverifiable transactions (usually, an " "unverifiable transaction is one resulting from a redirect or a request for " @@ -705,46 +705,46 @@ msgid "" "blocked on the basis of verifiability" msgstr "" -#: ../../library/http.cookiejar.rst:549 +#: ../../library/http.cookiejar.rst:548 msgid "Netscape protocol strictness switches:" msgstr "" -#: ../../library/http.cookiejar.rst:553 +#: ../../library/http.cookiejar.rst:552 msgid "" "Apply :rfc:`2965` rules on unverifiable transactions even to Netscape " "cookies." msgstr "" -#: ../../library/http.cookiejar.rst:558 +#: ../../library/http.cookiejar.rst:557 msgid "" "Flags indicating how strict to be with domain-matching rules for Netscape " "cookies. See below for acceptable values." msgstr "" -#: ../../library/http.cookiejar.rst:564 +#: ../../library/http.cookiejar.rst:563 msgid "" "Ignore cookies in Set-Cookie: headers that have names starting with ``'$'``." msgstr "" -#: ../../library/http.cookiejar.rst:569 +#: ../../library/http.cookiejar.rst:568 msgid "Don't allow setting cookies whose path doesn't path-match request URI." msgstr "" -#: ../../library/http.cookiejar.rst:571 +#: ../../library/http.cookiejar.rst:570 msgid "" ":attr:`strict_ns_domain` is a collection of flags. Its value is constructed " "by or-ing together (for example, ``DomainStrictNoDots|" "DomainStrictNonDomain`` means both flags are set)." msgstr "" -#: ../../library/http.cookiejar.rst:578 +#: ../../library/http.cookiejar.rst:577 msgid "" "When setting cookies, the 'host prefix' must not contain a dot (eg. ``www." "foo.bar.com`` can't set a cookie for ``.bar.com``, because ``www.foo`` " "contains a dot)." msgstr "" -#: ../../library/http.cookiejar.rst:585 +#: ../../library/http.cookiejar.rst:584 msgid "" "Cookies that did not explicitly specify a ``domain`` cookie-attribute can " "only be returned to a domain equal to the domain that set the cookie (eg. " @@ -752,31 +752,31 @@ msgid "" "no ``domain`` cookie-attribute)." msgstr "" -#: ../../library/http.cookiejar.rst:593 +#: ../../library/http.cookiejar.rst:592 msgid "When setting cookies, require a full :rfc:`2965` domain-match." msgstr "" -#: ../../library/http.cookiejar.rst:595 +#: ../../library/http.cookiejar.rst:594 msgid "" "The following attributes are provided for convenience, and are the most " "useful combinations of the above flags:" msgstr "" -#: ../../library/http.cookiejar.rst:601 +#: ../../library/http.cookiejar.rst:600 msgid "" "Equivalent to 0 (ie. all of the above Netscape domain strictness flags " "switched off)." msgstr "" -#: ../../library/http.cookiejar.rst:607 +#: ../../library/http.cookiejar.rst:606 msgid "Equivalent to ``DomainStrictNoDots|DomainStrictNonDomain``." msgstr "等價於 ``DomainStrictNoDots|DomainStrictNonDomain``\\ 。" -#: ../../library/http.cookiejar.rst:611 +#: ../../library/http.cookiejar.rst:610 msgid "Cookie Objects" msgstr "Cookie 物件" -#: ../../library/http.cookiejar.rst:613 +#: ../../library/http.cookiejar.rst:612 msgid "" ":class:`Cookie` instances have Python attributes roughly corresponding to " "the standard cookie-attributes specified in the various cookie standards. " @@ -787,14 +787,14 @@ msgid "" "(Netscape) cookies." msgstr "" -#: ../../library/http.cookiejar.rst:621 +#: ../../library/http.cookiejar.rst:620 msgid "" "Assignment to these attributes should not be necessary other than in rare " "circumstances in a :class:`CookiePolicy` method. The class does not enforce " "internal consistency, so you should know what you're doing if you do that." msgstr "" -#: ../../library/http.cookiejar.rst:628 +#: ../../library/http.cookiejar.rst:627 msgid "" "Integer or :const:`None`. Netscape cookies have :attr:`version` 0. :rfc:" "`2965` and :rfc:`2109` cookies have a ``version`` cookie-attribute of 1. " @@ -802,51 +802,51 @@ msgid "" "Netscape cookies, in which case :attr:`version` is 0." msgstr "" -#: ../../library/http.cookiejar.rst:636 +#: ../../library/http.cookiejar.rst:635 msgid "Cookie name (a string)." msgstr "" -#: ../../library/http.cookiejar.rst:641 +#: ../../library/http.cookiejar.rst:640 msgid "Cookie value (a string), or :const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:646 +#: ../../library/http.cookiejar.rst:645 msgid "" "String representing a port or a set of ports (eg. '80', or '80,8080'), or :" "const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:652 +#: ../../library/http.cookiejar.rst:651 msgid "Cookie path (a string, eg. ``'/acme/rocket_launchers'``)." msgstr "" -#: ../../library/http.cookiejar.rst:657 +#: ../../library/http.cookiejar.rst:656 msgid "``True`` if cookie should only be returned over a secure connection." msgstr "" -#: ../../library/http.cookiejar.rst:662 +#: ../../library/http.cookiejar.rst:661 msgid "" "Integer expiry date in seconds since epoch, or :const:`None`. See also the :" "meth:`is_expired` method." msgstr "" -#: ../../library/http.cookiejar.rst:668 +#: ../../library/http.cookiejar.rst:667 msgid "``True`` if this is a session cookie." msgstr "" -#: ../../library/http.cookiejar.rst:673 +#: ../../library/http.cookiejar.rst:672 msgid "" "String comment from the server explaining the function of this cookie, or :" "const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:679 +#: ../../library/http.cookiejar.rst:678 msgid "" "URL linking to a comment from the server explaining the function of this " "cookie, or :const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:685 +#: ../../library/http.cookiejar.rst:684 msgid "" "``True`` if this cookie was received as an :rfc:`2109` cookie (ie. the " "cookie arrived in a :mailheader:`Set-Cookie` header, and the value of the " @@ -855,70 +855,70 @@ msgid "" "cookies, in which case :attr:`version` is 0." msgstr "" -#: ../../library/http.cookiejar.rst:694 +#: ../../library/http.cookiejar.rst:693 msgid "" "``True`` if a port or set of ports was explicitly specified by the server " "(in the :mailheader:`Set-Cookie` / :mailheader:`Set-Cookie2` header)." msgstr "" -#: ../../library/http.cookiejar.rst:700 +#: ../../library/http.cookiejar.rst:699 msgid "``True`` if a domain was explicitly specified by the server." msgstr "" -#: ../../library/http.cookiejar.rst:705 +#: ../../library/http.cookiejar.rst:704 msgid "" "``True`` if the domain explicitly specified by the server began with a dot " "(``'.'``)." msgstr "" -#: ../../library/http.cookiejar.rst:708 +#: ../../library/http.cookiejar.rst:707 msgid "" "Cookies may have additional non-standard cookie-attributes. These may be " "accessed using the following methods:" msgstr "" -#: ../../library/http.cookiejar.rst:714 +#: ../../library/http.cookiejar.rst:713 msgid "Return ``True`` if cookie has the named cookie-attribute." msgstr "" -#: ../../library/http.cookiejar.rst:719 +#: ../../library/http.cookiejar.rst:718 msgid "" "If cookie has the named cookie-attribute, return its value. Otherwise, " "return *default*." msgstr "" -#: ../../library/http.cookiejar.rst:725 +#: ../../library/http.cookiejar.rst:724 msgid "Set the value of the named cookie-attribute." msgstr "" -#: ../../library/http.cookiejar.rst:727 +#: ../../library/http.cookiejar.rst:726 msgid "The :class:`Cookie` class also defines the following method:" msgstr "" -#: ../../library/http.cookiejar.rst:732 +#: ../../library/http.cookiejar.rst:731 msgid "" "``True`` if cookie has passed the time at which the server requested it " "should expire. If *now* is given (in seconds since the epoch), return " "whether the cookie has expired at the specified time." msgstr "" -#: ../../library/http.cookiejar.rst:738 +#: ../../library/http.cookiejar.rst:737 msgid "Examples" msgstr "範例" -#: ../../library/http.cookiejar.rst:740 +#: ../../library/http.cookiejar.rst:739 msgid "" "The first example shows the most common usage of :mod:`http.cookiejar`::" msgstr "" -#: ../../library/http.cookiejar.rst:747 +#: ../../library/http.cookiejar.rst:746 msgid "" "This example illustrates how to open a URL using your Netscape, Mozilla, or " "Lynx cookies (assumes Unix/Netscape convention for location of the cookies " "file)::" msgstr "" -#: ../../library/http.cookiejar.rst:756 +#: ../../library/http.cookiejar.rst:755 msgid "" "The next example illustrates the use of :class:`DefaultCookiePolicy`. Turn " "on :rfc:`2965` cookies, be more strict about domains when setting and " diff --git a/library/idle.po b/library/idle.po index 2f18ce811a..5cbdab30c1 100644 --- a/library/idle.po +++ b/library/idle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-04 00:18+0000\n" +"POT-Creation-Date: 2022-08-12 00:15+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-" @@ -117,23 +117,23 @@ msgid "Open an existing file with an Open dialog." msgstr "" #: ../../library/idle.rst:65 -msgid "Recent Files" +msgid "Open Module..." msgstr "" #: ../../library/idle.rst:65 -msgid "Open a list of recent files. Click one to open it." +msgid "Open an existing module (searches sys.path)." msgstr "" #: ../../library/idle.rst:68 -msgid "Open Module..." +msgid "Recent Files" msgstr "" #: ../../library/idle.rst:68 -msgid "Open an existing module (searches sys.path)." +msgid "Open a list of recent files. Click one to open it." msgstr "" #: ../../library/idle.rst:76 -msgid "Class Browser" +msgid "Module Browser" msgstr "" #: ../../library/idle.rst:75 @@ -164,290 +164,293 @@ msgid "" "instead." msgstr "" -#: ../../library/idle.rst:90 +#: ../../library/idle.rst:93 msgid "Save As..." msgstr "" #: ../../library/idle.rst:89 msgid "" "Save the current window with a Save As dialog. The file saved becomes the " -"new associated file for the window." +"new associated file for the window. (If your file namager is set to hide " +"extensions, the current extension will be omitted in the file name box. If " +"the new filename has no '.', '.py' and '.txt' will be added for Python and " +"text files, except that on macOS Aqua,'.py' is added for all files.)" msgstr "" -#: ../../library/idle.rst:94 +#: ../../library/idle.rst:97 msgid "Save Copy As..." msgstr "" -#: ../../library/idle.rst:93 +#: ../../library/idle.rst:96 msgid "" "Save the current window to different file without changing the associated " -"file." +"file. (See Save As note above about filename extensions.)" msgstr "" -#: ../../library/idle.rst:97 +#: ../../library/idle.rst:100 msgid "Print Window" msgstr "" -#: ../../library/idle.rst:97 +#: ../../library/idle.rst:100 msgid "Print the current window to the default printer." msgstr "" -#: ../../library/idle.rst:102 +#: ../../library/idle.rst:105 msgid "Close Window" msgstr "" -#: ../../library/idle.rst:100 +#: ../../library/idle.rst:103 msgid "" "Close the current window (if an unsaved editor, ask to save; if an unsaved " "Shell, ask to quit execution). Calling ``exit()`` or ``close()`` in the " "Shell window also closes Shell. If this is the only window, also exit IDLE." msgstr "" -#: ../../library/idle.rst:105 +#: ../../library/idle.rst:108 msgid "Exit IDLE" msgstr "離開 IDLE" -#: ../../library/idle.rst:105 +#: ../../library/idle.rst:108 msgid "Close all windows and quit IDLE (ask to save unsaved edit windows)." msgstr "" -#: ../../library/idle.rst:108 +#: ../../library/idle.rst:111 msgid "Edit menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:112 +#: ../../library/idle.rst:115 msgid "Undo" msgstr "" -#: ../../library/idle.rst:111 +#: ../../library/idle.rst:114 msgid "" "Undo the last change to the current window. A maximum of 1000 changes may " "be undone." msgstr "" -#: ../../library/idle.rst:115 +#: ../../library/idle.rst:118 msgid "Redo" msgstr "" -#: ../../library/idle.rst:115 +#: ../../library/idle.rst:118 msgid "Redo the last undone change to the current window." msgstr "" -#: ../../library/idle.rst:118 ../../library/idle.rst:367 +#: ../../library/idle.rst:121 +msgid "Select All" +msgstr "選擇全部" + +#: ../../library/idle.rst:121 +msgid "Select the entire contents of the current window." +msgstr "" + +#: ../../library/idle.rst:124 ../../library/idle.rst:370 msgid "Cut" msgstr "剪下" -#: ../../library/idle.rst:118 ../../library/idle.rst:367 +#: ../../library/idle.rst:124 ../../library/idle.rst:370 msgid "" "Copy selection into the system-wide clipboard; then delete the selection." msgstr "" -#: ../../library/idle.rst:121 ../../library/idle.rst:370 +#: ../../library/idle.rst:127 ../../library/idle.rst:373 msgid "Copy" msgstr "複製" -#: ../../library/idle.rst:121 ../../library/idle.rst:370 +#: ../../library/idle.rst:127 ../../library/idle.rst:373 msgid "Copy selection into the system-wide clipboard." msgstr "" -#: ../../library/idle.rst:124 ../../library/idle.rst:373 +#: ../../library/idle.rst:130 ../../library/idle.rst:376 msgid "Paste" msgstr "貼上" -#: ../../library/idle.rst:124 ../../library/idle.rst:373 +#: ../../library/idle.rst:130 ../../library/idle.rst:376 msgid "Insert contents of the system-wide clipboard into the current window." msgstr "" -#: ../../library/idle.rst:126 +#: ../../library/idle.rst:132 msgid "The clipboard functions are also available in context menus." msgstr "" -#: ../../library/idle.rst:129 -msgid "Select All" -msgstr "選擇全部" - -#: ../../library/idle.rst:129 -msgid "Select the entire contents of the current window." -msgstr "" - -#: ../../library/idle.rst:132 +#: ../../library/idle.rst:135 msgid "Find..." msgstr "" -#: ../../library/idle.rst:132 +#: ../../library/idle.rst:135 msgid "Open a search dialog with many options" msgstr "" -#: ../../library/idle.rst:135 +#: ../../library/idle.rst:138 msgid "Find Again" msgstr "" -#: ../../library/idle.rst:135 +#: ../../library/idle.rst:138 msgid "Repeat the last search, if there is one." msgstr "" -#: ../../library/idle.rst:138 +#: ../../library/idle.rst:141 msgid "Find Selection" msgstr "" -#: ../../library/idle.rst:138 +#: ../../library/idle.rst:141 msgid "Search for the currently selected string, if there is one." msgstr "" -#: ../../library/idle.rst:141 +#: ../../library/idle.rst:144 msgid "Find in Files..." msgstr "" -#: ../../library/idle.rst:141 +#: ../../library/idle.rst:144 msgid "Open a file search dialog. Put results in a new output window." msgstr "" -#: ../../library/idle.rst:144 +#: ../../library/idle.rst:147 msgid "Replace..." msgstr "" -#: ../../library/idle.rst:144 +#: ../../library/idle.rst:147 msgid "Open a search-and-replace dialog." msgstr "" -#: ../../library/idle.rst:149 +#: ../../library/idle.rst:152 msgid "Go to Line" msgstr "" -#: ../../library/idle.rst:147 +#: ../../library/idle.rst:150 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:153 +#: ../../library/idle.rst:156 msgid "Show Completions" msgstr "" -#: ../../library/idle.rst:152 +#: ../../library/idle.rst:155 msgid "" "Open a scrollable list allowing selection of existing names. See :ref:" "`Completions ` in the Editing and navigation section below." msgstr "" -#: ../../library/idle.rst:157 +#: ../../library/idle.rst:160 msgid "Expand Word" msgstr "" -#: ../../library/idle.rst:156 +#: ../../library/idle.rst:159 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:162 -msgid "Show call tip" +#: ../../library/idle.rst:165 +msgid "Show Call Tip" msgstr "" -#: ../../library/idle.rst:160 +#: ../../library/idle.rst:163 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:165 -msgid "Show surrounding parens" +#: ../../library/idle.rst:168 +msgid "Show Surrounding Parens" msgstr "" -#: ../../library/idle.rst:165 +#: ../../library/idle.rst:168 msgid "Highlight the surrounding parenthesis." msgstr "" -#: ../../library/idle.rst:170 +#: ../../library/idle.rst:173 msgid "Format menu (Editor window only)" msgstr "" -#: ../../library/idle.rst:173 +#: ../../library/idle.rst:178 +msgid "Format Paragraph" +msgstr "" + +#: ../../library/idle.rst:176 +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 msgid "Indent Region" msgstr "" -#: ../../library/idle.rst:173 +#: ../../library/idle.rst:181 msgid "Shift selected lines right by the indent width (default 4 spaces)." msgstr "" -#: ../../library/idle.rst:176 +#: ../../library/idle.rst:184 msgid "Dedent Region" msgstr "" -#: ../../library/idle.rst:176 +#: ../../library/idle.rst:184 msgid "Shift selected lines left by the indent width (default 4 spaces)." msgstr "" -#: ../../library/idle.rst:179 +#: ../../library/idle.rst:187 msgid "Comment Out Region" msgstr "" -#: ../../library/idle.rst:179 +#: ../../library/idle.rst:187 msgid "Insert ## in front of selected lines." msgstr "" -#: ../../library/idle.rst:182 +#: ../../library/idle.rst:190 msgid "Uncomment Region" msgstr "" -#: ../../library/idle.rst:182 +#: ../../library/idle.rst:190 msgid "Remove leading # or ## from selected lines." msgstr "" -#: ../../library/idle.rst:186 +#: ../../library/idle.rst:194 msgid "Tabify Region" msgstr "" -#: ../../library/idle.rst:185 +#: ../../library/idle.rst:193 msgid "" "Turn *leading* stretches of spaces into tabs. (Note: We recommend using 4 " "space blocks to indent Python code.)" msgstr "" -#: ../../library/idle.rst:189 +#: ../../library/idle.rst:197 msgid "Untabify Region" msgstr "" -#: ../../library/idle.rst:189 +#: ../../library/idle.rst:197 msgid "Turn *all* tabs into the correct number of spaces." msgstr "" -#: ../../library/idle.rst:192 +#: ../../library/idle.rst:200 msgid "Toggle Tabs" msgstr "" -#: ../../library/idle.rst:192 +#: ../../library/idle.rst:200 msgid "Open a dialog to switch between indenting with spaces and tabs." msgstr "" -#: ../../library/idle.rst:196 +#: ../../library/idle.rst:204 msgid "New Indent Width" msgstr "" -#: ../../library/idle.rst:195 +#: ../../library/idle.rst:203 msgid "" "Open a dialog to change indent width. The accepted default by the Python " "community is 4 spaces." msgstr "" -#: ../../library/idle.rst:201 -msgid "Format Paragraph" -msgstr "" - -#: ../../library/idle.rst:199 -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." +#: ../../library/idle.rst:210 +msgid "Strip Trailing Chitespace" msgstr "" #: ../../library/idle.rst:207 -msgid "Strip trailing whitespace" -msgstr "" - -#: ../../library/idle.rst:204 msgid "" "Remove trailing space and other whitespace characters after the last non-" "whitespace character of a line by applying str.rstrip to each line, " @@ -455,15 +458,15 @@ msgid "" "extra newlines at the end of the file." msgstr "" -#: ../../library/idle.rst:213 +#: ../../library/idle.rst:216 msgid "Run menu (Editor window only)" msgstr "" -#: ../../library/idle.rst:224 +#: ../../library/idle.rst:227 msgid "Run Module" msgstr "" -#: ../../library/idle.rst:218 +#: ../../library/idle.rst:221 msgid "" "Do :ref:`Check Module `. If no error, restart the shell to " "clean the environment, then execute the module. Output is displayed in the " @@ -473,22 +476,22 @@ msgid "" "similar to executing a file with ``python -i file`` at a command line." msgstr "" -#: ../../library/idle.rst:231 +#: ../../library/idle.rst:234 msgid "Run... Customized" msgstr "" -#: ../../library/idle.rst:229 +#: ../../library/idle.rst:232 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:240 +#: ../../library/idle.rst:243 msgid "Check Module" msgstr "" -#: ../../library/idle.rst:236 +#: ../../library/idle.rst:239 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 " @@ -497,70 +500,70 @@ msgid "" "window." msgstr "" -#: ../../library/idle.rst:246 +#: ../../library/idle.rst:249 msgid "Python Shell" msgstr "" -#: ../../library/idle.rst:245 +#: ../../library/idle.rst:248 msgid "Open or wake up the Python Shell window." msgstr "" -#: ../../library/idle.rst:249 +#: ../../library/idle.rst:252 msgid "Shell menu (Shell window only)" msgstr "" -#: ../../library/idle.rst:252 +#: ../../library/idle.rst:255 msgid "View Last Restart" msgstr "" -#: ../../library/idle.rst:252 +#: ../../library/idle.rst:255 msgid "Scroll the shell window to the last Shell restart." msgstr "" -#: ../../library/idle.rst:255 +#: ../../library/idle.rst:258 msgid "Restart Shell" msgstr "" -#: ../../library/idle.rst:255 +#: ../../library/idle.rst:258 msgid "" "Restart the shell to clean the environment and reset display and exception " "handling." msgstr "" -#: ../../library/idle.rst:258 +#: ../../library/idle.rst:261 msgid "Previous History" msgstr "" -#: ../../library/idle.rst:258 +#: ../../library/idle.rst:261 msgid "" "Cycle through earlier commands in history which match the current entry." msgstr "" -#: ../../library/idle.rst:261 +#: ../../library/idle.rst:264 msgid "Next History" msgstr "" -#: ../../library/idle.rst:261 +#: ../../library/idle.rst:264 msgid "Cycle through later commands in history which match the current entry." msgstr "" -#: ../../library/idle.rst:264 +#: ../../library/idle.rst:267 msgid "Interrupt Execution" msgstr "" -#: ../../library/idle.rst:264 +#: ../../library/idle.rst:267 msgid "Stop a running program." msgstr "" -#: ../../library/idle.rst:267 +#: ../../library/idle.rst:270 msgid "Debug menu (Shell window only)" msgstr "" -#: ../../library/idle.rst:274 +#: ../../library/idle.rst:277 msgid "Go to File/Line" msgstr "" -#: ../../library/idle.rst:270 +#: ../../library/idle.rst:273 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 " @@ -569,45 +572,45 @@ msgid "" "Shell window and Output windows." msgstr "" -#: ../../library/idle.rst:283 +#: ../../library/idle.rst:286 msgid "Debugger (toggle)" msgstr "" -#: ../../library/idle.rst:281 +#: ../../library/idle.rst:284 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:287 +#: ../../library/idle.rst:290 msgid "Stack Viewer" msgstr "" -#: ../../library/idle.rst:286 +#: ../../library/idle.rst:289 msgid "" "Show the stack traceback of the last exception in a tree widget, with access " "to locals and globals." msgstr "" -#: ../../library/idle.rst:290 +#: ../../library/idle.rst:293 msgid "Auto-open Stack Viewer" msgstr "" -#: ../../library/idle.rst:290 +#: ../../library/idle.rst:293 msgid "" "Toggle automatically opening the stack viewer on an unhandled exception." msgstr "" -#: ../../library/idle.rst:293 +#: ../../library/idle.rst:296 msgid "Options menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:301 +#: ../../library/idle.rst:304 msgid "Configure IDLE" msgstr "" -#: ../../library/idle.rst:296 +#: ../../library/idle.rst:299 msgid "" "Open a configuration dialog and change preferences for the following: fonts, " "indentation, keybindings, text color themes, startup windows and size, " @@ -616,39 +619,39 @@ msgid "" "see :ref:`Setting preferences ` under Help and preferences." msgstr "" -#: ../../library/idle.rst:303 +#: ../../library/idle.rst:306 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:313 msgid "Show/Hide Code Context (Editor Window only)" msgstr "" -#: ../../library/idle.rst:307 +#: ../../library/idle.rst:310 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:315 +#: ../../library/idle.rst:318 msgid "Show/Hide Line Numbers (Editor Window only)" msgstr "" -#: ../../library/idle.rst:313 +#: ../../library/idle.rst:316 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:323 +#: ../../library/idle.rst:326 msgid "Zoom/Restore Height" msgstr "" -#: ../../library/idle.rst:318 +#: ../../library/idle.rst:321 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 " @@ -658,74 +661,74 @@ msgid "" "no effect when a window is maximized." msgstr "" -#: ../../library/idle.rst:326 +#: ../../library/idle.rst:329 msgid "Window menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:328 +#: ../../library/idle.rst:331 msgid "" "Lists the names of all open windows; select one to bring it to the " "foreground (deiconifying it if necessary)." msgstr "" -#: ../../library/idle.rst:332 +#: ../../library/idle.rst:335 msgid "Help menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:335 +#: ../../library/idle.rst:338 msgid "About IDLE" msgstr "" -#: ../../library/idle.rst:335 +#: ../../library/idle.rst:338 msgid "Display version, copyright, license, credits, and more." msgstr "" -#: ../../library/idle.rst:339 +#: ../../library/idle.rst:342 msgid "IDLE Help" msgstr "" -#: ../../library/idle.rst:338 +#: ../../library/idle.rst:341 msgid "" "Display this IDLE document, detailing the menu options, basic editing and " "navigation, and other tips." msgstr "" -#: ../../library/idle.rst:343 +#: ../../library/idle.rst:346 msgid "Python Docs" msgstr "" -#: ../../library/idle.rst:342 +#: ../../library/idle.rst:345 msgid "" "Access local Python documentation, if installed, or start a web browser and " "open docs.python.org showing the latest Python documentation." msgstr "" -#: ../../library/idle.rst:346 +#: ../../library/idle.rst:349 msgid "Turtle Demo" msgstr "" -#: ../../library/idle.rst:346 +#: ../../library/idle.rst:349 msgid "Run the turtledemo module with example Python code and turtle drawings." msgstr "" -#: ../../library/idle.rst:348 +#: ../../library/idle.rst:351 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:361 +#: ../../library/idle.rst:364 msgid "Context menus" msgstr "" -#: ../../library/idle.rst:363 +#: ../../library/idle.rst:366 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:375 +#: ../../library/idle.rst:378 msgid "" "Editor windows also have breakpoint functions. Lines with a breakpoint set " "are specially marked. Breakpoints only have an effect when running under " @@ -733,66 +736,66 @@ msgid "" "directory." msgstr "" -#: ../../library/idle.rst:381 +#: ../../library/idle.rst:384 msgid "Set Breakpoint" msgstr "" -#: ../../library/idle.rst:381 +#: ../../library/idle.rst:384 msgid "Set a breakpoint on the current line." msgstr "" -#: ../../library/idle.rst:384 +#: ../../library/idle.rst:387 msgid "Clear Breakpoint" msgstr "" -#: ../../library/idle.rst:384 +#: ../../library/idle.rst:387 msgid "Clear the breakpoint on that line." msgstr "" -#: ../../library/idle.rst:386 +#: ../../library/idle.rst:389 msgid "Shell and Output windows also have the following." msgstr "" -#: ../../library/idle.rst:389 +#: ../../library/idle.rst:392 msgid "Go to file/line" msgstr "" -#: ../../library/idle.rst:389 +#: ../../library/idle.rst:392 msgid "Same as in Debug menu." msgstr "" -#: ../../library/idle.rst:391 +#: ../../library/idle.rst:394 msgid "" "The Shell window also has an output squeezing facility explained in the " "*Python Shell window* subsection below." msgstr "" -#: ../../library/idle.rst:397 +#: ../../library/idle.rst:400 msgid "Squeeze" msgstr "" -#: ../../library/idle.rst:395 +#: ../../library/idle.rst:398 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:402 +#: ../../library/idle.rst:405 msgid "Editing and Navigation" msgstr "" -#: ../../library/idle.rst:405 +#: ../../library/idle.rst:408 msgid "Editor windows" msgstr "" -#: ../../library/idle.rst:407 +#: ../../library/idle.rst:410 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:411 +#: ../../library/idle.rst:414 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 " @@ -800,99 +803,99 @@ msgid "" "numbers with 0." msgstr "" -#: ../../library/idle.rst:416 +#: ../../library/idle.rst:419 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:420 +#: ../../library/idle.rst:423 msgid "Key bindings" msgstr "" -#: ../../library/idle.rst:422 +#: ../../library/idle.rst:425 msgid "" "In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix " "and the :kbd:`Command` key on macOS." msgstr "" -#: ../../library/idle.rst:425 +#: ../../library/idle.rst:428 msgid ":kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right" msgstr "" -#: ../../library/idle.rst:427 +#: ../../library/idle.rst:430 msgid "" ":kbd:`C-Backspace` delete word left; :kbd:`C-Del` delete word to the right" msgstr "" -#: ../../library/idle.rst:429 +#: ../../library/idle.rst:432 msgid "Arrow keys and :kbd:`Page Up`/:kbd:`Page Down` to move around" msgstr "" -#: ../../library/idle.rst:431 +#: ../../library/idle.rst:434 msgid ":kbd:`C-LeftArrow` and :kbd:`C-RightArrow` moves by words" msgstr "" -#: ../../library/idle.rst:433 +#: ../../library/idle.rst:436 msgid ":kbd:`Home`/:kbd:`End` go to begin/end of line" msgstr "" -#: ../../library/idle.rst:435 +#: ../../library/idle.rst:438 msgid ":kbd:`C-Home`/:kbd:`C-End` go to begin/end of file" msgstr "" -#: ../../library/idle.rst:437 +#: ../../library/idle.rst:440 msgid "Some useful Emacs bindings are inherited from Tcl/Tk:" msgstr "" -#: ../../library/idle.rst:439 +#: ../../library/idle.rst:442 msgid ":kbd:`C-a` beginning of line" msgstr "" -#: ../../library/idle.rst:441 +#: ../../library/idle.rst:444 msgid ":kbd:`C-e` end of line" msgstr "" -#: ../../library/idle.rst:443 +#: ../../library/idle.rst:446 msgid ":kbd:`C-k` kill line (but doesn't put it in clipboard)" msgstr "" -#: ../../library/idle.rst:445 +#: ../../library/idle.rst:448 msgid ":kbd:`C-l` center window around the insertion point" msgstr "" -#: ../../library/idle.rst:447 +#: ../../library/idle.rst:450 msgid "" ":kbd:`C-b` go backward one character without deleting (usually you can also " "use the cursor key for this)" msgstr "" -#: ../../library/idle.rst:450 +#: ../../library/idle.rst:453 msgid "" ":kbd:`C-f` go forward one character without deleting (usually you can also " "use the cursor key for this)" msgstr "" -#: ../../library/idle.rst:453 +#: ../../library/idle.rst:456 msgid "" ":kbd:`C-p` go up one line (usually you can also use the cursor key for this)" msgstr "" -#: ../../library/idle.rst:456 +#: ../../library/idle.rst:459 msgid ":kbd:`C-d` delete next character" msgstr "" -#: ../../library/idle.rst:458 +#: ../../library/idle.rst:461 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:462 +#: ../../library/idle.rst:465 msgid "Automatic indentation" msgstr "" -#: ../../library/idle.rst:464 +#: ../../library/idle.rst:467 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 " @@ -902,17 +905,29 @@ msgid "" "tabs are restricted to four spaces due to Tcl/Tk limitations." msgstr "" -#: ../../library/idle.rst:471 +#: ../../library/idle.rst:474 msgid "" "See also the indent/dedent region commands on the :ref:`Format menu `." msgstr "" -#: ../../library/idle.rst:477 +#: ../../library/idle.rst:478 +msgid "Search and Replace" +msgstr "" + +#: ../../library/idle.rst:480 +msgid "" +"Any selection becomes a search target. However, only selections within a " +"line work because searches are only performed within lines with the terminal " +"newline removed. If ``[x] Regular expresion`` is checked, the target is " +"interpreted according to the Python re module." +msgstr "" + +#: ../../library/idle.rst:488 msgid "Completions" msgstr "" -#: ../../library/idle.rst:479 +#: ../../library/idle.rst:490 msgid "" "Completions are supplied, when requested and available, for module names, " "attributes of classes or functions, or filenames. Each request method " @@ -925,7 +940,7 @@ msgid "" "box. A double click within the box selects and closes." msgstr "" -#: ../../library/idle.rst:490 +#: ../../library/idle.rst:501 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. " @@ -937,7 +952,7 @@ msgid "" "directory name and a separator." msgstr "" -#: ../../library/idle.rst:500 +#: ../../library/idle.rst:511 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 :" @@ -948,7 +963,7 @@ msgid "" "directory." msgstr "" -#: ../../library/idle.rst:508 +#: ../../library/idle.rst:519 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 " @@ -956,14 +971,14 @@ msgid "" "without opening a box." msgstr "" -#: ../../library/idle.rst:513 +#: ../../library/idle.rst:524 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:517 +#: ../../library/idle.rst:528 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 " @@ -971,18 +986,18 @@ msgid "" "file. This also increases possible attribute completions." msgstr "" -#: ../../library/idle.rst:523 +#: ../../library/idle.rst:534 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:530 +#: ../../library/idle.rst:541 msgid "Calltips" msgstr "" -#: ../../library/idle.rst:532 +#: ../../library/idle.rst:543 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 " @@ -992,7 +1007,7 @@ msgid "" "or enter its shortcut to display a calltip." msgstr "" -#: ../../library/idle.rst:539 +#: ../../library/idle.rst:550 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 " @@ -1001,14 +1016,14 @@ msgid "" "or name (keyword) only. Details are subject to change." msgstr "" -#: ../../library/idle.rst:545 +#: ../../library/idle.rst:556 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:549 +#: ../../library/idle.rst:560 msgid "" "For example, restart the Shell and enter ``itertools.count(``. A calltip " "appears because Idle imports itertools into the user process for its own " @@ -1018,18 +1033,18 @@ msgid "" "display a calltip." msgstr "" -#: ../../library/idle.rst:556 +#: ../../library/idle.rst:567 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:563 +#: ../../library/idle.rst:574 msgid "Code Context" msgstr "" -#: ../../library/idle.rst:565 +#: ../../library/idle.rst:576 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 " @@ -1043,23 +1058,23 @@ msgid "" "the top of the editor." msgstr "" -#: ../../library/idle.rst:576 +#: ../../library/idle.rst:587 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:580 +#: ../../library/idle.rst:591 msgid "Shell window" msgstr "" -#: ../../library/idle.rst:582 +#: ../../library/idle.rst:593 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:585 +#: ../../library/idle.rst:596 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:" @@ -1067,7 +1082,7 @@ msgid "" "compound statement by entering a blank line after the statement." msgstr "" -#: ../../library/idle.rst:591 +#: ../../library/idle.rst:602 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 " @@ -1076,7 +1091,7 @@ msgid "" "one." msgstr "" -#: ../../library/idle.rst:597 +#: ../../library/idle.rst:608 msgid "" "Lines containing ``RESTART`` mean that the user execution process has been " "re-started. This occurs when the user execution process has crashed, when " @@ -1084,50 +1099,50 @@ msgid "" "window." msgstr "" -#: ../../library/idle.rst:602 +#: ../../library/idle.rst:613 msgid "" "The editing features described in previous subsections work when entering " "code interactively. IDLE's Shell window also responds to the following keys." msgstr "" -#: ../../library/idle.rst:605 +#: ../../library/idle.rst:616 msgid ":kbd:`C-c` interrupts executing command" msgstr "" -#: ../../library/idle.rst:607 +#: ../../library/idle.rst:618 msgid "" ":kbd:`C-d` sends end-of-file; closes window if typed at a ``>>>`` prompt" msgstr "" -#: ../../library/idle.rst:609 +#: ../../library/idle.rst:620 msgid ":kbd:`Alt-/` (Expand word) is also useful to reduce typing" msgstr "" -#: ../../library/idle.rst:611 +#: ../../library/idle.rst:622 msgid "Command history" msgstr "" -#: ../../library/idle.rst:613 +#: ../../library/idle.rst:624 msgid "" ":kbd:`Alt-p` retrieves previous command matching what you have typed. On " "macOS use :kbd:`C-p`." msgstr "" -#: ../../library/idle.rst:616 +#: ../../library/idle.rst:627 msgid ":kbd:`Alt-n` retrieves next. On macOS use :kbd:`C-n`." msgstr "" -#: ../../library/idle.rst:618 +#: ../../library/idle.rst:629 msgid "" ":kbd:`Return` while the cursor is on any previous command retrieves that " "command" msgstr "" -#: ../../library/idle.rst:622 +#: ../../library/idle.rst:633 msgid "Text colors" msgstr "" -#: ../../library/idle.rst:624 +#: ../../library/idle.rst:635 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 " @@ -1137,7 +1152,7 @@ msgid "" "(when present), found text (when possible), and selected text." msgstr "" -#: ../../library/idle.rst:631 +#: ../../library/idle.rst:642 msgid "" "IDLE also highlights the :ref:`soft keywords ` :keyword:" "`match`, :keyword:`case `, and :keyword:`_ ` in " @@ -1146,7 +1161,7 @@ msgid "" "patterns." msgstr "" -#: ../../library/idle.rst:637 +#: ../../library/idle.rst:648 msgid "" "Text coloring is done in the background, so uncolorized text is occasionally " "visible. To change the color scheme, use the Configure IDLE dialog " @@ -1154,11 +1169,11 @@ msgid "" "and text in popups and dialogs is not user-configurable." msgstr "" -#: ../../library/idle.rst:644 +#: ../../library/idle.rst:655 msgid "Startup and Code Execution" msgstr "" -#: ../../library/idle.rst:646 +#: ../../library/idle.rst:657 msgid "" "Upon startup with the ``-s`` option, IDLE will execute the file referenced " "by the environment variables :envvar:`IDLESTARTUP` or :envvar:" @@ -1170,7 +1185,7 @@ msgid "" "modules." msgstr "" -#: ../../library/idle.rst:654 +#: ../../library/idle.rst:665 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`` " @@ -1179,15 +1194,15 @@ msgid "" "importing functions to be used from IDLE's Python shell." msgstr "" -#: ../../library/idle.rst:661 +#: ../../library/idle.rst:672 msgid "Command line usage" msgstr "" -#: ../../library/idle.rst:677 +#: ../../library/idle.rst:688 msgid "If there are arguments:" msgstr "" -#: ../../library/idle.rst:679 +#: ../../library/idle.rst:690 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'``. " @@ -1195,17 +1210,17 @@ msgid "" "dialog." msgstr "" -#: ../../library/idle.rst:684 +#: ../../library/idle.rst:695 msgid "" "Otherwise, arguments are files opened for editing and ``sys.argv`` reflects " "the arguments passed to IDLE itself." msgstr "" -#: ../../library/idle.rst:688 +#: ../../library/idle.rst:699 msgid "Startup failure" msgstr "" -#: ../../library/idle.rst:690 +#: ../../library/idle.rst:701 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 " @@ -1215,7 +1230,7 @@ msgid "" "directs the user here. It then exits." msgstr "" -#: ../../library/idle.rst:697 +#: ../../library/idle.rst:708 msgid "" "One specific connection failure on Unix systems results from misconfigured " "masquerading rules somewhere in a system's network setup. When IDLE is " @@ -1225,7 +1240,7 @@ msgid "" "``tcplisten `` in another." msgstr "" -#: ../../library/idle.rst:705 +#: ../../library/idle.rst:716 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 " @@ -1234,7 +1249,7 @@ msgid "" "file." msgstr "" -#: ../../library/idle.rst:711 +#: ../../library/idle.rst:722 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 " @@ -1244,7 +1259,7 @@ msgid "" "connections." msgstr "" -#: ../../library/idle.rst:718 +#: ../../library/idle.rst:729 msgid "" "Python installation issues occasionally stop IDLE: multiple versions can " "clash, or a single installation might need admin access. If one undo the " @@ -1252,7 +1267,7 @@ msgid "" "completely remove Python and start over." msgstr "" -#: ../../library/idle.rst:723 +#: ../../library/idle.rst:734 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 " @@ -1261,7 +1276,7 @@ msgid "" "may fix a temporary problem." msgstr "" -#: ../../library/idle.rst:729 +#: ../../library/idle.rst:740 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 " @@ -1272,14 +1287,14 @@ msgid "" "with the settings dialog." msgstr "" -#: ../../library/idle.rst:737 +#: ../../library/idle.rst:748 msgid "" "If IDLE quits with no message, and it was not started from a console, try " "starting it from a console or terminal (``python -m idlelib``) and see if " "this results in an error message." msgstr "" -#: ../../library/idle.rst:741 +#: ../../library/idle.rst:752 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 " @@ -1288,11 +1303,11 @@ msgid "" "upgrade tcl/tk, then re-configure IDLE to use a font that works better." msgstr "" -#: ../../library/idle.rst:749 +#: ../../library/idle.rst:760 msgid "Running user code" msgstr "" -#: ../../library/idle.rst:751 +#: ../../library/idle.rst:762 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, " @@ -1302,7 +1317,7 @@ msgid "" "``threading.active_count()`` returns 2 instead of 1." msgstr "" -#: ../../library/idle.rst:758 +#: ../../library/idle.rst:769 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 " @@ -1312,7 +1327,7 @@ msgid "" "__stderr__`` are not touched, but may be ``None``." msgstr "" -#: ../../library/idle.rst:765 +#: ../../library/idle.rst:776 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 " @@ -1324,7 +1339,7 @@ msgid "" "fields and lines." msgstr "" -#: ../../library/idle.rst:774 +#: ../../library/idle.rst:785 msgid "" "IDLE's standard stream replacements are not inherited by subprocesses " "created in the execution process, whether directly by user code or by " @@ -1335,14 +1350,14 @@ msgid "" "attached to that window for input and output." msgstr "" -#: ../../library/idle.rst:783 +#: ../../library/idle.rst:794 msgid "" "If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, " "IDLE's changes are lost and input from the keyboard and output to the screen " "will not work correctly." msgstr "" -#: ../../library/idle.rst:787 +#: ../../library/idle.rst:798 msgid "" "When Shell has the focus, it controls the keyboard and screen. This is " "normally transparent, but functions that directly access the keyboard and " @@ -1350,7 +1365,7 @@ msgid "" "determine whether a key has been pressed and if so, which." msgstr "" -#: ../../library/idle.rst:792 +#: ../../library/idle.rst:803 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 " @@ -1358,17 +1373,17 @@ msgid "" "frames." msgstr "" -#: ../../library/idle.rst:797 +#: ../../library/idle.rst:808 msgid "" "When user code raises SystemExit either directly or by calling sys.exit, " "IDLE returns to a Shell prompt instead of exiting." msgstr "" -#: ../../library/idle.rst:801 +#: ../../library/idle.rst:812 msgid "User output in Shell" msgstr "" -#: ../../library/idle.rst:803 +#: ../../library/idle.rst:814 msgid "" "When a program outputs text, the result is determined by the corresponding " "output device. When IDLE executes user code, ``sys.stdout`` and ``sys." @@ -1378,7 +1393,7 @@ msgid "" "rather than production runs." msgstr "" -#: ../../library/idle.rst:810 +#: ../../library/idle.rst:821 msgid "" "For instance, Shell never throws away output. A program that sends " "unlimited output to Shell will eventually fill memory, resulting in a memory " @@ -1387,7 +1402,7 @@ msgid "" "lines, with 300 the default." msgstr "" -#: ../../library/idle.rst:816 +#: ../../library/idle.rst:827 msgid "" "A Tk Text widget, and hence IDLE's Shell, displays characters (codepoints) " "in the BMP (Basic Multilingual Plane) subset of Unicode. Which characters " @@ -1401,7 +1416,7 @@ msgid "" "spacing behavior.) ::" msgstr "" -#: ../../library/idle.rst:834 +#: ../../library/idle.rst:845 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 " @@ -1410,13 +1425,13 @@ msgid "" "regardless of how they are displayed." msgstr "" -#: ../../library/idle.rst:840 +#: ../../library/idle.rst:851 msgid "" "Normal and error output are generally kept separate (on separate lines) from " "code input and each other. They each get different highlight colors." msgstr "" -#: ../../library/idle.rst:843 +#: ../../library/idle.rst:854 msgid "" "For SyntaxError tracebacks, the normal '^' marking where the error was " "detected is replaced by coloring the text with an error highlight. When code " @@ -1425,7 +1440,7 @@ msgid "" "opened if necessary." msgstr "" -#: ../../library/idle.rst:849 +#: ../../library/idle.rst:860 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 " @@ -1434,18 +1449,18 @@ msgid "" "on the output. This can be useful lines long enough to slow down scrolling." msgstr "" -#: ../../library/idle.rst:857 +#: ../../library/idle.rst:868 msgid "" "Squeezed output is expanded in place by double-clicking the label. It can " "also be sent to the clipboard or a separate view window by right-clicking " "the label." msgstr "" -#: ../../library/idle.rst:862 +#: ../../library/idle.rst:873 msgid "Developing tkinter applications" msgstr "" -#: ../../library/idle.rst:864 +#: ../../library/idle.rst:875 msgid "" "IDLE is intentionally different from standard Python in order to facilitate " "development of tkinter programs. Enter ``import tkinter as tk; root = tk." @@ -1457,7 +1472,7 @@ msgid "" "changes in standard Python until one enters ``root.update()``." msgstr "" -#: ../../library/idle.rst:873 +#: ../../library/idle.rst:884 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 " @@ -1465,7 +1480,7 @@ msgid "" "``mainloop()`` returns, at which time there is nothing left to interact with." msgstr "" -#: ../../library/idle.rst:879 +#: ../../library/idle.rst:890 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 " @@ -1473,11 +1488,11 @@ msgid "" "mainloop call when running in standard Python." msgstr "" -#: ../../library/idle.rst:885 +#: ../../library/idle.rst:896 msgid "Running without a subprocess" msgstr "" -#: ../../library/idle.rst:887 +#: ../../library/idle.rst:898 msgid "" "By default, IDLE executes user code in a separate subprocess via a socket, " "which uses the internal loopback interface. This connection is not " @@ -1485,7 +1500,7 @@ msgid "" "firewall software complains anyway, you can ignore it." msgstr "" -#: ../../library/idle.rst:892 +#: ../../library/idle.rst:903 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 " @@ -1494,7 +1509,7 @@ msgid "" "command line switch." msgstr "" -#: ../../library/idle.rst:898 +#: ../../library/idle.rst:909 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 " @@ -1508,15 +1523,15 @@ msgid "" "at all possible." msgstr "" -#: ../../library/idle.rst:913 +#: ../../library/idle.rst:924 msgid "Help and Preferences" msgstr "" -#: ../../library/idle.rst:918 +#: ../../library/idle.rst:929 msgid "Help sources" msgstr "" -#: ../../library/idle.rst:920 +#: ../../library/idle.rst:931 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 " @@ -1526,7 +1541,7 @@ msgid "" "the opened box." msgstr "" -#: ../../library/idle.rst:928 +#: ../../library/idle.rst:939 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 " @@ -1535,17 +1550,17 @@ msgid "" "instead." msgstr "" -#: ../../library/idle.rst:934 +#: ../../library/idle.rst:945 msgid "" "Selected URLs can be added or removed from the help menu at any time using " "the General tab of the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:940 +#: ../../library/idle.rst:951 msgid "Setting preferences" msgstr "" -#: ../../library/idle.rst:942 +#: ../../library/idle.rst:953 msgid "" "The font preferences, highlighting, keys, and general preferences can be " "changed via Configure IDLE on the Option menu. Non-default user settings are " @@ -1554,7 +1569,7 @@ msgid "" "or more of the files in ``.idlerc``." msgstr "" -#: ../../library/idle.rst:948 +#: ../../library/idle.rst:959 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 " @@ -1563,7 +1578,7 @@ msgid "" "them to the top of the sample and try changing first size and then font." msgstr "" -#: ../../library/idle.rst:955 +#: ../../library/idle.rst:966 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, " @@ -1571,22 +1586,22 @@ msgid "" "IDLEs." msgstr "" -#: ../../library/idle.rst:961 +#: ../../library/idle.rst:972 msgid "IDLE on macOS" msgstr "" -#: ../../library/idle.rst:963 +#: ../../library/idle.rst:974 msgid "" "Under System Preferences: Dock, one can set \"Prefer tabs when opening " "documents\" to \"Always\". This setting is not compatible with the tk/" "tkinter GUI framework used by IDLE, and it breaks a few IDLE features." msgstr "" -#: ../../library/idle.rst:968 +#: ../../library/idle.rst:979 msgid "Extensions" msgstr "" -#: ../../library/idle.rst:970 +#: ../../library/idle.rst:981 msgid "" "IDLE contains an extension facility. Preferences for extensions can be " "changed with the Extensions tab of the preferences dialog. See the beginning " @@ -1594,3 +1609,26 @@ msgid "" "The only current default extension is zzdummy, an example also used for " "testing." msgstr "" + +#: ../../library/idle.rst:989 +msgid "idlelib" +msgstr "idlelib" + +#: ../../library/idle.rst:994 +msgid "**Source code:** :source:`Lib/idlelib`" +msgstr "**原始碼:**\\ :source:`Lib/idlelib/`" + +#: ../../library/idle.rst:998 +msgid "" +"The Lib/idlelib package implements the IDLE application. See the rest of " +"this page for how to use IDLE." +msgstr "" + +#: ../../library/idle.rst:1001 +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 " +"maps IDLE menu items to the code that implements the item. Except for files " +"listed under 'Startup', the idlelib code is 'private' in sense that feature " +"changes can be backported (see :pep:`434`)." +msgstr "" diff --git a/library/json.po b/library/json.po index 1624f30b74..4028ac1ceb 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -223,7 +223,7 @@ msgid "" "*object_hook* is an optional function that will be called with the result of " "any object literal decoded (a :class:`dict`). The return value of " "*object_hook* will be used instead of the :class:`dict`. This feature can " -"be used to implement custom decoders (e.g. `JSON-RPC `_ class hinting)." msgstr "" @@ -403,7 +403,7 @@ msgid "" "*object_hook*, if specified, 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)." +"support `JSON-RPC `_ class hinting)." msgstr "" #: ../../library/json.rst:331 diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 43a7c00301..1107fa6006 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-16 00:17+0000\n" +"POT-Creation-Date: 2022-08-31 00:21+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-" @@ -750,11 +750,21 @@ msgstr "" #: ../../library/logging.handlers.rst:575 msgid "" +"As UDP is not a streaming protocol, there is no persistent connection " +"between an instance of this handler and *host*. For this reason, when using " +"a network socket, a DNS lookup might have to be made each time an event is " +"logged, which can introduce some latency into the system. If this affects " +"you, you can do a lookup yourself and initialize this handler using the " +"looked-up IP address rather than the hostname." +msgstr "" + +#: ../../library/logging.handlers.rst:582 +msgid "" "If ``port`` is specified as ``None``, a Unix domain socket is created using " "the value in ``host`` - otherwise, a UDP socket is created." msgstr "" -#: ../../library/logging.handlers.rst:581 +#: ../../library/logging.handlers.rst:588 msgid "" "Pickles the record's attribute dictionary and writes it to the socket in " "binary format. If there is an error with the socket, silently drops the " @@ -762,29 +772,29 @@ msgid "" "LogRecord`, use the :func:`~logging.makeLogRecord` function." msgstr "" -#: ../../library/logging.handlers.rst:590 +#: ../../library/logging.handlers.rst:597 msgid "" "The factory method of :class:`SocketHandler` is here overridden to create a " "UDP socket (:const:`socket.SOCK_DGRAM`)." msgstr "" -#: ../../library/logging.handlers.rst:596 +#: ../../library/logging.handlers.rst:603 msgid "" "Send a pickled byte-string to a socket. The format of the sent byte-string " "is as described in the documentation for :meth:`SocketHandler.makePickle`." msgstr "" -#: ../../library/logging.handlers.rst:603 +#: ../../library/logging.handlers.rst:610 msgid "SysLogHandler" msgstr "SysLogHandler" -#: ../../library/logging.handlers.rst:605 +#: ../../library/logging.handlers.rst:612 msgid "" "The :class:`SysLogHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a remote or local Unix syslog." msgstr "" -#: ../../library/logging.handlers.rst:611 +#: ../../library/logging.handlers.rst:618 msgid "" "Returns a new instance of the :class:`SysLogHandler` class intended to " "communicate with a remote Unix machine whose address is given by *address* " @@ -799,7 +809,7 @@ msgid "" "rsyslog), specify a value of :const:`socket.SOCK_STREAM`." msgstr "" -#: ../../library/logging.handlers.rst:623 +#: ../../library/logging.handlers.rst:630 msgid "" "Note that if your server is not listening on UDP port 514, :class:" "`SysLogHandler` may appear not to work. In that case, check what address you " @@ -810,21 +820,32 @@ msgid "" "platforms). On Windows, you pretty much have to use the UDP option." msgstr "" -#: ../../library/logging.handlers.rst:632 +#: ../../library/logging.handlers.rst:639 +msgid "" +"On macOS 12.x (Monterey), Apple has changed the behaviour of their syslog " +"daemon - it no longer listens on a domain socket. Therefore, you cannot " +"expect :class:`SysLogHandler` to work on this system." +msgstr "" + +#: ../../library/logging.handlers.rst:643 +msgid "See :gh:`91070` for more information." +msgstr "" + +#: ../../library/logging.handlers.rst:645 msgid "*socktype* was added." msgstr "新增 *socktype*\\ 。" -#: ../../library/logging.handlers.rst:638 +#: ../../library/logging.handlers.rst:651 msgid "Closes the socket to the remote host." msgstr "" -#: ../../library/logging.handlers.rst:643 +#: ../../library/logging.handlers.rst:656 msgid "" "The record is formatted, and then sent to the syslog server. If exception " "information is present, it is *not* sent to the server." msgstr "" -#: ../../library/logging.handlers.rst:646 +#: ../../library/logging.handlers.rst:659 msgid "" "(See: :issue:`12168`.) In earlier versions, the message sent to the syslog " "daemons was always terminated with a NUL byte, because early versions of " @@ -835,7 +856,7 @@ msgid "" "byte on as part of the message." msgstr "" -#: ../../library/logging.handlers.rst:655 +#: ../../library/logging.handlers.rst:668 msgid "" "To enable easier handling of syslog messages in the face of all these " "differing daemon behaviours, the appending of the NUL byte has been made " @@ -845,7 +866,7 @@ msgid "" "*not* append the NUL terminator." msgstr "" -#: ../../library/logging.handlers.rst:662 +#: ../../library/logging.handlers.rst:675 msgid "" "(See: :issue:`12419`.) In earlier versions, there was no facility for an " "\"ident\" or \"tag\" prefix to identify the source of the message. This can " @@ -856,262 +877,262 @@ msgid "" "bytes, and is prepended to the message exactly as is." msgstr "" -#: ../../library/logging.handlers.rst:673 +#: ../../library/logging.handlers.rst:686 msgid "" "Encodes the facility and priority into an integer. You can pass in strings " "or integers - if strings are passed, internal mapping dictionaries are used " "to convert them to integers." msgstr "" -#: ../../library/logging.handlers.rst:677 +#: ../../library/logging.handlers.rst:690 msgid "" "The symbolic ``LOG_`` values are defined in :class:`SysLogHandler` and " "mirror the values defined in the ``sys/syslog.h`` header file." msgstr "" -#: ../../library/logging.handlers.rst:680 +#: ../../library/logging.handlers.rst:693 msgid "**Priorities**" msgstr "" -#: ../../library/logging.handlers.rst:683 -#: ../../library/logging.handlers.rst:705 +#: ../../library/logging.handlers.rst:696 +#: ../../library/logging.handlers.rst:718 msgid "Name (string)" msgstr "" -#: ../../library/logging.handlers.rst:683 -#: ../../library/logging.handlers.rst:705 +#: ../../library/logging.handlers.rst:696 +#: ../../library/logging.handlers.rst:718 msgid "Symbolic value" msgstr "" -#: ../../library/logging.handlers.rst:685 +#: ../../library/logging.handlers.rst:698 msgid "``alert``" msgstr "``alert``" -#: ../../library/logging.handlers.rst:685 +#: ../../library/logging.handlers.rst:698 msgid "LOG_ALERT" msgstr "LOG_ALERT" -#: ../../library/logging.handlers.rst:687 +#: ../../library/logging.handlers.rst:700 msgid "``crit`` or ``critical``" msgstr "``crit`` 或 ``critical``" -#: ../../library/logging.handlers.rst:687 +#: ../../library/logging.handlers.rst:700 msgid "LOG_CRIT" msgstr "LOG_CRIT" -#: ../../library/logging.handlers.rst:689 +#: ../../library/logging.handlers.rst:702 msgid "``debug``" msgstr "``debug``" -#: ../../library/logging.handlers.rst:689 +#: ../../library/logging.handlers.rst:702 msgid "LOG_DEBUG" msgstr "LOG_DEBUG" -#: ../../library/logging.handlers.rst:691 +#: ../../library/logging.handlers.rst:704 msgid "``emerg`` or ``panic``" msgstr "``emerg`` 或 ``panic``" -#: ../../library/logging.handlers.rst:691 +#: ../../library/logging.handlers.rst:704 msgid "LOG_EMERG" msgstr "LOG_EMERG" -#: ../../library/logging.handlers.rst:693 +#: ../../library/logging.handlers.rst:706 msgid "``err`` or ``error``" msgstr "``err`` 或 ``error``" -#: ../../library/logging.handlers.rst:693 +#: ../../library/logging.handlers.rst:706 msgid "LOG_ERR" msgstr "LOG_ERR" -#: ../../library/logging.handlers.rst:695 +#: ../../library/logging.handlers.rst:708 msgid "``info``" msgstr "``info``" -#: ../../library/logging.handlers.rst:695 +#: ../../library/logging.handlers.rst:708 msgid "LOG_INFO" msgstr "LOG_INFO" -#: ../../library/logging.handlers.rst:697 +#: ../../library/logging.handlers.rst:710 msgid "``notice``" msgstr "``notice``" -#: ../../library/logging.handlers.rst:697 +#: ../../library/logging.handlers.rst:710 msgid "LOG_NOTICE" msgstr "LOG_NOTICE" -#: ../../library/logging.handlers.rst:699 +#: ../../library/logging.handlers.rst:712 msgid "``warn`` or ``warning``" msgstr "``warn`` 或 ``warning``" -#: ../../library/logging.handlers.rst:699 +#: ../../library/logging.handlers.rst:712 msgid "LOG_WARNING" msgstr "LOG_WARNING" -#: ../../library/logging.handlers.rst:702 +#: ../../library/logging.handlers.rst:715 msgid "**Facilities**" msgstr "" -#: ../../library/logging.handlers.rst:707 +#: ../../library/logging.handlers.rst:720 msgid "``auth``" msgstr "``auth``" -#: ../../library/logging.handlers.rst:707 +#: ../../library/logging.handlers.rst:720 msgid "LOG_AUTH" msgstr "LOG_AUTH" -#: ../../library/logging.handlers.rst:709 +#: ../../library/logging.handlers.rst:722 msgid "``authpriv``" msgstr "``authpriv``" -#: ../../library/logging.handlers.rst:709 +#: ../../library/logging.handlers.rst:722 msgid "LOG_AUTHPRIV" msgstr "LOG_AUTHPRIV" -#: ../../library/logging.handlers.rst:711 +#: ../../library/logging.handlers.rst:724 msgid "``cron``" msgstr "``cron``" -#: ../../library/logging.handlers.rst:711 +#: ../../library/logging.handlers.rst:724 msgid "LOG_CRON" msgstr "LOG_CRON" -#: ../../library/logging.handlers.rst:713 +#: ../../library/logging.handlers.rst:726 msgid "``daemon``" msgstr "``daemon``" -#: ../../library/logging.handlers.rst:713 +#: ../../library/logging.handlers.rst:726 msgid "LOG_DAEMON" msgstr "LOG_DAEMON" -#: ../../library/logging.handlers.rst:715 +#: ../../library/logging.handlers.rst:728 msgid "``ftp``" msgstr "``ftp``" -#: ../../library/logging.handlers.rst:715 +#: ../../library/logging.handlers.rst:728 msgid "LOG_FTP" msgstr "LOG_FTP" -#: ../../library/logging.handlers.rst:717 +#: ../../library/logging.handlers.rst:730 msgid "``kern``" msgstr "``kern``" -#: ../../library/logging.handlers.rst:717 +#: ../../library/logging.handlers.rst:730 msgid "LOG_KERN" msgstr "LOG_KERN" -#: ../../library/logging.handlers.rst:719 +#: ../../library/logging.handlers.rst:732 msgid "``lpr``" msgstr "``lpr``" -#: ../../library/logging.handlers.rst:719 +#: ../../library/logging.handlers.rst:732 msgid "LOG_LPR" msgstr "LOG_LPR" -#: ../../library/logging.handlers.rst:721 +#: ../../library/logging.handlers.rst:734 msgid "``mail``" msgstr "``mail``" -#: ../../library/logging.handlers.rst:721 +#: ../../library/logging.handlers.rst:734 msgid "LOG_MAIL" msgstr "LOG_MAIL" -#: ../../library/logging.handlers.rst:723 +#: ../../library/logging.handlers.rst:736 msgid "``news``" msgstr "``news``" -#: ../../library/logging.handlers.rst:723 +#: ../../library/logging.handlers.rst:736 msgid "LOG_NEWS" msgstr "LOG_NEWS" -#: ../../library/logging.handlers.rst:725 +#: ../../library/logging.handlers.rst:738 msgid "``syslog``" msgstr "``syslog``" -#: ../../library/logging.handlers.rst:725 +#: ../../library/logging.handlers.rst:738 msgid "LOG_SYSLOG" msgstr "LOG_SYSLOG" -#: ../../library/logging.handlers.rst:727 +#: ../../library/logging.handlers.rst:740 msgid "``user``" msgstr "``user``" -#: ../../library/logging.handlers.rst:727 +#: ../../library/logging.handlers.rst:740 msgid "LOG_USER" msgstr "LOG_USER" -#: ../../library/logging.handlers.rst:729 +#: ../../library/logging.handlers.rst:742 msgid "``uucp``" msgstr "``uucp``" -#: ../../library/logging.handlers.rst:729 +#: ../../library/logging.handlers.rst:742 msgid "LOG_UUCP" msgstr "LOG_UUCP" -#: ../../library/logging.handlers.rst:731 +#: ../../library/logging.handlers.rst:744 msgid "``local0``" msgstr "``local0``" -#: ../../library/logging.handlers.rst:731 +#: ../../library/logging.handlers.rst:744 msgid "LOG_LOCAL0" msgstr "LOG_LOCAL0" -#: ../../library/logging.handlers.rst:733 +#: ../../library/logging.handlers.rst:746 msgid "``local1``" msgstr "``local1``" -#: ../../library/logging.handlers.rst:733 +#: ../../library/logging.handlers.rst:746 msgid "LOG_LOCAL1" msgstr "LOG_LOCAL1" -#: ../../library/logging.handlers.rst:735 +#: ../../library/logging.handlers.rst:748 msgid "``local2``" msgstr "``local2``" -#: ../../library/logging.handlers.rst:735 +#: ../../library/logging.handlers.rst:748 msgid "LOG_LOCAL2" msgstr "LOG_LOCAL2" -#: ../../library/logging.handlers.rst:737 +#: ../../library/logging.handlers.rst:750 msgid "``local3``" msgstr "``local3``" -#: ../../library/logging.handlers.rst:737 +#: ../../library/logging.handlers.rst:750 msgid "LOG_LOCAL3" msgstr "LOG_LOCAL3" -#: ../../library/logging.handlers.rst:739 +#: ../../library/logging.handlers.rst:752 msgid "``local4``" msgstr "``local4``" -#: ../../library/logging.handlers.rst:739 +#: ../../library/logging.handlers.rst:752 msgid "LOG_LOCAL4" msgstr "LOG_LOCAL4" -#: ../../library/logging.handlers.rst:741 +#: ../../library/logging.handlers.rst:754 msgid "``local5``" msgstr "``local5``" -#: ../../library/logging.handlers.rst:741 +#: ../../library/logging.handlers.rst:754 msgid "LOG_LOCAL5" msgstr "LOG_LOCAL5" -#: ../../library/logging.handlers.rst:743 +#: ../../library/logging.handlers.rst:756 msgid "``local6``" msgstr "``local6``" -#: ../../library/logging.handlers.rst:743 +#: ../../library/logging.handlers.rst:756 msgid "LOG_LOCAL6" msgstr "LOG_LOCAL6" -#: ../../library/logging.handlers.rst:745 +#: ../../library/logging.handlers.rst:758 msgid "``local7``" msgstr "``local7``" -#: ../../library/logging.handlers.rst:745 +#: ../../library/logging.handlers.rst:758 msgid "LOG_LOCAL7" msgstr "LOG_LOCAL7" -#: ../../library/logging.handlers.rst:750 +#: ../../library/logging.handlers.rst:763 msgid "" "Maps a logging level name to a syslog priority name. You may need to " "override this if you are using custom levels, or if the default algorithm is " @@ -1120,11 +1141,11 @@ msgid "" "all other level names to 'warning'." msgstr "" -#: ../../library/logging.handlers.rst:760 +#: ../../library/logging.handlers.rst:773 msgid "NTEventLogHandler" msgstr "NTEventLogHandler" -#: ../../library/logging.handlers.rst:762 +#: ../../library/logging.handlers.rst:775 msgid "" "The :class:`NTEventLogHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a local Windows NT, Windows " @@ -1132,7 +1153,7 @@ msgid "" "Win32 extensions for Python installed." msgstr "" -#: ../../library/logging.handlers.rst:770 +#: ../../library/logging.handlers.rst:783 msgid "" "Returns a new instance of the :class:`NTEventLogHandler` class. The " "*appname* is used to define the application name as it appears in the event " @@ -1148,7 +1169,7 @@ msgid "" "or ``'Security'``, and defaults to ``'Application'``." msgstr "" -#: ../../library/logging.handlers.rst:786 +#: ../../library/logging.handlers.rst:799 msgid "" "At this point, you can remove the application name from the registry as a " "source of event log entries. However, if you do this, you will not be able " @@ -1157,19 +1178,19 @@ msgid "" "not do this." msgstr "" -#: ../../library/logging.handlers.rst:795 +#: ../../library/logging.handlers.rst:808 msgid "" "Determines the message ID, event category and event type, and then logs the " "message in the NT event log." msgstr "" -#: ../../library/logging.handlers.rst:801 +#: ../../library/logging.handlers.rst:814 msgid "" "Returns the event category for the record. Override this if you want to " "specify your own categories. This version returns 0." msgstr "" -#: ../../library/logging.handlers.rst:807 +#: ../../library/logging.handlers.rst:820 msgid "" "Returns the event type for the record. Override this if you want to specify " "your own types. This version does a mapping using the handler's typemap " @@ -1180,7 +1201,7 @@ msgid "" "the handler's *typemap* attribute." msgstr "" -#: ../../library/logging.handlers.rst:818 +#: ../../library/logging.handlers.rst:831 msgid "" "Returns the message ID for the record. If you are using your own messages, " "you could do this by having the *msg* passed to the logger being an ID " @@ -1189,17 +1210,17 @@ msgid "" "message ID in :file:`win32service.pyd`." msgstr "" -#: ../../library/logging.handlers.rst:827 +#: ../../library/logging.handlers.rst:840 msgid "SMTPHandler" msgstr "SMTPHandler" -#: ../../library/logging.handlers.rst:829 +#: ../../library/logging.handlers.rst:842 msgid "" "The :class:`SMTPHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to an email address via SMTP." msgstr "" -#: ../../library/logging.handlers.rst:835 +#: ../../library/logging.handlers.rst:848 msgid "" "Returns a new instance of the :class:`SMTPHandler` class. The instance is " "initialized with the from and to addresses and subject line of the email. " @@ -1210,7 +1231,7 @@ msgid "" "*credentials* argument." msgstr "" -#: ../../library/logging.handlers.rst:842 +#: ../../library/logging.handlers.rst:855 msgid "" "To specify the use of a secure protocol (TLS), pass in a tuple to the " "*secure* argument. This will only be used when authentication credentials " @@ -1220,31 +1241,31 @@ msgid "" "SMTP.starttls` method.)" msgstr "" -#: ../../library/logging.handlers.rst:849 +#: ../../library/logging.handlers.rst:862 msgid "" "A timeout can be specified for communication with the SMTP server using the " "*timeout* argument." msgstr "" -#: ../../library/logging.handlers.rst:852 +#: ../../library/logging.handlers.rst:865 msgid "The *timeout* argument was added." msgstr "新增 *timeout* 引數。" -#: ../../library/logging.handlers.rst:857 +#: ../../library/logging.handlers.rst:870 msgid "Formats the record and sends it to the specified addressees." msgstr "" -#: ../../library/logging.handlers.rst:862 +#: ../../library/logging.handlers.rst:875 msgid "" "If you want to specify a subject line which is record-dependent, override " "this method." msgstr "" -#: ../../library/logging.handlers.rst:868 +#: ../../library/logging.handlers.rst:881 msgid "MemoryHandler" msgstr "MemoryHandler" -#: ../../library/logging.handlers.rst:870 +#: ../../library/logging.handlers.rst:883 msgid "" "The :class:`MemoryHandler` class, located in the :mod:`logging.handlers` " "module, supports buffering of logging records in memory, periodically " @@ -1252,7 +1273,7 @@ msgid "" "buffer is full, or when an event of a certain severity or greater is seen." msgstr "" -#: ../../library/logging.handlers.rst:875 +#: ../../library/logging.handlers.rst:888 msgid "" ":class:`MemoryHandler` is a subclass of the more general :class:" "`BufferingHandler`, which is an abstract class. This buffers logging records " @@ -1261,31 +1282,31 @@ msgid "" "should, then :meth:`flush` is expected to do the flushing." msgstr "" -#: ../../library/logging.handlers.rst:884 +#: ../../library/logging.handlers.rst:897 msgid "" "Initializes the handler with a buffer of the specified capacity. Here, " "*capacity* means the number of logging records buffered." msgstr "" -#: ../../library/logging.handlers.rst:890 +#: ../../library/logging.handlers.rst:903 msgid "" "Append the record to the buffer. If :meth:`shouldFlush` returns true, call :" "meth:`flush` to process the buffer." msgstr "" -#: ../../library/logging.handlers.rst:896 +#: ../../library/logging.handlers.rst:909 msgid "" "You can override this to implement custom flushing behavior. This version " "just zaps the buffer to empty." msgstr "" -#: ../../library/logging.handlers.rst:902 +#: ../../library/logging.handlers.rst:915 msgid "" "Return ``True`` if the buffer is up to capacity. This method can be " "overridden to implement custom flushing strategies." msgstr "" -#: ../../library/logging.handlers.rst:908 +#: ../../library/logging.handlers.rst:921 msgid "" "Returns a new instance of the :class:`MemoryHandler` class. The instance is " "initialized with a buffer size of *capacity* (number of records buffered). " @@ -1297,41 +1318,41 @@ msgid "" "the buffer will occur when the handler is closed." msgstr "" -#: ../../library/logging.handlers.rst:917 +#: ../../library/logging.handlers.rst:930 msgid "The *flushOnClose* parameter was added." msgstr "新增 *flushOnClose* 參數。" -#: ../../library/logging.handlers.rst:923 +#: ../../library/logging.handlers.rst:936 msgid "Calls :meth:`flush`, sets the target to ``None`` and clears the buffer." msgstr "" -#: ../../library/logging.handlers.rst:929 +#: ../../library/logging.handlers.rst:942 msgid "" "For a :class:`MemoryHandler`, flushing means just sending the buffered " "records to the target, if there is one. The buffer is also cleared when this " "happens. Override if you want different behavior." msgstr "" -#: ../../library/logging.handlers.rst:936 +#: ../../library/logging.handlers.rst:949 msgid "Sets the target handler for this handler." msgstr "" -#: ../../library/logging.handlers.rst:941 +#: ../../library/logging.handlers.rst:954 msgid "Checks for buffer full or a record at the *flushLevel* or higher." msgstr "" -#: ../../library/logging.handlers.rst:947 +#: ../../library/logging.handlers.rst:960 msgid "HTTPHandler" msgstr "HTTPHandler" -#: ../../library/logging.handlers.rst:949 +#: ../../library/logging.handlers.rst:962 msgid "" "The :class:`HTTPHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a web server, using either " "``GET`` or ``POST`` semantics." msgstr "" -#: ../../library/logging.handlers.rst:956 +#: ../../library/logging.handlers.rst:969 msgid "" "Returns a new instance of the :class:`HTTPHandler` class. The *host* can be " "of the form ``host:port``, should you need to use a specific port number. " @@ -1345,11 +1366,11 @@ msgid "" "cleartext across the wire." msgstr "" -#: ../../library/logging.handlers.rst:967 +#: ../../library/logging.handlers.rst:980 msgid "The *context* parameter was added." msgstr "新增 *context* 參數。" -#: ../../library/logging.handlers.rst:972 +#: ../../library/logging.handlers.rst:985 msgid "" "Provides a dictionary, based on ``record``, which is to be URL-encoded and " "sent to the web server. The default implementation just returns ``record." @@ -1358,14 +1379,14 @@ msgid "" "customization of what's sent to the server is required." msgstr "" -#: ../../library/logging.handlers.rst:980 +#: ../../library/logging.handlers.rst:993 msgid "" "Sends the record to the web server as a URL-encoded dictionary. The :meth:" "`mapLogRecord` method is used to convert the record to the dictionary to be " "sent." msgstr "" -#: ../../library/logging.handlers.rst:984 +#: ../../library/logging.handlers.rst:997 msgid "" "Since preparing a record for sending it to a web server is not the same as a " "generic formatting operation, using :meth:`~logging.Handler.setFormatter` to " @@ -1375,18 +1396,18 @@ msgid "" "the dictionary in a form suitable for sending to a web server." msgstr "" -#: ../../library/logging.handlers.rst:997 +#: ../../library/logging.handlers.rst:1010 msgid "QueueHandler" msgstr "QueueHandler" -#: ../../library/logging.handlers.rst:1001 +#: ../../library/logging.handlers.rst:1014 msgid "" "The :class:`QueueHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a queue, such as those " "implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: ../../library/logging.handlers.rst:1005 +#: ../../library/logging.handlers.rst:1018 msgid "" "Along with the :class:`QueueListener` class, :class:`QueueHandler` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1396,7 +1417,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1014 +#: ../../library/logging.handlers.rst:1027 msgid "" "Returns a new instance of the :class:`QueueHandler` class. The instance is " "initialized with the queue to send messages to. The *queue* can be any queue-" @@ -1406,14 +1427,14 @@ msgid "" "instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1021 -#: ../../library/logging.handlers.rst:1096 +#: ../../library/logging.handlers.rst:1034 +#: ../../library/logging.handlers.rst:1109 msgid "" "If you are using :mod:`multiprocessing`, you should avoid using :class:" "`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`." msgstr "" -#: ../../library/logging.handlers.rst:1026 +#: ../../library/logging.handlers.rst:1039 msgid "" "Enqueues the result of preparing the LogRecord. Should an exception occur (e." "g. because a bounded queue has filled up), the :meth:`~logging.Handler." @@ -1423,13 +1444,13 @@ msgid "" "raiseExceptions` is ``True``)." msgstr "" -#: ../../library/logging.handlers.rst:1035 +#: ../../library/logging.handlers.rst:1048 msgid "" "Prepares a record for queuing. The object returned by this method is " "enqueued." msgstr "" -#: ../../library/logging.handlers.rst:1038 +#: ../../library/logging.handlers.rst:1051 msgid "" "The base implementation formats the record to merge the message, arguments, " "exception and stack information, if present. It also removes unpickleable " @@ -1439,32 +1460,32 @@ msgid "" "attr:`exc_info` and :attr:`exc_text` attributes to ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1046 +#: ../../library/logging.handlers.rst:1059 msgid "" "You might want to override this method if you want to convert the record to " "a dict or JSON string, or send a modified copy of the record while leaving " "the original intact." msgstr "" -#: ../../library/logging.handlers.rst:1052 +#: ../../library/logging.handlers.rst:1065 msgid "" "Enqueues the record on the queue using ``put_nowait()``; you may want to " "override this if you want to use blocking behaviour, or a timeout, or a " "customized queue implementation." msgstr "" -#: ../../library/logging.handlers.rst:1058 +#: ../../library/logging.handlers.rst:1071 msgid "" "When created via configuration using :func:`~logging.config.dictConfig`, " "this attribute will contain a :class:`QueueListener` instance for use with " "this handler. Otherwise, it will be ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1067 +#: ../../library/logging.handlers.rst:1080 msgid "QueueListener" msgstr "QueueListener" -#: ../../library/logging.handlers.rst:1071 +#: ../../library/logging.handlers.rst:1084 msgid "" "The :class:`QueueListener` class, located in the :mod:`logging.handlers` " "module, supports receiving logging messages from a queue, such as those " @@ -1475,7 +1496,7 @@ msgid "" "works hand-in-hand with :class:`QueueHandler`." msgstr "" -#: ../../library/logging.handlers.rst:1079 +#: ../../library/logging.handlers.rst:1092 msgid "" "Along with the :class:`QueueHandler` class, :class:`QueueListener` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1485,7 +1506,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1088 +#: ../../library/logging.handlers.rst:1101 msgid "" "Returns a new instance of the :class:`QueueListener` class. The instance is " "initialized with the queue to send messages to and a list of handlers which " @@ -1496,7 +1517,7 @@ msgid "" "class:`~queue.SimpleQueue` instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1099 +#: ../../library/logging.handlers.rst:1112 msgid "" "If ``respect_handler_level`` is ``True``, a handler's level is respected " "(compared with the level for the message) when deciding whether to pass " @@ -1504,82 +1525,82 @@ msgid "" "versions - to always pass each message to each handler." msgstr "" -#: ../../library/logging.handlers.rst:1104 +#: ../../library/logging.handlers.rst:1117 msgid "The ``respect_handler_level`` argument was added." msgstr "新增 ``respect_handler_level`` 引數。" -#: ../../library/logging.handlers.rst:1109 +#: ../../library/logging.handlers.rst:1122 msgid "Dequeues a record and return it, optionally blocking." msgstr "" -#: ../../library/logging.handlers.rst:1111 +#: ../../library/logging.handlers.rst:1124 msgid "" "The base implementation uses ``get()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1117 +#: ../../library/logging.handlers.rst:1130 msgid "Prepare a record for handling." msgstr "" -#: ../../library/logging.handlers.rst:1119 +#: ../../library/logging.handlers.rst:1132 msgid "" "This implementation just returns the passed-in record. You may want to " "override this method if you need to do any custom marshalling or " "manipulation of the record before passing it to the handlers." msgstr "" -#: ../../library/logging.handlers.rst:1125 +#: ../../library/logging.handlers.rst:1138 msgid "Handle a record." msgstr "" -#: ../../library/logging.handlers.rst:1127 +#: ../../library/logging.handlers.rst:1140 msgid "" "This just loops through the handlers offering them the record to handle. The " "actual object passed to the handlers is that which is returned from :meth:" "`prepare`." msgstr "" -#: ../../library/logging.handlers.rst:1133 +#: ../../library/logging.handlers.rst:1146 msgid "Starts the listener." msgstr "" -#: ../../library/logging.handlers.rst:1135 +#: ../../library/logging.handlers.rst:1148 msgid "" "This starts up a background thread to monitor the queue for LogRecords to " "process." msgstr "" -#: ../../library/logging.handlers.rst:1140 +#: ../../library/logging.handlers.rst:1153 msgid "Stops the listener." msgstr "" -#: ../../library/logging.handlers.rst:1142 +#: ../../library/logging.handlers.rst:1155 msgid "" "This asks the thread to terminate, and then waits for it to do so. Note that " "if you don't call this before your application exits, there may be some " "records still left on the queue, which won't be processed." msgstr "" -#: ../../library/logging.handlers.rst:1148 +#: ../../library/logging.handlers.rst:1161 msgid "" "Writes a sentinel to the queue to tell the listener to quit. This " "implementation uses ``put_nowait()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1159 +#: ../../library/logging.handlers.rst:1172 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.handlers.rst:1159 +#: ../../library/logging.handlers.rst:1172 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.handlers.rst:1161 +#: ../../library/logging.handlers.rst:1174 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.handlers.rst:1162 +#: ../../library/logging.handlers.rst:1175 msgid "Configuration API for the logging module." msgstr "" diff --git a/library/logging.po b/library/logging.po index 84d40bbb1b..adae02fdd5 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-05 00:15+0000\n" +"POT-Creation-Date: 2022-08-03 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -268,7 +268,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:189 ../../library/logging.rst:998 +#: ../../library/logging.rst:189 ../../library/logging.rst:1021 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -280,14 +280,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:198 ../../library/logging.rst:1007 +#: ../../library/logging.rst:198 ../../library/logging.rst:1030 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:206 ../../library/logging.rst:1015 +#: ../../library/logging.rst:206 ../../library/logging.rst:1038 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -336,7 +336,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:246 ../../library/logging.rst:1046 +#: ../../library/logging.rst:246 ../../library/logging.rst:1069 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -354,7 +354,7 @@ msgid "" "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:257 ../../library/logging.rst:1057 +#: ../../library/logging.rst:257 ../../library/logging.rst:1080 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" @@ -890,11 +890,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:713 +#: ../../library/logging.rst:714 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:715 +#: ../../library/logging.rst:716 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -902,73 +902,75 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:723 +#: ../../library/logging.rst:724 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:725 +#: ../../library/logging.rst:726 msgid "" -"The primary information is passed in :attr:`msg` and :attr:`args`, which are " -"combined using ``msg % args`` to create the :attr:`message` field of the " -"record." +"The primary information is passed in *msg* and *args*, which are combined " +"using ``msg % args`` to create the :attr:`!message` attribute of the record." msgstr "" #: ../../library/logging.rst:0 msgid "Parameters" msgstr "" -#: ../../library/logging.rst:729 +#: ../../library/logging.rst:730 msgid "" -"The name of the logger used to log the event represented by this LogRecord. " -"Note that this name will always have this value, even though it may be " -"emitted by a handler attached to a different (ancestor) logger." +"The name of the logger used to log the event represented by this :class:`!" +"LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " +"have this value, even though it may be emitted by a handler attached to a " +"different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:733 +#: ../../library/logging.rst:738 msgid "" -"The numeric level of the logging event (one of DEBUG, INFO etc.) Note that " -"this is converted to *two* attributes of the LogRecord: ``levelno`` for the " -"numeric value and ``levelname`` for the corresponding level name." +"The :ref:`numeric level ` of the logging event (such as ``10`` for " +"``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " +"attributes of the LogRecord: :attr:`!levelno` for the numeric value and :" +"attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:737 -msgid "The full pathname of the source file where the logging call was made." +#: ../../library/logging.rst:745 +msgid "" +"The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:739 +#: ../../library/logging.rst:749 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:741 +#: ../../library/logging.rst:753 msgid "" -"The event description message, possibly a format string with placeholders " -"for variable data." +"The event description message, which can be a %-format string with " +"placeholders for variable data." msgstr "" -#: ../../library/logging.rst:743 +#: ../../library/logging.rst:757 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:745 +#: ../../library/logging.rst:761 msgid "" -"An exception tuple with the current exception information, or ``None`` if no " -"exception information is available." +"An exception tuple with the current exception information, as returned by :" +"func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:747 +#: ../../library/logging.rst:766 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:749 +#: ../../library/logging.rst:770 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:754 +#: ../../library/logging.rst:777 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -977,7 +979,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:761 +#: ../../library/logging.rst:784 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -985,24 +987,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:767 +#: ../../library/logging.rst:790 msgid "" "This functionality can be used to inject your own values into a :class:" "`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:779 +#: ../../library/logging.rst:802 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:788 +#: ../../library/logging.rst:811 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:790 +#: ../../library/logging.rst:813 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1013,7 +1015,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:798 +#: ../../library/logging.rst:821 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" "`` as the placeholder in the format string. If you are using $-formatting (:" @@ -1021,7 +1023,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:804 +#: ../../library/logging.rst:827 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1030,308 +1032,308 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:811 +#: ../../library/logging.rst:834 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:811 ../../library/logging.rst:1194 +#: ../../library/logging.rst:834 ../../library/logging.rst:1217 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:811 ../../library/logging.rst:1194 +#: ../../library/logging.rst:834 ../../library/logging.rst:1217 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:813 +#: ../../library/logging.rst:0 ../../library/logging.rst:836 msgid "args" msgstr "" -#: ../../library/logging.rst:813 ../../library/logging.rst:827 -#: ../../library/logging.rst:855 ../../library/logging.rst:873 +#: ../../library/logging.rst:836 ../../library/logging.rst:850 +#: ../../library/logging.rst:878 ../../library/logging.rst:896 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:813 +#: ../../library/logging.rst:836 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:818 +#: ../../library/logging.rst:841 msgid "asctime" msgstr "" -#: ../../library/logging.rst:818 +#: ../../library/logging.rst:841 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:818 +#: ../../library/logging.rst:841 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:824 +#: ../../library/logging.rst:847 msgid "created" msgstr "" -#: ../../library/logging.rst:824 +#: ../../library/logging.rst:847 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:824 +#: ../../library/logging.rst:847 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:827 +#: ../../library/logging.rst:0 ../../library/logging.rst:850 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:827 +#: ../../library/logging.rst:850 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:830 +#: ../../library/logging.rst:853 msgid "filename" msgstr "" -#: ../../library/logging.rst:830 +#: ../../library/logging.rst:853 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:830 +#: ../../library/logging.rst:853 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:832 +#: ../../library/logging.rst:855 msgid "funcName" msgstr "" -#: ../../library/logging.rst:832 +#: ../../library/logging.rst:855 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:832 +#: ../../library/logging.rst:855 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:834 +#: ../../library/logging.rst:857 msgid "levelname" msgstr "" -#: ../../library/logging.rst:834 +#: ../../library/logging.rst:857 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:834 +#: ../../library/logging.rst:857 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:838 +#: ../../library/logging.rst:861 msgid "levelno" msgstr "" -#: ../../library/logging.rst:838 +#: ../../library/logging.rst:861 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:838 +#: ../../library/logging.rst:861 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:843 +#: ../../library/logging.rst:866 msgid "lineno" msgstr "" -#: ../../library/logging.rst:843 +#: ../../library/logging.rst:866 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:843 +#: ../../library/logging.rst:866 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:846 +#: ../../library/logging.rst:869 msgid "message" msgstr "" -#: ../../library/logging.rst:846 +#: ../../library/logging.rst:869 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:846 +#: ../../library/logging.rst:869 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:850 +#: ../../library/logging.rst:873 msgid "module" msgstr "模組" -#: ../../library/logging.rst:850 +#: ../../library/logging.rst:873 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:850 +#: ../../library/logging.rst:873 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:852 +#: ../../library/logging.rst:875 msgid "msecs" msgstr "" -#: ../../library/logging.rst:852 +#: ../../library/logging.rst:875 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:852 +#: ../../library/logging.rst:875 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:855 +#: ../../library/logging.rst:0 ../../library/logging.rst:878 msgid "msg" msgstr "" -#: ../../library/logging.rst:855 +#: ../../library/logging.rst:878 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:860 +#: ../../library/logging.rst:0 ../../library/logging.rst:883 msgid "name" msgstr "" -#: ../../library/logging.rst:860 +#: ../../library/logging.rst:883 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:860 +#: ../../library/logging.rst:883 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:862 +#: ../../library/logging.rst:885 msgid "pathname" msgstr "" -#: ../../library/logging.rst:862 +#: ../../library/logging.rst:885 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:862 +#: ../../library/logging.rst:885 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:865 +#: ../../library/logging.rst:888 msgid "process" msgstr "" -#: ../../library/logging.rst:865 +#: ../../library/logging.rst:888 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:865 +#: ../../library/logging.rst:888 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:867 +#: ../../library/logging.rst:890 msgid "processName" msgstr "" -#: ../../library/logging.rst:867 +#: ../../library/logging.rst:890 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:867 +#: ../../library/logging.rst:890 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:869 +#: ../../library/logging.rst:892 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:869 +#: ../../library/logging.rst:892 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:869 +#: ../../library/logging.rst:892 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:873 +#: ../../library/logging.rst:896 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:873 +#: ../../library/logging.rst:896 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:879 +#: ../../library/logging.rst:902 msgid "thread" msgstr "" -#: ../../library/logging.rst:879 +#: ../../library/logging.rst:902 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:879 +#: ../../library/logging.rst:902 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:881 +#: ../../library/logging.rst:904 msgid "threadName" msgstr "" -#: ../../library/logging.rst:881 +#: ../../library/logging.rst:904 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:881 +#: ../../library/logging.rst:904 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:884 +#: ../../library/logging.rst:907 msgid "*processName* was added." msgstr "新增 *processName*\\ 。" -#: ../../library/logging.rst:891 +#: ../../library/logging.rst:914 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:893 +#: ../../library/logging.rst:916 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:899 +#: ../../library/logging.rst:922 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:927 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1340,7 +1342,7 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:910 +#: ../../library/logging.rst:933 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1352,24 +1354,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:919 +#: ../../library/logging.rst:942 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:924 +#: ../../library/logging.rst:947 msgid "" "Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " "to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:930 +#: ../../library/logging.rst:953 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:932 +#: ../../library/logging.rst:955 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1378,7 +1380,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:937 +#: ../../library/logging.rst:960 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1386,17 +1388,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:944 +#: ../../library/logging.rst:967 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:946 +#: ../../library/logging.rst:969 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:952 +#: ../../library/logging.rst:975 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1405,14 +1407,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:957 +#: ../../library/logging.rst:980 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:964 +#: ../../library/logging.rst:987 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1421,24 +1423,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:975 +#: ../../library/logging.rst:998 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:977 +#: ../../library/logging.rst:1000 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:982 +#: ../../library/logging.rst:1005 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:987 +#: ../../library/logging.rst:1010 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1447,7 +1449,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:992 +#: ../../library/logging.rst:1015 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1457,7 +1459,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1041 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1466,18 +1468,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1029 +#: ../../library/logging.rst:1052 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1035 +#: ../../library/logging.rst:1058 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1039 +#: ../../library/logging.rst:1062 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1488,58 +1490,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1053 +#: ../../library/logging.rst:1076 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1062 +#: ../../library/logging.rst:1085 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1068 +#: ../../library/logging.rst:1091 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1071 +#: ../../library/logging.rst:1094 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1078 +#: ../../library/logging.rst:1101 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1084 +#: ../../library/logging.rst:1107 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1090 +#: ../../library/logging.rst:1113 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1096 +#: ../../library/logging.rst:1119 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1101 +#: ../../library/logging.rst:1124 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1553,7 +1555,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1112 +#: ../../library/logging.rst:1135 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1561,13 +1563,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1117 +#: ../../library/logging.rst:1140 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1123 +#: ../../library/logging.rst:1146 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1577,17 +1579,17 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1130 +#: ../../library/logging.rst:1153 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1135 +#: ../../library/logging.rst:1158 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1137 +#: ../../library/logging.rst:1160 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1597,20 +1599,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1144 +#: ../../library/logging.rst:1167 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1148 +#: ../../library/logging.rst:1171 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1151 +#: ../../library/logging.rst:1174 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -1619,7 +1621,7 @@ msgid "" "versa." msgstr "" -#: ../../library/logging.rst:1157 +#: ../../library/logging.rst:1180 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1627,7 +1629,7 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1165 +#: ../../library/logging.rst:1188 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1635,7 +1637,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1173 +#: ../../library/logging.rst:1196 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1644,13 +1646,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1179 +#: ../../library/logging.rst:1202 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1182 +#: ../../library/logging.rst:1205 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1659,54 +1661,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1189 +#: ../../library/logging.rst:1212 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1219 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1219 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1200 +#: ../../library/logging.rst:1223 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1200 +#: ../../library/logging.rst:1223 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1204 +#: ../../library/logging.rst:1227 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1204 +#: ../../library/logging.rst:1227 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1209 +#: ../../library/logging.rst:1232 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1209 +#: ../../library/logging.rst:1232 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1212 +#: ../../library/logging.rst:1235 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1212 +#: ../../library/logging.rst:1235 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1223 +#: ../../library/logging.rst:1246 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1223 +#: ../../library/logging.rst:1246 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1229 +#: ../../library/logging.rst:1252 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1229 +#: ../../library/logging.rst:1252 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1746,33 +1748,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1238 +#: ../../library/logging.rst:1261 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1238 +#: ../../library/logging.rst:1261 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1244 +#: ../../library/logging.rst:1267 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1244 +#: ../../library/logging.rst:1267 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1249 +#: ../../library/logging.rst:1272 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1249 +#: ../../library/logging.rst:1272 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -1781,39 +1783,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1260 +#: ../../library/logging.rst:1283 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1263 +#: ../../library/logging.rst:1286 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1269 +#: ../../library/logging.rst:1292 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1272 +#: ../../library/logging.rst:1295 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1277 +#: ../../library/logging.rst:1300 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1281 +#: ../../library/logging.rst:1304 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1288 +#: ../../library/logging.rst:1311 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`__init__` such that only a name " @@ -1825,32 +1827,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1299 +#: ../../library/logging.rst:1322 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1301 +#: ../../library/logging.rst:1324 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1303 +#: ../../library/logging.rst:1326 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1308 +#: ../../library/logging.rst:1331 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1310 +#: ../../library/logging.rst:1333 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1312 +#: ../../library/logging.rst:1335 msgid "The logger name." msgstr "" @@ -1858,7 +1860,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1313 +#: ../../library/logging.rst:1336 msgid "The logging level (numeric)." msgstr "" @@ -1866,7 +1868,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1314 +#: ../../library/logging.rst:1337 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1874,19 +1876,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1338 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1316 +#: ../../library/logging.rst:1339 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1317 +#: ../../library/logging.rst:1340 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1318 +#: ../../library/logging.rst:1341 msgid "An exception tuple, or ``None``." msgstr "" @@ -1894,7 +1896,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1319 +#: ../../library/logging.rst:1342 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1902,7 +1904,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1321 +#: ../../library/logging.rst:1344 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1912,15 +1914,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1323 +#: ../../library/logging.rst:1346 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1327 +#: ../../library/logging.rst:1350 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1331 +#: ../../library/logging.rst:1354 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -1931,22 +1933,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1342 +#: ../../library/logging.rst:1365 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1344 +#: ../../library/logging.rst:1367 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1372 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1352 +#: ../../library/logging.rst:1375 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -1955,46 +1957,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1357 +#: ../../library/logging.rst:1380 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1365 +#: ../../library/logging.rst:1388 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1365 +#: ../../library/logging.rst:1388 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1368 +#: ../../library/logging.rst:1391 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1368 +#: ../../library/logging.rst:1391 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1372 +#: ../../library/logging.rst:1395 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1394 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1377 +#: ../../library/logging.rst:1400 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1398 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/library/multiprocessing.po b/library/multiprocessing.po index d92e892a13..5aeed729f3 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-01 00:17+0000\n" +"POT-Creation-Date: 2022-08-22 00:19+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-" @@ -58,11 +58,21 @@ msgstr "" msgid "will print to standard output ::" msgstr "" -#: ../../library/multiprocessing.rst:47 +#: ../../library/multiprocessing.rst:48 +msgid "" +":class:`concurrent.futures.ProcessPoolExecutor` offers a higher level " +"interface to push tasks to a background process without blocking execution " +"of the calling process. Compared to using the :class:`~multiprocessing.pool." +"Pool` interface directly, the :mod:`concurrent.futures` API more readily " +"allows the submission of work to the underlying process pool to be separated " +"from waiting for the results." +msgstr "" + +#: ../../library/multiprocessing.rst:57 msgid "The :class:`Process` class" msgstr "" -#: ../../library/multiprocessing.rst:49 +#: ../../library/multiprocessing.rst:59 msgid "" "In :mod:`multiprocessing`, processes are spawned by creating a :class:" "`Process` object and then calling its :meth:`~Process.start` method. :class:" @@ -70,32 +80,32 @@ msgid "" "of a multiprocess program is ::" msgstr "" -#: ../../library/multiprocessing.rst:64 +#: ../../library/multiprocessing.rst:74 msgid "" "To show the individual process IDs involved, here is an expanded example::" msgstr "" -#: ../../library/multiprocessing.rst:85 +#: ../../library/multiprocessing.rst:95 msgid "" "For an explanation of why the ``if __name__ == '__main__'`` part is " "necessary, see :ref:`multiprocessing-programming`." msgstr "" -#: ../../library/multiprocessing.rst:91 +#: ../../library/multiprocessing.rst:101 msgid "Contexts and start methods" msgstr "" -#: ../../library/multiprocessing.rst:95 +#: ../../library/multiprocessing.rst:105 msgid "" "Depending on the platform, :mod:`multiprocessing` supports three ways to " "start a process. These *start methods* are" msgstr "" -#: ../../library/multiprocessing.rst:106 +#: ../../library/multiprocessing.rst:116 msgid "*spawn*" msgstr "" -#: ../../library/multiprocessing.rst:99 +#: ../../library/multiprocessing.rst:109 msgid "" "The parent process starts a fresh Python interpreter process. The child " "process will only inherit those resources necessary to run the process " @@ -105,15 +115,15 @@ msgid "" "or *forkserver*." msgstr "" -#: ../../library/multiprocessing.rst:106 +#: ../../library/multiprocessing.rst:116 msgid "Available on Unix and Windows. The default on Windows and macOS." msgstr "" -#: ../../library/multiprocessing.rst:115 +#: ../../library/multiprocessing.rst:125 msgid "*fork*" msgstr "" -#: ../../library/multiprocessing.rst:109 +#: ../../library/multiprocessing.rst:119 msgid "" "The parent process uses :func:`os.fork` to fork the Python interpreter. The " "child process, when it begins, is effectively identical to the parent " @@ -121,15 +131,15 @@ msgid "" "Note that safely forking a multithreaded process is problematic." msgstr "" -#: ../../library/multiprocessing.rst:115 +#: ../../library/multiprocessing.rst:125 msgid "Available on Unix only. The default on Unix." msgstr "" -#: ../../library/multiprocessing.rst:126 +#: ../../library/multiprocessing.rst:136 msgid "*forkserver*" msgstr "" -#: ../../library/multiprocessing.rst:118 +#: ../../library/multiprocessing.rst:128 msgid "" "When the program starts and selects the *forkserver* start method, a server " "process is started. From then on, whenever a new process is needed, the " @@ -138,27 +148,27 @@ msgid "" "use :func:`os.fork`. No unnecessary resources are inherited." msgstr "" -#: ../../library/multiprocessing.rst:125 +#: ../../library/multiprocessing.rst:135 msgid "" "Available on Unix platforms which support passing file descriptors over Unix " "pipes." msgstr "" -#: ../../library/multiprocessing.rst:130 ../../library/multiprocessing.rst:1044 +#: ../../library/multiprocessing.rst:140 ../../library/multiprocessing.rst:1054 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " "subprocess. See :issue:`33725`." msgstr "" -#: ../../library/multiprocessing.rst:134 +#: ../../library/multiprocessing.rst:144 msgid "" "*spawn* added on all unix platforms, and *forkserver* added for some unix " "platforms. Child processes no longer inherit all of the parents inheritable " "handles on Windows." msgstr "" -#: ../../library/multiprocessing.rst:140 +#: ../../library/multiprocessing.rst:150 msgid "" "On Unix using the *spawn* or *forkserver* start methods will also start a " "*resource tracker* process which tracks the unlinked named system resources " @@ -173,25 +183,25 @@ msgid "" "space in the main memory.)" msgstr "" -#: ../../library/multiprocessing.rst:153 +#: ../../library/multiprocessing.rst:163 msgid "" "To select a start method you use the :func:`set_start_method` in the ``if " "__name__ == '__main__'`` clause of the main module. For example::" msgstr "" -#: ../../library/multiprocessing.rst:170 +#: ../../library/multiprocessing.rst:180 msgid "" ":func:`set_start_method` should not be used more than once in the program." msgstr "" -#: ../../library/multiprocessing.rst:173 +#: ../../library/multiprocessing.rst:183 msgid "" "Alternatively, you can use :func:`get_context` to obtain a context object. " "Context objects have the same API as the multiprocessing module, and allow " "one to use multiple start methods in the same program. ::" msgstr "" -#: ../../library/multiprocessing.rst:191 +#: ../../library/multiprocessing.rst:201 msgid "" "Note that objects related to one context may not be compatible with " "processes for a different context. In particular, locks created using the " @@ -199,13 +209,13 @@ msgid "" "*forkserver* start methods." msgstr "" -#: ../../library/multiprocessing.rst:196 +#: ../../library/multiprocessing.rst:206 msgid "" "A library which wants to use a particular start method should probably use :" "func:`get_context` to avoid interfering with the choice of the library user." msgstr "" -#: ../../library/multiprocessing.rst:202 +#: ../../library/multiprocessing.rst:212 msgid "" "The ``'spawn'`` and ``'forkserver'`` start methods cannot currently be used " "with \"frozen\" executables (i.e., binaries produced by packages like " @@ -213,41 +223,41 @@ msgid "" "work." msgstr "" -#: ../../library/multiprocessing.rst:209 +#: ../../library/multiprocessing.rst:219 msgid "Exchanging objects between processes" msgstr "" -#: ../../library/multiprocessing.rst:211 +#: ../../library/multiprocessing.rst:221 msgid "" ":mod:`multiprocessing` supports two types of communication channel between " "processes:" msgstr "" -#: ../../library/multiprocessing.rst:214 +#: ../../library/multiprocessing.rst:224 msgid "**Queues**" msgstr "" -#: ../../library/multiprocessing.rst:216 +#: ../../library/multiprocessing.rst:226 msgid "" "The :class:`Queue` class is a near clone of :class:`queue.Queue`. For " "example::" msgstr "" -#: ../../library/multiprocessing.rst:231 +#: ../../library/multiprocessing.rst:241 msgid "Queues are thread and process safe." msgstr "" -#: ../../library/multiprocessing.rst:233 +#: ../../library/multiprocessing.rst:243 msgid "**Pipes**" msgstr "" -#: ../../library/multiprocessing.rst:235 +#: ../../library/multiprocessing.rst:245 msgid "" "The :func:`Pipe` function returns a pair of connection objects connected by " "a pipe which by default is duplex (two-way). For example::" msgstr "" -#: ../../library/multiprocessing.rst:251 +#: ../../library/multiprocessing.rst:261 msgid "" "The two connection objects returned by :func:`Pipe` represent the two ends " "of the pipe. Each connection object has :meth:`~Connection.send` and :meth:" @@ -257,55 +267,55 @@ msgid "" "corruption from processes using different ends of the pipe at the same time." msgstr "" -#: ../../library/multiprocessing.rst:261 +#: ../../library/multiprocessing.rst:271 msgid "Synchronization between processes" msgstr "" -#: ../../library/multiprocessing.rst:263 +#: ../../library/multiprocessing.rst:273 msgid "" ":mod:`multiprocessing` contains equivalents of all the synchronization " "primitives from :mod:`threading`. For instance one can use a lock to ensure " "that only one process prints to standard output at a time::" msgstr "" -#: ../../library/multiprocessing.rst:282 +#: ../../library/multiprocessing.rst:292 msgid "" "Without using the lock output from the different processes is liable to get " "all mixed up." msgstr "" -#: ../../library/multiprocessing.rst:287 +#: ../../library/multiprocessing.rst:297 msgid "Sharing state between processes" msgstr "" -#: ../../library/multiprocessing.rst:289 +#: ../../library/multiprocessing.rst:299 msgid "" "As mentioned above, when doing concurrent programming it is usually best to " "avoid using shared state as far as possible. This is particularly true when " "using multiple processes." msgstr "" -#: ../../library/multiprocessing.rst:293 +#: ../../library/multiprocessing.rst:303 msgid "" "However, if you really do need to use some shared data then :mod:" "`multiprocessing` provides a couple of ways of doing so." msgstr "" -#: ../../library/multiprocessing.rst:296 +#: ../../library/multiprocessing.rst:306 msgid "**Shared memory**" msgstr "" -#: ../../library/multiprocessing.rst:298 +#: ../../library/multiprocessing.rst:308 msgid "" "Data can be stored in a shared memory map using :class:`Value` or :class:" "`Array`. For example, the following code ::" msgstr "" -#: ../../library/multiprocessing.rst:319 ../../library/multiprocessing.rst:365 +#: ../../library/multiprocessing.rst:329 ../../library/multiprocessing.rst:375 msgid "will print ::" msgstr "" -#: ../../library/multiprocessing.rst:324 +#: ../../library/multiprocessing.rst:334 msgid "" "The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are " "typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a " @@ -313,25 +323,25 @@ msgid "" "objects will be process and thread-safe." msgstr "" -#: ../../library/multiprocessing.rst:329 +#: ../../library/multiprocessing.rst:339 msgid "" "For more flexibility in using shared memory one can use the :mod:" "`multiprocessing.sharedctypes` module which supports the creation of " "arbitrary ctypes objects allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:333 +#: ../../library/multiprocessing.rst:343 msgid "**Server process**" msgstr "" -#: ../../library/multiprocessing.rst:335 +#: ../../library/multiprocessing.rst:345 msgid "" "A manager object returned by :func:`Manager` controls a server process which " "holds Python objects and allows other processes to manipulate them using " "proxies." msgstr "" -#: ../../library/multiprocessing.rst:339 +#: ../../library/multiprocessing.rst:349 msgid "" "A manager returned by :func:`Manager` will support types :class:`list`, :" "class:`dict`, :class:`~managers.Namespace`, :class:`Lock`, :class:`RLock`, :" @@ -340,7 +350,7 @@ msgid "" "`Array`. For example, ::" msgstr "" -#: ../../library/multiprocessing.rst:370 +#: ../../library/multiprocessing.rst:380 msgid "" "Server process managers are more flexible than using shared memory objects " "because they can be made to support arbitrary object types. Also, a single " @@ -348,31 +358,31 @@ msgid "" "They are, however, slower than using shared memory." msgstr "" -#: ../../library/multiprocessing.rst:377 +#: ../../library/multiprocessing.rst:387 msgid "Using a pool of workers" msgstr "" -#: ../../library/multiprocessing.rst:379 +#: ../../library/multiprocessing.rst:389 msgid "" "The :class:`~multiprocessing.pool.Pool` class represents a pool of worker " "processes. It has methods which allows tasks to be offloaded to the worker " "processes in a few different ways." msgstr "" -#: ../../library/multiprocessing.rst:383 +#: ../../library/multiprocessing.rst:393 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/multiprocessing.rst:427 +#: ../../library/multiprocessing.rst:437 msgid "" "Note that the methods of a pool should only ever be used by the process " "which created it." msgstr "" -#: ../../library/multiprocessing.rst:432 +#: ../../library/multiprocessing.rst:442 msgid "" "Functionality within this package requires that the ``__main__`` module be " "importable by the children. This is covered in :ref:`multiprocessing-" @@ -381,35 +391,35 @@ msgid "" "work in the interactive interpreter. For example::" msgstr "" -#: ../../library/multiprocessing.rst:455 +#: ../../library/multiprocessing.rst:465 msgid "" "(If you try this it will actually output three full tracebacks interleaved " "in a semi-random fashion, and then you may have to stop the parent process " "somehow.)" msgstr "" -#: ../../library/multiprocessing.rst:461 +#: ../../library/multiprocessing.rst:471 msgid "Reference" msgstr "" -#: ../../library/multiprocessing.rst:463 +#: ../../library/multiprocessing.rst:473 msgid "" "The :mod:`multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:468 +#: ../../library/multiprocessing.rst:478 msgid ":class:`Process` and exceptions" msgstr ":class:`Process` 與例外" -#: ../../library/multiprocessing.rst:473 +#: ../../library/multiprocessing.rst:483 msgid "" "Process objects represent activity that is run in a separate process. The :" "class:`Process` class has equivalents of all the methods of :class:" "`threading.Thread`." msgstr "" -#: ../../library/multiprocessing.rst:477 +#: ../../library/multiprocessing.rst:487 msgid "" "The constructor should always be called with keyword arguments. *group* " "should always be ``None``; it exists solely for compatibility with :class:" @@ -423,26 +433,26 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:488 +#: ../../library/multiprocessing.rst:498 msgid "By default, no arguments are passed to *target*." msgstr "" -#: ../../library/multiprocessing.rst:490 +#: ../../library/multiprocessing.rst:500 msgid "" "If a subclass overrides the constructor, it must make sure it invokes the " "base class constructor (:meth:`Process.__init__`) before doing anything else " "to the process." msgstr "" -#: ../../library/multiprocessing.rst:494 +#: ../../library/multiprocessing.rst:504 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/multiprocessing.rst:499 +#: ../../library/multiprocessing.rst:509 msgid "Method representing the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:501 +#: ../../library/multiprocessing.rst:511 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " @@ -450,17 +460,17 @@ msgid "" "*args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/multiprocessing.rst:508 +#: ../../library/multiprocessing.rst:518 msgid "Start the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:510 +#: ../../library/multiprocessing.rst:520 msgid "" "This must be called at most once per process object. It arranges for the " "object's :meth:`run` method to be invoked in a separate process." msgstr "" -#: ../../library/multiprocessing.rst:515 +#: ../../library/multiprocessing.rst:525 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -470,23 +480,23 @@ msgid "" "terminated." msgstr "" -#: ../../library/multiprocessing.rst:522 +#: ../../library/multiprocessing.rst:532 msgid "A process can be joined many times." msgstr "" -#: ../../library/multiprocessing.rst:524 +#: ../../library/multiprocessing.rst:534 msgid "" "A process cannot join itself because this would cause a deadlock. It is an " "error to attempt to join a process before it has been started." msgstr "" -#: ../../library/multiprocessing.rst:529 +#: ../../library/multiprocessing.rst:539 msgid "" "The process's name. The name is a string used for identification purposes " "only. It has no semantics. Multiple processes may be given the same name." msgstr "" -#: ../../library/multiprocessing.rst:533 +#: ../../library/multiprocessing.rst:543 msgid "" "The initial name is set by the constructor. If no explicit name is provided " "to the constructor, a name of the form 'Process-N\\ :sub:`1`:N\\ :sub:" @@ -494,33 +504,33 @@ msgid "" "child of its parent." msgstr "" -#: ../../library/multiprocessing.rst:540 +#: ../../library/multiprocessing.rst:550 msgid "Return whether the process is alive." msgstr "" -#: ../../library/multiprocessing.rst:542 +#: ../../library/multiprocessing.rst:552 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -#: ../../library/multiprocessing.rst:547 +#: ../../library/multiprocessing.rst:557 msgid "" "The process's daemon flag, a Boolean value. This must be set before :meth:" "`start` is called." msgstr "" -#: ../../library/multiprocessing.rst:550 +#: ../../library/multiprocessing.rst:560 msgid "The initial value is inherited from the creating process." msgstr "" -#: ../../library/multiprocessing.rst:552 +#: ../../library/multiprocessing.rst:562 msgid "" "When a process exits, it attempts to terminate all of its daemonic child " "processes." msgstr "" -#: ../../library/multiprocessing.rst:555 +#: ../../library/multiprocessing.rst:565 msgid "" "Note that a daemonic process is not allowed to create child processes. " "Otherwise a daemonic process would leave its children orphaned if it gets " @@ -529,92 +539,92 @@ msgid "" "(and not joined) if non-daemonic processes have exited." msgstr "" -#: ../../library/multiprocessing.rst:561 +#: ../../library/multiprocessing.rst:571 msgid "" "In addition to the :class:`threading.Thread` API, :class:`Process` objects " "also support the following attributes and methods:" msgstr "" -#: ../../library/multiprocessing.rst:566 +#: ../../library/multiprocessing.rst:576 msgid "" "Return the process ID. Before the process is spawned, this will be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:571 +#: ../../library/multiprocessing.rst:581 msgid "" "The child's exit code. This will be ``None`` if the process has not yet " "terminated." msgstr "" -#: ../../library/multiprocessing.rst:574 +#: ../../library/multiprocessing.rst:584 msgid "" "If the child's :meth:`run` method returned normally, the exit code will be " "0. If it terminated via :func:`sys.exit` with an integer argument *N*, the " "exit code will be *N*." msgstr "" -#: ../../library/multiprocessing.rst:578 +#: ../../library/multiprocessing.rst:588 msgid "" "If the child terminated due to an exception not caught within :meth:`run`, " "the exit code will be 1. If it was terminated by signal *N*, the exit code " "will be the negative value *-N*." msgstr "" -#: ../../library/multiprocessing.rst:584 +#: ../../library/multiprocessing.rst:594 msgid "The process's authentication key (a byte string)." msgstr "" -#: ../../library/multiprocessing.rst:586 +#: ../../library/multiprocessing.rst:596 msgid "" "When :mod:`multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" -#: ../../library/multiprocessing.rst:589 +#: ../../library/multiprocessing.rst:599 msgid "" "When a :class:`Process` object is created, it will inherit the " "authentication key of its parent process, although this may be changed by " "setting :attr:`authkey` to another byte string." msgstr "" -#: ../../library/multiprocessing.rst:593 +#: ../../library/multiprocessing.rst:603 msgid "See :ref:`multiprocessing-auth-keys`." msgstr "參閱 :ref:`multiprocessing-auth-keys`\\ 。" -#: ../../library/multiprocessing.rst:597 +#: ../../library/multiprocessing.rst:607 msgid "" "A numeric handle of a system object which will become \"ready\" when the " "process ends." msgstr "" -#: ../../library/multiprocessing.rst:600 +#: ../../library/multiprocessing.rst:610 msgid "" "You can use this value if you want to wait on several events at once using :" "func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join()` is " "simpler." msgstr "" -#: ../../library/multiprocessing.rst:604 +#: ../../library/multiprocessing.rst:614 msgid "" "On Windows, this is an OS handle usable with the ``WaitForSingleObject`` and " "``WaitForMultipleObjects`` family of API calls. On Unix, this is a file " "descriptor usable with primitives from the :mod:`select` module." msgstr "" -#: ../../library/multiprocessing.rst:612 +#: ../../library/multiprocessing.rst:622 msgid "" "Terminate the process. On Unix this is done using the ``SIGTERM`` signal; " "on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " "finally clauses, etc., will not be executed." msgstr "" -#: ../../library/multiprocessing.rst:616 +#: ../../library/multiprocessing.rst:626 msgid "" "Note that descendant processes of the process will *not* be terminated -- " "they will simply become orphaned." msgstr "" -#: ../../library/multiprocessing.rst:621 +#: ../../library/multiprocessing.rst:631 msgid "" "If this method is used when the associated process is using a pipe or queue " "then the pipe or queue is liable to become corrupted and may become unusable " @@ -623,11 +633,11 @@ msgid "" "deadlock." msgstr "" -#: ../../library/multiprocessing.rst:629 +#: ../../library/multiprocessing.rst:639 msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on Unix." msgstr "" -#: ../../library/multiprocessing.rst:635 +#: ../../library/multiprocessing.rst:645 msgid "" "Close the :class:`Process` object, releasing all resources associated with " "it. :exc:`ValueError` is raised if the underlying process is still " @@ -635,59 +645,59 @@ msgid "" "attributes of the :class:`Process` object will raise :exc:`ValueError`." msgstr "" -#: ../../library/multiprocessing.rst:643 +#: ../../library/multiprocessing.rst:653 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -#: ../../library/multiprocessing.rst:647 +#: ../../library/multiprocessing.rst:657 msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:668 +#: ../../library/multiprocessing.rst:678 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:672 +#: ../../library/multiprocessing.rst:682 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:675 +#: ../../library/multiprocessing.rst:685 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:680 +#: ../../library/multiprocessing.rst:690 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:684 +#: ../../library/multiprocessing.rst:694 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:687 +#: ../../library/multiprocessing.rst:697 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:689 +#: ../../library/multiprocessing.rst:699 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:693 +#: ../../library/multiprocessing.rst:703 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:696 +#: ../../library/multiprocessing.rst:706 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -697,7 +707,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:703 +#: ../../library/multiprocessing.rst:713 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -705,20 +715,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:708 +#: ../../library/multiprocessing.rst:718 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:713 +#: ../../library/multiprocessing.rst:723 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:720 +#: ../../library/multiprocessing.rst:730 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -727,14 +737,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:727 +#: ../../library/multiprocessing.rst:737 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:732 +#: ../../library/multiprocessing.rst:742 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -742,7 +752,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:739 +#: ../../library/multiprocessing.rst:749 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -750,7 +760,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:746 +#: ../../library/multiprocessing.rst:756 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1098 +#: ../../library/multiprocessing.rst:1108 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1101 +#: ../../library/multiprocessing.rst:1111 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1106 +#: ../../library/multiprocessing.rst:1116 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1113 +#: ../../library/multiprocessing.rst:1123 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1117 +#: ../../library/multiprocessing.rst:1127 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1119 +#: ../../library/multiprocessing.rst:1129 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1123 +#: ../../library/multiprocessing.rst:1133 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1125 +#: ../../library/multiprocessing.rst:1135 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1129 +#: ../../library/multiprocessing.rst:1139 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1134 +#: ../../library/multiprocessing.rst:1144 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1136 +#: ../../library/multiprocessing.rst:1146 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1228,7 +1238,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1143 +#: ../../library/multiprocessing.rst:1153 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1236,19 +1246,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1148 +#: ../../library/multiprocessing.rst:1158 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1152 +#: ../../library/multiprocessing.rst:1162 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1159 +#: ../../library/multiprocessing.rst:1169 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1256,45 +1266,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1165 +#: ../../library/multiprocessing.rst:1175 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1170 +#: ../../library/multiprocessing.rst:1180 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1174 +#: ../../library/multiprocessing.rst:1184 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1178 +#: ../../library/multiprocessing.rst:1188 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1183 +#: ../../library/multiprocessing.rst:1193 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1208 +#: ../../library/multiprocessing.rst:1218 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1212 +#: ../../library/multiprocessing.rst:1222 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1302,73 +1312,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1219 +#: ../../library/multiprocessing.rst:1229 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1225 +#: ../../library/multiprocessing.rst:1235 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1229 +#: ../../library/multiprocessing.rst:1239 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1233 +#: ../../library/multiprocessing.rst:1243 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1238 +#: ../../library/multiprocessing.rst:1248 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1244 +#: ../../library/multiprocessing.rst:1254 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1247 -#: ../../library/multiprocessing.rst:1385 +#: ../../library/multiprocessing.rst:1257 +#: ../../library/multiprocessing.rst:1395 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1251 +#: ../../library/multiprocessing.rst:1261 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1256 +#: ../../library/multiprocessing.rst:1266 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1258 +#: ../../library/multiprocessing.rst:1268 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1261 -#: ../../library/multiprocessing.rst:1796 +#: ../../library/multiprocessing.rst:1271 +#: ../../library/multiprocessing.rst:1806 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1266 +#: ../../library/multiprocessing.rst:1276 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1271 +#: ../../library/multiprocessing.rst:1281 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1379,25 +1389,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1279 +#: ../../library/multiprocessing.rst:1289 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1283 +#: ../../library/multiprocessing.rst:1293 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1288 -#: ../../library/multiprocessing.rst:1339 +#: ../../library/multiprocessing.rst:1298 +#: ../../library/multiprocessing.rst:1349 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1290 +#: ../../library/multiprocessing.rst:1300 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1405,14 +1415,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1295 +#: ../../library/multiprocessing.rst:1305 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1299 +#: ../../library/multiprocessing.rst:1309 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1426,19 +1436,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1314 +#: ../../library/multiprocessing.rst:1324 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1317 +#: ../../library/multiprocessing.rst:1327 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1323 +#: ../../library/multiprocessing.rst:1333 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1447,20 +1457,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1329 +#: ../../library/multiprocessing.rst:1339 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1333 +#: ../../library/multiprocessing.rst:1343 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1341 +#: ../../library/multiprocessing.rst:1351 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1473,7 +1483,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1351 +#: ../../library/multiprocessing.rst:1361 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1484,14 +1494,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1359 +#: ../../library/multiprocessing.rst:1369 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1366 +#: ../../library/multiprocessing.rst:1376 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1501,7 +1511,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1374 +#: ../../library/multiprocessing.rst:1384 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1510,17 +1520,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1383 +#: ../../library/multiprocessing.rst:1393 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1390 +#: ../../library/multiprocessing.rst:1400 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1395 +#: ../../library/multiprocessing.rst:1405 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1529,13 +1539,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1401 +#: ../../library/multiprocessing.rst:1411 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1406 +#: ../../library/multiprocessing.rst:1416 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1544,32 +1554,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1414 +#: ../../library/multiprocessing.rst:1424 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1416 +#: ../../library/multiprocessing.rst:1426 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1421 +#: ../../library/multiprocessing.rst:1431 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1425 -#: ../../library/multiprocessing.rst:1512 +#: ../../library/multiprocessing.rst:1435 +#: ../../library/multiprocessing.rst:1522 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1429 +#: ../../library/multiprocessing.rst:1439 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -1579,32 +1589,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1436 +#: ../../library/multiprocessing.rst:1446 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1442 +#: ../../library/multiprocessing.rst:1452 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1448 -#: ../../library/multiprocessing.rst:1538 -#: ../../library/multiprocessing.rst:1553 +#: ../../library/multiprocessing.rst:1458 +#: ../../library/multiprocessing.rst:1548 +#: ../../library/multiprocessing.rst:1563 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1452 +#: ../../library/multiprocessing.rst:1462 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1455 +#: ../../library/multiprocessing.rst:1465 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1614,7 +1624,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1462 +#: ../../library/multiprocessing.rst:1472 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -1624,28 +1634,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1469 +#: ../../library/multiprocessing.rst:1479 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1471 +#: ../../library/multiprocessing.rst:1481 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1476 +#: ../../library/multiprocessing.rst:1486 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1481 +#: ../../library/multiprocessing.rst:1491 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1487 +#: ../../library/multiprocessing.rst:1497 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -1654,11 +1664,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1495 +#: ../../library/multiprocessing.rst:1505 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1497 +#: ../../library/multiprocessing.rst:1507 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1668,40 +1678,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1504 +#: ../../library/multiprocessing.rst:1514 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1510 +#: ../../library/multiprocessing.rst:1520 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1516 +#: ../../library/multiprocessing.rst:1526 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1520 +#: ../../library/multiprocessing.rst:1530 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1526 +#: ../../library/multiprocessing.rst:1536 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1530 -#: ../../library/multiprocessing.rst:1546 +#: ../../library/multiprocessing.rst:1540 +#: ../../library/multiprocessing.rst:1556 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -1711,121 +1721,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1542 +#: ../../library/multiprocessing.rst:1552 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1557 +#: ../../library/multiprocessing.rst:1567 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1562 +#: ../../library/multiprocessing.rst:1572 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1566 +#: ../../library/multiprocessing.rst:1576 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1570 +#: ../../library/multiprocessing.rst:1580 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1583 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1577 +#: ../../library/multiprocessing.rst:1587 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1582 +#: ../../library/multiprocessing.rst:1592 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1582 +#: ../../library/multiprocessing.rst:1592 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1582 +#: ../../library/multiprocessing.rst:1592 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1584 +#: ../../library/multiprocessing.rst:1594 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1584 +#: ../../library/multiprocessing.rst:1594 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1584 +#: ../../library/multiprocessing.rst:1594 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1585 +#: ../../library/multiprocessing.rst:1595 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1585 +#: ../../library/multiprocessing.rst:1595 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1586 +#: ../../library/multiprocessing.rst:1596 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1586 +#: ../../library/multiprocessing.rst:1596 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1586 +#: ../../library/multiprocessing.rst:1596 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1587 +#: ../../library/multiprocessing.rst:1597 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1587 +#: ../../library/multiprocessing.rst:1597 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1587 +#: ../../library/multiprocessing.rst:1597 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1591 +#: ../../library/multiprocessing.rst:1601 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1629 +#: ../../library/multiprocessing.rst:1639 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1642 +#: ../../library/multiprocessing.rst:1652 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1654 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1834,7 +1844,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1653 +#: ../../library/multiprocessing.rst:1663 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1842,31 +1852,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1661 +#: ../../library/multiprocessing.rst:1671 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1667 +#: ../../library/multiprocessing.rst:1677 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1669 +#: ../../library/multiprocessing.rst:1679 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1672 +#: ../../library/multiprocessing.rst:1682 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1675 +#: ../../library/multiprocessing.rst:1685 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -1874,50 +1884,50 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1682 +#: ../../library/multiprocessing.rst:1692 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1687 +#: ../../library/multiprocessing.rst:1697 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1696 +#: ../../library/multiprocessing.rst:1706 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1700 +#: ../../library/multiprocessing.rst:1710 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1708 +#: ../../library/multiprocessing.rst:1718 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1711 +#: ../../library/multiprocessing.rst:1721 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1715 +#: ../../library/multiprocessing.rst:1725 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1718 +#: ../../library/multiprocessing.rst:1728 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1721 +#: ../../library/multiprocessing.rst:1731 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -1925,14 +1935,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1727 +#: ../../library/multiprocessing.rst:1737 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1731 +#: ../../library/multiprocessing.rst:1741 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -1943,7 +1953,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1740 +#: ../../library/multiprocessing.rst:1750 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -1953,22 +1963,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1747 +#: ../../library/multiprocessing.rst:1757 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1751 +#: ../../library/multiprocessing.rst:1761 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1755 +#: ../../library/multiprocessing.rst:1765 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1757 +#: ../../library/multiprocessing.rst:1767 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -1976,173 +1986,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1763 +#: ../../library/multiprocessing.rst:1773 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:1768 +#: ../../library/multiprocessing.rst:1778 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:1772 +#: ../../library/multiprocessing.rst:1782 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:1778 +#: ../../library/multiprocessing.rst:1788 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1785 +#: ../../library/multiprocessing.rst:1795 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1790 +#: ../../library/multiprocessing.rst:1800 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1793 +#: ../../library/multiprocessing.rst:1803 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:1801 +#: ../../library/multiprocessing.rst:1811 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1805 +#: ../../library/multiprocessing.rst:1815 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1809 +#: ../../library/multiprocessing.rst:1819 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1813 +#: ../../library/multiprocessing.rst:1823 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1817 +#: ../../library/multiprocessing.rst:1827 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1821 +#: ../../library/multiprocessing.rst:1831 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1826 +#: ../../library/multiprocessing.rst:1836 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1830 +#: ../../library/multiprocessing.rst:1840 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1837 +#: ../../library/multiprocessing.rst:1847 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1842 +#: ../../library/multiprocessing.rst:1852 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1844 +#: ../../library/multiprocessing.rst:1854 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1851 +#: ../../library/multiprocessing.rst:1861 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1853 +#: ../../library/multiprocessing.rst:1863 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:1856 +#: ../../library/multiprocessing.rst:1866 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:1872 +#: ../../library/multiprocessing.rst:1882 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1874 +#: ../../library/multiprocessing.rst:1884 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:1899 +#: ../../library/multiprocessing.rst:1909 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1901 +#: ../../library/multiprocessing.rst:1911 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:1904 +#: ../../library/multiprocessing.rst:1914 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1916 +#: ../../library/multiprocessing.rst:1926 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1926 +#: ../../library/multiprocessing.rst:1936 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1937 +#: ../../library/multiprocessing.rst:1947 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:1962 +#: ../../library/multiprocessing.rst:1972 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:1964 +#: ../../library/multiprocessing.rst:1974 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:1968 +#: ../../library/multiprocessing.rst:1978 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2150,14 +2160,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:1986 +#: ../../library/multiprocessing.rst:1996 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:1990 +#: ../../library/multiprocessing.rst:2000 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -2165,11 +2175,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2006 +#: ../../library/multiprocessing.rst:2016 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2019 +#: ../../library/multiprocessing.rst:2029 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -2180,53 +2190,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2038 +#: ../../library/multiprocessing.rst:2048 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2044 +#: ../../library/multiprocessing.rst:2054 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2052 +#: ../../library/multiprocessing.rst:2062 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2056 +#: ../../library/multiprocessing.rst:2066 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2060 +#: ../../library/multiprocessing.rst:2070 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2062 +#: ../../library/multiprocessing.rst:2072 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2066 +#: ../../library/multiprocessing.rst:2076 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2070 +#: ../../library/multiprocessing.rst:2080 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2072 +#: ../../library/multiprocessing.rst:2082 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2076 +#: ../../library/multiprocessing.rst:2086 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -2234,79 +2244,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2081 +#: ../../library/multiprocessing.rst:2091 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2084 +#: ../../library/multiprocessing.rst:2094 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2100 +#: ../../library/multiprocessing.rst:2110 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2102 +#: ../../library/multiprocessing.rst:2112 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2106 +#: ../../library/multiprocessing.rst:2116 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2110 +#: ../../library/multiprocessing.rst:2120 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2114 +#: ../../library/multiprocessing.rst:2124 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2116 +#: ../../library/multiprocessing.rst:2126 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2119 +#: ../../library/multiprocessing.rst:2129 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2124 +#: ../../library/multiprocessing.rst:2134 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2129 +#: ../../library/multiprocessing.rst:2139 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2134 +#: ../../library/multiprocessing.rst:2144 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2138 +#: ../../library/multiprocessing.rst:2148 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2141 -#: ../../library/multiprocessing.rst:2702 +#: ../../library/multiprocessing.rst:2151 +#: ../../library/multiprocessing.rst:2712 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2144 +#: ../../library/multiprocessing.rst:2154 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -2314,7 +2324,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2159 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2322,13 +2332,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2155 +#: ../../library/multiprocessing.rst:2165 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2159 +#: ../../library/multiprocessing.rst:2169 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -2336,22 +2346,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2164 +#: ../../library/multiprocessing.rst:2174 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2168 +#: ../../library/multiprocessing.rst:2178 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2171 +#: ../../library/multiprocessing.rst:2181 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2176 +#: ../../library/multiprocessing.rst:2186 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -2362,7 +2372,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2186 +#: ../../library/multiprocessing.rst:2196 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -2370,14 +2380,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2193 +#: ../../library/multiprocessing.rst:2203 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2196 -#: ../../library/multiprocessing.rst:2227 +#: ../../library/multiprocessing.rst:2206 +#: ../../library/multiprocessing.rst:2237 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -2385,60 +2395,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2201 -#: ../../library/multiprocessing.rst:2232 +#: ../../library/multiprocessing.rst:2211 +#: ../../library/multiprocessing.rst:2242 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2205 -#: ../../library/multiprocessing.rst:2236 +#: ../../library/multiprocessing.rst:2215 +#: ../../library/multiprocessing.rst:2246 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2210 +#: ../../library/multiprocessing.rst:2220 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2214 +#: ../../library/multiprocessing.rst:2224 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2218 +#: ../../library/multiprocessing.rst:2228 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2224 +#: ../../library/multiprocessing.rst:2234 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2241 +#: ../../library/multiprocessing.rst:2251 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2243 +#: ../../library/multiprocessing.rst:2253 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2248 +#: ../../library/multiprocessing.rst:2258 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -2446,65 +2456,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2255 +#: ../../library/multiprocessing.rst:2265 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2261 +#: ../../library/multiprocessing.rst:2271 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2265 +#: ../../library/multiprocessing.rst:2275 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2272 +#: ../../library/multiprocessing.rst:2282 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2280 +#: ../../library/multiprocessing.rst:2290 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2285 +#: ../../library/multiprocessing.rst:2295 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2291 +#: ../../library/multiprocessing.rst:2301 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2294 +#: ../../library/multiprocessing.rst:2304 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2302 +#: ../../library/multiprocessing.rst:2312 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2307 +#: ../../library/multiprocessing.rst:2317 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2512,41 +2522,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2314 +#: ../../library/multiprocessing.rst:2324 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2318 +#: ../../library/multiprocessing.rst:2328 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2322 +#: ../../library/multiprocessing.rst:2332 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2325 +#: ../../library/multiprocessing.rst:2335 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2329 +#: ../../library/multiprocessing.rst:2339 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2356 +#: ../../library/multiprocessing.rst:2366 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2361 +#: ../../library/multiprocessing.rst:2371 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2365 +#: ../../library/multiprocessing.rst:2375 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2555,46 +2565,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2374 +#: ../../library/multiprocessing.rst:2384 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2377 +#: ../../library/multiprocessing.rst:2387 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2383 +#: ../../library/multiprocessing.rst:2393 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2386 +#: ../../library/multiprocessing.rst:2396 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2391 +#: ../../library/multiprocessing.rst:2401 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2394 +#: ../../library/multiprocessing.rst:2404 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2398 -#: ../../library/multiprocessing.rst:2433 +#: ../../library/multiprocessing.rst:2408 +#: ../../library/multiprocessing.rst:2443 msgid "" "If *authkey* is given and not None, it should be a byte string and will be " "used as the secret key for an HMAC-based authentication challenge. No " @@ -2603,26 +2613,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2406 +#: ../../library/multiprocessing.rst:2416 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2409 +#: ../../library/multiprocessing.rst:2419 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2414 +#: ../../library/multiprocessing.rst:2424 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2418 +#: ../../library/multiprocessing.rst:2428 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -2636,49 +2646,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2429 +#: ../../library/multiprocessing.rst:2439 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2441 +#: ../../library/multiprocessing.rst:2451 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2448 +#: ../../library/multiprocessing.rst:2458 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2452 +#: ../../library/multiprocessing.rst:2462 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2456 +#: ../../library/multiprocessing.rst:2466 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2460 +#: ../../library/multiprocessing.rst:2470 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2463 +#: ../../library/multiprocessing.rst:2473 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2470 +#: ../../library/multiprocessing.rst:2480 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -2687,32 +2697,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2476 +#: ../../library/multiprocessing.rst:2486 msgid "" "For both Unix and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2479 +#: ../../library/multiprocessing.rst:2489 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2480 +#: ../../library/multiprocessing.rst:2490 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2481 +#: ../../library/multiprocessing.rst:2491 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2484 +#: ../../library/multiprocessing.rst:2494 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2487 +#: ../../library/multiprocessing.rst:2497 msgid "" "**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2720,7 +2730,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2493 +#: ../../library/multiprocessing.rst:2503 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -2729,46 +2739,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2503 +#: ../../library/multiprocessing.rst:2513 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2505 +#: ../../library/multiprocessing.rst:2515 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2524 +#: ../../library/multiprocessing.rst:2534 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2541 +#: ../../library/multiprocessing.rst:2551 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2580 +#: ../../library/multiprocessing.rst:2590 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2582 +#: ../../library/multiprocessing.rst:2592 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2585 +#: ../../library/multiprocessing.rst:2595 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2588 +#: ../../library/multiprocessing.rst:2598 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\.\\\\pipe\\" "\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a " @@ -2776,17 +2786,17 @@ msgid "" "samp:`r'\\\\\\\\{ServerName}\\\\pipe\\\\{PipeName}'` instead." msgstr "" -#: ../../library/multiprocessing.rst:2593 +#: ../../library/multiprocessing.rst:2603 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2600 +#: ../../library/multiprocessing.rst:2610 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2602 +#: ../../library/multiprocessing.rst:2612 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2794,7 +2804,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2608 +#: ../../library/multiprocessing.rst:2618 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -2802,7 +2812,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2614 +#: ../../library/multiprocessing.rst:2624 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2813,17 +2823,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2622 +#: ../../library/multiprocessing.rst:2632 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2626 +#: ../../library/multiprocessing.rst:2636 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2628 +#: ../../library/multiprocessing.rst:2638 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2831,27 +2841,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2635 +#: ../../library/multiprocessing.rst:2645 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2638 +#: ../../library/multiprocessing.rst:2648 msgid "" "When first created the logger has level :data:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2642 +#: ../../library/multiprocessing.rst:2652 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2649 +#: ../../library/multiprocessing.rst:2659 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -2860,25 +2870,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2655 +#: ../../library/multiprocessing.rst:2665 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2670 +#: ../../library/multiprocessing.rst:2680 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2674 +#: ../../library/multiprocessing.rst:2684 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2679 +#: ../../library/multiprocessing.rst:2689 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2684 +#: ../../library/multiprocessing.rst:2694 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2886,7 +2896,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2692 +#: ../../library/multiprocessing.rst:2702 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2896,18 +2906,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2699 +#: ../../library/multiprocessing.rst:2709 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2705 +#: ../../library/multiprocessing.rst:2715 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2709 +#: ../../library/multiprocessing.rst:2719 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -2917,7 +2927,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2716 +#: ../../library/multiprocessing.rst:2726 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2926,69 +2936,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2726 +#: ../../library/multiprocessing.rst:2736 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2728 +#: ../../library/multiprocessing.rst:2738 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2733 +#: ../../library/multiprocessing.rst:2743 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2735 +#: ../../library/multiprocessing.rst:2745 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2737 +#: ../../library/multiprocessing.rst:2747 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2739 +#: ../../library/multiprocessing.rst:2749 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2742 +#: ../../library/multiprocessing.rst:2752 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:2746 +#: ../../library/multiprocessing.rst:2756 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2748 +#: ../../library/multiprocessing.rst:2758 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2750 +#: ../../library/multiprocessing.rst:2760 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2752 +#: ../../library/multiprocessing.rst:2762 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2755 +#: ../../library/multiprocessing.rst:2765 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2757 +#: ../../library/multiprocessing.rst:2767 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2759 +#: ../../library/multiprocessing.rst:2769 msgid "" "On Unix when a process finishes but has not been joined it becomes a zombie. " "There should never be very many because each time a new process starts (or :" @@ -2999,11 +3009,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2767 +#: ../../library/multiprocessing.rst:2777 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2769 +#: ../../library/multiprocessing.rst:2779 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3013,11 +3023,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2777 +#: ../../library/multiprocessing.rst:2787 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2779 +#: ../../library/multiprocessing.rst:2789 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3025,18 +3035,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2785 +#: ../../library/multiprocessing.rst:2795 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:2789 +#: ../../library/multiprocessing.rst:2799 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2791 +#: ../../library/multiprocessing.rst:2801 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -3045,7 +3055,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2797 +#: ../../library/multiprocessing.rst:2807 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -3054,21 +3064,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2803 +#: ../../library/multiprocessing.rst:2813 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2817 +#: ../../library/multiprocessing.rst:2827 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2820 +#: ../../library/multiprocessing.rst:2830 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2822 +#: ../../library/multiprocessing.rst:2832 msgid "" "On Unix using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3076,7 +3086,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2827 +#: ../../library/multiprocessing.rst:2837 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -3085,29 +3095,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2834 +#: ../../library/multiprocessing.rst:2844 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2846 +#: ../../library/multiprocessing.rst:2856 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2858 +#: ../../library/multiprocessing.rst:2868 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2860 +#: ../../library/multiprocessing.rst:2870 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2864 +#: ../../library/multiprocessing.rst:2874 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:2870 +#: ../../library/multiprocessing.rst:2880 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3117,33 +3127,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2877 +#: ../../library/multiprocessing.rst:2887 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2889 +#: ../../library/multiprocessing.rst:2899 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2892 +#: ../../library/multiprocessing.rst:2902 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2894 +#: ../../library/multiprocessing.rst:2904 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2897 +#: ../../library/multiprocessing.rst:2907 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2899 +#: ../../library/multiprocessing.rst:2909 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3151,11 +3161,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2904 +#: ../../library/multiprocessing.rst:2914 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2906 +#: ../../library/multiprocessing.rst:2916 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -3163,66 +3173,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2911 +#: ../../library/multiprocessing.rst:2921 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2914 +#: ../../library/multiprocessing.rst:2924 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2916 +#: ../../library/multiprocessing.rst:2926 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such a starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:2920 +#: ../../library/multiprocessing.rst:2930 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2932 +#: ../../library/multiprocessing.rst:2942 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2946 +#: ../../library/multiprocessing.rst:2956 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:2949 +#: ../../library/multiprocessing.rst:2959 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:2952 +#: ../../library/multiprocessing.rst:2962 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:2959 +#: ../../library/multiprocessing.rst:2969 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:2961 +#: ../../library/multiprocessing.rst:2971 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:2967 +#: ../../library/multiprocessing.rst:2977 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:2973 +#: ../../library/multiprocessing.rst:2983 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" diff --git a/library/os.path.po b/library/os.path.po index ff88c35fe8..f854edc535 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -341,7 +341,7 @@ msgstr "" #: ../../library/os.path.rst:337 msgid "" "On POSIX systems, in accordance with `IEEE Std 1003.1 2013 Edition; 4.13 " -"Pathname Resolution `_, if a pathname begins with exactly two " "slashes, the first component following the leading characters may be " "interpreted in an implementation-defined manner, although more than two " diff --git a/library/os.po b/library/os.po index ae26278dd8..638f3740d3 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2631,9 +2631,9 @@ msgstr "" #: ../../library/os.rst:2441 msgid "" -"On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " -"`readdir() `_ functions. On Windows, it uses the Win32 `FindFirstFileW " "`_ and `FindNextFileW `_." +"See also the `Linux getrandom() manual page `_." msgstr "" #: ../../library/os.rst:4876 diff --git a/library/secrets.po b/library/secrets.po index 36f4efafc8..db01d6cf11 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2022-06-11 14:07+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -202,12 +202,12 @@ msgstr "產生八個字元長的字母數字密碼:" #: ../../library/secrets.rst:155 msgid "" -"Applications should not `store passwords in a recoverable format `_, whether plain text or encrypted. " -"They should be salted and hashed using a cryptographically strong one-way " -"(irreversible) hash function." +"Applications should not `store passwords in a recoverable format `_, whether plain text or " +"encrypted. They should be salted and hashed using a cryptographically " +"strong one-way (irreversible) hash function." msgstr "" -"應用程式不能\\ `以可復原的格式存儲密碼 `_,無論是用純文本還是經過加密。 它們應當先加鹽" "(salt),再使用高加密強度的單向(不可逆)雜湊函數來產生雜湊值。" diff --git a/library/socket.po b/library/socket.po index 471e5130ef..bb3a064403 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+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-" @@ -485,7 +485,7 @@ msgstr "" #: ../../library/socket.rst:343 msgid "" -"`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 53d9a9817d..060976f8f0 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-30 00:15+0000\n" +"POT-Creation-Date: 2022-08-31 08:54+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-" @@ -26,11 +26,7 @@ msgstr "" msgid "**Source code:** :source:`Lib/sqlite3/`" msgstr "**原始碼:**\\ :source:`Lib/sqlite3/`" -#: ../../library/sqlite3.rst:15 ../../library/sqlite3.rst:1108 -msgid "Introduction" -msgstr "簡介" - -#: ../../library/sqlite3.rst:17 +#: ../../library/sqlite3.rst:23 msgid "" "SQLite is a C library that provides a lightweight disk-based database that " "doesn't require a separate server process and allows accessing the database " @@ -40,201 +36,224 @@ msgid "" "PostgreSQL or Oracle." msgstr "" -#: ../../library/sqlite3.rst:24 +#: ../../library/sqlite3.rst:30 msgid "" -"The sqlite3 module was written by Gerhard Häring. It provides an SQL " -"interface compliant with the DB-API 2.0 specification described by :pep:" +"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.7.15 or newer." msgstr "" -#: ../../library/sqlite3.rst:32 -msgid "Tutorial" -msgstr "" - #: ../../library/sqlite3.rst:34 -msgid "" -"To use the module, start by creating a :class:`Connection` object that " -"represents the database. Here the data will be stored in the :file:`example." -"db` file::" -msgstr "" - -#: ../../library/sqlite3.rst:41 -msgid "" -"The special path name ``:memory:`` can be provided to create a temporary " -"database in RAM." +msgid "This document includes four main sections:" msgstr "" -#: ../../library/sqlite3.rst:44 -msgid "" -"Once a :class:`Connection` has been established, create a :class:`Cursor` " -"object and call its :meth:`~Cursor.execute` method to perform SQL commands::" -msgstr "" - -#: ../../library/sqlite3.rst:63 -msgid "" -"The saved data is persistent: it can be reloaded in a subsequent session " -"even after restarting the Python interpreter::" +#: ../../library/sqlite3.rst:36 +msgid ":ref:`sqlite3-tutorial` teaches how to use the :mod:`!sqlite3` module." msgstr "" -#: ../../library/sqlite3.rst:70 -msgid "At this point, our database only contains one row::" -msgstr "" - -#: ../../library/sqlite3.rst:76 +#: ../../library/sqlite3.rst:37 msgid "" -"The result is a one-item :class:`tuple`: one row, with one column. Now, let " -"us insert three more rows of data, using :meth:`~Cursor.executemany`::" +":ref:`sqlite3-reference` describes the classes and functions this module " +"defines." msgstr "" -#: ../../library/sqlite3.rst:88 -msgid "" -"Then, retrieve the data by iterating over the result of a ``SELECT`` " -"statement::" +#: ../../library/sqlite3.rst:39 +msgid ":ref:`sqlite3-howtos` details how to handle specific tasks." msgstr "" -#: ../../library/sqlite3.rst:101 +#: ../../library/sqlite3.rst:40 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 " -"vulnerable to SQL injection attacks (see the `xkcd webcomic `_ for a humorous example of what can go wrong)::" +":ref:`sqlite3-explanation` provides in-depth background on transaction " +"control." msgstr "" -#: ../../library/sqlite3.rst:110 -msgid "" -"Instead, use the DB-API's parameter substitution. To insert a variable into " -"a query string, use a placeholder in the string, and substitute the actual " -"values into the query by providing them as a :class:`tuple` of values to the " -"second argument of the cursor's :meth:`~Cursor.execute` method. An SQL " -"statement may use one of two kinds of placeholders: question marks (qmark " -"style) or named placeholders (named style). For the qmark style, " -"``parameters`` must be a :term:`sequence `. For the named style, " -"it can be either a :term:`sequence ` or :class:`dict` instance. " -"The length of the :term:`sequence ` must match the number of " -"placeholders, or a :exc:`ProgrammingError` is raised. If a :class:`dict` is " -"given, it must contain keys for all named parameters. Any extra items are " -"ignored. Here's an example of both styles:" -msgstr "" - -#: ../../library/sqlite3.rst:130 +#: ../../library/sqlite3.rst:47 msgid "https://www.sqlite.org" msgstr "https://www.sqlite.org" -#: ../../library/sqlite3.rst:129 +#: ../../library/sqlite3.rst:46 msgid "" "The SQLite web page; the documentation describes the syntax and the " "available data types for the supported SQL dialect." msgstr "" -#: ../../library/sqlite3.rst:133 +#: ../../library/sqlite3.rst:50 msgid "https://www.w3schools.com/sql/" msgstr "https://www.w3schools.com/sql/" -#: ../../library/sqlite3.rst:133 +#: ../../library/sqlite3.rst:50 msgid "Tutorial, reference and examples for learning SQL syntax." msgstr "" -#: ../../library/sqlite3.rst:135 +#: ../../library/sqlite3.rst:52 msgid ":pep:`249` - Database API Specification 2.0" msgstr "" -#: ../../library/sqlite3.rst:136 +#: ../../library/sqlite3.rst:53 msgid "PEP written by Marc-André Lemburg." msgstr "PEP 由 Marc-André Lemburg 撰寫。" -#: ../../library/sqlite3.rst:142 -msgid "Module functions and constants" +#: ../../library/sqlite3.rst:66 +msgid "Tutorial" msgstr "" -#: ../../library/sqlite3.rst:147 +#: ../../library/sqlite3.rst:68 msgid "" -"String constant stating the supported DB-API level. Required by the DB-API. " -"Hard-coded to ``\"2.0\"``." +"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:152 +#: ../../library/sqlite3.rst:73 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" -"\"``." +"First, we need to create a new database and open a database connection to " +"allow :mod:`!sqlite3` to work with it. Call :func:`sqlite3.connect` to to " +"create a connection to the database :file:`tutorial.db` in the current " +"working directory, implicitly creating it if it does not exist:" msgstr "" -#: ../../library/sqlite3.rst:158 +#: ../../library/sqlite3.rst:84 msgid "" -"The :mod:`sqlite3` module supports both ``qmark`` and ``numeric`` DB-API " -"parameter styles, because that is what the underlying SQLite library " -"supports. However, the DB-API does not allow multiple values for the " -"``paramstyle`` attribute." +"The returned :class:`Connection` object ``con`` represents the connection to " +"the on-disk database." msgstr "" -#: ../../library/sqlite3.rst:165 +#: ../../library/sqlite3.rst:87 msgid "" -"Version number of this module as a :class:`string `. This is not the " -"version of the SQLite library." +"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:171 +#: ../../library/sqlite3.rst:95 msgid "" -"Version number of this module as a :class:`tuple` of :class:`integers " -"`. This is not the version of the SQLite library." +"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 " +"score. For simplicity, we can just use column names in the table declaration " +"-- thanks to the `flexible typing`_ feature of SQLite, specifying the data " +"types is optional. Execute the ``CREATE TABLE`` statement by calling :meth:" +"`cur.execute(...) `:" msgstr "" -#: ../../library/sqlite3.rst:177 +#: ../../library/sqlite3.rst:111 msgid "" -"Version number of the runtime SQLite library as a :class:`string `." +"We can verify that the new table has been created by querying the " +"``sqlite_master`` table built-in to SQLite, which should now contain an " +"entry for the ``movie`` table definition (see `The Schema Table`_ for " +"details). Execute that query by calling :meth:`cur.execute(...) `, assign the result to ``res``, and call :meth:`res.fetchone() " +"` to fetch the resulting row:" msgstr "" -#: ../../library/sqlite3.rst:182 +#: ../../library/sqlite3.rst:125 msgid "" -"Version number of the runtime SQLite library as a :class:`tuple` of :class:" -"`integers `." +"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:188 +#: ../../library/sqlite3.rst:136 msgid "" -"Integer constant required by the DB-API, stating the level of thread safety " -"the :mod:`sqlite3` module supports. Currently hard-coded to ``1``, meaning *" -"\"Threads may share the module, but not connections.\"* However, this may " -"not always be true. You can check the underlying SQLite library's compile-" -"time threaded mode using the following query::" +"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:201 +#: ../../library/sqlite3.rst:148 msgid "" -"Note that the `SQLITE_THREADSAFE levels `_ do not match the DB-API 2.0 ``threadsafety`` levels." +"The ``INSERT`` statement implicitly opens a transaction, which needs to be " +"committed before changes are saved in the database (see :ref:`sqlite3-" +"controlling-transactions` for details). Call :meth:`con.commit() ` on the connection object to commit the transaction:" msgstr "" -#: ../../library/sqlite3.rst:208 +#: ../../library/sqlite3.rst:158 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 " -"types are declared when the database table is created. ``sqlite3`` will look " -"up a converter function using the first word of the declared type as the " -"converter dictionary key. For example:" +"We can verify that the data was inserted correctly by executing a ``SELECT`` " +"query. Use the now-familiar :meth:`cur.execute(...) ` to " +"assign the result to ``res``, and call :meth:`res.fetchall() ` to return all resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:225 +#: ../../library/sqlite3.rst:170 msgid "" -"This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " -"(bitwise or) operator." +"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:231 +#: ../../library/sqlite3.rst:173 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 " -"column name, as the converter dictionary key. The type name must be wrapped " -"in square brackets (``[]``)." +"Now, insert three more rows by calling :meth:`cur.executemany(...) `:" msgstr "" -#: ../../library/sqlite3.rst:241 +#: ../../library/sqlite3.rst:186 msgid "" -"This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " -"(bitwise or) operator." +"Notice that ``?`` placeholders are used to bind ``data`` to the query. " +"Always use placeholders instead of :ref:`string formatting ` " +"to bind Python values to SQL statements, to avoid `SQL injection attacks`_ " +"(see :ref:`sqlite3-placeholders` for more details)." +msgstr "" + +#: ../../library/sqlite3.rst:192 +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:206 +msgid "" +"Each row is a two-item :class:`tuple` of ``(year, title)``, matching the " +"columns selected in the query." +msgstr "" + +#: ../../library/sqlite3.rst:209 +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:224 +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:236 +msgid ":ref:`sqlite3-howtos` for further reading:" +msgstr "" + +#: ../../library/sqlite3.rst:238 +msgid ":ref:`sqlite3-placeholders`" +msgstr "" + +#: ../../library/sqlite3.rst:239 +msgid ":ref:`sqlite3-adapters`" +msgstr "" + +#: ../../library/sqlite3.rst:240 +msgid ":ref:`sqlite3-converters`" +msgstr "" + +#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:514 +msgid ":ref:`sqlite3-connection-context-manager`" +msgstr "" + +#: ../../library/sqlite3.rst:243 +msgid "" +":ref:`sqlite3-explanation` for in-depth background on transaction control." msgstr "" #: ../../library/sqlite3.rst:248 +msgid "Reference" +msgstr "" + +#: ../../library/sqlite3.rst:256 +msgid "Module functions" +msgstr "" + +#: ../../library/sqlite3.rst:263 msgid "Open a connection to an SQLite database." msgstr "" @@ -242,13 +261,13 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/sqlite3.rst:250 +#: ../../library/sqlite3.rst:265 msgid "" "The path to the database file to be opened. Pass ``\":memory:\"`` to open a " "connection to a database that is in RAM instead of on disk." msgstr "" -#: ../../library/sqlite3.rst:256 +#: ../../library/sqlite3.rst:271 msgid "" "How many seconds the connection should wait before raising an exception, if " "the database is locked by another connection. If another connection opens a " @@ -256,7 +275,7 @@ msgid "" "is committed. Default five seconds." msgstr "" -#: ../../library/sqlite3.rst:264 +#: ../../library/sqlite3.rst:278 msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " @@ -269,38 +288,37 @@ msgid "" "disabled." msgstr "" -#: ../../library/sqlite3.rst:279 +#: ../../library/sqlite3.rst:292 msgid "" "The :attr:`~Connection.isolation_level` of the connection, controlling " "whether and how transactions are implicitly opened. Can be ``\"DEFERRED\"`` " -"(default), ``\"EXCLUSIVE\"`` or ``\"IMMEDIATE\"``; or :const:`None` to " -"disable opening transactions implicitly. See :ref:`sqlite3-controlling-" -"transactions` for more." +"(default), ``\"EXCLUSIVE\"`` or ``\"IMMEDIATE\"``; or ``None`` to disable " +"opening transactions implicitly. See :ref:`sqlite3-controlling-transactions` " +"for more." msgstr "" -#: ../../library/sqlite3.rst:287 +#: ../../library/sqlite3.rst:300 msgid "" -"If :const:`True` (default), only the creating thread may use the connection. " -"If :const:`False`, the connection may be shared across multiple threads; if " -"so, write operations should be serialized by the user to avoid data " -"corruption." +"If ``True`` (default), only the creating thread may use the connection. If " +"``False``, the connection may be shared across multiple threads; if so, " +"write operations should be serialized by the user to avoid data corruption." msgstr "" -#: ../../library/sqlite3.rst:294 +#: ../../library/sqlite3.rst:306 msgid "" "A custom subclass of :class:`Connection` to create the connection with, if " "not the default :class:`Connection` class." msgstr "" -#: ../../library/sqlite3.rst:299 +#: ../../library/sqlite3.rst:310 msgid "" -"The number of statements that ``sqlite3`` should internally cache for this " -"connection, to avoid parsing overhead. By default, 100 statements." +"The number of statements that :mod:`!sqlite3` should internally cache for " +"this connection, to avoid parsing overhead. By default, 100 statements." msgstr "" -#: ../../library/sqlite3.rst:305 +#: ../../library/sqlite3.rst:315 msgid "" -"If set to :const:`True`, *database* is interpreted as a :abbr:`URI (Uniform " +"If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform " "Resource Identifier)` with a file path and an optional query string. The " "scheme part *must* be ``\"file:\"``, and the path can be relative or " "absolute. The query string allows passing parameters to SQLite, enabling " @@ -311,32 +329,68 @@ msgstr "" msgid "Return type" msgstr "" -#: ../../library/sqlite3.rst:317 +#: ../../library/sqlite3.rst:326 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -#: ../../library/sqlite3.rst:318 +#: ../../library/sqlite3.rst:327 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." msgstr "" -#: ../../library/sqlite3.rst:320 +#: ../../library/sqlite3.rst:329 msgid "The *uri* parameter." msgstr "*uri* 參數。" -#: ../../library/sqlite3.rst:323 +#: ../../library/sqlite3.rst:332 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:326 +#: ../../library/sqlite3.rst:335 msgid "The ``sqlite3.connect/handle`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:332 +#: ../../library/sqlite3.rst:340 +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 " +"performed, other than checking that there are no unclosed string literals " +"and the statement is terminated by a semicolon." +msgstr "" + +#: ../../library/sqlite3.rst:346 +msgid "For example:" +msgstr "範例:" + +#: ../../library/sqlite3.rst:355 +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:361 +msgid "" +"Enable or disable callback tracebacks. By default you will not get any " +"tracebacks in user-defined functions, aggregates, converters, authorizer " +"callbacks etc. If you want to debug them, you can call this function with " +"*flag* set to ``True``. Afterwards, you will get tracebacks from callbacks " +"on ``sys.stderr``. Use ``False`` to disable the feature again." +msgstr "" + +#: ../../library/sqlite3.rst:370 +msgid "" +"Register an *adapter* callable to adapt the Python type *type* into an " +"SQLite type. The adapter is called with a Python object of type *type* as " +"its sole argument, and must return a value of a :ref:`type that SQLite " +"natively understands `." +msgstr "" + +#: ../../library/sqlite3.rst:378 msgid "" "Register the *converter* callable to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " @@ -346,292 +400,401 @@ msgid "" "type detection works." msgstr "" -#: ../../library/sqlite3.rst:340 +#: ../../library/sqlite3.rst:386 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" -#: ../../library/sqlite3.rst:346 +#: ../../library/sqlite3.rst:393 +msgid "Module constants" +msgstr "" + +#: ../../library/sqlite3.rst:397 msgid "" -"Register an *adapter* callable to adapt the Python type *type* into an " -"SQLite type. The adapter is called with a Python object of type *type* as " -"its sole argument, and must return a value of a :ref:`type that SQLite " -"natively understands`." +"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 " +"column name, as the converter dictionary key. The type name must be wrapped " +"in square brackets (``[]``)." msgstr "" -#: ../../library/sqlite3.rst:355 +#: ../../library/sqlite3.rst:407 msgid "" -"Returns :const:`True` if the string *statement* contains one or more " -"complete SQL statements terminated by semicolons. It does not verify that " -"the SQL is syntactically correct, only that there are no unclosed string " -"literals and the statement is terminated by a semicolon." +"This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " +"(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:360 +#: ../../library/sqlite3.rst:412 msgid "" -"This can be used to build a shell for SQLite, as in the following example:" +"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 " +"types are declared when the database table is created. :mod:`!sqlite3` will " +"look up a converter function using the first word of the declared type as " +"the converter dictionary key. For example:" msgstr "" -#: ../../library/sqlite3.rst:368 +#: ../../library/sqlite3.rst:428 msgid "" -"Enable or disable callback tracebacks. By default you will not get any " -"tracebacks in user-defined functions, aggregates, converters, authorizer " -"callbacks etc. If you want to debug them, you can call this function with " -"*flag* set to ``True``. Afterwards, you will get tracebacks from callbacks " -"on ``sys.stderr``. Use :const:`False` to disable the feature again." +"This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " +"(bitwise or) operator." +msgstr "" + +#: ../../library/sqlite3.rst:435 +msgid "" +"Flags that should be returned by the *authorizer_callback* callable passed " +"to :meth:`Connection.set_authorizer`, to indicate whether:" +msgstr "" + +#: ../../library/sqlite3.rst:438 +msgid "Access is allowed (:const:`!SQLITE_OK`)," msgstr "" -#: ../../library/sqlite3.rst:379 -msgid "Connection Objects" +#: ../../library/sqlite3.rst:439 +msgid "" +"The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)" msgstr "" -#: ../../library/sqlite3.rst:383 +#: ../../library/sqlite3.rst:440 +msgid "" +"The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)" +msgstr "" + +#: ../../library/sqlite3.rst:444 +msgid "" +"String constant stating the supported DB-API level. Required by the DB-API. " +"Hard-coded to ``\"2.0\"``." +msgstr "" + +#: ../../library/sqlite3.rst:449 +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:455 +msgid "" +"The :mod:`!sqlite3` module supports both ``qmark`` and ``numeric`` DB-API " +"parameter styles, because that is what the underlying SQLite library " +"supports. However, the DB-API does not allow multiple values for the " +"``paramstyle`` attribute." +msgstr "" + +#: ../../library/sqlite3.rst:462 +msgid "" +"Version number of the runtime SQLite library as a :class:`string `." +msgstr "" + +#: ../../library/sqlite3.rst:466 +msgid "" +"Version number of the runtime SQLite library as a :class:`tuple` of :class:" +"`integers `." +msgstr "" + +#: ../../library/sqlite3.rst:471 +msgid "" +"Integer constant required by the DB-API, stating the level of thread safety " +"the :mod:`!sqlite3` module supports. Currently hard-coded to ``1``, meaning *" +"\"Threads may share the module, but not connections.\"* However, this may " +"not always be true. You can check the underlying SQLite library's compile-" +"time threaded mode using the following query::" +msgstr "" + +#: ../../library/sqlite3.rst:484 +msgid "" +"Note that the `SQLITE_THREADSAFE levels `_ do not match the DB-API 2.0 ``threadsafety`` levels." +msgstr "" + +#: ../../library/sqlite3.rst:490 +msgid "" +"Version number of this module as a :class:`string `. This is not the " +"version of the SQLite library." +msgstr "" + +#: ../../library/sqlite3.rst:495 +msgid "" +"Version number of this module as a :class:`tuple` of :class:`integers " +"`. This is not the version of the SQLite library." +msgstr "" + +#: ../../library/sqlite3.rst:502 +msgid "Connection objects" +msgstr "" + +#: ../../library/sqlite3.rst:506 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:390 +#: ../../library/sqlite3.rst:513 msgid ":ref:`sqlite3-connection-shortcuts`" msgstr "" -#: ../../library/sqlite3.rst:391 -msgid ":ref:`sqlite3-connection-context-manager`" -msgstr "" - -#: ../../library/sqlite3.rst:393 +#: ../../library/sqlite3.rst:516 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:397 +#: ../../library/sqlite3.rst:520 msgid "" "This attribute controls the :ref:`transaction handling ` performed by ``sqlite3``. If set to :const:`None`, " +"transactions>` performed by :mod:`!sqlite3`. If set to ``None``, " "transactions are never implicitly opened. If set to one of ``\"DEFERRED\"``, " "``\"IMMEDIATE\"``, or ``\"EXCLUSIVE\"``, corresponding to the underlying " "`SQLite transaction behaviour`_, implicit :ref:`transaction management " "` is performed." msgstr "" -#: ../../library/sqlite3.rst:405 +#: ../../library/sqlite3.rst:528 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:410 +#: ../../library/sqlite3.rst:533 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:413 +#: ../../library/sqlite3.rst:536 +msgid "" +"``True`` if a transaction is active (there are uncommitted changes), " +"``False`` otherwise." +msgstr "" + +#: ../../library/sqlite3.rst:543 +msgid "" +"A callable that accepts two arguments, a :class:`Cursor` object and the raw " +"row results as a :class:`tuple`, and returns a custom object representing an " +"SQLite row." +msgstr "" + +#: ../../library/sqlite3.rst:547 ../../library/sqlite3.rst:586 +#: ../../library/sqlite3.rst:695 ../../library/sqlite3.rst:733 +#: ../../library/sqlite3.rst:952 ../../library/sqlite3.rst:1098 +#: ../../library/sqlite3.rst:1119 ../../library/sqlite3.rst:1255 +msgid "Example:" +msgstr "範例:" + +#: ../../library/sqlite3.rst:569 msgid "" -":const:`True` if a transaction is active (there are uncommitted changes), :" -"const:`False` otherwise." +"If returning a tuple doesn't suffice and you want name-based access to " +"columns, you should consider setting :attr:`row_factory` to the highly " +"optimized :class:`sqlite3.Row` type. :class:`Row` provides both index-based " +"and case-insensitive name-based access to columns with almost no memory " +"overhead. It will probably be better than your own custom dictionary-based " +"approach or even a db_row based solution." +msgstr "" + +#: ../../library/sqlite3.rst:580 +msgid "" +"A callable that accepts a :class:`bytes` parameter and returns a text " +"representation of it. The callable is invoked for SQLite values with the " +"``TEXT`` data type. By default, this attribute is set to :class:`str`. If " +"you want to return ``bytes`` instead, set *text_factory* to ``bytes``." +msgstr "" + +#: ../../library/sqlite3.rst:620 +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:420 +#: ../../library/sqlite3.rst:626 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " "single optional parameter *factory*. If supplied, this must be a callable " "returning an instance of :class:`Cursor` or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:427 +#: ../../library/sqlite3.rst:633 msgid "" "Commit any pending transaction to the database. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:432 +#: ../../library/sqlite3.rst:638 msgid "" "Roll back to the start of any pending transaction. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:437 +#: ../../library/sqlite3.rst:643 msgid "" "Close the database connection. Any pending transaction is not committed " "implicitly; make sure to :meth:`commit` before closing to avoid losing " "pending changes." msgstr "" -#: ../../library/sqlite3.rst:444 +#: ../../library/sqlite3.rst:650 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:450 +#: ../../library/sqlite3.rst:656 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:456 +#: ../../library/sqlite3.rst:662 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:462 +#: ../../library/sqlite3.rst:668 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:464 +#: ../../library/sqlite3.rst:670 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:468 +#: ../../library/sqlite3.rst:673 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:473 +#: ../../library/sqlite3.rst:677 msgid "" "A callable that is called when the SQL function is invoked. The callable " "must return :ref:`a type natively supported by SQLite `. Set " -"to :const:`None` to remove an existing SQL function." +"to ``None`` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:480 +#: ../../library/sqlite3.rst:684 msgid "" -"If :const:`True`, the created SQL function is marked as `deterministic " -"`_, which allows SQLite to perform " -"additional optimizations." +"If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " +"optimizations." msgstr "" #: ../../library/sqlite3.rst:0 msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:486 +#: ../../library/sqlite3.rst:689 msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" -#: ../../library/sqlite3.rst:489 +#: ../../library/sqlite3.rst:692 msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:492 ../../library/sqlite3.rst:523 -#: ../../library/sqlite3.rst:658 ../../library/sqlite3.rst:680 -msgid "Example:" -msgstr "範例:" - -#: ../../library/sqlite3.rst:499 +#: ../../library/sqlite3.rst:711 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:501 +#: ../../library/sqlite3.rst:713 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:505 +#: ../../library/sqlite3.rst:716 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:510 +#: ../../library/sqlite3.rst:720 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " "as :ref:`a type natively supported by SQLite `. The number " "of arguments that the ``step()`` method must accept is controlled by " -"*n_arg*. Set to :const:`None` to remove an existing SQL aggregate function." +"*n_arg*. Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:511 +#: ../../library/sqlite3.rst:721 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:513 +#: ../../library/sqlite3.rst:723 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:514 +#: ../../library/sqlite3.rst:724 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:517 +#: ../../library/sqlite3.rst:727 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:520 -msgid "Set to :const:`None` to remove an existing SQL aggregate function." +#: ../../library/sqlite3.rst:730 +msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:530 +#: ../../library/sqlite3.rst:765 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:534 +#: ../../library/sqlite3.rst:769 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:535 +#: ../../library/sqlite3.rst:770 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:536 +#: ../../library/sqlite3.rst:771 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:538 +#: ../../library/sqlite3.rst:773 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:542 -msgid "Remove a collation function by setting *callable* to :const:`None`." +#: ../../library/sqlite3.rst:801 +msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" -#: ../../library/sqlite3.rst:547 +#: ../../library/sqlite3.rst:806 msgid "" "Call this method from a different thread to abort any queries that might be " "executing on the connection. Aborted queries will raise an exception." msgstr "" -#: ../../library/sqlite3.rst:554 +#: ../../library/sqlite3.rst:813 msgid "" "Register callable *authorizer_callback* to be invoked for each attempt to " -"access a column of a table in the database. The callback should return :" -"const:`SQLITE_OK` if access is allowed, :const:`SQLITE_DENY` if the entire " -"SQL statement should be aborted with an error and :const:`SQLITE_IGNORE` if " -"the column should be treated as a NULL value. These constants are available " -"in the :mod:`sqlite3` module." +"access a column of a table in the database. The callback should return one " +"of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE` to " +"signal how access to the column should be handled by the underlying SQLite " +"library." msgstr "" -#: ../../library/sqlite3.rst:561 +#: ../../library/sqlite3.rst:819 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 :const:`None` " +"authorized. The second and third argument will be arguments or ``None`` " "depending on the first argument. The 4th argument is the name of the " "database (\"main\", \"temp\", etc.) if applicable. The 5th argument is the " "name of the inner-most trigger or view that is responsible for the access " -"attempt or :const:`None` if this access attempt is directly from input SQL " -"code." +"attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: ../../library/sqlite3.rst:568 +#: ../../library/sqlite3.rst:826 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 " -"the first one. All necessary constants are available in the :mod:`sqlite3` " +"the first one. All necessary constants are available in the :mod:`!sqlite3` " "module." msgstr "" -#: ../../library/sqlite3.rst:575 +#: ../../library/sqlite3.rst:833 msgid "" "Register callable *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -639,192 +802,152 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:580 +#: ../../library/sqlite3.rst:838 msgid "" "If you want to clear any previously installed progress handler, call the " -"method with :const:`None` for *progress_handler*." +"method with ``None`` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:583 +#: ../../library/sqlite3.rst:841 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:590 +#: ../../library/sqlite3.rst:848 msgid "" "Register callable *trace_callback* to be invoked for each SQL statement that " "is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:593 +#: ../../library/sqlite3.rst:851 msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " "that the backend does not only run statements passed to the :meth:`Cursor." "execute` methods. Other sources include the :ref:`transaction management " -"` of the sqlite3 module and the execution " -"of triggers defined in the current database." +"` of the :mod:`!sqlite3` module and the " +"execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:601 -msgid "" -"Passing :const:`None` as *trace_callback* will disable the trace callback." +#: ../../library/sqlite3.rst:859 +msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:604 +#: ../../library/sqlite3.rst:862 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:614 +#: ../../library/sqlite3.rst:872 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " -"*enabled* is :const:`True`; else, disallow loading SQLite extensions. SQLite " +"*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " "extensions can define new functions, aggregates or whole new virtual table " "implementations. One well-known extension is the fulltext-search extension " "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:623 +#: ../../library/sqlite3.rst:881 msgid "" -"The ``sqlite3`` module is not built with loadable extension support by " +"The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " "are compiled without this feature. To get loadable extension support, you " "must pass the :option:`--enable-loadable-sqlite-extensions` option to :" "program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:630 +#: ../../library/sqlite3.rst:888 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:634 +#: ../../library/sqlite3.rst:892 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:641 +#: ../../library/sqlite3.rst:935 msgid "" "Load an SQLite extension from a shared library located at *path*. Enable " "extension loading with :meth:`enable_load_extension` before calling this " "method." msgstr "" -#: ../../library/sqlite3.rst:645 +#: ../../library/sqlite3.rst:939 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:649 +#: ../../library/sqlite3.rst:943 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:654 -msgid "" -"A callable that accepts two arguments, a :class:`Cursor` object and the raw " -"row results as a :class:`tuple`, and returns a custom object representing an " -"SQLite row." -msgstr "" - -#: ../../library/sqlite3.rst:662 -msgid "" -"If returning a tuple doesn't suffice and you want name-based access to " -"columns, you should consider setting :attr:`row_factory` to the highly " -"optimized :class:`sqlite3.Row` type. :class:`Row` provides both index-based " -"and case-insensitive name-based access to columns with almost no memory " -"overhead. It will probably be better than your own custom dictionary-based " -"approach or even a db_row based solution." -msgstr "" - -#: ../../library/sqlite3.rst:674 -msgid "" -"A callable that accepts a :class:`bytes` parameter and returns a text " -"representation of it. The callable is invoked for SQLite values with the " -"``TEXT`` data type. By default, this attribute is set to :class:`str`. If " -"you want to return ``bytes`` instead, set *text_factory* to ``bytes``." -msgstr "" - -#: ../../library/sqlite3.rst:687 -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:693 +#: ../../library/sqlite3.rst:948 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:697 ../../library/sqlite3.rst:828 -#: ../../library/sqlite3.rst:847 -msgid "Example::" -msgstr "" -"範例:\n" -"\n" -"::" - -#: ../../library/sqlite3.rst:711 +#: ../../library/sqlite3.rst:966 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:713 +#: ../../library/sqlite3.rst:968 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:716 +#: ../../library/sqlite3.rst:971 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:720 +#: ../../library/sqlite3.rst:974 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:727 +#: ../../library/sqlite3.rst:980 msgid "" "If set to a callable, it is invoked with three integer arguments for every " "backup iteration: the *status* of the last iteration, the *remaining* number " -"of pages still to be copied, and the *total* number of pages. Defaults to :" -"const:`None`." +"of pages still to be copied, and the *total* number of pages. Defaults to " +"``None``." msgstr "" -#: ../../library/sqlite3.rst:736 +#: ../../library/sqlite3.rst:989 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 statment." +"custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:744 +#: ../../library/sqlite3.rst:996 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:749 -msgid "Example 1, copy an existing database into another::" +#: ../../library/sqlite3.rst:1000 +msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:763 -msgid "Example 2, copy an existing database into a transient copy::" +#: ../../library/sqlite3.rst:1019 +msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:777 -msgid "Cursor Objects" +#: ../../library/sqlite3.rst:1033 +msgid "Cursor objects" msgstr "" -#: ../../library/sqlite3.rst:779 +#: ../../library/sqlite3.rst:1035 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 " @@ -832,25 +955,25 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:786 +#: ../../library/sqlite3.rst:1042 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::" +"to fetch the resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:797 +#: ../../library/sqlite3.rst:1067 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:804 +#: ../../library/sqlite3.rst:1074 msgid "" "Execute SQL statement *sql*. Bind values to the statement using :ref:" "`placeholders ` that map to the :term:`sequence` or :" "class:`dict` *parameters*." msgstr "" -#: ../../library/sqlite3.rst:809 +#: ../../library/sqlite3.rst:1079 msgid "" ":meth:`execute` will only execute a single SQL statement. If you try to " "execute more than one statement with it, it will raise a :exc:`Warning`. " @@ -858,15 +981,15 @@ msgid "" "with one call." msgstr "" -#: ../../library/sqlite3.rst:814 +#: ../../library/sqlite3.rst:1084 msgid "" -"If :attr:`~Connection.isolation_level` is not :const:`None`, *sql* is an " +"If :attr:`~Connection.isolation_level` is not ``None``, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " "no open transaction, a transaction is implicitly opened before executing " "*sql*." msgstr "" -#: ../../library/sqlite3.rst:822 +#: ../../library/sqlite3.rst:1092 msgid "" "Execute :ref:`parameterized ` SQL statement *sql* " "against all parameter sequences or mappings found in the sequence " @@ -875,31 +998,31 @@ msgid "" "handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:839 +#: ../../library/sqlite3.rst:1111 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " -"transaciton, an implicit ``COMMIT`` statement is executed first. No other " +"transaction, an implicit ``COMMIT`` statement is executed first. No other " "implicit transaction control is performed; any transaction control must be " "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:845 +#: ../../library/sqlite3.rst:1117 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:861 +#: ../../library/sqlite3.rst:1135 msgid "" -"Fetch the next row of a query result set as a :class:`tuple`. Return :const:" -"`None` if no more data is available." +"Return the next row of a query result set as a :class:`tuple`. Return " +"``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:867 +#: ../../library/sqlite3.rst:1141 msgid "" -"Fetch the next set of rows of a query result as a :class:`list`. Return an " +"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:870 +#: ../../library/sqlite3.rst:1144 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 " @@ -907,7 +1030,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:876 +#: ../../library/sqlite3.rst:1150 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -915,29 +1038,29 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:883 +#: ../../library/sqlite3.rst:1157 msgid "" -"Fetch all (remaining) rows of a query result as a :class:`list`. Return an " +"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:890 +#: ../../library/sqlite3.rst:1164 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:892 +#: ../../library/sqlite3.rst:1166 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:897 ../../library/sqlite3.rst:901 -msgid "Required by the DB-API. Does nothing in :mod:`sqlite3`." +#: ../../library/sqlite3.rst:1171 ../../library/sqlite3.rst:1175 +msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:905 +#: ../../library/sqlite3.rst:1179 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -946,128 +1069,119 @@ msgid "" "methods." msgstr "" -#: ../../library/sqlite3.rst:913 +#: ../../library/sqlite3.rst:1187 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 " "the :meth:`execute` method. For other statements, after :meth:`executemany` " "or :meth:`executescript`, or if the insertion failed, the value of " -"``lastrowid`` is left unchanged. The initial value of ``lastrowid`` is :" -"const:`None`." +"``lastrowid`` is left unchanged. The initial value of ``lastrowid`` is " +"``None``." msgstr "" -#: ../../library/sqlite3.rst:921 +#: ../../library/sqlite3.rst:1195 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:923 +#: ../../library/sqlite3.rst:1197 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:928 +#: ../../library/sqlite3.rst:1202 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:933 +#: ../../library/sqlite3.rst:1207 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 :const:`None`." +"column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:937 +#: ../../library/sqlite3.rst:1211 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:941 +#: ../../library/sqlite3.rst:1215 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" "`con.cursor() ` will have a :attr:`connection` attribute " -"that refers to *con*::" +"that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:954 -msgid "Row Objects" +#: ../../library/sqlite3.rst:1235 +msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:958 +#: ../../library/sqlite3.rst:1239 msgid "" -"A :class:`Row` instance serves as a highly optimized :attr:`~Connection." -"row_factory` for :class:`Connection` objects. It tries to mimic a :class:" -"`tuple` in most of its features, and supports iteration, :func:`repr`, " +"A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." +"row_factory` for :class:`Connection` objects. It supports iteration, " "equality testing, :func:`len`, and :term:`mapping` access by column name and " "index." msgstr "" -#: ../../library/sqlite3.rst:964 +#: ../../library/sqlite3.rst:1244 msgid "Two row objects compare equal if have equal columns and equal members." msgstr "" -#: ../../library/sqlite3.rst:968 +#: ../../library/sqlite3.rst:1248 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:972 +#: ../../library/sqlite3.rst:1252 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:975 -msgid "Let's assume we initialize a table as in the example given above::" +#: ../../library/sqlite3.rst:1272 +msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:987 -msgid "Now we plug :class:`Row` in::" -msgstr "" - -#: ../../library/sqlite3.rst:1017 -msgid "PrepareProtocol Objects" -msgstr "" - -#: ../../library/sqlite3.rst:1021 +#: ../../library/sqlite3.rst:1276 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:1029 +#: ../../library/sqlite3.rst:1284 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1031 +#: ../../library/sqlite3.rst:1286 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1290 msgid "" -"This exception is raised by ``sqlite3`` if an SQL query is not a :class:" +"This exception is raised by :mod:`!sqlite3` if an SQL query is not a :class:" "`string `, or if multiple statements are passed to :meth:`~Cursor." "execute` or :meth:`~Cursor.executemany`. ``Warning`` is a subclass of :exc:" "`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1042 +#: ../../library/sqlite3.rst:1297 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:1048 +#: ../../library/sqlite3.rst:1303 msgid "" -"This exception is raised by ``sqlite3`` for fetch across rollback, or if " -"``sqlite3`` is unable to bind parameters. ``InterfaceError`` is a subclass " -"of :exc:`Error`." +"This exception is raised by :mod:`!sqlite3` for fetch across rollback, or " +"if :mod:`!sqlite3` is unable to bind parameters. ``InterfaceError`` is a " +"subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1054 +#: ../../library/sqlite3.rst:1309 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 " @@ -1075,14 +1189,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1061 +#: ../../library/sqlite3.rst:1316 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:1067 +#: ../../library/sqlite3.rst:1322 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 " @@ -1090,127 +1204,203 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1075 +#: ../../library/sqlite3.rst:1330 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:1080 +#: ../../library/sqlite3.rst:1335 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:1087 +#: ../../library/sqlite3.rst:1342 msgid "" -"Exception raised for ``sqlite3`` API programming errors, for example trying " -"to operate on a closed :class:`Connection`, or trying to execute non-DML " -"statements with :meth:`~Cursor.executemany`. ``ProgrammingError`` is a " +"Exception raised for :mod:`!sqlite3` API programming errors, for example " +"trying to operate on a closed :class:`Connection`, or trying to execute non-" +"DML statements with :meth:`~Cursor.executemany`. ``ProgrammingError`` is a " "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1094 +#: ../../library/sqlite3.rst:1349 msgid "" "Exception raised in case a method or database API is not supported by the " -"underlying SQLite library. For example, setting *deterministic* to :const:" -"`True` in :meth:`~Connection.create_function`, if the underlying SQLite " -"library does not support deterministic functions. ``NotSupportedError`` is a " +"underlying SQLite library. For example, setting *deterministic* to ``True`` " +"in :meth:`~Connection.create_function`, if the underlying SQLite library " +"does not support deterministic functions. ``NotSupportedError`` is a " "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1104 +#: ../../library/sqlite3.rst:1359 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1110 +#: ../../library/sqlite3.rst:1361 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1113 +#: ../../library/sqlite3.rst:1364 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1116 ../../library/sqlite3.rst:1133 +#: ../../library/sqlite3.rst:1367 ../../library/sqlite3.rst:1384 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1116 ../../library/sqlite3.rst:1133 +#: ../../library/sqlite3.rst:1367 ../../library/sqlite3.rst:1384 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1118 ../../library/sqlite3.rst:1135 -msgid ":const:`None`" -msgstr ":const:`None`" +#: ../../library/sqlite3.rst:1369 ../../library/sqlite3.rst:1386 +msgid "``None``" +msgstr "" -#: ../../library/sqlite3.rst:1118 ../../library/sqlite3.rst:1135 +#: ../../library/sqlite3.rst:1369 ../../library/sqlite3.rst:1386 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1120 ../../library/sqlite3.rst:1137 +#: ../../library/sqlite3.rst:1371 ../../library/sqlite3.rst:1388 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1120 ../../library/sqlite3.rst:1137 +#: ../../library/sqlite3.rst:1371 ../../library/sqlite3.rst:1388 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1122 ../../library/sqlite3.rst:1139 +#: ../../library/sqlite3.rst:1373 ../../library/sqlite3.rst:1390 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1122 ../../library/sqlite3.rst:1139 +#: ../../library/sqlite3.rst:1373 ../../library/sqlite3.rst:1390 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1124 +#: ../../library/sqlite3.rst:1375 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1124 ../../library/sqlite3.rst:1141 +#: ../../library/sqlite3.rst:1375 ../../library/sqlite3.rst:1392 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1126 ../../library/sqlite3.rst:1144 +#: ../../library/sqlite3.rst:1377 ../../library/sqlite3.rst:1395 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1126 ../../library/sqlite3.rst:1144 +#: ../../library/sqlite3.rst:1377 ../../library/sqlite3.rst:1395 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1130 +#: ../../library/sqlite3.rst:1381 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1141 +#: ../../library/sqlite3.rst:1392 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1147 +#: ../../library/sqlite3.rst:1398 +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 " +"adapters `, and you can let the :mod:`!sqlite3` module " +"convert SQLite types to Python types via :ref:`converters `." +msgstr "" + +#: ../../library/sqlite3.rst:1408 +msgid "Default adapters and converters" +msgstr "" + +#: ../../library/sqlite3.rst:1410 +msgid "" +"There are default adapters for the date and datetime types in the datetime " +"module. They will be sent as ISO dates/ISO timestamps to SQLite." +msgstr "" + +#: ../../library/sqlite3.rst:1413 +msgid "" +"The default converters are registered under the name \"date\" for :class:" +"`datetime.date` and under the name \"timestamp\" for :class:`datetime." +"datetime`." +msgstr "" + +#: ../../library/sqlite3.rst:1417 +msgid "" +"This way, you can use date/timestamps from Python without any additional " +"fiddling in most cases. The format of the adapters is also compatible with " +"the experimental SQLite date/time functions." +msgstr "" + +#: ../../library/sqlite3.rst:1421 +msgid "The following example demonstrates this." +msgstr "" + +#: ../../library/sqlite3.rst:1425 +msgid "" +"If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " +"its value will be truncated to microsecond precision by the timestamp " +"converter." +msgstr "" + +#: ../../library/sqlite3.rst:1431 +msgid "" +"The default \"timestamp\" converter ignores UTC offsets in the database and " +"always returns a naive :class:`datetime.datetime` object. To preserve UTC " +"offsets in timestamps, either leave converters disabled, or register an " +"offset-aware converter with :func:`register_converter`." +msgstr "" + +#: ../../library/sqlite3.rst:1440 +msgid "How-to guides" +msgstr "" + +#: ../../library/sqlite3.rst:1445 +msgid "How to use placeholders to bind values in SQL queries" +msgstr "" + +#: ../../library/sqlite3.rst:1447 +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 " +"vulnerable to `SQL injection attacks`_ (see the `xkcd webcomic `_ for a humorous example of what can go wrong)::" +msgstr "" + +#: ../../library/sqlite3.rst:1456 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 object " -"adaptation, and you can let the :mod:`sqlite3` module convert SQLite types " -"to different Python types via converters." +"Instead, use the DB-API's parameter substitution. To insert a variable into " +"a query string, use a placeholder in the string, and substitute the actual " +"values into the query by providing them as a :class:`tuple` of values to the " +"second argument of the cursor's :meth:`~Cursor.execute` method. An SQL " +"statement may use one of two kinds of placeholders: question marks (qmark " +"style) or named placeholders (named style). For the qmark style, " +"``parameters`` must be a :term:`sequence `. For the named style, " +"it can be either a :term:`sequence ` or :class:`dict` instance. " +"The length of the :term:`sequence ` must match the number of " +"placeholders, or a :exc:`ProgrammingError` is raised. If a :class:`dict` is " +"given, it must contain keys for all named parameters. Any extra items are " +"ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1154 -msgid "Using adapters to store custom Python types in SQLite databases" +#: ../../library/sqlite3.rst:1498 +msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1156 +#: ../../library/sqlite3.rst:1500 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`." +"types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1160 +#: ../../library/sqlite3.rst:1504 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 " @@ -1220,271 +1410,224 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1172 -msgid "Letting your object adapt itself" +#: ../../library/sqlite3.rst:1516 +msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1174 +#: ../../library/sqlite3.rst:1518 msgid "" -"Suppose we have a ``Point`` class that represents a pair of coordinates, " -"``x`` and ``y``, in a Cartesian coordinate system. The coordinate pair will " -"be stored as a text string in the database, using a semicolon to separate " -"the coordinates. This can be implemented by adding a ``__conform__(self, " -"protocol)`` method which returns the adapted value. The object passed to " -"*protocol* will be of type :class:`PrepareProtocol`." +"Suppose we have a :class:`!Point` class that represents a pair of " +"coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " +"coordinate pair will be stored as a text string in the database, using a " +"semicolon to separate the coordinates. This can be implemented by adding a " +"``__conform__(self, protocol)`` method which returns the adapted value. The " +"object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1186 -msgid "Registering an adapter callable" +#: ../../library/sqlite3.rst:1549 +msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1188 +#: ../../library/sqlite3.rst:1551 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:1196 -msgid "Converting SQLite values to custom Python types" +#: ../../library/sqlite3.rst:1581 +msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1198 +#: ../../library/sqlite3.rst:1583 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:1203 +#: ../../library/sqlite3.rst:1588 msgid "" -"Let's go back to the :class:`Point` class. We stored the x and y coordinates " -"separated via semicolons as strings in SQLite." +"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:1206 +#: ../../library/sqlite3.rst:1591 msgid "" "First, we'll define a converter function that accepts the string as a " -"parameter and constructs a :class:`Point` object from it." +"parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1211 +#: ../../library/sqlite3.rst:1596 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1220 +#: ../../library/sqlite3.rst:1605 msgid "" -"We now need to tell ``sqlite3`` when it should convert a given SQLite value. " -"This is done when connecting to a database, using the *detect_types* " +"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:1224 +#: ../../library/sqlite3.rst:1609 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1225 +#: ../../library/sqlite3.rst:1610 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1226 +#: ../../library/sqlite3.rst:1611 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1230 +#: ../../library/sqlite3.rst:1615 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:1236 -msgid "Default adapters and converters" -msgstr "" - -#: ../../library/sqlite3.rst:1238 -msgid "" -"There are default adapters for the date and datetime types in the datetime " -"module. They will be sent as ISO dates/ISO timestamps to SQLite." -msgstr "" - -#: ../../library/sqlite3.rst:1241 -msgid "" -"The default converters are registered under the name \"date\" for :class:" -"`datetime.date` and under the name \"timestamp\" for :class:`datetime." -"datetime`." -msgstr "" - -#: ../../library/sqlite3.rst:1245 -msgid "" -"This way, you can use date/timestamps from Python without any additional " -"fiddling in most cases. The format of the adapters is also compatible with " -"the experimental SQLite date/time functions." +#: ../../library/sqlite3.rst:1666 +msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:1249 -msgid "The following example demonstrates this." -msgstr "" - -#: ../../library/sqlite3.rst:1253 -msgid "" -"If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " -"its value will be truncated to microsecond precision by the timestamp " -"converter." -msgstr "" - -#: ../../library/sqlite3.rst:1259 -msgid "" -"The default \"timestamp\" converter ignores UTC offsets in the database and " -"always returns a naive :class:`datetime.datetime` object. To preserve UTC " -"offsets in timestamps, either leave converters disabled, or register an " -"offset-aware converter with :func:`register_converter`." -msgstr "" - -#: ../../library/sqlite3.rst:1268 -msgid "Adapter and Converter Recipes" -msgstr "" - -#: ../../library/sqlite3.rst:1270 +#: ../../library/sqlite3.rst:1668 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:1313 -msgid "Controlling Transactions" +#: ../../library/sqlite3.rst:1711 +msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:1315 +#: ../../library/sqlite3.rst:1713 msgid "" -"The ``sqlite3`` module does not adhere to the transaction handling " -"recommended by :pep:`249`." +"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" +"meth:`~Connection.executescript` methods of the :class:`Connection` class, " +"your code can be written more concisely because you don't have to create the " +"(often superfluous) :class:`Cursor` objects explicitly. Instead, the :class:" +"`Cursor` objects are created implicitly and these shortcut methods return " +"the cursor objects. This way, you can execute a ``SELECT`` statement and " +"iterate over it directly using only a single call on the :class:`Connection` " +"object." msgstr "" -#: ../../library/sqlite3.rst:1318 -msgid "" -"If the connection attribute :attr:`~Connection.isolation_level` is not :" -"const:`None`, new transactions are implicitly opened before :meth:`~Cursor." -"execute` and :meth:`~Cursor.executemany` executes ``INSERT``, ``UPDATE``, " -"``DELETE``, or ``REPLACE`` statements. Use the :meth:`~Connection.commit` " -"and :meth:`~Connection.rollback` methods to respectively commit and roll " -"back pending transactions. You can choose the underlying `SQLite transaction " -"behaviour`_ — that is, whether and what type of ``BEGIN`` statements " -"``sqlite3`` implicitly executes – via the :attr:`~Connection." -"isolation_level` attribute." +#: ../../library/sqlite3.rst:1754 +msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:1330 +#: ../../library/sqlite3.rst:1756 msgid "" -"If :attr:`~Connection.isolation_level` is set to :const:`None`, no " -"transactions are implicitly opened at all. This leaves the underlying SQLite " -"library in `autocommit mode`_, but also allows the user to perform their own " -"transaction handling using explicit SQL statements. The underlying SQLite " -"library autocommit mode can be queried using the :attr:`~Connection." -"in_transaction` attribute." +"A :class:`Connection` object can be used as a context manager that " +"automatically commits or rolls back open transactions when leaving the body " +"of the context manager. If the body of the :keyword:`with` statement " +"finishes without exceptions, the transaction is committed. If this commit " +"fails, or if the body of the ``with`` statement raises an uncaught " +"exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:1338 +#: ../../library/sqlite3.rst:1765 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`." +"If there is no open transaction upon leaving the body of the ``with`` " +"statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:1342 +#: ../../library/sqlite3.rst:1770 msgid "" -":mod:`sqlite3` used to implicitly commit an open transaction before DDL " -"statements. This is no longer the case." +"The context manager neither implicitly opens a new transaction nor closes " +"the connection." msgstr "" -#: ../../library/sqlite3.rst:1356 -msgid "SQLite URI tricks" +#: ../../library/sqlite3.rst:1803 +msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:1358 +#: ../../library/sqlite3.rst:1805 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:1360 -msgid "Open a database in read-only mode::" +#: ../../library/sqlite3.rst:1807 +msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:1364 +#: ../../library/sqlite3.rst:1816 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::" +"will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:1369 -msgid "Create a shared named in-memory database::" +#: ../../library/sqlite3.rst:1826 +msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1840 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:1384 -msgid "Using :mod:`sqlite3` efficiently" -msgstr "" +#: ../../library/sqlite3.rst:1849 +msgid "Explanation" +msgstr "解釋" -#: ../../library/sqlite3.rst:1390 -msgid "Using connection shortcut methods" +#: ../../library/sqlite3.rst:1854 +msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:1392 +#: ../../library/sqlite3.rst:1856 msgid "" -"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" -"meth:`~Connection.executescript` methods of the :class:`Connection` class, " -"your code can be written more concisely because you don't have to create the " -"(often superfluous) :class:`Cursor` objects explicitly. Instead, the :class:" -"`Cursor` objects are created implicitly and these shortcut methods return " -"the cursor objects. This way, you can execute a ``SELECT`` statement and " -"iterate over it directly using only a single call on the :class:`Connection` " -"object." -msgstr "" - -#: ../../library/sqlite3.rst:1405 -msgid "Accessing columns by name instead of by index" +"The :mod:`!sqlite3` module does not adhere to the transaction handling " +"recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:1407 +#: ../../library/sqlite3.rst:1859 msgid "" -"One useful feature of the :mod:`sqlite3` module is the built-in :class:" -"`sqlite3.Row` class designed to be used as a row factory." +"If the connection attribute :attr:`~Connection.isolation_level` is not " +"``None``, new transactions are implicitly opened before :meth:`~Cursor." +"execute` and :meth:`~Cursor.executemany` executes ``INSERT``, ``UPDATE``, " +"``DELETE``, or ``REPLACE`` statements. Use the :meth:`~Connection.commit` " +"and :meth:`~Connection.rollback` methods to respectively commit and roll " +"back pending transactions. You can choose the underlying `SQLite transaction " +"behaviour`_ — that is, whether and what type of ``BEGIN`` statements :mod:`!" +"sqlite3` implicitly executes – via the :attr:`~Connection.isolation_level` " +"attribute." msgstr "" -#: ../../library/sqlite3.rst:1410 +#: ../../library/sqlite3.rst:1871 msgid "" -"Rows wrapped with this class can be accessed both by index (like tuples) and " -"case-insensitively by name:" -msgstr "" - -#: ../../library/sqlite3.rst:1419 -msgid "Using the connection as a context manager" +"If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " +"are implicitly opened at all. This leaves the underlying SQLite library in " +"`autocommit mode`_, but also allows the user to perform their own " +"transaction handling using explicit SQL statements. The underlying SQLite " +"library autocommit mode can be queried using the :attr:`~Connection." +"in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:1421 +#: ../../library/sqlite3.rst:1879 msgid "" -"A :class:`Connection` object can be used as a context manager that " -"automatically commits or rolls back open transactions when leaving the body " -"of the context manager. If the body of the :keyword:`with` statement " -"finishes without exceptions, the transaction is committed. If this commit " -"fails, or if the body of the ``with`` statement raises an uncaught " -"exception, the transaction is rolled back." +"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:1430 +#: ../../library/sqlite3.rst:1883 msgid "" -"If there is no open transaction upon leaving the body of the ``with`` " -"statement, the context manager is a no-op." +":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " +"statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1435 -msgid "" -"The context manager neither implicitly opens a new transaction nor closes " -"the connection." -msgstr "" +#~ msgid "Example::" +#~ msgstr "" +#~ "範例:\n" +#~ "\n" +#~ "::" + +#~ msgid "Introduction" +#~ msgstr "簡介" + +#~ msgid ":const:`None`" +#~ msgstr ":const:`None`" #~ msgid "Footnotes" #~ msgstr "註解" diff --git a/library/statistics.po b/library/statistics.po index 6f232b2bf8..327cbd9857 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-11 00:15+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-07-27 16:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1009,7 +1009,7 @@ msgstr "" #: ../../library/statistics.rst:913 msgid "" "Normal distributions can be used to approximate `Binomial distributions " -"`_ when the sample " +"`_ when the sample " "size is large and when the probability of a successful trial is near 50%." msgstr "" diff --git a/library/stdtypes.po b/library/stdtypes.po index b174353f00..702d391dc8 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-08-31 00:21+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -80,8 +80,8 @@ msgid "" "built-in objects considered false:" msgstr "" "預設情況下,一個物件會被視為真值,除非它的 class 定義了會回傳 ``False`` 的 :" -"meth:`__bool__` method 或是定義了會回傳零的 :meth:`__len__` method。[1]_ " -"以下列出了大部分會被視為 false 的內建物件:" +"meth:`__bool__` method 或是定義了會回傳零的 :meth:`__len__` method。[1]_ 以下" +"列出了大部分會被視為 false 的內建物件:" #: ../../library/stdtypes.rst:55 msgid "constants defined to be false: ``None`` and ``False``." @@ -136,7 +136,7 @@ msgstr "結果" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 #: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:883 #: ../../library/stdtypes.rst:1088 ../../library/stdtypes.rst:2325 -#: ../../library/stdtypes.rst:3536 +#: ../../library/stdtypes.rst:3537 msgid "Notes" msgstr "註解" @@ -151,7 +151,7 @@ msgstr "" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 #: ../../library/stdtypes.rst:885 ../../library/stdtypes.rst:888 #: ../../library/stdtypes.rst:1099 ../../library/stdtypes.rst:2331 -#: ../../library/stdtypes.rst:3542 +#: ../../library/stdtypes.rst:3543 msgid "\\(1)" msgstr "\\(1)" @@ -166,7 +166,7 @@ msgstr "" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:288 #: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1127 #: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:2337 -#: ../../library/stdtypes.rst:3546 ../../library/stdtypes.rst:3548 +#: ../../library/stdtypes.rst:3547 ../../library/stdtypes.rst:3549 msgid "\\(2)" msgstr "\\(2)" @@ -181,16 +181,16 @@ msgstr "" #: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:897 #: ../../library/stdtypes.rst:1130 ../../library/stdtypes.rst:2339 #: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:2343 -#: ../../library/stdtypes.rst:2345 ../../library/stdtypes.rst:3550 -#: ../../library/stdtypes.rst:3552 ../../library/stdtypes.rst:3554 -#: ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:2345 ../../library/stdtypes.rst:3551 +#: ../../library/stdtypes.rst:3553 ../../library/stdtypes.rst:3555 +#: ../../library/stdtypes.rst:3557 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:102 ../../library/stdtypes.rst:319 #: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:934 #: ../../library/stdtypes.rst:1138 ../../library/stdtypes.rst:2371 -#: ../../library/stdtypes.rst:3586 +#: ../../library/stdtypes.rst:3587 msgid "Notes:" msgstr "註解:" @@ -230,8 +230,8 @@ msgid "This table summarizes the comparison operations:" msgstr "" #: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2302 -#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3513 -#: ../../library/stdtypes.rst:3536 +#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3514 +#: ../../library/stdtypes.rst:3537 msgid "Meaning" msgstr "" @@ -514,7 +514,7 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1120 -#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3574 msgid "\\(6)" msgstr "\\(6)" @@ -553,8 +553,8 @@ msgstr "" #: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:312 #: ../../library/stdtypes.rst:1109 ../../library/stdtypes.rst:1112 #: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:2361 -#: ../../library/stdtypes.rst:2364 ../../library/stdtypes.rst:3569 -#: ../../library/stdtypes.rst:3576 +#: ../../library/stdtypes.rst:2364 ../../library/stdtypes.rst:3570 +#: ../../library/stdtypes.rst:3577 msgid "\\(5)" msgstr "\\(5)" @@ -691,7 +691,7 @@ msgstr "" #: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:419 #: ../../library/stdtypes.rst:422 ../../library/stdtypes.rst:1133 #: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:2351 -#: ../../library/stdtypes.rst:3558 ../../library/stdtypes.rst:3562 +#: ../../library/stdtypes.rst:3559 ../../library/stdtypes.rst:3563 msgid "\\(4)" msgstr "\\(4)" @@ -1241,7 +1241,7 @@ msgid "" "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:910 ../../library/stdtypes.rst:3544 +#: ../../library/stdtypes.rst:910 ../../library/stdtypes.rst:3545 msgid "\\(8)" msgstr "\\(8)" @@ -1887,7 +1887,7 @@ msgstr "" #: ../../library/stdtypes.rst:1418 msgid "" -"The `linspace recipe `_ shows " +"The `linspace recipe `_ shows " "how to implement a lazy version of range suitable for floating point " "applications." msgstr "" @@ -2106,7 +2106,7 @@ msgstr "" msgid "Support for keyword arguments added." msgstr "" -#: ../../library/stdtypes.rst:1602 ../../library/stdtypes.rst:2732 +#: ../../library/stdtypes.rst:1602 ../../library/stdtypes.rst:2733 msgid "" "The *errors* is now checked in development mode and in :ref:`debug mode " "`." @@ -2477,14 +2477,14 @@ msgstr "" #: ../../library/stdtypes.rst:2005 ../../library/stdtypes.rst:2021 #: ../../library/stdtypes.rst:2073 ../../library/stdtypes.rst:2141 -#: ../../library/stdtypes.rst:2208 ../../library/stdtypes.rst:3048 -#: ../../library/stdtypes.rst:3064 ../../library/stdtypes.rst:3155 -#: ../../library/stdtypes.rst:3171 ../../library/stdtypes.rst:3196 -#: ../../library/stdtypes.rst:3210 ../../library/stdtypes.rst:3238 -#: ../../library/stdtypes.rst:3252 ../../library/stdtypes.rst:3270 -#: ../../library/stdtypes.rst:3297 ../../library/stdtypes.rst:3320 -#: ../../library/stdtypes.rst:3347 ../../library/stdtypes.rst:3389 -#: ../../library/stdtypes.rst:3413 +#: ../../library/stdtypes.rst:2208 ../../library/stdtypes.rst:3049 +#: ../../library/stdtypes.rst:3065 ../../library/stdtypes.rst:3156 +#: ../../library/stdtypes.rst:3172 ../../library/stdtypes.rst:3197 +#: ../../library/stdtypes.rst:3211 ../../library/stdtypes.rst:3239 +#: ../../library/stdtypes.rst:3253 ../../library/stdtypes.rst:3271 +#: ../../library/stdtypes.rst:3298 ../../library/stdtypes.rst:3321 +#: ../../library/stdtypes.rst:3348 ../../library/stdtypes.rst:3390 +#: ../../library/stdtypes.rst:3414 msgid "For example::" msgstr "" "舉例來說:\n" @@ -2663,7 +2663,7 @@ msgid "" "uppercase character and the remaining characters are lowercase." msgstr "" -#: ../../library/stdtypes.rst:2146 ../../library/stdtypes.rst:3357 +#: ../../library/stdtypes.rst:2146 ../../library/stdtypes.rst:3358 msgid "" "The algorithm uses a simple language-independent definition of a word as " "groups of consecutive letters. The definition works in many contexts but it " @@ -2763,36 +2763,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2257 ../../library/stdtypes.rst:3468 +#: ../../library/stdtypes.rst:2257 ../../library/stdtypes.rst:3469 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2260 ../../library/stdtypes.rst:3471 +#: ../../library/stdtypes.rst:2260 ../../library/stdtypes.rst:3472 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2262 ../../library/stdtypes.rst:3473 +#: ../../library/stdtypes.rst:2262 ../../library/stdtypes.rst:3474 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2265 ../../library/stdtypes.rst:3476 +#: ../../library/stdtypes.rst:2265 ../../library/stdtypes.rst:3477 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2268 ../../library/stdtypes.rst:3479 +#: ../../library/stdtypes.rst:2268 ../../library/stdtypes.rst:3480 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is read from the next element of the tuple in *values*, and the " "object to convert comes after the minimum field width and optional precision." msgstr "" -#: ../../library/stdtypes.rst:2272 ../../library/stdtypes.rst:3483 +#: ../../library/stdtypes.rst:2272 ../../library/stdtypes.rst:3484 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -2800,11 +2800,11 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2277 ../../library/stdtypes.rst:3488 +#: ../../library/stdtypes.rst:2277 ../../library/stdtypes.rst:3489 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2279 ../../library/stdtypes.rst:3490 +#: ../../library/stdtypes.rst:2279 ../../library/stdtypes.rst:3491 msgid "Conversion type." msgstr "" @@ -2816,176 +2816,176 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2290 ../../library/stdtypes.rst:3501 +#: ../../library/stdtypes.rst:2290 ../../library/stdtypes.rst:3502 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2293 ../../library/stdtypes.rst:3504 +#: ../../library/stdtypes.rst:2293 ../../library/stdtypes.rst:3505 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2302 ../../library/stdtypes.rst:3513 +#: ../../library/stdtypes.rst:2302 ../../library/stdtypes.rst:3514 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3515 +#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3516 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3515 +#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3516 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3518 +#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3519 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3518 +#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3519 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3520 +#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3521 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3520 +#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3521 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3523 +#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3524 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3523 +#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3524 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3526 +#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3527 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3526 +#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3527 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2319 ../../library/stdtypes.rst:3530 +#: ../../library/stdtypes.rst:2319 ../../library/stdtypes.rst:3531 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" -#: ../../library/stdtypes.rst:2322 ../../library/stdtypes.rst:3533 +#: ../../library/stdtypes.rst:2322 ../../library/stdtypes.rst:3534 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3536 +#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3537 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:3538 +#: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:3539 msgid "``'d'``" msgstr "``'d'``" #: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:2329 -#: ../../library/stdtypes.rst:3538 ../../library/stdtypes.rst:3540 +#: ../../library/stdtypes.rst:3539 ../../library/stdtypes.rst:3541 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2329 ../../library/stdtypes.rst:3540 +#: ../../library/stdtypes.rst:2329 ../../library/stdtypes.rst:3541 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2331 ../../library/stdtypes.rst:3542 +#: ../../library/stdtypes.rst:2331 ../../library/stdtypes.rst:3543 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2331 ../../library/stdtypes.rst:3542 +#: ../../library/stdtypes.rst:2331 ../../library/stdtypes.rst:3543 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3544 +#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3545 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3544 +#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3545 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:3547 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:3547 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3548 +#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3549 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3548 +#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3549 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3550 +#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3551 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3550 +#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3551 msgid "Floating point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3552 +#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3553 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3552 +#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3553 msgid "Floating point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:3554 +#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:3555 msgid "``'f'``" msgstr "``'f'``" #: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:2345 -#: ../../library/stdtypes.rst:3554 ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:3555 ../../library/stdtypes.rst:3557 msgid "Floating point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2345 ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:2345 ../../library/stdtypes.rst:3557 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3558 +#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3559 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3558 +#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3559 msgid "" "Floating point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3562 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3563 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3562 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3563 msgid "" "Floating point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3566 +#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3567 msgid "``'c'``" msgstr "``'c'``" @@ -2993,7 +2993,7 @@ msgstr "``'c'``" msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:3580 msgid "``'r'``" msgstr "``'r'``" @@ -3001,7 +3001,7 @@ msgstr "``'r'``" msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2361 ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:2361 ../../library/stdtypes.rst:3574 msgid "``'s'``" msgstr "``'s'``" @@ -3009,7 +3009,7 @@ msgstr "``'s'``" msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2364 ../../library/stdtypes.rst:3576 +#: ../../library/stdtypes.rst:2364 ../../library/stdtypes.rst:3577 msgid "``'a'``" msgstr "``'a'``" @@ -3017,56 +3017,56 @@ msgstr "``'a'``" msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3582 +#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3583 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3582 +#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3583 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:3590 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3593 +#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3594 msgid "" "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on " "whether the ``'x'`` or ``'X'`` format was used) to be inserted before the " "first digit." msgstr "" -#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3598 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3600 +#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3601 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3604 +#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3605 msgid "" "The alternate form causes the result to always contain a decimal point, and " "trailing zeroes are not removed as they would otherwise be." msgstr "" -#: ../../library/stdtypes.rst:2392 ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:2392 ../../library/stdtypes.rst:3608 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2396 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:2396 ../../library/stdtypes.rst:3612 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3620 +#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3621 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`\\ 。" @@ -3209,7 +3209,7 @@ msgid "" "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2503 ../../library/stdtypes.rst:2587 +#: ../../library/stdtypes.rst:2503 ../../library/stdtypes.rst:2588 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." @@ -3218,19 +3218,19 @@ msgstr "" #: ../../library/stdtypes.rst:2509 msgid "" "If you want to make the hex string easier to read, you can specify a single " -"character separator *sep* parameter to include in the output. By default " -"between each byte. A second optional *bytes_per_sep* parameter controls the " -"spacing. Positive values calculate the separator position from the right, " -"negative values from the left." +"character separator *sep* parameter to include in the output. By default, " +"this separator will be included between each byte. A second optional " +"*bytes_per_sep* parameter controls the spacing. Positive values calculate " +"the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:2526 msgid "" ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters " "to insert separators between bytes in the hex output." msgstr "" -#: ../../library/stdtypes.rst:2529 +#: ../../library/stdtypes.rst:2530 msgid "" "Since bytes objects are sequences of integers (akin to a tuple), for a bytes " "object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " @@ -3238,58 +3238,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2534 +#: ../../library/stdtypes.rst:2535 msgid "" "The representation of bytes objects uses the literal format (``b'...'``) " "since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " "always convert a bytes object into a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2542 +#: ../../library/stdtypes.rst:2543 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2546 +#: ../../library/stdtypes.rst:2547 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2551 +#: ../../library/stdtypes.rst:2552 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2554 +#: ../../library/stdtypes.rst:2555 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2555 +#: ../../library/stdtypes.rst:2556 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2556 +#: ../../library/stdtypes.rst:2557 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2557 +#: ../../library/stdtypes.rst:2558 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2559 +#: ../../library/stdtypes.rst:2560 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " "operations described in :ref:`bytes-methods`." msgstr "" -#: ../../library/stdtypes.rst:2563 +#: ../../library/stdtypes.rst:2564 msgid "Also see the :ref:`bytearray ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2565 +#: ../../library/stdtypes.rst:2566 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3297,33 +3297,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2571 +#: ../../library/stdtypes.rst:2572 msgid "" "This :class:`bytearray` class method returns bytearray object, decoding the " "given string object. The string must contain two hexadecimal digits per " "byte, with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:2578 +#: ../../library/stdtypes.rst:2579 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2582 +#: ../../library/stdtypes.rst:2583 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2595 +#: ../../library/stdtypes.rst:2596 msgid "" "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2601 msgid "" "Since bytearray objects are sequences of integers (akin to a list), for a " "bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be " @@ -3331,7 +3331,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2605 +#: ../../library/stdtypes.rst:2606 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -3339,11 +3339,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2614 +#: ../../library/stdtypes.rst:2615 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2619 +#: ../../library/stdtypes.rst:2620 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -3352,97 +3352,97 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2627 +#: ../../library/stdtypes.rst:2628 msgid "" "The methods on bytes and bytearray objects don't accept strings as their " "arguments, just as the methods on strings don't accept bytes as their " "arguments. For example, you have to write::" msgstr "" -#: ../../library/stdtypes.rst:2634 +#: ../../library/stdtypes.rst:2635 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/stdtypes.rst:2639 +#: ../../library/stdtypes.rst:2640 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " "binary data. These restrictions are covered below." msgstr "" -#: ../../library/stdtypes.rst:2644 +#: ../../library/stdtypes.rst:2645 msgid "" "Using these ASCII based operations to manipulate binary data that is not " "stored in an ASCII based format may lead to data corruption." msgstr "" -#: ../../library/stdtypes.rst:2647 +#: ../../library/stdtypes.rst:2648 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2653 +#: ../../library/stdtypes.rst:2654 msgid "" "Return the number of non-overlapping occurrences of subsequence *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:2657 ../../library/stdtypes.rst:2756 -#: ../../library/stdtypes.rst:2778 ../../library/stdtypes.rst:2844 -#: ../../library/stdtypes.rst:2857 +#: ../../library/stdtypes.rst:2658 ../../library/stdtypes.rst:2757 +#: ../../library/stdtypes.rst:2779 ../../library/stdtypes.rst:2845 +#: ../../library/stdtypes.rst:2858 msgid "" "The subsequence to search for may be any :term:`bytes-like object` or an " "integer in the range 0 to 255." msgstr "" -#: ../../library/stdtypes.rst:2660 ../../library/stdtypes.rst:2768 -#: ../../library/stdtypes.rst:2781 ../../library/stdtypes.rst:2847 -#: ../../library/stdtypes.rst:2860 +#: ../../library/stdtypes.rst:2661 ../../library/stdtypes.rst:2769 +#: ../../library/stdtypes.rst:2782 ../../library/stdtypes.rst:2848 +#: ../../library/stdtypes.rst:2861 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2667 +#: ../../library/stdtypes.rst:2668 msgid "" "If the binary data starts with the *prefix* string, return " "``bytes[len(prefix):]``. Otherwise, return a copy of the original binary " "data::" msgstr "" -#: ../../library/stdtypes.rst:2676 +#: ../../library/stdtypes.rst:2677 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2680 ../../library/stdtypes.rst:2702 -#: ../../library/stdtypes.rst:2832 ../../library/stdtypes.rst:2925 -#: ../../library/stdtypes.rst:2939 ../../library/stdtypes.rst:2970 -#: ../../library/stdtypes.rst:2984 ../../library/stdtypes.rst:3026 -#: ../../library/stdtypes.rst:3096 ../../library/stdtypes.rst:3114 -#: ../../library/stdtypes.rst:3142 ../../library/stdtypes.rst:3281 -#: ../../library/stdtypes.rst:3336 ../../library/stdtypes.rst:3379 -#: ../../library/stdtypes.rst:3400 ../../library/stdtypes.rst:3422 -#: ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:2681 ../../library/stdtypes.rst:2703 +#: ../../library/stdtypes.rst:2833 ../../library/stdtypes.rst:2926 +#: ../../library/stdtypes.rst:2940 ../../library/stdtypes.rst:2971 +#: ../../library/stdtypes.rst:2985 ../../library/stdtypes.rst:3027 +#: ../../library/stdtypes.rst:3097 ../../library/stdtypes.rst:3115 +#: ../../library/stdtypes.rst:3143 ../../library/stdtypes.rst:3282 +#: ../../library/stdtypes.rst:3337 ../../library/stdtypes.rst:3380 +#: ../../library/stdtypes.rst:3401 ../../library/stdtypes.rst:3423 +#: ../../library/stdtypes.rst:3625 msgid "" "The bytearray version of this method does *not* operate in place - it always " "produces a new object, even if no changes were made." msgstr "" -#: ../../library/stdtypes.rst:2689 +#: ../../library/stdtypes.rst:2690 msgid "" "If the binary data ends with the *suffix* string and that *suffix* is not " "empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the " "original binary data::" msgstr "" -#: ../../library/stdtypes.rst:2698 +#: ../../library/stdtypes.rst:2699 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2711 +#: ../../library/stdtypes.rst:2712 msgid "" "Return a string decoded from the given bytes. Default encoding is " "``'utf-8'``. *errors* may be given to set a different error handling " @@ -3453,25 +3453,25 @@ msgid "" "encodings, see section :ref:`standard-encodings`." msgstr "" -#: ../../library/stdtypes.rst:2719 +#: ../../library/stdtypes.rst:2720 msgid "" "By default, the *errors* argument is not checked for best performances, but " "only used at the first decoding error. Enable the :ref:`Python Development " "Mode `, or use a :ref:`debug build ` to check *errors*." msgstr "" -#: ../../library/stdtypes.rst:2725 +#: ../../library/stdtypes.rst:2726 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary bytes or " "bytearray object." msgstr "" -#: ../../library/stdtypes.rst:2729 +#: ../../library/stdtypes.rst:2730 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:2740 +#: ../../library/stdtypes.rst:2741 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -3479,11 +3479,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2745 +#: ../../library/stdtypes.rst:2746 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2751 +#: ../../library/stdtypes.rst:2752 msgid "" "Return the lowest index in the data where the subsequence *sub* is found, " "such that *sub* is contained in the slice ``s[start:end]``. Optional " @@ -3491,20 +3491,20 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2761 +#: ../../library/stdtypes.rst:2762 msgid "" "The :meth:`~bytes.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:2775 +#: ../../library/stdtypes.rst:2776 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2788 +#: ../../library/stdtypes.rst:2789 msgid "" "Return a bytes or bytearray object which is the concatenation of the binary " "data sequences in *iterable*. A :exc:`TypeError` will be raised if there " @@ -3514,7 +3514,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2799 +#: ../../library/stdtypes.rst:2800 msgid "" "This static method returns a translation table usable for :meth:`bytes." "translate` that will map each character in *from* into the character at the " @@ -3522,7 +3522,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2810 +#: ../../library/stdtypes.rst:2811 msgid "" "Split the sequence at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -3531,24 +3531,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2817 ../../library/stdtypes.rst:2874 +#: ../../library/stdtypes.rst:2818 ../../library/stdtypes.rst:2875 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2823 +#: ../../library/stdtypes.rst:2824 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If the optional argument *count* is given, only the " "first *count* occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:2827 +#: ../../library/stdtypes.rst:2828 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2839 +#: ../../library/stdtypes.rst:2840 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -3556,13 +3556,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2854 +#: ../../library/stdtypes.rst:2855 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2867 +#: ../../library/stdtypes.rst:2868 msgid "" "Split the sequence at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -3571,7 +3571,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2880 +#: ../../library/stdtypes.rst:2881 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -3579,11 +3579,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2885 +#: ../../library/stdtypes.rst:2886 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2891 +#: ../../library/stdtypes.rst:2892 msgid "" "Return a copy of the bytes or bytearray object where all bytes occurring in " "the optional argument *delete* are removed, and the remaining bytes have " @@ -3591,22 +3591,22 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:2896 +#: ../../library/stdtypes.rst:2897 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:2899 +#: ../../library/stdtypes.rst:2900 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:2905 +#: ../../library/stdtypes.rst:2906 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:2909 +#: ../../library/stdtypes.rst:2910 msgid "" "The following methods on bytes and bytearray objects have default behaviours " "that assume the use of ASCII compatible binary formats, but can still be " @@ -3615,7 +3615,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:2918 +#: ../../library/stdtypes.rst:2919 msgid "" "Return a copy of the object centered in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3623,7 +3623,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2932 +#: ../../library/stdtypes.rst:2933 msgid "" "Return a copy of the object left justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3631,7 +3631,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2946 +#: ../../library/stdtypes.rst:2947 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -3641,14 +3641,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2958 +#: ../../library/stdtypes.rst:2959 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removeprefix` for a method that will remove a " "single prefix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2977 +#: ../../library/stdtypes.rst:2978 msgid "" "Return a copy of the object right justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3656,7 +3656,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2991 +#: ../../library/stdtypes.rst:2992 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " @@ -3666,7 +3666,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3002 +#: ../../library/stdtypes.rst:3003 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -3676,14 +3676,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3014 +#: ../../library/stdtypes.rst:3015 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removesuffix` for a method that will remove a " "single suffix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3033 +#: ../../library/stdtypes.rst:3034 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given and non-negative, at most " @@ -3692,7 +3692,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3039 +#: ../../library/stdtypes.rst:3040 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -3703,7 +3703,7 @@ msgid "" "object being split. The *sep* argument may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3057 +#: ../../library/stdtypes.rst:3058 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive ASCII whitespace are regarded as a single " @@ -3713,7 +3713,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3078 +#: ../../library/stdtypes.rst:3079 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *chars* argument is a binary sequence specifying the set of " @@ -3723,13 +3723,13 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3091 +#: ../../library/stdtypes.rst:3092 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3100 +#: ../../library/stdtypes.rst:3101 msgid "" "The following methods on bytes and bytearray objects assume the use of ASCII " "compatible binary formats and should not be applied to arbitrary binary " @@ -3737,14 +3737,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3108 +#: ../../library/stdtypes.rst:3109 msgid "" "Return a copy of the sequence with each byte interpreted as an ASCII " "character, and the first byte capitalized and the rest lowercased. Non-ASCII " "byte values are passed through unchanged." msgstr "" -#: ../../library/stdtypes.rst:3121 +#: ../../library/stdtypes.rst:3122 msgid "" "Return a copy of the sequence where all ASCII tab characters are replaced by " "one or more ASCII spaces, depending on the current column and the given tab " @@ -3760,7 +3760,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3149 +#: ../../library/stdtypes.rst:3150 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -3769,7 +3769,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3166 +#: ../../library/stdtypes.rst:3167 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -3777,35 +3777,35 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3182 +#: ../../library/stdtypes.rst:3183 msgid "" "Return ``True`` if the sequence is empty or all bytes in the sequence are " "ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." msgstr "" -#: ../../library/stdtypes.rst:3192 +#: ../../library/stdtypes.rst:3193 msgid "" "Return ``True`` if all bytes in the sequence are ASCII decimal digits and " "the sequence is not empty, ``False`` otherwise. ASCII decimal digits are " "those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3207 +#: ../../library/stdtypes.rst:3208 msgid "" "Return ``True`` if there is at least one lowercase ASCII character in the " "sequence and no uppercase ASCII characters, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:3217 ../../library/stdtypes.rst:3259 -#: ../../library/stdtypes.rst:3275 ../../library/stdtypes.rst:3325 -#: ../../library/stdtypes.rst:3394 +#: ../../library/stdtypes.rst:3218 ../../library/stdtypes.rst:3260 +#: ../../library/stdtypes.rst:3276 ../../library/stdtypes.rst:3326 +#: ../../library/stdtypes.rst:3395 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " "values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3225 +#: ../../library/stdtypes.rst:3226 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -3813,27 +3813,27 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3234 +#: ../../library/stdtypes.rst:3235 msgid "" "Return ``True`` if the sequence is ASCII titlecase and the sequence is not " "empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the " "definition of \"titlecase\"." msgstr "" -#: ../../library/stdtypes.rst:3249 +#: ../../library/stdtypes.rst:3250 msgid "" "Return ``True`` if there is at least one uppercase alphabetic ASCII " "character in the sequence and no lowercase ASCII characters, ``False`` " "otherwise." msgstr "" -#: ../../library/stdtypes.rst:3267 +#: ../../library/stdtypes.rst:3268 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3292 +#: ../../library/stdtypes.rst:3293 msgid "" "Return a list of the lines in the binary sequence, breaking at ASCII line " "boundaries. This method uses the :term:`universal newlines` approach to " @@ -3841,20 +3841,20 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3304 +#: ../../library/stdtypes.rst:3305 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:3317 +#: ../../library/stdtypes.rst:3318 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." msgstr "" -#: ../../library/stdtypes.rst:3329 +#: ../../library/stdtypes.rst:3330 msgid "" "Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -3862,14 +3862,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3343 +#: ../../library/stdtypes.rst:3344 msgid "" "Return a titlecased version of the binary sequence where words start with an " "uppercase ASCII character and the remaining characters are lowercase. " "Uncased byte values are left unmodified." msgstr "" -#: ../../library/stdtypes.rst:3352 +#: ../../library/stdtypes.rst:3353 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -3877,18 +3877,18 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3365 +#: ../../library/stdtypes.rst:3366 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3386 +#: ../../library/stdtypes.rst:3387 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3407 +#: ../../library/stdtypes.rst:3408 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -3897,11 +3897,11 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3429 +#: ../../library/stdtypes.rst:3430 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3446 +#: ../../library/stdtypes.rst:3447 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -3909,7 +3909,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3451 +#: ../../library/stdtypes.rst:3452 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -3919,7 +3919,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3458 +#: ../../library/stdtypes.rst:3459 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -3927,7 +3927,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3492 +#: ../../library/stdtypes.rst:3493 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the bytes object *must* include a parenthesised mapping key into " @@ -3935,73 +3935,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3566 +#: ../../library/stdtypes.rst:3567 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3569 +#: ../../library/stdtypes.rst:3570 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3569 +#: ../../library/stdtypes.rst:3570 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:3574 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3576 +#: ../../library/stdtypes.rst:3577 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:3580 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:3580 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3614 +#: ../../library/stdtypes.rst:3615 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:3618 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3629 +#: ../../library/stdtypes.rst:3630 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3636 +#: ../../library/stdtypes.rst:3637 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3638 +#: ../../library/stdtypes.rst:3639 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying." msgstr "" -#: ../../library/stdtypes.rst:3644 +#: ../../library/stdtypes.rst:3645 msgid "" "Create a :class:`memoryview` that references *object*. *object* must " "support the buffer protocol. Built-in objects that support the buffer " "protocol include :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/stdtypes.rst:3648 +#: ../../library/stdtypes.rst:3649 msgid "" "A :class:`memoryview` has the notion of an *element*, which is the atomic " "memory unit handled by the originating *object*. For many simple types such " @@ -4009,7 +4009,7 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3653 +#: ../../library/stdtypes.rst:3654 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`. If " "``view.ndim = 0``, the length is 1. If ``view.ndim = 1``, the length is " @@ -4019,13 +4019,13 @@ msgid "" "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3660 +#: ../../library/stdtypes.rst:3661 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3673 +#: ../../library/stdtypes.rst:3674 msgid "" "If :class:`~memoryview.format` is one of the native format specifiers from " "the :mod:`struct` module, indexing with an integer or a tuple of integers is " @@ -4036,82 +4036,82 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:3682 +#: ../../library/stdtypes.rst:3683 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:3694 +#: ../../library/stdtypes.rst:3695 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:3715 +#: ../../library/stdtypes.rst:3716 msgid "" "One-dimensional memoryviews of hashable (read-only) types with formats 'B', " "'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m." "tobytes())``::" msgstr "" -#: ../../library/stdtypes.rst:3727 +#: ../../library/stdtypes.rst:3728 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now hashable." msgstr "" -#: ../../library/stdtypes.rst:3731 +#: ../../library/stdtypes.rst:3732 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:3735 +#: ../../library/stdtypes.rst:3736 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:3738 +#: ../../library/stdtypes.rst:3739 msgid ":class:`memoryview` has several methods:" msgstr "" -#: ../../library/stdtypes.rst:3742 +#: ../../library/stdtypes.rst:3743 msgid "" "A memoryview and a :pep:`3118` exporter are equal if their shapes are " "equivalent and if all corresponding values are equal when the operands' " "respective format codes are interpreted using :mod:`struct` syntax." msgstr "" -#: ../../library/stdtypes.rst:3746 +#: ../../library/stdtypes.rst:3747 msgid "" "For the subset of :mod:`struct` format strings currently supported by :meth:" "`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" msgstr "" -#: ../../library/stdtypes.rst:3765 +#: ../../library/stdtypes.rst:3766 msgid "" "If either format string is not supported by the :mod:`struct` module, then " "the objects will always compare as unequal (even if the format strings and " "buffer contents are identical)::" msgstr "" -#: ../../library/stdtypes.rst:3781 +#: ../../library/stdtypes.rst:3782 msgid "" "Note that, as with floating point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:3784 +#: ../../library/stdtypes.rst:3785 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:3790 +#: ../../library/stdtypes.rst:3791 msgid "" "Return the data in the buffer as a bytestring. This is equivalent to " "calling the :class:`bytes` constructor on the memoryview. ::" msgstr "" -#: ../../library/stdtypes.rst:3799 +#: ../../library/stdtypes.rst:3800 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -4119,7 +4119,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:3804 +#: ../../library/stdtypes.rst:3805 msgid "" "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the " "original array is converted to C or Fortran order. For contiguous views, 'A' " @@ -4128,36 +4128,36 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:3813 +#: ../../library/stdtypes.rst:3814 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:3822 +#: ../../library/stdtypes.rst:3823 msgid "" "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:3829 +#: ../../library/stdtypes.rst:3830 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:3839 +#: ../../library/stdtypes.rst:3840 msgid "" ":meth:`tolist` now supports all single character native formats in :mod:" "`struct` module syntax as well as multi-dimensional representations." msgstr "" -#: ../../library/stdtypes.rst:3846 +#: ../../library/stdtypes.rst:3847 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:3865 +#: ../../library/stdtypes.rst:3866 msgid "" "Release the underlying buffer exposed by the memoryview object. Many " "objects take special actions when a view is held on them (for example, a :" @@ -4166,20 +4166,20 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:3871 +#: ../../library/stdtypes.rst:3872 msgid "" "After this method has been called, any further operation on the view raises " "a :class:`ValueError` (except :meth:`release()` itself which can be called " "multiple times)::" msgstr "" -#: ../../library/stdtypes.rst:3882 +#: ../../library/stdtypes.rst:3883 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:3898 +#: ../../library/stdtypes.rst:3899 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -4188,57 +4188,57 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:3904 +#: ../../library/stdtypes.rst:3905 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " "'c'). The byte length of the result must be the same as the original length." msgstr "" -#: ../../library/stdtypes.rst:3909 +#: ../../library/stdtypes.rst:3910 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3932 +#: ../../library/stdtypes.rst:3933 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:3945 +#: ../../library/stdtypes.rst:3946 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:3971 +#: ../../library/stdtypes.rst:3972 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:3985 +#: ../../library/stdtypes.rst:3986 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:3988 +#: ../../library/stdtypes.rst:3989 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:3992 +#: ../../library/stdtypes.rst:3993 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4003 +#: ../../library/stdtypes.rst:4004 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -#: ../../library/stdtypes.rst:4022 +#: ../../library/stdtypes.rst:4023 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4039 +#: ../../library/stdtypes.rst:4040 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4043 +#: ../../library/stdtypes.rst:4044 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -4246,59 +4246,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4048 +#: ../../library/stdtypes.rst:4049 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" -#: ../../library/stdtypes.rst:4054 +#: ../../library/stdtypes.rst:4055 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4067 +#: ../../library/stdtypes.rst:4068 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4072 +#: ../../library/stdtypes.rst:4073 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." msgstr "" -#: ../../library/stdtypes.rst:4075 ../../library/stdtypes.rst:4083 +#: ../../library/stdtypes.rst:4076 ../../library/stdtypes.rst:4084 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4080 +#: ../../library/stdtypes.rst:4081 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." msgstr "" -#: ../../library/stdtypes.rst:4088 +#: ../../library/stdtypes.rst:4089 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4092 +#: ../../library/stdtypes.rst:4093 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4098 +#: ../../library/stdtypes.rst:4099 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4104 +#: ../../library/stdtypes.rst:4105 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4112 +#: ../../library/stdtypes.rst:4113 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4116 +#: ../../library/stdtypes.rst:4117 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4308,7 +4308,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4123 +#: ../../library/stdtypes.rst:4124 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -4316,7 +4316,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4128 +#: ../../library/stdtypes.rst:4129 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4328,18 +4328,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4136 +#: ../../library/stdtypes.rst:4137 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -#: ../../library/stdtypes.rst:4140 +#: ../../library/stdtypes.rst:4141 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4145 +#: ../../library/stdtypes.rst:4146 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -4347,92 +4347,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4151 +#: ../../library/stdtypes.rst:4152 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4153 +#: ../../library/stdtypes.rst:4154 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4154 +#: ../../library/stdtypes.rst:4155 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4155 +#: ../../library/stdtypes.rst:4156 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4157 +#: ../../library/stdtypes.rst:4158 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4162 +#: ../../library/stdtypes.rst:4163 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4166 +#: ../../library/stdtypes.rst:4167 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4170 +#: ../../library/stdtypes.rst:4171 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4174 +#: ../../library/stdtypes.rst:4175 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." msgstr "" -#: ../../library/stdtypes.rst:4180 +#: ../../library/stdtypes.rst:4181 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4184 +#: ../../library/stdtypes.rst:4185 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4190 +#: ../../library/stdtypes.rst:4191 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4194 +#: ../../library/stdtypes.rst:4195 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4200 +#: ../../library/stdtypes.rst:4201 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4205 +#: ../../library/stdtypes.rst:4206 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4210 +#: ../../library/stdtypes.rst:4211 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4215 +#: ../../library/stdtypes.rst:4216 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4219 +#: ../../library/stdtypes.rst:4220 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4222 +#: ../../library/stdtypes.rst:4223 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4442,7 +4442,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4229 +#: ../../library/stdtypes.rst:4230 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -4452,14 +4452,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4236 +#: ../../library/stdtypes.rst:4237 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " "returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" -#: ../../library/stdtypes.rst:4240 +#: ../../library/stdtypes.rst:4241 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -4467,71 +4467,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4245 +#: ../../library/stdtypes.rst:4246 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" -#: ../../library/stdtypes.rst:4248 +#: ../../library/stdtypes.rst:4249 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4250 +#: ../../library/stdtypes.rst:4251 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -#: ../../library/stdtypes.rst:4254 +#: ../../library/stdtypes.rst:4255 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4260 +#: ../../library/stdtypes.rst:4261 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4265 +#: ../../library/stdtypes.rst:4266 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:4271 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4275 +#: ../../library/stdtypes.rst:4276 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4279 +#: ../../library/stdtypes.rst:4280 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4283 +#: ../../library/stdtypes.rst:4284 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4288 +#: ../../library/stdtypes.rst:4289 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4292 +#: ../../library/stdtypes.rst:4293 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4297 +#: ../../library/stdtypes.rst:4298 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4300 +#: ../../library/stdtypes.rst:4301 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4539,18 +4539,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4305 +#: ../../library/stdtypes.rst:4306 msgid "" "Note, the *elem* argument to the :meth:`__contains__`, :meth:`remove`, and :" "meth:`discard` methods may be a set. To support searching for an equivalent " "frozenset, a temporary one is created from *elem*." msgstr "" -#: ../../library/stdtypes.rst:4313 +#: ../../library/stdtypes.rst:4314 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4323 +#: ../../library/stdtypes.rst:4324 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4559,7 +4559,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4329 +#: ../../library/stdtypes.rst:4330 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4571,33 +4571,33 @@ msgid "" "approximations it is usually unwise to use them as dictionary keys.)" msgstr "" -#: ../../library/stdtypes.rst:4342 +#: ../../library/stdtypes.rst:4343 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4345 +#: ../../library/stdtypes.rst:4346 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4347 +#: ../../library/stdtypes.rst:4348 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4349 +#: ../../library/stdtypes.rst:4350 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4350 +#: ../../library/stdtypes.rst:4351 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4353 +#: ../../library/stdtypes.rst:4354 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it is a mapping object, a dictionary is " @@ -4609,7 +4609,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4363 +#: ../../library/stdtypes.rst:4364 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -4617,39 +4617,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4368 +#: ../../library/stdtypes.rst:4369 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4380 +#: ../../library/stdtypes.rst:4381 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" -#: ../../library/stdtypes.rst:4384 +#: ../../library/stdtypes.rst:4385 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4389 +#: ../../library/stdtypes.rst:4390 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4393 +#: ../../library/stdtypes.rst:4394 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4397 +#: ../../library/stdtypes.rst:4398 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4402 +#: ../../library/stdtypes.rst:4403 msgid "" "If a subclass of dict defines a method :meth:`__missing__` and *key* is not " "present, the ``d[key]`` operation calls that method with the key *key* as " @@ -4660,51 +4660,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4420 +#: ../../library/stdtypes.rst:4421 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different ``__missing__`` method is used by :class:`collections." "defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:4426 +#: ../../library/stdtypes.rst:4427 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4430 +#: ../../library/stdtypes.rst:4431 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:4436 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4439 +#: ../../library/stdtypes.rst:4440 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4443 +#: ../../library/stdtypes.rst:4444 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4448 +#: ../../library/stdtypes.rst:4449 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:4453 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4456 +#: ../../library/stdtypes.rst:4457 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4458 +#: ../../library/stdtypes.rst:4459 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -4713,70 +4713,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4466 +#: ../../library/stdtypes.rst:4467 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " "raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4472 +#: ../../library/stdtypes.rst:4473 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4477 +#: ../../library/stdtypes.rst:4478 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4482 +#: ../../library/stdtypes.rst:4483 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" "exc:`KeyError` is raised." msgstr "" -#: ../../library/stdtypes.rst:4488 +#: ../../library/stdtypes.rst:4489 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -#: ../../library/stdtypes.rst:4491 +#: ../../library/stdtypes.rst:4492 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" "`popitem` raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4495 +#: ../../library/stdtypes.rst:4496 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4501 +#: ../../library/stdtypes.rst:4502 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4508 +#: ../../library/stdtypes.rst:4509 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" -#: ../../library/stdtypes.rst:4514 +#: ../../library/stdtypes.rst:4515 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4517 +#: ../../library/stdtypes.rst:4518 msgid "" ":meth:`update` accepts either another dictionary object or an iterable of " "key/value pairs (as tuples or other iterables of length two). If keyword " @@ -4784,71 +4784,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4524 +#: ../../library/stdtypes.rst:4525 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4527 +#: ../../library/stdtypes.rst:4528 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:4537 +#: ../../library/stdtypes.rst:4538 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4545 +#: ../../library/stdtypes.rst:4546 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4551 +#: ../../library/stdtypes.rst:4552 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " "'>') raise :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:4555 +#: ../../library/stdtypes.rst:4556 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:4573 +#: ../../library/stdtypes.rst:4574 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4577 +#: ../../library/stdtypes.rst:4578 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4589 +#: ../../library/stdtypes.rst:4590 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4594 +#: ../../library/stdtypes.rst:4595 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4601 +#: ../../library/stdtypes.rst:4602 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4603 +#: ../../library/stdtypes.rst:4604 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -4856,23 +4856,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4608 +#: ../../library/stdtypes.rst:4609 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4613 +#: ../../library/stdtypes.rst:4614 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4617 +#: ../../library/stdtypes.rst:4618 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4620 +#: ../../library/stdtypes.rst:4621 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4880,39 +4880,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4625 +#: ../../library/stdtypes.rst:4626 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:4628 +#: ../../library/stdtypes.rst:4629 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4633 +#: ../../library/stdtypes.rst:4634 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:4638 +#: ../../library/stdtypes.rst:4639 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:4641 +#: ../../library/stdtypes.rst:4642 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4646 +#: ../../library/stdtypes.rst:4647 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4651 +#: ../../library/stdtypes.rst:4652 msgid "" "Keys views are set-like since their entries are unique and hashable. If all " "values are hashable, so that ``(key, value)`` pairs are unique and hashable, " @@ -4922,15 +4922,15 @@ msgid "" "abc.Set` are available (for example, ``==``, ``<``, or ``^``)." msgstr "" -#: ../../library/stdtypes.rst:4658 +#: ../../library/stdtypes.rst:4659 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4699 +#: ../../library/stdtypes.rst:4700 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4706 +#: ../../library/stdtypes.rst:4707 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -4938,7 +4938,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4714 +#: ../../library/stdtypes.rst:4715 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -4946,14 +4946,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4719 +#: ../../library/stdtypes.rst:4720 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" "`open` to be used as the context expression in a :keyword:`with` statement." msgstr "" -#: ../../library/stdtypes.rst:4723 +#: ../../library/stdtypes.rst:4724 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -4963,7 +4963,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4733 +#: ../../library/stdtypes.rst:4734 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -4972,7 +4972,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4738 +#: ../../library/stdtypes.rst:4739 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -4983,7 +4983,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4745 +#: ../../library/stdtypes.rst:4746 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -4992,7 +4992,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4751 +#: ../../library/stdtypes.rst:4752 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -5001,7 +5001,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4757 +#: ../../library/stdtypes.rst:4758 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5011,7 +5011,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4764 +#: ../../library/stdtypes.rst:4765 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -5020,23 +5020,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4772 +#: ../../library/stdtypes.rst:4773 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4777 +#: ../../library/stdtypes.rst:4778 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4784 +#: ../../library/stdtypes.rst:4785 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4790 +#: ../../library/stdtypes.rst:4791 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5046,19 +5046,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4800 +#: ../../library/stdtypes.rst:4801 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:4803 +#: ../../library/stdtypes.rst:4804 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4806 +#: ../../library/stdtypes.rst:4807 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -5067,7 +5067,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4812 +#: ../../library/stdtypes.rst:4813 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -5076,7 +5076,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4818 +#: ../../library/stdtypes.rst:4819 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -5084,7 +5084,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4824 +#: ../../library/stdtypes.rst:4825 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -5093,21 +5093,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4830 +#: ../../library/stdtypes.rst:4831 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " "directly." msgstr "" -#: ../../library/stdtypes.rst:4836 +#: ../../library/stdtypes.rst:4837 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " "expecting a :class:`list` containing :class:`float` elements::" msgstr "" -#: ../../library/stdtypes.rst:4844 +#: ../../library/stdtypes.rst:4845 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -5115,13 +5115,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4852 +#: ../../library/stdtypes.rst:4853 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4860 +#: ../../library/stdtypes.rst:4861 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5130,325 +5130,325 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4870 +#: ../../library/stdtypes.rst:4871 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4881 +#: ../../library/stdtypes.rst:4882 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4889 +#: ../../library/stdtypes.rst:4890 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4897 +#: ../../library/stdtypes.rst:4898 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " "items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" -#: ../../library/stdtypes.rst:4908 +#: ../../library/stdtypes.rst:4909 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4910 +#: ../../library/stdtypes.rst:4911 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4913 +#: ../../library/stdtypes.rst:4914 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4914 +#: ../../library/stdtypes.rst:4915 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4915 +#: ../../library/stdtypes.rst:4916 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4916 +#: ../../library/stdtypes.rst:4917 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4917 +#: ../../library/stdtypes.rst:4918 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4918 +#: ../../library/stdtypes.rst:4919 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4919 +#: ../../library/stdtypes.rst:4920 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4920 +#: ../../library/stdtypes.rst:4921 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:4922 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4922 +#: ../../library/stdtypes.rst:4923 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4923 +#: ../../library/stdtypes.rst:4924 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4924 +#: ../../library/stdtypes.rst:4925 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4925 +#: ../../library/stdtypes.rst:4926 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4926 +#: ../../library/stdtypes.rst:4927 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4927 +#: ../../library/stdtypes.rst:4928 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4928 +#: ../../library/stdtypes.rst:4929 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4929 +#: ../../library/stdtypes.rst:4930 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4930 +#: ../../library/stdtypes.rst:4931 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4931 +#: ../../library/stdtypes.rst:4932 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4932 +#: ../../library/stdtypes.rst:4933 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4933 +#: ../../library/stdtypes.rst:4934 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4934 +#: ../../library/stdtypes.rst:4935 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4935 +#: ../../library/stdtypes.rst:4936 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4936 +#: ../../library/stdtypes.rst:4937 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4937 +#: ../../library/stdtypes.rst:4938 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4938 +#: ../../library/stdtypes.rst:4939 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4939 +#: ../../library/stdtypes.rst:4940 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4940 +#: ../../library/stdtypes.rst:4941 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4941 +#: ../../library/stdtypes.rst:4942 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4942 +#: ../../library/stdtypes.rst:4943 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4943 +#: ../../library/stdtypes.rst:4944 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4944 +#: ../../library/stdtypes.rst:4945 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:4945 +#: ../../library/stdtypes.rst:4946 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:4946 +#: ../../library/stdtypes.rst:4947 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:4947 +#: ../../library/stdtypes.rst:4948 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:4948 +#: ../../library/stdtypes.rst:4949 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:4949 +#: ../../library/stdtypes.rst:4950 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:4950 +#: ../../library/stdtypes.rst:4951 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:4951 +#: ../../library/stdtypes.rst:4952 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:4952 +#: ../../library/stdtypes.rst:4953 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:4953 +#: ../../library/stdtypes.rst:4954 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:4954 +#: ../../library/stdtypes.rst:4955 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:4955 +#: ../../library/stdtypes.rst:4956 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:4956 +#: ../../library/stdtypes.rst:4957 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:4957 +#: ../../library/stdtypes.rst:4958 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:4958 +#: ../../library/stdtypes.rst:4959 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:4959 +#: ../../library/stdtypes.rst:4960 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:4960 +#: ../../library/stdtypes.rst:4961 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:4961 +#: ../../library/stdtypes.rst:4962 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:4962 +#: ../../library/stdtypes.rst:4963 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:4963 +#: ../../library/stdtypes.rst:4964 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:4964 +#: ../../library/stdtypes.rst:4965 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:4965 +#: ../../library/stdtypes.rst:4966 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4967 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4972 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:4974 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4978 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:4985 +#: ../../library/stdtypes.rst:4986 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " "class::" msgstr "" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:4996 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5007 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." "ParamSpec` is intended primarily for static type checking." msgstr "" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5014 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5014 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5018 +#: ../../library/stdtypes.rst:5019 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5017 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." "__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:5021 +#: ../../library/stdtypes.rst:5022 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5021 +#: ../../library/stdtypes.rst:5022 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:5031 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5036 +#: ../../library/stdtypes.rst:5037 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5457,7 +5457,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5043 +#: ../../library/stdtypes.rst:5044 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -5465,76 +5465,76 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5053 +#: ../../library/stdtypes.rst:5054 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5055 +#: ../../library/stdtypes.rst:5056 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5059 +#: ../../library/stdtypes.rst:5060 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5063 +#: ../../library/stdtypes.rst:5064 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5067 +#: ../../library/stdtypes.rst:5068 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5071 +#: ../../library/stdtypes.rst:5072 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5078 +#: ../../library/stdtypes.rst:5079 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5084 +#: ../../library/stdtypes.rst:5085 msgid "" "However, union objects containing :ref:`parameterized generics ` cannot be used::" msgstr "" -#: ../../library/stdtypes.rst:5092 +#: ../../library/stdtypes.rst:5093 msgid "" "The user-exposed type for the union object can be accessed from :data:`types." "UnionType` and used for :func:`isinstance` checks. An object cannot be " "instantiated from the type::" msgstr "" -#: ../../library/stdtypes.rst:5105 +#: ../../library/stdtypes.rst:5106 msgid "" "The :meth:`__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`__or__`, the Union may override " "it::" msgstr "" -#: ../../library/stdtypes.rst:5123 +#: ../../library/stdtypes.rst:5124 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5131 +#: ../../library/stdtypes.rst:5132 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5133 +#: ../../library/stdtypes.rst:5134 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5140 +#: ../../library/stdtypes.rst:5141 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5142 +#: ../../library/stdtypes.rst:5143 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -5545,7 +5545,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5149 +#: ../../library/stdtypes.rst:5150 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5556,32 +5556,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5157 +#: ../../library/stdtypes.rst:5158 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5165 +#: ../../library/stdtypes.rst:5166 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5167 +#: ../../library/stdtypes.rst:5168 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5173 +#: ../../library/stdtypes.rst:5174 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5175 +#: ../../library/stdtypes.rst:5176 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:5178 +#: ../../library/stdtypes.rst:5179 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5589,15 +5589,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5182 +#: ../../library/stdtypes.rst:5183 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5188 +#: ../../library/stdtypes.rst:5189 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5192 +#: ../../library/stdtypes.rst:5193 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: built-in methods (such as :meth:`append` on lists) and " @@ -5605,7 +5605,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5197 +#: ../../library/stdtypes.rst:5198 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :dfn:" @@ -5617,7 +5617,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5206 +#: ../../library/stdtypes.rst:5207 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5627,15 +5627,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5226 ../../library/stdtypes.rst:5257 +#: ../../library/stdtypes.rst:5227 ../../library/stdtypes.rst:5258 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5234 +#: ../../library/stdtypes.rst:5235 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5240 +#: ../../library/stdtypes.rst:5241 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5645,23 +5645,23 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5247 +#: ../../library/stdtypes.rst:5248 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." msgstr "" -#: ../../library/stdtypes.rst:5254 +#: ../../library/stdtypes.rst:5255 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5263 +#: ../../library/stdtypes.rst:5264 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5269 +#: ../../library/stdtypes.rst:5270 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -5669,30 +5669,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5274 +#: ../../library/stdtypes.rst:5275 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5280 +#: ../../library/stdtypes.rst:5281 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5282 +#: ../../library/stdtypes.rst:5283 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5286 +#: ../../library/stdtypes.rst:5287 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5293 +#: ../../library/stdtypes.rst:5294 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5295 +#: ../../library/stdtypes.rst:5296 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5700,15 +5700,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5300 +#: ../../library/stdtypes.rst:5301 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5306 +#: ../../library/stdtypes.rst:5307 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5308 +#: ../../library/stdtypes.rst:5309 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -5716,15 +5716,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5313 +#: ../../library/stdtypes.rst:5314 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5320 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5321 +#: ../../library/stdtypes.rst:5322 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5735,104 +5735,104 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:5335 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5340 +#: ../../library/stdtypes.rst:5341 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5342 +#: ../../library/stdtypes.rst:5343 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5349 +#: ../../library/stdtypes.rst:5350 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5351 +#: ../../library/stdtypes.rst:5352 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:5358 +#: ../../library/stdtypes.rst:5359 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5364 +#: ../../library/stdtypes.rst:5365 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5369 +#: ../../library/stdtypes.rst:5370 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5374 +#: ../../library/stdtypes.rst:5375 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5380 +#: ../../library/stdtypes.rst:5381 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5388 +#: ../../library/stdtypes.rst:5389 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5394 +#: ../../library/stdtypes.rst:5395 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~class.__mro__`." msgstr "" -#: ../../library/stdtypes.rst:5401 +#: ../../library/stdtypes.rst:5402 msgid "" "Each class keeps a list of weak references to its immediate subclasses. " "This method returns a list of all those references still alive. The list is " "in definition order. Example::" msgstr "" -#: ../../library/stdtypes.rst:5410 +#: ../../library/stdtypes.rst:5411 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5411 +#: ../../library/stdtypes.rst:5412 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5414 +#: ../../library/stdtypes.rst:5415 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5417 +#: ../../library/stdtypes.rst:5418 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5419 +#: ../../library/stdtypes.rst:5420 msgid "" "Cased characters are those with general category property being one of \"Lu" "\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:5422 +#: ../../library/stdtypes.rst:5423 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." diff --git a/library/string.po b/library/string.po index c5042dbdd4..fca38e71c2 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-14 02:16+0000\n" +"POT-Creation-Date: 2022-08-06 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,78 +26,78 @@ msgstr "" msgid "**Source code:** :source:`Lib/string.py`" msgstr "**原始碼:**\\ :source:`Lib/string.py`" -#: ../../library/string.rst:13 +#: ../../library/string.rst:14 msgid ":ref:`textseq`" msgstr ":ref:`textseq`" -#: ../../library/string.rst:15 +#: ../../library/string.rst:16 msgid ":ref:`string-methods`" msgstr ":ref:`string-methods`" -#: ../../library/string.rst:18 +#: ../../library/string.rst:19 msgid "String constants" msgstr "" -#: ../../library/string.rst:20 +#: ../../library/string.rst:21 msgid "The constants defined in this module are:" msgstr "" -#: ../../library/string.rst:25 +#: ../../library/string.rst:26 msgid "" "The concatenation of the :const:`ascii_lowercase` and :const:" "`ascii_uppercase` constants described below. This value is not locale-" "dependent." msgstr "" -#: ../../library/string.rst:31 +#: ../../library/string.rst:32 msgid "" "The lowercase letters ``'abcdefghijklmnopqrstuvwxyz'``. This value is not " "locale-dependent and will not change." msgstr "" -#: ../../library/string.rst:37 +#: ../../library/string.rst:38 msgid "" "The uppercase letters ``'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. This value is not " "locale-dependent and will not change." msgstr "" -#: ../../library/string.rst:43 +#: ../../library/string.rst:44 msgid "The string ``'0123456789'``." msgstr "" -#: ../../library/string.rst:48 +#: ../../library/string.rst:49 msgid "The string ``'0123456789abcdefABCDEF'``." msgstr "" -#: ../../library/string.rst:53 +#: ../../library/string.rst:54 msgid "The string ``'01234567'``." msgstr "" -#: ../../library/string.rst:58 +#: ../../library/string.rst:59 msgid "" "String of ASCII characters which are considered punctuation characters in " "the ``C`` locale: ``!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~``." msgstr "" -#: ../../library/string.rst:63 +#: ../../library/string.rst:64 msgid "" "String of ASCII characters which are considered printable. This is a " "combination of :const:`digits`, :const:`ascii_letters`, :const:" "`punctuation`, and :const:`whitespace`." msgstr "" -#: ../../library/string.rst:70 +#: ../../library/string.rst:71 msgid "" "A string containing all ASCII characters that are considered whitespace. " "This includes the characters space, tab, linefeed, return, formfeed, and " "vertical tab." msgstr "" -#: ../../library/string.rst:78 +#: ../../library/string.rst:79 msgid "Custom String Formatting" msgstr "" -#: ../../library/string.rst:80 +#: ../../library/string.rst:81 msgid "" "The built-in string class provides the ability to do complex variable " "substitutions and value formatting via the :meth:`~str.format` method " @@ -107,24 +107,24 @@ msgid "" "method." msgstr "" -#: ../../library/string.rst:89 +#: ../../library/string.rst:90 msgid "The :class:`Formatter` class has the following public methods:" msgstr "" -#: ../../library/string.rst:93 +#: ../../library/string.rst:94 msgid "" "The primary API method. It takes a format string and an arbitrary set of " "positional and keyword arguments. It is just a wrapper that calls :meth:" "`vformat`." msgstr "" -#: ../../library/string.rst:97 +#: ../../library/string.rst:98 msgid "" "A format string argument is now :ref:`positional-only `." msgstr "" -#: ../../library/string.rst:103 +#: ../../library/string.rst:104 msgid "" "This function does the actual work of formatting. It is exposed as a " "separate function for cases where you want to pass in a predefined " @@ -134,13 +134,13 @@ msgid "" "and replacement fields. It calls the various methods described below." msgstr "" -#: ../../library/string.rst:111 +#: ../../library/string.rst:112 msgid "" "In addition, the :class:`Formatter` defines a number of methods that are " "intended to be replaced by subclasses:" msgstr "" -#: ../../library/string.rst:116 +#: ../../library/string.rst:117 msgid "" "Loop over the format_string and return an iterable of tuples " "(*literal_text*, *field_name*, *format_spec*, *conversion*). This is used " @@ -148,7 +148,7 @@ msgid "" "replacement fields." msgstr "" -#: ../../library/string.rst:121 +#: ../../library/string.rst:122 msgid "" "The values in the tuple conceptually represent a span of literal text " "followed by a single replacement field. If there is no literal text (which " @@ -158,7 +158,7 @@ msgid "" "be ``None``." msgstr "" -#: ../../library/string.rst:130 +#: ../../library/string.rst:131 msgid "" "Given *field_name* as returned by :meth:`parse` (see above), convert it to " "an object to be formatted. Returns a tuple (obj, used_key). The default " @@ -168,7 +168,7 @@ msgid "" "*key* parameter to :meth:`get_value`." msgstr "" -#: ../../library/string.rst:139 +#: ../../library/string.rst:140 msgid "" "Retrieve a given field value. The *key* argument will be either an integer " "or a string. If it is an integer, it represents the index of the positional " @@ -176,21 +176,21 @@ msgid "" "in *kwargs*." msgstr "" -#: ../../library/string.rst:144 +#: ../../library/string.rst:145 msgid "" "The *args* parameter is set to the list of positional arguments to :meth:" "`vformat`, and the *kwargs* parameter is set to the dictionary of keyword " "arguments." msgstr "" -#: ../../library/string.rst:148 +#: ../../library/string.rst:149 msgid "" "For compound field names, these functions are only called for the first " "component of the field name; subsequent components are handled through " "normal attribute and indexing operations." msgstr "" -#: ../../library/string.rst:152 +#: ../../library/string.rst:153 msgid "" "So for example, the field expression '0.name' would cause :meth:`get_value` " "to be called with a *key* argument of 0. The ``name`` attribute will be " @@ -198,13 +198,13 @@ msgid "" "`getattr` function." msgstr "" -#: ../../library/string.rst:157 +#: ../../library/string.rst:158 msgid "" "If the index or keyword refers to an item that does not exist, then an :exc:" "`IndexError` or :exc:`KeyError` should be raised." msgstr "" -#: ../../library/string.rst:162 +#: ../../library/string.rst:163 msgid "" "Implement checking for unused arguments if desired. The arguments to this " "function is the set of all argument keys that were actually referred to in " @@ -214,24 +214,24 @@ msgid "" "meth:`check_unused_args` is assumed to raise an exception if the check fails." msgstr "" -#: ../../library/string.rst:172 +#: ../../library/string.rst:173 msgid "" ":meth:`format_field` simply calls the global :func:`format` built-in. The " "method is provided so that subclasses can override it." msgstr "" -#: ../../library/string.rst:177 +#: ../../library/string.rst:178 msgid "" "Converts the value (returned by :meth:`get_field`) given a conversion type " "(as in the tuple returned by the :meth:`parse` method). The default version " "understands 's' (str), 'r' (repr) and 'a' (ascii) conversion types." msgstr "" -#: ../../library/string.rst:186 +#: ../../library/string.rst:187 msgid "Format String Syntax" msgstr "" -#: ../../library/string.rst:188 +#: ../../library/string.rst:189 msgid "" "The :meth:`str.format` method and the :class:`Formatter` class share the " "same syntax for format strings (although in the case of :class:`Formatter`, " @@ -241,7 +241,7 @@ msgid "" "expressions." msgstr "" -#: ../../library/string.rst:201 +#: ../../library/string.rst:202 msgid "" "Format strings contain \"replacement fields\" surrounded by curly braces ``{}" "``. Anything that is not contained in braces is considered literal text, " @@ -250,11 +250,11 @@ msgid "" "``." msgstr "" -#: ../../library/string.rst:206 +#: ../../library/string.rst:207 msgid "The grammar for a replacement field is as follows:" msgstr "" -#: ../../library/string.rst:218 +#: ../../library/string.rst:219 msgid "" "In less formal terms, the replacement field can start with a *field_name* " "that specifies the object whose value is to be formatted and inserted into " @@ -264,11 +264,11 @@ msgid "" "specify a non-default format for the replacement value." msgstr "" -#: ../../library/string.rst:225 +#: ../../library/string.rst:226 msgid "See also the :ref:`formatspec` section." msgstr "另請參閱 :ref:`formatspec` 部份。" -#: ../../library/string.rst:227 +#: ../../library/string.rst:228 msgid "" "The *field_name* itself begins with an *arg_name* that is either a number or " "a keyword. If it's a number, it refers to a positional argument, and if " @@ -284,22 +284,22 @@ msgid "" "`__getitem__`." msgstr "" -#: ../../library/string.rst:239 +#: ../../library/string.rst:240 msgid "" "The positional argument specifiers can be omitted for :meth:`str.format`, so " "``'{} {}'.format(a, b)`` is equivalent to ``'{0} {1}'.format(a, b)``." msgstr "" -#: ../../library/string.rst:243 +#: ../../library/string.rst:244 msgid "" "The positional argument specifiers can be omitted for :class:`Formatter`." msgstr "" -#: ../../library/string.rst:246 +#: ../../library/string.rst:247 msgid "Some simple format string examples::" msgstr "" -#: ../../library/string.rst:255 +#: ../../library/string.rst:256 msgid "" "The *conversion* field causes a type coercion before formatting. Normally, " "the job of formatting a value is done by the :meth:`__format__` method of " @@ -309,21 +309,21 @@ msgid "" "normal formatting logic is bypassed." msgstr "" -#: ../../library/string.rst:262 +#: ../../library/string.rst:263 msgid "" "Three conversion flags are currently supported: ``'!s'`` which calls :func:" "`str` on the value, ``'!r'`` which calls :func:`repr` and ``'!a'`` which " "calls :func:`ascii`." msgstr "" -#: ../../library/string.rst:266 +#: ../../library/string.rst:267 msgid "Some examples::" msgstr "" "一些範例:\n" "\n" "::" -#: ../../library/string.rst:272 +#: ../../library/string.rst:273 msgid "" "The *format_spec* field contains a specification of how the value should be " "presented, including such details as field width, alignment, padding, " @@ -331,13 +331,13 @@ msgid "" "\"formatting mini-language\" or interpretation of the *format_spec*." msgstr "" -#: ../../library/string.rst:277 +#: ../../library/string.rst:278 msgid "" "Most built-in types support a common formatting mini-language, which is " "described in the next section." msgstr "" -#: ../../library/string.rst:280 +#: ../../library/string.rst:281 msgid "" "A *format_spec* field can also include nested replacement fields within it. " "These nested replacement fields may contain a field name, conversion flag " @@ -347,15 +347,15 @@ msgid "" "to be dynamically specified." msgstr "" -#: ../../library/string.rst:287 +#: ../../library/string.rst:288 msgid "See the :ref:`formatexamples` section for some examples." msgstr "範例請見 :ref:`formatexamples`\\ 。" -#: ../../library/string.rst:293 +#: ../../library/string.rst:294 msgid "Format Specification Mini-Language" msgstr "" -#: ../../library/string.rst:295 +#: ../../library/string.rst:296 msgid "" "\"Format specifications\" are used within replacement fields contained " "within a format string to define how individual values are presented (see :" @@ -364,25 +364,25 @@ msgid "" "how the format specification is to be interpreted." msgstr "" -#: ../../library/string.rst:302 +#: ../../library/string.rst:303 msgid "" "Most built-in types implement the following options for format " "specifications, although some of the formatting options are only supported " "by the numeric types." msgstr "" -#: ../../library/string.rst:305 +#: ../../library/string.rst:306 msgid "" "A general convention is that an empty format specification produces the same " "result as if you had called :func:`str` on the value. A non-empty format " "specification typically modifies the result." msgstr "" -#: ../../library/string.rst:309 +#: ../../library/string.rst:310 msgid "The general form of a *standard format specifier* is:" msgstr "" -#: ../../library/string.rst:321 +#: ../../library/string.rst:322 msgid "" "If a valid *align* value is specified, it can be preceded by a *fill* " "character that can be any character and defaults to a space if omitted. It " @@ -393,45 +393,45 @@ msgid "" "the :func:`format` function." msgstr "" -#: ../../library/string.rst:330 +#: ../../library/string.rst:331 msgid "The meaning of the various alignment options is as follows:" msgstr "" -#: ../../library/string.rst:339 ../../library/string.rst:370 +#: ../../library/string.rst:340 ../../library/string.rst:371 msgid "Option" msgstr "" -#: ../../library/string.rst:339 ../../library/string.rst:370 -#: ../../library/string.rst:444 ../../library/string.rst:455 -#: ../../library/string.rst:490 +#: ../../library/string.rst:340 ../../library/string.rst:371 +#: ../../library/string.rst:445 ../../library/string.rst:456 +#: ../../library/string.rst:491 msgid "Meaning" msgstr "" -#: ../../library/string.rst:341 +#: ../../library/string.rst:342 msgid "``'<'``" msgstr "``'<'``" -#: ../../library/string.rst:341 +#: ../../library/string.rst:342 msgid "" "Forces the field to be left-aligned within the available space (this is the " "default for most objects)." msgstr "" -#: ../../library/string.rst:344 +#: ../../library/string.rst:345 msgid "``'>'``" msgstr "``'>'``" -#: ../../library/string.rst:344 +#: ../../library/string.rst:345 msgid "" "Forces the field to be right-aligned within the available space (this is the " "default for numbers)." msgstr "" -#: ../../library/string.rst:347 +#: ../../library/string.rst:348 msgid "``'='``" msgstr "``'='``" -#: ../../library/string.rst:347 +#: ../../library/string.rst:348 msgid "" "Forces the padding to be placed after the sign (if any) but before the " "digits. This is used for printing fields in the form '+000000120'. This " @@ -439,58 +439,58 @@ msgid "" "for numbers when '0' immediately precedes the field width." msgstr "" -#: ../../library/string.rst:353 +#: ../../library/string.rst:354 msgid "``'^'``" msgstr "``'^'``" -#: ../../library/string.rst:353 +#: ../../library/string.rst:354 msgid "Forces the field to be centered within the available space." msgstr "" -#: ../../library/string.rst:357 +#: ../../library/string.rst:358 msgid "" "Note that unless a minimum field width is defined, the field width will " "always be the same size as the data to fill it, so that the alignment option " "has no meaning in this case." msgstr "" -#: ../../library/string.rst:361 +#: ../../library/string.rst:362 msgid "" "The *sign* option is only valid for number types, and can be one of the " "following:" msgstr "" -#: ../../library/string.rst:372 +#: ../../library/string.rst:373 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/string.rst:372 +#: ../../library/string.rst:373 msgid "" "indicates that a sign should be used for both positive as well as negative " "numbers." msgstr "" -#: ../../library/string.rst:375 +#: ../../library/string.rst:376 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/string.rst:375 +#: ../../library/string.rst:376 msgid "" "indicates that a sign should be used only for negative numbers (this is the " "default behavior)." msgstr "" -#: ../../library/string.rst:378 +#: ../../library/string.rst:379 msgid "space" msgstr "" -#: ../../library/string.rst:378 +#: ../../library/string.rst:379 msgid "" "indicates that a leading space should be used on positive numbers, and a " "minus sign on negative numbers." msgstr "" -#: ../../library/string.rst:385 +#: ../../library/string.rst:386 msgid "" "The ``'#'`` option causes the \"alternate form\" to be used for the " "conversion. The alternate form is defined differently for different types. " @@ -504,17 +504,17 @@ msgid "" "and ``'G'`` conversions, trailing zeros are not removed from the result." msgstr "" -#: ../../library/string.rst:399 +#: ../../library/string.rst:400 msgid "" "The ``','`` option signals the use of a comma for a thousands separator. For " "a locale aware separator, use the ``'n'`` integer presentation type instead." msgstr "" -#: ../../library/string.rst:403 +#: ../../library/string.rst:404 msgid "Added the ``','`` option (see also :pep:`378`)." msgstr "新增 ``','`` 選項(請見 :pep:`378`\\ )。" -#: ../../library/string.rst:408 +#: ../../library/string.rst:409 msgid "" "The ``'_'`` option signals the use of an underscore for a thousands " "separator for floating point presentation types and for integer presentation " @@ -523,18 +523,18 @@ msgid "" "presentation types, specifying this option is an error." msgstr "" -#: ../../library/string.rst:415 +#: ../../library/string.rst:416 msgid "Added the ``'_'`` option (see also :pep:`515`)." msgstr "新增 ``'_'`` 選項(請見 :pep:`515`\\ )。" -#: ../../library/string.rst:418 +#: ../../library/string.rst:419 msgid "" "*width* is a decimal integer defining the minimum total field width, " "including any prefixes, separators, and other formatting characters. If not " "specified, then the field width will be determined by the content." msgstr "" -#: ../../library/string.rst:422 +#: ../../library/string.rst:423 msgid "" "When no explicit alignment is given, preceding the *width* field by a zero " "(``'0'``) character enables sign-aware zero-padding for numeric types. This " @@ -542,13 +542,13 @@ msgid "" "``'='``." msgstr "" -#: ../../library/string.rst:427 +#: ../../library/string.rst:428 msgid "" "Preceding the *width* field by ``'0'`` no longer affects the default " "alignment for strings." msgstr "" -#: ../../library/string.rst:431 +#: ../../library/string.rst:432 msgid "" "The *precision* is a decimal integer indicating how many digits should be " "displayed after the decimal point for presentation types ``'f'`` and " @@ -559,110 +559,110 @@ msgid "" "types." msgstr "" -#: ../../library/string.rst:439 +#: ../../library/string.rst:440 msgid "Finally, the *type* determines how the data should be presented." msgstr "" -#: ../../library/string.rst:441 +#: ../../library/string.rst:442 msgid "The available string presentation types are:" msgstr "" -#: ../../library/string.rst:444 ../../library/string.rst:455 -#: ../../library/string.rst:490 +#: ../../library/string.rst:445 ../../library/string.rst:456 +#: ../../library/string.rst:491 msgid "Type" msgstr "" -#: ../../library/string.rst:446 +#: ../../library/string.rst:447 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/string.rst:446 +#: ../../library/string.rst:447 msgid "String format. This is the default type for strings and may be omitted." msgstr "" -#: ../../library/string.rst:449 ../../library/string.rst:478 -#: ../../library/string.rst:565 +#: ../../library/string.rst:450 ../../library/string.rst:479 +#: ../../library/string.rst:566 msgid "None" msgstr "None" -#: ../../library/string.rst:449 +#: ../../library/string.rst:450 msgid "The same as ``'s'``." msgstr "" -#: ../../library/string.rst:452 +#: ../../library/string.rst:453 msgid "The available integer presentation types are:" msgstr "" -#: ../../library/string.rst:457 +#: ../../library/string.rst:458 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/string.rst:457 +#: ../../library/string.rst:458 msgid "Binary format. Outputs the number in base 2." msgstr "" -#: ../../library/string.rst:459 +#: ../../library/string.rst:460 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/string.rst:459 +#: ../../library/string.rst:460 msgid "" "Character. Converts the integer to the corresponding unicode character " "before printing." msgstr "" -#: ../../library/string.rst:462 +#: ../../library/string.rst:463 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/string.rst:462 +#: ../../library/string.rst:463 msgid "Decimal Integer. Outputs the number in base 10." msgstr "" -#: ../../library/string.rst:464 +#: ../../library/string.rst:465 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/string.rst:464 +#: ../../library/string.rst:465 msgid "Octal format. Outputs the number in base 8." msgstr "" -#: ../../library/string.rst:466 +#: ../../library/string.rst:467 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/string.rst:466 +#: ../../library/string.rst:467 msgid "" "Hex format. Outputs the number in base 16, using lower-case letters for the " "digits above 9." msgstr "" -#: ../../library/string.rst:469 +#: ../../library/string.rst:470 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/string.rst:469 +#: ../../library/string.rst:470 msgid "" "Hex format. Outputs the number in base 16, using upper-case letters for the " "digits above 9. In case ``'#'`` is specified, the prefix ``'0x'`` will be " "upper-cased to ``'0X'`` as well." msgstr "" -#: ../../library/string.rst:474 ../../library/string.rst:558 +#: ../../library/string.rst:475 ../../library/string.rst:559 msgid "``'n'``" msgstr "``'n'``" -#: ../../library/string.rst:474 +#: ../../library/string.rst:475 msgid "" "Number. This is the same as ``'d'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:478 +#: ../../library/string.rst:479 msgid "The same as ``'d'``." msgstr "" -#: ../../library/string.rst:481 +#: ../../library/string.rst:482 msgid "" "In addition to the above presentation types, integers can be formatted with " "the floating point presentation types listed below (except ``'n'`` and " @@ -670,17 +670,17 @@ msgid "" "floating point number before formatting." msgstr "" -#: ../../library/string.rst:486 +#: ../../library/string.rst:487 msgid "" "The available presentation types for :class:`float` and :class:`~decimal." "Decimal` values are:" msgstr "" -#: ../../library/string.rst:492 +#: ../../library/string.rst:493 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/string.rst:492 +#: ../../library/string.rst:493 msgid "" "Scientific notation. For a given precision ``p``, formats the number in " "scientific notation with the letter 'e' separating the coefficient from the " @@ -692,21 +692,21 @@ msgid "" "removed unless the ``#`` option is used." msgstr "" -#: ../../library/string.rst:504 +#: ../../library/string.rst:505 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/string.rst:504 +#: ../../library/string.rst:505 msgid "" "Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the " "separator character." msgstr "" -#: ../../library/string.rst:507 +#: ../../library/string.rst:508 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/string.rst:507 +#: ../../library/string.rst:508 msgid "" "Fixed-point notation. For a given precision ``p``, formats the number as a " "decimal number with exactly ``p`` digits following the decimal point. With " @@ -717,21 +717,21 @@ msgid "" "used." msgstr "" -#: ../../library/string.rst:517 +#: ../../library/string.rst:518 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/string.rst:517 +#: ../../library/string.rst:518 msgid "" "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " "``inf`` to ``INF``." msgstr "" -#: ../../library/string.rst:520 +#: ../../library/string.rst:521 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/string.rst:520 +#: ../../library/string.rst:521 msgid "" "General format. For a given precision ``p >= 1``, this rounds the number to " "``p`` significant digits and then formats the result in either fixed-point " @@ -739,7 +739,7 @@ msgid "" "``0`` is treated as equivalent to a precision of ``1``." msgstr "" -#: ../../library/string.rst:527 +#: ../../library/string.rst:528 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -752,7 +752,7 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" -#: ../../library/string.rst:540 +#: ../../library/string.rst:541 msgid "" "With no precision given, uses a precision of ``6`` significant digits for :" "class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " @@ -762,40 +762,40 @@ msgid "" "notation is used otherwise." msgstr "" -#: ../../library/string.rst:549 +#: ../../library/string.rst:550 msgid "" "Positive and negative infinity, positive and negative zero, and nans, are " "formatted as ``inf``, ``-inf``, ``0``, ``-0`` and ``nan`` respectively, " "regardless of the precision." msgstr "" -#: ../../library/string.rst:554 +#: ../../library/string.rst:555 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/string.rst:554 +#: ../../library/string.rst:555 msgid "" "General format. Same as ``'g'`` except switches to ``'E'`` if the number " "gets too large. The representations of infinity and NaN are uppercased, too." msgstr "" -#: ../../library/string.rst:558 +#: ../../library/string.rst:559 msgid "" "Number. This is the same as ``'g'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:562 +#: ../../library/string.rst:563 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/string.rst:562 +#: ../../library/string.rst:563 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) " "format, followed by a percent sign." msgstr "" -#: ../../library/string.rst:565 +#: ../../library/string.rst:566 msgid "" "For :class:`float` this is the same as ``'g'``, except that when fixed-point " "notation is used to format the result, it always includes at least one digit " @@ -803,116 +803,116 @@ msgid "" "represent the given value faithfully." msgstr "" -#: ../../library/string.rst:571 +#: ../../library/string.rst:572 msgid "" "For :class:`~decimal.Decimal`, this is the same as either ``'g'`` or ``'G'`` " "depending on the value of ``context.capitals`` for the current decimal " "context." msgstr "" -#: ../../library/string.rst:575 +#: ../../library/string.rst:576 msgid "" "The overall effect is to match the output of :func:`str` as altered by the " "other format modifiers." msgstr "" -#: ../../library/string.rst:583 +#: ../../library/string.rst:584 msgid "Format examples" msgstr "" -#: ../../library/string.rst:585 +#: ../../library/string.rst:586 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "" -#: ../../library/string.rst:588 +#: ../../library/string.rst:589 msgid "" "In most of the cases the syntax is similar to the old ``%``-formatting, with " "the addition of the ``{}`` and with ``:`` used instead of ``%``. For " "example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``." msgstr "" -#: ../../library/string.rst:592 +#: ../../library/string.rst:593 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "" -#: ../../library/string.rst:595 +#: ../../library/string.rst:596 msgid "Accessing arguments by position::" msgstr "" -#: ../../library/string.rst:608 +#: ../../library/string.rst:609 msgid "Accessing arguments by name::" msgstr "" -#: ../../library/string.rst:616 +#: ../../library/string.rst:617 msgid "Accessing arguments' attributes::" msgstr "" -#: ../../library/string.rst:631 +#: ../../library/string.rst:632 msgid "Accessing arguments' items::" msgstr "" -#: ../../library/string.rst:637 +#: ../../library/string.rst:638 msgid "Replacing ``%s`` and ``%r``::" msgstr "" -#: ../../library/string.rst:642 +#: ../../library/string.rst:643 msgid "Aligning the text and specifying a width::" msgstr "" -#: ../../library/string.rst:653 +#: ../../library/string.rst:654 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "" -#: ../../library/string.rst:662 +#: ../../library/string.rst:663 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "" -#: ../../library/string.rst:671 +#: ../../library/string.rst:672 msgid "Using the comma as a thousands separator::" msgstr "" -#: ../../library/string.rst:676 +#: ../../library/string.rst:677 msgid "Expressing a percentage::" msgstr "" -#: ../../library/string.rst:683 +#: ../../library/string.rst:684 msgid "Using type-specific formatting::" msgstr "" -#: ../../library/string.rst:690 +#: ../../library/string.rst:691 msgid "Nesting arguments and more complex examples::" msgstr "" -#: ../../library/string.rst:724 +#: ../../library/string.rst:725 msgid "Template strings" msgstr "" -#: ../../library/string.rst:726 +#: ../../library/string.rst:727 msgid "" "Template strings provide simpler string substitutions as described in :pep:" "`292`. A primary use case for template strings is for internationalization " "(i18n) since in that context, the simpler syntax and functionality makes it " "easier to translate than other built-in string formatting facilities in " "Python. As an example of a library built on template strings for i18n, see " -"the `flufl.i18n `_ package." +"the `flufl.i18n `_ package." msgstr "" -#: ../../library/string.rst:736 +#: ../../library/string.rst:737 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:738 +#: ../../library/string.rst:739 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:740 +#: ../../library/string.rst:741 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of ``" "\"identifier\"``. By default, ``\"identifier\"`` is restricted to any case-" @@ -921,30 +921,30 @@ msgid "" "after the ``$`` character terminates this placeholder specification." msgstr "" -#: ../../library/string.rst:747 +#: ../../library/string.rst:748 msgid "" "``${identifier}`` is equivalent to ``$identifier``. It is required when " "valid identifier characters follow the placeholder but are not part of the " "placeholder, such as ``\"${noun}ification\"``." msgstr "" -#: ../../library/string.rst:751 +#: ../../library/string.rst:752 msgid "" "Any other appearance of ``$`` in the string will result in a :exc:" "`ValueError` being raised." msgstr "" -#: ../../library/string.rst:754 +#: ../../library/string.rst:755 msgid "" "The :mod:`string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" -#: ../../library/string.rst:760 +#: ../../library/string.rst:761 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:765 +#: ../../library/string.rst:766 msgid "" "Performs the template substitution, returning a new string. *mapping* is " "any dictionary-like object with keys that match the placeholders in the " @@ -953,7 +953,7 @@ msgid "" "there are duplicates, the placeholders from *kwds* take precedence." msgstr "" -#: ../../library/string.rst:774 +#: ../../library/string.rst:775 msgid "" "Like :meth:`substitute`, except that if placeholders are missing from " "*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " @@ -962,7 +962,7 @@ msgid "" "simply return ``$`` instead of raising :exc:`ValueError`." msgstr "" -#: ../../library/string.rst:780 +#: ../../library/string.rst:781 msgid "" "While other exceptions may still occur, this method is called \"safe\" " "because it always tries to return a usable string instead of raising an " @@ -972,21 +972,21 @@ msgid "" "Python identifiers." msgstr "" -#: ../../library/string.rst:787 +#: ../../library/string.rst:788 msgid ":class:`Template` instances also provide one public data attribute:" msgstr "" -#: ../../library/string.rst:791 +#: ../../library/string.rst:792 msgid "" "This is the object passed to the constructor's *template* argument. In " "general, you shouldn't change it, but read-only access is not enforced." msgstr "" -#: ../../library/string.rst:794 +#: ../../library/string.rst:795 msgid "Here is an example of how to use a Template::" msgstr "" -#: ../../library/string.rst:812 +#: ../../library/string.rst:813 msgid "" "Advanced usage: you can derive subclasses of :class:`Template` to customize " "the placeholder syntax, delimiter character, or the entire regular " @@ -994,7 +994,7 @@ msgid "" "these class attributes:" msgstr "" -#: ../../library/string.rst:817 +#: ../../library/string.rst:818 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -1004,7 +1004,7 @@ msgid "" "the subclass's class namespace)." msgstr "" -#: ../../library/string.rst:824 +#: ../../library/string.rst:825 msgid "" "*idpattern* -- This is the regular expression describing the pattern for non-" "braced placeholders. The default value is the regular expression ``(?a:[_a-" @@ -1012,19 +1012,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:831 +#: ../../library/string.rst:832 msgid "" "Since default *flags* is ``re.IGNORECASE``, pattern ``[a-z]`` can match with " "some non-ASCII characters. That's why we use the local ``a`` flag here." msgstr "" -#: ../../library/string.rst:835 +#: ../../library/string.rst:836 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:839 +#: ../../library/string.rst:840 msgid "" "*braceidpattern* -- This is like *idpattern* but describes the pattern for " "braced placeholders. Defaults to ``None`` which means to fall back to " @@ -1033,7 +1033,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:847 +#: ../../library/string.rst:848 msgid "" "*flags* -- The regular expression flags that will be applied when compiling " "the regular expression used for recognizing substitutions. The default " @@ -1042,7 +1042,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:855 +#: ../../library/string.rst:856 msgid "" "Alternatively, you can provide the entire regular expression pattern by " "overriding the class attribute *pattern*. If you do this, the value must be " @@ -1051,35 +1051,35 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:861 +#: ../../library/string.rst:862 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "" -#: ../../library/string.rst:864 +#: ../../library/string.rst:865 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." msgstr "" -#: ../../library/string.rst:867 +#: ../../library/string.rst:868 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." msgstr "" -#: ../../library/string.rst:870 +#: ../../library/string.rst:871 msgid "" "*invalid* -- This group matches any other delimiter pattern (usually a " "single delimiter), and it should appear last in the regular expression." msgstr "" -#: ../../library/string.rst:875 +#: ../../library/string.rst:876 msgid "Helper functions" msgstr "" -#: ../../library/string.rst:879 +#: ../../library/string.rst:880 msgid "" "Split the argument into words using :meth:`str.split`, capitalize each word " "using :meth:`str.capitalize`, and join the capitalized words using :meth:" diff --git a/library/sys.po b/library/sys.po index 76bbb780a5..a96d9ac46e 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-22 00:18+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+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-" @@ -2431,6 +2431,6 @@ msgstr "" #: ../../library/sys.rst:1747 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " -"standard is available at http://www.open-std.org/jtc1/sc22/wg14/www/docs/" +"standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" "n1256.pdf\\ ." msgstr "" diff --git a/library/syslog.po b/library/syslog.po index ecb243de1d..3c4d27803b 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-08-13 00:17+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-" @@ -52,8 +52,8 @@ msgstr "" #: ../../library/syslog.rst:31 msgid "" -"If :func:`openlog` has not been called prior to the call to :func:`syslog`, " -"``openlog()`` will be called with no arguments." +"If :func:`openlog` has not been called prior to the call to :func:`syslog`, :" +"func:`openlog` will be called with no arguments." msgstr "" #: ../../library/syslog.rst:34 @@ -62,14 +62,21 @@ msgid "" "``priority``, ``message``." msgstr "" -#: ../../library/syslog.rst:39 +#: ../../library/syslog.rst:36 +msgid "" +"In previous versions, :func:`openlog` would not be called automatically if " +"it wasn't called prior to the call to :func:`syslog`, deferring to the " +"syslog implementation to call ``openlog()``." +msgstr "" + +#: ../../library/syslog.rst:44 msgid "" "Logging options of subsequent :func:`syslog` calls can be set by calling :" "func:`openlog`. :func:`syslog` will call :func:`openlog` with no arguments " "if the log is not currently open." msgstr "" -#: ../../library/syslog.rst:43 +#: ../../library/syslog.rst:48 msgid "" "The optional *ident* keyword argument is a string which is prepended to " "every message, and defaults to ``sys.argv[0]`` with leading path components " @@ -79,25 +86,24 @@ msgid "" "for messages which do not have a facility explicitly encoded." msgstr "" -#: ../../library/syslog.rst:50 +#: ../../library/syslog.rst:55 msgid "" "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments " "``ident``, ``logoption``, ``facility``." msgstr "" -#: ../../library/syslog.rst:52 +#: ../../library/syslog.rst:57 msgid "" "In previous versions, keyword arguments were not allowed, and *ident* was " -"required. The default for *ident* was dependent on the system libraries, " -"and often was ``python`` instead of the name of the Python program file." +"required." msgstr "" -#: ../../library/syslog.rst:60 +#: ../../library/syslog.rst:64 msgid "" "Reset the syslog module values and call the system library ``closelog()``." msgstr "" -#: ../../library/syslog.rst:62 +#: ../../library/syslog.rst:66 msgid "" "This causes the module to behave as it does when initially imported. For " "example, :func:`openlog` will be called on the first :func:`syslog` call " @@ -105,13 +111,13 @@ msgid "" "`openlog` parameters are reset to defaults." msgstr "" -#: ../../library/syslog.rst:67 +#: ../../library/syslog.rst:71 msgid "" "Raises an :ref:`auditing event ` ``syslog.closelog`` with no " "arguments." msgstr "" -#: ../../library/syslog.rst:72 +#: ../../library/syslog.rst:76 msgid "" "Set the priority mask to *maskpri* and return the previous mask value. " "Calls to :func:`syslog` with a priority level not set in *maskpri* are " @@ -121,32 +127,32 @@ msgid "" "and including *pri*." msgstr "" -#: ../../library/syslog.rst:79 +#: ../../library/syslog.rst:83 msgid "" "Raises an :ref:`auditing event ` ``syslog.setlogmask`` with " "argument ``maskpri``." msgstr "" -#: ../../library/syslog.rst:81 +#: ../../library/syslog.rst:85 msgid "The module defines the following constants:" msgstr "" -#: ../../library/syslog.rst:86 +#: ../../library/syslog.rst:90 msgid "Priority levels (high to low):" msgstr "" -#: ../../library/syslog.rst:84 +#: ../../library/syslog.rst:88 msgid "" ":const:`LOG_EMERG`, :const:`LOG_ALERT`, :const:`LOG_CRIT`, :const:" "`LOG_ERR`, :const:`LOG_WARNING`, :const:`LOG_NOTICE`, :const:`LOG_INFO`, :" "const:`LOG_DEBUG`." msgstr "" -#: ../../library/syslog.rst:93 +#: ../../library/syslog.rst:97 msgid "Facilities:" msgstr "" -#: ../../library/syslog.rst:89 +#: ../../library/syslog.rst:93 msgid "" ":const:`LOG_KERN`, :const:`LOG_USER`, :const:`LOG_MAIL`, :const:" "`LOG_DAEMON`, :const:`LOG_AUTH`, :const:`LOG_LPR`, :const:`LOG_NEWS`, :const:" @@ -154,33 +160,33 @@ msgid "" "const:`LOG_LOCAL7`, and, if defined in ````, :const:`LOG_AUTHPRIV`." msgstr "" -#: ../../library/syslog.rst:99 +#: ../../library/syslog.rst:103 msgid "Log options:" msgstr "" -#: ../../library/syslog.rst:96 +#: ../../library/syslog.rst:100 msgid "" ":const:`LOG_PID`, :const:`LOG_CONS`, :const:`LOG_NDELAY`, and, if defined in " "````, :const:`LOG_ODELAY`, :const:`LOG_NOWAIT`, and :const:" "`LOG_PERROR`." msgstr "" -#: ../../library/syslog.rst:102 +#: ../../library/syslog.rst:106 msgid "Examples" msgstr "範例" -#: ../../library/syslog.rst:105 +#: ../../library/syslog.rst:109 msgid "Simple example" msgstr "簡單範例" -#: ../../library/syslog.rst:107 +#: ../../library/syslog.rst:111 msgid "A simple set of examples::" msgstr "" "一組簡單範例:\n" "\n" "::" -#: ../../library/syslog.rst:115 +#: ../../library/syslog.rst:119 msgid "" "An example of setting some log options, these would include the process ID " "in logged messages, and write the messages to the destination facility used " diff --git a/library/threading.po b/library/threading.po index 82ad0fd7eb..048967f403 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-05 00:12+0000\n" +"POT-Creation-Date: 2022-08-22 00:19+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-" @@ -29,7 +29,7 @@ msgstr "**原始碼:**\\ :source:`Lib/threading.py`" #: ../../library/threading.rst:11 msgid "" "This module constructs higher-level threading interfaces on top of the lower " -"level :mod:`_thread` module. See also the :mod:`queue` module." +"level :mod:`_thread` module." msgstr "" #: ../../library/threading.rst:14 @@ -38,12 +38,32 @@ msgstr "" #: ../../library/threading.rst:19 msgid "" +":class:`concurrent.futures.ThreadPoolExecutor` offers a higher level " +"interface to push tasks to a background thread without blocking execution of " +"the calling thread, while still being able to retrieve their results when " +"needed." +msgstr "" + +#: ../../library/threading.rst:23 +msgid "" +":mod:`queue` provides a thread-safe interface for exchanging data between " +"running threads." +msgstr "" + +#: ../../library/threading.rst:26 +msgid "" +":mod:`asyncio` offers an alternative approach to achieving task level " +"concurrency without requiring the use of multiple operating system threads." +msgstr "" + +#: ../../library/threading.rst:31 +msgid "" "In the Python 2.x series, this module contained ``camelCase`` names for some " "methods and functions. These are deprecated as of Python 3.10, but they are " "still supported for compatibility with Python 2.5 and lower." msgstr "" -#: ../../library/threading.rst:26 +#: ../../library/threading.rst:38 msgid "" "In CPython, due to the :term:`Global Interpreter Lock `, only one thread can execute Python code at once (even though certain " @@ -54,21 +74,21 @@ msgid "" "appropriate model if you want to run multiple I/O-bound tasks simultaneously." msgstr "" -#: ../../library/threading.rst:37 +#: ../../library/threading.rst:49 msgid "This module defines the following functions:" msgstr "" -#: ../../library/threading.rst:42 +#: ../../library/threading.rst:54 msgid "" "Return the number of :class:`Thread` objects currently alive. The returned " "count is equal to the length of the list returned by :func:`.enumerate`." msgstr "" -#: ../../library/threading.rst:45 +#: ../../library/threading.rst:57 msgid "The function ``activeCount`` is a deprecated alias for this function." msgstr "" -#: ../../library/threading.rst:50 +#: ../../library/threading.rst:62 msgid "" "Return the current :class:`Thread` object, corresponding to the caller's " "thread of control. If the caller's thread of control was not created " @@ -76,78 +96,78 @@ msgid "" "functionality is returned." msgstr "" -#: ../../library/threading.rst:55 +#: ../../library/threading.rst:67 msgid "The function ``currentThread`` is a deprecated alias for this function." msgstr "" -#: ../../library/threading.rst:60 +#: ../../library/threading.rst:72 msgid "Handle uncaught exception raised by :func:`Thread.run`." msgstr "" -#: ../../library/threading.rst:62 +#: ../../library/threading.rst:74 msgid "The *args* argument has the following attributes:" msgstr "" -#: ../../library/threading.rst:64 +#: ../../library/threading.rst:76 msgid "*exc_type*: Exception type." msgstr "" -#: ../../library/threading.rst:65 +#: ../../library/threading.rst:77 msgid "*exc_value*: Exception value, can be ``None``." msgstr "" -#: ../../library/threading.rst:66 +#: ../../library/threading.rst:78 msgid "*exc_traceback*: Exception traceback, can be ``None``." msgstr "" -#: ../../library/threading.rst:67 +#: ../../library/threading.rst:79 msgid "*thread*: Thread which raised the exception, can be ``None``." msgstr "" -#: ../../library/threading.rst:69 +#: ../../library/threading.rst:81 msgid "" "If *exc_type* is :exc:`SystemExit`, the exception is silently ignored. " "Otherwise, the exception is printed out on :data:`sys.stderr`." msgstr "" -#: ../../library/threading.rst:72 +#: ../../library/threading.rst:84 msgid "" "If this function raises an exception, :func:`sys.excepthook` is called to " "handle it." msgstr "" -#: ../../library/threading.rst:75 +#: ../../library/threading.rst:87 msgid "" ":func:`threading.excepthook` can be overridden to control how uncaught " "exceptions raised by :func:`Thread.run` are handled." msgstr "" -#: ../../library/threading.rst:78 +#: ../../library/threading.rst:90 msgid "" "Storing *exc_value* using a custom hook can create a reference cycle. It " "should be cleared explicitly to break the reference cycle when the exception " "is no longer needed." msgstr "" -#: ../../library/threading.rst:82 +#: ../../library/threading.rst:94 msgid "" "Storing *thread* using a custom hook can resurrect it if it is set to an " "object which is being finalized. Avoid storing *thread* after the custom " "hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/threading.rst:87 +#: ../../library/threading.rst:99 msgid ":func:`sys.excepthook` handles uncaught exceptions." msgstr "" -#: ../../library/threading.rst:93 +#: ../../library/threading.rst:105 msgid "" "Holds the original value of :func:`threading.excepthook`. It is saved so " "that the original value can be restored in case they happen to get replaced " "with broken or alternative objects." msgstr "" -#: ../../library/threading.rst:101 +#: ../../library/threading.rst:113 msgid "" "Return the 'thread identifier' of the current thread. This is a nonzero " "integer. Its value has no direct meaning; it is intended as a magic cookie " @@ -156,7 +176,7 @@ msgid "" "created." msgstr "" -#: ../../library/threading.rst:112 +#: ../../library/threading.rst:124 msgid "" "Return the native integral Thread ID of the current thread assigned by the " "kernel. This is a non-negative integer. Its value may be used to uniquely " @@ -164,13 +184,13 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/threading.rst:118 +#: ../../library/threading.rst:130 msgid "" ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " "NetBSD, AIX." msgstr "" -#: ../../library/threading.rst:124 +#: ../../library/threading.rst:136 msgid "" "Return a list of all :class:`Thread` objects currently active. The list " "includes daemonic threads and dummy thread objects created by :func:" @@ -179,35 +199,35 @@ msgid "" "even when terminated." msgstr "" -#: ../../library/threading.rst:133 +#: ../../library/threading.rst:145 msgid "" "Return the main :class:`Thread` object. In normal conditions, the main " "thread is the thread from which the Python interpreter was started." msgstr "" -#: ../../library/threading.rst:144 +#: ../../library/threading.rst:156 msgid "" "Set a trace function for all threads started from the :mod:`threading` " "module. The *func* will be passed to :func:`sys.settrace` for each thread, " "before its :meth:`~Thread.run` method is called." msgstr "" -#: ../../library/threading.rst:155 +#: ../../library/threading.rst:167 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/threading.rst:164 +#: ../../library/threading.rst:176 msgid "" "Set a profile function for all threads started from the :mod:`threading` " "module. The *func* will be passed to :func:`sys.setprofile` for each " "thread, before its :meth:`~Thread.run` method is called." msgstr "" -#: ../../library/threading.rst:173 +#: ../../library/threading.rst:185 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/threading.rst:180 +#: ../../library/threading.rst:192 msgid "" "Return the thread stack size used when creating new threads. The optional " "*size* argument specifies the stack size to be used for subsequently created " @@ -226,16 +246,16 @@ msgid "" "information)." msgstr "" -#: ../../library/threading.rst:195 +#: ../../library/threading.rst:207 msgid "" ":ref:`Availability `: Windows, systems with POSIX threads." msgstr "" -#: ../../library/threading.rst:198 +#: ../../library/threading.rst:210 msgid "This module also defines the following constant:" msgstr "" -#: ../../library/threading.rst:202 +#: ../../library/threading.rst:214 msgid "" "The maximum value allowed for the *timeout* parameter of blocking functions " "(:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition.wait`, etc.). " @@ -243,13 +263,13 @@ msgid "" "`OverflowError`." msgstr "" -#: ../../library/threading.rst:210 +#: ../../library/threading.rst:222 msgid "" "This module defines a number of classes, which are detailed in the sections " "below." msgstr "" -#: ../../library/threading.rst:213 +#: ../../library/threading.rst:225 msgid "" "The design of this module is loosely based on Java's threading model. " "However, where Java makes locks and condition variables basic behavior of " @@ -260,40 +280,40 @@ msgid "" "Thread class, when implemented, are mapped to module-level functions." msgstr "" -#: ../../library/threading.rst:221 +#: ../../library/threading.rst:233 msgid "All of the methods described below are executed atomically." msgstr "" -#: ../../library/threading.rst:225 +#: ../../library/threading.rst:237 msgid "Thread-Local Data" msgstr "" -#: ../../library/threading.rst:227 +#: ../../library/threading.rst:239 msgid "" "Thread-local data is data whose values are thread specific. To manage " "thread-local data, just create an instance of :class:`local` (or a subclass) " "and store attributes on it::" msgstr "" -#: ../../library/threading.rst:234 +#: ../../library/threading.rst:246 msgid "The instance's values will be different for separate threads." msgstr "" -#: ../../library/threading.rst:239 +#: ../../library/threading.rst:251 msgid "A class that represents thread-local data." msgstr "" -#: ../../library/threading.rst:241 +#: ../../library/threading.rst:253 msgid "" "For more details and extensive examples, see the documentation string of " "the :mod:`_threading_local` module." msgstr "" -#: ../../library/threading.rst:248 +#: ../../library/threading.rst:260 msgid "Thread Objects" msgstr "" -#: ../../library/threading.rst:250 +#: ../../library/threading.rst:262 msgid "" "The :class:`Thread` class represents an activity that is run in a separate " "thread of control. There are two ways to specify the activity: by passing a " @@ -303,14 +323,14 @@ msgid "" "`~Thread.__init__` and :meth:`~Thread.run` methods of this class." msgstr "" -#: ../../library/threading.rst:257 +#: ../../library/threading.rst:269 msgid "" "Once a thread object is created, its activity must be started by calling the " "thread's :meth:`~Thread.start` method. This invokes the :meth:`~Thread.run` " "method in a separate thread of control." msgstr "" -#: ../../library/threading.rst:261 +#: ../../library/threading.rst:273 msgid "" "Once the thread's activity is started, the thread is considered 'alive'. It " "stops being alive when its :meth:`~Thread.run` method terminates -- either " @@ -318,27 +338,27 @@ msgid "" "is_alive` method tests whether the thread is alive." msgstr "" -#: ../../library/threading.rst:266 +#: ../../library/threading.rst:278 msgid "" "Other threads can call a thread's :meth:`~Thread.join` method. This blocks " "the calling thread until the thread whose :meth:`~Thread.join` method is " "called is terminated." msgstr "" -#: ../../library/threading.rst:270 +#: ../../library/threading.rst:282 msgid "" "A thread has a name. The name can be passed to the constructor, and read or " "changed through the :attr:`~Thread.name` attribute." msgstr "" -#: ../../library/threading.rst:273 +#: ../../library/threading.rst:285 msgid "" "If the :meth:`~Thread.run` method raises an exception, :func:`threading." "excepthook` is called to handle it. By default, :func:`threading.excepthook` " "ignores silently :exc:`SystemExit`." msgstr "" -#: ../../library/threading.rst:277 +#: ../../library/threading.rst:289 msgid "" "A thread can be flagged as a \"daemon thread\". The significance of this " "flag is that the entire Python program exits when only daemon threads are " @@ -347,7 +367,7 @@ msgid "" "constructor argument." msgstr "" -#: ../../library/threading.rst:284 +#: ../../library/threading.rst:296 msgid "" "Daemon threads are abruptly stopped at shutdown. Their resources (such as " "open files, database transactions, etc.) may not be released properly. If " @@ -355,13 +375,13 @@ msgid "" "suitable signalling mechanism such as an :class:`Event`." msgstr "" -#: ../../library/threading.rst:289 +#: ../../library/threading.rst:301 msgid "" "There is a \"main thread\" object; this corresponds to the initial thread of " "control in the Python program. It is not a daemon thread." msgstr "" -#: ../../library/threading.rst:292 +#: ../../library/threading.rst:304 msgid "" "There is the possibility that \"dummy thread objects\" are created. These " "are thread objects corresponding to \"alien threads\", which are threads of " @@ -371,25 +391,25 @@ msgid "" "deleted, since it is impossible to detect the termination of alien threads." msgstr "" -#: ../../library/threading.rst:303 +#: ../../library/threading.rst:315 msgid "" "This constructor should always be called with keyword arguments. Arguments " "are:" msgstr "" -#: ../../library/threading.rst:306 +#: ../../library/threading.rst:318 msgid "" "*group* should be ``None``; reserved for future extension when a :class:" "`ThreadGroup` class is implemented." msgstr "" -#: ../../library/threading.rst:309 +#: ../../library/threading.rst:321 msgid "" "*target* is the callable object to be invoked by the :meth:`run` method. " "Defaults to ``None``, meaning nothing is called." msgstr "" -#: ../../library/threading.rst:312 +#: ../../library/threading.rst:324 msgid "" "*name* is the thread name. By default, a unique name is constructed of the " "form \"Thread-*N*\" where *N* is a small decimal number, or \"Thread-*N* " @@ -397,61 +417,61 @@ msgid "" "is specified." msgstr "" -#: ../../library/threading.rst:317 +#: ../../library/threading.rst:329 msgid "" "*args* is the argument tuple for the target invocation. Defaults to ``()``." msgstr "" -#: ../../library/threading.rst:319 +#: ../../library/threading.rst:331 msgid "" "*kwargs* is a dictionary of keyword arguments for the target invocation. " "Defaults to ``{}``." msgstr "" -#: ../../library/threading.rst:322 +#: ../../library/threading.rst:334 msgid "" "If not ``None``, *daemon* explicitly sets whether the thread is daemonic. If " "``None`` (the default), the daemonic property is inherited from the current " "thread." msgstr "" -#: ../../library/threading.rst:326 +#: ../../library/threading.rst:338 msgid "" "If the subclass overrides the constructor, it must make sure to invoke the " "base class constructor (``Thread.__init__()``) before doing anything else to " "the thread." msgstr "" -#: ../../library/threading.rst:330 +#: ../../library/threading.rst:342 msgid "Use the *target* name if *name* argument is omitted." msgstr "" -#: ../../library/threading.rst:333 +#: ../../library/threading.rst:345 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/threading.rst:338 +#: ../../library/threading.rst:350 msgid "Start the thread's activity." msgstr "" -#: ../../library/threading.rst:340 +#: ../../library/threading.rst:352 msgid "" "It must be called at most once per thread object. It arranges for the " "object's :meth:`~Thread.run` method to be invoked in a separate thread of " "control." msgstr "" -#: ../../library/threading.rst:344 +#: ../../library/threading.rst:356 msgid "" "This method will raise a :exc:`RuntimeError` if called more than once on the " "same thread object." msgstr "" -#: ../../library/threading.rst:349 +#: ../../library/threading.rst:361 msgid "Method representing the thread's activity." msgstr "" -#: ../../library/threading.rst:351 +#: ../../library/threading.rst:363 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the " @@ -459,7 +479,7 @@ msgid "" "the *args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/threading.rst:358 +#: ../../library/threading.rst:370 msgid "" "Wait until the thread terminates. This blocks the calling thread until the " "thread whose :meth:`~Thread.join` method is called terminates -- either " @@ -467,7 +487,7 @@ msgid "" "occurs." msgstr "" -#: ../../library/threading.rst:363 +#: ../../library/threading.rst:375 msgid "" "When the *timeout* argument is present and not ``None``, it should be a " "floating point number specifying a timeout for the operation in seconds (or " @@ -477,17 +497,17 @@ msgid "" "`~Thread.join` call timed out." msgstr "" -#: ../../library/threading.rst:370 +#: ../../library/threading.rst:382 msgid "" "When the *timeout* argument is not present or ``None``, the operation will " "block until the thread terminates." msgstr "" -#: ../../library/threading.rst:373 +#: ../../library/threading.rst:385 msgid "A thread can be :meth:`~Thread.join`\\ ed many times." msgstr "" -#: ../../library/threading.rst:375 +#: ../../library/threading.rst:387 msgid "" ":meth:`~Thread.join` raises a :exc:`RuntimeError` if an attempt is made to " "join the current thread as that would cause a deadlock. It is also an error " @@ -495,20 +515,20 @@ msgid "" "do so raise the same exception." msgstr "" -#: ../../library/threading.rst:382 +#: ../../library/threading.rst:394 msgid "" "A string used for identification purposes only. It has no semantics. " "Multiple threads may be given the same name. The initial name is set by the " "constructor." msgstr "" -#: ../../library/threading.rst:389 +#: ../../library/threading.rst:401 msgid "" "Deprecated getter/setter API for :attr:`~Thread.name`; use it directly as a " "property instead." msgstr "" -#: ../../library/threading.rst:396 +#: ../../library/threading.rst:408 msgid "" "The 'thread identifier' of this thread or ``None`` if the thread has not " "been started. This is a nonzero integer. See the :func:`get_ident` " @@ -517,7 +537,7 @@ msgid "" "thread has exited." msgstr "" -#: ../../library/threading.rst:404 +#: ../../library/threading.rst:416 msgid "" "The Thread ID (``TID``) of this thread, as assigned by the OS (kernel). This " "is a non-negative integer, or ``None`` if the thread has not been started. " @@ -526,30 +546,30 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/threading.rst:413 +#: ../../library/threading.rst:425 msgid "" "Similar to Process IDs, Thread IDs are only valid (guaranteed unique system-" "wide) from the time the thread is created until the thread has been " "terminated." msgstr "" -#: ../../library/threading.rst:418 +#: ../../library/threading.rst:430 msgid "" ":ref:`Availability `: Requires :func:`get_native_id` function." msgstr "" -#: ../../library/threading.rst:423 +#: ../../library/threading.rst:435 msgid "Return whether the thread is alive." msgstr "" -#: ../../library/threading.rst:425 +#: ../../library/threading.rst:437 msgid "" "This method returns ``True`` just before the :meth:`~Thread.run` method " "starts until just after the :meth:`~Thread.run` method terminates. The " "module function :func:`.enumerate` returns a list of all alive threads." msgstr "" -#: ../../library/threading.rst:431 +#: ../../library/threading.rst:443 msgid "" "A boolean value indicating whether this thread is a daemon thread (``True``) " "or not (``False``). This must be set before :meth:`~Thread.start` is " @@ -559,22 +579,22 @@ msgid "" "`~Thread.daemon` = ``False``." msgstr "" -#: ../../library/threading.rst:438 +#: ../../library/threading.rst:450 msgid "" "The entire Python program exits when no alive non-daemon threads are left." msgstr "" -#: ../../library/threading.rst:443 +#: ../../library/threading.rst:455 msgid "" "Deprecated getter/setter API for :attr:`~Thread.daemon`; use it directly as " "a property instead." msgstr "" -#: ../../library/threading.rst:452 +#: ../../library/threading.rst:464 msgid "Lock Objects" msgstr "" -#: ../../library/threading.rst:454 +#: ../../library/threading.rst:466 msgid "" "A primitive lock is a synchronization primitive that is not owned by a " "particular thread when locked. In Python, it is currently the lowest level " @@ -582,7 +602,7 @@ msgid "" "`_thread` extension module." msgstr "" -#: ../../library/threading.rst:459 +#: ../../library/threading.rst:471 msgid "" "A primitive lock is in one of two states, \"locked\" or \"unlocked\". It is " "created in the unlocked state. It has two basic methods, :meth:`~Lock." @@ -596,11 +616,11 @@ msgid "" "an unlocked lock, a :exc:`RuntimeError` will be raised." msgstr "" -#: ../../library/threading.rst:470 +#: ../../library/threading.rst:482 msgid "Locks also support the :ref:`context management protocol `." msgstr "" -#: ../../library/threading.rst:472 +#: ../../library/threading.rst:484 msgid "" "When more than one thread is blocked in :meth:`~Lock.acquire` waiting for " "the state to turn to unlocked, only one thread proceeds when a :meth:`~Lock." @@ -608,42 +628,42 @@ msgid "" "proceeds is not defined, and may vary across implementations." msgstr "" -#: ../../library/threading.rst:477 +#: ../../library/threading.rst:489 msgid "All methods are executed atomically." msgstr "" -#: ../../library/threading.rst:482 +#: ../../library/threading.rst:494 msgid "" "The class implementing primitive lock objects. Once a thread has acquired a " "lock, subsequent attempts to acquire it block, until it is released; any " "thread may release it." msgstr "" -#: ../../library/threading.rst:486 +#: ../../library/threading.rst:498 msgid "" "Note that ``Lock`` is actually a factory function which returns an instance " "of the most efficient version of the concrete Lock class that is supported " "by the platform." msgstr "" -#: ../../library/threading.rst:493 ../../library/threading.rst:573 +#: ../../library/threading.rst:505 ../../library/threading.rst:585 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/threading.rst:495 +#: ../../library/threading.rst:507 msgid "" "When invoked with the *blocking* argument set to ``True`` (the default), " "block until the lock is unlocked, then set it to locked and return ``True``." msgstr "" -#: ../../library/threading.rst:498 +#: ../../library/threading.rst:510 msgid "" "When invoked with the *blocking* argument set to ``False``, do not block. If " "a call with *blocking* set to ``True`` would block, return ``False`` " "immediately; otherwise, set the lock to locked and return ``True``." msgstr "" -#: ../../library/threading.rst:502 +#: ../../library/threading.rst:514 msgid "" "When invoked with the floating-point *timeout* argument set to a positive " "value, block for at most the number of seconds specified by *timeout* and as " @@ -652,53 +672,53 @@ msgid "" "*blocking* is ``False``." msgstr "" -#: ../../library/threading.rst:508 +#: ../../library/threading.rst:520 msgid "" "The return value is ``True`` if the lock is acquired successfully, ``False`` " "if not (for example if the *timeout* expired)." msgstr "" -#: ../../library/threading.rst:511 ../../library/threading.rst:595 -#: ../../library/threading.rst:842 +#: ../../library/threading.rst:523 ../../library/threading.rst:607 +#: ../../library/threading.rst:854 msgid "The *timeout* parameter is new." msgstr "" -#: ../../library/threading.rst:514 +#: ../../library/threading.rst:526 msgid "" "Lock acquisition can now be interrupted by signals on POSIX if the " "underlying threading implementation supports it." msgstr "" -#: ../../library/threading.rst:521 +#: ../../library/threading.rst:533 msgid "" "Release a lock. This can be called from any thread, not only the thread " "which has acquired the lock." msgstr "" -#: ../../library/threading.rst:524 +#: ../../library/threading.rst:536 msgid "" "When the lock is locked, reset it to unlocked, and return. If any other " "threads are blocked waiting for the lock to become unlocked, allow exactly " "one of them to proceed." msgstr "" -#: ../../library/threading.rst:528 +#: ../../library/threading.rst:540 msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised." msgstr "" -#: ../../library/threading.rst:530 ../../library/threading.rst:611 +#: ../../library/threading.rst:542 ../../library/threading.rst:623 msgid "There is no return value." msgstr "" -#: ../../library/threading.rst:534 +#: ../../library/threading.rst:546 msgid "Return ``True`` if the lock is acquired." msgstr "" -#: ../../library/threading.rst:541 +#: ../../library/threading.rst:553 msgid "RLock Objects" msgstr "RLock 物件" -#: ../../library/threading.rst:543 +#: ../../library/threading.rst:555 msgid "" "A reentrant lock is a synchronization primitive that may be acquired " "multiple times by the same thread. Internally, it uses the concepts of " @@ -707,7 +727,7 @@ msgid "" "lock; in the unlocked state, no thread owns it." msgstr "" -#: ../../library/threading.rst:549 +#: ../../library/threading.rst:561 msgid "" "To lock the lock, a thread calls its :meth:`~RLock.acquire` method; this " "returns once the thread owns the lock. To unlock the lock, a thread calls " @@ -718,13 +738,13 @@ msgid "" "proceed." msgstr "" -#: ../../library/threading.rst:556 +#: ../../library/threading.rst:568 msgid "" "Reentrant locks also support the :ref:`context management protocol `." msgstr "" -#: ../../library/threading.rst:561 +#: ../../library/threading.rst:573 msgid "" "This class implements reentrant lock objects. A reentrant lock must be " "released by the thread that acquired it. Once a thread has acquired a " @@ -732,14 +752,14 @@ msgid "" "thread must release it once for each time it has acquired it." msgstr "" -#: ../../library/threading.rst:566 +#: ../../library/threading.rst:578 msgid "" "Note that ``RLock`` is actually a factory function which returns an instance " "of the most efficient version of the concrete RLock class that is supported " "by the platform." msgstr "" -#: ../../library/threading.rst:575 +#: ../../library/threading.rst:587 msgid "" "When invoked without arguments: if this thread already owns the lock, " "increment the recursion level by one, and return immediately. Otherwise, if " @@ -750,13 +770,13 @@ msgid "" "ownership of the lock. There is no return value in this case." msgstr "" -#: ../../library/threading.rst:583 +#: ../../library/threading.rst:595 msgid "" "When invoked with the *blocking* argument set to ``True``, do the same thing " "as when called without arguments, and return ``True``." msgstr "" -#: ../../library/threading.rst:586 +#: ../../library/threading.rst:598 msgid "" "When invoked with the *blocking* argument set to ``False``, do not block. " "If a call without an argument would block, return ``False`` immediately; " @@ -764,7 +784,7 @@ msgid "" "``True``." msgstr "" -#: ../../library/threading.rst:590 +#: ../../library/threading.rst:602 msgid "" "When invoked with the floating-point *timeout* argument set to a positive " "value, block for at most the number of seconds specified by *timeout* and as " @@ -772,7 +792,7 @@ msgid "" "acquired, ``False`` if the timeout has elapsed." msgstr "" -#: ../../library/threading.rst:601 +#: ../../library/threading.rst:613 msgid "" "Release a lock, decrementing the recursion level. If after the decrement it " "is zero, reset the lock to unlocked (not owned by any thread), and if any " @@ -781,17 +801,17 @@ msgid "" "is still nonzero, the lock remains locked and owned by the calling thread." msgstr "" -#: ../../library/threading.rst:607 +#: ../../library/threading.rst:619 msgid "" "Only call this method when the calling thread owns the lock. A :exc:" "`RuntimeError` is raised if this method is called when the lock is unlocked." msgstr "" -#: ../../library/threading.rst:617 +#: ../../library/threading.rst:629 msgid "Condition Objects" msgstr "" -#: ../../library/threading.rst:619 +#: ../../library/threading.rst:631 msgid "" "A condition variable is always associated with some kind of lock; this can " "be passed in or one will be created by default. Passing one in is useful " @@ -799,7 +819,7 @@ msgid "" "of the condition object: you don't have to track it separately." msgstr "" -#: ../../library/threading.rst:624 +#: ../../library/threading.rst:636 msgid "" "A condition variable obeys the :ref:`context management protocol `: using the ``with`` statement acquires the associated lock for the " @@ -808,7 +828,7 @@ msgid "" "associated lock." msgstr "" -#: ../../library/threading.rst:630 +#: ../../library/threading.rst:642 msgid "" "Other methods must be called with the associated lock held. The :meth:" "`~Condition.wait` method releases the lock, and then blocks until another " @@ -817,14 +837,14 @@ msgid "" "and returns. It is also possible to specify a timeout." msgstr "" -#: ../../library/threading.rst:636 +#: ../../library/threading.rst:648 msgid "" "The :meth:`~Condition.notify` method wakes up one of the threads waiting for " "the condition variable, if any are waiting. The :meth:`~Condition." "notify_all` method wakes up all threads waiting for the condition variable." msgstr "" -#: ../../library/threading.rst:640 +#: ../../library/threading.rst:652 msgid "" "Note: the :meth:`~Condition.notify` and :meth:`~Condition.notify_all` " "methods don't release the lock; this means that the thread or threads " @@ -833,7 +853,7 @@ msgid "" "or :meth:`~Condition.notify_all` finally relinquishes ownership of the lock." msgstr "" -#: ../../library/threading.rst:646 +#: ../../library/threading.rst:658 msgid "" "The typical programming style using condition variables uses the lock to " "synchronize access to some shared state; threads that are interested in a " @@ -845,7 +865,7 @@ msgid "" "situation with unlimited buffer capacity::" msgstr "" -#: ../../library/threading.rst:666 +#: ../../library/threading.rst:678 msgid "" "The ``while`` loop checking for the application's condition is necessary " "because :meth:`~Condition.wait` can return after an arbitrary long time, and " @@ -855,7 +875,7 @@ msgid "" "checking, and eases the computation of timeouts::" msgstr "" -#: ../../library/threading.rst:678 +#: ../../library/threading.rst:690 msgid "" "To choose between :meth:`~Condition.notify` and :meth:`~Condition." "notify_all`, consider whether one state change can be interesting for only " @@ -864,45 +884,45 @@ msgid "" "thread." msgstr "" -#: ../../library/threading.rst:686 +#: ../../library/threading.rst:698 msgid "" "This class implements condition variable objects. A condition variable " "allows one or more threads to wait until they are notified by another thread." msgstr "" -#: ../../library/threading.rst:689 +#: ../../library/threading.rst:701 msgid "" "If the *lock* argument is given and not ``None``, it must be a :class:`Lock` " "or :class:`RLock` object, and it is used as the underlying lock. Otherwise, " "a new :class:`RLock` object is created and used as the underlying lock." msgstr "" -#: ../../library/threading.rst:693 ../../library/threading.rst:817 -#: ../../library/threading.rst:863 ../../library/threading.rst:915 -#: ../../library/threading.rst:986 +#: ../../library/threading.rst:705 ../../library/threading.rst:829 +#: ../../library/threading.rst:875 ../../library/threading.rst:927 +#: ../../library/threading.rst:998 msgid "changed from a factory function to a class." msgstr "" -#: ../../library/threading.rst:698 +#: ../../library/threading.rst:710 msgid "" "Acquire the underlying lock. This method calls the corresponding method on " "the underlying lock; the return value is whatever that method returns." msgstr "" -#: ../../library/threading.rst:703 +#: ../../library/threading.rst:715 msgid "" "Release the underlying lock. This method calls the corresponding method on " "the underlying lock; there is no return value." msgstr "" -#: ../../library/threading.rst:708 +#: ../../library/threading.rst:720 msgid "" "Wait until notified or until a timeout occurs. If the calling thread has not " "acquired the lock when this method is called, a :exc:`RuntimeError` is " "raised." msgstr "" -#: ../../library/threading.rst:712 +#: ../../library/threading.rst:724 msgid "" "This method releases the underlying lock, and then blocks until it is " "awakened by a :meth:`notify` or :meth:`notify_all` call for the same " @@ -910,14 +930,14 @@ msgid "" "Once awakened or timed out, it re-acquires the lock and returns." msgstr "" -#: ../../library/threading.rst:717 +#: ../../library/threading.rst:729 msgid "" "When the *timeout* argument is present and not ``None``, it should be a " "floating point number specifying a timeout for the operation in seconds (or " "fractions thereof)." msgstr "" -#: ../../library/threading.rst:721 +#: ../../library/threading.rst:733 msgid "" "When the underlying lock is an :class:`RLock`, it is not released using its :" "meth:`release` method, since this may not actually unlock the lock when it " @@ -927,24 +947,24 @@ msgid "" "used to restore the recursion level when the lock is reacquired." msgstr "" -#: ../../library/threading.rst:729 +#: ../../library/threading.rst:741 msgid "" "The return value is ``True`` unless a given *timeout* expired, in which case " "it is ``False``." msgstr "" -#: ../../library/threading.rst:732 ../../library/threading.rst:951 +#: ../../library/threading.rst:744 ../../library/threading.rst:963 msgid "Previously, the method always returned ``None``." msgstr "" -#: ../../library/threading.rst:737 +#: ../../library/threading.rst:749 msgid "" "Wait until a condition evaluates to true. *predicate* should be a callable " "which result will be interpreted as a boolean value. A *timeout* may be " "provided giving the maximum time to wait." msgstr "" -#: ../../library/threading.rst:741 +#: ../../library/threading.rst:753 msgid "" "This utility method may call :meth:`wait` repeatedly until the predicate is " "satisfied, or until a timeout occurs. The return value is the last return " @@ -952,33 +972,33 @@ msgid "" "out." msgstr "" -#: ../../library/threading.rst:746 +#: ../../library/threading.rst:758 msgid "" "Ignoring the timeout feature, calling this method is roughly equivalent to " "writing::" msgstr "" -#: ../../library/threading.rst:752 +#: ../../library/threading.rst:764 msgid "" "Therefore, the same rules apply as with :meth:`wait`: The lock must be held " "when called and is re-acquired on return. The predicate is evaluated with " "the lock held." msgstr "" -#: ../../library/threading.rst:760 +#: ../../library/threading.rst:772 msgid "" "By default, wake up one thread waiting on this condition, if any. If the " "calling thread has not acquired the lock when this method is called, a :exc:" "`RuntimeError` is raised." msgstr "" -#: ../../library/threading.rst:764 +#: ../../library/threading.rst:776 msgid "" "This method wakes up at most *n* of the threads waiting for the condition " "variable; it is a no-op if no threads are waiting." msgstr "" -#: ../../library/threading.rst:767 +#: ../../library/threading.rst:779 msgid "" "The current implementation wakes up exactly *n* threads, if at least *n* " "threads are waiting. However, it's not safe to rely on this behavior. A " @@ -986,14 +1006,14 @@ msgid "" "threads." msgstr "" -#: ../../library/threading.rst:772 +#: ../../library/threading.rst:784 msgid "" "Note: an awakened thread does not actually return from its :meth:`wait` call " "until it can reacquire the lock. Since :meth:`notify` does not release the " "lock, its caller should." msgstr "" -#: ../../library/threading.rst:778 +#: ../../library/threading.rst:790 msgid "" "Wake up all threads waiting on this condition. This method acts like :meth:" "`notify`, but wakes up all waiting threads instead of one. If the calling " @@ -1001,15 +1021,15 @@ msgid "" "`RuntimeError` is raised." msgstr "" -#: ../../library/threading.rst:783 +#: ../../library/threading.rst:795 msgid "The method ``notifyAll`` is a deprecated alias for this method." msgstr "" -#: ../../library/threading.rst:789 +#: ../../library/threading.rst:801 msgid "Semaphore Objects" msgstr "" -#: ../../library/threading.rst:791 +#: ../../library/threading.rst:803 msgid "" "This is one of the oldest synchronization primitives in the history of " "computer science, invented by the early Dutch computer scientist Edsger W. " @@ -1017,7 +1037,7 @@ msgid "" "acquire` and :meth:`~Semaphore.release`)." msgstr "" -#: ../../library/threading.rst:796 +#: ../../library/threading.rst:808 msgid "" "A semaphore manages an internal counter which is decremented by each :meth:" "`~Semaphore.acquire` call and incremented by each :meth:`~Semaphore.release` " @@ -1026,12 +1046,12 @@ msgid "" "meth:`~Semaphore.release`." msgstr "" -#: ../../library/threading.rst:802 +#: ../../library/threading.rst:814 msgid "" "Semaphores also support the :ref:`context management protocol `." msgstr "" -#: ../../library/threading.rst:807 +#: ../../library/threading.rst:819 msgid "" "This class implements semaphore objects. A semaphore manages an atomic " "counter representing the number of :meth:`release` calls minus the number " @@ -1040,28 +1060,28 @@ msgid "" "If not given, *value* defaults to 1." msgstr "" -#: ../../library/threading.rst:813 +#: ../../library/threading.rst:825 msgid "" "The optional argument gives the initial *value* for the internal counter; it " "defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` is " "raised." msgstr "" -#: ../../library/threading.rst:822 +#: ../../library/threading.rst:834 msgid "Acquire a semaphore." msgstr "" -#: ../../library/threading.rst:824 +#: ../../library/threading.rst:836 msgid "When invoked without arguments:" msgstr "" -#: ../../library/threading.rst:826 +#: ../../library/threading.rst:838 msgid "" "If the internal counter is larger than zero on entry, decrement it by one " "and return ``True`` immediately." msgstr "" -#: ../../library/threading.rst:828 +#: ../../library/threading.rst:840 msgid "" "If the internal counter is zero on entry, block until awoken by a call to :" "meth:`~Semaphore.release`. Once awoken (and the counter is greater than 0), " @@ -1070,32 +1090,32 @@ msgid "" "threads are awoken should not be relied on." msgstr "" -#: ../../library/threading.rst:834 +#: ../../library/threading.rst:846 msgid "" "When invoked with *blocking* set to ``False``, do not block. If a call " "without an argument would block, return ``False`` immediately; otherwise, do " "the same thing as when called without arguments, and return ``True``." msgstr "" -#: ../../library/threading.rst:838 +#: ../../library/threading.rst:850 msgid "" "When invoked with a *timeout* other than ``None``, it will block for at most " "*timeout* seconds. If acquire does not complete successfully in that " "interval, return ``False``. Return ``True`` otherwise." msgstr "" -#: ../../library/threading.rst:847 +#: ../../library/threading.rst:859 msgid "" "Release a semaphore, incrementing the internal counter by *n*. When it was " "zero on entry and other threads are waiting for it to become larger than " "zero again, wake up *n* of those threads." msgstr "" -#: ../../library/threading.rst:851 +#: ../../library/threading.rst:863 msgid "Added the *n* parameter to release multiple waiting threads at once." msgstr "" -#: ../../library/threading.rst:857 +#: ../../library/threading.rst:869 msgid "" "Class implementing bounded semaphore objects. A bounded semaphore checks to " "make sure its current value doesn't exceed its initial value. If it does, :" @@ -1104,11 +1124,11 @@ msgid "" "times it's a sign of a bug. If not given, *value* defaults to 1." msgstr "" -#: ../../library/threading.rst:870 +#: ../../library/threading.rst:882 msgid ":class:`Semaphore` Example" msgstr ":class:`Semaphore` 範例" -#: ../../library/threading.rst:872 +#: ../../library/threading.rst:884 msgid "" "Semaphores are often used to guard resources with limited capacity, for " "example, a database server. In any situation where the size of the resource " @@ -1116,37 +1136,37 @@ msgid "" "threads, your main thread would initialize the semaphore::" msgstr "" -#: ../../library/threading.rst:881 +#: ../../library/threading.rst:893 msgid "" "Once spawned, worker threads call the semaphore's acquire and release " "methods when they need to connect to the server::" msgstr "" -#: ../../library/threading.rst:891 +#: ../../library/threading.rst:903 msgid "" "The use of a bounded semaphore reduces the chance that a programming error " "which causes the semaphore to be released more than it's acquired will go " "undetected." msgstr "" -#: ../../library/threading.rst:898 +#: ../../library/threading.rst:910 msgid "Event Objects" msgstr "" -#: ../../library/threading.rst:900 +#: ../../library/threading.rst:912 msgid "" "This is one of the simplest mechanisms for communication between threads: " "one thread signals an event and other threads wait for it." msgstr "" -#: ../../library/threading.rst:903 +#: ../../library/threading.rst:915 msgid "" "An event object manages an internal flag that can be set to true with the :" "meth:`~Event.set` method and reset to false with the :meth:`~Event.clear` " "method. The :meth:`~Event.wait` method blocks until the flag is true." msgstr "" -#: ../../library/threading.rst:910 +#: ../../library/threading.rst:922 msgid "" "Class implementing event objects. An event manages a flag that can be set " "to true with the :meth:`~Event.set` method and reset to false with the :meth:" @@ -1154,43 +1174,43 @@ msgid "" "flag is initially false." msgstr "" -#: ../../library/threading.rst:920 +#: ../../library/threading.rst:932 msgid "Return ``True`` if and only if the internal flag is true." msgstr "" -#: ../../library/threading.rst:922 +#: ../../library/threading.rst:934 msgid "The method ``isSet`` is a deprecated alias for this method." msgstr "" -#: ../../library/threading.rst:926 +#: ../../library/threading.rst:938 msgid "" "Set the internal flag to true. All threads waiting for it to become true are " "awakened. Threads that call :meth:`wait` once the flag is true will not " "block at all." msgstr "" -#: ../../library/threading.rst:932 +#: ../../library/threading.rst:944 msgid "" "Reset the internal flag to false. Subsequently, threads calling :meth:`wait` " "will block until :meth:`.set` is called to set the internal flag to true " "again." msgstr "" -#: ../../library/threading.rst:938 +#: ../../library/threading.rst:950 msgid "" "Block until the internal flag is true. If the internal flag is true on " "entry, return immediately. Otherwise, block until another thread calls :" "meth:`.set` to set the flag to true, or until the optional timeout occurs." msgstr "" -#: ../../library/threading.rst:942 +#: ../../library/threading.rst:954 msgid "" "When the timeout argument is present and not ``None``, it should be a " "floating point number specifying a timeout for the operation in seconds (or " "fractions thereof)." msgstr "" -#: ../../library/threading.rst:946 +#: ../../library/threading.rst:958 msgid "" "This method returns ``True`` if and only if the internal flag has been set " "to true, either before the wait call or after the wait starts, so it will " @@ -1198,11 +1218,11 @@ msgid "" "out." msgstr "" -#: ../../library/threading.rst:958 +#: ../../library/threading.rst:970 msgid "Timer Objects" msgstr "" -#: ../../library/threading.rst:960 +#: ../../library/threading.rst:972 msgid "" "This class represents an action that should be run only after a certain " "amount of time has passed --- a timer. :class:`Timer` is a subclass of :" @@ -1210,7 +1230,7 @@ msgid "" "threads." msgstr "" -#: ../../library/threading.rst:964 +#: ../../library/threading.rst:976 msgid "" "Timers are started, as with threads, by calling their :meth:`~Timer.start` " "method. The timer can be stopped (before its action has begun) by calling " @@ -1219,14 +1239,14 @@ msgid "" "by the user." msgstr "" -#: ../../library/threading.rst:970 +#: ../../library/threading.rst:982 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/threading.rst:981 +#: ../../library/threading.rst:993 msgid "" "Create a timer that will run *function* with arguments *args* and keyword " "arguments *kwargs*, after *interval* seconds have passed. If *args* is " @@ -1234,17 +1254,17 @@ msgid "" "``None`` (the default) then an empty dict will be used." msgstr "" -#: ../../library/threading.rst:991 +#: ../../library/threading.rst:1003 msgid "" "Stop the timer, and cancel the execution of the timer's action. This will " "only work if the timer is still in its waiting stage." msgstr "" -#: ../../library/threading.rst:996 +#: ../../library/threading.rst:1008 msgid "Barrier Objects" msgstr "" -#: ../../library/threading.rst:1000 +#: ../../library/threading.rst:1012 msgid "" "This class provides a simple synchronization primitive for use by a fixed " "number of threads that need to wait for each other. Each of the threads " @@ -1253,18 +1273,18 @@ msgid "" "calls. At this point, the threads are released simultaneously." msgstr "" -#: ../../library/threading.rst:1006 +#: ../../library/threading.rst:1018 msgid "" "The barrier can be reused any number of times for the same number of threads." msgstr "" -#: ../../library/threading.rst:1008 +#: ../../library/threading.rst:1020 msgid "" "As an example, here is a simple way to synchronize a client and server " "thread::" msgstr "" -#: ../../library/threading.rst:1028 +#: ../../library/threading.rst:1040 msgid "" "Create a barrier object for *parties* number of threads. An *action*, when " "provided, is a callable to be called by one of the threads when they are " @@ -1272,7 +1292,7 @@ msgid "" "the :meth:`wait` method." msgstr "" -#: ../../library/threading.rst:1035 +#: ../../library/threading.rst:1047 msgid "" "Pass the barrier. When all the threads party to the barrier have called " "this function, they are all released simultaneously. If a *timeout* is " @@ -1280,44 +1300,44 @@ msgid "" "constructor." msgstr "" -#: ../../library/threading.rst:1040 +#: ../../library/threading.rst:1052 msgid "" "The return value is an integer in the range 0 to *parties* -- 1, different " "for each thread. This can be used to select a thread to do some special " "housekeeping, e.g.::" msgstr "" -#: ../../library/threading.rst:1049 +#: ../../library/threading.rst:1061 msgid "" "If an *action* was provided to the constructor, one of the threads will have " "called it prior to being released. Should this call raise an error, the " "barrier is put into the broken state." msgstr "" -#: ../../library/threading.rst:1053 +#: ../../library/threading.rst:1065 msgid "If the call times out, the barrier is put into the broken state." msgstr "" -#: ../../library/threading.rst:1055 +#: ../../library/threading.rst:1067 msgid "" "This method may raise a :class:`BrokenBarrierError` exception if the barrier " "is broken or reset while a thread is waiting." msgstr "" -#: ../../library/threading.rst:1060 +#: ../../library/threading.rst:1072 msgid "" "Return the barrier to the default, empty state. Any threads waiting on it " "will receive the :class:`BrokenBarrierError` exception." msgstr "" -#: ../../library/threading.rst:1063 +#: ../../library/threading.rst:1075 msgid "" "Note that using this function may require some external synchronization if " "there are other threads whose state is unknown. If a barrier is broken it " "may be better to just leave it and create a new one." msgstr "" -#: ../../library/threading.rst:1069 +#: ../../library/threading.rst:1081 msgid "" "Put the barrier into a broken state. This causes any active or future calls " "to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for " @@ -1325,36 +1345,36 @@ msgid "" "application." msgstr "" -#: ../../library/threading.rst:1074 +#: ../../library/threading.rst:1086 msgid "" "It may be preferable to simply create the barrier with a sensible *timeout* " "value to automatically guard against one of the threads going awry." msgstr "" -#: ../../library/threading.rst:1080 +#: ../../library/threading.rst:1092 msgid "The number of threads required to pass the barrier." msgstr "" -#: ../../library/threading.rst:1084 +#: ../../library/threading.rst:1096 msgid "The number of threads currently waiting in the barrier." msgstr "" -#: ../../library/threading.rst:1088 +#: ../../library/threading.rst:1100 msgid "A boolean that is ``True`` if the barrier is in the broken state." msgstr "" -#: ../../library/threading.rst:1093 +#: ../../library/threading.rst:1105 msgid "" "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:" "`Barrier` object is reset or broken." msgstr "" -#: ../../library/threading.rst:1100 +#: ../../library/threading.rst:1112 msgid "" "Using locks, conditions, and semaphores in the :keyword:`!with` statement" msgstr "" -#: ../../library/threading.rst:1102 +#: ../../library/threading.rst:1114 msgid "" "All of the objects provided by this module that have :meth:`acquire` and :" "meth:`release` methods can be used as context managers for a :keyword:`with` " @@ -1363,11 +1383,11 @@ msgid "" "Hence, the following snippet::" msgstr "" -#: ../../library/threading.rst:1111 +#: ../../library/threading.rst:1123 msgid "is equivalent to::" msgstr "" -#: ../../library/threading.rst:1119 +#: ../../library/threading.rst:1131 msgid "" "Currently, :class:`Lock`, :class:`RLock`, :class:`Condition`, :class:" "`Semaphore`, and :class:`BoundedSemaphore` objects may be used as :keyword:" diff --git a/library/tkinter.po b/library/tkinter.po index bae0b45eb7..fa79617987 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+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-" @@ -137,8 +137,8 @@ msgid "By Alan Moore. (ISBN 978-1788835886)" msgstr "由 Alan Moore 所著。(ISBN 978-1788835886)" #: ../../library/tkinter.rst:65 -msgid "`Programming Python `_" -msgstr "`Programming Python `_" +msgid "`Programming Python `_" +msgstr "`Programming Python `_" #: ../../library/tkinter.rst:65 msgid "By Mark Lutz; has excellent coverage of Tkinter. (ISBN 978-0596158101)" @@ -196,11 +196,11 @@ msgstr "Tk" #: ../../library/tkinter.rst:93 msgid "" -"Tk is a `Tcl package `_ implemented in C that adds " -"custom commands to create and manipulate GUI widgets. Each :class:`Tk` " -"object embeds its own Tcl interpreter instance with Tk loaded into it. Tk's " -"widgets are very customizable, though at the cost of a dated appearance. Tk " -"uses Tcl's event queue to generate and process GUI events." +"Tk is a `Tcl package `_ implemented in C " +"that adds custom commands to create and manipulate GUI widgets. Each :class:" +"`Tk` object embeds its own Tcl interpreter instance with Tk loaded into it. " +"Tk's widgets are very customizable, though at the cost of a dated " +"appearance. Tk uses Tcl's event queue to generate and process GUI events." msgstr "" #: ../../library/tkinter.rst:103 @@ -1690,7 +1690,7 @@ msgstr "" #: ../../library/tkinter.rst:991 msgid "" -"The `Pillow `_ package adds support for formats " +"The `Pillow `_ package adds support for formats " "such as BMP, JPEG, TIFF, and WebP, among others." msgstr "" diff --git a/library/typing.po b/library/typing.po index e9b208fd19..d138b4a16b 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-08 00:18+0000\n" +"POT-Creation-Date: 2022-08-14 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -281,7 +281,7 @@ msgid "" msgstr "" #: ../../library/typing.rst:203 ../../library/typing.rst:1018 -#: ../../library/typing.rst:2247 +#: ../../library/typing.rst:2252 msgid "For example::" msgstr "" "舉例來說:\n" @@ -871,7 +871,7 @@ msgid "" "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:896 ../../library/typing.rst:2142 +#: ../../library/typing.rst:896 ../../library/typing.rst:2147 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1433,7 +1433,7 @@ msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example::" msgstr "" -#: ../../library/typing.rst:1549 +#: ../../library/typing.rst:1552 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " @@ -1443,152 +1443,152 @@ msgid "" "it from another ``TypedDict`` with a different value for ``total``. Usage::" msgstr "" -#: ../../library/typing.rst:1569 +#: ../../library/typing.rst:1574 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1574 +#: ../../library/typing.rst:1579 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1577 +#: ../../library/typing.rst:1582 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1586 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1585 +#: ../../library/typing.rst:1590 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1590 +#: ../../library/typing.rst:1595 msgid "" ":class:`builtins.dict ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1596 +#: ../../library/typing.rst:1601 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1601 +#: ../../library/typing.rst:1606 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1611 +#: ../../library/typing.rst:1616 msgid "" ":class:`builtins.list ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1617 +#: ../../library/typing.rst:1622 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1621 +#: ../../library/typing.rst:1626 msgid "" ":class:`builtins.set ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1627 +#: ../../library/typing.rst:1632 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1629 +#: ../../library/typing.rst:1634 msgid "" ":class:`builtins.frozenset ` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1633 +#: ../../library/typing.rst:1638 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1636 +#: ../../library/typing.rst:1641 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1640 +#: ../../library/typing.rst:1645 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1644 +#: ../../library/typing.rst:1649 msgid "" ":class:`collections.defaultdict` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1650 +#: ../../library/typing.rst:1655 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1654 +#: ../../library/typing.rst:1659 msgid "" ":class:`collections.OrderedDict` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1660 +#: ../../library/typing.rst:1665 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:1665 +#: ../../library/typing.rst:1670 msgid "" ":class:`collections.ChainMap` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1671 +#: ../../library/typing.rst:1676 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:1676 +#: ../../library/typing.rst:1681 msgid "" ":class:`collections.Counter` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1682 +#: ../../library/typing.rst:1687 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:1687 +#: ../../library/typing.rst:1692 msgid "" ":class:`collections.deque` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1692 +#: ../../library/typing.rst:1697 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:1698 +#: ../../library/typing.rst:1703 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:1705 +#: ../../library/typing.rst:1710 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:1710 +#: ../../library/typing.rst:1715 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1596,413 +1596,413 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:1720 +#: ../../library/typing.rst:1725 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:1721 +#: ../../library/typing.rst:1726 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1727 +#: ../../library/typing.rst:1732 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:1731 +#: ../../library/typing.rst:1736 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:1740 +#: ../../library/typing.rst:1745 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:1743 +#: ../../library/typing.rst:1748 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:1747 +#: ../../library/typing.rst:1752 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:1749 +#: ../../library/typing.rst:1754 msgid "" ":class:`collections.abc.Set` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1755 +#: ../../library/typing.rst:1760 msgid "A generic version of :class:`collections.abc.ByteString`." msgstr "" -#: ../../library/typing.rst:1757 +#: ../../library/typing.rst:1762 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:1760 +#: ../../library/typing.rst:1765 msgid "" "As a shorthand for this type, :class:`bytes` can be used to annotate " "arguments of any of the types mentioned above." msgstr "" -#: ../../library/typing.rst:1763 +#: ../../library/typing.rst:1768 msgid "" ":class:`collections.abc.ByteString` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1769 +#: ../../library/typing.rst:1774 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:1773 +#: ../../library/typing.rst:1778 msgid "" ":class:`collections.abc.Collection` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1779 +#: ../../library/typing.rst:1784 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:1781 +#: ../../library/typing.rst:1786 msgid "" ":class:`collections.abc.Container` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1787 +#: ../../library/typing.rst:1792 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:1789 +#: ../../library/typing.rst:1794 msgid "" ":class:`collections.abc.ItemsView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1795 +#: ../../library/typing.rst:1800 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:1797 +#: ../../library/typing.rst:1802 msgid "" ":class:`collections.abc.KeysView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1803 +#: ../../library/typing.rst:1808 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:1809 +#: ../../library/typing.rst:1814 msgid "" ":class:`collections.abc.Mapping` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1815 +#: ../../library/typing.rst:1820 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:1822 msgid "" ":class:`collections.abc.MappingView` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1823 +#: ../../library/typing.rst:1828 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:1825 +#: ../../library/typing.rst:1830 msgid "" ":class:`collections.abc.MutableMapping` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1831 +#: ../../library/typing.rst:1836 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:1833 +#: ../../library/typing.rst:1838 msgid "" ":class:`collections.abc.MutableSequence` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1839 +#: ../../library/typing.rst:1844 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:1841 +#: ../../library/typing.rst:1846 msgid "" ":class:`collections.abc.MutableSet` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1847 +#: ../../library/typing.rst:1852 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:1849 +#: ../../library/typing.rst:1854 msgid "" ":class:`collections.abc.Sequence` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1855 +#: ../../library/typing.rst:1860 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:1857 +#: ../../library/typing.rst:1862 msgid "" ":class:`collections.abc.ValuesView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1862 +#: ../../library/typing.rst:1867 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:1866 +#: ../../library/typing.rst:1871 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:1868 +#: ../../library/typing.rst:1873 msgid "" ":class:`collections.abc.Iterable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1874 +#: ../../library/typing.rst:1879 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:1876 +#: ../../library/typing.rst:1881 msgid "" ":class:`collections.abc.Iterator` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1882 +#: ../../library/typing.rst:1887 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:1891 +#: ../../library/typing.rst:1896 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:1895 +#: ../../library/typing.rst:1900 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:1903 +#: ../../library/typing.rst:1908 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:1911 +#: ../../library/typing.rst:1916 msgid "" ":class:`collections.abc.Generator` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1917 +#: ../../library/typing.rst:1922 msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:1921 +#: ../../library/typing.rst:1926 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:1923 +#: ../../library/typing.rst:1928 msgid "" ":class:`collections.abc.Reversible` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1929 +#: ../../library/typing.rst:1934 msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:1932 +#: ../../library/typing.rst:1937 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:1936 +#: ../../library/typing.rst:1941 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:1948 +#: ../../library/typing.rst:1953 msgid "" ":class:`collections.abc.Coroutine` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1954 +#: ../../library/typing.rst:1959 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:1963 +#: ../../library/typing.rst:1968 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:1967 +#: ../../library/typing.rst:1972 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:1975 +#: ../../library/typing.rst:1980 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:1990 msgid "" ":class:`collections.abc.AsyncGenerator` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1991 +#: ../../library/typing.rst:1996 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:1995 +#: ../../library/typing.rst:2000 msgid "" ":class:`collections.abc.AsyncIterable` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2001 +#: ../../library/typing.rst:2006 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2005 +#: ../../library/typing.rst:2010 msgid "" ":class:`collections.abc.AsyncIterator` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2011 +#: ../../library/typing.rst:2016 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2015 +#: ../../library/typing.rst:2020 msgid "" ":class:`collections.abc.Awaitable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2026 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2025 +#: ../../library/typing.rst:2030 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2035 msgid "" ":class:`contextlib.AbstractContextManager` now supports ``[]``. See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2036 +#: ../../library/typing.rst:2041 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2041 +#: ../../library/typing.rst:2046 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2046 +#: ../../library/typing.rst:2051 msgid "Protocols" msgstr "" -#: ../../library/typing.rst:2048 +#: ../../library/typing.rst:2053 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2052 +#: ../../library/typing.rst:2057 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2057 +#: ../../library/typing.rst:2062 msgid "An ABC with one abstract method ``__bytes__``." msgstr "" -#: ../../library/typing.rst:2061 +#: ../../library/typing.rst:2066 msgid "An ABC with one abstract method ``__complex__``." msgstr "" -#: ../../library/typing.rst:2065 +#: ../../library/typing.rst:2070 msgid "An ABC with one abstract method ``__float__``." msgstr "" -#: ../../library/typing.rst:2069 +#: ../../library/typing.rst:2074 msgid "An ABC with one abstract method ``__index__``." msgstr "" -#: ../../library/typing.rst:2075 +#: ../../library/typing.rst:2080 msgid "An ABC with one abstract method ``__int__``." msgstr "" -#: ../../library/typing.rst:2079 +#: ../../library/typing.rst:2084 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2083 +#: ../../library/typing.rst:2088 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2087 +#: ../../library/typing.rst:2092 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2089 +#: ../../library/typing.rst:2094 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2096 +#: ../../library/typing.rst:2101 msgid "" "The ``@overload`` decorator allows describing functions and methods that " "support multiple different combinations of argument types. A series of " @@ -2017,69 +2017,69 @@ msgid "" "variable::" msgstr "" -#: ../../library/typing.rst:2120 +#: ../../library/typing.rst:2125 msgid "See :pep:`484` for details and comparison with other typing semantics." msgstr "" -#: ../../library/typing.rst:2124 +#: ../../library/typing.rst:2129 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2154 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2151 +#: ../../library/typing.rst:2156 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods defined in that class (but not to methods defined " "in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2160 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2159 +#: ../../library/typing.rst:2164 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2161 +#: ../../library/typing.rst:2166 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2166 +#: ../../library/typing.rst:2171 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2168 +#: ../../library/typing.rst:2173 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2179 +#: ../../library/typing.rst:2184 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2188 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2187 +#: ../../library/typing.rst:2192 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2190 +#: ../../library/typing.rst:2195 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2089,29 +2089,29 @@ msgid "" "merging all the ``__annotations__`` along ``C.__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2198 +#: ../../library/typing.rst:2203 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2213 +#: ../../library/typing.rst:2218 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2218 +#: ../../library/typing.rst:2223 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2224 +#: ../../library/typing.rst:2229 msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:2226 +#: ../../library/typing.rst:2231 msgid "" "For a typing object of the form ``X[Y, Z, ...]`` these functions return " "``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" @@ -2122,11 +2122,11 @@ msgid "" "and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:2245 +#: ../../library/typing.rst:2250 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2260 +#: ../../library/typing.rst:2265 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2134,24 +2134,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2266 +#: ../../library/typing.rst:2271 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2273 +#: ../../library/typing.rst:2278 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2277 +#: ../../library/typing.rst:2282 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2286 +#: ../../library/typing.rst:2291 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2159,7 +2159,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2293 +#: ../../library/typing.rst:2298 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " diff --git a/library/winreg.po b/library/winreg.po index 0fa993b3fe..1d4e2a5808 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-08-04 00:16+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-" @@ -87,8 +87,8 @@ msgstr "" #: ../../library/winreg.rst:58 ../../library/winreg.rst:84 #: ../../library/winreg.rst:118 ../../library/winreg.rst:139 -#: ../../library/winreg.rst:177 ../../library/winreg.rst:208 -#: ../../library/winreg.rst:243 ../../library/winreg.rst:334 +#: ../../library/winreg.rst:172 ../../library/winreg.rst:203 +#: ../../library/winreg.rst:238 ../../library/winreg.rst:329 msgid "See :ref:`above `." msgstr "" @@ -99,14 +99,14 @@ msgid "" msgstr "" #: ../../library/winreg.rst:67 ../../library/winreg.rst:93 -#: ../../library/winreg.rst:126 ../../library/winreg.rst:153 -#: ../../library/winreg.rst:185 ../../library/winreg.rst:197 -#: ../../library/winreg.rst:216 ../../library/winreg.rst:265 -#: ../../library/winreg.rst:312 ../../library/winreg.rst:342 -#: ../../library/winreg.rst:368 ../../library/winreg.rst:388 -#: ../../library/winreg.rst:412 ../../library/winreg.rst:437 -#: ../../library/winreg.rst:465 ../../library/winreg.rst:496 -#: ../../library/winreg.rst:513 ../../library/winreg.rst:528 +#: ../../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 msgid "" "*key* is an already open key, or one of the predefined :ref:`HKEY_* " "constants `." @@ -133,13 +133,13 @@ msgid "" msgstr "" #: ../../library/winreg.rst:82 ../../library/winreg.rst:114 -#: ../../library/winreg.rst:329 +#: ../../library/winreg.rst:324 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey/result`` with " "argument ``key``." msgstr "" -#: ../../library/winreg.rst:98 ../../library/winreg.rst:160 +#: ../../library/winreg.rst:98 ../../library/winreg.rst:154 msgid "" "*reserved* is a reserved integer, and must be zero. The default is zero." msgstr "" @@ -162,166 +162,159 @@ msgid "" "subkeys." msgstr "" -#: ../../library/winreg.rst:132 ../../library/winreg.rst:166 +#: ../../library/winreg.rst:132 ../../library/winreg.rst:161 msgid "*This method can not delete keys with subkeys.*" msgstr "" -#: ../../library/winreg.rst:134 ../../library/winreg.rst:168 +#: ../../library/winreg.rst:134 ../../library/winreg.rst:163 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:173 +#: ../../library/winreg.rst:137 ../../library/winreg.rst:168 msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteKey`` with " "arguments ``key``, ``sub_key``, ``access``." msgstr "" -#: ../../library/winreg.rst:148 -msgid "" -"The :func:`DeleteKeyEx` function is implemented with the RegDeleteKeyEx " -"Windows API function, which is specific to 64-bit versions of Windows. See " -"the `RegDeleteKeyEx documentation `__." -msgstr "" - -#: ../../library/winreg.rst:156 +#: ../../library/winreg.rst:150 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:162 +#: ../../library/winreg.rst:156 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`. " -"See :ref:`Access Rights ` for other allowed values." +"desired security access for the key. Default is :const:`KEY_WOW64_64KEY`. " +"On 32-bit Windows, the WOW64 constants are ignored. See :ref:`Access Rights " +"` for other allowed values." msgstr "" -#: ../../library/winreg.rst:171 +#: ../../library/winreg.rst:166 msgid "On unsupported Windows versions, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/winreg.rst:183 +#: ../../library/winreg.rst:178 msgid "Removes a named value from a registry key." msgstr "" -#: ../../library/winreg.rst:188 +#: ../../library/winreg.rst:183 msgid "*value* is a string that identifies the value to remove." msgstr "" -#: ../../library/winreg.rst:190 +#: ../../library/winreg.rst:185 msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteValue`` with " "arguments ``key``, ``value``." msgstr "" -#: ../../library/winreg.rst:195 +#: ../../library/winreg.rst:190 msgid "Enumerates subkeys of an open registry key, returning a string." msgstr "" -#: ../../library/winreg.rst:200 +#: ../../library/winreg.rst:195 msgid "*index* is an integer that identifies the index of the key to retrieve." msgstr "" -#: ../../library/winreg.rst:202 +#: ../../library/winreg.rst:197 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:206 +#: ../../library/winreg.rst:201 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumKey`` with arguments " "``key``, ``index``." msgstr "" -#: ../../library/winreg.rst:214 +#: ../../library/winreg.rst:209 msgid "Enumerates values of an open registry key, returning a tuple." msgstr "" -#: ../../library/winreg.rst:219 +#: ../../library/winreg.rst:214 msgid "" "*index* is an integer that identifies the index of the value to retrieve." msgstr "" -#: ../../library/winreg.rst:221 +#: ../../library/winreg.rst:216 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:225 ../../library/winreg.rst:345 +#: ../../library/winreg.rst:220 ../../library/winreg.rst:340 msgid "The result is a tuple of 3 items:" msgstr "" -#: ../../library/winreg.rst:228 ../../library/winreg.rst:348 -#: ../../library/winreg.rst:396 +#: ../../library/winreg.rst:223 ../../library/winreg.rst:343 +#: ../../library/winreg.rst:391 msgid "Index" msgstr "" -#: ../../library/winreg.rst:228 ../../library/winreg.rst:348 -#: ../../library/winreg.rst:396 +#: ../../library/winreg.rst:223 ../../library/winreg.rst:343 +#: ../../library/winreg.rst:391 msgid "Meaning" msgstr "" -#: ../../library/winreg.rst:230 ../../library/winreg.rst:350 -#: ../../library/winreg.rst:398 +#: ../../library/winreg.rst:225 ../../library/winreg.rst:345 +#: ../../library/winreg.rst:393 msgid "``0``" msgstr "``0``" -#: ../../library/winreg.rst:230 +#: ../../library/winreg.rst:225 msgid "A string that identifies the value name" msgstr "" -#: ../../library/winreg.rst:232 ../../library/winreg.rst:353 -#: ../../library/winreg.rst:400 +#: ../../library/winreg.rst:227 ../../library/winreg.rst:348 +#: ../../library/winreg.rst:395 msgid "``1``" msgstr "``1``" -#: ../../library/winreg.rst:232 +#: ../../library/winreg.rst:227 msgid "" "An object that holds the value data, and whose type depends on the " "underlying registry type" msgstr "" -#: ../../library/winreg.rst:236 ../../library/winreg.rst:356 +#: ../../library/winreg.rst:231 ../../library/winreg.rst:351 msgid "``2``" msgstr "``2``" -#: ../../library/winreg.rst:236 +#: ../../library/winreg.rst:231 msgid "" "An integer that identifies the type of the value data (see table in docs " "for :meth:`SetValueEx`)" msgstr "" -#: ../../library/winreg.rst:241 +#: ../../library/winreg.rst:236 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumValue`` with " "arguments ``key``, ``index``." msgstr "" -#: ../../library/winreg.rst:252 +#: ../../library/winreg.rst:247 msgid "" "Expands environment variable placeholders ``%NAME%`` in strings like :const:" "`REG_EXPAND_SZ`::" msgstr "" -#: ../../library/winreg.rst:258 +#: ../../library/winreg.rst:253 msgid "" "Raises an :ref:`auditing event ` ``winreg." "ExpandEnvironmentStrings`` with argument ``str``." msgstr "" -#: ../../library/winreg.rst:263 +#: ../../library/winreg.rst:258 msgid "Writes all the attributes of a key to the registry." msgstr "" -#: ../../library/winreg.rst:268 +#: ../../library/winreg.rst:263 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. " @@ -332,36 +325,36 @@ msgid "" "disk." msgstr "" -#: ../../library/winreg.rst:277 +#: ../../library/winreg.rst:272 msgid "" "If you don't know whether a :func:`FlushKey` call is required, it probably " "isn't." msgstr "" -#: ../../library/winreg.rst:283 +#: ../../library/winreg.rst:278 msgid "" "Creates a subkey under the specified key and stores registration information " "from a specified file into that subkey." msgstr "" -#: ../../library/winreg.rst:286 +#: ../../library/winreg.rst:281 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:289 +#: ../../library/winreg.rst:284 msgid "*sub_key* is a string that identifies the subkey to load." msgstr "" -#: ../../library/winreg.rst:291 +#: ../../library/winreg.rst:286 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:295 +#: ../../library/winreg.rst:290 msgid "" "A call to :func:`LoadKey` fails if the calling process does not have the :" "const:`SE_RESTORE_PRIVILEGE` privilege. Note that privileges are different " @@ -369,86 +362,86 @@ msgid "" "microsoft.com/en-us/library/ms724889%28v=VS.85%29.aspx>`__ for more details." msgstr "" -#: ../../library/winreg.rst:301 +#: ../../library/winreg.rst:296 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:304 +#: ../../library/winreg.rst:299 msgid "" "Raises an :ref:`auditing event ` ``winreg.LoadKey`` with arguments " "``key``, ``sub_key``, ``file_name``." msgstr "" -#: ../../library/winreg.rst:310 +#: ../../library/winreg.rst:305 msgid "" "Opens the specified key, returning a :ref:`handle object `." msgstr "" -#: ../../library/winreg.rst:315 +#: ../../library/winreg.rst:310 msgid "*sub_key* is a string that identifies the sub_key to open." msgstr "" -#: ../../library/winreg.rst:317 +#: ../../library/winreg.rst:312 msgid "" "*reserved* is a reserved integer, and must be zero. The default is zero." msgstr "" -#: ../../library/winreg.rst:319 +#: ../../library/winreg.rst:314 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:323 +#: ../../library/winreg.rst:318 msgid "The result is a new handle to the specified key." msgstr "" -#: ../../library/winreg.rst:325 +#: ../../library/winreg.rst:320 msgid "If the function fails, :exc:`OSError` is raised." msgstr "" -#: ../../library/winreg.rst:327 +#: ../../library/winreg.rst:322 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey`` with arguments " "``key``, ``sub_key``, ``access``." msgstr "" -#: ../../library/winreg.rst:331 +#: ../../library/winreg.rst:326 msgid "Allow the use of named arguments." msgstr "" -#: ../../library/winreg.rst:340 +#: ../../library/winreg.rst:335 msgid "Returns information about a key, as a tuple." msgstr "" -#: ../../library/winreg.rst:350 +#: ../../library/winreg.rst:345 msgid "An integer giving the number of sub keys this key has." msgstr "" -#: ../../library/winreg.rst:353 +#: ../../library/winreg.rst:348 msgid "An integer giving the number of values this key has." msgstr "" -#: ../../library/winreg.rst:356 +#: ../../library/winreg.rst:351 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:361 +#: ../../library/winreg.rst:356 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryInfoKey`` with " "argument ``key``." msgstr "" -#: ../../library/winreg.rst:366 +#: ../../library/winreg.rst:361 msgid "Retrieves the unnamed value for a key, as a string." msgstr "" -#: ../../library/winreg.rst:371 +#: ../../library/winreg.rst:366 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 " @@ -456,7 +449,7 @@ msgid "" "identified by *key*." msgstr "" -#: ../../library/winreg.rst:375 +#: ../../library/winreg.rst:370 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 " @@ -464,41 +457,41 @@ msgid "" "`QueryValueEx` if possible." msgstr "" -#: ../../library/winreg.rst:380 ../../library/winreg.rst:405 +#: ../../library/winreg.rst:375 ../../library/winreg.rst:400 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryValue`` with " "arguments ``key``, ``sub_key``, ``value_name``." msgstr "" -#: ../../library/winreg.rst:385 +#: ../../library/winreg.rst:380 msgid "" "Retrieves the type and data for a specified value name associated with an " "open registry key." msgstr "" -#: ../../library/winreg.rst:391 +#: ../../library/winreg.rst:386 msgid "*value_name* is a string indicating the value to query." msgstr "" -#: ../../library/winreg.rst:393 +#: ../../library/winreg.rst:388 msgid "The result is a tuple of 2 items:" msgstr "" -#: ../../library/winreg.rst:398 +#: ../../library/winreg.rst:393 msgid "The value of the registry item." msgstr "" -#: ../../library/winreg.rst:400 +#: ../../library/winreg.rst:395 msgid "" "An integer giving the registry type for this value (see table in docs for :" "meth:`SetValueEx`)" msgstr "" -#: ../../library/winreg.rst:410 +#: ../../library/winreg.rst:405 msgid "Saves the specified key, and all its subkeys to the specified file." msgstr "" -#: ../../library/winreg.rst:415 +#: ../../library/winreg.rst:410 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 " @@ -506,7 +499,7 @@ msgid "" "method." msgstr "" -#: ../../library/winreg.rst:420 +#: ../../library/winreg.rst:415 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 " @@ -516,169 +509,169 @@ msgid "" "library/ms724878%28v=VS.85%29.aspx>`__ for more details." msgstr "" -#: ../../library/winreg.rst:428 +#: ../../library/winreg.rst:423 msgid "This function passes ``NULL`` for *security_attributes* to the API." msgstr "" -#: ../../library/winreg.rst:430 +#: ../../library/winreg.rst:425 msgid "" "Raises an :ref:`auditing event ` ``winreg.SaveKey`` with arguments " "``key``, ``file_name``." msgstr "" -#: ../../library/winreg.rst:435 +#: ../../library/winreg.rst:430 msgid "Associates a value with a specified key." msgstr "" -#: ../../library/winreg.rst:440 +#: ../../library/winreg.rst:435 msgid "" "*sub_key* is a string that names the subkey with which the value is " "associated." msgstr "" -#: ../../library/winreg.rst:442 +#: ../../library/winreg.rst:437 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:446 ../../library/winreg.rst:476 +#: ../../library/winreg.rst:441 ../../library/winreg.rst:471 msgid "*value* is a string that specifies the new value." msgstr "" -#: ../../library/winreg.rst:448 +#: ../../library/winreg.rst:443 msgid "" "If the key specified by the *sub_key* parameter does not exist, the SetValue " "function creates it." msgstr "" -#: ../../library/winreg.rst:451 ../../library/winreg.rst:484 +#: ../../library/winreg.rst:446 ../../library/winreg.rst:479 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:455 +#: ../../library/winreg.rst:450 msgid "" "The key identified by the *key* parameter must have been opened with :const:" "`KEY_SET_VALUE` access." msgstr "" -#: ../../library/winreg.rst:458 ../../library/winreg.rst:488 +#: ../../library/winreg.rst:453 ../../library/winreg.rst:483 msgid "" "Raises an :ref:`auditing event ` ``winreg.SetValue`` with " "arguments ``key``, ``sub_key``, ``type``, ``value``." msgstr "" -#: ../../library/winreg.rst:463 +#: ../../library/winreg.rst:458 msgid "Stores data in the value field of an open registry key." msgstr "" -#: ../../library/winreg.rst:468 +#: ../../library/winreg.rst:463 msgid "" "*value_name* is a string that names the subkey with which the value is " "associated." msgstr "" -#: ../../library/winreg.rst:471 +#: ../../library/winreg.rst:466 msgid "*reserved* can be anything -- zero is always passed to the API." msgstr "" -#: ../../library/winreg.rst:473 +#: ../../library/winreg.rst:468 msgid "" "*type* is an integer that specifies the type of the data. See :ref:`Value " "Types ` for the available types." msgstr "" -#: ../../library/winreg.rst:478 +#: ../../library/winreg.rst:473 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:482 +#: ../../library/winreg.rst:477 msgid "To open the key, use the :func:`CreateKey` or :func:`OpenKey` methods." msgstr "" -#: ../../library/winreg.rst:493 +#: ../../library/winreg.rst:488 msgid "" "Disables registry reflection for 32-bit processes running on a 64-bit " "operating system." msgstr "" -#: ../../library/winreg.rst:499 ../../library/winreg.rst:516 -#: ../../library/winreg.rst:533 +#: ../../library/winreg.rst:494 ../../library/winreg.rst:511 +#: ../../library/winreg.rst:528 msgid "" "Will generally raise :exc:`NotImplementedError` if executed on a 32-bit " "operating system." msgstr "" -#: ../../library/winreg.rst:502 +#: ../../library/winreg.rst:497 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:506 +#: ../../library/winreg.rst:501 msgid "" "Raises an :ref:`auditing event ` ``winreg.DisableReflectionKey`` " "with argument ``key``." msgstr "" -#: ../../library/winreg.rst:511 +#: ../../library/winreg.rst:506 msgid "Restores registry reflection for the specified disabled key." msgstr "" -#: ../../library/winreg.rst:519 +#: ../../library/winreg.rst:514 msgid "" "Restoring reflection for a key does not affect reflection of any subkeys." msgstr "" -#: ../../library/winreg.rst:521 +#: ../../library/winreg.rst:516 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnableReflectionKey`` " "with argument ``key``." msgstr "" -#: ../../library/winreg.rst:526 +#: ../../library/winreg.rst:521 msgid "Determines the reflection state for the specified key." msgstr "" -#: ../../library/winreg.rst:531 +#: ../../library/winreg.rst:526 msgid "Returns ``True`` if reflection is disabled." msgstr "" -#: ../../library/winreg.rst:536 +#: ../../library/winreg.rst:531 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryReflectionKey`` " "with argument ``key``." msgstr "" -#: ../../library/winreg.rst:542 +#: ../../library/winreg.rst:537 msgid "Constants" msgstr "常數" -#: ../../library/winreg.rst:544 +#: ../../library/winreg.rst:539 msgid "" "The following constants are defined for use in many :mod:`_winreg` functions." msgstr "" -#: ../../library/winreg.rst:549 +#: ../../library/winreg.rst:544 msgid "HKEY_* Constants" msgstr "" -#: ../../library/winreg.rst:553 +#: ../../library/winreg.rst:548 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:560 +#: ../../library/winreg.rst:555 msgid "" "Registry entries subordinate to this key define the preferences of the " "current user. These preferences include the settings of environment " @@ -686,48 +679,48 @@ msgid "" "and application preferences." msgstr "" -#: ../../library/winreg.rst:567 +#: ../../library/winreg.rst:562 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:573 +#: ../../library/winreg.rst:568 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:579 +#: ../../library/winreg.rst:574 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:587 +#: ../../library/winreg.rst:582 msgid "" "Contains information about the current hardware profile of the local " "computer system." msgstr "" -#: ../../library/winreg.rst:592 +#: ../../library/winreg.rst:587 msgid "This key is not used in versions of Windows after 98." msgstr "" -#: ../../library/winreg.rst:598 +#: ../../library/winreg.rst:593 msgid "Access Rights" msgstr "" -#: ../../library/winreg.rst:600 +#: ../../library/winreg.rst:595 msgid "" "For more information, see `Registry Key Security and Access `__." msgstr "" -#: ../../library/winreg.rst:605 +#: ../../library/winreg.rst:600 msgid "" "Combines the STANDARD_RIGHTS_REQUIRED, :const:`KEY_QUERY_VALUE`, :const:" "`KEY_SET_VALUE`, :const:`KEY_CREATE_SUB_KEY`, :const:" @@ -735,180 +728,180 @@ msgid "" "access rights." msgstr "" -#: ../../library/winreg.rst:612 +#: ../../library/winreg.rst:607 msgid "" "Combines the STANDARD_RIGHTS_WRITE, :const:`KEY_SET_VALUE`, and :const:" "`KEY_CREATE_SUB_KEY` access rights." msgstr "" -#: ../../library/winreg.rst:617 +#: ../../library/winreg.rst:612 msgid "" "Combines the STANDARD_RIGHTS_READ, :const:`KEY_QUERY_VALUE`, :const:" "`KEY_ENUMERATE_SUB_KEYS`, and :const:`KEY_NOTIFY` values." msgstr "" -#: ../../library/winreg.rst:622 +#: ../../library/winreg.rst:617 msgid "Equivalent to :const:`KEY_READ`." msgstr "" -#: ../../library/winreg.rst:626 +#: ../../library/winreg.rst:621 msgid "Required to query the values of a registry key." msgstr "" -#: ../../library/winreg.rst:630 +#: ../../library/winreg.rst:625 msgid "Required to create, delete, or set a registry value." msgstr "" -#: ../../library/winreg.rst:634 +#: ../../library/winreg.rst:629 msgid "Required to create a subkey of a registry key." msgstr "" -#: ../../library/winreg.rst:638 +#: ../../library/winreg.rst:633 msgid "Required to enumerate the subkeys of a registry key." msgstr "" -#: ../../library/winreg.rst:642 +#: ../../library/winreg.rst:637 msgid "" "Required to request change notifications for a registry key or for subkeys " "of a registry key." msgstr "" -#: ../../library/winreg.rst:647 +#: ../../library/winreg.rst:642 msgid "Reserved for system use." msgstr "" -#: ../../library/winreg.rst:653 +#: ../../library/winreg.rst:648 msgid "64-bit Specific" msgstr "" -#: ../../library/winreg.rst:655 +#: ../../library/winreg.rst:650 msgid "" "For more information, see `Accessing an Alternate Registry View `__." msgstr "" -#: ../../library/winreg.rst:660 +#: ../../library/winreg.rst:655 msgid "" "Indicates that an application on 64-bit Windows should operate on the 64-bit " -"registry view." +"registry view. On 32-bit Windows, this constant is ignored." msgstr "" -#: ../../library/winreg.rst:665 +#: ../../library/winreg.rst:660 msgid "" "Indicates that an application on 64-bit Windows should operate on the 32-bit " -"registry view." +"registry view. On 32-bit Windows, this constant is ignored." msgstr "" -#: ../../library/winreg.rst:672 +#: ../../library/winreg.rst:666 msgid "Value Types" msgstr "" -#: ../../library/winreg.rst:674 +#: ../../library/winreg.rst:668 msgid "" "For more information, see `Registry Value Types `__." msgstr "" -#: ../../library/winreg.rst:679 +#: ../../library/winreg.rst:673 msgid "Binary data in any form." msgstr "" -#: ../../library/winreg.rst:683 +#: ../../library/winreg.rst:677 msgid "32-bit number." msgstr "" -#: ../../library/winreg.rst:687 +#: ../../library/winreg.rst:681 msgid "" "A 32-bit number in little-endian format. Equivalent to :const:`REG_DWORD`." msgstr "" -#: ../../library/winreg.rst:691 +#: ../../library/winreg.rst:685 msgid "A 32-bit number in big-endian format." msgstr "" -#: ../../library/winreg.rst:695 +#: ../../library/winreg.rst:689 msgid "" "Null-terminated string containing references to environment variables (``" "%PATH%``)." msgstr "" -#: ../../library/winreg.rst:700 +#: ../../library/winreg.rst:694 msgid "A Unicode symbolic link." msgstr "" -#: ../../library/winreg.rst:704 +#: ../../library/winreg.rst:698 msgid "" "A sequence of null-terminated strings, terminated by two null characters. " "(Python handles this termination automatically.)" msgstr "" -#: ../../library/winreg.rst:709 +#: ../../library/winreg.rst:703 msgid "No defined value type." msgstr "" -#: ../../library/winreg.rst:713 +#: ../../library/winreg.rst:707 msgid "A 64-bit number." msgstr "" -#: ../../library/winreg.rst:719 +#: ../../library/winreg.rst:713 msgid "" "A 64-bit number in little-endian format. Equivalent to :const:`REG_QWORD`." msgstr "" -#: ../../library/winreg.rst:725 +#: ../../library/winreg.rst:719 msgid "A device-driver resource list." msgstr "" -#: ../../library/winreg.rst:729 +#: ../../library/winreg.rst:723 msgid "A hardware setting." msgstr "" -#: ../../library/winreg.rst:733 +#: ../../library/winreg.rst:727 msgid "A hardware resource list." msgstr "" -#: ../../library/winreg.rst:737 +#: ../../library/winreg.rst:731 msgid "A null-terminated string." msgstr "" -#: ../../library/winreg.rst:743 +#: ../../library/winreg.rst:737 msgid "Registry Handle Objects" msgstr "" -#: ../../library/winreg.rst:745 +#: ../../library/winreg.rst:739 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:749 +#: ../../library/winreg.rst:743 msgid "All registry functions in this module return one of these objects." msgstr "" -#: ../../library/winreg.rst:751 +#: ../../library/winreg.rst:745 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:754 +#: ../../library/winreg.rst:748 msgid "Handle objects provide semantics for :meth:`__bool__` -- thus ::" msgstr "" -#: ../../library/winreg.rst:759 +#: ../../library/winreg.rst:753 msgid "" "will print ``Yes`` if the handle is currently valid (has not been closed or " "detached)." msgstr "" -#: ../../library/winreg.rst:762 +#: ../../library/winreg.rst:756 msgid "" "The object also support comparison semantics, so handle objects will compare " "true if they both reference the same underlying Windows handle value." msgstr "" -#: ../../library/winreg.rst:765 +#: ../../library/winreg.rst:759 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 " @@ -917,46 +910,46 @@ msgid "" "object." msgstr "" -#: ../../library/winreg.rst:773 +#: ../../library/winreg.rst:767 msgid "Closes the underlying Windows handle." msgstr "" -#: ../../library/winreg.rst:775 +#: ../../library/winreg.rst:769 msgid "If the handle is already closed, no error is raised." msgstr "" -#: ../../library/winreg.rst:780 +#: ../../library/winreg.rst:774 msgid "Detaches the Windows handle from the handle object." msgstr "" -#: ../../library/winreg.rst:782 +#: ../../library/winreg.rst:776 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:786 +#: ../../library/winreg.rst:780 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:790 +#: ../../library/winreg.rst:784 msgid "" "Raises an :ref:`auditing event ` ``winreg.PyHKEY.Detach`` with " "argument ``key``." msgstr "" -#: ../../library/winreg.rst:796 +#: ../../library/winreg.rst:790 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:803 +#: ../../library/winreg.rst:797 msgid "" "will automatically close *key* when control leaves the :keyword:`with` block." msgstr "" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index ea56fab2f7..98604fedf5 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -255,11 +255,12 @@ msgid "" "Added support of type tags with prefixes (e.g. ``ex:nil``). Added support of " "unmarshalling additional types used by Apache XML-RPC implementation for " "numerics: ``i1``, ``i2``, ``i8``, ``biginteger``, ``float`` and " -"``bigdecimal``. See http://ws.apache.org/xmlrpc/types.html for a description." +"``bigdecimal``. See https://ws.apache.org/xmlrpc/types.html for a " +"description." msgstr "" #: ../../library/xmlrpc.client.rst:164 -msgid "`XML-RPC HOWTO `_" +msgid "`XML-RPC HOWTO `_" msgstr "" #: ../../library/xmlrpc.client.rst:163 diff --git a/license.po b/license.po index d7d50f2a9a..1093084733 100644 --- a/license.po +++ b/license.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-22 00:18+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2022-06-27 09:40+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -322,10 +322,10 @@ msgstr "Sockets" msgid "" "The :mod:`socket` module uses the functions, :func:`getaddrinfo`, and :func:" "`getnameinfo`, which are coded in separate source files from the WIDE " -"Project, http://www.wide.ad.jp/. ::" +"Project, https://www.wide.ad.jp/. ::" msgstr "" ":mod:`socket` 模組使用 :func:`getaddrinfo` 和 :func:`getnameinfo` 函式,它們" -"在 WIDE 專案(http://www.wide.ad.jp/)內,於不同的原始檔案中被編碼:\n" +"在 WIDE 專案(https://www.wide.ad.jp/)內,於不同的原始檔案中被編碼:\n" "\n" "::" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index b196d015d8..3dcb33030f 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-23 00:17+0000\n" +"POT-Creation-Date: 2022-08-29 10:12+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1255,8 +1255,7 @@ msgstr ":class:`tuple`" msgid "" "These classes accept a single positional argument, and the pattern there is " "matched against the whole object rather than an attribute. For example " -"``int(0|1)`` matches the value ``0``, but not the values ``0.0`` or " -"``False``." +"``int(0|1)`` matches the value ``0``, but not the value ``0.0``." msgstr "" #: ../../reference/compound_stmts.rst:1079 @@ -1627,7 +1626,8 @@ msgstr "" #: ../../reference/compound_stmts.rst:1450 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." -msgstr "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" +msgstr "" +"更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" #: ../../reference/compound_stmts.rst:1452 msgid "" @@ -1649,7 +1649,8 @@ msgstr "" msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." -msgstr "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" +msgstr "" +"更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" #: ../../reference/compound_stmts.rst:1494 msgid "" diff --git a/reference/introduction.po b/reference/introduction.po index f29dc4f709..9531c87c84 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -97,7 +97,7 @@ msgid "" "Python implemented in Java. This implementation can be used as a scripting " "language for Java applications, or can be used to create applications using " "the Java class libraries. It is also often used to create tests for Java " -"libraries. More information can be found at `the Jython website `_." msgstr "" @@ -122,7 +122,8 @@ msgid "" "An alternate Python for .NET. Unlike Python.NET, this is a complete Python " "implementation that generates IL, and compiles Python code directly to .NET " "assemblies. It was created by Jim Hugunin, the original creator of Jython. " -"For more information, see `the IronPython website `_." +"For more information, see `the IronPython website `_." msgstr "" #: ../../reference/introduction.rst:77 @@ -136,7 +137,7 @@ msgid "" "support and a Just in Time compiler. One of the goals of the project is to " "encourage experimentation with the language itself by making it easier to " "modify the interpreter (since it is written in Python). Additional " -"information is available on `the PyPy project's home page `_." msgstr "" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index a8854e83de..eba007771a 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-29 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -619,13 +619,17 @@ msgid "Notes" msgstr "註解" #: ../../reference/lexical_analysis.rst:555 -msgid "``\\newline``" -msgstr "``\\newline``" +msgid "``\\``\\ " +msgstr "``\\``\\ " #: ../../reference/lexical_analysis.rst:555 msgid "Backslash and newline ignored" msgstr "" +#: ../../reference/lexical_analysis.rst:555 +msgid "\\(1)" +msgstr "\\(1)" + #: ../../reference/lexical_analysis.rst:557 msgid "``\\\\``" msgstr "``\\\\``" @@ -715,8 +719,8 @@ msgid "Character with octal value *ooo*" msgstr "" #: ../../reference/lexical_analysis.rst:577 -msgid "(1,3)" -msgstr "(1,3)" +msgid "(2,4)" +msgstr "(2,4)" #: ../../reference/lexical_analysis.rst:580 msgid "``\\xhh``" @@ -727,8 +731,8 @@ msgid "Character with hex value *hh*" msgstr "" #: ../../reference/lexical_analysis.rst:580 -msgid "(2,3)" -msgstr "(2,3)" +msgid "(3,4)" +msgstr "(3,4)" #: ../../reference/lexical_analysis.rst:583 msgid "Escape sequences only recognized in string literals are:" @@ -743,8 +747,8 @@ msgid "Character named *name* in the Unicode database" msgstr "" #: ../../reference/lexical_analysis.rst:588 -msgid "\\(4)" -msgstr "\\(4)" +msgid "\\(5)" +msgstr "\\(5)" #: ../../reference/lexical_analysis.rst:591 msgid "``\\uxxxx``" @@ -755,8 +759,8 @@ msgid "Character with 16-bit hex value *xxxx*" msgstr "" #: ../../reference/lexical_analysis.rst:591 -msgid "\\(5)" -msgstr "\\(5)" +msgid "\\(6)" +msgstr "\\(6)" #: ../../reference/lexical_analysis.rst:594 msgid "``\\Uxxxxxxxx``" @@ -767,43 +771,54 @@ msgid "Character with 32-bit hex value *xxxxxxxx*" msgstr "" #: ../../reference/lexical_analysis.rst:594 -msgid "\\(6)" -msgstr "\\(6)" +msgid "\\(7)" +msgstr "\\(7)" #: ../../reference/lexical_analysis.rst:598 msgid "Notes:" msgstr "註解:" #: ../../reference/lexical_analysis.rst:601 +msgid "A backslash can be added at the end of a line to ignore the newline::" +msgstr "" + +#: ../../reference/lexical_analysis.rst:607 +msgid "" +"The same result can be achieved using :ref:`triple-quoted strings " +"`, or parentheses and :ref:`string literal concatenation `." +msgstr "" + +#: ../../reference/lexical_analysis.rst:611 msgid "As in Standard C, up to three octal digits are accepted." msgstr "" -#: ../../reference/lexical_analysis.rst:604 +#: ../../reference/lexical_analysis.rst:614 msgid "Unlike in Standard C, exactly two hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:607 +#: ../../reference/lexical_analysis.rst:617 msgid "" "In a bytes literal, hexadecimal and octal escapes denote the byte with the " "given value. In a string literal, these escapes denote a Unicode character " "with the given value." msgstr "" -#: ../../reference/lexical_analysis.rst:612 +#: ../../reference/lexical_analysis.rst:622 msgid "Support for name aliases [#]_ has been added." msgstr "" -#: ../../reference/lexical_analysis.rst:616 +#: ../../reference/lexical_analysis.rst:626 msgid "Exactly four hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:619 +#: ../../reference/lexical_analysis.rst:629 msgid "" "Any Unicode character can be encoded this way. Exactly eight hex digits are " "required." msgstr "" -#: ../../reference/lexical_analysis.rst:625 +#: ../../reference/lexical_analysis.rst:635 msgid "" "Unlike Standard C, all unrecognized escape sequences are left in the string " "unchanged, i.e., *the backslash is left in the result*. (This behavior is " @@ -813,14 +828,14 @@ msgid "" "category of unrecognized escapes for bytes literals." msgstr "" -#: ../../reference/lexical_analysis.rst:632 +#: ../../reference/lexical_analysis.rst:642 msgid "" "Unrecognized escape sequences produce a :exc:`DeprecationWarning`. In a " "future Python version they will be a :exc:`SyntaxWarning` and eventually a :" "exc:`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:637 +#: ../../reference/lexical_analysis.rst:647 msgid "" "Even in a raw literal, quotes can be escaped with a backslash, but the " "backslash remains in the result; for example, ``r\"\\\"\"`` is a valid " @@ -833,11 +848,11 @@ msgid "" "continuation." msgstr "" -#: ../../reference/lexical_analysis.rst:650 +#: ../../reference/lexical_analysis.rst:660 msgid "String literal concatenation" msgstr "" -#: ../../reference/lexical_analysis.rst:652 +#: ../../reference/lexical_analysis.rst:662 msgid "" "Multiple adjacent string or bytes literals (delimited by whitespace), " "possibly using different quoting conventions, are allowed, and their meaning " @@ -847,7 +862,7 @@ msgid "" "lines, or even to add comments to parts of strings, for example::" msgstr "" -#: ../../reference/lexical_analysis.rst:663 +#: ../../reference/lexical_analysis.rst:673 msgid "" "Note that this feature is defined at the syntactical level, but implemented " "at compile time. The '+' operator must be used to concatenate string " @@ -857,11 +872,11 @@ msgid "" "with plain string literals." msgstr "" -#: ../../reference/lexical_analysis.rst:684 +#: ../../reference/lexical_analysis.rst:694 msgid "Formatted string literals" msgstr "" -#: ../../reference/lexical_analysis.rst:688 +#: ../../reference/lexical_analysis.rst:698 msgid "" "A :dfn:`formatted string literal` or :dfn:`f-string` is a string literal " "that is prefixed with ``'f'`` or ``'F'``. These strings may contain " @@ -870,14 +885,14 @@ msgid "" "are really expressions evaluated at run time." msgstr "" -#: ../../reference/lexical_analysis.rst:694 +#: ../../reference/lexical_analysis.rst:704 msgid "" "Escape sequences are decoded like in ordinary string literals (except when a " "literal is also marked as a raw string). After decoding, the grammar for " "the contents of the string is:" msgstr "" -#: ../../reference/lexical_analysis.rst:708 +#: ../../reference/lexical_analysis.rst:718 msgid "" "The parts of the string outside curly braces are treated literally, except " "that any doubled curly braces ``'{{'`` or ``'}}'`` are replaced with the " @@ -890,7 +905,7 @@ msgid "" "replacement field ends with a closing curly bracket ``'}'``." msgstr "" -#: ../../reference/lexical_analysis.rst:718 +#: ../../reference/lexical_analysis.rst:728 msgid "" "Expressions in formatted string literals are treated like regular Python " "expressions surrounded by parentheses, with a few exceptions. An empty " @@ -901,14 +916,14 @@ msgid "" "where the formatted string literal appears, in order from left to right." msgstr "" -#: ../../reference/lexical_analysis.rst:727 +#: ../../reference/lexical_analysis.rst:737 msgid "" "Prior to Python 3.7, an :keyword:`await` expression and comprehensions " "containing an :keyword:`async for` clause were illegal in the expressions in " "formatted string literals due to a problem with the implementation." msgstr "" -#: ../../reference/lexical_analysis.rst:732 +#: ../../reference/lexical_analysis.rst:742 msgid "" "When the equal sign ``'='`` is provided, the output will have the expression " "text, the ``'='`` and the evaluated value. Spaces after the opening brace " @@ -919,18 +934,18 @@ msgid "" "r'`` is declared." msgstr "" -#: ../../reference/lexical_analysis.rst:740 +#: ../../reference/lexical_analysis.rst:750 msgid "The equal sign ``'='``." msgstr "" -#: ../../reference/lexical_analysis.rst:743 +#: ../../reference/lexical_analysis.rst:753 msgid "" "If a conversion is specified, the result of evaluating the expression is " "converted before formatting. Conversion ``'!s'`` calls :func:`str` on the " "result, ``'!r'`` calls :func:`repr`, and ``'!a'`` calls :func:`ascii`." msgstr "" -#: ../../reference/lexical_analysis.rst:747 +#: ../../reference/lexical_analysis.rst:757 msgid "" "The result is then formatted using the :func:`format` protocol. The format " "specifier is passed to the :meth:`__format__` method of the expression or " @@ -939,7 +954,7 @@ msgid "" "whole string." msgstr "" -#: ../../reference/lexical_analysis.rst:753 +#: ../../reference/lexical_analysis.rst:763 msgid "" "Top-level format specifiers may include nested replacement fields. These " "nested fields may include their own conversion fields and :ref:`format " @@ -948,111 +963,111 @@ msgid "" "as that used by the :meth:`str.format` method." msgstr "" -#: ../../reference/lexical_analysis.rst:759 +#: ../../reference/lexical_analysis.rst:769 msgid "" "Formatted string literals may be concatenated, but replacement fields cannot " "be split across literals." msgstr "" -#: ../../reference/lexical_analysis.rst:762 +#: ../../reference/lexical_analysis.rst:772 msgid "Some examples of formatted string literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:794 +#: ../../reference/lexical_analysis.rst:804 msgid "" "A consequence of sharing the same syntax as regular string literals is that " "characters in the replacement fields must not conflict with the quoting used " "in the outer formatted string literal::" msgstr "" -#: ../../reference/lexical_analysis.rst:801 +#: ../../reference/lexical_analysis.rst:811 msgid "" "Backslashes are not allowed in format expressions and will raise an error::" msgstr "" -#: ../../reference/lexical_analysis.rst:806 +#: ../../reference/lexical_analysis.rst:816 msgid "" "To include a value in which a backslash escape is required, create a " "temporary variable." msgstr "" -#: ../../reference/lexical_analysis.rst:813 +#: ../../reference/lexical_analysis.rst:823 msgid "" "Formatted string literals cannot be used as docstrings, even if they do not " "include expressions." msgstr "" -#: ../../reference/lexical_analysis.rst:824 +#: ../../reference/lexical_analysis.rst:834 msgid "" "See also :pep:`498` for the proposal that added formatted string literals, " "and :meth:`str.format`, which uses a related format string mechanism." msgstr "" -#: ../../reference/lexical_analysis.rst:831 +#: ../../reference/lexical_analysis.rst:841 msgid "Numeric literals" msgstr "" -#: ../../reference/lexical_analysis.rst:837 +#: ../../reference/lexical_analysis.rst:847 msgid "" "There are three types of numeric literals: integers, floating point numbers, " "and imaginary numbers. There are no complex literals (complex numbers can " "be formed by adding a real number and an imaginary number)." msgstr "" -#: ../../reference/lexical_analysis.rst:841 +#: ../../reference/lexical_analysis.rst:851 msgid "" "Note that numeric literals do not include a sign; a phrase like ``-1`` is " "actually an expression composed of the unary operator '``-``' and the " "literal ``1``." msgstr "" -#: ../../reference/lexical_analysis.rst:855 +#: ../../reference/lexical_analysis.rst:865 msgid "Integer literals" msgstr "" -#: ../../reference/lexical_analysis.rst:857 +#: ../../reference/lexical_analysis.rst:867 msgid "Integer literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:871 +#: ../../reference/lexical_analysis.rst:881 msgid "" "There is no limit for the length of integer literals apart from what can be " "stored in available memory." msgstr "" -#: ../../reference/lexical_analysis.rst:874 +#: ../../reference/lexical_analysis.rst:884 msgid "" "Underscores are ignored for determining the numeric value of the literal. " "They can be used to group digits for enhanced readability. One underscore " "can occur between digits, and after base specifiers like ``0x``." msgstr "" -#: ../../reference/lexical_analysis.rst:878 +#: ../../reference/lexical_analysis.rst:888 msgid "" "Note that leading zeros in a non-zero decimal number are not allowed. This " "is for disambiguation with C-style octal literals, which Python used before " "version 3.0." msgstr "" -#: ../../reference/lexical_analysis.rst:882 +#: ../../reference/lexical_analysis.rst:892 msgid "Some examples of integer literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:888 -#: ../../reference/lexical_analysis.rst:920 +#: ../../reference/lexical_analysis.rst:898 +#: ../../reference/lexical_analysis.rst:930 msgid "Underscores are now allowed for grouping purposes in literals." msgstr "" -#: ../../reference/lexical_analysis.rst:899 +#: ../../reference/lexical_analysis.rst:909 msgid "Floating point literals" msgstr "" -#: ../../reference/lexical_analysis.rst:901 +#: ../../reference/lexical_analysis.rst:911 msgid "" "Floating point literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:911 +#: ../../reference/lexical_analysis.rst:921 msgid "" "Note that the integer and exponent parts are always interpreted using radix " "10. For example, ``077e010`` is legal, and denotes the same number as " @@ -1061,19 +1076,19 @@ msgid "" "grouping." msgstr "" -#: ../../reference/lexical_analysis.rst:916 +#: ../../reference/lexical_analysis.rst:926 msgid "Some examples of floating point literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:929 +#: ../../reference/lexical_analysis.rst:939 msgid "Imaginary literals" msgstr "" -#: ../../reference/lexical_analysis.rst:931 +#: ../../reference/lexical_analysis.rst:941 msgid "Imaginary literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:936 +#: ../../reference/lexical_analysis.rst:946 msgid "" "An imaginary literal yields a complex number with a real part of 0.0. " "Complex numbers are represented as a pair of floating point numbers and have " @@ -1082,23 +1097,23 @@ msgid "" "Some examples of imaginary literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:948 +#: ../../reference/lexical_analysis.rst:958 msgid "Operators" msgstr "" -#: ../../reference/lexical_analysis.rst:952 +#: ../../reference/lexical_analysis.rst:962 msgid "The following tokens are operators:" msgstr "" -#: ../../reference/lexical_analysis.rst:965 +#: ../../reference/lexical_analysis.rst:975 msgid "Delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:979 msgid "The following tokens serve as delimiters in the grammar:" msgstr "" -#: ../../reference/lexical_analysis.rst:978 +#: ../../reference/lexical_analysis.rst:988 msgid "" "The period can also occur in floating-point and imaginary literals. A " "sequence of three periods has a special meaning as an ellipsis literal. The " @@ -1106,22 +1121,22 @@ msgid "" "as delimiters, but also perform an operation." msgstr "" -#: ../../reference/lexical_analysis.rst:983 +#: ../../reference/lexical_analysis.rst:993 msgid "" "The following printing ASCII characters have special meaning as part of " "other tokens or are otherwise significant to the lexical analyzer:" msgstr "" -#: ../../reference/lexical_analysis.rst:990 +#: ../../reference/lexical_analysis.rst:1000 msgid "" "The following printing ASCII characters are not used in Python. Their " "occurrence outside string literals and comments is an unconditional error:" msgstr "" -#: ../../reference/lexical_analysis.rst:999 +#: ../../reference/lexical_analysis.rst:1009 msgid "Footnotes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:1000 +#: ../../reference/lexical_analysis.rst:1010 msgid "https://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt" msgstr "https://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt" diff --git a/using/mac.po b/using/mac.po index 13bc9f7c00..96003a4b23 100644 --- a/using/mac.po +++ b/using/mac.po @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" -"PO-Revision-Date: 2022-02-12 19:12+0800\n" +"POT-Creation-Date: 2022-08-07 00:19+0000\n" +"PO-Revision-Date: 2022-08-31 22:26+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -20,7 +20,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.0.1\n" +"X-Generator: Poedit 3.1.1\n" #: ../../using/mac.rst:6 msgid "Using Python on a Mac" @@ -49,33 +49,35 @@ msgstr "取得和安裝 MacPython" #: ../../using/mac.rst:20 msgid "" -"macOS since version 10.8 comes with Python 2.7 pre-installed by Apple. If " -"you wish, you are invited to install the most recent version of Python 3 " -"from the Python website (https://www.python.org). A current \"universal " -"binary\" build of Python, which runs natively on the Mac's new Intel and " -"legacy PPC CPU's, is available there." +"macOS used to come with Python 2.7 pre-installed between versions 10.8 and " +"`12.3 `_. You are invited to install the most " +"recent version of Python 3 from the Python website (https://www.python." +"org). A current \"universal binary\" build of Python, which runs natively " +"on the Mac's new Intel and legacy PPC CPU's, is available there." msgstr "" -"macOS 自 10.8 版本開始預設安裝 Python 2.7。你也可以到 Python 網站 (https://" -"www.python.org) 安裝最新的 Python 3 版本。你可以找到建立在\"通用二進位 " -"(universal binary)\" 上的 Python 建置版本,它能夠原生地運行在 Mac 新的 Intel " -"CPU 與過去的 PPC CPU 上。" +"macOS 自 10.8 版本開始至 `12.3 版本 `_\\ 之間預" +"設安裝 Python 2.7。你也可以到 Python 網站 (https://www.python.org) 安裝最新" +"的 Python 3 版本。你可以找到建立在\"通用二進位 (universal binary)\" 上的 " +"Python 建置版本,它能夠原生地運行在 Mac 新的 Intel CPU 與過去的 PPC CPU 上。" -#: ../../using/mac.rst:26 +#: ../../using/mac.rst:27 msgid "What you get after installing is a number of things:" msgstr "在安裝後你必須要做幾件事:" -#: ../../using/mac.rst:28 +#: ../../using/mac.rst:29 msgid "" -"A :file:`Python 3.9` folder in your :file:`Applications` folder. In here you " -"find IDLE, the development environment that is a standard part of official " -"Python distributions; and PythonLauncher, which handles double-clicking " -"Python scripts from the Finder." +"A :file:`Python 3.12` folder in your :file:`Applications` folder. In here " +"you find IDLE, the development environment that is a standard part of " +"official Python distributions; and PythonLauncher, which handles double-" +"clicking Python scripts from the Finder." msgstr "" -"會有一個 :file:`Python 3.9` 資料夾在你的 :file:`Applications` 資料夾中。在這" +"會有一個 :file:`Python 3.12` 資料夾在你的 :file:`Applications` 資料夾中。在這" "裡你可以找到 IDLE,它是作為官方 Python 發行版標準組成的開發環境;以及 " "PythonLauncher,它負責處理在 Finder 中雙擊 Python 腳本的操作。" -#: ../../using/mac.rst:33 +#: ../../using/mac.rst:34 msgid "" "A framework :file:`/Library/Frameworks/Python.framework`, which includes the " "Python executable and libraries. The installer adds this location to your " @@ -87,7 +89,7 @@ msgstr "" "裝 MacPython ,你可以簡單地移除這三個專案。Python 可執行檔案的符號連結 " "(symlink) 則放在 /usr/local/bin/ 中。" -#: ../../using/mac.rst:38 +#: ../../using/mac.rst:39 msgid "" "The Apple-provided build of Python is installed in :file:`/System/Library/" "Frameworks/Python.framework` and :file:`/usr/bin/python`, respectively. You " @@ -103,7 +105,7 @@ msgstr "" "python.org 安裝較新的 Python 版本,那麼你的計算機上將安裝兩個不同但都可運作" "的 Python,因此你的路徑和用法與你想要執行的操作一致非常重要。" -#: ../../using/mac.rst:46 +#: ../../using/mac.rst:47 msgid "" "IDLE includes a help menu that allows you to access Python documentation. If " "you are completely new to Python you should start reading the tutorial " @@ -112,7 +114,7 @@ msgstr "" "IDLE 包含一個幫助選單,讓你可以參閱 Python 文件。如果你是 Python 的新手,你應" "該開始閱讀該文件中的教學介紹。" -#: ../../using/mac.rst:50 +#: ../../using/mac.rst:51 msgid "" "If you are familiar with Python on other Unix platforms you should read the " "section on running Python scripts from the Unix shell." @@ -120,11 +122,11 @@ msgstr "" "如果你熟悉其他 Unix 平臺上的 Python,那麼你應該閱讀有關從 Unix shell 執行 " "Python 腳本的部分。" -#: ../../using/mac.rst:55 +#: ../../using/mac.rst:56 msgid "How to run a Python script" msgstr "如何執行 Python 腳本" -#: ../../using/mac.rst:57 +#: ../../using/mac.rst:58 msgid "" "Your best way to get started with Python on macOS is through the IDLE " "integrated development environment, see section :ref:`ide` and use the Help " @@ -133,7 +135,7 @@ msgstr "" "在 macOS 上開始使用 Python 的最佳方法是透過 IDLE 整合開發環境,參見\\ :ref:" "`ide` 部分,並在 IDE 執行時使用幫助選單。" -#: ../../using/mac.rst:61 +#: ../../using/mac.rst:62 msgid "" "If you want to run Python scripts from the Terminal window command line or " "from the Finder you first need an editor to create your script. macOS comes " @@ -142,8 +144,8 @@ msgid "" "`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see http://www." "barebones.com/products/bbedit/index.html) are good choices, as is :program:" "`TextMate` (see https://macromates.com/). Other editors include :program:" -"`Gvim` (http://macvim-dev.github.io/macvim/) and :program:`Aquamacs` (http://" -"aquamacs.org/)." +"`Gvim` (https://macvim-dev.github.io/macvim/) and :program:`Aquamacs` " +"(http://aquamacs.org/)." msgstr "" "如果要從終端機視窗命令列或 Finder 執行 Python 腳本,首先需要一個編輯器來建立" "腳本。macOS 附帶了許多標準的 Unix 命令列編輯器,如 :program:`vim` 和 :" @@ -151,10 +153,10 @@ msgstr "" "Software 的 :program:`BBEdit` 或 :program:`TextWrangler`\\ (參見 http://www." "barebones.com/products/bbedit/index.html)是不錯的選擇,\\ :program:" "`TextMate`\\ (參見 https://macromates.com/)也是個選擇。其他編輯器包括 :" -"program:`Gvim`\\ (http://macvim-dev.github.io/macvim/)和 :program:" -"`Aquamacs`\\ (http://aquamacs.org/)。" +"program:`Gvim`\\ (https://macvim-dev.github.io/macvim/)和 :program:" +"`Aquamacs`\\ (https://aquamacs.org/)。" -#: ../../using/mac.rst:71 +#: ../../using/mac.rst:72 msgid "" "To run your script from the Terminal window you must make sure that :file:`/" "usr/local/bin` is in your shell search path." @@ -162,15 +164,15 @@ msgstr "" "要從終端機視窗執行腳本,你必須確保 :file:`/usr/local/bin` 位於 shell 搜尋路徑" "中。" -#: ../../using/mac.rst:74 +#: ../../using/mac.rst:75 msgid "To run your script from the Finder you have two options:" msgstr "從 Finder 執行你的腳本時,你有兩個選項:" -#: ../../using/mac.rst:76 +#: ../../using/mac.rst:77 msgid "Drag it to :program:`PythonLauncher`" msgstr "把它拖曳到 :program:`PythonLauncher`" -#: ../../using/mac.rst:78 +#: ../../using/mac.rst:79 msgid "" "Select :program:`PythonLauncher` as the default application to open your " "script (or any .py script) through the finder Info window and double-click " @@ -183,11 +185,11 @@ msgstr "" "制腳本啟動方式的選項。拖曳選項可以讓你一次更改多個選項,或使用其偏好設定選單" "以全域性地更改內容。" -#: ../../using/mac.rst:88 +#: ../../using/mac.rst:89 msgid "Running scripts with a GUI" msgstr "透過 GUI 執行腳本" -#: ../../using/mac.rst:90 +#: ../../using/mac.rst:91 msgid "" "With older versions of Python, there is one macOS quirk that you need to be " "aware of: programs that talk to the Aqua window manager (in other words, " @@ -198,17 +200,17 @@ msgstr "" "的程式(換而言之,任何具有 GUI(圖形化使用者介面)的程式)需要以特殊方式執" "行。使用 :program:`pythonw` 而不是 :program:`python` 來啟動這樣的腳本。" -#: ../../using/mac.rst:95 +#: ../../using/mac.rst:96 msgid "" "With Python 3.9, you can use either :program:`python` or :program:`pythonw`." msgstr "" "Python 3.9 上,你可以使用 :program:`python` 或者 :program:`pythonw`\\ 。" -#: ../../using/mac.rst:99 +#: ../../using/mac.rst:100 msgid "Configuration" msgstr "設定" -#: ../../using/mac.rst:101 +#: ../../using/mac.rst:102 msgid "" "Python on macOS honors all standard Unix environment variables such as :" "envvar:`PYTHONPATH`, but setting these variables for programs started from " @@ -221,7 +223,7 @@ msgstr "" "不會讀取你的 :file:`.profile` 或 :file:`.cshrc`\\ 。你需要建立一個檔案 :file:" "`~/.MacOSX/environment.plist`\\ 。相關資訊請參閱 Apple 的技術文件 QA1067。" -#: ../../using/mac.rst:108 +#: ../../using/mac.rst:109 msgid "" "For more information on installation Python packages in MacPython, see " "section :ref:`mac-package-manager`." @@ -229,11 +231,11 @@ msgstr "" "更多關於在 MacPython 中安裝 Python 套件的資訊,參閱 :ref:`mac-package-" "manager` 部分。" -#: ../../using/mac.rst:115 +#: ../../using/mac.rst:116 msgid "The IDE" msgstr "整合化開發工具 (IDE)" -#: ../../using/mac.rst:117 +#: ../../using/mac.rst:118 msgid "" "MacPython ships with the standard IDLE development environment. A good " "introduction to using IDLE can be found at http://www.hashcollision.org/hkn/" @@ -242,15 +244,15 @@ msgstr "" "MacPython 附帶標準的 IDLE 開發環境。有關使用 IDLE 的詳細介紹,請見 http://" "www.hashcollision.org/hkn/python/idle_intro/index.html\\ 。" -#: ../../using/mac.rst:125 +#: ../../using/mac.rst:126 msgid "Installing Additional Python Packages" msgstr "安裝額外的 Python 套件" -#: ../../using/mac.rst:127 +#: ../../using/mac.rst:128 msgid "There are several methods to install additional Python packages:" msgstr "有幾個方法可以安裝額外的 Python 套件:" -#: ../../using/mac.rst:129 +#: ../../using/mac.rst:130 msgid "" "Packages can be installed via the standard Python distutils mode (``python " "setup.py install``)." @@ -258,7 +260,7 @@ msgstr "" "可以透過標準的 Python distutils 模式(\\ ``python setup.py install``\\ )安裝" "套件。" -#: ../../using/mac.rst:132 +#: ../../using/mac.rst:133 msgid "" "Many packages can also be installed via the :program:`setuptools` extension " "or :program:`pip` wrapper, see https://pip.pypa.io/." @@ -266,17 +268,17 @@ msgstr "" "許多套件也可以透過 :program:`setuptools` 擴充套件或 :program:`pip` 包裝器 " "(wrapper) 安裝,請參閱 https://pip.pypa.io/\\ 。" -#: ../../using/mac.rst:137 +#: ../../using/mac.rst:138 msgid "GUI Programming on the Mac" msgstr "於 Mac 上開發 GUI 程式" -#: ../../using/mac.rst:139 +#: ../../using/mac.rst:140 msgid "" "There are several options for building GUI applications on the Mac with " "Python." msgstr "於 Mac 上使用 Python 來建立 GUI 應用程式有許多選項。" -#: ../../using/mac.rst:141 +#: ../../using/mac.rst:142 msgid "" "*PyObjC* is a Python binding to Apple's Objective-C/Cocoa framework, which " "is the foundation of most modern Mac development. Information on PyObjC is " @@ -286,7 +288,7 @@ msgstr "" "多數現代 Mac 開發的基礎。有關 PyObjC 的資訊,請見 https://pypi.org/project/" "pyobjc/。" -#: ../../using/mac.rst:145 +#: ../../using/mac.rst:146 msgid "" "The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-" "platform Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is " @@ -297,7 +299,7 @@ msgstr "" "(https://www.tcl.tk)。Apple 的 OS X 包含了 Aqua 原生版本的 Tk,最新版本可以" "從 https://www.activestate.com 下載和安裝;它也可以從原始碼開始建置。" -#: ../../using/mac.rst:150 +#: ../../using/mac.rst:151 msgid "" "*wxPython* is another popular cross-platform GUI toolkit that runs natively " "on macOS. Packages and documentation are available from https://www.wxpython." @@ -306,7 +308,7 @@ msgstr "" "*wxPython* 是另一種流行的跨平臺 GUI 工具套件,可在 macOS 上本機執行。套件和文" "件可從 https://www.wxpython.org 獲得。" -#: ../../using/mac.rst:153 +#: ../../using/mac.rst:154 msgid "" "*PyQt* is another popular cross-platform GUI toolkit that runs natively on " "macOS. More information can be found at https://riverbankcomputing.com/" @@ -315,11 +317,11 @@ msgstr "" "*PyQt* 是另一種流行的跨平臺 GUI 工具套件,可在原生 macOS 上執行。更多資訊可" "在 https://riverbankcomputing.com/software/pyqt/intro 上找到。" -#: ../../using/mac.rst:159 +#: ../../using/mac.rst:160 msgid "Distributing Python Applications on the Mac" msgstr "於 Mac 上發行 Python 應用程式" -#: ../../using/mac.rst:161 +#: ../../using/mac.rst:162 msgid "" "The standard tool for deploying standalone Python applications on the Mac " "is :program:`py2app`. More information on installing and using py2app can be " @@ -328,25 +330,25 @@ msgstr "" "在 Mac 上部署獨立 Python 應用程式的標準工具是 :program:`py2app`\\ 。有關安裝" "和使用 py2app 的更多資訊,請參考 https://pypi.org/project/py2app/\\ 。" -#: ../../using/mac.rst:167 +#: ../../using/mac.rst:168 msgid "Other Resources" msgstr "其他資源" -#: ../../using/mac.rst:169 +#: ../../using/mac.rst:170 msgid "" "The MacPython mailing list is an excellent support resource for Python users " "and developers on the Mac:" msgstr "" "MacPython 郵件清單對於 Mac 上的 Python 使用者和開發者是一個極佳的支援資源:" -#: ../../using/mac.rst:172 +#: ../../using/mac.rst:173 msgid "https://www.python.org/community/sigs/current/pythonmac-sig/" msgstr "https://www.python.org/community/sigs/current/pythonmac-sig/" -#: ../../using/mac.rst:174 +#: ../../using/mac.rst:175 msgid "Another useful resource is the MacPython wiki:" msgstr "另一個好用資源是 MacPython wiki:" -#: ../../using/mac.rst:176 +#: ../../using/mac.rst:177 msgid "https://wiki.python.org/moin/MacPython" msgstr "https://wiki.python.org/moin/MacPython" diff --git a/using/windows.po b/using/windows.po index f7e637b73a..ab95aafab1 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-21 00:17+0000\n" +"POT-Creation-Date: 2022-08-03 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -267,8 +267,8 @@ msgstr "" #: ../../using/windows.rst:142 ../../using/windows.rst:165 #: ../../using/windows.rst:168 ../../using/windows.rst:177 -#: ../../using/windows.rst:195 ../../using/windows.rst:203 -#: ../../using/windows.rst:206 +#: ../../using/windows.rst:199 ../../using/windows.rst:207 +#: ../../using/windows.rst:210 msgid "0" msgstr "0" @@ -321,7 +321,7 @@ msgstr "DefaultCustomTargetDir" msgid "The default custom install directory displayed in the UI" msgstr "" -#: ../../using/windows.rst:159 ../../using/windows.rst:208 +#: ../../using/windows.rst:159 ../../using/windows.rst:212 msgid "(empty)" msgstr "" @@ -335,10 +335,10 @@ msgstr "當執行程序也被安裝時創造檔案關聯" #: ../../using/windows.rst:162 ../../using/windows.rst:172 #: ../../using/windows.rst:175 ../../using/windows.rst:179 -#: ../../using/windows.rst:182 ../../using/windows.rst:185 -#: ../../using/windows.rst:187 ../../using/windows.rst:190 -#: ../../using/windows.rst:193 ../../using/windows.rst:197 -#: ../../using/windows.rst:199 ../../using/windows.rst:201 +#: ../../using/windows.rst:183 ../../using/windows.rst:187 +#: ../../using/windows.rst:189 ../../using/windows.rst:193 +#: ../../using/windows.rst:197 ../../using/windows.rst:201 +#: ../../using/windows.rst:203 ../../using/windows.rst:205 msgid "1" msgstr "1" @@ -390,126 +390,134 @@ msgid "Include_dev" msgstr "Include_dev" #: ../../using/windows.rst:179 -msgid "Install developer headers and libraries" +msgid "" +"Install developer headers and libraries. Omitting this may lead to an " +"unusable installation." msgstr "" -#: ../../using/windows.rst:182 +#: ../../using/windows.rst:183 msgid "Include_exe" msgstr "Include_exe" -#: ../../using/windows.rst:182 -msgid "Install :file:`python.exe` and related files" +#: ../../using/windows.rst:183 +msgid "" +"Install :file:`python.exe` and related files. Omitting this may lead to an " +"unusable installation." msgstr "" -#: ../../using/windows.rst:185 +#: ../../using/windows.rst:187 msgid "Include_launcher" msgstr "Include_launcher" -#: ../../using/windows.rst:185 +#: ../../using/windows.rst:187 msgid "Install :ref:`launcher`." msgstr "" -#: ../../using/windows.rst:187 +#: ../../using/windows.rst:189 msgid "InstallLauncherAllUsers" msgstr "InstallLauncherAllUsers" -#: ../../using/windows.rst:187 -msgid "Installs :ref:`launcher` for all users." +#: ../../using/windows.rst:189 +msgid "" +"Installs the launcher for all users. Also requires ``Include_launcher`` to " +"be set to 1" msgstr "" -#: ../../using/windows.rst:190 +#: ../../using/windows.rst:193 msgid "Include_lib" msgstr "Include_lib" -#: ../../using/windows.rst:190 -msgid "Install standard library and extension modules" +#: ../../using/windows.rst:193 +msgid "" +"Install standard library and extension modules. Omitting this may lead to an " +"unusable installation." msgstr "" -#: ../../using/windows.rst:193 +#: ../../using/windows.rst:197 msgid "Include_pip" msgstr "Include_pip" -#: ../../using/windows.rst:193 +#: ../../using/windows.rst:197 msgid "Install bundled pip and setuptools" msgstr "" -#: ../../using/windows.rst:195 +#: ../../using/windows.rst:199 msgid "Include_symbols" msgstr "Include_symbols" -#: ../../using/windows.rst:195 +#: ../../using/windows.rst:199 msgid "Install debugging symbols (`*`.pdb)" msgstr "" -#: ../../using/windows.rst:197 +#: ../../using/windows.rst:201 msgid "Include_tcltk" msgstr "Include_tcltk" -#: ../../using/windows.rst:197 +#: ../../using/windows.rst:201 msgid "Install Tcl/Tk support and IDLE" msgstr "" -#: ../../using/windows.rst:199 +#: ../../using/windows.rst:203 msgid "Include_test" msgstr "Include_test" -#: ../../using/windows.rst:199 +#: ../../using/windows.rst:203 msgid "Install standard library test suite" msgstr "" -#: ../../using/windows.rst:201 +#: ../../using/windows.rst:205 msgid "Include_tools" msgstr "Include_tools" -#: ../../using/windows.rst:201 +#: ../../using/windows.rst:205 msgid "Install utility scripts" msgstr "" -#: ../../using/windows.rst:203 +#: ../../using/windows.rst:207 msgid "LauncherOnly" msgstr "LauncherOnly" -#: ../../using/windows.rst:203 +#: ../../using/windows.rst:207 msgid "Only installs the launcher. This will override most other options." msgstr "" -#: ../../using/windows.rst:206 +#: ../../using/windows.rst:210 msgid "SimpleInstall" msgstr "SimpleInstall" -#: ../../using/windows.rst:206 +#: ../../using/windows.rst:210 msgid "Disable most install UI" msgstr "" -#: ../../using/windows.rst:208 +#: ../../using/windows.rst:212 msgid "SimpleInstallDescription" msgstr "SimpleInstallDescription" -#: ../../using/windows.rst:208 +#: ../../using/windows.rst:212 msgid "A custom message to display when the simplified install UI is used." msgstr "" -#: ../../using/windows.rst:212 +#: ../../using/windows.rst:216 msgid "" "For example, to silently install a default, system-wide Python installation, " "you could use the following command (from an elevated command prompt)::" msgstr "" -#: ../../using/windows.rst:217 +#: ../../using/windows.rst:221 msgid "" "To allow users to easily install a personal copy of Python without the test " "suite, you could provide a shortcut with the following command. This will " "display a simplified initial page and disallow customization::" msgstr "" -#: ../../using/windows.rst:224 +#: ../../using/windows.rst:228 msgid "" "(Note that omitting the launcher also omits file associations, and is only " "recommended for per-user installs when there is also a system-wide " "installation that included the launcher.)" msgstr "" -#: ../../using/windows.rst:228 +#: ../../using/windows.rst:232 msgid "" "The options listed above can also be provided in a file named ``unattend." "xml`` alongside the executable. This file specifies a list of options and " @@ -518,11 +526,11 @@ msgid "" "strings. This example file sets the same options as the previous example:" msgstr "" -#: ../../using/windows.rst:247 +#: ../../using/windows.rst:251 msgid "Installing Without Downloading" msgstr "當安裝時不下載" -#: ../../using/windows.rst:249 +#: ../../using/windows.rst:253 msgid "" "As some features of Python are not included in the initial installer " "download, selecting those features may require an internet connection. To " @@ -533,7 +541,7 @@ msgid "" "to be performed it is very useful to have a locally cached copy." msgstr "" -#: ../../using/windows.rst:257 +#: ../../using/windows.rst:261 msgid "" "Execute the following command from Command Prompt to download all possible " "required files. Remember to substitute ``python-3.9.0.exe`` for the actual " @@ -541,23 +549,23 @@ msgid "" "avoid collisions between files with the same name." msgstr "" -#: ../../using/windows.rst:266 +#: ../../using/windows.rst:270 msgid "" "You may also specify the ``/quiet`` option to hide the progress display." msgstr "" -#: ../../using/windows.rst:269 +#: ../../using/windows.rst:273 msgid "Modifying an install" msgstr "" -#: ../../using/windows.rst:271 +#: ../../using/windows.rst:275 msgid "" "Once Python has been installed, you can add or remove features through the " "Programs and Features tool that is part of Windows. Select the Python entry " "and choose \"Uninstall/Change\" to open the installer in maintenance mode." msgstr "" -#: ../../using/windows.rst:275 +#: ../../using/windows.rst:279 msgid "" "\"Modify\" allows you to add or remove features by modifying the checkboxes " "- unchanged checkboxes will not install or remove anything. Some options " @@ -565,42 +573,42 @@ msgid "" "these, you will need to remove and then reinstall Python completely." msgstr "" -#: ../../using/windows.rst:280 +#: ../../using/windows.rst:284 msgid "" "\"Repair\" will verify all the files that should be installed using the " "current settings and replace any that have been removed or modified." msgstr "" -#: ../../using/windows.rst:283 +#: ../../using/windows.rst:287 msgid "" "\"Uninstall\" will remove Python entirely, with the exception of the :ref:" "`launcher`, which has its own entry in Programs and Features." msgstr "" -#: ../../using/windows.rst:290 +#: ../../using/windows.rst:294 msgid "The Microsoft Store package" msgstr "" -#: ../../using/windows.rst:294 +#: ../../using/windows.rst:298 msgid "" "The Microsoft Store package is an easily installable Python interpreter that " "is intended mainly for interactive use, for example, by students." msgstr "" -#: ../../using/windows.rst:297 +#: ../../using/windows.rst:301 msgid "" "To install the package, ensure you have the latest Windows 10 updates and " "search the Microsoft Store app for \"Python |version|\". Ensure that the app " "you select is published by the Python Software Foundation, and install it." msgstr "" -#: ../../using/windows.rst:302 +#: ../../using/windows.rst:306 msgid "" "Python will always be available for free on the Microsoft Store. If you are " "asked to pay for it, you have not selected the correct package." msgstr "" -#: ../../using/windows.rst:305 +#: ../../using/windows.rst:309 msgid "" "After installation, Python may be launched by finding it in Start. " "Alternatively, it will be available from any Command Prompt or PowerShell " @@ -608,7 +616,7 @@ msgid "" "``pip`` or ``idle``. IDLE can also be found in Start." msgstr "" -#: ../../using/windows.rst:310 +#: ../../using/windows.rst:314 msgid "" "All three commands are also available with version number suffixes, for " "example, as ``python3.exe`` and ``python3.x.exe`` as well as ``python.exe`` " @@ -619,13 +627,13 @@ msgid "" "of ``python`` is selected." msgstr "" -#: ../../using/windows.rst:318 +#: ../../using/windows.rst:322 msgid "" "Virtual environments can be created with ``python -m venv`` and activated " "and used as normal." msgstr "" -#: ../../using/windows.rst:321 +#: ../../using/windows.rst:325 msgid "" "If you have installed another version of Python and added it to your " "``PATH`` variable, it will be available as ``python.exe`` rather than the " @@ -633,13 +641,13 @@ msgid "" "exe`` or ``python3.x.exe``." msgstr "" -#: ../../using/windows.rst:326 +#: ../../using/windows.rst:330 msgid "" "The ``py.exe`` launcher will detect this Python installation, but will " "prefer installations from the traditional installer." msgstr "" -#: ../../using/windows.rst:329 +#: ../../using/windows.rst:333 msgid "" "To remove Python, open Settings and use Apps and Features, or else find " "Python in Start and right-click to select Uninstall. Uninstalling will " @@ -647,15 +655,15 @@ msgid "" "but will not remove any virtual environments" msgstr "" -#: ../../using/windows.rst:335 +#: ../../using/windows.rst:339 msgid "Known issues" msgstr "" -#: ../../using/windows.rst:338 +#: ../../using/windows.rst:342 msgid "Redirection of local data, registry, and temporary paths" msgstr "" -#: ../../using/windows.rst:340 +#: ../../using/windows.rst:344 msgid "" "Because of restrictions on Microsoft Store apps, Python scripts may not have " "full write access to shared locations such as :envvar:`TEMP` and the " @@ -663,7 +671,7 @@ msgid "" "modify the shared locations, you will need to install the full installer." msgstr "" -#: ../../using/windows.rst:345 +#: ../../using/windows.rst:349 msgid "" "At runtime, Python will use a private copy of well-known Windows folders and " "the registry. For example, if the environment variable :envvar:`%APPDATA%` " @@ -673,7 +681,7 @@ msgid "" "Python.3.8_qbz5n2kfra8p0\\\\LocalCache\\\\Local\\\\`." msgstr "" -#: ../../using/windows.rst:350 +#: ../../using/windows.rst:354 msgid "" "When reading files, Windows will return the file from the private folder, or " "if that does not exist, the real Windows directory. For example reading :" @@ -682,36 +690,36 @@ msgid "" "\\\\package_name\\\\VFS\\\\SystemX86`." msgstr "" -#: ../../using/windows.rst:354 +#: ../../using/windows.rst:358 msgid "" "You can find the real path of any existing file using :func:`os.path." "realpath`:" msgstr "" -#: ../../using/windows.rst:363 +#: ../../using/windows.rst:367 msgid "When writing to the Windows Registry, the following behaviors exist:" msgstr "" -#: ../../using/windows.rst:365 +#: ../../using/windows.rst:369 msgid "" "Reading from ``HKLM\\\\Software`` is allowed and results are merged with " "the :file:`registry.dat` file in the package." msgstr "" -#: ../../using/windows.rst:366 +#: ../../using/windows.rst:370 msgid "" "Writing to ``HKLM\\\\Software`` is not allowed if the corresponding key/" "value exists, i.e. modifying existing keys." msgstr "" -#: ../../using/windows.rst:367 +#: ../../using/windows.rst:371 msgid "" "Writing to ``HKLM\\\\Software`` is allowed as long as a corresponding key/" "value does not exist in the package and the user has the correct access " "permissions." msgstr "" -#: ../../using/windows.rst:370 +#: ../../using/windows.rst:374 msgid "" "For more detail on the technical basis for these limitations, please consult " "Microsoft's documentation on packaged full-trust apps, currently available " @@ -720,11 +728,11 @@ msgid "" "behind-the-scenes>`_" msgstr "" -#: ../../using/windows.rst:379 +#: ../../using/windows.rst:383 msgid "The nuget.org packages" msgstr "" -#: ../../using/windows.rst:383 +#: ../../using/windows.rst:387 msgid "" "The nuget.org package is a reduced size Python environment intended for use " "on continuous integration and build systems that do not have a system-wide " @@ -732,14 +740,14 @@ msgid "" "works perfectly fine for packages containing build-time tools." msgstr "" -#: ../../using/windows.rst:388 +#: ../../using/windows.rst:392 msgid "" "Visit `nuget.org `_ for the most up-to-date " "information on using nuget. What follows is a summary that is sufficient for " "Python developers." msgstr "" -#: ../../using/windows.rst:392 +#: ../../using/windows.rst:396 msgid "" "The ``nuget.exe`` command line tool may be downloaded directly from " "``https://aka.ms/nugetclidl``, for example, using curl or PowerShell. With " @@ -747,7 +755,7 @@ msgid "" "installed using::" msgstr "" -#: ../../using/windows.rst:400 +#: ../../using/windows.rst:404 msgid "" "To select a particular version, add a ``-Version 3.x.y``. The output " "directory may be changed from ``.``, and the package will be installed into " @@ -757,7 +765,7 @@ msgid "" "directory that contains the Python installation:" msgstr "" -#: ../../using/windows.rst:417 +#: ../../using/windows.rst:421 msgid "" "In general, nuget packages are not upgradeable, and newer versions should be " "installed side-by-side and referenced using the full path. Alternatively, " @@ -765,7 +773,7 @@ msgid "" "will do this automatically if they do not preserve files between builds." msgstr "" -#: ../../using/windows.rst:422 +#: ../../using/windows.rst:426 msgid "" "Alongside the ``tools`` directory is a ``build\\native`` directory. This " "contains a MSBuild properties file ``python.props`` that can be used in a C+" @@ -773,7 +781,7 @@ msgid "" "automatically use the headers and import libraries in your build." msgstr "" -#: ../../using/windows.rst:427 +#: ../../using/windows.rst:431 msgid "" "The package information pages on nuget.org are `www.nuget.org/packages/" "python `_ for the 64-bit version and " @@ -781,18 +789,18 @@ msgid "" "pythonx86>`_ for the 32-bit version." msgstr "" -#: ../../using/windows.rst:436 +#: ../../using/windows.rst:440 msgid "The embeddable package" msgstr "" -#: ../../using/windows.rst:440 +#: ../../using/windows.rst:444 msgid "" "The embedded distribution is a ZIP file containing a minimal Python " "environment. It is intended for acting as part of another application, " "rather than being directly accessed by end-users." msgstr "" -#: ../../using/windows.rst:444 +#: ../../using/windows.rst:448 msgid "" "When extracted, the embedded distribution is (almost) fully isolated from " "the user's system, including environment variables, system registry " @@ -803,7 +811,7 @@ msgid "" "documentation are not included." msgstr "" -#: ../../using/windows.rst:453 +#: ../../using/windows.rst:457 msgid "" "The embedded distribution does not include the `Microsoft C Runtime `_" msgstr "`ActivePython `_" -#: ../../using/windows.rst:521 +#: ../../using/windows.rst:525 msgid "Installer with multi-platform compatibility, documentation, PyWin32" msgstr "" -#: ../../using/windows.rst:525 +#: ../../using/windows.rst:529 msgid "`Anaconda `_" msgstr "`Anaconda `_" -#: ../../using/windows.rst:524 +#: ../../using/windows.rst:528 msgid "" "Popular scientific modules (such as numpy, scipy and pandas) and the " "``conda`` package manager." msgstr "" -#: ../../using/windows.rst:531 +#: ../../using/windows.rst:535 msgid "`Enthought Deployment Manager `_" msgstr "`Enthought Deployment Manager `_" -#: ../../using/windows.rst:528 +#: ../../using/windows.rst:532 msgid "\"The Next Generation Python Environment and Package Manager\"." msgstr "" -#: ../../using/windows.rst:530 +#: ../../using/windows.rst:534 msgid "" "Previously Enthought provided Canopy, but it `reached end of life in 2016 " "`_." msgstr "" -#: ../../using/windows.rst:535 +#: ../../using/windows.rst:539 msgid "`WinPython `_" msgstr "`WinPython `_" -#: ../../using/windows.rst:534 +#: ../../using/windows.rst:538 msgid "" "Windows-specific distribution with prebuilt scientific packages and tools " "for building packages." msgstr "" -#: ../../using/windows.rst:537 +#: ../../using/windows.rst:541 msgid "" "Note that these packages may not include the latest versions of Python or " "other libraries, and are not maintained or supported by the core Python team." msgstr "" -#: ../../using/windows.rst:543 +#: ../../using/windows.rst:547 msgid "Configuring Python" msgstr "設定 Python" -#: ../../using/windows.rst:545 +#: ../../using/windows.rst:549 msgid "" "To run Python conveniently from a command prompt, you might consider " "changing some default environment variables in Windows. While the installer " @@ -968,29 +976,29 @@ msgid "" "use multiple versions of Python, consider using the :ref:`launcher`." msgstr "" -#: ../../using/windows.rst:555 +#: ../../using/windows.rst:559 msgid "Excursus: Setting environment variables" msgstr "" -#: ../../using/windows.rst:557 +#: ../../using/windows.rst:561 msgid "" "Windows allows environment variables to be configured permanently at both " "the User level and the System level, or temporarily in a command prompt." msgstr "" -#: ../../using/windows.rst:560 +#: ../../using/windows.rst:564 msgid "" "To temporarily set environment variables, open Command Prompt and use the :" "command:`set` command:" msgstr "" -#: ../../using/windows.rst:569 +#: ../../using/windows.rst:573 msgid "" "These changes will apply to any further commands executed in that console, " "and will be inherited by any applications started from the console." msgstr "" -#: ../../using/windows.rst:572 +#: ../../using/windows.rst:576 msgid "" "Including the variable name within percent signs will expand to the existing " "value, allowing you to add your new value at either the start or the end. " @@ -999,7 +1007,7 @@ msgid "" "launched." msgstr "" -#: ../../using/windows.rst:578 +#: ../../using/windows.rst:582 msgid "" "To permanently modify the default environment variables, click Start and " "search for 'edit environment variables', or open System properties, :" @@ -1009,20 +1017,20 @@ msgid "" "your machine (i.e. Administrator rights)." msgstr "" -#: ../../using/windows.rst:587 +#: ../../using/windows.rst:591 msgid "" "Windows will concatenate User variables *after* System variables, which may " "cause unexpected results when modifying :envvar:`PATH`." msgstr "" -#: ../../using/windows.rst:590 +#: ../../using/windows.rst:594 msgid "" "The :envvar:`PYTHONPATH` variable is used by all versions of Python, so you " "should not permanently configure it unless the listed paths only include " "code that is compatible with all of your installed Python versions." msgstr "" -#: ../../using/windows.rst:598 +#: ../../using/windows.rst:602 msgid "" "https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" "variables" @@ -1030,11 +1038,11 @@ msgstr "" "https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" "variables" -#: ../../using/windows.rst:598 +#: ../../using/windows.rst:602 msgid "Overview of environment variables on Windows" msgstr "Windows 上的環境變數概要" -#: ../../using/windows.rst:601 +#: ../../using/windows.rst:605 msgid "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/set_1" @@ -1042,11 +1050,11 @@ msgstr "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/set_1" -#: ../../using/windows.rst:601 +#: ../../using/windows.rst:605 msgid "The ``set`` command, for temporarily modifying environment variables" msgstr "" -#: ../../using/windows.rst:603 +#: ../../using/windows.rst:607 msgid "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/setx" @@ -1054,22 +1062,22 @@ msgstr "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/setx" -#: ../../using/windows.rst:604 +#: ../../using/windows.rst:608 msgid "The ``setx`` command, for permanently modifying environment variables" msgstr "" -#: ../../using/windows.rst:610 +#: ../../using/windows.rst:614 msgid "Finding the Python executable" msgstr "" -#: ../../using/windows.rst:614 +#: ../../using/windows.rst:618 msgid "" "Besides using the automatically created start menu entry for the Python " "interpreter, you might want to start Python in the command prompt. The " "installer has an option to set that up for you." msgstr "" -#: ../../using/windows.rst:618 +#: ../../using/windows.rst:622 msgid "" "On the first page of the installer, an option labelled \"Add Python to PATH" "\" may be selected to have the installer add the install location into the :" @@ -1080,7 +1088,7 @@ msgid "" "documentation." msgstr "" -#: ../../using/windows.rst:625 +#: ../../using/windows.rst:629 msgid "" "If you don't enable this option at install time, you can always re-run the " "installer, select Modify, and enable it. Alternatively, you can manually " @@ -1091,24 +1099,24 @@ msgid "" "entries already existed)::" msgstr "" -#: ../../using/windows.rst:638 +#: ../../using/windows.rst:642 msgid "UTF-8 mode" msgstr "" -#: ../../using/windows.rst:642 +#: ../../using/windows.rst:646 msgid "" "Windows still uses legacy encodings for the system encoding (the ANSI Code " "Page). Python uses it for the default encoding of text files (e.g. :func:" "`locale.getpreferredencoding`)." msgstr "" -#: ../../using/windows.rst:646 +#: ../../using/windows.rst:650 msgid "" "This may cause issues because UTF-8 is widely used on the internet and most " "Unix systems, including WSL (Windows Subsystem for Linux)." msgstr "" -#: ../../using/windows.rst:649 +#: ../../using/windows.rst:653 msgid "" "You can use the :ref:`Python UTF-8 Mode ` to change the default " "text encoding to UTF-8. You can enable the :ref:`Python UTF-8 Mode ` is enabled, you can still use " "the system encoding (the ANSI Code Page) via the \"mbcs\" codec." msgstr "" -#: ../../using/windows.rst:658 +#: ../../using/windows.rst:662 msgid "" "Note that adding ``PYTHONUTF8=1`` to the default environment variables will " "affect all Python 3.7+ applications on your system. If you have any Python " @@ -1132,27 +1140,27 @@ msgid "" "utf8`` command line option." msgstr "" -#: ../../using/windows.rst:665 +#: ../../using/windows.rst:669 msgid "" "Even when UTF-8 mode is disabled, Python uses UTF-8 by default on Windows " "for:" msgstr "" -#: ../../using/windows.rst:668 +#: ../../using/windows.rst:672 msgid "Console I/O including standard I/O (see :pep:`528` for details)." msgstr "" -#: ../../using/windows.rst:669 +#: ../../using/windows.rst:673 msgid "" "The :term:`filesystem encoding ` " "(see :pep:`529` for details)." msgstr "" -#: ../../using/windows.rst:676 +#: ../../using/windows.rst:680 msgid "Python Launcher for Windows" msgstr "" -#: ../../using/windows.rst:680 +#: ../../using/windows.rst:684 msgid "" "The Python launcher for Windows is a utility which aids in locating and " "executing of different Python versions. It allows scripts (or the command-" @@ -1160,7 +1168,7 @@ msgid "" "locate and execute that version." msgstr "" -#: ../../using/windows.rst:685 +#: ../../using/windows.rst:689 msgid "" "Unlike the :envvar:`PATH` variable, the launcher will correctly select the " "most appropriate version of Python. It will prefer per-user installations " @@ -1168,19 +1176,19 @@ msgid "" "most recently installed version." msgstr "" -#: ../../using/windows.rst:690 +#: ../../using/windows.rst:694 msgid "The launcher was originally specified in :pep:`397`." msgstr "" -#: ../../using/windows.rst:693 +#: ../../using/windows.rst:697 msgid "Getting started" msgstr "開始" -#: ../../using/windows.rst:696 +#: ../../using/windows.rst:700 msgid "From the command-line" msgstr "" -#: ../../using/windows.rst:700 +#: ../../using/windows.rst:704 msgid "" "System-wide installations of Python 3.3 and later will put the launcher on " "your :envvar:`PATH`. The launcher is compatible with all available versions " @@ -1188,54 +1196,54 @@ msgid "" "the launcher is available, execute the following command in Command Prompt::" msgstr "" -#: ../../using/windows.rst:707 +#: ../../using/windows.rst:711 msgid "" "You should find that the latest version of Python you have installed is " "started - it can be exited as normal, and any additional command-line " "arguments specified will be sent directly to Python." msgstr "" -#: ../../using/windows.rst:711 +#: ../../using/windows.rst:715 msgid "" "If you have multiple versions of Python installed (e.g., 3.7 and |version|) " "you will have noticed that Python |version| was started - to launch Python " "3.7, try the command::" msgstr "" -#: ../../using/windows.rst:717 +#: ../../using/windows.rst:721 msgid "" "If you want the latest version of Python 2 you have installed, try the " "command::" msgstr "" -#: ../../using/windows.rst:722 +#: ../../using/windows.rst:726 msgid "You should find the latest version of Python 3.x starts." msgstr "" -#: ../../using/windows.rst:724 +#: ../../using/windows.rst:728 msgid "" "If you see the following error, you do not have the launcher installed::" msgstr "" -#: ../../using/windows.rst:729 +#: ../../using/windows.rst:733 msgid "" "Per-user installations of Python do not add the launcher to :envvar:`PATH` " "unless the option was selected on installation." msgstr "" -#: ../../using/windows.rst:732 +#: ../../using/windows.rst:736 msgid "The command::" msgstr "" -#: ../../using/windows.rst:736 +#: ../../using/windows.rst:740 msgid "displays the currently installed version(s) of Python." msgstr "" -#: ../../using/windows.rst:739 +#: ../../using/windows.rst:743 msgid "Virtual environments" msgstr "虛擬環境(Virtual environment)" -#: ../../using/windows.rst:743 +#: ../../using/windows.rst:747 msgid "" "If the launcher is run with no explicit Python version specification, and a " "virtual environment (created with the standard library :mod:`venv` module or " @@ -1245,27 +1253,27 @@ msgid "" "specify the global Python version." msgstr "" -#: ../../using/windows.rst:751 +#: ../../using/windows.rst:755 msgid "From a script" msgstr "" -#: ../../using/windows.rst:753 +#: ../../using/windows.rst:757 msgid "" "Let's create a test Python script - create a file called ``hello.py`` with " "the following contents" msgstr "" -#: ../../using/windows.rst:762 +#: ../../using/windows.rst:766 msgid "From the directory in which hello.py lives, execute the command::" msgstr "" -#: ../../using/windows.rst:766 +#: ../../using/windows.rst:770 msgid "" "You should notice the version number of your latest Python 2.x installation " "is printed. Now try changing the first line to be:" msgstr "" -#: ../../using/windows.rst:773 +#: ../../using/windows.rst:777 msgid "" "Re-executing the command should now print the latest Python 3.x information. " "As with the above command-line examples, you can specify a more explicit " @@ -1274,7 +1282,7 @@ msgid "" "information printed." msgstr "" -#: ../../using/windows.rst:779 +#: ../../using/windows.rst:783 msgid "" "Note that unlike interactive use, a bare \"python\" will use the latest " "version of Python 2.x that you have installed. This is for backward " @@ -1282,11 +1290,11 @@ msgid "" "typically refers to Python 2." msgstr "" -#: ../../using/windows.rst:785 +#: ../../using/windows.rst:789 msgid "From file associations" msgstr "從檔案關聯" -#: ../../using/windows.rst:787 +#: ../../using/windows.rst:791 msgid "" "The launcher should have been associated with Python files (i.e. ``.py``, ``." "pyw``, ``.pyc`` files) when it was installed. This means that when you " @@ -1295,17 +1303,17 @@ msgid "" "have the script specify the version which should be used." msgstr "" -#: ../../using/windows.rst:793 +#: ../../using/windows.rst:797 msgid "" "The key benefit of this is that a single launcher can support multiple " "Python versions at the same time depending on the contents of the first line." msgstr "" -#: ../../using/windows.rst:797 +#: ../../using/windows.rst:801 msgid "Shebang Lines" msgstr "" -#: ../../using/windows.rst:799 +#: ../../using/windows.rst:803 msgid "" "If the first line of a script file starts with ``#!``, it is known as a " "\"shebang\" line. Linux and other Unix like operating systems have native " @@ -1315,34 +1323,34 @@ msgid "" "demonstrate their use." msgstr "" -#: ../../using/windows.rst:806 +#: ../../using/windows.rst:810 msgid "" "To allow shebang lines in Python scripts to be portable between Unix and " "Windows, this launcher supports a number of 'virtual' commands to specify " "which interpreter to use. The supported virtual commands are:" msgstr "" -#: ../../using/windows.rst:810 +#: ../../using/windows.rst:814 msgid "``/usr/bin/env python``" msgstr "``/usr/bin/env python``" -#: ../../using/windows.rst:811 +#: ../../using/windows.rst:815 msgid "``/usr/bin/python``" msgstr "``/usr/bin/python``" -#: ../../using/windows.rst:812 +#: ../../using/windows.rst:816 msgid "``/usr/local/bin/python``" msgstr "``/usr/local/bin/python``" -#: ../../using/windows.rst:813 +#: ../../using/windows.rst:817 msgid "``python``" msgstr "``python``" -#: ../../using/windows.rst:815 +#: ../../using/windows.rst:819 msgid "For example, if the first line of your script starts with" msgstr "" -#: ../../using/windows.rst:821 +#: ../../using/windows.rst:825 msgid "" "The default Python will be located and used. As many Python scripts written " "to work on Unix will already have this line, you should find these scripts " @@ -1351,7 +1359,7 @@ msgid "" "of the shebang lines starting with ``/usr``." msgstr "" -#: ../../using/windows.rst:827 +#: ../../using/windows.rst:831 msgid "" "Any of the above virtual commands can be suffixed with an explicit version " "(either just the major version, or the major and minor version). Furthermore " @@ -1360,14 +1368,14 @@ msgid "" "python 3.7." msgstr "" -#: ../../using/windows.rst:835 +#: ../../using/windows.rst:839 msgid "" "Beginning with python launcher 3.7 it is possible to request 64-bit version " "by the \"-64\" suffix. Furthermore it is possible to specify a major and " "architecture without minor (i.e. ``/usr/bin/python3-64``)." msgstr "" -#: ../../using/windows.rst:839 +#: ../../using/windows.rst:843 msgid "" "The ``/usr/bin/env`` form of shebang line has one further special property. " "Before looking for installed Python interpreters, this form will search the " @@ -1376,29 +1384,29 @@ msgid "" "search." msgstr "" -#: ../../using/windows.rst:845 +#: ../../using/windows.rst:849 msgid "Arguments in shebang lines" msgstr "" -#: ../../using/windows.rst:847 +#: ../../using/windows.rst:851 msgid "" "The shebang lines can also specify additional options to be passed to the " "Python interpreter. For example, if you have a shebang line:" msgstr "" -#: ../../using/windows.rst:854 +#: ../../using/windows.rst:858 msgid "Then Python will be started with the ``-v`` option" msgstr "" -#: ../../using/windows.rst:857 +#: ../../using/windows.rst:861 msgid "Customization" msgstr "" -#: ../../using/windows.rst:860 +#: ../../using/windows.rst:864 msgid "Customization via INI files" msgstr "" -#: ../../using/windows.rst:862 +#: ../../using/windows.rst:866 msgid "" "Two .ini files will be searched by the launcher - ``py.ini`` in the current " "user's \"application data\" directory (i.e. the directory returned by " @@ -1408,7 +1416,7 @@ msgid "" "launcher (i.e. py.exe) and for the 'windows' version (i.e. pyw.exe)." msgstr "" -#: ../../using/windows.rst:869 +#: ../../using/windows.rst:873 msgid "" "Customization specified in the \"application directory\" will have " "precedence over the one next to the executable, so a user, who may not have " @@ -1416,11 +1424,11 @@ msgid "" "that global .ini file." msgstr "" -#: ../../using/windows.rst:874 +#: ../../using/windows.rst:878 msgid "Customizing default Python versions" msgstr "" -#: ../../using/windows.rst:876 +#: ../../using/windows.rst:880 msgid "" "In some cases, a version qualifier can be included in a command to dictate " "which version of Python will be used by the command. A version qualifier " @@ -1430,13 +1438,13 @@ msgid "" "\"-32\" or \"-64\"." msgstr "" -#: ../../using/windows.rst:882 +#: ../../using/windows.rst:886 msgid "" "For example, a shebang line of ``#!python`` has no version qualifier, while " "``#!python3`` has a version qualifier which specifies only a major version." msgstr "" -#: ../../using/windows.rst:885 +#: ../../using/windows.rst:889 msgid "" "If no version qualifiers are found in a command, the environment variable :" "envvar:`PY_PYTHON` can be set to specify the default version qualifier. If " @@ -1446,7 +1454,7 @@ msgid "" "launcher included with Python 3.7 or newer.)" msgstr "" -#: ../../using/windows.rst:892 +#: ../../using/windows.rst:896 msgid "" "If no minor version qualifiers are found, the environment variable " "``PY_PYTHON{major}`` (where ``{major}`` is the current major version " @@ -1457,7 +1465,7 @@ msgid "" "version in that family." msgstr "" -#: ../../using/windows.rst:900 +#: ../../using/windows.rst:904 msgid "" "On 64-bit Windows with both 32-bit and 64-bit implementations of the same " "(major.minor) Python version installed, the 64-bit version will always be " @@ -1471,30 +1479,30 @@ msgid "" "suffix can be used on a version specifier to change this behaviour." msgstr "" -#: ../../using/windows.rst:911 +#: ../../using/windows.rst:915 msgid "Examples:" msgstr "範例:" -#: ../../using/windows.rst:913 +#: ../../using/windows.rst:917 msgid "" "If no relevant options are set, the commands ``python`` and ``python2`` will " "use the latest Python 2.x version installed and the command ``python3`` will " "use the latest Python 3.x installed." msgstr "" -#: ../../using/windows.rst:917 +#: ../../using/windows.rst:921 msgid "" "The command ``python3.7`` will not consult any options at all as the " "versions are fully specified." msgstr "" -#: ../../using/windows.rst:920 +#: ../../using/windows.rst:924 msgid "" "If ``PY_PYTHON=3``, the commands ``python`` and ``python3`` will both use " "the latest installed Python 3 version." msgstr "" -#: ../../using/windows.rst:923 +#: ../../using/windows.rst:927 msgid "" "If ``PY_PYTHON=3.7-32``, the command ``python`` will use the 32-bit " "implementation of 3.7 whereas the command ``python3`` will use the latest " @@ -1502,13 +1510,13 @@ msgid "" "specified.)" msgstr "" -#: ../../using/windows.rst:928 +#: ../../using/windows.rst:932 msgid "" "If ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7``, the commands ``python`` and " "``python3`` will both use specifically 3.7" msgstr "" -#: ../../using/windows.rst:931 +#: ../../using/windows.rst:935 msgid "" "In addition to environment variables, the same settings can be configured in " "the .INI file used by the launcher. The section in the INI file is called " @@ -1518,25 +1526,25 @@ msgid "" "will override things specified in the INI file." msgstr "" -#: ../../using/windows.rst:938 +#: ../../using/windows.rst:942 msgid "For example:" msgstr "" -#: ../../using/windows.rst:940 +#: ../../using/windows.rst:944 msgid "Setting ``PY_PYTHON=3.7`` is equivalent to the INI file containing:" msgstr "" -#: ../../using/windows.rst:947 +#: ../../using/windows.rst:951 msgid "" "Setting ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7`` is equivalent to the INI file " "containing:" msgstr "" -#: ../../using/windows.rst:957 +#: ../../using/windows.rst:961 msgid "Diagnostics" msgstr "" -#: ../../using/windows.rst:959 +#: ../../using/windows.rst:963 msgid "" "If an environment variable ``PYLAUNCH_DEBUG`` is set (to any value), the " "launcher will print diagnostic information to stderr (i.e. to the console). " @@ -1546,11 +1554,11 @@ msgid "" "target Python." msgstr "" -#: ../../using/windows.rst:971 +#: ../../using/windows.rst:975 msgid "Finding modules" msgstr "" -#: ../../using/windows.rst:973 +#: ../../using/windows.rst:977 msgid "" "Python usually stores its library (and thereby your site-packages folder) in " "the installation directory. So, if you had installed Python to :file:`C:\\" @@ -1559,7 +1567,7 @@ msgid "" "\\\\site-packages\\\\`." msgstr "" -#: ../../using/windows.rst:979 +#: ../../using/windows.rst:983 msgid "" "To completely override :data:`sys.path`, create a ``._pth`` file with the " "same name as the DLL (``python37._pth``) or the executable (``python._pth``) " @@ -1568,7 +1576,7 @@ msgid "" "allows paths to be restricted for any program loading the runtime if desired." msgstr "" -#: ../../using/windows.rst:985 +#: ../../using/windows.rst:989 msgid "" "When the file exists, all registry and environment variables are ignored, " "isolated mode is enabled, and :mod:`site` is not imported unless one line in " @@ -1578,25 +1586,25 @@ msgid "" "arbitrary code cannot be specified." msgstr "" -#: ../../using/windows.rst:992 +#: ../../using/windows.rst:996 msgid "" "Note that ``.pth`` files (without leading underscore) will be processed " "normally by the :mod:`site` module when ``import site`` has been specified." msgstr "" -#: ../../using/windows.rst:995 +#: ../../using/windows.rst:999 msgid "" "When no ``._pth`` file is found, this is how :data:`sys.path` is populated " "on Windows:" msgstr "" -#: ../../using/windows.rst:998 +#: ../../using/windows.rst:1002 msgid "" "An empty entry is added at the start, which corresponds to the current " "directory." msgstr "" -#: ../../using/windows.rst:1001 +#: ../../using/windows.rst:1005 msgid "" "If the environment variable :envvar:`PYTHONPATH` exists, as described in :" "ref:`using-on-envvars`, its entries are added next. Note that on Windows, " @@ -1604,7 +1612,7 @@ msgid "" "from the colon used in drive identifiers (``C:\\`` etc.)." msgstr "" -#: ../../using/windows.rst:1006 +#: ../../using/windows.rst:1010 msgid "" "Additional \"application paths\" can be added in the registry as subkeys of :" "samp:`\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\{version}\\\\PythonPath` under " @@ -1614,7 +1622,7 @@ msgid "" "installers only use HKLM, so HKCU is typically empty.)" msgstr "" -#: ../../using/windows.rst:1013 +#: ../../using/windows.rst:1017 msgid "" "If the environment variable :envvar:`PYTHONHOME` is set, it is assumed as " "\"Python Home\". Otherwise, the path of the main Python executable is used " @@ -1625,31 +1633,31 @@ msgid "" "PythonPath stored in the registry." msgstr "" -#: ../../using/windows.rst:1021 +#: ../../using/windows.rst:1025 msgid "" "If the Python Home cannot be located, no :envvar:`PYTHONPATH` is specified " "in the environment, and no registry entries can be found, a default path " "with relative entries is used (e.g. ``.\\Lib;.\\plat-win``, etc)." msgstr "" -#: ../../using/windows.rst:1025 +#: ../../using/windows.rst:1029 msgid "" "If a ``pyvenv.cfg`` file is found alongside the main executable or in the " "directory one level above the executable, the following variations apply:" msgstr "" -#: ../../using/windows.rst:1028 +#: ../../using/windows.rst:1032 msgid "" "If ``home`` is an absolute path and :envvar:`PYTHONHOME` is not set, this " "path is used instead of the path to the main executable when deducing the " "home location." msgstr "" -#: ../../using/windows.rst:1032 +#: ../../using/windows.rst:1036 msgid "The end result of all this is:" msgstr "最終這所有的結果為:" -#: ../../using/windows.rst:1034 +#: ../../using/windows.rst:1038 msgid "" "When running :file:`python.exe`, or any other .exe in the main Python " "directory (either an installed version, or directly from the PCbuild " @@ -1657,7 +1665,7 @@ msgid "" "ignored. Other \"application paths\" in the registry are always read." msgstr "" -#: ../../using/windows.rst:1039 +#: ../../using/windows.rst:1043 msgid "" "When Python is hosted in another .exe (different directory, embedded via " "COM, etc), the \"Python Home\" will not be deduced, so the core path from " @@ -1665,20 +1673,20 @@ msgid "" "always read." msgstr "" -#: ../../using/windows.rst:1043 +#: ../../using/windows.rst:1047 msgid "" "If Python can't find its home and there are no registry value (frozen .exe, " "some very strange installation setup) you get a path with some default, but " "relative, paths." msgstr "" -#: ../../using/windows.rst:1047 +#: ../../using/windows.rst:1051 msgid "" "For those who want to bundle Python into their application or distribution, " "the following advice will prevent conflicts with other installations:" msgstr "" -#: ../../using/windows.rst:1050 +#: ../../using/windows.rst:1054 msgid "" "Include a ``._pth`` file alongside your executable containing the " "directories to include. This will ignore paths listed in the registry and " @@ -1686,20 +1694,20 @@ msgid "" "listed." msgstr "" -#: ../../using/windows.rst:1055 +#: ../../using/windows.rst:1059 msgid "" "If you are loading :file:`python3.dll` or :file:`python37.dll` in your own " "executable, explicitly call :c:func:`Py_SetPath` or (at least) :c:func:" "`Py_SetProgramName` before :c:func:`Py_Initialize`." msgstr "" -#: ../../using/windows.rst:1059 +#: ../../using/windows.rst:1063 msgid "" "Clear and/or overwrite :envvar:`PYTHONPATH` and set :envvar:`PYTHONHOME` " "before launching :file:`python.exe` from your application." msgstr "" -#: ../../using/windows.rst:1062 +#: ../../using/windows.rst:1066 msgid "" "If you cannot use the previous suggestions (for example, you are a " "distribution that allows people to run :file:`python.exe` directly), ensure " @@ -1708,7 +1716,7 @@ msgid "" "correctly named ZIP file will be detected instead.)" msgstr "" -#: ../../using/windows.rst:1068 +#: ../../using/windows.rst:1072 msgid "" "These will ensure that the files in a system-wide installation will not take " "precedence over the copy of the standard library bundled with your " @@ -1718,19 +1726,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1077 +#: ../../using/windows.rst:1081 msgid "" "Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1079 +#: ../../using/windows.rst:1083 msgid "" "Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " "executable." msgstr "" -#: ../../using/windows.rst:1085 +#: ../../using/windows.rst:1089 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1738,88 +1746,88 @@ msgid "" "explicitly added to :attr:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1091 +#: ../../using/windows.rst:1095 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1093 +#: ../../using/windows.rst:1097 msgid "" "Even though Python aims to be portable among all platforms, there are " "features that are unique to Windows. A couple of modules, both in the " "standard library and external, and snippets exist to use these features." msgstr "" -#: ../../using/windows.rst:1097 +#: ../../using/windows.rst:1101 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1101 +#: ../../using/windows.rst:1105 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1103 +#: ../../using/windows.rst:1107 msgid "" "The `PyWin32 `_ module by Mark Hammond is " "a collection of modules for advanced Windows-specific support. This " "includes utilities for:" msgstr "" -#: ../../using/windows.rst:1107 +#: ../../using/windows.rst:1111 msgid "" "`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1110 +#: ../../using/windows.rst:1114 msgid "Win32 API calls" msgstr "" -#: ../../using/windows.rst:1111 +#: ../../using/windows.rst:1115 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1112 +#: ../../using/windows.rst:1116 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1113 +#: ../../using/windows.rst:1117 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1117 +#: ../../using/windows.rst:1121 msgid "" "`PythonWin `_ is a sample MFC application shipped with PyWin32. " "It is an embeddable IDE with a built-in debugger." msgstr "" -#: ../../using/windows.rst:1124 +#: ../../using/windows.rst:1128 msgid "" "`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" -#: ../../using/windows.rst:1124 +#: ../../using/windows.rst:1128 msgid "by Tim Golden" msgstr "由 Tim Golden 所著" -#: ../../using/windows.rst:1126 +#: ../../using/windows.rst:1130 msgid "`Python and COM `_" msgstr "`Python and COM `_" -#: ../../using/windows.rst:1127 +#: ../../using/windows.rst:1131 msgid "by David and Paul Boddie" msgstr "由 David 與 Paul Boddie 所著" -#: ../../using/windows.rst:1131 +#: ../../using/windows.rst:1135 msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1133 +#: ../../using/windows.rst:1137 msgid "" "`cx_Freeze `_ is a :mod:" "`distutils` extension (see :ref:`extending-distutils`) which wraps Python " @@ -1828,11 +1836,11 @@ msgid "" "users to install Python." msgstr "" -#: ../../using/windows.rst:1141 +#: ../../using/windows.rst:1145 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1143 +#: ../../using/windows.rst:1147 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -1840,48 +1848,48 @@ msgid "" "devguide.python.org/setup/#get-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1148 +#: ../../using/windows.rst:1152 msgid "" "The source tree contains a build solution and project files for Microsoft " "Visual Studio, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1152 +#: ../../using/windows.rst:1156 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1154 +#: ../../using/windows.rst:1158 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1158 +#: ../../using/windows.rst:1162 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1160 +#: ../../using/windows.rst:1164 msgid "" "With ongoing development of Python, some platforms that used to be supported " "earlier are no longer supported (due to the lack of users or developers). " "Check :pep:`11` for details on all unsupported platforms." msgstr "" -#: ../../using/windows.rst:1164 +#: ../../using/windows.rst:1168 msgid "" "`Windows CE `_ is `no longer supported " "`__ since Python 3 (if it " "ever was)." msgstr "" -#: ../../using/windows.rst:1167 +#: ../../using/windows.rst:1171 msgid "" "The `Cygwin `_ installer offers to install the `Python " "interpreter `__ as well" msgstr "" -#: ../../using/windows.rst:1171 +#: ../../using/windows.rst:1175 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 2800183498..5aac56d48d 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1140,7 +1140,7 @@ msgid "" "inheritance hierarchy. Classic classes are unaffected by this change. " "Python 2.2 originally used a topological sort of a class's ancestors, but " "2.3 now uses the C3 algorithm as described in the paper `\"A Monotonic " -"Superclass Linearization for Dylan\" `_. To understand the motivation for this " "change, read Michele Simionato's article `\"Python 2.3 Method Resolution " "Order\" `_, or read the " diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 5e09c8dab9..e41e3b9550 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-09 00:18+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-" @@ -1007,8 +1007,8 @@ msgid "" "were stored in an :c:type:`int`. The C compilers for most 64-bit platforms " "still define :c:type:`int` as a 32-bit type, so that meant that lists could " "only hold up to ``2**31 - 1`` = 2147483647 items. (There are actually a few " -"different programming models that 64-bit C compilers can use -- see http://" -"www.unix.org/version2/whatsnew/lp64_wp.html for a discussion -- but the most " +"different programming models that 64-bit C compilers can use -- see https://" +"unix.org/version2/whatsnew/lp64_wp.html for a discussion -- but the most " "commonly available model leaves :c:type:`int` as 32 bits.)" msgstr "" @@ -2310,7 +2310,7 @@ msgstr "sqlite3 套件" #: ../../whatsnew/2.5.rst:1933 msgid "" -"The pysqlite module (http://www.pysqlite.org), a wrapper for the SQLite " +"The pysqlite module (https://www.pysqlite.org), a wrapper for the SQLite " "embedded database, has been added to the standard library under the package " "name :mod:`sqlite3`." msgstr "" @@ -2395,8 +2395,8 @@ msgid "" msgstr "" #: ../../whatsnew/2.5.rst:2023 -msgid "http://www.pysqlite.org" -msgstr "http://www.pysqlite.org" +msgid "https://www.pysqlite.org" +msgstr "https://www.pysqlite.org" #: ../../whatsnew/2.5.rst:2023 msgid "The pysqlite web page." diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index bc177f0de4..3421852301 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+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-" @@ -166,8 +166,8 @@ msgid "" "posted a call for issue trackers, asking volunteers to set up different " "products and import some of the bugs and patches from SourceForge. Four " "different trackers were examined: `Jira `__, `Launchpad `__, `Roundup `__, and `Trac `__. The " +"jira/>`__, `Launchpad `__, `Roundup `__, and `Trac `__. The " "committee eventually settled on Jira and Roundup as the two candidates. " "Jira is a commercial product that offers no-cost hosted instances to free-" "software projects; Roundup is an open-source project that requires " @@ -189,7 +189,7 @@ msgid "" "Hosting of the Python bug tracker is kindly provided by `Upfront Systems " "`__ of Stellenbosch, South Africa. Martin " "von Löwis put a lot of effort into importing existing bugs and patches from " -"SourceForge; his scripts for this import operation are at ``http://svn." +"SourceForge; his scripts for this import operation are at ``https://svn." "python.org/view/tracker/importer/`` and may be useful to other projects " "wishing to move from SourceForge to Roundup." msgstr "" @@ -203,24 +203,24 @@ msgid "The Python bug tracker." msgstr "" #: ../../whatsnew/2.6.rst:188 -msgid "http://bugs.jython.org:" -msgstr "http://bugs.jython.org:" +msgid "https://bugs.jython.org:" +msgstr "https://bugs.jython.org:" #: ../../whatsnew/2.6.rst:188 msgid "The Jython bug tracker." msgstr "" #: ../../whatsnew/2.6.rst:191 -msgid "http://roundup.sourceforge.net/" -msgstr "http://roundup.sourceforge.net/" +msgid "https://roundup.sourceforge.io/" +msgstr "https://roundup.sourceforge.io/" #: ../../whatsnew/2.6.rst:191 msgid "Roundup downloads and documentation." msgstr "" #: ../../whatsnew/2.6.rst:193 -msgid "http://svn.python.org/view/tracker/importer/" -msgstr "http://svn.python.org/view/tracker/importer/" +msgid "https://svn.python.org/view/tracker/importer/" +msgstr "https://svn.python.org/view/tracker/importer/" #: ../../whatsnew/2.6.rst:194 msgid "Martin von Löwis's conversion scripts." @@ -285,14 +285,14 @@ msgstr "" #: ../../whatsnew/2.6.rst:239 msgid "`Sphinx `__" -msgstr "" +msgstr "`Sphinx `__" #: ../../whatsnew/2.6.rst:239 msgid "Documentation and code for the Sphinx toolchain." msgstr "" #: ../../whatsnew/2.6.rst:241 -msgid "`Docutils `__" +msgid "`Docutils `__" msgstr "" #: ../../whatsnew/2.6.rst:242 @@ -1565,7 +1565,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1436 msgid "" -"`Scheme's number datatypes `__ from the R5RS Scheme specification." msgstr "" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index e1de2ddb2d..c1cbde62fb 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+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-" @@ -362,7 +362,7 @@ msgid "" "The :mod:`json` module's :class:`~json.JSONDecoder` class constructor was " "extended with an *object_pairs_hook* parameter to allow :class:`OrderedDict` " "instances to be built by the decoder. Support was also added for third-party " -"tools like `PyYAML `_." +"tools like `PyYAML `_." msgstr "" #: ../../whatsnew/2.7.rst:307 @@ -1117,7 +1117,7 @@ msgid "" "pybsddb.htm>`__. The new version features better Python 3.x compatibility, " "various bug fixes, and adds several new BerkeleyDB flags and methods. " "(Updated by Jesús Cea Avión; :issue:`8156`. The pybsddb changelog can be " -"read at http://hg.jcea.es/pybsddb/file/tip/ChangeLog.)" +"read at https://hg.jcea.es/pybsddb/file/tip/ChangeLog.)" msgstr "" #: ../../whatsnew/2.7.rst:1053 @@ -2075,7 +2075,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:1833 msgid "" "When used from the command line, the module can automatically discover " -"tests. It's not as fancy as `py.test `__ or `nose " +"tests. It's not as fancy as `py.test `__ or `nose " "`__, but provides a simple way to run tests " "kept within a set of package directories. For example, the following " "command will search the :file:`test/` subdirectory for any importable test " @@ -3186,7 +3186,7 @@ msgid "" "index` sections of the documentation have been completely redesigned as " "short getting started and FAQ documents. Most packaging documentation has " "now been moved out to the Python Packaging Authority maintained `Python " -"Packaging User Guide `__ and the documentation " +"Packaging User Guide `__ and the documentation " "of the individual projects." msgstr "" diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index d804c098f5..85c020ba16 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-30 00:18+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+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-" @@ -68,7 +68,7 @@ msgid "" "order as the underlying tuple indices. The :mod:`json` module is being " "built-out with an *object_pairs_hook* to allow OrderedDicts to be built by " "the decoder. Support was also added for third-party tools like `PyYAML " -"`_." +"`_." msgstr "" #: ../../whatsnew/3.1.rst:80 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index e57abe7012..c3858a0d5f 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-22 00:19+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+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-" @@ -136,7 +136,7 @@ msgstr "" msgid ":pep:`597`, Add optional EncodingWarning" msgstr "" -#: ../../whatsnew/3.10.rst:93 ../../whatsnew/3.10.rst:2048 +#: ../../whatsnew/3.10.rst:93 ../../whatsnew/3.10.rst:2051 msgid "New Features" msgstr "" @@ -1195,8 +1195,8 @@ msgstr "" msgid "doctest" msgstr "doctest" -#: ../../whatsnew/3.10.rst:1076 ../../whatsnew/3.10.rst:1197 -#: ../../whatsnew/3.10.rst:1224 ../../whatsnew/3.10.rst:1323 +#: ../../whatsnew/3.10.rst:1076 ../../whatsnew/3.10.rst:1200 +#: ../../whatsnew/3.10.rst:1227 ../../whatsnew/3.10.rst:1326 msgid "" "When a module does not define ``__loader__``, fall back to ``__spec__." "loader``. (Contributed by Brett Cannon in :issue:`42133`.)" @@ -1358,17 +1358,23 @@ msgid "" "Terry Jan Reedy in :issue:`45447`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1179 +#: ../../whatsnew/3.10.rst:1178 +msgid "" +"Include prompts when saving Shell with inputs and outputs. (Contributed by " +"Terry Jan Reedy in :gh:`95191`.)" +msgstr "" + +#: ../../whatsnew/3.10.rst:1182 msgid "importlib.metadata" msgstr "importlib.metadata" -#: ../../whatsnew/3.10.rst:1181 +#: ../../whatsnew/3.10.rst:1184 msgid "" "Feature parity with ``importlib_metadata`` 4.6 (`history `_)." msgstr "" -#: ../../whatsnew/3.10.rst:1184 +#: ../../whatsnew/3.10.rst:1187 msgid "" ":ref:`importlib.metadata entry points ` now provide a nicer " "experience for selecting entry points by group and name through a new :class:" @@ -1376,18 +1382,18 @@ msgid "" "docs for more info on the deprecation and usage." msgstr "" -#: ../../whatsnew/3.10.rst:1190 +#: ../../whatsnew/3.10.rst:1193 msgid "" "Added :func:`importlib.metadata.packages_distributions` for resolving top-" "level Python modules and packages to their :class:`importlib.metadata." "Distribution`." msgstr "" -#: ../../whatsnew/3.10.rst:1195 +#: ../../whatsnew/3.10.rst:1198 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.10.rst:1200 +#: ../../whatsnew/3.10.rst:1203 msgid "" "Add :func:`inspect.get_annotations`, which safely computes the annotations " "defined on an object. It works around the quirks of accessing the " @@ -1405,38 +1411,38 @@ msgid "" "`43817`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1216 +#: ../../whatsnew/3.10.rst:1219 msgid "itertools" msgstr "" -#: ../../whatsnew/3.10.rst:1218 +#: ../../whatsnew/3.10.rst:1221 msgid "" "Add :func:`itertools.pairwise()`. (Contributed by Raymond Hettinger in :" "issue:`38200`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1222 +#: ../../whatsnew/3.10.rst:1225 msgid "linecache" msgstr "linecache" -#: ../../whatsnew/3.10.rst:1228 +#: ../../whatsnew/3.10.rst:1231 msgid "os" msgstr "os" -#: ../../whatsnew/3.10.rst:1230 +#: ../../whatsnew/3.10.rst:1233 msgid "" "Add :func:`os.cpu_count()` support for VxWorks RTOS. (Contributed by Peixing " "Xin in :issue:`41440`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1233 +#: ../../whatsnew/3.10.rst:1236 msgid "" "Add a new function :func:`os.eventfd` and related helpers to wrap the " "``eventfd2`` syscall on Linux. (Contributed by Christian Heimes in :issue:" "`41001`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1237 +#: ../../whatsnew/3.10.rst:1240 msgid "" "Add :func:`os.splice()` that allows to move data between two file " "descriptors without copying between kernel address space and user address " @@ -1444,41 +1450,41 @@ msgid "" "by Pablo Galindo in :issue:`41625`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1242 +#: ../../whatsnew/3.10.rst:1245 msgid "" "Add :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`, :data:`~os.O_SYMLINK` and :" "data:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Dong-hee Na in :issue:" "`43106`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1247 +#: ../../whatsnew/3.10.rst:1250 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.10.rst:1249 +#: ../../whatsnew/3.10.rst:1252 msgid "" ":func:`os.path.realpath` now accepts a *strict* keyword-only argument. When " "set to ``True``, :exc:`OSError` is raised if a path doesn't exist or a " "symlink loop is encountered. (Contributed by Barney Gale in :issue:`43757`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1255 +#: ../../whatsnew/3.10.rst:1258 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.10.rst:1257 +#: ../../whatsnew/3.10.rst:1260 msgid "" "Add slice support to :attr:`PurePath.parents `. " "(Contributed by Joshua Cannon in :issue:`35498`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1260 +#: ../../whatsnew/3.10.rst:1263 msgid "" "Add negative indexing support to :attr:`PurePath.parents `. (Contributed by Yaroslav Pankovych in :issue:`21041`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1264 +#: ../../whatsnew/3.10.rst:1267 msgid "" "Add :meth:`Path.hardlink_to ` method that " "supersedes :meth:`~pathlib.Path.link_to`. The new method has the same " @@ -1486,7 +1492,7 @@ msgid "" "Gale in :issue:`39950`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1269 +#: ../../whatsnew/3.10.rst:1272 msgid "" ":meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now accept a " "*follow_symlinks* keyword-only argument for consistency with corresponding " @@ -1494,11 +1500,11 @@ msgid "" "`39906`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1275 +#: ../../whatsnew/3.10.rst:1278 msgid "platform" msgstr "platform" -#: ../../whatsnew/3.10.rst:1277 +#: ../../whatsnew/3.10.rst:1280 msgid "" "Add :func:`platform.freedesktop_os_release()` to retrieve operation system " "identification from `freedesktop.org os-release ` section for " "more information." msgstr "" -#: ../../whatsnew/3.10.rst:1622 +#: ../../whatsnew/3.10.rst:1625 msgid "" "Non-integer arguments to :func:`random.randrange` are deprecated. The :exc:" "`ValueError` is deprecated in favor of a :exc:`TypeError`. (Contributed by " "Serhiy Storchaka and Raymond Hettinger in :issue:`37319`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1626 +#: ../../whatsnew/3.10.rst:1629 msgid "" "The various ``load_module()`` methods of :mod:`importlib` have been " "documented as deprecated since Python 3.6, but will now also trigger a :exc:" @@ -2024,21 +2030,21 @@ msgid "" "(Contributed by Brett Cannon in :issue:`26131`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1632 +#: ../../whatsnew/3.10.rst:1635 msgid "" ":meth:`zimport.zipimporter.load_module` has been deprecated in preference " "for :meth:`~zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon " "in :issue:`26131`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1636 +#: ../../whatsnew/3.10.rst:1639 msgid "" "The use of :meth:`~importlib.abc.Loader.load_module` by the import system " "now triggers an :exc:`ImportWarning` as :meth:`~importlib.abc.Loader." "exec_module` is preferred. (Contributed by Brett Cannon in :issue:`26131`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1641 +#: ../../whatsnew/3.10.rst:1644 msgid "" "The use of :meth:`importlib.abc.MetaPathFinder.find_module` and :meth:" "`importlib.abc.PathEntryFinder.find_module` by the import system now trigger " @@ -2048,7 +2054,7 @@ msgid "" "porting. (Contributed by Brett Cannon in :issue:`42134`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1650 +#: ../../whatsnew/3.10.rst:1653 msgid "" "The use of :meth:`importlib.abc.PathEntryFinder.find_loader` by the import " "system now triggers an :exc:`ImportWarning` as :meth:`importlib.abc." @@ -2057,7 +2063,7 @@ msgid "" "`43672`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1656 +#: ../../whatsnew/3.10.rst:1659 msgid "" "The various implementations of :meth:`importlib.abc.MetaPathFinder." "find_module` ( :meth:`importlib.machinery.BuiltinImporter.find_module`, :" @@ -2072,7 +2078,7 @@ msgid "" "Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1671 +#: ../../whatsnew/3.10.rst:1674 msgid "" ":class:`importlib.abc.Finder` is deprecated (including its sole method, :" "meth:`~importlib.abc.Finder.find_module`). Both :class:`importlib.abc." @@ -2081,7 +2087,7 @@ msgid "" "appropriate instead. (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1678 +#: ../../whatsnew/3.10.rst:1681 msgid "" "The deprecations of :mod:`imp`, :func:`importlib.find_loader`, :func:" "`importlib.util.set_package_wrapper`, :func:`importlib.util." @@ -2092,7 +2098,7 @@ msgid "" "Brett Cannon in :issue:`43720`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1688 +#: ../../whatsnew/3.10.rst:1691 msgid "" "The import system now uses the ``__spec__`` attribute on modules before " "falling back on :meth:`~importlib.abc.Loader.module_repr` for a module's " @@ -2100,7 +2106,7 @@ msgid "" "for Python 3.12. (Contributed by Brett Cannon in :issue:`42137`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1694 +#: ../../whatsnew/3.10.rst:1697 msgid "" ":meth:`importlib.abc.Loader.module_repr`, :meth:`importlib.machinery." "FrozenLoader.module_repr`, and :meth:`importlib.machinery.BuiltinLoader." @@ -2108,7 +2114,7 @@ msgid "" "(Contributed by Brett Cannon in :issue:`42136`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1700 +#: ../../whatsnew/3.10.rst:1703 msgid "" "``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python " "3.3, when it was made an alias to :class:`str`. It is now deprecated, " @@ -2116,7 +2122,7 @@ msgid "" "issue:`42264`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1705 +#: ../../whatsnew/3.10.rst:1708 msgid "" ":func:`asyncio.get_event_loop` now emits a deprecation warning if there is " "no running event loop. In the future it will be an alias of :func:`~asyncio." @@ -2130,7 +2136,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`39529`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1718 +#: ../../whatsnew/3.10.rst:1721 msgid "" "The undocumented built-in function ``sqlite3.enable_shared_cache`` is now " "deprecated, scheduled for removal in Python 3.12. Its use is strongly " @@ -2140,68 +2146,68 @@ msgid "" "query parameter. (Contributed by Erlend E. Aasland in :issue:`24464`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1726 +#: ../../whatsnew/3.10.rst:1729 msgid "The following ``threading`` methods are now deprecated:" msgstr "" -#: ../../whatsnew/3.10.rst:1728 +#: ../../whatsnew/3.10.rst:1731 msgid "``threading.currentThread`` => :func:`threading.current_thread`" msgstr "``threading.currentThread`` => :func:`threading.current_thread`" -#: ../../whatsnew/3.10.rst:1730 +#: ../../whatsnew/3.10.rst:1733 msgid "``threading.activeCount`` => :func:`threading.active_count`" msgstr "``threading.activeCount`` => :func:`threading.active_count`" -#: ../../whatsnew/3.10.rst:1732 +#: ../../whatsnew/3.10.rst:1735 msgid "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" msgstr "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" -#: ../../whatsnew/3.10.rst:1735 +#: ../../whatsnew/3.10.rst:1738 msgid "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" msgstr "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" -#: ../../whatsnew/3.10.rst:1737 +#: ../../whatsnew/3.10.rst:1740 msgid "``threading.Thread.setName`` => :attr:`threading.Thread.name`" msgstr "``threading.Thread.setName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1739 +#: ../../whatsnew/3.10.rst:1742 msgid "``threading.thread.getName`` => :attr:`threading.Thread.name`" msgstr "``threading.thread.getName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1741 +#: ../../whatsnew/3.10.rst:1744 msgid "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1743 +#: ../../whatsnew/3.10.rst:1746 msgid "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1745 +#: ../../whatsnew/3.10.rst:1748 msgid "(Contributed by Jelle Zijlstra in :gh:`87889`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1747 +#: ../../whatsnew/3.10.rst:1750 msgid "" ":meth:`pathlib.Path.link_to` is deprecated and slated for removal in Python " "3.12. Use :meth:`pathlib.Path.hardlink_to` instead. (Contributed by Barney " "Gale in :issue:`39950`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1751 +#: ../../whatsnew/3.10.rst:1754 msgid "" "``cgi.log()`` is deprecated and slated for removal in Python 3.12. " "(Contributed by Inada Naoki in :issue:`41139`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1754 +#: ../../whatsnew/3.10.rst:1757 msgid "" "The following :mod:`ssl` features have been deprecated since Python 3.6, " "Python 3.7, or OpenSSL 1.1.0 and will be removed in 3.11:" msgstr "" -#: ../../whatsnew/3.10.rst:1757 +#: ../../whatsnew/3.10.rst:1760 msgid "" ":data:`~ssl.OP_NO_SSLv2`, :data:`~ssl.OP_NO_SSLv3`, :data:`~ssl." "OP_NO_TLSv1`, :data:`~ssl.OP_NO_TLSv1_1`, :data:`~ssl.OP_NO_TLSv1_2`, and :" @@ -2209,7 +2215,7 @@ msgid "" "minimum_version` and :attr:`sslSSLContext.maximum_version`." msgstr "" -#: ../../whatsnew/3.10.rst:1763 +#: ../../whatsnew/3.10.rst:1766 msgid "" ":data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`, :data:`~ssl." "PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`, :data:`~ssl." @@ -2218,26 +2224,26 @@ msgid "" "and :data:`~ssl.PROTOCOL_TLS_SERVER`" msgstr "" -#: ../../whatsnew/3.10.rst:1769 +#: ../../whatsnew/3.10.rst:1772 msgid "" ":func:`~ssl.wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`" msgstr "" -#: ../../whatsnew/3.10.rst:1771 +#: ../../whatsnew/3.10.rst:1774 msgid ":func:`~ssl.match_hostname`" msgstr ":func:`~ssl.match_hostname`" -#: ../../whatsnew/3.10.rst:1773 +#: ../../whatsnew/3.10.rst:1776 msgid ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" msgstr ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" -#: ../../whatsnew/3.10.rst:1775 +#: ../../whatsnew/3.10.rst:1778 msgid "" "NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and :meth:`ssl." "SSLContext.set_npn_protocols` are replaced by ALPN." msgstr "" -#: ../../whatsnew/3.10.rst:1778 +#: ../../whatsnew/3.10.rst:1781 msgid "" "The threading debug (:envvar:`PYTHONTHREADDEBUG` environment variable) is " "deprecated in Python 3.10 and will be removed in Python 3.12. This feature " @@ -2245,7 +2251,7 @@ msgid "" "Victor Stinner in :issue:`44584`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1783 +#: ../../whatsnew/3.10.rst:1786 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules will be removed in a future " @@ -2254,11 +2260,11 @@ msgid "" "Rittau in :issue:`38291`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1792 ../../whatsnew/3.10.rst:2217 +#: ../../whatsnew/3.10.rst:1795 ../../whatsnew/3.10.rst:2220 msgid "Removed" msgstr "" -#: ../../whatsnew/3.10.rst:1794 +#: ../../whatsnew/3.10.rst:1797 msgid "" "Removed special methods ``__int__``, ``__float__``, ``__floordiv__``, " "``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and " @@ -2266,7 +2272,7 @@ msgid "" "`TypeError`. (Contributed by Serhiy Storchaka in :issue:`41974`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1800 +#: ../../whatsnew/3.10.rst:1803 msgid "" "The ``ParserBase.error()`` method from the private and undocumented " "``_markupbase`` module has been removed. :class:`html.parser.HTMLParser` is " @@ -2275,7 +2281,7 @@ msgid "" "`31844`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1806 +#: ../../whatsnew/3.10.rst:1809 msgid "" "Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal " "PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was " @@ -2283,7 +2289,7 @@ msgid "" "`42157`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1811 +#: ../../whatsnew/3.10.rst:1814 msgid "" "Removed the ``parser`` module, which was deprecated in 3.9 due to the switch " "to the new PEG parser, as well as all the C source and header files that " @@ -2291,7 +2297,7 @@ msgid "" "``graminit.h`` and ``grammar.h``." msgstr "" -#: ../../whatsnew/3.10.rst:1816 +#: ../../whatsnew/3.10.rst:1819 msgid "" "Removed the Public C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2299,7 +2305,7 @@ msgid "" "deprecated in 3.9 due to the switch to the new PEG parser." msgstr "" -#: ../../whatsnew/3.10.rst:1821 +#: ../../whatsnew/3.10.rst:1824 msgid "" "Removed the ``formatter`` module, which was deprecated in Python 3.4. It is " "somewhat obsolete, little used, and not tested. It was originally scheduled " @@ -2309,71 +2315,71 @@ msgid "" "`42299`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1828 +#: ../../whatsnew/3.10.rst:1831 msgid "" "Removed the :c:func:`PyModule_GetWarningsModule` function that was useless " "now due to the _warnings module was converted to a builtin module in 2.6. " "(Contributed by Hai Shi in :issue:`42599`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1832 +#: ../../whatsnew/3.10.rst:1835 msgid "" "Remove deprecated aliases to :ref:`collections-abstract-base-classes` from " "the :mod:`collections` module. (Contributed by Victor Stinner in :issue:" "`37324`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1836 +#: ../../whatsnew/3.10.rst:1839 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " "Python 3.8. The motivation behind this change is multifold:" msgstr "" -#: ../../whatsnew/3.10.rst:1840 +#: ../../whatsnew/3.10.rst:1843 msgid "This simplifies the high-level API." msgstr "" -#: ../../whatsnew/3.10.rst:1841 +#: ../../whatsnew/3.10.rst:1844 msgid "" "The functions in the high-level API have been implicitly getting the current " "thread's running event loop since Python 3.7. There isn't a need to pass " "the event loop to the API in most normal use cases." msgstr "" -#: ../../whatsnew/3.10.rst:1844 +#: ../../whatsnew/3.10.rst:1847 msgid "" "Event loop passing is error-prone especially when dealing with loops running " "in different threads." msgstr "" -#: ../../whatsnew/3.10.rst:1847 +#: ../../whatsnew/3.10.rst:1850 msgid "" "Note that the low-level API will still accept ``loop``. See :ref:`changes-" "python-api` for examples of how to replace existing code." msgstr "" -#: ../../whatsnew/3.10.rst:1850 ../../whatsnew/3.10.rst:1922 +#: ../../whatsnew/3.10.rst:1853 ../../whatsnew/3.10.rst:1925 msgid "" "(Contributed by Yurii Karabas, Andrew Svetlov, Yury Selivanov and Kyle " "Stanley in :issue:`42392`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1855 ../../whatsnew/3.10.rst:2142 +#: ../../whatsnew/3.10.rst:1858 ../../whatsnew/3.10.rst:2145 msgid "Porting to Python 3.10" msgstr "" -#: ../../whatsnew/3.10.rst:1857 +#: ../../whatsnew/3.10.rst:1860 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.10.rst:1862 +#: ../../whatsnew/3.10.rst:1865 msgid "Changes in the Python syntax" msgstr "" -#: ../../whatsnew/3.10.rst:1864 +#: ../../whatsnew/3.10.rst:1867 msgid "" "Deprecation warning is now emitted when compiling previously valid syntax if " "the numeric literal is immediately followed by a keyword (like in ``0in " @@ -2383,11 +2389,11 @@ msgid "" "following keyword. (Contributed by Serhiy Storchaka in :issue:`43833`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1875 +#: ../../whatsnew/3.10.rst:1878 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.10.rst:1877 +#: ../../whatsnew/3.10.rst:1880 msgid "" "The *etype* parameters of the :func:`~traceback.format_exception`, :func:" "`~traceback.format_exception_only`, and :func:`~traceback.print_exception` " @@ -2395,7 +2401,7 @@ msgid "" "(Contributed by Zackery Spytz and Matthias Bussonnier in :issue:`26389`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1883 +#: ../../whatsnew/3.10.rst:1886 msgid "" ":mod:`atexit`: At Python exit, if a callback registered with :func:`atexit." "register` fails, its exception is now logged. Previously, only some " @@ -2403,7 +2409,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`42639`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1889 +#: ../../whatsnew/3.10.rst:1892 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -2416,7 +2422,7 @@ msgid "" "`42195`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1899 +#: ../../whatsnew/3.10.rst:1902 msgid "" ":meth:`socket.htons` and :meth:`socket.ntohs` now raise :exc:`OverflowError` " "instead of :exc:`DeprecationWarning` if the given parameter will not fit in " @@ -2424,29 +2430,29 @@ msgid "" "`42393`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1904 +#: ../../whatsnew/3.10.rst:1907 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " "Python 3.8." msgstr "" -#: ../../whatsnew/3.10.rst:1908 +#: ../../whatsnew/3.10.rst:1911 msgid "A coroutine that currently looks like this::" msgstr "" -#: ../../whatsnew/3.10.rst:1913 +#: ../../whatsnew/3.10.rst:1916 msgid "Should be replaced with this::" msgstr "" -#: ../../whatsnew/3.10.rst:1918 +#: ../../whatsnew/3.10.rst:1921 msgid "" "If ``foo()`` was specifically designed *not* to run in the current thread's " "running event loop (e.g. running in another thread's event loop), consider " "using :func:`asyncio.run_coroutine_threadsafe` instead." msgstr "" -#: ../../whatsnew/3.10.rst:1925 +#: ../../whatsnew/3.10.rst:1928 msgid "" "The :data:`types.FunctionType` constructor now inherits the current builtins " "if the *globals* dictionary has no ``\"__builtins__\"`` key, rather than " @@ -2457,11 +2463,11 @@ msgid "" "`42990`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1934 +#: ../../whatsnew/3.10.rst:1937 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.10.rst:1936 +#: ../../whatsnew/3.10.rst:1939 msgid "" "The C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2470,31 +2476,31 @@ msgid "" "PEG parser." msgstr "" -#: ../../whatsnew/3.10.rst:1942 +#: ../../whatsnew/3.10.rst:1945 msgid "" "Source should be now be compiled directly to a code object using, for " "example, :c:func:`Py_CompileString`. The resulting code object can then be " "evaluated using, for example, :c:func:`PyEval_EvalCode`." msgstr "" -#: ../../whatsnew/3.10.rst:1946 +#: ../../whatsnew/3.10.rst:1949 msgid "Specifically:" msgstr "" -#: ../../whatsnew/3.10.rst:1948 +#: ../../whatsnew/3.10.rst:1951 msgid "" "A call to ``PyParser_SimpleParseStringFlags`` followed by ``PyNode_Compile`` " "can be replaced by calling :c:func:`Py_CompileString`." msgstr "" -#: ../../whatsnew/3.10.rst:1951 +#: ../../whatsnew/3.10.rst:1954 msgid "" "There is no direct replacement for ``PyParser_SimpleParseFileFlags``. To " "compile code from a ``FILE *`` argument, you will need to read the file in C " "and pass the resulting buffer to :c:func:`Py_CompileString`." msgstr "" -#: ../../whatsnew/3.10.rst:1955 +#: ../../whatsnew/3.10.rst:1958 msgid "" "To compile a file given a ``char *`` filename, explicitly open the file, " "read it and compile the result. One way to do this is using the :py:mod:`io` " @@ -2503,7 +2509,7 @@ msgid "" "(Declarations and error handling are omitted.) ::" msgstr "" -#: ../../whatsnew/3.10.rst:1968 +#: ../../whatsnew/3.10.rst:1971 msgid "" "For ``FrameObject`` objects, the ``f_lasti`` member now represents a " "wordcode offset instead of a simple offset into the bytecode string. This " @@ -2513,53 +2519,53 @@ msgid "" "considered stable: please use :c:func:`PyFrame_GetLineNumber` instead." msgstr "" -#: ../../whatsnew/3.10.rst:1976 +#: ../../whatsnew/3.10.rst:1979 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.10.rst:1978 +#: ../../whatsnew/3.10.rst:1981 msgid "" "The ``MAKE_FUNCTION`` instruction now accepts either a dict or a tuple of " "strings as the function's annotations. (Contributed by Yurii Karabas and " "Inada Naoki in :issue:`42202`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1983 +#: ../../whatsnew/3.10.rst:1986 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.10.rst:1985 +#: ../../whatsnew/3.10.rst:1988 msgid "" ":pep:`644`: Python now requires OpenSSL 1.1.1 or newer. OpenSSL 1.0.2 is no " "longer supported. (Contributed by Christian Heimes in :issue:`43669`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1989 +#: ../../whatsnew/3.10.rst:1992 msgid "" "The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now " "required to build Python. (Contributed by Victor Stinner in :issue:`36020`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1993 +#: ../../whatsnew/3.10.rst:1996 msgid "" ":mod:`sqlite3` requires SQLite 3.7.15 or higher. (Contributed by Sergey " "Fedoseev and Erlend E. Aasland in :issue:`40744` and :issue:`40810`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1996 +#: ../../whatsnew/3.10.rst:1999 msgid "" "The :mod:`atexit` module must now always be built as a built-in module. " "(Contributed by Victor Stinner in :issue:`42639`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1999 +#: ../../whatsnew/3.10.rst:2002 msgid "" "Add :option:`--disable-test-modules` option to the ``configure`` script: " "don't build nor install test modules. (Contributed by Xavier de Gaye, Thomas " "Petazzoni and Peixing Xin in :issue:`27640`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2003 +#: ../../whatsnew/3.10.rst:2006 msgid "" "Add :option:`--with-wheel-pkg-dir=PATH option <--with-wheel-pkg-dir>` to the " "``./configure`` script. If specified, the :mod:`ensurepip` module looks for " @@ -2568,7 +2574,7 @@ msgid "" "packages." msgstr "" -#: ../../whatsnew/3.10.rst:2009 +#: ../../whatsnew/3.10.rst:2012 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -2576,22 +2582,22 @@ msgid "" "_bundled`` package." msgstr "" -#: ../../whatsnew/3.10.rst:2014 +#: ../../whatsnew/3.10.rst:2017 msgid "(Contributed by Victor Stinner in :issue:`42856`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2016 +#: ../../whatsnew/3.10.rst:2019 msgid "" "Add a new :option:`configure --without-static-libpython option <--without-" "static-libpython>` to not build the ``libpythonMAJOR.MINOR.a`` static " "library and not install the ``python.o`` object file." msgstr "" -#: ../../whatsnew/3.10.rst:2020 +#: ../../whatsnew/3.10.rst:2023 msgid "(Contributed by Victor Stinner in :issue:`43103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2022 +#: ../../whatsnew/3.10.rst:2025 msgid "" "The ``configure`` script now uses the ``pkg-config`` utility, if available, " "to detect the location of Tcl/Tk headers and libraries. As before, those " @@ -2600,7 +2606,7 @@ msgid "" "(Contributed by Manolis Stamatogiannakis in :issue:`42603`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2028 +#: ../../whatsnew/3.10.rst:2031 msgid "" "Add :option:`--with-openssl-rpath` option to ``configure`` script. The " "option simplifies building Python with a custom OpenSSL installation, e.g. " @@ -2608,15 +2614,15 @@ msgid "" "(Contributed by Christian Heimes in :issue:`43466`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2035 +#: ../../whatsnew/3.10.rst:2038 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.10.rst:2038 +#: ../../whatsnew/3.10.rst:2041 msgid "PEP 652: Maintaining the Stable ABI" msgstr "" -#: ../../whatsnew/3.10.rst:2040 +#: ../../whatsnew/3.10.rst:2043 msgid "" "The Stable ABI (Application Binary Interface) for extension modules or " "embedding Python is now explicitly defined. :ref:`stable` describes C API " @@ -2624,25 +2630,25 @@ msgid "" "ABI." msgstr "" -#: ../../whatsnew/3.10.rst:2045 +#: ../../whatsnew/3.10.rst:2048 msgid "(Contributed by Petr Viktorin in :pep:`652` and :issue:`43795`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2050 +#: ../../whatsnew/3.10.rst:2053 msgid "" "The result of :c:func:`PyNumber_Index` now always has exact type :class:" "`int`. Previously, the result could have been an instance of a subclass of " "``int``. (Contributed by Serhiy Storchaka in :issue:`40792`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2054 +#: ../../whatsnew/3.10.rst:2057 msgid "" "Add a new :c:member:`~PyConfig.orig_argv` member to the :c:type:`PyConfig` " "structure: the list of the original command line arguments passed to the " "Python executable. (Contributed by Victor Stinner in :issue:`23427`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2059 +#: ../../whatsnew/3.10.rst:2062 msgid "" "The :c:func:`PyDateTime_DATE_GET_TZINFO` and :c:func:" "`PyDateTime_TIME_GET_TZINFO` macros have been added for accessing the " @@ -2650,72 +2656,72 @@ msgid "" "time` objects. (Contributed by Zackery Spytz in :issue:`30155`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2065 +#: ../../whatsnew/3.10.rst:2068 msgid "" "Add a :c:func:`PyCodec_Unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2069 +#: ../../whatsnew/3.10.rst:2072 msgid "" "The :c:func:`PyIter_Send` function was added to allow sending value into " "iterator without raising ``StopIteration`` exception. (Contributed by " "Vladimir Matveev in :issue:`41756`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2073 +#: ../../whatsnew/3.10.rst:2076 msgid "" "Add :c:func:`PyUnicode_AsUTF8AndSize` to the limited C API. (Contributed by " "Alex Gaynor in :issue:`41784`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2076 +#: ../../whatsnew/3.10.rst:2079 msgid "" "Add :c:func:`PyModule_AddObjectRef` function: similar to :c:func:" "`PyModule_AddObject` but don't steal a reference to the value on success. " "(Contributed by Victor Stinner in :issue:`1635741`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2081 +#: ../../whatsnew/3.10.rst:2084 msgid "" "Add :c:func:`Py_NewRef` and :c:func:`Py_XNewRef` functions to increment the " "reference count of an object and return the object. (Contributed by Victor " "Stinner in :issue:`42262`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2085 +#: ../../whatsnew/3.10.rst:2088 msgid "" "The :c:func:`PyType_FromSpecWithBases` and :c:func:" "`PyType_FromModuleAndSpec` functions now accept a single class as the " "*bases* argument. (Contributed by Serhiy Storchaka in :issue:`42423`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2089 +#: ../../whatsnew/3.10.rst:2092 msgid "" "The :c:func:`PyType_FromModuleAndSpec` function now accepts NULL ``tp_doc`` " "slot. (Contributed by Hai Shi in :issue:`41832`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2093 +#: ../../whatsnew/3.10.rst:2096 msgid "" "The :c:func:`PyType_GetSlot` function can accept :ref:`static types `. (Contributed by Hai Shi and Petr Viktorin in :issue:`41073`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2097 +#: ../../whatsnew/3.10.rst:2100 msgid "" "Add a new :c:func:`PySet_CheckExact` function to the C-API to check if an " "object is an instance of :class:`set` but not an instance of a subtype. " "(Contributed by Pablo Galindo in :issue:`43277`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2101 +#: ../../whatsnew/3.10.rst:2104 msgid "" "Add :c:func:`PyErr_SetInterruptEx` which allows passing a signal number to " "simulate. (Contributed by Antoine Pitrou in :issue:`43356`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2105 +#: ../../whatsnew/3.10.rst:2108 msgid "" "The limited C API is now supported if :ref:`Python is built in debug mode " "` (if the ``Py_DEBUG`` macro is defined). In the limited C API, " @@ -2728,14 +2734,14 @@ msgid "" "`36465`)." msgstr "" -#: ../../whatsnew/3.10.rst:2115 +#: ../../whatsnew/3.10.rst:2118 msgid "" "The limited C API is still not supported in the :option:`--with-trace-refs` " "special build (``Py_TRACE_REFS`` macro). (Contributed by Victor Stinner in :" "issue:`43688`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2119 +#: ../../whatsnew/3.10.rst:2122 msgid "" "Add the :c:func:`Py_Is(x, y) ` function to test if the *x* object is " "the *y* object, the same as ``x is y`` in Python. Add also the :c:func:" @@ -2745,7 +2751,7 @@ msgid "" "`43753`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2126 +#: ../../whatsnew/3.10.rst:2129 msgid "" "Add new functions to control the garbage collector from C code: :c:func:" "`PyGC_Enable()`, :c:func:`PyGC_Disable()`, :c:func:`PyGC_IsEnabled()`. These " @@ -2753,20 +2759,20 @@ msgid "" "collector from C code without having to import the :mod:`gc` module." msgstr "" -#: ../../whatsnew/3.10.rst:2133 +#: ../../whatsnew/3.10.rst:2136 msgid "" "Add a new :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " "creating type instances. (Contributed by Victor Stinner in :issue:`43916`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2137 +#: ../../whatsnew/3.10.rst:2140 msgid "" "Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " "immutable type objects: type attributes cannot be set nor deleted. " "(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2144 +#: ../../whatsnew/3.10.rst:2147 msgid "" "The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use :c:func:" "`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use ``#``: " @@ -2775,7 +2781,7 @@ msgid "" "`353`. (Contributed by Victor Stinner in :issue:`40943`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2151 +#: ../../whatsnew/3.10.rst:2154 msgid "" "Since :c:func:`Py_REFCNT()` is changed to the inline static function, " "``Py_REFCNT(obj) = new_refcnt`` must be replaced with ``Py_SET_REFCNT(obj, " @@ -2783,18 +2789,18 @@ msgid "" "For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.10.rst:2160 +#: ../../whatsnew/3.10.rst:2163 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2162 +#: ../../whatsnew/3.10.rst:2165 msgid "" "Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had been allowed " "for historical reason. It is no longer allowed. (Contributed by Victor " "Stinner in :issue:`40839`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2166 +#: ../../whatsnew/3.10.rst:2169 msgid "" "``PyUnicode_FromUnicode(NULL, size)`` and " "``PyUnicode_FromStringAndSize(NULL, size)`` raise ``DeprecationWarning`` " @@ -2802,14 +2808,14 @@ msgid "" "data. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2171 +#: ../../whatsnew/3.10.rst:2174 msgid "" "The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule API " "``unicodedata.ucnhash_CAPI`` has been moved to the internal C API. " "(Contributed by Victor Stinner in :issue:`42157`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2175 +#: ../../whatsnew/3.10.rst:2178 msgid "" ":c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:" "func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and :c:func:" @@ -2820,7 +2826,7 @@ msgid "" "issue:`42260`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2183 +#: ../../whatsnew/3.10.rst:2186 msgid "" ":c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` and :c:func:" "`PyCell_SET` macros can no longer be used as l-value or r-value. For " @@ -2830,7 +2836,7 @@ msgid "" "and Victor Stinner in :issue:`30459`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2190 +#: ../../whatsnew/3.10.rst:2193 msgid "" "The non-limited API files ``odictobject.h``, ``parser_interface.h``, " "``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``, ``pyfpe." @@ -2841,7 +2847,7 @@ msgid "" "Nicholas Sim in :issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2198 +#: ../../whatsnew/3.10.rst:2201 msgid "" "Use the :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable " "type objects. Do not rely on :c:data:`Py_TPFLAGS_HEAPTYPE` to decide if a " @@ -2850,85 +2856,85 @@ msgid "" "issue:`43908`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2204 +#: ../../whatsnew/3.10.rst:2207 msgid "" "The undocumented function ``Py_FrozenMain`` has been removed from the " "limited API. The function is mainly useful for custom builds of Python. " "(Contributed by Petr Viktorin in :issue:`26241`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2211 +#: ../../whatsnew/3.10.rst:2214 msgid "" "The ``PyUnicode_InternImmortal()`` function is now deprecated and will be " "removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` instead. " "(Contributed by Victor Stinner in :issue:`41692`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2219 +#: ../../whatsnew/3.10.rst:2222 msgid "" "Removed ``Py_UNICODE_str*`` functions manipulating ``Py_UNICODE*`` strings. " "(Contributed by Inada Naoki in :issue:`41123`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2222 +#: ../../whatsnew/3.10.rst:2225 msgid "" "``Py_UNICODE_strlen``: use :c:func:`PyUnicode_GetLength` or :c:macro:" "`PyUnicode_GET_LENGTH`" msgstr "" -#: ../../whatsnew/3.10.rst:2224 +#: ../../whatsnew/3.10.rst:2227 msgid "" "``Py_UNICODE_strcat``: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_FromFormat`" msgstr "" -#: ../../whatsnew/3.10.rst:2226 +#: ../../whatsnew/3.10.rst:2229 msgid "" "``Py_UNICODE_strcpy``, ``Py_UNICODE_strncpy``: use :c:func:" "`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`" msgstr "" -#: ../../whatsnew/3.10.rst:2228 +#: ../../whatsnew/3.10.rst:2231 msgid "``Py_UNICODE_strcmp``: use :c:func:`PyUnicode_Compare`" msgstr "" -#: ../../whatsnew/3.10.rst:2229 +#: ../../whatsnew/3.10.rst:2232 msgid "``Py_UNICODE_strncmp``: use :c:func:`PyUnicode_Tailmatch`" msgstr "" -#: ../../whatsnew/3.10.rst:2230 +#: ../../whatsnew/3.10.rst:2233 msgid "" "``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: use :c:func:" "`PyUnicode_FindChar`" msgstr "" -#: ../../whatsnew/3.10.rst:2233 +#: ../../whatsnew/3.10.rst:2236 msgid "" "Removed ``PyUnicode_GetMax()``. Please migrate to new (:pep:`393`) APIs. " "(Contributed by Inada Naoki in :issue:`41103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2236 +#: ../../whatsnew/3.10.rst:2239 msgid "" "Removed ``PyLong_FromUnicode()``. Please migrate to :c:func:" "`PyLong_FromUnicodeObject`. (Contributed by Inada Naoki in :issue:`41103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2239 +#: ../../whatsnew/3.10.rst:2242 msgid "" "Removed ``PyUnicode_AsUnicodeCopy()``. Please use :c:func:" "`PyUnicode_AsUCS4Copy` or :c:func:`PyUnicode_AsWideCharString` (Contributed " "by Inada Naoki in :issue:`41103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2243 +#: ../../whatsnew/3.10.rst:2246 msgid "" "Removed ``_Py_CheckRecursionLimit`` variable: it has been replaced by " "``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` structure. " "(Contributed by Victor Stinner in :issue:`41834`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2247 +#: ../../whatsnew/3.10.rst:2250 msgid "" "Removed undocumented macros ``Py_ALLOW_RECURSION`` and " "``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the :c:" @@ -2936,14 +2942,14 @@ msgid "" "issue:`41936`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2252 +#: ../../whatsnew/3.10.rst:2255 msgid "" "Removed the undocumented ``PyOS_InitInterrupts()`` function. Initializing " "Python already implicitly installs signal handlers: see :c:member:`PyConfig." "install_signal_handlers`. (Contributed by Victor Stinner in :issue:`41713`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2257 +#: ../../whatsnew/3.10.rst:2260 msgid "" "Remove the ``PyAST_Validate()`` function. It is no longer possible to build " "a AST object (``mod_ty`` type) with the public C API. The function was " @@ -2951,48 +2957,48 @@ msgid "" "Stinner in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2262 +#: ../../whatsnew/3.10.rst:2265 msgid "Remove the ``symtable.h`` header file and the undocumented functions:" msgstr "" -#: ../../whatsnew/3.10.rst:2264 +#: ../../whatsnew/3.10.rst:2267 msgid "``PyST_GetScope()``" msgstr "``PyST_GetScope()``" -#: ../../whatsnew/3.10.rst:2265 +#: ../../whatsnew/3.10.rst:2268 msgid "``PySymtable_Build()``" msgstr "``PySymtable_Build()``" -#: ../../whatsnew/3.10.rst:2266 +#: ../../whatsnew/3.10.rst:2269 msgid "``PySymtable_BuildObject()``" msgstr "``PySymtable_BuildObject()``" -#: ../../whatsnew/3.10.rst:2267 +#: ../../whatsnew/3.10.rst:2270 msgid "``PySymtable_Free()``" msgstr "``PySymtable_Free()``" -#: ../../whatsnew/3.10.rst:2268 +#: ../../whatsnew/3.10.rst:2271 msgid "``Py_SymtableString()``" msgstr "``Py_SymtableString()``" -#: ../../whatsnew/3.10.rst:2269 +#: ../../whatsnew/3.10.rst:2272 msgid "``Py_SymtableStringObject()``" msgstr "``Py_SymtableStringObject()``" -#: ../../whatsnew/3.10.rst:2271 +#: ../../whatsnew/3.10.rst:2274 msgid "" "The ``Py_SymtableString()`` function was part the stable ABI by mistake but " "it could not be used, because the ``symtable.h`` header file was excluded " "from the limited C API." msgstr "" -#: ../../whatsnew/3.10.rst:2275 +#: ../../whatsnew/3.10.rst:2278 msgid "" "Use Python :mod:`symtable` module instead. (Contributed by Victor Stinner " "in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2278 +#: ../../whatsnew/3.10.rst:2281 msgid "" "Remove :c:func:`PyOS_ReadlineFunctionPointer` from the limited C API headers " "and from ``python3.dll``, the library that provides the stable ABI on " @@ -3000,7 +3006,7 @@ msgid "" "cannot be guaranteed. (Contributed by Petr Viktorin in :issue:`43868`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2284 +#: ../../whatsnew/3.10.rst:2287 msgid "" "Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. These " "functions were undocumented and excluded from the limited C API. Most names " @@ -3011,86 +3017,86 @@ msgid "" "(Contributed by Victor Stinner in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2292 +#: ../../whatsnew/3.10.rst:2295 msgid "" "Remove the compiler and parser functions using ``struct _mod`` type, because " "the public AST C API was removed:" msgstr "" -#: ../../whatsnew/3.10.rst:2295 +#: ../../whatsnew/3.10.rst:2298 msgid "``PyAST_Compile()``" msgstr "``PyAST_Compile()``" -#: ../../whatsnew/3.10.rst:2296 +#: ../../whatsnew/3.10.rst:2299 msgid "``PyAST_CompileEx()``" msgstr "``PyAST_CompileEx()``" -#: ../../whatsnew/3.10.rst:2297 +#: ../../whatsnew/3.10.rst:2300 msgid "``PyAST_CompileObject()``" msgstr "``PyAST_CompileObject()``" -#: ../../whatsnew/3.10.rst:2298 +#: ../../whatsnew/3.10.rst:2301 msgid "``PyFuture_FromAST()``" msgstr "``PyFuture_FromAST()``" -#: ../../whatsnew/3.10.rst:2299 +#: ../../whatsnew/3.10.rst:2302 msgid "``PyFuture_FromASTObject()``" msgstr "``PyFuture_FromASTObject()``" -#: ../../whatsnew/3.10.rst:2300 +#: ../../whatsnew/3.10.rst:2303 msgid "``PyParser_ASTFromFile()``" msgstr "``PyParser_ASTFromFile()``" -#: ../../whatsnew/3.10.rst:2301 +#: ../../whatsnew/3.10.rst:2304 msgid "``PyParser_ASTFromFileObject()``" msgstr "``PyParser_ASTFromFileObject()``" -#: ../../whatsnew/3.10.rst:2302 +#: ../../whatsnew/3.10.rst:2305 msgid "``PyParser_ASTFromFilename()``" msgstr "``PyParser_ASTFromFilename()``" -#: ../../whatsnew/3.10.rst:2303 +#: ../../whatsnew/3.10.rst:2306 msgid "``PyParser_ASTFromString()``" msgstr "``PyParser_ASTFromString()``" -#: ../../whatsnew/3.10.rst:2304 +#: ../../whatsnew/3.10.rst:2307 msgid "``PyParser_ASTFromStringObject()``" msgstr "``PyParser_ASTFromStringObject()``" -#: ../../whatsnew/3.10.rst:2306 +#: ../../whatsnew/3.10.rst:2309 msgid "" "These functions were undocumented and excluded from the limited C API. " "(Contributed by Victor Stinner in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2309 +#: ../../whatsnew/3.10.rst:2312 msgid "Remove the ``pyarena.h`` header file with functions:" msgstr "" -#: ../../whatsnew/3.10.rst:2311 +#: ../../whatsnew/3.10.rst:2314 msgid "``PyArena_New()``" msgstr "``PyArena_New()``" -#: ../../whatsnew/3.10.rst:2312 +#: ../../whatsnew/3.10.rst:2315 msgid "``PyArena_Free()``" msgstr "``PyArena_Free()``" -#: ../../whatsnew/3.10.rst:2313 +#: ../../whatsnew/3.10.rst:2316 msgid "``PyArena_Malloc()``" msgstr "``PyArena_Malloc()``" -#: ../../whatsnew/3.10.rst:2314 +#: ../../whatsnew/3.10.rst:2317 msgid "``PyArena_AddPyObject()``" msgstr "``PyArena_AddPyObject()``" -#: ../../whatsnew/3.10.rst:2316 +#: ../../whatsnew/3.10.rst:2319 msgid "" "These functions were undocumented, excluded from the limited C API, and were " "only used internally by the compiler. (Contributed by Victor Stinner in :" "issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2320 +#: ../../whatsnew/3.10.rst:2323 msgid "" "The ``PyThreadState.use_tracing`` member has been removed to optimize " "Python. (Contributed by Mark Shannon in :issue:`43760`.)" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 65a4e97825..5b03bc422e 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-22 00:18+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+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-" @@ -2855,7 +2855,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2509 msgid "" -"In addition to the existing Subversion code repository at http://svn.python." +"In addition to the existing Subversion code repository at https://svn.python." "org there is now a `Mercurial `_ repository " "at https://hg.python.org/\\ ." msgstr "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 1866bc4f00..11d2f44d27 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+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-" @@ -1527,7 +1527,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1108 msgid "" "The following table is meant as an illustration. Benchmarks are available at " -"http://www.bytereef.org/mpdecimal/quickstart.html." +"https://www.bytereef.org/mpdecimal/quickstart.html." msgstr "" #: ../../whatsnew/3.3.rst:1112 diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 55c94bb9e5..23949295d9 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+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-" @@ -1517,7 +1517,7 @@ msgstr "imghdr" #: ../../whatsnew/3.5.rst:1255 msgid "" -"The :func:`~imghdr.what` function now recognizes the `OpenEXR `_ format (contributed by Martin Vignali and Claudiu Popa in :" "issue:`20295`), and the `WebP `_ format " "(contributed by Fabrice Aneche and Claudiu Popa in :issue:`20197`.)" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index d1a6be8890..f5e72a49a1 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -849,7 +849,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:614 msgid "" -"`importlib_resources `_ -- a PyPI backport for earlier Python versions." msgstr ""