From a8ab98a8fafc6919df22fd4595562c9a27a74676 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Jan 2023 00:19:20 +0000 Subject: [PATCH 1/2] sync with cpython 541e7b80 --- c-api/typeobj.po | 806 ++++++++++++++++++------------------ reference/compound_stmts.po | 592 +++++++++++++------------- 2 files changed, 699 insertions(+), 699 deletions(-) diff --git a/c-api/typeobj.po b/c-api/typeobj.po index a8a77ff56a..d4d75f272b 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-29 00:17+0000\n" +"POT-Creation-Date: 2023-01-05 00:16+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-" @@ -1000,7 +1000,7 @@ msgstr "__getitem__" msgid ":c:member:`~PyMappingMethods.mp_ass_subscript`" msgstr ":c:member:`~PyMappingMethods.mp_ass_subscript`" -#: ../../c-api/typeobj.rst:302 ../../c-api/typeobj.rst:459 +#: ../../c-api/typeobj.rst:302 ../../c-api/typeobj.rst:460 msgid ":c:type:`objobjargproc`" msgstr ":c:type:`objobjargproc`" @@ -1053,7 +1053,7 @@ msgstr "__setitem__ __delitem__" msgid ":c:member:`~PySequenceMethods.sq_contains`" msgstr ":c:member:`~PySequenceMethods.sq_contains`" -#: ../../c-api/typeobj.rst:318 ../../c-api/typeobj.rst:454 +#: ../../c-api/typeobj.rst:318 ../../c-api/typeobj.rst:455 msgid ":c:type:`objobjproc`" msgstr ":c:type:`objobjproc`" @@ -1114,8 +1114,8 @@ msgstr ":c:type:`visitproc`" #: ../../c-api/typeobj.rst:360 ../../c-api/typeobj.rst:373 #: ../../c-api/typeobj.rst:384 ../../c-api/typeobj.rst:396 #: ../../c-api/typeobj.rst:416 ../../c-api/typeobj.rst:427 -#: ../../c-api/typeobj.rst:449 ../../c-api/typeobj.rst:454 -#: ../../c-api/typeobj.rst:459 +#: ../../c-api/typeobj.rst:449 ../../c-api/typeobj.rst:455 +#: ../../c-api/typeobj.rst:460 msgid "int" msgstr "int" @@ -1135,26 +1135,26 @@ msgstr ":c:type:`Py_buffer` *" msgid ":c:type:`releasebufferproc`" msgstr ":c:type:`releasebufferproc`" -#: ../../c-api/typeobj.rst:466 +#: ../../c-api/typeobj.rst:467 msgid "See :ref:`slot-typedefs` below for more detail." msgstr "更多細節請見下方的 :ref:`slot-typedefs`。" -#: ../../c-api/typeobj.rst:470 +#: ../../c-api/typeobj.rst:471 msgid "PyTypeObject Definition" msgstr "" -#: ../../c-api/typeobj.rst:472 +#: ../../c-api/typeobj.rst:473 msgid "" "The structure definition for :c:type:`PyTypeObject` can be found in :file:" "`Include/object.h`. For convenience of reference, this repeats the " "definition found there:" msgstr "" -#: ../../c-api/typeobj.rst:482 +#: ../../c-api/typeobj.rst:483 msgid "PyObject Slots" msgstr "" -#: ../../c-api/typeobj.rst:484 +#: ../../c-api/typeobj.rst:485 msgid "" "The type object structure extends the :c:type:`PyVarObject` structure. The :" "attr:`ob_size` field is used for dynamic types (created by :func:`type_new`, " @@ -1163,7 +1163,7 @@ msgid "" "that its instances (i.e. type objects) *must* have the :attr:`ob_size` field." msgstr "" -#: ../../c-api/typeobj.rst:493 +#: ../../c-api/typeobj.rst:494 msgid "" "This is the type object's reference count, initialized to ``1`` by the " "``PyObject_HEAD_INIT`` macro. Note that for :ref:`statically allocated type " @@ -1173,46 +1173,46 @@ msgid "" "as references." msgstr "" -#: ../../c-api/typeobj.rst:500 ../../c-api/typeobj.rst:523 -#: ../../c-api/typeobj.rst:545 ../../c-api/typeobj.rst:559 -#: ../../c-api/typeobj.rst:603 ../../c-api/typeobj.rst:646 -#: ../../c-api/typeobj.rst:704 ../../c-api/typeobj.rst:742 -#: ../../c-api/typeobj.rst:762 ../../c-api/typeobj.rst:779 -#: ../../c-api/typeobj.rst:797 ../../c-api/typeobj.rst:821 -#: ../../c-api/typeobj.rst:838 ../../c-api/typeobj.rst:850 -#: ../../c-api/typeobj.rst:862 ../../c-api/typeobj.rst:895 -#: ../../c-api/typeobj.rst:913 ../../c-api/typeobj.rst:933 -#: ../../c-api/typeobj.rst:954 ../../c-api/typeobj.rst:980 -#: ../../c-api/typeobj.rst:999 ../../c-api/typeobj.rst:1015 -#: ../../c-api/typeobj.rst:1052 ../../c-api/typeobj.rst:1063 -#: ../../c-api/typeobj.rst:1073 ../../c-api/typeobj.rst:1083 -#: ../../c-api/typeobj.rst:1097 ../../c-api/typeobj.rst:1115 -#: ../../c-api/typeobj.rst:1138 ../../c-api/typeobj.rst:1185 -#: ../../c-api/typeobj.rst:1200 ../../c-api/typeobj.rst:1219 -#: ../../c-api/typeobj.rst:1249 ../../c-api/typeobj.rst:1271 -#: ../../c-api/typeobj.rst:1287 ../../c-api/typeobj.rst:1355 -#: ../../c-api/typeobj.rst:1422 ../../c-api/typeobj.rst:1481 -#: ../../c-api/typeobj.rst:1511 ../../c-api/typeobj.rst:1543 -#: ../../c-api/typeobj.rst:1566 ../../c-api/typeobj.rst:1579 -#: ../../c-api/typeobj.rst:1594 ../../c-api/typeobj.rst:1608 -#: ../../c-api/typeobj.rst:1638 ../../c-api/typeobj.rst:1658 -#: ../../c-api/typeobj.rst:1684 ../../c-api/typeobj.rst:1702 -#: ../../c-api/typeobj.rst:1735 ../../c-api/typeobj.rst:1786 -#: ../../c-api/typeobj.rst:1803 ../../c-api/typeobj.rst:1844 -#: ../../c-api/typeobj.rst:1866 ../../c-api/typeobj.rst:1898 -#: ../../c-api/typeobj.rst:1926 ../../c-api/typeobj.rst:1939 -#: ../../c-api/typeobj.rst:1949 ../../c-api/typeobj.rst:1958 -#: ../../c-api/typeobj.rst:1968 ../../c-api/typeobj.rst:1982 -#: ../../c-api/typeobj.rst:2028 ../../c-api/typeobj.rst:2051 +#: ../../c-api/typeobj.rst:501 ../../c-api/typeobj.rst:524 +#: ../../c-api/typeobj.rst:546 ../../c-api/typeobj.rst:560 +#: ../../c-api/typeobj.rst:604 ../../c-api/typeobj.rst:647 +#: ../../c-api/typeobj.rst:705 ../../c-api/typeobj.rst:743 +#: ../../c-api/typeobj.rst:763 ../../c-api/typeobj.rst:780 +#: ../../c-api/typeobj.rst:798 ../../c-api/typeobj.rst:822 +#: ../../c-api/typeobj.rst:839 ../../c-api/typeobj.rst:851 +#: ../../c-api/typeobj.rst:863 ../../c-api/typeobj.rst:896 +#: ../../c-api/typeobj.rst:914 ../../c-api/typeobj.rst:934 +#: ../../c-api/typeobj.rst:955 ../../c-api/typeobj.rst:981 +#: ../../c-api/typeobj.rst:1000 ../../c-api/typeobj.rst:1016 +#: ../../c-api/typeobj.rst:1053 ../../c-api/typeobj.rst:1064 +#: ../../c-api/typeobj.rst:1074 ../../c-api/typeobj.rst:1084 +#: ../../c-api/typeobj.rst:1098 ../../c-api/typeobj.rst:1116 +#: ../../c-api/typeobj.rst:1139 ../../c-api/typeobj.rst:1186 +#: ../../c-api/typeobj.rst:1201 ../../c-api/typeobj.rst:1220 +#: ../../c-api/typeobj.rst:1250 ../../c-api/typeobj.rst:1272 +#: ../../c-api/typeobj.rst:1288 ../../c-api/typeobj.rst:1356 +#: ../../c-api/typeobj.rst:1423 ../../c-api/typeobj.rst:1482 +#: ../../c-api/typeobj.rst:1512 ../../c-api/typeobj.rst:1544 +#: ../../c-api/typeobj.rst:1567 ../../c-api/typeobj.rst:1580 +#: ../../c-api/typeobj.rst:1595 ../../c-api/typeobj.rst:1609 +#: ../../c-api/typeobj.rst:1639 ../../c-api/typeobj.rst:1659 +#: ../../c-api/typeobj.rst:1685 ../../c-api/typeobj.rst:1703 +#: ../../c-api/typeobj.rst:1736 ../../c-api/typeobj.rst:1787 +#: ../../c-api/typeobj.rst:1804 ../../c-api/typeobj.rst:1845 +#: ../../c-api/typeobj.rst:1867 ../../c-api/typeobj.rst:1899 +#: ../../c-api/typeobj.rst:1927 ../../c-api/typeobj.rst:1940 +#: ../../c-api/typeobj.rst:1950 ../../c-api/typeobj.rst:1959 +#: ../../c-api/typeobj.rst:1969 ../../c-api/typeobj.rst:1983 +#: ../../c-api/typeobj.rst:2029 ../../c-api/typeobj.rst:2052 msgid "**Inheritance:**" msgstr "" -#: ../../c-api/typeobj.rst:502 ../../c-api/typeobj.rst:561 -#: ../../c-api/typeobj.rst:605 +#: ../../c-api/typeobj.rst:503 ../../c-api/typeobj.rst:562 +#: ../../c-api/typeobj.rst:606 msgid "This field is not inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:507 +#: ../../c-api/typeobj.rst:508 msgid "" "This is the type's type, in other words its metatype. It is initialized by " "the argument to the ``PyObject_HEAD_INIT`` macro, and its value should " @@ -1224,7 +1224,7 @@ msgid "" "doing anything else. This is typically done like this::" msgstr "" -#: ../../c-api/typeobj.rst:518 +#: ../../c-api/typeobj.rst:519 msgid "" "This should be done before any instances of the type are created. :c:func:" "`PyType_Ready` checks if :attr:`ob_type` is ``NULL``, and if so, initializes " @@ -1232,22 +1232,22 @@ msgid "" "will not change this field if it is non-zero." msgstr "" -#: ../../c-api/typeobj.rst:525 ../../c-api/typeobj.rst:706 -#: ../../c-api/typeobj.rst:823 ../../c-api/typeobj.rst:915 -#: ../../c-api/typeobj.rst:935 ../../c-api/typeobj.rst:1545 -#: ../../c-api/typeobj.rst:1568 ../../c-api/typeobj.rst:1686 -#: ../../c-api/typeobj.rst:1704 ../../c-api/typeobj.rst:1788 -#: ../../c-api/typeobj.rst:1900 ../../c-api/typeobj.rst:2030 +#: ../../c-api/typeobj.rst:526 ../../c-api/typeobj.rst:707 +#: ../../c-api/typeobj.rst:824 ../../c-api/typeobj.rst:916 +#: ../../c-api/typeobj.rst:936 ../../c-api/typeobj.rst:1546 +#: ../../c-api/typeobj.rst:1569 ../../c-api/typeobj.rst:1687 +#: ../../c-api/typeobj.rst:1705 ../../c-api/typeobj.rst:1789 +#: ../../c-api/typeobj.rst:1901 ../../c-api/typeobj.rst:2031 msgid "This field is inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:531 +#: ../../c-api/typeobj.rst:532 msgid "" "These fields are only present when the macro ``Py_TRACE_REFS`` is defined " "(see the :option:`configure --with-trace-refs option <--with-trace-refs>`)." msgstr "" -#: ../../c-api/typeobj.rst:534 +#: ../../c-api/typeobj.rst:535 msgid "" "Their initialization to ``NULL`` is taken care of by the " "``PyObject_HEAD_INIT`` macro. For :ref:`statically allocated objects " @@ -1256,7 +1256,7 @@ msgid "" "object into a doubly linked list of *all* live objects on the heap." msgstr "" -#: ../../c-api/typeobj.rst:540 +#: ../../c-api/typeobj.rst:541 msgid "" "This could be used for various debugging purposes; currently the only uses " "are the :func:`sys.getobjects` function and to print the objects that are " @@ -1264,26 +1264,26 @@ msgid "" "`PYTHONDUMPREFS` is set." msgstr "" -#: ../../c-api/typeobj.rst:547 +#: ../../c-api/typeobj.rst:548 msgid "These fields are not inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:551 +#: ../../c-api/typeobj.rst:552 msgid "PyVarObject Slots" msgstr "" -#: ../../c-api/typeobj.rst:555 +#: ../../c-api/typeobj.rst:556 msgid "" "For :ref:`statically allocated type objects `, this should be " "initialized to zero. For :ref:`dynamically allocated type objects `, this field has a special internal meaning." msgstr "" -#: ../../c-api/typeobj.rst:565 +#: ../../c-api/typeobj.rst:566 msgid "PyTypeObject Slots" msgstr "" -#: ../../c-api/typeobj.rst:567 +#: ../../c-api/typeobj.rst:568 msgid "" "Each slot has a section describing inheritance. If :c:func:`PyType_Ready` " "may set a value when the field is set to ``NULL`` then there will also be a " @@ -1291,7 +1291,7 @@ msgid "" "`PyBaseObject_Type` and :c:type:`PyType_Type` effectively act as defaults.)" msgstr "" -#: ../../c-api/typeobj.rst:574 +#: ../../c-api/typeobj.rst:575 msgid "" "Pointer to a NUL-terminated string containing the name of the type. For " "types that are accessible as module globals, the string should be the full " @@ -1303,14 +1303,14 @@ msgid "" "tp_name` initializer ``\"P.Q.M.T\"``." msgstr "" -#: ../../c-api/typeobj.rst:582 +#: ../../c-api/typeobj.rst:583 msgid "" "For :ref:`dynamically allocated type objects `, this should just " "be the type name, and the module name explicitly stored in the type dict as " "the value for key ``'__module__'``." msgstr "" -#: ../../c-api/typeobj.rst:587 +#: ../../c-api/typeobj.rst:588 msgid "" "For :ref:`statically allocated type objects `, the *tp_name* " "field should contain a dot. Everything before the last dot is made " @@ -1318,7 +1318,7 @@ msgid "" "last dot is made accessible as the :attr:`~definition.__name__` attribute." msgstr "" -#: ../../c-api/typeobj.rst:593 +#: ../../c-api/typeobj.rst:594 msgid "" "If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is " "made accessible as the :attr:`~definition.__name__` attribute, and the :attr:" @@ -1328,19 +1328,19 @@ msgid "" "created with pydoc." msgstr "" -#: ../../c-api/typeobj.rst:599 +#: ../../c-api/typeobj.rst:600 msgid "" "This field must not be ``NULL``. It is the only required field in :c:func:" "`PyTypeObject` (other than potentially :c:member:`~PyTypeObject." "tp_itemsize`)." msgstr "" -#: ../../c-api/typeobj.rst:611 +#: ../../c-api/typeobj.rst:612 msgid "" "These fields allow calculating the size in bytes of instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:613 +#: ../../c-api/typeobj.rst:614 msgid "" "There are two kinds of types: types with fixed-length instances have a zero :" "c:member:`~PyTypeObject.tp_itemsize` field, types with variable-length " @@ -1349,7 +1349,7 @@ msgid "" "in :c:member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:618 +#: ../../c-api/typeobj.rst:619 msgid "" "For a type with variable-length instances, the instances must have an :attr:" "`ob_size` field, and the instance size is :c:member:`~PyTypeObject." @@ -1363,7 +1363,7 @@ msgid "" "instances, yet those instances have a meaningful :attr:`ob_size` field)." msgstr "" -#: ../../c-api/typeobj.rst:629 +#: ../../c-api/typeobj.rst:630 msgid "" "The basic size includes the fields in the instance declared by the macro :c:" "macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD` (whichever is used to " @@ -1375,7 +1375,7 @@ msgid "" "size." msgstr "" -#: ../../c-api/typeobj.rst:637 +#: ../../c-api/typeobj.rst:638 msgid "" "A note about alignment: if the variable items require a particular " "alignment, this should be taken care of by the value of :c:member:" @@ -1386,12 +1386,12 @@ msgid "" "alignment requirement for ``double``)." msgstr "" -#: ../../c-api/typeobj.rst:644 +#: ../../c-api/typeobj.rst:645 msgid "" "For any type with variable-length instances, this field must not be ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:648 +#: ../../c-api/typeobj.rst:649 msgid "" "These fields are inherited separately by subtypes. If the base type has a " "non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is generally not safe to " @@ -1399,7 +1399,7 @@ msgid "" "subtype (though this depends on the implementation of the base type)." msgstr "" -#: ../../c-api/typeobj.rst:656 +#: ../../c-api/typeobj.rst:657 msgid "" "A pointer to the instance destructor function. This function must be " "defined unless the type guarantees that its instances will never be " @@ -1407,7 +1407,7 @@ msgid "" "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:662 +#: ../../c-api/typeobj.rst:663 msgid "" "The destructor function is called by the :c:func:`Py_DECREF` and :c:func:" "`Py_XDECREF` macros when the new reference count is zero. At this point, " @@ -1425,14 +1425,14 @@ msgid "" "allocated using :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`." msgstr "" -#: ../../c-api/typeobj.rst:677 +#: ../../c-api/typeobj.rst:678 msgid "" "If the type supports garbage collection (has the :const:`Py_TPFLAGS_HAVE_GC` " "flag bit set), the destructor should call :c:func:`PyObject_GC_UnTrack` " "before clearing any member fields." msgstr "" -#: ../../c-api/typeobj.rst:689 +#: ../../c-api/typeobj.rst:690 msgid "" "Finally, if the type is heap allocated (:const:`Py_TPFLAGS_HEAPTYPE`), the " "deallocator should decrement the reference count for its type object after " @@ -1440,28 +1440,28 @@ msgid "" "recommended way to achieve this is:" msgstr "" -#: ../../c-api/typeobj.rst:711 +#: ../../c-api/typeobj.rst:712 msgid "" "An optional offset to a per-instance function that implements calling the " "object using the :ref:`vectorcall protocol `, a more efficient " "alternative of the simpler :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:716 +#: ../../c-api/typeobj.rst:717 msgid "" "This field is only used if the flag :const:`Py_TPFLAGS_HAVE_VECTORCALL` is " "set. If so, this must be a positive integer containing the offset in the " "instance of a :c:type:`vectorcallfunc` pointer." msgstr "" -#: ../../c-api/typeobj.rst:720 +#: ../../c-api/typeobj.rst:721 msgid "" "The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " "behaves as if :const:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " "instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:724 +#: ../../c-api/typeobj.rst:725 msgid "" "Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:" "`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the " @@ -1469,7 +1469,7 @@ msgid "" "`PyVectorcall_Call`." msgstr "" -#: ../../c-api/typeobj.rst:731 +#: ../../c-api/typeobj.rst:732 msgid "" "It is not recommended for :ref:`mutable heap types ` to " "implement the vectorcall protocol. When a user sets :attr:`__call__` in " @@ -1477,13 +1477,13 @@ msgid "" "the vectorcall function." msgstr "" -#: ../../c-api/typeobj.rst:738 +#: ../../c-api/typeobj.rst:739 msgid "" "Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " "used for printing to a file. In Python 3.0 to 3.7, it was unused." msgstr "" -#: ../../c-api/typeobj.rst:744 +#: ../../c-api/typeobj.rst:745 msgid "" "This field is always inherited. However, the :const:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not, then " @@ -1493,11 +1493,11 @@ msgid "" "subclasses defined in Python)." msgstr "" -#: ../../c-api/typeobj.rst:756 +#: ../../c-api/typeobj.rst:757 msgid "An optional pointer to the get-attribute-string function." msgstr "" -#: ../../c-api/typeobj.rst:758 +#: ../../c-api/typeobj.rst:759 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " @@ -1505,11 +1505,11 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:764 ../../c-api/typeobj.rst:956 +#: ../../c-api/typeobj.rst:765 ../../c-api/typeobj.rst:957 msgid "Group: :attr:`tp_getattr`, :attr:`tp_getattro`" msgstr "" -#: ../../c-api/typeobj.rst:766 +#: ../../c-api/typeobj.rst:767 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1518,12 +1518,12 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:773 ../../c-api/typeobj.rst:969 +#: ../../c-api/typeobj.rst:774 ../../c-api/typeobj.rst:970 msgid "" "An optional pointer to the function for setting and deleting attributes." msgstr "" -#: ../../c-api/typeobj.rst:775 +#: ../../c-api/typeobj.rst:776 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " @@ -1531,11 +1531,11 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:781 ../../c-api/typeobj.rst:982 +#: ../../c-api/typeobj.rst:782 ../../c-api/typeobj.rst:983 msgid "Group: :attr:`tp_setattr`, :attr:`tp_setattro`" msgstr "" -#: ../../c-api/typeobj.rst:783 +#: ../../c-api/typeobj.rst:784 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1544,34 +1544,34 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:790 +#: ../../c-api/typeobj.rst:791 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement :term:`awaitable` and :term:`asynchronous iterator` " "protocols at the C-level. See :ref:`async-structs` for details." msgstr "" -#: ../../c-api/typeobj.rst:794 +#: ../../c-api/typeobj.rst:795 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "" -#: ../../c-api/typeobj.rst:799 +#: ../../c-api/typeobj.rst:800 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:807 +#: ../../c-api/typeobj.rst:808 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." msgstr "" -#: ../../c-api/typeobj.rst:810 +#: ../../c-api/typeobj.rst:811 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" -#: ../../c-api/typeobj.rst:814 +#: ../../c-api/typeobj.rst:815 msgid "" "The function must return a string or a Unicode object. Ideally, this " "function should return a string that, when passed to :func:`eval`, given a " @@ -1580,87 +1580,87 @@ msgid "" "``'>'`` from which both the type and the value of the object can be deduced." msgstr "" -#: ../../c-api/typeobj.rst:825 ../../c-api/typeobj.rst:937 -#: ../../c-api/typeobj.rst:962 ../../c-api/typeobj.rst:988 -#: ../../c-api/typeobj.rst:1030 ../../c-api/typeobj.rst:1490 -#: ../../c-api/typeobj.rst:1642 ../../c-api/typeobj.rst:1663 -#: ../../c-api/typeobj.rst:1754 ../../c-api/typeobj.rst:1790 -#: ../../c-api/typeobj.rst:1808 ../../c-api/typeobj.rst:1850 -#: ../../c-api/typeobj.rst:1871 ../../c-api/typeobj.rst:1902 +#: ../../c-api/typeobj.rst:826 ../../c-api/typeobj.rst:938 +#: ../../c-api/typeobj.rst:963 ../../c-api/typeobj.rst:989 +#: ../../c-api/typeobj.rst:1031 ../../c-api/typeobj.rst:1491 +#: ../../c-api/typeobj.rst:1643 ../../c-api/typeobj.rst:1664 +#: ../../c-api/typeobj.rst:1755 ../../c-api/typeobj.rst:1791 +#: ../../c-api/typeobj.rst:1809 ../../c-api/typeobj.rst:1851 +#: ../../c-api/typeobj.rst:1872 ../../c-api/typeobj.rst:1903 msgid "**Default:**" msgstr "**預設:**" -#: ../../c-api/typeobj.rst:827 +#: ../../c-api/typeobj.rst:828 msgid "" "When this field is not set, a string of the form ``<%s object at %p>`` is " "returned, where ``%s`` is replaced by the type name, and ``%p`` by the " "object's memory address." msgstr "" -#: ../../c-api/typeobj.rst:834 +#: ../../c-api/typeobj.rst:835 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the number protocol. These fields are documented " "in :ref:`number-structs`." msgstr "" -#: ../../c-api/typeobj.rst:840 +#: ../../c-api/typeobj.rst:841 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:846 +#: ../../c-api/typeobj.rst:847 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the sequence protocol. These fields are documented " "in :ref:`sequence-structs`." msgstr "" -#: ../../c-api/typeobj.rst:852 +#: ../../c-api/typeobj.rst:853 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:858 +#: ../../c-api/typeobj.rst:859 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the mapping protocol. These fields are documented " "in :ref:`mapping-structs`." msgstr "" -#: ../../c-api/typeobj.rst:864 +#: ../../c-api/typeobj.rst:865 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:872 +#: ../../c-api/typeobj.rst:873 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." msgstr "" -#: ../../c-api/typeobj.rst:875 +#: ../../c-api/typeobj.rst:876 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" -#: ../../c-api/typeobj.rst:879 +#: ../../c-api/typeobj.rst:880 msgid "" "The value ``-1`` should not be returned as a normal return value; when an " "error occurs during the computation of the hash value, the function should " "set an exception and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:883 +#: ../../c-api/typeobj.rst:884 msgid "" "When this field is not set (*and* :attr:`tp_richcompare` is not set), an " "attempt to take the hash of the object raises :exc:`TypeError`. This is the " "same as setting it to :c:func:`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:887 +#: ../../c-api/typeobj.rst:888 msgid "" "This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to " "block inheritance of the hash method from a parent type. This is interpreted " @@ -1671,11 +1671,11 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:897 ../../c-api/typeobj.rst:1483 +#: ../../c-api/typeobj.rst:898 ../../c-api/typeobj.rst:1484 msgid "Group: :attr:`tp_hash`, :attr:`tp_richcompare`" msgstr "" -#: ../../c-api/typeobj.rst:899 +#: ../../c-api/typeobj.rst:900 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -1684,14 +1684,14 @@ msgid "" "are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:907 +#: ../../c-api/typeobj.rst:908 msgid "" "An optional pointer to a function that implements calling the object. This " "should be ``NULL`` if the object is not callable. The signature is the same " "as for :c:func:`PyObject_Call`::" msgstr "" -#: ../../c-api/typeobj.rst:920 +#: ../../c-api/typeobj.rst:921 msgid "" "An optional pointer to a function that implements the built-in operation :" "func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls " @@ -1700,11 +1700,11 @@ msgid "" "this handler.)" msgstr "" -#: ../../c-api/typeobj.rst:925 +#: ../../c-api/typeobj.rst:926 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" -#: ../../c-api/typeobj.rst:929 +#: ../../c-api/typeobj.rst:930 msgid "" "The function must return a string or a Unicode object. It should be a " "\"friendly\" string representation of the object, as this is the " @@ -1712,28 +1712,28 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:939 +#: ../../c-api/typeobj.rst:940 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." msgstr "" -#: ../../c-api/typeobj.rst:945 +#: ../../c-api/typeobj.rst:946 msgid "An optional pointer to the get-attribute function." msgstr "" -#: ../../c-api/typeobj.rst:947 +#: ../../c-api/typeobj.rst:948 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:951 +#: ../../c-api/typeobj.rst:952 msgid "" "It is usually convenient to set this field to :c:func:" "`PyObject_GenericGetAttr`, which implements the normal way of looking for " "object attributes." msgstr "" -#: ../../c-api/typeobj.rst:958 +#: ../../c-api/typeobj.rst:959 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1742,15 +1742,15 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:964 +#: ../../c-api/typeobj.rst:965 msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:971 +#: ../../c-api/typeobj.rst:972 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:975 +#: ../../c-api/typeobj.rst:976 msgid "" "In addition, setting *value* to ``NULL`` to delete an attribute must be " "supported. It is usually convenient to set this field to :c:func:" @@ -1758,7 +1758,7 @@ msgid "" "attributes." msgstr "" -#: ../../c-api/typeobj.rst:984 +#: ../../c-api/typeobj.rst:985 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1767,24 +1767,24 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:990 +#: ../../c-api/typeobj.rst:991 msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:995 +#: ../../c-api/typeobj.rst:996 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the buffer interface. These fields are documented " "in :ref:`buffer-structs`." msgstr "" -#: ../../c-api/typeobj.rst:1001 +#: ../../c-api/typeobj.rst:1002 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:1007 +#: ../../c-api/typeobj.rst:1008 msgid "" "This field is a bit mask of various flags. Some flags indicate variant " "semantics for certain situations; others are used to indicate that certain " @@ -1796,7 +1796,7 @@ msgid "" "accessed and must be considered to have a zero or ``NULL`` value instead." msgstr "" -#: ../../c-api/typeobj.rst:1017 +#: ../../c-api/typeobj.rst:1018 msgid "" "Inheritance of this field is complicated. Most flag bits are inherited " "individually, i.e. if the base type has a flag bit set, the subtype inherits " @@ -1811,17 +1811,17 @@ msgid "" "the subtype exist and have ``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1032 +#: ../../c-api/typeobj.rst:1033 msgid "" ":c:type:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." msgstr "" -#: ../../c-api/typeobj.rst:1035 +#: ../../c-api/typeobj.rst:1036 msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1037 +#: ../../c-api/typeobj.rst:1038 msgid "" "The following bit masks are currently defined; these can be ORed together " "using the ``|`` operator to form the value of the :c:member:`~PyTypeObject." @@ -1830,7 +1830,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1044 +#: ../../c-api/typeobj.rst:1045 msgid "" "This bit is set when the type object itself is allocated on the heap, for " "example, types created dynamically using :c:func:`PyType_FromSpec`. In this " @@ -1841,32 +1841,32 @@ msgid "" "gets INCREF'ed or DECREF'ed)." msgstr "" -#: ../../c-api/typeobj.rst:1054 ../../c-api/typeobj.rst:1065 -#: ../../c-api/typeobj.rst:1075 ../../c-api/typeobj.rst:1085 -#: ../../c-api/typeobj.rst:1117 +#: ../../c-api/typeobj.rst:1055 ../../c-api/typeobj.rst:1066 +#: ../../c-api/typeobj.rst:1076 ../../c-api/typeobj.rst:1086 +#: ../../c-api/typeobj.rst:1118 msgid "???" msgstr "" -#: ../../c-api/typeobj.rst:1059 +#: ../../c-api/typeobj.rst:1060 msgid "" "This bit is set when the type can be used as the base type of another type. " "If this bit is clear, the type cannot be subtyped (similar to a \"final\" " "class in Java)." msgstr "" -#: ../../c-api/typeobj.rst:1070 +#: ../../c-api/typeobj.rst:1071 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1080 +#: ../../c-api/typeobj.rst:1081 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1090 +#: ../../c-api/typeobj.rst:1091 msgid "" "This bit is set when the object supports garbage collection. If this bit is " "set, instances must be created using :c:func:`PyObject_GC_New` and destroyed " @@ -1876,13 +1876,13 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: ../../c-api/typeobj.rst:1099 ../../c-api/typeobj.rst:1357 -#: ../../c-api/typeobj.rst:1424 +#: ../../c-api/typeobj.rst:1100 ../../c-api/typeobj.rst:1358 +#: ../../c-api/typeobj.rst:1425 msgid "" "Group: :const:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1101 +#: ../../c-api/typeobj.rst:1102 msgid "" "The :const:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :" "attr:`tp_traverse` and :attr:`tp_clear` fields, i.e. if the :const:" @@ -1891,48 +1891,48 @@ msgid "" "``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1111 +#: ../../c-api/typeobj.rst:1112 msgid "" "This is a bitmask of all the bits that pertain to the existence of certain " "fields in the type object and its extension structures. Currently, it " "includes the following bits: :const:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" -#: ../../c-api/typeobj.rst:1122 +#: ../../c-api/typeobj.rst:1123 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1124 +#: ../../c-api/typeobj.rst:1125 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1126 +#: ../../c-api/typeobj.rst:1127 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1129 +#: ../../c-api/typeobj.rst:1130 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1132 +#: ../../c-api/typeobj.rst:1133 msgid "" "This flag enables an optimization for typical method calls like ``obj." "meth()``: it avoids creating a temporary \"bound method\" object for ``obj." "meth``." msgstr "" -#: ../../c-api/typeobj.rst:1140 +#: ../../c-api/typeobj.rst:1141 msgid "" "This flag is never inherited by types without the :const:" "`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " "whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1157 +#: ../../c-api/typeobj.rst:1158 msgid "" "These flags are used by functions such as :c:func:`PyLong_Check` to quickly " "determine if a type is a subclass of a built-in type; such specific checks " @@ -1942,81 +1942,81 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1168 +#: ../../c-api/typeobj.rst:1169 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1173 +#: ../../c-api/typeobj.rst:1174 msgid "" "This flag isn't necessary anymore, as the interpreter assumes the :c:member:" "`~PyTypeObject.tp_finalize` slot is always present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1181 +#: ../../c-api/typeobj.rst:1182 msgid "" "This bit is set when the class implements the :ref:`vectorcall protocol " "`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " "details." msgstr "" -#: ../../c-api/typeobj.rst:1187 +#: ../../c-api/typeobj.rst:1188 msgid "" "This bit is inherited for types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` " "flag set, if :c:member:`~PyTypeObject.tp_call` is also inherited." msgstr "" -#: ../../c-api/typeobj.rst:1195 +#: ../../c-api/typeobj.rst:1196 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1197 +#: ../../c-api/typeobj.rst:1198 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1202 +#: ../../c-api/typeobj.rst:1203 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1208 +#: ../../c-api/typeobj.rst:1209 msgid "" "Disallow creating instances of the type: set :c:member:`~PyTypeObject." "tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." msgstr "" -#: ../../c-api/typeobj.rst:1212 +#: ../../c-api/typeobj.rst:1213 msgid "" "The flag must be set before creating the type, not after. For example, it " "must be set before :c:func:`PyType_Ready` is called on the type." msgstr "" -#: ../../c-api/typeobj.rst:1215 +#: ../../c-api/typeobj.rst:1216 msgid "" "The flag is set automatically on :ref:`static types ` if :c:" "member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:" "member:`~PyTypeObject.tp_new` is NULL." msgstr "" -#: ../../c-api/typeobj.rst:1221 +#: ../../c-api/typeobj.rst:1222 msgid "" "This flag is not inherited. However, subclasses will not be instantiable " "unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " "only possible via the C API)." msgstr "" -#: ../../c-api/typeobj.rst:1228 +#: ../../c-api/typeobj.rst:1229 msgid "" "To disallow instantiating a class directly but allow instantiating its " "subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " "Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1239 +#: ../../c-api/typeobj.rst:1240 msgid "" "This bit indicates that instances of the class may match mapping patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2024,23 +2024,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1246 ../../c-api/typeobj.rst:1268 +#: ../../c-api/typeobj.rst:1247 ../../c-api/typeobj.rst:1269 msgid "" ":const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE` are mutually " "exclusive; it is an error to enable both flags simultaneously." msgstr "" -#: ../../c-api/typeobj.rst:1251 +#: ../../c-api/typeobj.rst:1252 msgid "" "This flag is inherited by types that do not already set :const:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1254 ../../c-api/typeobj.rst:1276 +#: ../../c-api/typeobj.rst:1255 ../../c-api/typeobj.rst:1277 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1261 +#: ../../c-api/typeobj.rst:1262 msgid "" "This bit indicates that instances of the class may match sequence patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2048,37 +2048,37 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1273 +#: ../../c-api/typeobj.rst:1274 msgid "" "This flag is inherited by types that do not already set :const:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1283 +#: ../../c-api/typeobj.rst:1284 msgid "" "An optional pointer to a NUL-terminated C string giving the docstring for " "this type object. This is exposed as the :attr:`__doc__` attribute on the " "type and instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:1289 +#: ../../c-api/typeobj.rst:1290 msgid "This field is *not* inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:1294 +#: ../../c-api/typeobj.rst:1295 msgid "" "An optional pointer to a traversal function for the garbage collector. This " "is only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1299 ../../c-api/typeobj.rst:1419 +#: ../../c-api/typeobj.rst:1300 ../../c-api/typeobj.rst:1420 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1302 +#: ../../c-api/typeobj.rst:1303 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2088,7 +2088,7 @@ msgid "" "`_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1317 +#: ../../c-api/typeobj.rst:1318 msgid "" "Note that :c:func:`Py_VISIT` is called only on those members that can " "participate in reference cycles. Although there is also a ``self->key`` " @@ -2096,14 +2096,14 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1321 +#: ../../c-api/typeobj.rst:1322 msgid "" "On the other hand, even if you know a member can never be part of a cycle, " "as a debugging aid you may want to visit it anyway just so the :mod:`gc` " "module's :func:`~gc.get_referents` function will include it." msgstr "" -#: ../../c-api/typeobj.rst:1326 +#: ../../c-api/typeobj.rst:1327 msgid "" "When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " "that the instance *owns* (by having :term:`strong references ` hold a reference to " "their type. Their traversal function must therefore either visit :c:func:" @@ -2132,14 +2132,14 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1350 +#: ../../c-api/typeobj.rst:1351 msgid "" "Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " "``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1359 +#: ../../c-api/typeobj.rst:1360 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_clear` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2147,14 +2147,14 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1367 +#: ../../c-api/typeobj.rst:1368 msgid "" "An optional pointer to a clear function for the garbage collector. This is " "only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The signature " "is::" msgstr "" -#: ../../c-api/typeobj.rst:1372 +#: ../../c-api/typeobj.rst:1373 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2169,7 +2169,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1382 +#: ../../c-api/typeobj.rst:1383 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2177,7 +2177,7 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1396 +#: ../../c-api/typeobj.rst:1397 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " "delicate: the reference to the contained object must not be decremented " @@ -2192,7 +2192,7 @@ msgid "" "in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1407 +#: ../../c-api/typeobj.rst:1408 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2200,7 +2200,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: ../../c-api/typeobj.rst:1413 +#: ../../c-api/typeobj.rst:1414 msgid "" "Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break " "reference cycles, it's not necessary to clear contained objects like Python " @@ -2210,7 +2210,7 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1426 +#: ../../c-api/typeobj.rst:1427 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_traverse` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2218,18 +2218,18 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1434 +#: ../../c-api/typeobj.rst:1435 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1438 +#: ../../c-api/typeobj.rst:1439 msgid "" "The first parameter is guaranteed to be an instance of the type that is " "defined by :c:type:`PyTypeObject`." msgstr "" -#: ../../c-api/typeobj.rst:1441 +#: ../../c-api/typeobj.rst:1442 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2237,74 +2237,74 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1446 +#: ../../c-api/typeobj.rst:1447 msgid "" "The following constants are defined to be used as the third argument for :c:" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" msgstr "" -#: ../../c-api/typeobj.rst:1450 +#: ../../c-api/typeobj.rst:1451 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1450 +#: ../../c-api/typeobj.rst:1451 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1452 +#: ../../c-api/typeobj.rst:1453 msgid ":const:`Py_LT`" msgstr ":const:`Py_LT`" -#: ../../c-api/typeobj.rst:1452 +#: ../../c-api/typeobj.rst:1453 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1454 +#: ../../c-api/typeobj.rst:1455 msgid ":const:`Py_LE`" msgstr ":const:`Py_LE`" -#: ../../c-api/typeobj.rst:1454 +#: ../../c-api/typeobj.rst:1455 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1456 +#: ../../c-api/typeobj.rst:1457 msgid ":const:`Py_EQ`" msgstr ":const:`Py_EQ`" -#: ../../c-api/typeobj.rst:1456 +#: ../../c-api/typeobj.rst:1457 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1458 +#: ../../c-api/typeobj.rst:1459 msgid ":const:`Py_NE`" msgstr ":const:`Py_NE`" -#: ../../c-api/typeobj.rst:1458 +#: ../../c-api/typeobj.rst:1459 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1460 +#: ../../c-api/typeobj.rst:1461 msgid ":const:`Py_GT`" msgstr ":const:`Py_GT`" -#: ../../c-api/typeobj.rst:1460 +#: ../../c-api/typeobj.rst:1461 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1462 +#: ../../c-api/typeobj.rst:1463 msgid ":const:`Py_GE`" msgstr ":const:`Py_GE`" -#: ../../c-api/typeobj.rst:1462 +#: ../../c-api/typeobj.rst:1463 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1465 +#: ../../c-api/typeobj.rst:1466 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1469 +#: ../../c-api/typeobj.rst:1470 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " @@ -2312,15 +2312,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1475 +#: ../../c-api/typeobj.rst:1476 msgid "The return value's reference count is properly incremented." msgstr "" -#: ../../c-api/typeobj.rst:1477 +#: ../../c-api/typeobj.rst:1478 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1485 +#: ../../c-api/typeobj.rst:1486 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2328,7 +2328,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1492 +#: ../../c-api/typeobj.rst:1493 msgid "" ":c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare` " "implementation, which may be inherited. However, if only :attr:`tp_hash` is " @@ -2336,7 +2336,7 @@ msgid "" "will not be able to participate in any comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1501 +#: ../../c-api/typeobj.rst:1502 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " @@ -2346,13 +2346,13 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1508 +#: ../../c-api/typeobj.rst:1509 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1513 +#: ../../c-api/typeobj.rst:1514 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -2361,7 +2361,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1518 +#: ../../c-api/typeobj.rst:1519 msgid "" "When a type defined by a class statement has no :attr:`~object.__slots__` " "declaration, and none of its base types are weakly referenceable, the type " @@ -2370,7 +2370,7 @@ msgid "" "tp_weaklistoffset` of that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1523 +#: ../../c-api/typeobj.rst:1524 msgid "" "When a type's :attr:`__slots__` declaration contains a slot named :attr:" "`__weakref__`, that slot becomes the weak reference list head for instances " @@ -2378,31 +2378,31 @@ msgid "" "`~PyTypeObject.tp_weaklistoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1528 +#: ../../c-api/typeobj.rst:1529 msgid "" "When a type's :attr:`__slots__` declaration does not contain a slot named :" "attr:`__weakref__`, the type inherits its :c:member:`~PyTypeObject." "tp_weaklistoffset` from its base type." msgstr "" -#: ../../c-api/typeobj.rst:1535 +#: ../../c-api/typeobj.rst:1536 msgid "" "An optional pointer to a function that returns an :term:`iterator` for the " "object. Its presence normally signals that the instances of this type are :" "term:`iterable` (although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1539 +#: ../../c-api/typeobj.rst:1540 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1550 +#: ../../c-api/typeobj.rst:1551 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1555 +#: ../../c-api/typeobj.rst:1556 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2410,74 +2410,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1560 +#: ../../c-api/typeobj.rst:1561 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " "a new iterator instance)." msgstr "" -#: ../../c-api/typeobj.rst:1564 +#: ../../c-api/typeobj.rst:1565 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1573 +#: ../../c-api/typeobj.rst:1574 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." msgstr "" -#: ../../c-api/typeobj.rst:1576 +#: ../../c-api/typeobj.rst:1577 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1581 +#: ../../c-api/typeobj.rst:1582 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1587 +#: ../../c-api/typeobj.rst:1588 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " "of instances of this type." msgstr "" -#: ../../c-api/typeobj.rst:1591 +#: ../../c-api/typeobj.rst:1592 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1596 +#: ../../c-api/typeobj.rst:1597 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1602 +#: ../../c-api/typeobj.rst:1603 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " "type." msgstr "" -#: ../../c-api/typeobj.rst:1605 +#: ../../c-api/typeobj.rst:1606 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1610 +#: ../../c-api/typeobj.rst:1611 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1616 +#: ../../c-api/typeobj.rst:1617 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2485,7 +2485,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1624 +#: ../../c-api/typeobj.rst:1625 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2493,7 +2493,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1629 +#: ../../c-api/typeobj.rst:1630 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "func:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2501,27 +2501,27 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1635 +#: ../../c-api/typeobj.rst:1636 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1640 +#: ../../c-api/typeobj.rst:1641 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1644 +#: ../../c-api/typeobj.rst:1645 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1650 +#: ../../c-api/typeobj.rst:1651 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1652 +#: ../../c-api/typeobj.rst:1653 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2530,45 +2530,45 @@ msgid "" "they don't correspond to overloaded operations (like :meth:`__add__`)." msgstr "" -#: ../../c-api/typeobj.rst:1660 +#: ../../c-api/typeobj.rst:1661 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1665 +#: ../../c-api/typeobj.rst:1666 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1670 +#: ../../c-api/typeobj.rst:1671 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" -#: ../../c-api/typeobj.rst:1676 +#: ../../c-api/typeobj.rst:1677 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1678 ../../c-api/typeobj.rst:1694 -#: ../../c-api/typeobj.rst:1769 ../../c-api/typeobj.rst:1799 -#: ../../c-api/typeobj.rst:1823 +#: ../../c-api/typeobj.rst:1679 ../../c-api/typeobj.rst:1695 +#: ../../c-api/typeobj.rst:1770 ../../c-api/typeobj.rst:1800 +#: ../../c-api/typeobj.rst:1824 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1691 +#: ../../c-api/typeobj.rst:1692 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1698 +#: ../../c-api/typeobj.rst:1699 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1709 +#: ../../c-api/typeobj.rst:1710 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -2576,13 +2576,13 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1714 +#: ../../c-api/typeobj.rst:1715 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1717 +#: ../../c-api/typeobj.rst:1718 msgid "" "If the value of this field is greater than zero, it specifies the offset " "from the start of the instance structure. If the value is less than zero, " @@ -2598,7 +2598,7 @@ msgid "" "the very end of the structure." msgstr "" -#: ../../c-api/typeobj.rst:1729 +#: ../../c-api/typeobj.rst:1730 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -2607,7 +2607,7 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: ../../c-api/typeobj.rst:1737 +#: ../../c-api/typeobj.rst:1738 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype instances " @@ -2616,7 +2616,7 @@ msgid "" "should not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1742 +#: ../../c-api/typeobj.rst:1743 msgid "" "When a type defined by a class statement has no :attr:`~object.__slots__` " "declaration, and none of its base types has an instance variable dictionary, " @@ -2624,14 +2624,14 @@ msgid "" "`~PyTypeObject.tp_dictoffset` is set to that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1747 +#: ../../c-api/typeobj.rst:1748 msgid "" "When a type defined by a class statement has a :attr:`__slots__` " "declaration, the type inherits its :c:member:`~PyTypeObject.tp_dictoffset` " "from its base type." msgstr "" -#: ../../c-api/typeobj.rst:1750 +#: ../../c-api/typeobj.rst:1751 msgid "" "(Adding a slot named :attr:`~object.__dict__` to the :attr:`__slots__` " "declaration does not have the expected effect, it just causes confusion. " @@ -2639,17 +2639,17 @@ msgid "" "though.)" msgstr "" -#: ../../c-api/typeobj.rst:1756 +#: ../../c-api/typeobj.rst:1757 msgid "" "This slot has no default. For :ref:`static types `, if the " "field is ``NULL`` then no :attr:`__dict__` gets created for instances." msgstr "" -#: ../../c-api/typeobj.rst:1762 +#: ../../c-api/typeobj.rst:1763 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1764 +#: ../../c-api/typeobj.rst:1765 msgid "" "This function corresponds to the :meth:`__init__` method of classes. Like :" "meth:`__init__`, it is possible to create an instance without calling :meth:" @@ -2657,14 +2657,14 @@ msgid "" "meth:`__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1773 +#: ../../c-api/typeobj.rst:1774 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" "`__init__`." msgstr "" -#: ../../c-api/typeobj.rst:1777 +#: ../../c-api/typeobj.rst:1778 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -2676,43 +2676,43 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1784 +#: ../../c-api/typeobj.rst:1785 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1792 +#: ../../c-api/typeobj.rst:1793 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1797 +#: ../../c-api/typeobj.rst:1798 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1805 +#: ../../c-api/typeobj.rst:1806 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1810 +#: ../../c-api/typeobj.rst:1811 msgid "" "For dynamic subtypes, this field is always set to :c:func:" "`PyType_GenericAlloc`, to force a standard heap allocation strategy." msgstr "" -#: ../../c-api/typeobj.rst:1814 +#: ../../c-api/typeobj.rst:1815 msgid "" "For static subtypes, :c:type:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: ../../c-api/typeobj.rst:1821 +#: ../../c-api/typeobj.rst:1822 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1827 +#: ../../c-api/typeobj.rst:1828 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -2721,7 +2721,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1833 +#: ../../c-api/typeobj.rst:1834 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2733,20 +2733,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1841 +#: ../../c-api/typeobj.rst:1842 msgid "" "Set the :const:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow creating " "instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1846 +#: ../../c-api/typeobj.rst:1847 msgid "" "This field is inherited by subtypes, except it is not inherited by :ref:" "`static types ` whose :c:member:`~PyTypeObject.tp_base` is " "``NULL`` or ``&PyBaseObject_Type``." msgstr "" -#: ../../c-api/typeobj.rst:1852 +#: ../../c-api/typeobj.rst:1853 msgid "" "For :ref:`static types ` this field has no default. This means " "if the slot is defined as ``NULL``, the type cannot be called to create new " @@ -2754,39 +2754,39 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1860 +#: ../../c-api/typeobj.rst:1861 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1864 +#: ../../c-api/typeobj.rst:1865 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1868 +#: ../../c-api/typeobj.rst:1869 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1873 +#: ../../c-api/typeobj.rst:1874 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" "func:`PyType_GenericAlloc` and the value of the :const:`Py_TPFLAGS_HAVE_GC` " "flag bit." msgstr "" -#: ../../c-api/typeobj.rst:1877 +#: ../../c-api/typeobj.rst:1878 msgid "For static subtypes, :c:type:`PyBaseObject_Type` uses PyObject_Del." msgstr "" -#: ../../c-api/typeobj.rst:1882 +#: ../../c-api/typeobj.rst:1883 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1884 +#: ../../c-api/typeobj.rst:1885 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " @@ -2798,90 +2798,90 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1894 +#: ../../c-api/typeobj.rst:1895 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" "`PyType_Type`, defines this function to distinguish between statically and :" "ref:`dynamically allocated types `.)" msgstr "" -#: ../../c-api/typeobj.rst:1904 +#: ../../c-api/typeobj.rst:1905 msgid "" "This slot has no default. If this field is ``NULL``, :const:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:1910 +#: ../../c-api/typeobj.rst:1911 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1912 ../../c-api/typeobj.rst:1936 +#: ../../c-api/typeobj.rst:1913 ../../c-api/typeobj.rst:1937 msgid "" "This field should be set to ``NULL`` and treated as read-only. Python will " "fill it in when the type is :c:func:`initialized `." msgstr "" -#: ../../c-api/typeobj.rst:1915 +#: ../../c-api/typeobj.rst:1916 msgid "" "For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " "` can be used instead of the *bases* argument of :c:func:" "`PyType_FromSpecWithBases`. The argument form is preferred." msgstr "" -#: ../../c-api/typeobj.rst:1922 +#: ../../c-api/typeobj.rst:1923 msgid "" "Multiple inheritance does not work well for statically defined types. If you " "set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " "will only be inherited from the first base." msgstr "" -#: ../../c-api/typeobj.rst:1928 ../../c-api/typeobj.rst:1951 -#: ../../c-api/typeobj.rst:1960 ../../c-api/typeobj.rst:1970 -#: ../../c-api/typeobj.rst:1984 +#: ../../c-api/typeobj.rst:1929 ../../c-api/typeobj.rst:1952 +#: ../../c-api/typeobj.rst:1961 ../../c-api/typeobj.rst:1971 +#: ../../c-api/typeobj.rst:1985 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1933 +#: ../../c-api/typeobj.rst:1934 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." msgstr "" -#: ../../c-api/typeobj.rst:1941 +#: ../../c-api/typeobj.rst:1942 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1947 +#: ../../c-api/typeobj.rst:1948 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1956 +#: ../../c-api/typeobj.rst:1957 msgid "List of weak references to subclasses. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1965 +#: ../../c-api/typeobj.rst:1966 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1975 +#: ../../c-api/typeobj.rst:1976 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:1980 +#: ../../c-api/typeobj.rst:1981 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1989 +#: ../../c-api/typeobj.rst:1990 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1993 +#: ../../c-api/typeobj.rst:1994 msgid "" "If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " "once when finalizing an instance. It is called either from the garbage " @@ -2891,14 +2891,14 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:2000 +#: ../../c-api/typeobj.rst:2001 msgid "" ":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " "exception status; therefore, a recommended way to write a non-trivial " "finalizer is::" msgstr "" -#: ../../c-api/typeobj.rst:2017 +#: ../../c-api/typeobj.rst:2018 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 " @@ -2911,18 +2911,18 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2036 +#: ../../c-api/typeobj.rst:2037 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:2040 +#: ../../c-api/typeobj.rst:2041 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2045 +#: ../../c-api/typeobj.rst:2046 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -2930,61 +2930,61 @@ msgid "" "attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2053 +#: ../../c-api/typeobj.rst:2054 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2055 +#: ../../c-api/typeobj.rst:2056 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2061 +#: ../../c-api/typeobj.rst:2062 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2063 +#: ../../c-api/typeobj.rst:2064 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:2067 +#: ../../c-api/typeobj.rst:2068 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2069 +#: ../../c-api/typeobj.rst:2070 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2071 +#: ../../c-api/typeobj.rst:2072 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:2073 +#: ../../c-api/typeobj.rst:2074 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2077 +#: ../../c-api/typeobj.rst:2078 msgid "" "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " "` as an opaque struct, any extension modules using static types must " "be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2085 +#: ../../c-api/typeobj.rst:2086 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2087 +#: ../../c-api/typeobj.rst:2088 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -2992,29 +2992,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2092 +#: ../../c-api/typeobj.rst:2093 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:2100 +#: ../../c-api/typeobj.rst:2101 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2107 +#: ../../c-api/typeobj.rst:2108 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:2113 ../../c-api/typeobj.rst:2437 +#: ../../c-api/typeobj.rst:2114 ../../c-api/typeobj.rst:2438 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2160 +#: ../../c-api/typeobj.rst:2161 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 " @@ -3024,30 +3024,30 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2169 +#: ../../c-api/typeobj.rst:2170 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:2214 +#: ../../c-api/typeobj.rst:2215 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2221 +#: ../../c-api/typeobj.rst:2222 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:2226 +#: ../../c-api/typeobj.rst:2227 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:2232 +#: ../../c-api/typeobj.rst:2233 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3055,7 +3055,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2240 +#: ../../c-api/typeobj.rst:2241 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" @@ -3065,17 +3065,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2251 +#: ../../c-api/typeobj.rst:2252 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2258 +#: ../../c-api/typeobj.rst:2259 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2263 +#: ../../c-api/typeobj.rst:2264 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 " @@ -3083,21 +3083,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2270 +#: ../../c-api/typeobj.rst:2271 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:2276 +#: ../../c-api/typeobj.rst:2277 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:2282 +#: ../../c-api/typeobj.rst:2283 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 " @@ -3106,7 +3106,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2288 +#: ../../c-api/typeobj.rst:2289 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 " @@ -3114,7 +3114,7 @@ msgid "" "the index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2295 +#: ../../c-api/typeobj.rst:2296 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:" @@ -3123,14 +3123,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2304 +#: ../../c-api/typeobj.rst:2305 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:2311 +#: ../../c-api/typeobj.rst:2312 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 " @@ -3140,7 +3140,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2320 +#: ../../c-api/typeobj.rst:2321 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 " @@ -3150,72 +3150,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2331 +#: ../../c-api/typeobj.rst:2332 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2339 +#: ../../c-api/typeobj.rst:2340 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:2345 ../../c-api/typeobj.rst:2394 -#: ../../c-api/typeobj.rst:2448 ../../c-api/typeobj.rst:2459 -#: ../../c-api/typeobj.rst:2471 ../../c-api/typeobj.rst:2480 +#: ../../c-api/typeobj.rst:2346 ../../c-api/typeobj.rst:2395 +#: ../../c-api/typeobj.rst:2449 ../../c-api/typeobj.rst:2460 +#: ../../c-api/typeobj.rst:2472 ../../c-api/typeobj.rst:2481 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2349 +#: ../../c-api/typeobj.rst:2350 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:2353 +#: ../../c-api/typeobj.rst:2354 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " "set :c:expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2356 +#: ../../c-api/typeobj.rst:2357 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2358 +#: ../../c-api/typeobj.rst:2359 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2360 +#: ../../c-api/typeobj.rst:2361 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2362 +#: ../../c-api/typeobj.rst:2363 msgid "Return ``0``." msgstr "" -#: ../../c-api/typeobj.rst:2364 +#: ../../c-api/typeobj.rst:2365 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2367 +#: ../../c-api/typeobj.rst:2368 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "expr:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2370 +#: ../../c-api/typeobj.rst:2371 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2374 +#: ../../c-api/typeobj.rst:2375 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3223,7 +3223,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2379 +#: ../../c-api/typeobj.rst:2380 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:" @@ -3232,19 +3232,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2386 +#: ../../c-api/typeobj.rst:2387 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:2389 +#: ../../c-api/typeobj.rst:2390 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2398 +#: ../../c-api/typeobj.rst:2399 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 " @@ -3252,15 +3252,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2403 +#: ../../c-api/typeobj.rst:2404 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2405 +#: ../../c-api/typeobj.rst:2406 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2407 +#: ../../c-api/typeobj.rst:2408 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 " @@ -3268,68 +3268,68 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2413 +#: ../../c-api/typeobj.rst:2414 msgid "" "This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2418 +#: ../../c-api/typeobj.rst:2419 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2426 +#: ../../c-api/typeobj.rst:2427 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2434 +#: ../../c-api/typeobj.rst:2435 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2452 +#: ../../c-api/typeobj.rst:2453 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:2455 +#: ../../c-api/typeobj.rst:2456 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2463 +#: ../../c-api/typeobj.rst:2464 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`__anext__` " "for details." msgstr "" -#: ../../c-api/typeobj.rst:2466 +#: ../../c-api/typeobj.rst:2467 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2475 +#: ../../c-api/typeobj.rst:2476 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " "This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2484 +#: ../../c-api/typeobj.rst:2485 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2493 +#: ../../c-api/typeobj.rst:2494 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2497 +#: ../../c-api/typeobj.rst:2498 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 " @@ -3343,80 +3343,80 @@ msgid "" "member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2507 +#: ../../c-api/typeobj.rst:2508 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:2514 +#: ../../c-api/typeobj.rst:2515 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2518 +#: ../../c-api/typeobj.rst:2519 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2522 +#: ../../c-api/typeobj.rst:2523 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2526 +#: ../../c-api/typeobj.rst:2527 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2530 ../../c-api/typeobj.rst:2539 +#: ../../c-api/typeobj.rst:2531 ../../c-api/typeobj.rst:2540 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2534 ../../c-api/typeobj.rst:2545 +#: ../../c-api/typeobj.rst:2535 ../../c-api/typeobj.rst:2546 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:2541 +#: ../../c-api/typeobj.rst:2542 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2548 +#: ../../c-api/typeobj.rst:2549 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2552 +#: ../../c-api/typeobj.rst:2553 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:2556 +#: ../../c-api/typeobj.rst:2557 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:2560 +#: ../../c-api/typeobj.rst:2561 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:2564 +#: ../../c-api/typeobj.rst:2565 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:2568 +#: ../../c-api/typeobj.rst:2569 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:2572 +#: ../../c-api/typeobj.rst:2573 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:2586 +#: ../../c-api/typeobj.rst:2587 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:2602 +#: ../../c-api/typeobj.rst:2603 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2604 +#: ../../c-api/typeobj.rst:2605 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3424,33 +3424,33 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2609 +#: ../../c-api/typeobj.rst:2610 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2626 +#: ../../c-api/typeobj.rst:2627 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2670 +#: ../../c-api/typeobj.rst:2671 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2697 +#: ../../c-api/typeobj.rst:2698 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:2716 +#: ../../c-api/typeobj.rst:2717 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2727 +#: ../../c-api/typeobj.rst:2728 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 068ab4d4a6..d5c8d46ea6 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-17 00:14+0000\n" +"POT-Creation-Date: 2023-01-05 00:16+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-" @@ -166,37 +166,37 @@ msgstr "" msgid "" "Names in the target list are not deleted when the loop is finished, but if " "the sequence is empty, they will not have been assigned to at all by the " -"loop. Hint: the built-in function :func:`range` returns an iterator of " -"integers suitable to emulate the effect of Pascal's ``for i := a to b do``; " -"e.g., ``list(range(3))`` returns the list ``[0, 1, 2]``." +"loop. Hint: the built-in type :func:`range` represents immutable arithmetic " +"sequences of integers. For instance, iterating ``range(3)`` successively " +"yields 0, 1, and then 2." msgstr "" -#: ../../reference/compound_stmts.rst:199 +#: ../../reference/compound_stmts.rst:198 msgid "Starred elements are now allowed in the expression list." msgstr "" -#: ../../reference/compound_stmts.rst:206 +#: ../../reference/compound_stmts.rst:205 msgid "The :keyword:`!try` statement" msgstr "" -#: ../../reference/compound_stmts.rst:216 +#: ../../reference/compound_stmts.rst:215 msgid "" "The :keyword:`!try` statement specifies exception handlers and/or cleanup " "code for a group of statements:" msgstr "" -#: ../../reference/compound_stmts.rst:232 +#: ../../reference/compound_stmts.rst:231 msgid "" "Additional information on exceptions can be found in section :ref:" "`exceptions`, and information on using the :keyword:`raise` statement to " "generate exceptions may be found in section :ref:`raise`." msgstr "" -#: ../../reference/compound_stmts.rst:240 +#: ../../reference/compound_stmts.rst:239 msgid ":keyword:`!except` clause" msgstr "" -#: ../../reference/compound_stmts.rst:242 +#: ../../reference/compound_stmts.rst:241 msgid "" "The :keyword:`!except` clause(s) specify one or more exception handlers. " "When no exception occurs in the :keyword:`try` clause, no exception handler " @@ -213,14 +213,14 @@ msgid "" "the exception object." msgstr "" -#: ../../reference/compound_stmts.rst:257 +#: ../../reference/compound_stmts.rst:256 msgid "" "If no :keyword:`!except` clause matches the exception, the search for an " "exception handler continues in the surrounding code and on the invocation " "stack. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:261 +#: ../../reference/compound_stmts.rst:260 msgid "" "If the evaluation of an expression in the header of an :keyword:`!except` " "clause raises an exception, the original search for a handler is canceled " @@ -229,7 +229,7 @@ msgid "" "the exception)." msgstr "" -#: ../../reference/compound_stmts.rst:269 +#: ../../reference/compound_stmts.rst:268 msgid "" "When a matching :keyword:`!except` clause is found, the exception is " "assigned to the target specified after the :keyword:`!as` keyword in that :" @@ -242,17 +242,17 @@ msgid "" "handle the exception.)" msgstr "" -#: ../../reference/compound_stmts.rst:280 +#: ../../reference/compound_stmts.rst:279 msgid "" "When an exception has been assigned using ``as target``, it is cleared at " "the end of the :keyword:`!except` clause. This is as if ::" msgstr "" -#: ../../reference/compound_stmts.rst:286 +#: ../../reference/compound_stmts.rst:285 msgid "was translated to ::" msgstr "" -#: ../../reference/compound_stmts.rst:294 +#: ../../reference/compound_stmts.rst:293 msgid "" "This means the exception must be assigned to a different name to be able to " "refer to it after the :keyword:`!except` clause. Exceptions are cleared " @@ -261,7 +261,7 @@ msgid "" "garbage collection occurs." msgstr "" -#: ../../reference/compound_stmts.rst:304 +#: ../../reference/compound_stmts.rst:303 msgid "" "Before an :keyword:`!except` clause's suite is executed, details about the " "exception are stored in the :mod:`sys` module and can be accessed via :func:" @@ -272,11 +272,11 @@ msgid "" "are restored to their previous values when leaving an exception handler::" msgstr "" -#: ../../reference/compound_stmts.rst:338 +#: ../../reference/compound_stmts.rst:337 msgid ":keyword:`!except*` clause" msgstr "" -#: ../../reference/compound_stmts.rst:340 +#: ../../reference/compound_stmts.rst:339 msgid "" "The :keyword:`!except*` clause(s) are used for handling :exc:" "`ExceptionGroup`\\s. The exception type for matching is interpreted as in " @@ -289,21 +289,21 @@ msgid "" "that matches it. ::" msgstr "" -#: ../../reference/compound_stmts.rst:368 +#: ../../reference/compound_stmts.rst:367 msgid "" "Any remaining exceptions that were not handled by any :keyword:`!except*` " "clause are re-raised at the end, combined into an exception group along with " "all exceptions that were raised from within :keyword:`!except*` clauses." msgstr "" -#: ../../reference/compound_stmts.rst:372 +#: ../../reference/compound_stmts.rst:371 msgid "" "If the raised exception is not an exception group and its type matches one " "of the :keyword:`!except*` clauses, it is caught and wrapped by an exception " "group with an empty message string. ::" msgstr "" -#: ../../reference/compound_stmts.rst:383 +#: ../../reference/compound_stmts.rst:382 msgid "" "An :keyword:`!except*` clause must have a matching type, and this type " "cannot be a subclass of :exc:`BaseExceptionGroup`. It is not possible to " @@ -312,11 +312,11 @@ msgid "" "an :keyword:`!except*` clause." msgstr "" -#: ../../reference/compound_stmts.rst:400 +#: ../../reference/compound_stmts.rst:399 msgid ":keyword:`!else` clause" msgstr "" -#: ../../reference/compound_stmts.rst:402 +#: ../../reference/compound_stmts.rst:401 msgid "" "The optional :keyword:`!else` clause is executed if the control flow leaves " "the :keyword:`try` suite, no exception was raised, and no :keyword:" @@ -325,11 +325,11 @@ msgid "" "keyword:`except` clauses." msgstr "" -#: ../../reference/compound_stmts.rst:414 +#: ../../reference/compound_stmts.rst:413 msgid ":keyword:`!finally` clause" msgstr "" -#: ../../reference/compound_stmts.rst:416 +#: ../../reference/compound_stmts.rst:415 msgid "" "If :keyword:`!finally` is present, it specifies a 'cleanup' handler. The :" "keyword:`try` clause is executed, including any :keyword:`except` and :" @@ -343,13 +343,13 @@ msgid "" "exception is discarded::" msgstr "" -#: ../../reference/compound_stmts.rst:435 +#: ../../reference/compound_stmts.rst:434 msgid "" "The exception information is not available to the program during execution " "of the :keyword:`!finally` clause." msgstr "" -#: ../../reference/compound_stmts.rst:443 +#: ../../reference/compound_stmts.rst:442 msgid "" "When a :keyword:`return`, :keyword:`break` or :keyword:`continue` statement " "is executed in the :keyword:`try` suite of a :keyword:`!try`...\\ :keyword:`!" @@ -357,7 +357,7 @@ msgid "" "way out.'" msgstr "" -#: ../../reference/compound_stmts.rst:447 +#: ../../reference/compound_stmts.rst:446 msgid "" "The return value of a function is determined by the last :keyword:`return` " "statement executed. Since the :keyword:`!finally` clause always executes, " @@ -365,17 +365,17 @@ msgid "" "will always be the last one executed::" msgstr "" -#: ../../reference/compound_stmts.rst:461 +#: ../../reference/compound_stmts.rst:460 msgid "" "Prior to Python 3.8, a :keyword:`continue` statement was illegal in the :" "keyword:`!finally` clause due to a problem with the implementation." msgstr "" -#: ../../reference/compound_stmts.rst:470 +#: ../../reference/compound_stmts.rst:469 msgid "The :keyword:`!with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:479 +#: ../../reference/compound_stmts.rst:478 msgid "" "The :keyword:`with` statement is used to wrap the execution of a block with " "methods defined by a context manager (see section :ref:`context-managers`). " @@ -383,37 +383,37 @@ msgid "" "`finally` usage patterns to be encapsulated for convenient reuse." msgstr "" -#: ../../reference/compound_stmts.rst:489 +#: ../../reference/compound_stmts.rst:488 msgid "" "The execution of the :keyword:`with` statement with one \"item\" proceeds as " "follows:" msgstr "" -#: ../../reference/compound_stmts.rst:491 +#: ../../reference/compound_stmts.rst:490 msgid "" "The context expression (the expression given in the :token:`~python-grammar:" "with_item`) is evaluated to obtain a context manager." msgstr "" -#: ../../reference/compound_stmts.rst:494 +#: ../../reference/compound_stmts.rst:493 msgid "The context manager's :meth:`__enter__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:496 +#: ../../reference/compound_stmts.rst:495 msgid "The context manager's :meth:`__exit__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:498 +#: ../../reference/compound_stmts.rst:497 msgid "The context manager's :meth:`__enter__` method is invoked." msgstr "" -#: ../../reference/compound_stmts.rst:500 +#: ../../reference/compound_stmts.rst:499 msgid "" "If a target was included in the :keyword:`with` statement, the return value " "from :meth:`__enter__` is assigned to it." msgstr "" -#: ../../reference/compound_stmts.rst:505 +#: ../../reference/compound_stmts.rst:504 msgid "" "The :keyword:`with` statement guarantees that if the :meth:`__enter__` " "method returns without an error, then :meth:`__exit__` will always be " @@ -422,11 +422,11 @@ msgid "" "See step 7 below." msgstr "" -#: ../../reference/compound_stmts.rst:511 +#: ../../reference/compound_stmts.rst:510 msgid "The suite is executed." msgstr "" -#: ../../reference/compound_stmts.rst:513 +#: ../../reference/compound_stmts.rst:512 msgid "" "The context manager's :meth:`__exit__` method is invoked. If an exception " "caused the suite to be exited, its type, value, and traceback are passed as " @@ -434,7 +434,7 @@ msgid "" "supplied." msgstr "" -#: ../../reference/compound_stmts.rst:518 +#: ../../reference/compound_stmts.rst:517 msgid "" "If the suite was exited due to an exception, and the return value from the :" "meth:`__exit__` method was false, the exception is reraised. If the return " @@ -442,119 +442,119 @@ msgid "" "the statement following the :keyword:`with` statement." msgstr "" -#: ../../reference/compound_stmts.rst:523 +#: ../../reference/compound_stmts.rst:522 msgid "" "If the suite was exited for any reason other than an exception, the return " "value from :meth:`__exit__` is ignored, and execution proceeds at the normal " "location for the kind of exit that was taken." msgstr "" -#: ../../reference/compound_stmts.rst:527 -#: ../../reference/compound_stmts.rst:1518 -#: ../../reference/compound_stmts.rst:1559 +#: ../../reference/compound_stmts.rst:526 +#: ../../reference/compound_stmts.rst:1517 +#: ../../reference/compound_stmts.rst:1558 msgid "The following code::" msgstr "" -#: ../../reference/compound_stmts.rst:532 -#: ../../reference/compound_stmts.rst:557 -#: ../../reference/compound_stmts.rst:1564 +#: ../../reference/compound_stmts.rst:531 +#: ../../reference/compound_stmts.rst:556 +#: ../../reference/compound_stmts.rst:1563 msgid "is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:551 +#: ../../reference/compound_stmts.rst:550 msgid "" "With more than one item, the context managers are processed as if multiple :" "keyword:`with` statements were nested::" msgstr "" -#: ../../reference/compound_stmts.rst:563 +#: ../../reference/compound_stmts.rst:562 msgid "" "You can also write multi-item context managers in multiple lines if the " "items are surrounded by parentheses. For example::" msgstr "" -#: ../../reference/compound_stmts.rst:572 +#: ../../reference/compound_stmts.rst:571 msgid "Support for multiple context expressions." msgstr "" -#: ../../reference/compound_stmts.rst:575 +#: ../../reference/compound_stmts.rst:574 msgid "" "Support for using grouping parentheses to break the statement in multiple " "lines." msgstr "" -#: ../../reference/compound_stmts.rst:581 +#: ../../reference/compound_stmts.rst:580 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/compound_stmts.rst:581 +#: ../../reference/compound_stmts.rst:580 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/compound_stmts.rst:587 +#: ../../reference/compound_stmts.rst:586 msgid "The :keyword:`!match` statement" msgstr "" -#: ../../reference/compound_stmts.rst:601 +#: ../../reference/compound_stmts.rst:600 msgid "The match statement is used for pattern matching. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:610 +#: ../../reference/compound_stmts.rst:609 msgid "" "This section uses single quotes to denote :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:613 +#: ../../reference/compound_stmts.rst:612 msgid "" "Pattern matching takes a pattern as input (following ``case``) and a subject " "value (following ``match``). The pattern (which may contain subpatterns) is " "matched against the subject value. The outcomes are:" msgstr "" -#: ../../reference/compound_stmts.rst:617 +#: ../../reference/compound_stmts.rst:616 msgid "A match success or failure (also termed a pattern success or failure)." msgstr "" -#: ../../reference/compound_stmts.rst:619 +#: ../../reference/compound_stmts.rst:618 msgid "" "Possible binding of matched values to a name. The prerequisites for this " "are further discussed below." msgstr "" -#: ../../reference/compound_stmts.rst:622 +#: ../../reference/compound_stmts.rst:621 msgid "" "The ``match`` and ``case`` keywords are :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:626 -#: ../../reference/compound_stmts.rst:1181 +#: ../../reference/compound_stmts.rst:625 +#: ../../reference/compound_stmts.rst:1180 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../reference/compound_stmts.rst:627 -#: ../../reference/compound_stmts.rst:1182 +#: ../../reference/compound_stmts.rst:626 +#: ../../reference/compound_stmts.rst:1181 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" -#: ../../reference/compound_stmts.rst:631 +#: ../../reference/compound_stmts.rst:630 msgid "Overview" msgstr "" -#: ../../reference/compound_stmts.rst:633 +#: ../../reference/compound_stmts.rst:632 msgid "Here's an overview of the logical flow of a match statement:" msgstr "" -#: ../../reference/compound_stmts.rst:636 +#: ../../reference/compound_stmts.rst:635 msgid "" "The subject expression ``subject_expr`` is evaluated and a resulting subject " "value obtained. If the subject expression contains a comma, a tuple is " "constructed using :ref:`the standard rules `." msgstr "" -#: ../../reference/compound_stmts.rst:640 +#: ../../reference/compound_stmts.rst:639 msgid "" "Each pattern in a ``case_block`` is attempted to match with the subject " "value. The specific rules for success or failure are described below. The " @@ -564,7 +564,7 @@ msgid "" "outlive the executed block and can be used after the match statement**." msgstr "" -#: ../../reference/compound_stmts.rst:649 +#: ../../reference/compound_stmts.rst:648 msgid "" "During failed pattern matches, some subpatterns may succeed. Do not rely on " "bindings being made for a failed match. Conversely, do not rely on " @@ -573,87 +573,87 @@ msgid "" "made to allow different implementations to add optimizations." msgstr "" -#: ../../reference/compound_stmts.rst:656 +#: ../../reference/compound_stmts.rst:655 msgid "" "If the pattern succeeds, the corresponding guard (if present) is evaluated. " "In this case all name bindings are guaranteed to have happened." msgstr "" -#: ../../reference/compound_stmts.rst:659 +#: ../../reference/compound_stmts.rst:658 msgid "" "If the guard evaluates as true or is missing, the ``block`` inside " "``case_block`` is executed." msgstr "" -#: ../../reference/compound_stmts.rst:662 +#: ../../reference/compound_stmts.rst:661 msgid "Otherwise, the next ``case_block`` is attempted as described above." msgstr "" -#: ../../reference/compound_stmts.rst:664 +#: ../../reference/compound_stmts.rst:663 msgid "If there are no further case blocks, the match statement is completed." msgstr "" -#: ../../reference/compound_stmts.rst:668 +#: ../../reference/compound_stmts.rst:667 msgid "" "Users should generally never rely on a pattern being evaluated. Depending " "on implementation, the interpreter may cache values or use other " "optimizations which skip repeated evaluations." msgstr "" -#: ../../reference/compound_stmts.rst:672 +#: ../../reference/compound_stmts.rst:671 msgid "A sample match statement::" msgstr "" -#: ../../reference/compound_stmts.rst:688 +#: ../../reference/compound_stmts.rst:687 msgid "" "In this case, ``if flag`` is a guard. Read more about that in the next " "section." msgstr "" -#: ../../reference/compound_stmts.rst:691 +#: ../../reference/compound_stmts.rst:690 msgid "Guards" msgstr "" -#: ../../reference/compound_stmts.rst:698 +#: ../../reference/compound_stmts.rst:697 msgid "" "A ``guard`` (which is part of the ``case``) must succeed for code inside the " "``case`` block to execute. It takes the form: :keyword:`if` followed by an " "expression." msgstr "" -#: ../../reference/compound_stmts.rst:703 +#: ../../reference/compound_stmts.rst:702 msgid "The logical flow of a ``case`` block with a ``guard`` follows:" msgstr "" -#: ../../reference/compound_stmts.rst:705 +#: ../../reference/compound_stmts.rst:704 msgid "" "Check that the pattern in the ``case`` block succeeded. If the pattern " "failed, the ``guard`` is not evaluated and the next ``case`` block is " "checked." msgstr "" -#: ../../reference/compound_stmts.rst:709 +#: ../../reference/compound_stmts.rst:708 msgid "If the pattern succeeded, evaluate the ``guard``." msgstr "" -#: ../../reference/compound_stmts.rst:711 +#: ../../reference/compound_stmts.rst:710 msgid "" "If the ``guard`` condition evaluates as true, the case block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:714 +#: ../../reference/compound_stmts.rst:713 msgid "" "If the ``guard`` condition evaluates as false, the case block is not " "selected." msgstr "" -#: ../../reference/compound_stmts.rst:717 +#: ../../reference/compound_stmts.rst:716 msgid "" "If the ``guard`` raises an exception during evaluation, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:720 +#: ../../reference/compound_stmts.rst:719 msgid "" "Guards are allowed to have side effects as they are expressions. Guard " "evaluation must proceed from the first to the last case block, one at a " @@ -662,17 +662,17 @@ msgid "" "block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:730 +#: ../../reference/compound_stmts.rst:729 msgid "Irrefutable Case Blocks" msgstr "" -#: ../../reference/compound_stmts.rst:734 +#: ../../reference/compound_stmts.rst:733 msgid "" "An irrefutable case block is a match-all case block. A match statement may " "have at most one irrefutable case block, and it must be last." msgstr "" -#: ../../reference/compound_stmts.rst:737 +#: ../../reference/compound_stmts.rst:736 msgid "" "A case block is considered irrefutable if it has no guard and its pattern is " "irrefutable. A pattern is considered irrefutable if we can prove from its " @@ -680,47 +680,47 @@ msgid "" "irrefutable:" msgstr "" -#: ../../reference/compound_stmts.rst:742 +#: ../../reference/compound_stmts.rst:741 msgid ":ref:`as-patterns` whose left-hand side is irrefutable" msgstr "" -#: ../../reference/compound_stmts.rst:744 +#: ../../reference/compound_stmts.rst:743 msgid ":ref:`or-patterns` containing at least one irrefutable pattern" msgstr "" -#: ../../reference/compound_stmts.rst:746 +#: ../../reference/compound_stmts.rst:745 msgid ":ref:`capture-patterns`" msgstr ":ref:`capture-patterns`" -#: ../../reference/compound_stmts.rst:748 +#: ../../reference/compound_stmts.rst:747 msgid ":ref:`wildcard-patterns`" msgstr ":ref:`wildcard-patterns`" -#: ../../reference/compound_stmts.rst:750 +#: ../../reference/compound_stmts.rst:749 msgid "parenthesized irrefutable patterns" msgstr "" -#: ../../reference/compound_stmts.rst:754 +#: ../../reference/compound_stmts.rst:753 msgid "Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:761 +#: ../../reference/compound_stmts.rst:760 msgid "This section uses grammar notations beyond standard EBNF:" msgstr "" -#: ../../reference/compound_stmts.rst:763 +#: ../../reference/compound_stmts.rst:762 msgid "the notation ``SEP.RULE+`` is shorthand for ``RULE (SEP RULE)*``" msgstr "" -#: ../../reference/compound_stmts.rst:765 +#: ../../reference/compound_stmts.rst:764 msgid "the notation ``!RULE`` is shorthand for a negative lookahead assertion" msgstr "" -#: ../../reference/compound_stmts.rst:768 +#: ../../reference/compound_stmts.rst:767 msgid "The top-level syntax for ``patterns`` is:" msgstr "" -#: ../../reference/compound_stmts.rst:782 +#: ../../reference/compound_stmts.rst:781 msgid "" "The descriptions below will include a description \"in simple terms\" of " "what a pattern does for illustration purposes (credits to Raymond Hettinger " @@ -730,70 +730,70 @@ msgid "" "forms." msgstr "" -#: ../../reference/compound_stmts.rst:792 +#: ../../reference/compound_stmts.rst:791 msgid "OR Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:794 +#: ../../reference/compound_stmts.rst:793 msgid "" "An OR pattern is two or more patterns separated by vertical bars ``|``. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:800 +#: ../../reference/compound_stmts.rst:799 msgid "" "Only the final subpattern may be :ref:`irrefutable `, and " "each subpattern must bind the same set of names to avoid ambiguity." msgstr "" -#: ../../reference/compound_stmts.rst:803 +#: ../../reference/compound_stmts.rst:802 msgid "" "An OR pattern matches each of its subpatterns in turn to the subject value, " "until one succeeds. The OR pattern is then considered successful. " "Otherwise, if none of the subpatterns succeed, the OR pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:807 +#: ../../reference/compound_stmts.rst:806 msgid "" "In simple terms, ``P1 | P2 | ...`` will try to match ``P1``, if it fails it " "will try to match ``P2``, succeeding immediately if any succeeds, failing " "otherwise." msgstr "" -#: ../../reference/compound_stmts.rst:813 +#: ../../reference/compound_stmts.rst:812 msgid "AS Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:815 +#: ../../reference/compound_stmts.rst:814 msgid "" "An AS pattern matches an OR pattern on the left of the :keyword:`as` keyword " "against a subject. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:821 +#: ../../reference/compound_stmts.rst:820 msgid "" "If the OR pattern fails, the AS pattern fails. Otherwise, the AS pattern " "binds the subject to the name on the right of the as keyword and succeeds. " "``capture_pattern`` cannot be a a ``_``." msgstr "" -#: ../../reference/compound_stmts.rst:825 +#: ../../reference/compound_stmts.rst:824 msgid "" "In simple terms ``P as NAME`` will match with ``P``, and on success it will " "set ``NAME = ``." msgstr "" -#: ../../reference/compound_stmts.rst:832 +#: ../../reference/compound_stmts.rst:831 msgid "Literal Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:834 +#: ../../reference/compound_stmts.rst:833 msgid "" "A literal pattern corresponds to most :ref:`literals ` in Python. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:847 +#: ../../reference/compound_stmts.rst:846 msgid "" "The rule ``strings`` and the token ``NUMBER`` are defined in the :doc:" "`standard Python grammar <./grammar>`. Triple-quoted strings are " @@ -801,42 +801,42 @@ msgid "" "are not supported." msgstr "" -#: ../../reference/compound_stmts.rst:852 +#: ../../reference/compound_stmts.rst:851 msgid "" "The forms ``signed_number '+' NUMBER`` and ``signed_number '-' NUMBER`` are " "for expressing :ref:`complex numbers `; they require a real " "number on the left and an imaginary number on the right. E.g. ``3 + 4j``." msgstr "" -#: ../../reference/compound_stmts.rst:856 +#: ../../reference/compound_stmts.rst:855 msgid "" "In simple terms, ``LITERAL`` will succeed only if `` == LITERAL``. " "For the singletons ``None``, ``True`` and ``False``, the :keyword:`is` " "operator is used." msgstr "" -#: ../../reference/compound_stmts.rst:862 +#: ../../reference/compound_stmts.rst:861 msgid "Capture Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:864 +#: ../../reference/compound_stmts.rst:863 msgid "A capture pattern binds the subject value to a name. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:870 +#: ../../reference/compound_stmts.rst:869 msgid "" "A single underscore ``_`` is not a capture pattern (this is what ``!'_'`` " "expresses). It is instead treated as a :token:`~python-grammar:" "wildcard_pattern`." msgstr "" -#: ../../reference/compound_stmts.rst:874 +#: ../../reference/compound_stmts.rst:873 msgid "" "In a given pattern, a given name can only be bound once. E.g. ``case x, " "x: ...`` is invalid while ``case [x] | x: ...`` is allowed." msgstr "" -#: ../../reference/compound_stmts.rst:877 +#: ../../reference/compound_stmts.rst:876 msgid "" "Capture patterns always succeed. The binding follows scoping rules " "established by the assignment expression operator in :pep:`572`; the name " @@ -844,55 +844,55 @@ msgid "" "there's an applicable :keyword:`global` or :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/compound_stmts.rst:882 +#: ../../reference/compound_stmts.rst:881 msgid "" "In simple terms ``NAME`` will always succeed and it will set ``NAME = " "``." msgstr "" -#: ../../reference/compound_stmts.rst:887 +#: ../../reference/compound_stmts.rst:886 msgid "Wildcard Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:889 +#: ../../reference/compound_stmts.rst:888 msgid "" "A wildcard pattern always succeeds (matches anything) and binds no name. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:895 +#: ../../reference/compound_stmts.rst:894 msgid "" "``_`` is a :ref:`soft keyword ` within any pattern, but only " "within patterns. It is an identifier, as usual, even within ``match`` " "subject expressions, ``guard``\\ s, and ``case`` blocks." msgstr "" -#: ../../reference/compound_stmts.rst:899 +#: ../../reference/compound_stmts.rst:898 msgid "In simple terms, ``_`` will always succeed." msgstr "" -#: ../../reference/compound_stmts.rst:904 +#: ../../reference/compound_stmts.rst:903 msgid "Value Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:906 +#: ../../reference/compound_stmts.rst:905 msgid "A value pattern represents a named value in Python. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:914 +#: ../../reference/compound_stmts.rst:913 msgid "" "The dotted name in the pattern is looked up using standard Python :ref:`name " "resolution rules `. The pattern succeeds if the value found " "compares equal to the subject value (using the ``==`` equality operator)." msgstr "" -#: ../../reference/compound_stmts.rst:919 +#: ../../reference/compound_stmts.rst:918 msgid "" "In simple terms ``NAME1.NAME2`` will succeed only if `` == NAME1." "NAME2``" msgstr "" -#: ../../reference/compound_stmts.rst:923 +#: ../../reference/compound_stmts.rst:922 msgid "" "If the same value occurs multiple times in the same match statement, the " "interpreter may cache the first value found and reuse it rather than repeat " @@ -900,44 +900,44 @@ msgid "" "given match statement." msgstr "" -#: ../../reference/compound_stmts.rst:931 +#: ../../reference/compound_stmts.rst:930 msgid "Group Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:933 +#: ../../reference/compound_stmts.rst:932 msgid "" "A group pattern allows users to add parentheses around patterns to emphasize " "the intended grouping. Otherwise, it has no additional syntax. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:940 +#: ../../reference/compound_stmts.rst:939 msgid "In simple terms ``(P)`` has the same effect as ``P``." msgstr "" -#: ../../reference/compound_stmts.rst:945 +#: ../../reference/compound_stmts.rst:944 msgid "Sequence Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:947 +#: ../../reference/compound_stmts.rst:946 msgid "" "A sequence pattern contains several subpatterns to be matched against " "sequence elements. The syntax is similar to the unpacking of a list or tuple." msgstr "" -#: ../../reference/compound_stmts.rst:958 +#: ../../reference/compound_stmts.rst:957 msgid "" "There is no difference if parentheses or square brackets are used for " "sequence patterns (i.e. ``(...)`` vs ``[...]`` )." msgstr "" -#: ../../reference/compound_stmts.rst:962 +#: ../../reference/compound_stmts.rst:961 msgid "" "A single pattern enclosed in parentheses without a trailing comma (e.g. ``(3 " "| 4)``) is a :ref:`group pattern `. While a single pattern " "enclosed in square brackets (e.g. ``[3 | 4]``) is still a sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:967 +#: ../../reference/compound_stmts.rst:966 msgid "" "At most one star subpattern may be in a sequence pattern. The star " "subpattern may occur in any position. If no star subpattern is present, the " @@ -945,40 +945,40 @@ msgid "" "variable-length sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:972 +#: ../../reference/compound_stmts.rst:971 msgid "" "The following is the logical flow for matching a sequence pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:975 +#: ../../reference/compound_stmts.rst:974 msgid "" "If the subject value is not a sequence [#]_, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:978 +#: ../../reference/compound_stmts.rst:977 msgid "" "If the subject value is an instance of ``str``, ``bytes`` or ``bytearray`` " "the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:981 +#: ../../reference/compound_stmts.rst:980 msgid "" "The subsequent steps depend on whether the sequence pattern is fixed or " "variable-length." msgstr "" -#: ../../reference/compound_stmts.rst:984 +#: ../../reference/compound_stmts.rst:983 msgid "If the sequence pattern is fixed-length:" msgstr "" -#: ../../reference/compound_stmts.rst:986 +#: ../../reference/compound_stmts.rst:985 msgid "" "If the length of the subject sequence is not equal to the number of " "subpatterns, the sequence pattern fails" msgstr "" -#: ../../reference/compound_stmts.rst:989 +#: ../../reference/compound_stmts.rst:988 msgid "" "Subpatterns in the sequence pattern are matched to their corresponding items " "in the subject sequence from left to right. Matching stops as soon as a " @@ -986,118 +986,118 @@ msgid "" "corresponding item, the sequence pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:994 +#: ../../reference/compound_stmts.rst:993 msgid "Otherwise, if the sequence pattern is variable-length:" msgstr "" -#: ../../reference/compound_stmts.rst:996 +#: ../../reference/compound_stmts.rst:995 msgid "" "If the length of the subject sequence is less than the number of non-star " "subpatterns, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:999 +#: ../../reference/compound_stmts.rst:998 msgid "" "The leading non-star subpatterns are matched to their corresponding items as " "for fixed-length sequences." msgstr "" -#: ../../reference/compound_stmts.rst:1002 +#: ../../reference/compound_stmts.rst:1001 msgid "" "If the previous step succeeds, the star subpattern matches a list formed of " "the remaining subject items, excluding the remaining items corresponding to " "non-star subpatterns following the star subpattern." msgstr "" -#: ../../reference/compound_stmts.rst:1006 +#: ../../reference/compound_stmts.rst:1005 msgid "" "Remaining non-star subpatterns are matched to their corresponding subject " "items, as for a fixed-length sequence." msgstr "" -#: ../../reference/compound_stmts.rst:1009 +#: ../../reference/compound_stmts.rst:1008 msgid "" "The length of the subject sequence is obtained via :func:`len` (i.e. via " "the :meth:`__len__` protocol). This length may be cached by the interpreter " "in a similar manner as :ref:`value patterns `." msgstr "" -#: ../../reference/compound_stmts.rst:1015 +#: ../../reference/compound_stmts.rst:1014 msgid "" "In simple terms ``[P1, P2, P3,`` ... ``, P]`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1018 +#: ../../reference/compound_stmts.rst:1017 msgid "check ```` is a sequence" msgstr "" -#: ../../reference/compound_stmts.rst:1019 +#: ../../reference/compound_stmts.rst:1018 msgid "``len(subject) == ``" msgstr "``len(subject) == ``" -#: ../../reference/compound_stmts.rst:1020 +#: ../../reference/compound_stmts.rst:1019 msgid "" "``P1`` matches ``[0]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1021 +#: ../../reference/compound_stmts.rst:1020 msgid "" "``P2`` matches ``[1]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1022 +#: ../../reference/compound_stmts.rst:1021 msgid "... and so on for the corresponding pattern/element." msgstr "" -#: ../../reference/compound_stmts.rst:1027 +#: ../../reference/compound_stmts.rst:1026 msgid "Mapping Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1029 +#: ../../reference/compound_stmts.rst:1028 msgid "" "A mapping pattern contains one or more key-value patterns. The syntax is " "similar to the construction of a dictionary. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1040 +#: ../../reference/compound_stmts.rst:1039 msgid "" "At most one double star pattern may be in a mapping pattern. The double " "star pattern must be the last subpattern in the mapping pattern." msgstr "" -#: ../../reference/compound_stmts.rst:1043 +#: ../../reference/compound_stmts.rst:1042 msgid "" "Duplicate keys in mapping patterns are disallowed. Duplicate literal keys " "will raise a :exc:`SyntaxError`. Two keys that otherwise have the same value " "will raise a :exc:`ValueError` at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1047 +#: ../../reference/compound_stmts.rst:1046 msgid "" "The following is the logical flow for matching a mapping pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1050 +#: ../../reference/compound_stmts.rst:1049 msgid "If the subject value is not a mapping [#]_,the mapping pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1052 +#: ../../reference/compound_stmts.rst:1051 msgid "" "If every key given in the mapping pattern is present in the subject mapping, " "and the pattern for each key matches the corresponding item of the subject " "mapping, the mapping pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1056 +#: ../../reference/compound_stmts.rst:1055 msgid "" "If duplicate keys are detected in the mapping pattern, the pattern is " "considered invalid. A :exc:`SyntaxError` is raised for duplicate literal " "values; or a :exc:`ValueError` for named keys of the same value." msgstr "" -#: ../../reference/compound_stmts.rst:1060 +#: ../../reference/compound_stmts.rst:1059 msgid "" "Key-value pairs are matched using the two-argument form of the mapping " "subject's ``get()`` method. Matched key-value pairs must already be present " @@ -1105,256 +1105,256 @@ msgid "" "`__getitem__`." msgstr "" -#: ../../reference/compound_stmts.rst:1065 +#: ../../reference/compound_stmts.rst:1064 msgid "" "In simple terms ``{KEY1: P1, KEY2: P2, ... }`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1068 +#: ../../reference/compound_stmts.rst:1067 msgid "check ```` is a mapping" msgstr "" -#: ../../reference/compound_stmts.rst:1069 +#: ../../reference/compound_stmts.rst:1068 msgid "``KEY1 in ``" msgstr "``KEY1 in ``" -#: ../../reference/compound_stmts.rst:1070 +#: ../../reference/compound_stmts.rst:1069 msgid "``P1`` matches ``[KEY1]``" msgstr "" -#: ../../reference/compound_stmts.rst:1071 +#: ../../reference/compound_stmts.rst:1070 msgid "... and so on for the corresponding KEY/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1077 +#: ../../reference/compound_stmts.rst:1076 msgid "Class Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1079 +#: ../../reference/compound_stmts.rst:1078 msgid "" "A class pattern represents a class and its positional and keyword arguments " "(if any). Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1090 +#: ../../reference/compound_stmts.rst:1089 msgid "The same keyword should not be repeated in class patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1092 +#: ../../reference/compound_stmts.rst:1091 msgid "" "The following is the logical flow for matching a class pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1095 +#: ../../reference/compound_stmts.rst:1094 msgid "" "If ``name_or_attr`` is not an instance of the builtin :class:`type` , raise :" "exc:`TypeError`." msgstr "" -#: ../../reference/compound_stmts.rst:1098 +#: ../../reference/compound_stmts.rst:1097 msgid "" "If the subject value is not an instance of ``name_or_attr`` (tested via :" "func:`isinstance`), the class pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1101 +#: ../../reference/compound_stmts.rst:1100 msgid "" "If no pattern arguments are present, the pattern succeeds. Otherwise, the " "subsequent steps depend on whether keyword or positional argument patterns " "are present." msgstr "" -#: ../../reference/compound_stmts.rst:1105 +#: ../../reference/compound_stmts.rst:1104 msgid "" "For a number of built-in types (specified below), a single positional " "subpattern is accepted which will match the entire subject; for these types " "keyword patterns also work as for other types." msgstr "" -#: ../../reference/compound_stmts.rst:1109 +#: ../../reference/compound_stmts.rst:1108 msgid "" "If only keyword patterns are present, they are processed as follows, one by " "one:" msgstr "" -#: ../../reference/compound_stmts.rst:1112 +#: ../../reference/compound_stmts.rst:1111 msgid "I. The keyword is looked up as an attribute on the subject." msgstr "" -#: ../../reference/compound_stmts.rst:1114 +#: ../../reference/compound_stmts.rst:1113 msgid "" "If this raises an exception other than :exc:`AttributeError`, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1117 +#: ../../reference/compound_stmts.rst:1116 msgid "If this raises :exc:`AttributeError`, the class pattern has failed." msgstr "" -#: ../../reference/compound_stmts.rst:1119 +#: ../../reference/compound_stmts.rst:1118 msgid "" "Else, the subpattern associated with the keyword pattern is matched against " "the subject's attribute value. If this fails, the class pattern fails; if " "this succeeds, the match proceeds to the next keyword." msgstr "" -#: ../../reference/compound_stmts.rst:1124 +#: ../../reference/compound_stmts.rst:1123 msgid "II. If all keyword patterns succeed, the class pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1126 +#: ../../reference/compound_stmts.rst:1125 msgid "" "If any positional patterns are present, they are converted to keyword " "patterns using the :data:`~object.__match_args__` attribute on the class " "``name_or_attr`` before matching:" msgstr "" -#: ../../reference/compound_stmts.rst:1130 +#: ../../reference/compound_stmts.rst:1129 msgid "" "I. The equivalent of ``getattr(cls, \"__match_args__\", ())`` is called." msgstr "" -#: ../../reference/compound_stmts.rst:1132 +#: ../../reference/compound_stmts.rst:1131 msgid "If this raises an exception, the exception bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1134 +#: ../../reference/compound_stmts.rst:1133 msgid "" "If the returned value is not a tuple, the conversion fails and :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1137 +#: ../../reference/compound_stmts.rst:1136 msgid "" "If there are more positional patterns than ``len(cls.__match_args__)``, :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1140 +#: ../../reference/compound_stmts.rst:1139 msgid "" "Otherwise, positional pattern ``i`` is converted to a keyword pattern using " "``__match_args__[i]`` as the keyword. ``__match_args__[i]`` must be a " "string; if not :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1144 +#: ../../reference/compound_stmts.rst:1143 msgid "If there are duplicate keywords, :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1146 +#: ../../reference/compound_stmts.rst:1145 msgid ":ref:`class-pattern-matching`" msgstr ":ref:`class-pattern-matching`" -#: ../../reference/compound_stmts.rst:1149 +#: ../../reference/compound_stmts.rst:1148 msgid "" "II. Once all positional patterns have been converted to keyword patterns," msgstr "" -#: ../../reference/compound_stmts.rst:1149 +#: ../../reference/compound_stmts.rst:1148 msgid "the match proceeds as if there were only keyword patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1151 +#: ../../reference/compound_stmts.rst:1150 msgid "" "For the following built-in types the handling of positional subpatterns is " "different:" msgstr "" -#: ../../reference/compound_stmts.rst:1154 +#: ../../reference/compound_stmts.rst:1153 msgid ":class:`bool`" msgstr ":class:`bool`" -#: ../../reference/compound_stmts.rst:1155 +#: ../../reference/compound_stmts.rst:1154 msgid ":class:`bytearray`" msgstr ":class:`bytearray`" -#: ../../reference/compound_stmts.rst:1156 +#: ../../reference/compound_stmts.rst:1155 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../reference/compound_stmts.rst:1157 +#: ../../reference/compound_stmts.rst:1156 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../reference/compound_stmts.rst:1158 +#: ../../reference/compound_stmts.rst:1157 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../reference/compound_stmts.rst:1159 +#: ../../reference/compound_stmts.rst:1158 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../reference/compound_stmts.rst:1160 +#: ../../reference/compound_stmts.rst:1159 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../reference/compound_stmts.rst:1161 -#: ../../reference/compound_stmts.rst:1612 +#: ../../reference/compound_stmts.rst:1160 +#: ../../reference/compound_stmts.rst:1611 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../reference/compound_stmts.rst:1162 +#: ../../reference/compound_stmts.rst:1161 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../reference/compound_stmts.rst:1163 +#: ../../reference/compound_stmts.rst:1162 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../reference/compound_stmts.rst:1164 -#: ../../reference/compound_stmts.rst:1615 +#: ../../reference/compound_stmts.rst:1163 +#: ../../reference/compound_stmts.rst:1614 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../reference/compound_stmts.rst:1166 +#: ../../reference/compound_stmts.rst:1165 msgid "" "These classes accept a single positional argument, and the pattern there is " "matched against the whole object rather than an attribute. For example " "``int(0|1)`` matches the value ``0``, but not the value ``0.0``." msgstr "" -#: ../../reference/compound_stmts.rst:1170 +#: ../../reference/compound_stmts.rst:1169 msgid "" "In simple terms ``CLS(P1, attr=P2)`` matches only if the following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1172 +#: ../../reference/compound_stmts.rst:1171 msgid "``isinstance(, CLS)``" msgstr "``isinstance(, CLS)``" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1172 msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1174 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1174 msgid "``hasattr(, \"attr\")``" msgstr "``hasattr(, \"attr\")``" -#: ../../reference/compound_stmts.rst:1176 +#: ../../reference/compound_stmts.rst:1175 msgid "``P2`` matches ``.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1177 +#: ../../reference/compound_stmts.rst:1176 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1191 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1207 +#: ../../reference/compound_stmts.rst:1206 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1226 +#: ../../reference/compound_stmts.rst:1225 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -1363,13 +1363,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1232 +#: ../../reference/compound_stmts.rst:1231 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1238 +#: ../../reference/compound_stmts.rst:1237 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1380,28 +1380,28 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1249 -#: ../../reference/compound_stmts.rst:1426 +#: ../../reference/compound_stmts.rst:1248 +#: ../../reference/compound_stmts.rst:1425 msgid "is roughly equivalent to ::" msgstr "" "大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1254 +#: ../../reference/compound_stmts.rst:1253 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1256 +#: ../../reference/compound_stmts.rst:1255 msgid "" "Functions may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1266 +#: ../../reference/compound_stmts.rst:1265 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1412,7 +1412,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1274 +#: ../../reference/compound_stmts.rst:1273 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1425,7 +1425,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1295 +#: ../../reference/compound_stmts.rst:1294 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1441,13 +1441,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1307 +#: ../../reference/compound_stmts.rst:1306 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1316 +#: ../../reference/compound_stmts.rst:1315 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1464,7 +1464,7 @@ msgid "" "different order than they appear in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1331 +#: ../../reference/compound_stmts.rst:1330 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1476,7 +1476,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1339 +#: ../../reference/compound_stmts.rst:1338 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1485,51 +1485,51 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1348 +#: ../../reference/compound_stmts.rst:1347 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1348 +#: ../../reference/compound_stmts.rst:1347 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1351 +#: ../../reference/compound_stmts.rst:1350 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1351 +#: ../../reference/compound_stmts.rst:1350 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1355 +#: ../../reference/compound_stmts.rst:1354 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1354 +#: ../../reference/compound_stmts.rst:1353 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables" msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1357 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1357 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1364 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:1380 +#: ../../reference/compound_stmts.rst:1379 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1386 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1538,11 +1538,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1396 +#: ../../reference/compound_stmts.rst:1395 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1401 +#: ../../reference/compound_stmts.rst:1400 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1554,7 +1554,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1410 +#: ../../reference/compound_stmts.rst:1409 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's ``__dict__``. Note that this is reliable only right after " @@ -1562,30 +1562,30 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1415 +#: ../../reference/compound_stmts.rst:1414 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1420 +#: ../../reference/compound_stmts.rst:1419 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1431 +#: ../../reference/compound_stmts.rst:1430 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1434 +#: ../../reference/compound_stmts.rst:1433 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1439 +#: ../../reference/compound_stmts.rst:1438 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1598,35 +1598,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1454 +#: ../../reference/compound_stmts.rst:1453 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1452 +#: ../../reference/compound_stmts.rst:1451 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1457 +#: ../../reference/compound_stmts.rst:1456 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:1457 +#: ../../reference/compound_stmts.rst:1456 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1464 +#: ../../reference/compound_stmts.rst:1463 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1472 +#: ../../reference/compound_stmts.rst:1471 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:1482 +#: ../../reference/compound_stmts.rst:1481 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1634,189 +1634,189 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1486 +#: ../../reference/compound_stmts.rst:1485 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1489 +#: ../../reference/compound_stmts.rst:1488 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1492 +#: ../../reference/compound_stmts.rst:1491 msgid "An example of a coroutine function::" msgstr "" "一個協程韓式函式範例:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1498 +#: ../../reference/compound_stmts.rst:1497 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1506 +#: ../../reference/compound_stmts.rst:1505 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1511 +#: ../../reference/compound_stmts.rst:1510 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1515 +#: ../../reference/compound_stmts.rst:1514 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1525 +#: ../../reference/compound_stmts.rst:1524 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1541 +#: ../../reference/compound_stmts.rst:1540 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "" "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" -#: ../../reference/compound_stmts.rst:1543 +#: ../../reference/compound_stmts.rst:1542 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1551 +#: ../../reference/compound_stmts.rst:1550 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1556 +#: ../../reference/compound_stmts.rst:1555 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1583 +#: ../../reference/compound_stmts.rst:1582 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "" "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" -#: ../../reference/compound_stmts.rst:1585 +#: ../../reference/compound_stmts.rst:1584 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1591 +#: ../../reference/compound_stmts.rst:1590 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1591 +#: ../../reference/compound_stmts.rst:1590 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1596 +#: ../../reference/compound_stmts.rst:1595 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1597 +#: ../../reference/compound_stmts.rst:1596 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1601 +#: ../../reference/compound_stmts.rst:1600 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1603 +#: ../../reference/compound_stmts.rst:1602 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1604 +#: ../../reference/compound_stmts.rst:1603 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1605 +#: ../../reference/compound_stmts.rst:1604 msgid "" "a builtin class that has its (CPython) :data:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1606 -#: ../../reference/compound_stmts.rst:1625 +#: ../../reference/compound_stmts.rst:1605 +#: ../../reference/compound_stmts.rst:1624 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1608 +#: ../../reference/compound_stmts.rst:1607 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1610 +#: ../../reference/compound_stmts.rst:1609 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1611 +#: ../../reference/compound_stmts.rst:1610 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1613 +#: ../../reference/compound_stmts.rst:1612 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1614 +#: ../../reference/compound_stmts.rst:1613 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1617 +#: ../../reference/compound_stmts.rst:1616 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1620 +#: ../../reference/compound_stmts.rst:1619 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1622 +#: ../../reference/compound_stmts.rst:1621 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1623 +#: ../../reference/compound_stmts.rst:1622 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1624 +#: ../../reference/compound_stmts.rst:1623 msgid "" "a builtin class that has its (CPython) :data:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1627 +#: ../../reference/compound_stmts.rst:1626 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1630 +#: ../../reference/compound_stmts.rst:1629 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's ``__doc__`` attribute and therefore the " "function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1634 +#: ../../reference/compound_stmts.rst:1633 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's ``__doc__`` item and therefore the class's :" From 50793f8d589b9f15e614d31abb3163c0cfbc360f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Jan 2023 00:18:44 +0000 Subject: [PATCH 2/2] sync with cpython 75861006 --- library/locale.po | 42 ++--- library/pathlib.po | 392 +++++++++++++++++++++++---------------------- 2 files changed, 221 insertions(+), 213 deletions(-) diff --git a/library/locale.po b/library/locale.po index 84e5aaaca3..17e1640962 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-05 00:19+0000\n" +"POT-Creation-Date: 2023-01-06 00:16+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-" @@ -727,7 +727,13 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:514 +#: ../../library/locale.rst:511 +msgid "" +"This value may not be available on operating systems not conforming to the " +"POSIX standard, most notably Windows." +msgstr "" + +#: ../../library/locale.rst:517 msgid "" "Locale category for formatting numbers. The functions :func:`.format`, :" "func:`atoi`, :func:`atof` and :func:`.str` of the :mod:`locale` module are " @@ -735,7 +741,7 @@ msgid "" "affected." msgstr "" -#: ../../library/locale.rst:522 +#: ../../library/locale.rst:525 msgid "" "Combination of all locale settings. If this flag is used when the locale is " "changed, setting the locale for all categories is attempted. If that fails " @@ -745,24 +751,24 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:531 +#: ../../library/locale.rst:534 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: ../../library/locale.rst:535 +#: ../../library/locale.rst:538 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/locale.rst:548 +#: ../../library/locale.rst:551 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:550 +#: ../../library/locale.rst:553 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " @@ -770,7 +776,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:555 +#: ../../library/locale.rst:558 msgid "" "Initially, when a program is started, the locale is the ``C`` locale, no " "matter what the user's preferred locale is. There is one exception: the :" @@ -780,7 +786,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:562 +#: ../../library/locale.rst:565 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -788,7 +794,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:567 +#: ../../library/locale.rst:570 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -799,14 +805,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:574 +#: ../../library/locale.rst:577 msgid "" "The only way to perform numeric operations according to the locale is to use " "the special functions defined by this module: :func:`atof`, :func:`atoi`, :" "func:`.format`, :func:`.str`." msgstr "" -#: ../../library/locale.rst:578 +#: ../../library/locale.rst:581 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -817,11 +823,11 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:589 +#: ../../library/locale.rst:592 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:591 +#: ../../library/locale.rst:594 msgid "" "Extension modules should never call :func:`setlocale`, except to find out " "what the current locale is. But since the return value can only be used " @@ -829,7 +835,7 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:596 +#: ../../library/locale.rst:599 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " @@ -839,11 +845,11 @@ msgid "" "accessible as a shared library." msgstr "" -#: ../../library/locale.rst:607 +#: ../../library/locale.rst:610 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:615 +#: ../../library/locale.rst:618 msgid "" "The locale module exposes the C library's gettext interface on systems that " "provide this interface. It consists of the functions :func:`!gettext`, :" @@ -854,7 +860,7 @@ msgid "" "for locating message catalogs." msgstr "" -#: ../../library/locale.rst:622 +#: ../../library/locale.rst:625 msgid "" "Python applications should normally find no need to invoke these functions, " "and should use :mod:`gettext` instead. A known exception to this rule are " diff --git a/library/pathlib.po b/library/pathlib.po index 4721ec5347..3571d8c690 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-01-06 00:16+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-" @@ -170,8 +170,8 @@ msgid "" msgstr "" #: ../../library/pathlib.rst:166 ../../library/pathlib.rst:178 -#: ../../library/pathlib.rst:664 ../../library/pathlib.rst:674 -#: ../../library/pathlib.rst:684 +#: ../../library/pathlib.rst:671 ../../library/pathlib.rst:681 +#: ../../library/pathlib.rst:691 msgid "*pathsegments* is specified similarly to :class:`PurePath`." msgstr "" @@ -208,295 +208,297 @@ msgstr "" #: ../../library/pathlib.rst:215 msgid "" -"The slash operator helps create child paths, similarly to :func:`os.path." -"join`::" +"The slash operator helps create child paths, mimicking the behaviour of :" +"func:`os.path.join`. For instance, when several absolute paths are given, " +"the last is taken as an anchor; for a Windows path, changing the local root " +"doesn't discard the previous drive setting::" msgstr "" -#: ../../library/pathlib.rst:226 +#: ../../library/pathlib.rst:233 msgid "" "A path object can be used anywhere an object implementing :class:`os." "PathLike` is accepted::" msgstr "" -#: ../../library/pathlib.rst:234 +#: ../../library/pathlib.rst:241 msgid "" "The string representation of a path is the raw filesystem path itself (in " "native form, e.g. with backslashes under Windows), which you can pass to any " "function taking a file path as a string::" msgstr "" -#: ../../library/pathlib.rst:245 +#: ../../library/pathlib.rst:252 msgid "" "Similarly, calling :class:`bytes` on a path gives the raw filesystem path as " "a bytes object, as encoded by :func:`os.fsencode`::" msgstr "" -#: ../../library/pathlib.rst:252 +#: ../../library/pathlib.rst:259 msgid "" "Calling :class:`bytes` is only recommended under Unix. Under Windows, the " "unicode form is the canonical representation of filesystem paths." msgstr "" -#: ../../library/pathlib.rst:257 +#: ../../library/pathlib.rst:264 msgid "Accessing individual parts" msgstr "" -#: ../../library/pathlib.rst:259 +#: ../../library/pathlib.rst:266 msgid "" "To access the individual \"parts\" (components) of a path, use the following " "property:" msgstr "" -#: ../../library/pathlib.rst:264 +#: ../../library/pathlib.rst:271 msgid "A tuple giving access to the path's various components::" msgstr "" -#: ../../library/pathlib.rst:274 +#: ../../library/pathlib.rst:281 msgid "(note how the drive and local root are regrouped in a single part)" msgstr "" -#: ../../library/pathlib.rst:278 +#: ../../library/pathlib.rst:285 msgid "Methods and properties" msgstr "" -#: ../../library/pathlib.rst:284 +#: ../../library/pathlib.rst:291 msgid "Pure paths provide the following methods and properties:" msgstr "" -#: ../../library/pathlib.rst:288 +#: ../../library/pathlib.rst:295 msgid "A string representing the drive letter or name, if any::" msgstr "" -#: ../../library/pathlib.rst:297 +#: ../../library/pathlib.rst:304 msgid "UNC shares are also considered drives::" msgstr "" -#: ../../library/pathlib.rst:304 +#: ../../library/pathlib.rst:311 msgid "A string representing the (local or global) root, if any::" msgstr "" -#: ../../library/pathlib.rst:313 +#: ../../library/pathlib.rst:320 msgid "UNC shares always have a root::" msgstr "" -#: ../../library/pathlib.rst:318 +#: ../../library/pathlib.rst:325 msgid "" "If the path starts with more than two successive slashes, :class:`~pathlib." "PurePosixPath` collapses them::" msgstr "" -#: ../../library/pathlib.rst:330 +#: ../../library/pathlib.rst:337 msgid "" "This behavior conforms to *The Open Group Base Specifications Issue 6*, " "paragraph `4.11 Pathname Resolution `_:" msgstr "" -#: ../../library/pathlib.rst:334 +#: ../../library/pathlib.rst:341 msgid "" "*\"A pathname that begins with two successive slashes may be interpreted in " "an implementation-defined manner, although more than two leading slashes " "shall be treated as a single slash.\"*" msgstr "" -#: ../../library/pathlib.rst:340 +#: ../../library/pathlib.rst:347 msgid "The concatenation of the drive and root::" msgstr "" -#: ../../library/pathlib.rst:354 +#: ../../library/pathlib.rst:361 msgid "" "An immutable sequence providing access to the logical ancestors of the path::" msgstr "" -#: ../../library/pathlib.rst:365 +#: ../../library/pathlib.rst:372 msgid "" "The parents sequence now supports :term:`slices ` and negative index " "values." msgstr "" -#: ../../library/pathlib.rst:370 +#: ../../library/pathlib.rst:377 msgid "The logical parent of the path::" msgstr "" -#: ../../library/pathlib.rst:376 +#: ../../library/pathlib.rst:383 msgid "You cannot go past an anchor, or empty path::" msgstr "" -#: ../../library/pathlib.rst:386 +#: ../../library/pathlib.rst:393 msgid "This is a purely lexical operation, hence the following behaviour::" msgstr "" -#: ../../library/pathlib.rst:392 +#: ../../library/pathlib.rst:399 msgid "" "If you want to walk an arbitrary filesystem path upwards, it is recommended " -"to first call :meth:`Path.resolve` so as to resolve symlinks and eliminate ``" -"\"..\"`` components." +"to first call :meth:`Path.resolve` so as to resolve symlinks and eliminate " +"``\"..\"`` components." msgstr "" -#: ../../library/pathlib.rst:399 +#: ../../library/pathlib.rst:406 msgid "" "A string representing the final path component, excluding the drive and " "root, if any::" msgstr "" -#: ../../library/pathlib.rst:405 +#: ../../library/pathlib.rst:412 msgid "UNC drive names are not considered::" msgstr "" -#: ../../library/pathlib.rst:415 +#: ../../library/pathlib.rst:422 msgid "The file extension of the final component, if any::" msgstr "" -#: ../../library/pathlib.rst:427 +#: ../../library/pathlib.rst:434 msgid "A list of the path's file extensions::" msgstr "" -#: ../../library/pathlib.rst:439 +#: ../../library/pathlib.rst:446 msgid "The final path component, without its suffix::" msgstr "" -#: ../../library/pathlib.rst:451 +#: ../../library/pathlib.rst:458 msgid "" "Return a string representation of the path with forward slashes (``/``)::" msgstr "" -#: ../../library/pathlib.rst:462 +#: ../../library/pathlib.rst:469 msgid "" "Represent the path as a ``file`` URI. :exc:`ValueError` is raised if the " "path isn't absolute." msgstr "" -#: ../../library/pathlib.rst:475 +#: ../../library/pathlib.rst:482 msgid "" "Return whether the path is absolute or not. A path is considered absolute " "if it has both a root and (if the flavour allows) a drive::" msgstr "" -#: ../../library/pathlib.rst:495 +#: ../../library/pathlib.rst:502 msgid "Return whether or not this path is relative to the *other* path." msgstr "" -#: ../../library/pathlib.rst:508 +#: ../../library/pathlib.rst:515 msgid "" "With :class:`PureWindowsPath`, return ``True`` if the path is considered " "reserved under Windows, ``False`` otherwise. With :class:`PurePosixPath`, " "``False`` is always returned." msgstr "" -#: ../../library/pathlib.rst:517 +#: ../../library/pathlib.rst:524 msgid "" "File system calls on reserved paths can fail mysteriously or have unintended " "effects." msgstr "" -#: ../../library/pathlib.rst:523 +#: ../../library/pathlib.rst:530 msgid "" "Calling this method is equivalent to combining the path with each of the " "*other* arguments in turn::" msgstr "" -#: ../../library/pathlib.rst:538 +#: ../../library/pathlib.rst:545 msgid "" "Match this path against the provided glob-style pattern. Return ``True`` if " "matching is successful, ``False`` otherwise." msgstr "" -#: ../../library/pathlib.rst:541 +#: ../../library/pathlib.rst:548 msgid "" "If *pattern* is relative, the path can be either relative or absolute, and " "matching is done from the right::" msgstr "" -#: ../../library/pathlib.rst:551 +#: ../../library/pathlib.rst:558 msgid "" "If *pattern* is absolute, the path must be absolute, and the whole path must " "match::" msgstr "" -#: ../../library/pathlib.rst:559 +#: ../../library/pathlib.rst:566 msgid "As with other methods, case-sensitivity follows platform defaults::" msgstr "" -#: ../../library/pathlib.rst:569 +#: ../../library/pathlib.rst:576 msgid "" "Compute a version of this path relative to the path represented by *other*. " "If it's impossible, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:584 +#: ../../library/pathlib.rst:591 msgid "" "NOTE: This function is part of :class:`PurePath` and works with strings. It " "does not check or access the underlying file structure." msgstr "" -#: ../../library/pathlib.rst:589 +#: ../../library/pathlib.rst:596 msgid "" "Return a new path with the :attr:`name` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:606 +#: ../../library/pathlib.rst:613 msgid "" "Return a new path with the :attr:`stem` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:630 +#: ../../library/pathlib.rst:637 msgid "" "Return a new path with the :attr:`suffix` changed. If the original path " "doesn't have a suffix, the new *suffix* is appended instead. If the " "*suffix* is an empty string, the original suffix is removed::" msgstr "" -#: ../../library/pathlib.rst:649 +#: ../../library/pathlib.rst:656 msgid "Concrete paths" msgstr "" -#: ../../library/pathlib.rst:651 +#: ../../library/pathlib.rst:658 msgid "" "Concrete paths are subclasses of the pure path classes. In addition to " "operations provided by the latter, they also provide methods to do system " "calls on path objects. There are three ways to instantiate concrete paths:" msgstr "" -#: ../../library/pathlib.rst:657 +#: ../../library/pathlib.rst:664 msgid "" "A subclass of :class:`PurePath`, this class represents concrete paths of the " "system's path flavour (instantiating it creates either a :class:`PosixPath` " "or a :class:`WindowsPath`)::" msgstr "" -#: ../../library/pathlib.rst:668 +#: ../../library/pathlib.rst:675 msgid "" "A subclass of :class:`Path` and :class:`PurePosixPath`, this class " "represents concrete non-Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:678 +#: ../../library/pathlib.rst:685 msgid "" "A subclass of :class:`Path` and :class:`PureWindowsPath`, this class " "represents concrete Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:686 +#: ../../library/pathlib.rst:693 msgid "" "You can only instantiate the class flavour that corresponds to your system " "(allowing system calls on non-compatible path flavours could lead to bugs or " "failures in your application)::" msgstr "" -#: ../../library/pathlib.rst:706 +#: ../../library/pathlib.rst:713 msgid "Methods" msgstr "" -#: ../../library/pathlib.rst:708 +#: ../../library/pathlib.rst:715 msgid "" "Concrete paths provide the following methods in addition to pure paths " "methods. Many of these methods can raise an :exc:`OSError` if a system call " "fails (for example because the path doesn't exist)." msgstr "" -#: ../../library/pathlib.rst:714 +#: ../../library/pathlib.rst:721 msgid "" ":meth:`~Path.exists()`, :meth:`~Path.is_dir()`, :meth:`~Path.is_file()`, :" "meth:`~Path.is_mount()`, :meth:`~Path.is_symlink()`, :meth:`~Path." @@ -506,78 +508,78 @@ msgid "" "the OS level." msgstr "" -#: ../../library/pathlib.rst:724 +#: ../../library/pathlib.rst:731 msgid "" "Return a new path object representing the current directory (as returned by :" "func:`os.getcwd`)::" msgstr "" -#: ../../library/pathlib.rst:733 +#: ../../library/pathlib.rst:740 msgid "" "Return a new path object representing the user's home directory (as returned " "by :func:`os.path.expanduser` with ``~`` construct). If the home directory " "can't be resolved, :exc:`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:747 +#: ../../library/pathlib.rst:754 msgid "" "Return a :class:`os.stat_result` object containing information about this " "path, like :func:`os.stat`. The result is looked up at each call to this " "method." msgstr "" -#: ../../library/pathlib.rst:750 +#: ../../library/pathlib.rst:757 msgid "" "This method normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :meth:`~Path.lstat`." msgstr "" -#: ../../library/pathlib.rst:761 ../../library/pathlib.rst:781 +#: ../../library/pathlib.rst:768 ../../library/pathlib.rst:788 msgid "The *follow_symlinks* parameter was added." msgstr "新增 *follow_symlinks* 參數。" -#: ../../library/pathlib.rst:766 +#: ../../library/pathlib.rst:773 msgid "Change the file mode and permissions, like :func:`os.chmod`." msgstr "" -#: ../../library/pathlib.rst:768 +#: ../../library/pathlib.rst:775 msgid "" "This method normally follows symlinks. Some Unix flavours support changing " "permissions on the symlink itself; on these platforms you may add the " "argument ``follow_symlinks=False``, or use :meth:`~Path.lchmod`." msgstr "" -#: ../../library/pathlib.rst:786 +#: ../../library/pathlib.rst:793 msgid "Whether the path points to an existing file or directory::" msgstr "" -#: ../../library/pathlib.rst:798 +#: ../../library/pathlib.rst:805 msgid "" "If the path points to a symlink, :meth:`exists` returns whether the symlink " "*points to* an existing file or directory." msgstr "" -#: ../../library/pathlib.rst:804 +#: ../../library/pathlib.rst:811 msgid "" "Return a new path with expanded ``~`` and ``~user`` constructs, as returned " "by :meth:`os.path.expanduser`. If a home directory can't be resolved, :exc:" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:819 +#: ../../library/pathlib.rst:826 msgid "" "Glob the given relative *pattern* in the directory represented by this path, " "yielding all matching files (of any kind)::" msgstr "" -#: ../../library/pathlib.rst:827 +#: ../../library/pathlib.rst:834 msgid "" "Patterns are the same as for :mod:`fnmatch`, with the addition of \"``**``\" " "which means \"this directory and all subdirectories, recursively\". In " "other words, it enables recursive globbing::" msgstr "" -#: ../../library/pathlib.rst:839 +#: ../../library/pathlib.rst:846 msgid "" "Using the \"``**``\" pattern in large directory trees may consume an " "inordinate amount of time." @@ -589,39 +591,39 @@ msgid "" "arguments ``self``, ``pattern``." msgstr "" -#: ../../library/pathlib.rst:844 ../../library/pathlib.rst:1137 +#: ../../library/pathlib.rst:851 ../../library/pathlib.rst:1144 msgid "" "Return only directories if *pattern* ends with a pathname components " "separator (:data:`~os.sep` or :data:`~os.altsep`)." msgstr "" -#: ../../library/pathlib.rst:850 +#: ../../library/pathlib.rst:857 msgid "" "Return the name of the group owning the file. :exc:`KeyError` is raised if " "the file's gid isn't found in the system database." msgstr "" -#: ../../library/pathlib.rst:856 +#: ../../library/pathlib.rst:863 msgid "" "Return ``True`` if the path points to a directory (or a symbolic link " "pointing to a directory), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:859 ../../library/pathlib.rst:868 -#: ../../library/pathlib.rst:897 ../../library/pathlib.rst:906 -#: ../../library/pathlib.rst:915 ../../library/pathlib.rst:924 +#: ../../library/pathlib.rst:866 ../../library/pathlib.rst:875 +#: ../../library/pathlib.rst:904 ../../library/pathlib.rst:913 +#: ../../library/pathlib.rst:922 ../../library/pathlib.rst:931 msgid "" "``False`` is also returned if the path doesn't exist or is a broken symlink; " "other errors (such as permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:865 +#: ../../library/pathlib.rst:872 msgid "" "Return ``True`` if the path points to a regular file (or a symbolic link " "pointing to a regular file), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:874 +#: ../../library/pathlib.rst:881 msgid "" "Return ``True`` if the path is a :dfn:`mount point`: a point in a file " "system where a different file system has been mounted. On POSIX, the " @@ -631,49 +633,49 @@ msgid "" "and POSIX variants. Not implemented on Windows." msgstr "" -#: ../../library/pathlib.rst:886 +#: ../../library/pathlib.rst:893 msgid "" "Return ``True`` if the path points to a symbolic link, ``False`` otherwise." msgstr "" -#: ../../library/pathlib.rst:888 +#: ../../library/pathlib.rst:895 msgid "" "``False`` is also returned if the path doesn't exist; other errors (such as " "permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:894 +#: ../../library/pathlib.rst:901 msgid "" "Return ``True`` if the path points to a Unix socket (or a symbolic link " "pointing to a Unix socket), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:903 +#: ../../library/pathlib.rst:910 msgid "" "Return ``True`` if the path points to a FIFO (or a symbolic link pointing to " "a FIFO), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:912 +#: ../../library/pathlib.rst:919 msgid "" "Return ``True`` if the path points to a block device (or a symbolic link " "pointing to a block device), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:921 +#: ../../library/pathlib.rst:928 msgid "" "Return ``True`` if the path points to a character device (or a symbolic link " "pointing to a character device), ``False`` if it points to another kind of " "file." msgstr "" -#: ../../library/pathlib.rst:930 +#: ../../library/pathlib.rst:937 msgid "" "When the path points to a directory, yield path objects of the directory " "contents::" msgstr "" -#: ../../library/pathlib.rst:944 +#: ../../library/pathlib.rst:951 msgid "" "The children are yielded in arbitrary order, and the special entries ``'.'`` " "and ``'..'`` are not included. If a file is removed from or added to the " @@ -681,88 +683,88 @@ msgid "" "be included is unspecified." msgstr "" -#: ../../library/pathlib.rst:951 +#: ../../library/pathlib.rst:958 msgid "" "Like :meth:`Path.chmod` but, if the path points to a symbolic link, the " "symbolic link's mode is changed rather than its target's." msgstr "" -#: ../../library/pathlib.rst:957 +#: ../../library/pathlib.rst:964 msgid "" "Like :meth:`Path.stat` but, if the path points to a symbolic link, return " "the symbolic link's information rather than its target's." msgstr "" -#: ../../library/pathlib.rst:963 +#: ../../library/pathlib.rst:970 msgid "" "Create a new directory at this given path. If *mode* is given, it is " "combined with the process' ``umask`` value to determine the file mode and " "access flags. If the path already exists, :exc:`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:968 +#: ../../library/pathlib.rst:975 msgid "" "If *parents* is true, any missing parents of this path are created as " "needed; they are created with the default permissions without taking *mode* " "into account (mimicking the POSIX ``mkdir -p`` command)." msgstr "" -#: ../../library/pathlib.rst:972 +#: ../../library/pathlib.rst:979 msgid "" "If *parents* is false (the default), a missing parent raises :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/pathlib.rst:975 +#: ../../library/pathlib.rst:982 msgid "" "If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if " "the target directory already exists." msgstr "" -#: ../../library/pathlib.rst:978 +#: ../../library/pathlib.rst:985 msgid "" "If *exist_ok* is true, :exc:`FileExistsError` exceptions will be ignored " "(same behavior as the POSIX ``mkdir -p`` command), but only if the last path " "component is not an existing non-directory file." msgstr "" -#: ../../library/pathlib.rst:982 +#: ../../library/pathlib.rst:989 msgid "The *exist_ok* parameter was added." msgstr "新增 *exist_ok* 參數。" -#: ../../library/pathlib.rst:988 +#: ../../library/pathlib.rst:995 msgid "" "Open the file pointed to by the path, like the built-in :func:`open` " "function does::" msgstr "" -#: ../../library/pathlib.rst:1000 +#: ../../library/pathlib.rst:1007 msgid "" "Return the name of the user owning the file. :exc:`KeyError` is raised if " "the file's uid isn't found in the system database." msgstr "" -#: ../../library/pathlib.rst:1006 +#: ../../library/pathlib.rst:1013 msgid "Return the binary contents of the pointed-to file as a bytes object::" msgstr "" -#: ../../library/pathlib.rst:1019 +#: ../../library/pathlib.rst:1026 msgid "Return the decoded contents of the pointed-to file as a string::" msgstr "" -#: ../../library/pathlib.rst:1027 +#: ../../library/pathlib.rst:1034 msgid "" "The file is opened and then closed. The optional parameters have the same " "meaning as in :func:`open`." msgstr "" -#: ../../library/pathlib.rst:1035 +#: ../../library/pathlib.rst:1042 msgid "" "Return the path to which the symbolic link points (as returned by :func:`os." "readlink`)::" msgstr "" -#: ../../library/pathlib.rst:1048 +#: ../../library/pathlib.rst:1055 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. On Unix, if *target* exists and is a file, " @@ -771,43 +773,43 @@ msgid "" "either a string or another path object::" msgstr "" -#: ../../library/pathlib.rst:1063 ../../library/pathlib.rst:1077 +#: ../../library/pathlib.rst:1070 ../../library/pathlib.rst:1084 msgid "" "The target path may be absolute or relative. Relative paths are interpreted " "relative to the current working directory, *not* the directory of the Path " "object." msgstr "" -#: ../../library/pathlib.rst:1067 ../../library/pathlib.rst:1081 +#: ../../library/pathlib.rst:1074 ../../library/pathlib.rst:1088 msgid "Added return value, return the new Path instance." msgstr "" -#: ../../library/pathlib.rst:1073 +#: ../../library/pathlib.rst:1080 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. If *target* points to an existing file or " "empty directory, it will be unconditionally replaced." msgstr "" -#: ../../library/pathlib.rst:1087 +#: ../../library/pathlib.rst:1094 msgid "" "Make the path absolute, without normalization or resolving symlinks. Returns " "a new path object::" msgstr "" -#: ../../library/pathlib.rst:1099 +#: ../../library/pathlib.rst:1106 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" msgstr "" -#: ../../library/pathlib.rst:1108 +#: ../../library/pathlib.rst:1115 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" msgstr "" -#: ../../library/pathlib.rst:1114 +#: ../../library/pathlib.rst:1121 msgid "" "If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError` " "is raised. If *strict* is ``False``, the path is resolved as far as " @@ -816,11 +818,11 @@ msgid "" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:1120 +#: ../../library/pathlib.rst:1127 msgid "The *strict* argument (pre-3.6 behavior is strict)." msgstr "" -#: ../../library/pathlib.rst:1125 +#: ../../library/pathlib.rst:1132 msgid "" "This is like calling :func:`Path.glob` with \"``**/``\" added in front of " "the given relative *pattern*::" @@ -832,49 +834,49 @@ msgid "" "arguments ``self``, ``pattern``." msgstr "" -#: ../../library/pathlib.rst:1143 +#: ../../library/pathlib.rst:1150 msgid "Remove this directory. The directory must be empty." msgstr "" -#: ../../library/pathlib.rst:1148 +#: ../../library/pathlib.rst:1155 msgid "" "Return whether this path points to the same file as *other_path*, which can " "be either a Path object, or a string. The semantics are similar to :func:" "`os.path.samefile` and :func:`os.path.samestat`." msgstr "" -#: ../../library/pathlib.rst:1152 +#: ../../library/pathlib.rst:1159 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "" -#: ../../library/pathlib.rst:1169 +#: ../../library/pathlib.rst:1176 msgid "" "Make this path a symbolic link to *target*. Under Windows, " "*target_is_directory* must be true (default ``False``) if the link's target " "is a directory. Under POSIX, *target_is_directory*'s value is ignored." msgstr "" -#: ../../library/pathlib.rst:1185 +#: ../../library/pathlib.rst:1192 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "" -#: ../../library/pathlib.rst:1190 +#: ../../library/pathlib.rst:1197 msgid "Make this path a hard link to the same file as *target*." msgstr "" -#: ../../library/pathlib.rst:1193 +#: ../../library/pathlib.rst:1200 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." msgstr "" -#: ../../library/pathlib.rst:1200 +#: ../../library/pathlib.rst:1207 msgid "Make *target* a hard link to this path." msgstr "" -#: ../../library/pathlib.rst:1204 +#: ../../library/pathlib.rst:1211 msgid "" "This function does not make this path a hard link to *target*, despite the " "implication of the function and argument names. The argument order (target, " @@ -882,14 +884,14 @@ msgid "" "hardlink_to`, but matches that of :func:`os.link`." msgstr "" -#: ../../library/pathlib.rst:1213 +#: ../../library/pathlib.rst:1220 msgid "" "This method is deprecated in favor of :meth:`Path.hardlink_to`, as the " "argument order of :meth:`Path.link_to` does not match that of :meth:`Path." "symlink_to`." msgstr "" -#: ../../library/pathlib.rst:1220 +#: ../../library/pathlib.rst:1227 msgid "" "Create a file at this given path. If *mode* is given, it is combined with " "the process' ``umask`` value to determine the file mode and access flags. " @@ -898,65 +900,65 @@ msgid "" "`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:1229 +#: ../../library/pathlib.rst:1236 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" -#: ../../library/pathlib.rst:1232 +#: ../../library/pathlib.rst:1239 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." msgstr "" -#: ../../library/pathlib.rst:1235 +#: ../../library/pathlib.rst:1242 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" -#: ../../library/pathlib.rst:1238 +#: ../../library/pathlib.rst:1245 msgid "The *missing_ok* parameter was added." msgstr "新增 *missing_ok* 參數。" -#: ../../library/pathlib.rst:1244 +#: ../../library/pathlib.rst:1251 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1253 +#: ../../library/pathlib.rst:1260 msgid "An existing file of the same name is overwritten." msgstr "" -#: ../../library/pathlib.rst:1260 +#: ../../library/pathlib.rst:1267 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1269 +#: ../../library/pathlib.rst:1276 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." msgstr "" -#: ../../library/pathlib.rst:1274 +#: ../../library/pathlib.rst:1281 msgid "The *newline* parameter was added." msgstr "新增 *newline* 參數。" -#: ../../library/pathlib.rst:1278 +#: ../../library/pathlib.rst:1285 msgid "Correspondence to tools in the :mod:`os` module" msgstr "" -#: ../../library/pathlib.rst:1280 +#: ../../library/pathlib.rst:1287 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." msgstr "" -#: ../../library/pathlib.rst:1285 +#: ../../library/pathlib.rst:1292 msgid "" "Not all pairs of functions/methods below are equivalent. Some of them, " "despite having some overlapping use-cases, have different semantics. They " @@ -964,237 +966,237 @@ msgid "" "relpath` and :meth:`PurePath.relative_to`." msgstr "" -#: ../../library/pathlib.rst:1291 +#: ../../library/pathlib.rst:1298 msgid ":mod:`os` and :mod:`os.path`" msgstr ":mod:`os` 和 :mod:`os.path`" -#: ../../library/pathlib.rst:1291 +#: ../../library/pathlib.rst:1298 msgid ":mod:`pathlib`" msgstr ":mod:`pathlib`" -#: ../../library/pathlib.rst:1293 +#: ../../library/pathlib.rst:1300 msgid ":func:`os.path.abspath`" msgstr ":func:`os.path.abspath`" -#: ../../library/pathlib.rst:1293 +#: ../../library/pathlib.rst:1300 msgid ":meth:`Path.absolute` [#]_" msgstr ":meth:`Path.absolute` [#]_" -#: ../../library/pathlib.rst:1294 +#: ../../library/pathlib.rst:1301 msgid ":func:`os.path.realpath`" msgstr ":func:`os.path.realpath`" -#: ../../library/pathlib.rst:1294 +#: ../../library/pathlib.rst:1301 msgid ":meth:`Path.resolve`" msgstr ":meth:`Path.resolve`" -#: ../../library/pathlib.rst:1295 +#: ../../library/pathlib.rst:1302 msgid ":func:`os.chmod`" msgstr ":func:`os.chmod`" -#: ../../library/pathlib.rst:1295 +#: ../../library/pathlib.rst:1302 msgid ":meth:`Path.chmod`" msgstr ":meth:`Path.chmod`" -#: ../../library/pathlib.rst:1296 +#: ../../library/pathlib.rst:1303 msgid ":func:`os.mkdir`" msgstr ":func:`os.mkdir`" -#: ../../library/pathlib.rst:1296 ../../library/pathlib.rst:1297 +#: ../../library/pathlib.rst:1303 ../../library/pathlib.rst:1304 msgid ":meth:`Path.mkdir`" msgstr ":meth:`Path.mkdir`" -#: ../../library/pathlib.rst:1297 +#: ../../library/pathlib.rst:1304 msgid ":func:`os.makedirs`" msgstr ":func:`os.makedirs`" -#: ../../library/pathlib.rst:1298 +#: ../../library/pathlib.rst:1305 msgid ":func:`os.rename`" msgstr ":func:`os.rename`" -#: ../../library/pathlib.rst:1298 +#: ../../library/pathlib.rst:1305 msgid ":meth:`Path.rename`" msgstr ":meth:`Path.rename`" -#: ../../library/pathlib.rst:1299 +#: ../../library/pathlib.rst:1306 msgid ":func:`os.replace`" msgstr ":func:`os.replace`" -#: ../../library/pathlib.rst:1299 +#: ../../library/pathlib.rst:1306 msgid ":meth:`Path.replace`" msgstr ":meth:`Path.replace`" -#: ../../library/pathlib.rst:1300 +#: ../../library/pathlib.rst:1307 msgid ":func:`os.rmdir`" msgstr ":func:`os.rmdir`" -#: ../../library/pathlib.rst:1300 +#: ../../library/pathlib.rst:1307 msgid ":meth:`Path.rmdir`" msgstr ":meth:`Path.rmdir`" -#: ../../library/pathlib.rst:1301 +#: ../../library/pathlib.rst:1308 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr ":func:`os.remove`, :func:`os.unlink`" -#: ../../library/pathlib.rst:1301 +#: ../../library/pathlib.rst:1308 msgid ":meth:`Path.unlink`" msgstr ":meth:`Path.unlink`" -#: ../../library/pathlib.rst:1302 +#: ../../library/pathlib.rst:1309 msgid ":func:`os.getcwd`" msgstr ":func:`os.getcwd`" -#: ../../library/pathlib.rst:1302 +#: ../../library/pathlib.rst:1309 msgid ":func:`Path.cwd`" msgstr ":func:`Path.cwd`" -#: ../../library/pathlib.rst:1303 +#: ../../library/pathlib.rst:1310 msgid ":func:`os.path.exists`" msgstr ":func:`os.path.exists`" -#: ../../library/pathlib.rst:1303 +#: ../../library/pathlib.rst:1310 msgid ":meth:`Path.exists`" msgstr ":meth:`Path.exists`" -#: ../../library/pathlib.rst:1304 +#: ../../library/pathlib.rst:1311 msgid ":func:`os.path.expanduser`" msgstr ":func:`os.path.expanduser`" -#: ../../library/pathlib.rst:1304 +#: ../../library/pathlib.rst:1311 msgid ":meth:`Path.expanduser` and :meth:`Path.home`" msgstr ":meth:`Path.expanduser` 和 :meth:`Path.home`" -#: ../../library/pathlib.rst:1306 +#: ../../library/pathlib.rst:1313 msgid ":func:`os.listdir`" msgstr ":func:`os.listdir`" -#: ../../library/pathlib.rst:1306 +#: ../../library/pathlib.rst:1313 msgid ":meth:`Path.iterdir`" msgstr ":meth:`Path.iterdir`" -#: ../../library/pathlib.rst:1307 +#: ../../library/pathlib.rst:1314 msgid ":func:`os.path.isdir`" msgstr ":func:`os.path.isdir`" -#: ../../library/pathlib.rst:1307 +#: ../../library/pathlib.rst:1314 msgid ":meth:`Path.is_dir`" msgstr ":meth:`Path.is_dir`" -#: ../../library/pathlib.rst:1308 +#: ../../library/pathlib.rst:1315 msgid ":func:`os.path.isfile`" msgstr ":func:`os.path.isfile`" -#: ../../library/pathlib.rst:1308 +#: ../../library/pathlib.rst:1315 msgid ":meth:`Path.is_file`" msgstr ":meth:`Path.is_file`" -#: ../../library/pathlib.rst:1309 +#: ../../library/pathlib.rst:1316 msgid ":func:`os.path.islink`" msgstr ":func:`os.path.islink`" -#: ../../library/pathlib.rst:1309 +#: ../../library/pathlib.rst:1316 msgid ":meth:`Path.is_symlink`" msgstr ":meth:`Path.is_symlink`" -#: ../../library/pathlib.rst:1310 +#: ../../library/pathlib.rst:1317 msgid ":func:`os.link`" msgstr ":func:`os.link`" -#: ../../library/pathlib.rst:1310 +#: ../../library/pathlib.rst:1317 msgid ":meth:`Path.hardlink_to`" msgstr ":meth:`Path.hardlink_to`" -#: ../../library/pathlib.rst:1311 +#: ../../library/pathlib.rst:1318 msgid ":func:`os.symlink`" msgstr ":func:`os.symlink`" -#: ../../library/pathlib.rst:1311 +#: ../../library/pathlib.rst:1318 msgid ":meth:`Path.symlink_to`" msgstr ":meth:`Path.symlink_to`" -#: ../../library/pathlib.rst:1312 +#: ../../library/pathlib.rst:1319 msgid ":func:`os.readlink`" msgstr ":func:`os.readlink`" -#: ../../library/pathlib.rst:1312 +#: ../../library/pathlib.rst:1319 msgid ":meth:`Path.readlink`" msgstr ":meth:`Path.readlink`" -#: ../../library/pathlib.rst:1313 +#: ../../library/pathlib.rst:1320 msgid ":func:`os.path.relpath`" msgstr ":func:`os.path.relpath`" -#: ../../library/pathlib.rst:1313 +#: ../../library/pathlib.rst:1320 msgid ":meth:`PurePath.relative_to` [#]_" msgstr ":meth:`PurePath.relative_to` [#]_" -#: ../../library/pathlib.rst:1314 +#: ../../library/pathlib.rst:1321 msgid ":func:`os.stat`" msgstr ":func:`os.stat`" -#: ../../library/pathlib.rst:1314 +#: ../../library/pathlib.rst:1321 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" msgstr ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" -#: ../../library/pathlib.rst:1317 +#: ../../library/pathlib.rst:1324 msgid ":func:`os.path.isabs`" msgstr ":func:`os.path.isabs`" -#: ../../library/pathlib.rst:1317 +#: ../../library/pathlib.rst:1324 msgid ":meth:`PurePath.is_absolute`" msgstr ":meth:`PurePath.is_absolute`" -#: ../../library/pathlib.rst:1318 +#: ../../library/pathlib.rst:1325 msgid ":func:`os.path.join`" msgstr ":func:`os.path.join`" -#: ../../library/pathlib.rst:1318 +#: ../../library/pathlib.rst:1325 msgid ":func:`PurePath.joinpath`" msgstr ":func:`PurePath.joinpath`" -#: ../../library/pathlib.rst:1319 +#: ../../library/pathlib.rst:1326 msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" -#: ../../library/pathlib.rst:1319 +#: ../../library/pathlib.rst:1326 msgid ":data:`PurePath.name`" msgstr ":data:`PurePath.name`" -#: ../../library/pathlib.rst:1320 +#: ../../library/pathlib.rst:1327 msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" -#: ../../library/pathlib.rst:1320 +#: ../../library/pathlib.rst:1327 msgid ":data:`PurePath.parent`" msgstr ":data:`PurePath.parent`" -#: ../../library/pathlib.rst:1321 +#: ../../library/pathlib.rst:1328 msgid ":func:`os.path.samefile`" msgstr ":func:`os.path.samefile`" -#: ../../library/pathlib.rst:1321 +#: ../../library/pathlib.rst:1328 msgid ":meth:`Path.samefile`" msgstr ":meth:`Path.samefile`" -#: ../../library/pathlib.rst:1322 +#: ../../library/pathlib.rst:1329 msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" -#: ../../library/pathlib.rst:1322 +#: ../../library/pathlib.rst:1329 msgid ":data:`PurePath.stem` and :data:`PurePath.suffix`" msgstr ":data:`PurePath.stem` 和 :data:`PurePath.suffix`" -#: ../../library/pathlib.rst:1327 +#: ../../library/pathlib.rst:1334 msgid "Footnotes" msgstr "註解" -#: ../../library/pathlib.rst:1328 +#: ../../library/pathlib.rst:1335 msgid "" ":func:`os.path.abspath` normalizes the resulting path, which may change its " "meaning in the presence of symlinks, while :meth:`Path.absolute` does not." msgstr "" -#: ../../library/pathlib.rst:1329 +#: ../../library/pathlib.rst:1336 msgid "" ":meth:`PurePath.relative_to` requires ``self`` to be the subpath of the " "argument, but :func:`os.path.relpath` does not."