diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index 3e4b2a1f76..3c4d98814a 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-10-29 00:08+0000\n" "PO-Revision-Date: 2018-05-23 14:31+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -64,14 +64,31 @@ msgid "" "initialized, it must call :c:func:`PyObject_GC_Track`." msgstr "" -#: ../../c-api/gcsupport.rst:37 +#: ../../c-api/gcsupport.rst:36 +msgid "" +"Similarly, the deallocator for the object must conform to a similar pair of " +"rules:" +msgstr "" + +#: ../../c-api/gcsupport.rst:39 +msgid "" +"Before fields which refer to other containers are invalidated, :c:func:" +"`PyObject_GC_UnTrack` must be called." +msgstr "" + +#: ../../c-api/gcsupport.rst:42 +msgid "" +"The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." +msgstr "" + +#: ../../c-api/gcsupport.rst:45 msgid "" "If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least a :" "c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one from its " "subclass or subclasses." msgstr "" -#: ../../c-api/gcsupport.rst:41 +#: ../../c-api/gcsupport.rst:49 msgid "" "When calling :c:func:`PyType_Ready` or some of the APIs that indirectly call " "it like :c:func:`PyType_FromSpecWithBases` or :c:func:`PyType_FromSpec` the " @@ -82,26 +99,26 @@ msgid "" "include the :const:`Py_TPFLAGS_HAVE_GC` flag." msgstr "" -#: ../../c-api/gcsupport.rst:51 +#: ../../c-api/gcsupport.rst:59 msgid "" "Analogous to :c:func:`PyObject_New` but for container objects with the :" "const:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" -#: ../../c-api/gcsupport.rst:57 +#: ../../c-api/gcsupport.rst:65 msgid "" "Analogous to :c:func:`PyObject_NewVar` but for container objects with the :" "const:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" -#: ../../c-api/gcsupport.rst:63 +#: ../../c-api/gcsupport.rst:71 msgid "" "Resize an object allocated by :c:func:`PyObject_NewVar`. Returns the " "resized object or ``NULL`` on failure. *op* must not be tracked by the " "collector yet." msgstr "" -#: ../../c-api/gcsupport.rst:69 +#: ../../c-api/gcsupport.rst:77 msgid "" "Adds the object *op* to the set of container objects tracked by the " "collector. The collector can run at unexpected times so objects must be " @@ -110,55 +127,38 @@ msgid "" "usually near the end of the constructor." msgstr "" -#: ../../c-api/gcsupport.rst:78 +#: ../../c-api/gcsupport.rst:86 msgid "" "Returns non-zero if the object implements the garbage collector protocol, " "otherwise returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:81 +#: ../../c-api/gcsupport.rst:89 msgid "" "The object cannot be tracked by the garbage collector if this function " "returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:86 +#: ../../c-api/gcsupport.rst:94 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* is " "being currently tracked by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:89 +#: ../../c-api/gcsupport.rst:97 msgid "This is analogous to the Python function :func:`gc.is_tracked`." msgstr "" -#: ../../c-api/gcsupport.rst:96 +#: ../../c-api/gcsupport.rst:104 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* has " "been already finalized by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:99 +#: ../../c-api/gcsupport.rst:107 msgid "This is analogous to the Python function :func:`gc.is_finalized`." msgstr "" -#: ../../c-api/gcsupport.rst:103 -msgid "" -"Similarly, the deallocator for the object must conform to a similar pair of " -"rules:" -msgstr "" - -#: ../../c-api/gcsupport.rst:106 -msgid "" -"Before fields which refer to other containers are invalidated, :c:func:" -"`PyObject_GC_UnTrack` must be called." -msgstr "" - -#: ../../c-api/gcsupport.rst:109 -msgid "" -"The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." -msgstr "" - #: ../../c-api/gcsupport.rst:114 msgid "" "Releases memory allocated to an object using :c:func:`PyObject_GC_New` or :c:" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 80093eb8fe..a67c92948e 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-10-29 00:08+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-" @@ -1165,34 +1165,34 @@ msgstr "" #: ../../c-api/typeobj.rst:494 ../../c-api/typeobj.rst:517 #: ../../c-api/typeobj.rst:539 ../../c-api/typeobj.rst:553 #: ../../c-api/typeobj.rst:597 ../../c-api/typeobj.rst:640 -#: ../../c-api/typeobj.rst:686 ../../c-api/typeobj.rst:730 -#: ../../c-api/typeobj.rst:749 ../../c-api/typeobj.rst:766 -#: ../../c-api/typeobj.rst:784 ../../c-api/typeobj.rst:808 -#: ../../c-api/typeobj.rst:825 ../../c-api/typeobj.rst:837 -#: ../../c-api/typeobj.rst:849 ../../c-api/typeobj.rst:882 -#: ../../c-api/typeobj.rst:900 ../../c-api/typeobj.rst:920 -#: ../../c-api/typeobj.rst:941 ../../c-api/typeobj.rst:967 -#: ../../c-api/typeobj.rst:986 ../../c-api/typeobj.rst:1002 -#: ../../c-api/typeobj.rst:1039 ../../c-api/typeobj.rst:1050 -#: ../../c-api/typeobj.rst:1060 ../../c-api/typeobj.rst:1070 -#: ../../c-api/typeobj.rst:1084 ../../c-api/typeobj.rst:1102 -#: ../../c-api/typeobj.rst:1125 ../../c-api/typeobj.rst:1172 -#: ../../c-api/typeobj.rst:1187 ../../c-api/typeobj.rst:1206 -#: ../../c-api/typeobj.rst:1225 ../../c-api/typeobj.rst:1247 -#: ../../c-api/typeobj.rst:1263 ../../c-api/typeobj.rst:1331 -#: ../../c-api/typeobj.rst:1398 ../../c-api/typeobj.rst:1457 -#: ../../c-api/typeobj.rst:1487 ../../c-api/typeobj.rst:1519 -#: ../../c-api/typeobj.rst:1542 ../../c-api/typeobj.rst:1555 -#: ../../c-api/typeobj.rst:1570 ../../c-api/typeobj.rst:1584 -#: ../../c-api/typeobj.rst:1614 ../../c-api/typeobj.rst:1634 -#: ../../c-api/typeobj.rst:1660 ../../c-api/typeobj.rst:1678 -#: ../../c-api/typeobj.rst:1718 ../../c-api/typeobj.rst:1769 -#: ../../c-api/typeobj.rst:1786 ../../c-api/typeobj.rst:1827 -#: ../../c-api/typeobj.rst:1849 ../../c-api/typeobj.rst:1881 -#: ../../c-api/typeobj.rst:1898 ../../c-api/typeobj.rst:1909 -#: ../../c-api/typeobj.rst:1919 ../../c-api/typeobj.rst:1928 -#: ../../c-api/typeobj.rst:1938 ../../c-api/typeobj.rst:1952 -#: ../../c-api/typeobj.rst:1990 ../../c-api/typeobj.rst:2007 +#: ../../c-api/typeobj.rst:698 ../../c-api/typeobj.rst:742 +#: ../../c-api/typeobj.rst:761 ../../c-api/typeobj.rst:778 +#: ../../c-api/typeobj.rst:796 ../../c-api/typeobj.rst:820 +#: ../../c-api/typeobj.rst:837 ../../c-api/typeobj.rst:849 +#: ../../c-api/typeobj.rst:861 ../../c-api/typeobj.rst:894 +#: ../../c-api/typeobj.rst:912 ../../c-api/typeobj.rst:932 +#: ../../c-api/typeobj.rst:953 ../../c-api/typeobj.rst:979 +#: ../../c-api/typeobj.rst:998 ../../c-api/typeobj.rst:1014 +#: ../../c-api/typeobj.rst:1051 ../../c-api/typeobj.rst:1062 +#: ../../c-api/typeobj.rst:1072 ../../c-api/typeobj.rst:1082 +#: ../../c-api/typeobj.rst:1096 ../../c-api/typeobj.rst:1114 +#: ../../c-api/typeobj.rst:1137 ../../c-api/typeobj.rst:1184 +#: ../../c-api/typeobj.rst:1199 ../../c-api/typeobj.rst:1218 +#: ../../c-api/typeobj.rst:1237 ../../c-api/typeobj.rst:1259 +#: ../../c-api/typeobj.rst:1275 ../../c-api/typeobj.rst:1343 +#: ../../c-api/typeobj.rst:1410 ../../c-api/typeobj.rst:1469 +#: ../../c-api/typeobj.rst:1499 ../../c-api/typeobj.rst:1531 +#: ../../c-api/typeobj.rst:1554 ../../c-api/typeobj.rst:1567 +#: ../../c-api/typeobj.rst:1582 ../../c-api/typeobj.rst:1596 +#: ../../c-api/typeobj.rst:1626 ../../c-api/typeobj.rst:1646 +#: ../../c-api/typeobj.rst:1672 ../../c-api/typeobj.rst:1690 +#: ../../c-api/typeobj.rst:1730 ../../c-api/typeobj.rst:1781 +#: ../../c-api/typeobj.rst:1798 ../../c-api/typeobj.rst:1839 +#: ../../c-api/typeobj.rst:1861 ../../c-api/typeobj.rst:1893 +#: ../../c-api/typeobj.rst:1910 ../../c-api/typeobj.rst:1921 +#: ../../c-api/typeobj.rst:1931 ../../c-api/typeobj.rst:1940 +#: ../../c-api/typeobj.rst:1950 ../../c-api/typeobj.rst:1964 +#: ../../c-api/typeobj.rst:2002 ../../c-api/typeobj.rst:2019 msgid "**Inheritance:**" msgstr "" @@ -1221,12 +1221,12 @@ msgid "" "will not change this field if it is non-zero." msgstr "" -#: ../../c-api/typeobj.rst:519 ../../c-api/typeobj.rst:688 -#: ../../c-api/typeobj.rst:810 ../../c-api/typeobj.rst:902 -#: ../../c-api/typeobj.rst:922 ../../c-api/typeobj.rst:1521 -#: ../../c-api/typeobj.rst:1544 ../../c-api/typeobj.rst:1662 -#: ../../c-api/typeobj.rst:1680 ../../c-api/typeobj.rst:1771 -#: ../../c-api/typeobj.rst:1883 ../../c-api/typeobj.rst:1992 +#: ../../c-api/typeobj.rst:519 ../../c-api/typeobj.rst:700 +#: ../../c-api/typeobj.rst:822 ../../c-api/typeobj.rst:914 +#: ../../c-api/typeobj.rst:934 ../../c-api/typeobj.rst:1533 +#: ../../c-api/typeobj.rst:1556 ../../c-api/typeobj.rst:1674 +#: ../../c-api/typeobj.rst:1692 ../../c-api/typeobj.rst:1783 +#: ../../c-api/typeobj.rst:1895 ../../c-api/typeobj.rst:2004 msgid "This field is inherited by subtypes." msgstr "" @@ -1416,34 +1416,41 @@ msgstr "" #: ../../c-api/typeobj.rst:671 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:683 +msgid "" "Finally, if the type is heap allocated (:const:`Py_TPFLAGS_HEAPTYPE`), the " "deallocator should decrement the reference count for its type object after " "calling the type deallocator. In order to avoid dangling pointers, the " "recommended way to achieve this is:" msgstr "" -#: ../../c-api/typeobj.rst:693 +#: ../../c-api/typeobj.rst:705 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:698 +#: ../../c-api/typeobj.rst:710 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:702 +#: ../../c-api/typeobj.rst:714 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:706 +#: ../../c-api/typeobj.rst:718 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 " @@ -1451,7 +1458,7 @@ msgid "" "`PyVectorcall_Call`." msgstr "" -#: ../../c-api/typeobj.rst:713 +#: ../../c-api/typeobj.rst:725 msgid "" "It is not recommended for :ref:`heap types ` to implement the " "vectorcall protocol. When a user sets :attr:`__call__` in Python code, only " @@ -1459,20 +1466,20 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:720 +#: ../../c-api/typeobj.rst:732 msgid "" "The semantics of the ``tp_vectorcall_offset`` slot are provisional and " "expected to be finalized in Python 3.9. If you use vectorcall, plan for " "updating your code for Python 3.9." msgstr "" -#: ../../c-api/typeobj.rst:726 +#: ../../c-api/typeobj.rst:738 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:732 +#: ../../c-api/typeobj.rst:744 msgid "" "This field is always inherited. However, the :const:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not, then " @@ -1481,11 +1488,11 @@ msgid "" "for :ref:`heap types ` (including subclasses defined in Python)." msgstr "" -#: ../../c-api/typeobj.rst:743 +#: ../../c-api/typeobj.rst:755 msgid "An optional pointer to the get-attribute-string function." msgstr "" -#: ../../c-api/typeobj.rst:745 +#: ../../c-api/typeobj.rst:757 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, " @@ -1493,11 +1500,11 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:751 ../../c-api/typeobj.rst:943 +#: ../../c-api/typeobj.rst:763 ../../c-api/typeobj.rst:955 msgid "Group: :attr:`tp_getattr`, :attr:`tp_getattro`" msgstr "" -#: ../../c-api/typeobj.rst:753 +#: ../../c-api/typeobj.rst:765 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1506,12 +1513,12 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:760 ../../c-api/typeobj.rst:956 +#: ../../c-api/typeobj.rst:772 ../../c-api/typeobj.rst:968 msgid "" "An optional pointer to the function for setting and deleting attributes." msgstr "" -#: ../../c-api/typeobj.rst:762 +#: ../../c-api/typeobj.rst:774 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, " @@ -1519,11 +1526,11 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:768 ../../c-api/typeobj.rst:969 +#: ../../c-api/typeobj.rst:780 ../../c-api/typeobj.rst:981 msgid "Group: :attr:`tp_setattr`, :attr:`tp_setattro`" msgstr "" -#: ../../c-api/typeobj.rst:770 +#: ../../c-api/typeobj.rst:782 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1532,34 +1539,34 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:777 +#: ../../c-api/typeobj.rst:789 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:781 +#: ../../c-api/typeobj.rst:793 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "" -#: ../../c-api/typeobj.rst:786 +#: ../../c-api/typeobj.rst:798 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:794 +#: ../../c-api/typeobj.rst:806 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." msgstr "" -#: ../../c-api/typeobj.rst:797 +#: ../../c-api/typeobj.rst:809 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" -#: ../../c-api/typeobj.rst:801 +#: ../../c-api/typeobj.rst:813 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 " @@ -1568,87 +1575,87 @@ msgid "" "``'>'`` from which both the type and the value of the object can be deduced." msgstr "" -#: ../../c-api/typeobj.rst:812 ../../c-api/typeobj.rst:924 -#: ../../c-api/typeobj.rst:949 ../../c-api/typeobj.rst:975 -#: ../../c-api/typeobj.rst:1017 ../../c-api/typeobj.rst:1466 -#: ../../c-api/typeobj.rst:1618 ../../c-api/typeobj.rst:1639 -#: ../../c-api/typeobj.rst:1737 ../../c-api/typeobj.rst:1773 -#: ../../c-api/typeobj.rst:1791 ../../c-api/typeobj.rst:1833 -#: ../../c-api/typeobj.rst:1854 ../../c-api/typeobj.rst:1885 +#: ../../c-api/typeobj.rst:824 ../../c-api/typeobj.rst:936 +#: ../../c-api/typeobj.rst:961 ../../c-api/typeobj.rst:987 +#: ../../c-api/typeobj.rst:1029 ../../c-api/typeobj.rst:1478 +#: ../../c-api/typeobj.rst:1630 ../../c-api/typeobj.rst:1651 +#: ../../c-api/typeobj.rst:1749 ../../c-api/typeobj.rst:1785 +#: ../../c-api/typeobj.rst:1803 ../../c-api/typeobj.rst:1845 +#: ../../c-api/typeobj.rst:1866 ../../c-api/typeobj.rst:1897 msgid "**Default:**" msgstr "" -#: ../../c-api/typeobj.rst:814 +#: ../../c-api/typeobj.rst:826 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:821 +#: ../../c-api/typeobj.rst:833 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:827 +#: ../../c-api/typeobj.rst:839 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:833 +#: ../../c-api/typeobj.rst:845 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:839 +#: ../../c-api/typeobj.rst:851 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:845 +#: ../../c-api/typeobj.rst:857 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:851 +#: ../../c-api/typeobj.rst:863 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:859 +#: ../../c-api/typeobj.rst:871 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." msgstr "" -#: ../../c-api/typeobj.rst:862 +#: ../../c-api/typeobj.rst:874 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" -#: ../../c-api/typeobj.rst:866 +#: ../../c-api/typeobj.rst:878 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:870 +#: ../../c-api/typeobj.rst:882 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:874 +#: ../../c-api/typeobj.rst:886 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 " @@ -1659,11 +1666,11 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:884 ../../c-api/typeobj.rst:1459 +#: ../../c-api/typeobj.rst:896 ../../c-api/typeobj.rst:1471 msgid "Group: :attr:`tp_hash`, :attr:`tp_richcompare`" msgstr "" -#: ../../c-api/typeobj.rst:886 +#: ../../c-api/typeobj.rst:898 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -1672,14 +1679,14 @@ msgid "" "are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:894 +#: ../../c-api/typeobj.rst:906 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:907 +#: ../../c-api/typeobj.rst:919 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 " @@ -1688,11 +1695,11 @@ msgid "" "this handler.)" msgstr "" -#: ../../c-api/typeobj.rst:912 +#: ../../c-api/typeobj.rst:924 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" -#: ../../c-api/typeobj.rst:916 +#: ../../c-api/typeobj.rst:928 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 " @@ -1700,28 +1707,28 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:926 +#: ../../c-api/typeobj.rst:938 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." msgstr "" -#: ../../c-api/typeobj.rst:932 +#: ../../c-api/typeobj.rst:944 msgid "An optional pointer to the get-attribute function." msgstr "" -#: ../../c-api/typeobj.rst:934 +#: ../../c-api/typeobj.rst:946 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:938 +#: ../../c-api/typeobj.rst:950 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:945 +#: ../../c-api/typeobj.rst:957 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1730,15 +1737,15 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:951 +#: ../../c-api/typeobj.rst:963 msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:958 +#: ../../c-api/typeobj.rst:970 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:962 +#: ../../c-api/typeobj.rst:974 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:" @@ -1746,7 +1753,7 @@ msgid "" "attributes." msgstr "" -#: ../../c-api/typeobj.rst:971 +#: ../../c-api/typeobj.rst:983 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1755,24 +1762,24 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:977 +#: ../../c-api/typeobj.rst:989 msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:982 +#: ../../c-api/typeobj.rst:994 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:988 +#: ../../c-api/typeobj.rst:1000 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:994 +#: ../../c-api/typeobj.rst:1006 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 " @@ -1784,7 +1791,7 @@ msgid "" "accessed and must be considered to have a zero or ``NULL`` value instead." msgstr "" -#: ../../c-api/typeobj.rst:1004 +#: ../../c-api/typeobj.rst:1016 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 " @@ -1799,17 +1806,17 @@ msgid "" "the subtype exist and have ``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1019 +#: ../../c-api/typeobj.rst:1031 msgid "" ":c:type:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." msgstr "" -#: ../../c-api/typeobj.rst:1022 +#: ../../c-api/typeobj.rst:1034 msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1024 +#: ../../c-api/typeobj.rst:1036 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." @@ -1818,7 +1825,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1031 +#: ../../c-api/typeobj.rst:1043 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 " @@ -1829,32 +1836,32 @@ msgid "" "gets INCREF'ed or DECREF'ed)." msgstr "" -#: ../../c-api/typeobj.rst:1041 ../../c-api/typeobj.rst:1052 -#: ../../c-api/typeobj.rst:1062 ../../c-api/typeobj.rst:1072 -#: ../../c-api/typeobj.rst:1104 +#: ../../c-api/typeobj.rst:1053 ../../c-api/typeobj.rst:1064 +#: ../../c-api/typeobj.rst:1074 ../../c-api/typeobj.rst:1084 +#: ../../c-api/typeobj.rst:1116 msgid "???" msgstr "" -#: ../../c-api/typeobj.rst:1046 +#: ../../c-api/typeobj.rst:1058 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:1057 +#: ../../c-api/typeobj.rst:1069 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1067 +#: ../../c-api/typeobj.rst:1079 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1077 +#: ../../c-api/typeobj.rst:1089 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 " @@ -1864,13 +1871,13 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: ../../c-api/typeobj.rst:1086 ../../c-api/typeobj.rst:1333 -#: ../../c-api/typeobj.rst:1400 +#: ../../c-api/typeobj.rst:1098 ../../c-api/typeobj.rst:1345 +#: ../../c-api/typeobj.rst:1412 msgid "" "Group: :const:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1088 +#: ../../c-api/typeobj.rst:1100 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:" @@ -1879,48 +1886,48 @@ msgid "" "``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1098 +#: ../../c-api/typeobj.rst:1110 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:1109 +#: ../../c-api/typeobj.rst:1121 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1111 +#: ../../c-api/typeobj.rst:1123 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1113 +#: ../../c-api/typeobj.rst:1125 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1116 +#: ../../c-api/typeobj.rst:1128 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1119 +#: ../../c-api/typeobj.rst:1131 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:1127 +#: ../../c-api/typeobj.rst:1139 msgid "" "This flag is never inherited by :ref:`heap types `. For " "extension types, it is inherited whenever :c:member:`~PyTypeObject." "tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1144 +#: ../../c-api/typeobj.rst:1156 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 " @@ -1930,68 +1937,68 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1155 +#: ../../c-api/typeobj.rst:1167 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1160 +#: ../../c-api/typeobj.rst:1172 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:1168 +#: ../../c-api/typeobj.rst:1180 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:1174 +#: ../../c-api/typeobj.rst:1186 msgid "" "This bit is inherited for :ref:`static subtypes ` if :c:member:" "`~PyTypeObject.tp_call` is also inherited. :ref:`Heap types ` do " "not inherit ``Py_TPFLAGS_HAVE_VECTORCALL``." msgstr "" -#: ../../c-api/typeobj.rst:1182 +#: ../../c-api/typeobj.rst:1194 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1184 +#: ../../c-api/typeobj.rst:1196 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1189 ../../c-api/typeobj.rst:1208 +#: ../../c-api/typeobj.rst:1201 ../../c-api/typeobj.rst:1220 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1195 +#: ../../c-api/typeobj.rst:1207 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:1199 +#: ../../c-api/typeobj.rst:1211 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:1202 +#: ../../c-api/typeobj.rst:1214 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:1215 +#: ../../c-api/typeobj.rst:1227 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 " @@ -1999,23 +2006,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1222 ../../c-api/typeobj.rst:1244 +#: ../../c-api/typeobj.rst:1234 ../../c-api/typeobj.rst:1256 msgid "" ":const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE` are mutually " "exclusive; it is an error enable both flags simultaneously." msgstr "" -#: ../../c-api/typeobj.rst:1227 +#: ../../c-api/typeobj.rst:1239 msgid "" "This flag is inherited by types that do not already set :const:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1230 ../../c-api/typeobj.rst:1252 +#: ../../c-api/typeobj.rst:1242 ../../c-api/typeobj.rst:1264 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1237 +#: ../../c-api/typeobj.rst:1249 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 " @@ -2023,37 +2030,37 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1249 +#: ../../c-api/typeobj.rst:1261 msgid "" "This flag is inherited by types that do not already set :const:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1259 +#: ../../c-api/typeobj.rst:1271 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:1265 +#: ../../c-api/typeobj.rst:1277 msgid "This field is *not* inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:1270 +#: ../../c-api/typeobj.rst:1282 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:1275 ../../c-api/typeobj.rst:1395 +#: ../../c-api/typeobj.rst:1287 ../../c-api/typeobj.rst:1407 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1278 +#: ../../c-api/typeobj.rst:1290 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2063,7 +2070,7 @@ msgid "" "`_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1293 +#: ../../c-api/typeobj.rst:1305 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`` " @@ -2071,14 +2078,14 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1297 +#: ../../c-api/typeobj.rst:1309 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:1302 +#: ../../c-api/typeobj.rst:1314 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:" @@ -2107,14 +2114,14 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1326 +#: ../../c-api/typeobj.rst:1338 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:1335 +#: ../../c-api/typeobj.rst:1347 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:" @@ -2122,14 +2129,14 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1343 +#: ../../c-api/typeobj.rst:1355 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:1348 +#: ../../c-api/typeobj.rst:1360 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2144,7 +2151,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1358 +#: ../../c-api/typeobj.rst:1370 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2152,7 +2159,7 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1372 +#: ../../c-api/typeobj.rst:1384 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 " @@ -2167,7 +2174,7 @@ msgid "" "in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1383 +#: ../../c-api/typeobj.rst:1395 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2175,7 +2182,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: ../../c-api/typeobj.rst:1389 +#: ../../c-api/typeobj.rst:1401 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 " @@ -2185,7 +2192,7 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1402 +#: ../../c-api/typeobj.rst:1414 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:" @@ -2193,18 +2200,18 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1410 +#: ../../c-api/typeobj.rst:1422 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1414 +#: ../../c-api/typeobj.rst:1426 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:1417 +#: ../../c-api/typeobj.rst:1429 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2212,74 +2219,74 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1422 +#: ../../c-api/typeobj.rst:1434 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:1426 +#: ../../c-api/typeobj.rst:1438 msgid "Constant" msgstr "" -#: ../../c-api/typeobj.rst:1426 +#: ../../c-api/typeobj.rst:1438 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1428 +#: ../../c-api/typeobj.rst:1440 msgid ":const:`Py_LT`" msgstr "" -#: ../../c-api/typeobj.rst:1428 +#: ../../c-api/typeobj.rst:1440 msgid "``<``" msgstr "" -#: ../../c-api/typeobj.rst:1430 +#: ../../c-api/typeobj.rst:1442 msgid ":const:`Py_LE`" msgstr "" -#: ../../c-api/typeobj.rst:1430 +#: ../../c-api/typeobj.rst:1442 msgid "``<=``" msgstr "" -#: ../../c-api/typeobj.rst:1432 +#: ../../c-api/typeobj.rst:1444 msgid ":const:`Py_EQ`" msgstr "" -#: ../../c-api/typeobj.rst:1432 +#: ../../c-api/typeobj.rst:1444 msgid "``==``" msgstr "" -#: ../../c-api/typeobj.rst:1434 +#: ../../c-api/typeobj.rst:1446 msgid ":const:`Py_NE`" msgstr "" -#: ../../c-api/typeobj.rst:1434 +#: ../../c-api/typeobj.rst:1446 msgid "``!=``" msgstr "" -#: ../../c-api/typeobj.rst:1436 +#: ../../c-api/typeobj.rst:1448 msgid ":const:`Py_GT`" msgstr "" -#: ../../c-api/typeobj.rst:1436 +#: ../../c-api/typeobj.rst:1448 msgid "``>``" msgstr "" -#: ../../c-api/typeobj.rst:1438 +#: ../../c-api/typeobj.rst:1450 msgid ":const:`Py_GE`" msgstr "" -#: ../../c-api/typeobj.rst:1438 +#: ../../c-api/typeobj.rst:1450 msgid "``>=``" msgstr "" -#: ../../c-api/typeobj.rst:1441 +#: ../../c-api/typeobj.rst:1453 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1445 +#: ../../c-api/typeobj.rst:1457 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 " @@ -2287,15 +2294,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1451 +#: ../../c-api/typeobj.rst:1463 msgid "The return value's reference count is properly incremented." msgstr "" -#: ../../c-api/typeobj.rst:1453 +#: ../../c-api/typeobj.rst:1465 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1461 +#: ../../c-api/typeobj.rst:1473 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2303,7 +2310,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1468 +#: ../../c-api/typeobj.rst:1480 msgid "" ":c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare` " "implementation, which may be inherited. However, if only :attr:`tp_hash` is " @@ -2311,7 +2318,7 @@ msgid "" "will not be able to participate in any comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1477 +#: ../../c-api/typeobj.rst:1489 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 " @@ -2321,13 +2328,13 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1484 +#: ../../c-api/typeobj.rst:1496 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:1489 +#: ../../c-api/typeobj.rst:1501 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 " @@ -2336,7 +2343,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1494 +#: ../../c-api/typeobj.rst:1506 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 " @@ -2345,7 +2352,7 @@ msgid "" "tp_weaklistoffset` of that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1499 +#: ../../c-api/typeobj.rst:1511 msgid "" "When a type's :attr:`__slots__` declaration contains a slot named :attr:" "`__weakref__`, that slot becomes the weak reference list head for instances " @@ -2353,31 +2360,31 @@ msgid "" "`~PyTypeObject.tp_weaklistoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1504 +#: ../../c-api/typeobj.rst:1516 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:1511 +#: ../../c-api/typeobj.rst:1523 msgid "" "An optional pointer to a function that returns an iterator for the object. " "Its presence normally signals that the instances of this type are iterable " "(although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1515 +#: ../../c-api/typeobj.rst:1527 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1526 +#: ../../c-api/typeobj.rst:1538 msgid "" "An optional pointer to a function that returns the next item in an iterator. " "The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1531 +#: ../../c-api/typeobj.rst:1543 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2385,74 +2392,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1536 +#: ../../c-api/typeobj.rst:1548 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:1540 +#: ../../c-api/typeobj.rst:1552 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1549 +#: ../../c-api/typeobj.rst:1561 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:1552 +#: ../../c-api/typeobj.rst:1564 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:1557 +#: ../../c-api/typeobj.rst:1569 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1563 +#: ../../c-api/typeobj.rst:1575 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:1567 +#: ../../c-api/typeobj.rst:1579 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:1572 +#: ../../c-api/typeobj.rst:1584 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1578 +#: ../../c-api/typeobj.rst:1590 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:1581 +#: ../../c-api/typeobj.rst:1593 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:1586 +#: ../../c-api/typeobj.rst:1598 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1592 +#: ../../c-api/typeobj.rst:1604 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2460,7 +2467,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1600 +#: ../../c-api/typeobj.rst:1612 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2468,7 +2475,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1605 +#: ../../c-api/typeobj.rst:1617 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "func:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2476,27 +2483,27 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1611 +#: ../../c-api/typeobj.rst:1623 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1616 +#: ../../c-api/typeobj.rst:1628 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1620 +#: ../../c-api/typeobj.rst:1632 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1626 +#: ../../c-api/typeobj.rst:1638 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1628 +#: ../../c-api/typeobj.rst:1640 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2505,45 +2512,45 @@ msgid "" "they don't correspond to overloaded operations (like :meth:`__add__`)." msgstr "" -#: ../../c-api/typeobj.rst:1636 +#: ../../c-api/typeobj.rst:1648 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:1641 +#: ../../c-api/typeobj.rst:1653 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1646 +#: ../../c-api/typeobj.rst:1658 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:1652 +#: ../../c-api/typeobj.rst:1664 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1654 ../../c-api/typeobj.rst:1670 -#: ../../c-api/typeobj.rst:1752 ../../c-api/typeobj.rst:1782 -#: ../../c-api/typeobj.rst:1806 +#: ../../c-api/typeobj.rst:1666 ../../c-api/typeobj.rst:1682 +#: ../../c-api/typeobj.rst:1764 ../../c-api/typeobj.rst:1794 +#: ../../c-api/typeobj.rst:1818 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1667 +#: ../../c-api/typeobj.rst:1679 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1674 +#: ../../c-api/typeobj.rst:1686 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1685 +#: ../../c-api/typeobj.rst:1697 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 " @@ -2551,13 +2558,13 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1690 +#: ../../c-api/typeobj.rst:1702 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:1693 +#: ../../c-api/typeobj.rst:1705 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, " @@ -2573,13 +2580,13 @@ msgid "" "the very end of the structure." msgstr "" -#: ../../c-api/typeobj.rst:1705 +#: ../../c-api/typeobj.rst:1717 msgid "" "The real dictionary offset in an instance can be computed from a negative :c:" "member:`~PyTypeObject.tp_dictoffset` as follows::" msgstr "" -#: ../../c-api/typeobj.rst:1712 +#: ../../c-api/typeobj.rst:1724 msgid "" "where :c:member:`~PyTypeObject.tp_basicsize`, :c:member:`~PyTypeObject." "tp_itemsize` and :c:member:`~PyTypeObject.tp_dictoffset` are taken from the " @@ -2589,7 +2596,7 @@ msgid "" "it is done for you by :c:func:`_PyObject_GetDictPtr`.)" msgstr "" -#: ../../c-api/typeobj.rst:1720 +#: ../../c-api/typeobj.rst:1732 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 " @@ -2598,7 +2605,7 @@ msgid "" "should not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1725 +#: ../../c-api/typeobj.rst:1737 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, " @@ -2606,14 +2613,14 @@ msgid "" "`~PyTypeObject.tp_dictoffset` is set to that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1730 +#: ../../c-api/typeobj.rst:1742 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:1733 +#: ../../c-api/typeobj.rst:1745 msgid "" "(Adding a slot named :attr:`~object.__dict__` to the :attr:`__slots__` " "declaration does not have the expected effect, it just causes confusion. " @@ -2621,17 +2628,17 @@ msgid "" "though.)" msgstr "" -#: ../../c-api/typeobj.rst:1739 +#: ../../c-api/typeobj.rst:1751 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:1745 +#: ../../c-api/typeobj.rst:1757 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1747 +#: ../../c-api/typeobj.rst:1759 msgid "" "This function corresponds to the :meth:`__init__` method of classes. Like :" "meth:`__init__`, it is possible to create an instance without calling :meth:" @@ -2639,14 +2646,14 @@ msgid "" "meth:`__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1756 +#: ../../c-api/typeobj.rst:1768 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:1760 +#: ../../c-api/typeobj.rst:1772 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 :" @@ -2658,43 +2665,43 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1767 +#: ../../c-api/typeobj.rst:1779 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1775 +#: ../../c-api/typeobj.rst:1787 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1780 +#: ../../c-api/typeobj.rst:1792 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1788 +#: ../../c-api/typeobj.rst:1800 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1793 +#: ../../c-api/typeobj.rst:1805 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:1797 +#: ../../c-api/typeobj.rst:1809 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:1804 +#: ../../c-api/typeobj.rst:1816 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1810 +#: ../../c-api/typeobj.rst:1822 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 " @@ -2703,7 +2710,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1816 +#: ../../c-api/typeobj.rst:1828 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2715,20 +2722,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1824 +#: ../../c-api/typeobj.rst:1836 msgid "" "Set the :const:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow creating " "instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1829 +#: ../../c-api/typeobj.rst:1841 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:1835 +#: ../../c-api/typeobj.rst:1847 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 " @@ -2736,39 +2743,39 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1843 +#: ../../c-api/typeobj.rst:1855 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1847 +#: ../../c-api/typeobj.rst:1859 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1851 +#: ../../c-api/typeobj.rst:1863 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1856 +#: ../../c-api/typeobj.rst:1868 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:1860 +#: ../../c-api/typeobj.rst:1872 msgid "For static subtypes, :c:type:`PyBaseObject_Type` uses PyObject_Del." msgstr "" -#: ../../c-api/typeobj.rst:1865 +#: ../../c-api/typeobj.rst:1877 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1867 +#: ../../c-api/typeobj.rst:1879 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 " @@ -2780,76 +2787,76 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1877 +#: ../../c-api/typeobj.rst:1889 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:1887 +#: ../../c-api/typeobj.rst:1899 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:1893 +#: ../../c-api/typeobj.rst:1905 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1895 +#: ../../c-api/typeobj.rst:1907 msgid "" "This is set for types created by a class statement. It should be ``NULL`` " "for statically defined types." msgstr "" -#: ../../c-api/typeobj.rst:1900 ../../c-api/typeobj.rst:1921 -#: ../../c-api/typeobj.rst:1930 ../../c-api/typeobj.rst:1940 -#: ../../c-api/typeobj.rst:1954 +#: ../../c-api/typeobj.rst:1912 ../../c-api/typeobj.rst:1933 +#: ../../c-api/typeobj.rst:1942 ../../c-api/typeobj.rst:1952 +#: ../../c-api/typeobj.rst:1966 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1905 +#: ../../c-api/typeobj.rst:1917 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:1911 +#: ../../c-api/typeobj.rst:1923 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1917 +#: ../../c-api/typeobj.rst:1929 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1926 +#: ../../c-api/typeobj.rst:1938 msgid "List of weak references to subclasses. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1935 +#: ../../c-api/typeobj.rst:1947 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1945 +#: ../../c-api/typeobj.rst:1957 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:1950 +#: ../../c-api/typeobj.rst:1962 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1959 +#: ../../c-api/typeobj.rst:1971 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1963 +#: ../../c-api/typeobj.rst:1975 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 " @@ -2859,24 +2866,24 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:1970 +#: ../../c-api/typeobj.rst:1982 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:1987 +#: ../../c-api/typeobj.rst:1999 msgid "" "For this field to be taken into account (even through inheritance), you must " "also set the :const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit." msgstr "" -#: ../../c-api/typeobj.rst:1996 +#: ../../c-api/typeobj.rst:2008 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2001 +#: ../../c-api/typeobj.rst:2013 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -2884,15 +2891,15 @@ msgid "" "attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2009 +#: ../../c-api/typeobj.rst:2021 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2011 +#: ../../c-api/typeobj.rst:2023 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2014 +#: ../../c-api/typeobj.rst:2026 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 " @@ -2905,53 +2912,53 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2028 +#: ../../c-api/typeobj.rst:2040 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2030 +#: ../../c-api/typeobj.rst:2042 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:2034 +#: ../../c-api/typeobj.rst:2046 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2036 +#: ../../c-api/typeobj.rst:2048 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2038 +#: ../../c-api/typeobj.rst:2050 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:2040 +#: ../../c-api/typeobj.rst:2052 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2044 +#: ../../c-api/typeobj.rst:2056 msgid "" "Also, since :c:type:`PyTypeObject` is not part of the :ref:`stable ABI " "`, any extension modules using static types must be compiled for a " "specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2052 +#: ../../c-api/typeobj.rst:2064 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2054 +#: ../../c-api/typeobj.rst:2066 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -2959,29 +2966,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2059 +#: ../../c-api/typeobj.rst:2071 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:2067 +#: ../../c-api/typeobj.rst:2079 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2074 +#: ../../c-api/typeobj.rst:2086 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:2080 ../../c-api/typeobj.rst:2404 +#: ../../c-api/typeobj.rst:2092 ../../c-api/typeobj.rst:2416 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2127 +#: ../../c-api/typeobj.rst:2139 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 " @@ -2991,30 +2998,30 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2136 +#: ../../c-api/typeobj.rst:2148 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:2181 +#: ../../c-api/typeobj.rst:2193 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2188 +#: ../../c-api/typeobj.rst:2200 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:2193 +#: ../../c-api/typeobj.rst:2205 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:2199 +#: ../../c-api/typeobj.rst:2211 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3022,7 +3029,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2207 +#: ../../c-api/typeobj.rst:2219 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" @@ -3032,17 +3039,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2218 +#: ../../c-api/typeobj.rst:2230 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2225 +#: ../../c-api/typeobj.rst:2237 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2230 +#: ../../c-api/typeobj.rst:2242 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 " @@ -3050,21 +3057,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2237 +#: ../../c-api/typeobj.rst:2249 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:2243 +#: ../../c-api/typeobj.rst:2255 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:2249 +#: ../../c-api/typeobj.rst:2261 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 " @@ -3073,7 +3080,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2255 +#: ../../c-api/typeobj.rst:2267 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 " @@ -3081,7 +3088,7 @@ msgid "" "the index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2262 +#: ../../c-api/typeobj.rst:2274 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:" @@ -3090,14 +3097,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2271 +#: ../../c-api/typeobj.rst:2283 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:2278 +#: ../../c-api/typeobj.rst:2290 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 " @@ -3107,7 +3114,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2287 +#: ../../c-api/typeobj.rst:2299 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 " @@ -3117,72 +3124,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2298 +#: ../../c-api/typeobj.rst:2310 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2306 +#: ../../c-api/typeobj.rst:2318 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:2312 ../../c-api/typeobj.rst:2361 -#: ../../c-api/typeobj.rst:2415 ../../c-api/typeobj.rst:2426 -#: ../../c-api/typeobj.rst:2437 ../../c-api/typeobj.rst:2446 +#: ../../c-api/typeobj.rst:2324 ../../c-api/typeobj.rst:2373 +#: ../../c-api/typeobj.rst:2427 ../../c-api/typeobj.rst:2438 +#: ../../c-api/typeobj.rst:2449 ../../c-api/typeobj.rst:2458 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2316 +#: ../../c-api/typeobj.rst:2328 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:2320 +#: ../../c-api/typeobj.rst:2332 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " "set :c:data:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2323 +#: ../../c-api/typeobj.rst:2335 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2325 +#: ../../c-api/typeobj.rst:2337 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2327 +#: ../../c-api/typeobj.rst:2339 msgid "" "Set :c:data:`view->obj` to *exporter* and increment :c:data:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2329 +#: ../../c-api/typeobj.rst:2341 msgid "Return ``0``." msgstr "" -#: ../../c-api/typeobj.rst:2331 +#: ../../c-api/typeobj.rst:2343 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2334 +#: ../../c-api/typeobj.rst:2346 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "data:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2337 +#: ../../c-api/typeobj.rst:2349 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:data:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2341 +#: ../../c-api/typeobj.rst:2353 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3190,7 +3197,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2346 +#: ../../c-api/typeobj.rst:2358 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:" @@ -3199,19 +3206,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2353 +#: ../../c-api/typeobj.rst:2365 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:2356 +#: ../../c-api/typeobj.rst:2368 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2365 +#: ../../c-api/typeobj.rst:2377 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 " @@ -3219,15 +3226,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2370 +#: ../../c-api/typeobj.rst:2382 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2372 +#: ../../c-api/typeobj.rst:2384 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2374 +#: ../../c-api/typeobj.rst:2386 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 " @@ -3235,67 +3242,67 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2380 +#: ../../c-api/typeobj.rst:2392 msgid "" "This function MUST NOT decrement :c:data:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2385 +#: ../../c-api/typeobj.rst:2397 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2393 +#: ../../c-api/typeobj.rst:2405 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2401 +#: ../../c-api/typeobj.rst:2413 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2419 +#: ../../c-api/typeobj.rst:2431 msgid "" "The returned object must be an iterator, i.e. :c:func:`PyIter_Check` must " "return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2422 +#: ../../c-api/typeobj.rst:2434 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2430 +#: ../../c-api/typeobj.rst:2442 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details." msgstr "" -#: ../../c-api/typeobj.rst:2432 +#: ../../c-api/typeobj.rst:2444 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2441 +#: ../../c-api/typeobj.rst:2453 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " "This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2450 +#: ../../c-api/typeobj.rst:2462 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2459 +#: ../../c-api/typeobj.rst:2471 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2463 +#: ../../c-api/typeobj.rst:2475 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " @@ -3309,80 +3316,80 @@ msgid "" "member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2473 +#: ../../c-api/typeobj.rst:2485 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:2480 +#: ../../c-api/typeobj.rst:2492 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "" -#: ../../c-api/typeobj.rst:2484 +#: ../../c-api/typeobj.rst:2496 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2488 +#: ../../c-api/typeobj.rst:2500 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:2492 +#: ../../c-api/typeobj.rst:2504 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "" -#: ../../c-api/typeobj.rst:2496 ../../c-api/typeobj.rst:2505 +#: ../../c-api/typeobj.rst:2508 ../../c-api/typeobj.rst:2517 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2500 ../../c-api/typeobj.rst:2511 +#: ../../c-api/typeobj.rst:2512 ../../c-api/typeobj.rst:2523 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:2507 +#: ../../c-api/typeobj.rst:2519 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "" -#: ../../c-api/typeobj.rst:2514 +#: ../../c-api/typeobj.rst:2526 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "" -#: ../../c-api/typeobj.rst:2518 +#: ../../c-api/typeobj.rst:2530 msgid "See :c:member:`~PyTypeObject.tp_descrget`." msgstr "" -#: ../../c-api/typeobj.rst:2522 +#: ../../c-api/typeobj.rst:2534 msgid "See :c:member:`~PyTypeObject.tp_descrset`." msgstr "" -#: ../../c-api/typeobj.rst:2526 +#: ../../c-api/typeobj.rst:2538 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "" -#: ../../c-api/typeobj.rst:2530 +#: ../../c-api/typeobj.rst:2542 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "" -#: ../../c-api/typeobj.rst:2534 +#: ../../c-api/typeobj.rst:2546 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "" -#: ../../c-api/typeobj.rst:2538 +#: ../../c-api/typeobj.rst:2550 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "" -#: ../../c-api/typeobj.rst:2552 +#: ../../c-api/typeobj.rst:2564 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "" -#: ../../c-api/typeobj.rst:2568 +#: ../../c-api/typeobj.rst:2580 msgid "Examples" msgstr "" -#: ../../c-api/typeobj.rst:2570 +#: ../../c-api/typeobj.rst:2582 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3390,33 +3397,33 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2575 +#: ../../c-api/typeobj.rst:2587 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2592 +#: ../../c-api/typeobj.rst:2604 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2636 +#: ../../c-api/typeobj.rst:2648 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2663 +#: ../../c-api/typeobj.rst:2675 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:2682 +#: ../../c-api/typeobj.rst:2694 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2693 +#: ../../c-api/typeobj.rst:2705 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" diff --git a/extending/newtypes.po b/extending/newtypes.po index 9fcf871947..f7094b0ddd 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-03 13:29+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,7 +93,13 @@ msgid "" "of this function::" msgstr "" -#: ../../extending/newtypes.rst:83 +#: ../../extending/newtypes.rst:79 +msgid "" +"If your type supports garbage collection, the destructor should call :c:func:" +"`PyObject_GC_UnTrack` before clearing any member fields::" +msgstr "" + +#: ../../extending/newtypes.rst:95 msgid "" "One important requirement of the deallocator function is that it leaves any " "pending exceptions alone. This is important since deallocators are " @@ -108,7 +114,7 @@ msgid "" "c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` functions::" msgstr "" -#: ../../extending/newtypes.rst:122 +#: ../../extending/newtypes.rst:134 msgid "" "There are limitations to what you can safely do in a deallocator function. " "First, if your type supports garbage collection (using :c:member:" @@ -121,43 +127,43 @@ msgid "" "tp_dealloc` again, causing a double free and a crash." msgstr "" -#: ../../extending/newtypes.rst:131 +#: ../../extending/newtypes.rst:143 msgid "" "Starting with Python 3.4, it is recommended not to put any complex " "finalization code in :c:member:`~PyTypeObject.tp_dealloc`, and instead use " "the new :c:member:`~PyTypeObject.tp_finalize` type method." msgstr "" -#: ../../extending/newtypes.rst:136 +#: ../../extending/newtypes.rst:148 msgid ":pep:`442` explains the new finalization scheme." msgstr "" -#: ../../extending/newtypes.rst:143 +#: ../../extending/newtypes.rst:155 msgid "Object Presentation" msgstr "" -#: ../../extending/newtypes.rst:145 +#: ../../extending/newtypes.rst:157 msgid "" "In Python, there are two ways to generate a textual representation of an " "object: the :func:`repr` function, and the :func:`str` function. (The :func:" "`print` function just calls :func:`str`.) These handlers are both optional." msgstr "" -#: ../../extending/newtypes.rst:154 +#: ../../extending/newtypes.rst:166 msgid "" "The :c:member:`~PyTypeObject.tp_repr` handler should return a string object " "containing a representation of the instance for which it is called. Here is " "a simple example::" msgstr "" -#: ../../extending/newtypes.rst:165 +#: ../../extending/newtypes.rst:177 msgid "" "If no :c:member:`~PyTypeObject.tp_repr` handler is specified, the " "interpreter will supply a representation that uses the type's :c:member:" "`~PyTypeObject.tp_name` and a uniquely-identifying value for the object." msgstr "" -#: ../../extending/newtypes.rst:169 +#: ../../extending/newtypes.rst:181 msgid "" "The :c:member:`~PyTypeObject.tp_str` handler is to :func:`str` what the :c:" "member:`~PyTypeObject.tp_repr` handler described above is to :func:`repr`; " @@ -168,15 +174,15 @@ msgid "" "the :c:member:`~PyTypeObject.tp_repr` handler is used instead." msgstr "" -#: ../../extending/newtypes.rst:176 +#: ../../extending/newtypes.rst:188 msgid "Here is a simple example::" msgstr "" -#: ../../extending/newtypes.rst:188 +#: ../../extending/newtypes.rst:200 msgid "Attribute Management" msgstr "" -#: ../../extending/newtypes.rst:190 +#: ../../extending/newtypes.rst:202 msgid "" "For every object which can support attributes, the corresponding type must " "provide the functions that control how the attributes are resolved. There " @@ -186,7 +192,7 @@ msgid "" "handler is ``NULL``." msgstr "" -#: ../../extending/newtypes.rst:196 +#: ../../extending/newtypes.rst:208 msgid "" "Python supports two pairs of attribute handlers; a type that supports " "attributes only needs to implement the functions for one pair. The " @@ -195,7 +201,7 @@ msgid "" "use whichever pair makes more sense for the implementation's convenience. ::" msgstr "" -#: ../../extending/newtypes.rst:208 +#: ../../extending/newtypes.rst:220 msgid "" "If accessing attributes of an object is always a simple operation (this will " "be explained shortly), there are generic implementations which can be used " @@ -206,35 +212,35 @@ msgid "" "mechanism that is available." msgstr "" -#: ../../extending/newtypes.rst:219 +#: ../../extending/newtypes.rst:231 msgid "Generic Attribute Management" msgstr "" -#: ../../extending/newtypes.rst:221 +#: ../../extending/newtypes.rst:233 msgid "" "Most extension types only use *simple* attributes. So, what makes the " "attributes simple? There are only a couple of conditions that must be met:" msgstr "" -#: ../../extending/newtypes.rst:224 +#: ../../extending/newtypes.rst:236 msgid "" "The name of the attributes must be known when :c:func:`PyType_Ready` is " "called." msgstr "" -#: ../../extending/newtypes.rst:227 +#: ../../extending/newtypes.rst:239 msgid "" "No special processing is needed to record that an attribute was looked up or " "set, nor do actions need to be taken based on the value." msgstr "" -#: ../../extending/newtypes.rst:230 +#: ../../extending/newtypes.rst:242 msgid "" "Note that this list does not place any restrictions on the values of the " "attributes, when the values are computed, or how relevant data is stored." msgstr "" -#: ../../extending/newtypes.rst:233 +#: ../../extending/newtypes.rst:245 msgid "" "When :c:func:`PyType_Ready` is called, it uses three tables referenced by " "the type object to create :term:`descriptor`\\s which are placed in the " @@ -246,18 +252,18 @@ msgid "" "``NULL`` as well, allowing the base type to handle attributes." msgstr "" -#: ../../extending/newtypes.rst:241 +#: ../../extending/newtypes.rst:253 msgid "The tables are declared as three fields of the type object::" msgstr "" -#: ../../extending/newtypes.rst:247 +#: ../../extending/newtypes.rst:259 msgid "" "If :c:member:`~PyTypeObject.tp_methods` is not ``NULL``, it must refer to an " "array of :c:type:`PyMethodDef` structures. Each entry in the table is an " "instance of this structure::" msgstr "" -#: ../../extending/newtypes.rst:258 +#: ../../extending/newtypes.rst:270 msgid "" "One entry should be defined for each method provided by the type; no entries " "are needed for methods inherited from a base type. One additional entry is " @@ -265,7 +271,7 @@ msgid "" "attr:`ml_name` field of the sentinel must be ``NULL``." msgstr "" -#: ../../extending/newtypes.rst:263 +#: ../../extending/newtypes.rst:275 msgid "" "The second table is used to define attributes which map directly to data " "stored in the instance. A variety of primitive C types are supported, and " @@ -273,7 +279,7 @@ msgid "" "defined as::" msgstr "" -#: ../../extending/newtypes.rst:275 +#: ../../extending/newtypes.rst:287 msgid "" "For each entry in the table, a :term:`descriptor` will be constructed and " "added to the type which will be able to extract a value from the instance " @@ -284,39 +290,39 @@ msgid "" "accessed." msgstr "" -#: ../../extending/newtypes.rst:282 +#: ../../extending/newtypes.rst:294 msgid "" "The following flag constants are defined in :file:`structmember.h`; they may " "be combined using bitwise-OR." msgstr "" -#: ../../extending/newtypes.rst:286 +#: ../../extending/newtypes.rst:298 msgid "Constant" msgstr "" -#: ../../extending/newtypes.rst:286 +#: ../../extending/newtypes.rst:298 msgid "Meaning" msgstr "" -#: ../../extending/newtypes.rst:288 +#: ../../extending/newtypes.rst:300 msgid ":const:`READONLY`" msgstr ":const:`READONLY`" -#: ../../extending/newtypes.rst:288 +#: ../../extending/newtypes.rst:300 msgid "Never writable." msgstr "" -#: ../../extending/newtypes.rst:290 +#: ../../extending/newtypes.rst:302 msgid ":const:`PY_AUDIT_READ`" msgstr ":const:`PY_AUDIT_READ`" -#: ../../extending/newtypes.rst:290 +#: ../../extending/newtypes.rst:302 msgid "" "Emit an ``object.__getattr__`` :ref:`audit events ` before " "reading." msgstr "" -#: ../../extending/newtypes.rst:295 +#: ../../extending/newtypes.rst:307 msgid "" ":const:`RESTRICTED`, :const:`READ_RESTRICTED` and :const:`WRITE_RESTRICTED` " "are deprecated. However, :const:`READ_RESTRICTED` is an alias for :const:" @@ -324,7 +330,7 @@ msgid "" "`READ_RESTRICTED` will also raise an audit event." msgstr "" -#: ../../extending/newtypes.rst:308 +#: ../../extending/newtypes.rst:320 msgid "" "An interesting advantage of using the :c:member:`~PyTypeObject.tp_members` " "table to build descriptors that are used at runtime is that any attribute " @@ -334,17 +340,17 @@ msgid "" "`__doc__` attribute." msgstr "" -#: ../../extending/newtypes.rst:314 +#: ../../extending/newtypes.rst:326 msgid "" "As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry " "with a :attr:`name` value of ``NULL`` is required." msgstr "" -#: ../../extending/newtypes.rst:328 +#: ../../extending/newtypes.rst:340 msgid "Type-specific Attribute Management" msgstr "" -#: ../../extending/newtypes.rst:330 +#: ../../extending/newtypes.rst:342 msgid "" "For simplicity, only the :c:type:`char\\*` version will be demonstrated " "here; the type of the name parameter is the only difference between the :c:" @@ -355,18 +361,18 @@ msgid "" "functionality, you'll understand what needs to be done." msgstr "" -#: ../../extending/newtypes.rst:338 +#: ../../extending/newtypes.rst:350 msgid "" "The :c:member:`~PyTypeObject.tp_getattr` handler is called when the object " "requires an attribute look-up. It is called in the same situations where " "the :meth:`__getattr__` method of a class would be called." msgstr "" -#: ../../extending/newtypes.rst:342 +#: ../../extending/newtypes.rst:354 msgid "Here is an example::" msgstr "" -#: ../../extending/newtypes.rst:358 +#: ../../extending/newtypes.rst:370 msgid "" "The :c:member:`~PyTypeObject.tp_setattr` handler is called when the :meth:" "`__setattr__` or :meth:`__delattr__` method of a class instance would be " @@ -376,11 +382,11 @@ msgid "" "should be set to ``NULL``. ::" msgstr "" -#: ../../extending/newtypes.rst:372 +#: ../../extending/newtypes.rst:384 msgid "Object Comparison" msgstr "" -#: ../../extending/newtypes.rst:378 +#: ../../extending/newtypes.rst:390 msgid "" "The :c:member:`~PyTypeObject.tp_richcompare` handler is called when " "comparisons are needed. It is analogous to the :ref:`rich comparison " @@ -388,34 +394,34 @@ msgid "" "`PyObject_RichCompare` and :c:func:`PyObject_RichCompareBool`." msgstr "" -#: ../../extending/newtypes.rst:383 +#: ../../extending/newtypes.rst:395 msgid "" "This function is called with two Python objects and the operator as " "arguments, where the operator is one of ``Py_EQ``, ``Py_NE``, ``Py_LE``, " -"``Py_GT``, ``Py_LT`` or ``Py_GT``. It should compare the two objects with " +"``Py_GE``, ``Py_LT`` or ``Py_GT``. It should compare the two objects with " "respect to the specified operator and return ``Py_True`` or ``Py_False`` if " "the comparison is successful, ``Py_NotImplemented`` to indicate that " "comparison is not implemented and the other object's comparison method " "should be tried, or ``NULL`` if an exception was set." msgstr "" -#: ../../extending/newtypes.rst:391 +#: ../../extending/newtypes.rst:403 msgid "" "Here is a sample implementation, for a datatype that is considered equal if " "the size of an internal pointer is equal::" msgstr "" -#: ../../extending/newtypes.rst:421 +#: ../../extending/newtypes.rst:433 msgid "Abstract Protocol Support" msgstr "" -#: ../../extending/newtypes.rst:423 +#: ../../extending/newtypes.rst:435 msgid "" "Python supports a variety of *abstract* 'protocols;' the specific interfaces " "provided to use these interfaces are documented in :ref:`abstract`." msgstr "" -#: ../../extending/newtypes.rst:427 +#: ../../extending/newtypes.rst:439 msgid "" "A number of these abstract interfaces were defined early in the development " "of the Python implementation. In particular, the number, mapping, and " @@ -430,7 +436,7 @@ msgid "" "slot, but a slot may still be unfilled.) ::" msgstr "" -#: ../../extending/newtypes.rst:442 +#: ../../extending/newtypes.rst:454 msgid "" "If you wish your object to be able to act like a number, a sequence, or a " "mapping object, then you place the address of a structure that implements " @@ -441,13 +447,13 @@ msgid "" "distribution. ::" msgstr "" -#: ../../extending/newtypes.rst:451 +#: ../../extending/newtypes.rst:463 msgid "" "This function, if you choose to provide it, should return a hash number for " "an instance of your data type. Here is a simple example::" msgstr "" -#: ../../extending/newtypes.rst:464 +#: ../../extending/newtypes.rst:476 msgid "" ":c:type:`Py_hash_t` is a signed integer type with a platform-varying width. " "Returning ``-1`` from :c:member:`~PyTypeObject.tp_hash` indicates an error, " @@ -455,7 +461,7 @@ msgid "" "computation is successful, as seen above." msgstr "" -#: ../../extending/newtypes.rst:473 +#: ../../extending/newtypes.rst:485 msgid "" "This function is called when an instance of your data type is \"called\", " "for example, if ``obj1`` is an instance of your data type and the Python " @@ -463,23 +469,23 @@ msgid "" "handler is invoked." msgstr "" -#: ../../extending/newtypes.rst:477 +#: ../../extending/newtypes.rst:489 msgid "This function takes three arguments:" msgstr "" -#: ../../extending/newtypes.rst:479 +#: ../../extending/newtypes.rst:491 msgid "" "*self* is the instance of the data type which is the subject of the call. If " "the call is ``obj1('hello')``, then *self* is ``obj1``." msgstr "" -#: ../../extending/newtypes.rst:482 +#: ../../extending/newtypes.rst:494 msgid "" "*args* is a tuple containing the arguments to the call. You can use :c:func:" "`PyArg_ParseTuple` to extract the arguments." msgstr "" -#: ../../extending/newtypes.rst:485 +#: ../../extending/newtypes.rst:497 msgid "" "*kwds* is a dictionary of keyword arguments that were passed. If this is non-" "``NULL`` and you support keyword arguments, use :c:func:" @@ -488,11 +494,11 @@ msgid "" "`TypeError` with a message saying that keyword arguments are not supported." msgstr "" -#: ../../extending/newtypes.rst:491 +#: ../../extending/newtypes.rst:503 msgid "Here is a toy ``tp_call`` implementation::" msgstr "" -#: ../../extending/newtypes.rst:517 +#: ../../extending/newtypes.rst:529 msgid "" "These functions provide support for the iterator protocol. Both handlers " "take exactly one parameter, the instance for which they are being called, " @@ -503,21 +509,21 @@ msgid "" "__next__` method." msgstr "" -#: ../../extending/newtypes.rst:524 +#: ../../extending/newtypes.rst:536 msgid "" "Any :term:`iterable` object must implement the :c:member:`~PyTypeObject." "tp_iter` handler, which must return an :term:`iterator` object. Here the " "same guidelines apply as for Python classes:" msgstr "" -#: ../../extending/newtypes.rst:528 +#: ../../extending/newtypes.rst:540 msgid "" "For collections (such as lists and tuples) which can support multiple " "independent iterators, a new iterator should be created and returned by each " "call to :c:member:`~PyTypeObject.tp_iter`." msgstr "" -#: ../../extending/newtypes.rst:531 +#: ../../extending/newtypes.rst:543 msgid "" "Objects which can only be iterated over once (usually due to side effects of " "iteration, such as file objects) can implement :c:member:`~PyTypeObject." @@ -525,7 +531,7 @@ msgid "" "therefore implement the :c:member:`~PyTypeObject.tp_iternext` handler." msgstr "" -#: ../../extending/newtypes.rst:536 +#: ../../extending/newtypes.rst:548 msgid "" "Any :term:`iterator` object should implement both :c:member:`~PyTypeObject." "tp_iter` and :c:member:`~PyTypeObject.tp_iternext`. An iterator's :c:member:" @@ -540,28 +546,28 @@ msgid "" "``NULL``." msgstr "" -#: ../../extending/newtypes.rst:552 +#: ../../extending/newtypes.rst:564 msgid "Weak Reference Support" msgstr "" -#: ../../extending/newtypes.rst:554 +#: ../../extending/newtypes.rst:566 msgid "" "One of the goals of Python's weak reference implementation is to allow any " "type to participate in the weak reference mechanism without incurring the " "overhead on performance-critical objects (such as numbers)." msgstr "" -#: ../../extending/newtypes.rst:559 +#: ../../extending/newtypes.rst:571 msgid "Documentation for the :mod:`weakref` module." msgstr "" -#: ../../extending/newtypes.rst:561 +#: ../../extending/newtypes.rst:573 msgid "" "For an object to be weakly referencable, the extension type must do two " "things:" msgstr "" -#: ../../extending/newtypes.rst:563 +#: ../../extending/newtypes.rst:575 msgid "" "Include a :c:type:`PyObject\\*` field in the C object structure dedicated to " "the weak reference mechanism. The object's constructor should leave it " @@ -569,35 +575,35 @@ msgid "" "tp_alloc`)." msgstr "" -#: ../../extending/newtypes.rst:568 +#: ../../extending/newtypes.rst:580 msgid "" "Set the :c:member:`~PyTypeObject.tp_weaklistoffset` type member to the " "offset of the aforementioned field in the C object structure, so that the " "interpreter knows how to access and modify that field." msgstr "" -#: ../../extending/newtypes.rst:572 +#: ../../extending/newtypes.rst:584 msgid "" "Concretely, here is how a trivial object structure would be augmented with " "the required field::" msgstr "" -#: ../../extending/newtypes.rst:580 +#: ../../extending/newtypes.rst:592 msgid "And the corresponding member in the statically-declared type object::" msgstr "" -#: ../../extending/newtypes.rst:588 +#: ../../extending/newtypes.rst:600 msgid "" "The only further addition is that ``tp_dealloc`` needs to clear any weak " "references (by calling :c:func:`PyObject_ClearWeakRefs`) if the field is non-" "``NULL``::" msgstr "" -#: ../../extending/newtypes.rst:604 +#: ../../extending/newtypes.rst:616 msgid "More Suggestions" msgstr "" -#: ../../extending/newtypes.rst:606 +#: ../../extending/newtypes.rst:618 msgid "" "In order to learn how to implement any specific method for your new data " "type, get the :term:`CPython` source code. Go to the :file:`Objects` " @@ -606,26 +612,26 @@ msgid "" "function you want to implement." msgstr "" -#: ../../extending/newtypes.rst:612 +#: ../../extending/newtypes.rst:624 msgid "" "When you need to verify that an object is a concrete instance of the type " "you are implementing, use the :c:func:`PyObject_TypeCheck` function. A " "sample of its use might be something like the following::" msgstr "" -#: ../../extending/newtypes.rst:623 +#: ../../extending/newtypes.rst:635 msgid "Download CPython source releases." msgstr "" -#: ../../extending/newtypes.rst:623 +#: ../../extending/newtypes.rst:635 msgid "https://www.python.org/downloads/source/" msgstr "https://www.python.org/downloads/source/" -#: ../../extending/newtypes.rst:625 +#: ../../extending/newtypes.rst:637 msgid "" "The CPython project on GitHub, where the CPython source code is developed." msgstr "" -#: ../../extending/newtypes.rst:626 +#: ../../extending/newtypes.rst:638 msgid "https://github.com/python/cpython" msgstr "https://github.com/python/cpython" diff --git a/library/collections.po b/library/collections.po index a774668f39..a6b35c4440 100644 --- a/library/collections.po +++ b/library/collections.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-10-28 17:11+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -398,7 +398,7 @@ msgid "" msgstr "" #: ../../library/collections.rst:345 -msgid "Rich comparison operations we were added" +msgid "Rich comparison operations were added." msgstr "" #: ../../library/collections.rst:348 diff --git a/library/functions.po b/library/functions.po index 4e3cd33194..cff9e65f83 100644 --- a/library/functions.po +++ b/library/functions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-03 00:08+0000\n" "PO-Revision-Date: 2018-11-10 18:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1184,7 +1184,7 @@ msgid "" "as a suite of Python statements which is then executed (unless a syntax " "error occurs). [#]_ If it is a code object, it is simply executed. In all " "cases, the code that's executed is expected to be valid as file input (see " -"the section \"File input\" in the Reference Manual). Be aware that the :" +"the section :ref:`file-input` in the Reference Manual). Be aware that the :" "keyword:`nonlocal`, :keyword:`yield`, and :keyword:`return` statements may " "not be used outside of function definitions even within the context of code " "passed to the :func:`exec` function. The return value is ``None``." @@ -2945,7 +2945,8 @@ msgstr "" #: ../../library/functions.rst:1833 msgid "Example::" -msgstr "例如:\n" +msgstr "" +"例如:\n" "\n" "::" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 057aa52692..6e332da8b9 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-10-31 00:09+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,7 +26,7 @@ msgid "``importlib.metadata`` is no longer provisional." msgstr "" #: ../../library/importlib.metadata.rst:14 -msgid "**Source code:** :source:`Lib/importlib/metadata.py`" +msgid "**Source code:** :source:`Lib/importlib/metadata/__init__.py`" msgstr "" #: ../../library/importlib.metadata.rst:16 diff --git a/library/importlib.po b/library/importlib.po index ae7ab0cfc7..9038b42403 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-01 00:09+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -433,8 +433,8 @@ msgid "" msgstr "" #: ../../library/importlib.rst:305 ../../library/importlib.rst:361 -#: ../../library/importlib.rst:369 ../../library/importlib.rst:1149 -#: ../../library/importlib.rst:1206 +#: ../../library/importlib.rst:369 ../../library/importlib.rst:1189 +#: ../../library/importlib.rst:1246 msgid "Use :meth:`find_spec` instead." msgstr "" @@ -512,7 +512,7 @@ msgid "" "definition for a loader." msgstr "" -#: ../../library/importlib.rst:385 ../../library/importlib.rst:870 +#: ../../library/importlib.rst:385 ../../library/importlib.rst:910 msgid "" "Loaders that wish to support resource reading should implement a " "``get_resource_reader(fullname)`` method as specified by :class:`importlib." @@ -904,7 +904,7 @@ msgstr "" msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:711 ../../library/importlib.rst:1351 +#: ../../library/importlib.rst:711 ../../library/importlib.rst:1391 msgid "Returns :attr:`path`." msgstr "" @@ -1036,7 +1036,47 @@ msgid "" "directories and opening files." msgstr "" -#: ../../library/importlib.rst:821 +#: ../../library/importlib.rst:820 +msgid "The base name of this object without any parent references." +msgstr "" + +#: ../../library/importlib.rst:824 +msgid "Yield Traversable objects in self." +msgstr "" + +#: ../../library/importlib.rst:828 +msgid "Return True if self is a directory." +msgstr "" + +#: ../../library/importlib.rst:832 +msgid "Return True if self is a file." +msgstr "" + +#: ../../library/importlib.rst:836 ../../library/importlib.rst:840 +msgid "Return Traversable child in self." +msgstr "" + +#: ../../library/importlib.rst:844 +msgid "" +"*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " +"suitable for reading (same as :attr:`pathlib.Path.open`)." +msgstr "" + +#: ../../library/importlib.rst:847 +msgid "" +"When opening as text, accepts encoding parameters such as those accepted by :" +"attr:`io.TextIOWrapper`." +msgstr "" + +#: ../../library/importlib.rst:852 +msgid "Read contents of self as bytes." +msgstr "" + +#: ../../library/importlib.rst:856 +msgid "Read contents of self as text." +msgstr "" + +#: ../../library/importlib.rst:861 msgid "" "An abstract base class for resource readers capable of serving the ``files`` " "interface. Subclasses ResourceReader and provides concrete implementations " @@ -1044,21 +1084,21 @@ msgid "" "TraversableReader also supplies ResourceReader." msgstr "" -#: ../../library/importlib.rst:827 +#: ../../library/importlib.rst:867 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.rst:834 +#: ../../library/importlib.rst:874 msgid ":mod:`importlib.resources` -- Resources" msgstr "" -#: ../../library/importlib.rst:839 +#: ../../library/importlib.rst:879 msgid "**Source code:** :source:`Lib/importlib/resources.py`" msgstr "" -#: ../../library/importlib.rst:845 +#: ../../library/importlib.rst:885 msgid "" "This module leverages Python's import system to provide access to " "*resources* within *packages*. If you can import a package, you can access " @@ -1066,7 +1106,7 @@ msgid "" "binary or text mode." msgstr "" -#: ../../library/importlib.rst:850 +#: ../../library/importlib.rst:890 msgid "" "Resources are roughly akin to files inside directories, though it's " "important to keep in mind that this is just a metaphor. Resources and " @@ -1074,7 +1114,7 @@ msgid "" "file system." msgstr "" -#: ../../library/importlib.rst:856 +#: ../../library/importlib.rst:896 msgid "" "This module provides functionality similar to `pkg_resources `_ `Basic Resource " @@ -1084,7 +1124,7 @@ msgid "" "consistent semantics." msgstr "" -#: ../../library/importlib.rst:864 +#: ../../library/importlib.rst:904 msgid "" "The standalone backport of this module provides more information on `using " "importlib.resources `_." msgstr "" -#: ../../library/importlib.rst:874 +#: ../../library/importlib.rst:914 msgid "The following types are defined." msgstr "" -#: ../../library/importlib.rst:878 +#: ../../library/importlib.rst:918 msgid "" "The ``Package`` type is defined as ``Union[str, ModuleType]``. This means " "that where the function describes accepting a ``Package``, you can pass in " @@ -1104,17 +1144,17 @@ msgid "" "``__spec__.submodule_search_locations`` that is not ``None``." msgstr "" -#: ../../library/importlib.rst:885 +#: ../../library/importlib.rst:925 msgid "" "This type describes the resource names passed into the various functions in " "this package. This is defined as ``Union[str, os.PathLike]``." msgstr "" -#: ../../library/importlib.rst:889 +#: ../../library/importlib.rst:929 msgid "The following functions are available." msgstr "" -#: ../../library/importlib.rst:894 +#: ../../library/importlib.rst:934 msgid "" "Returns an :class:`importlib.resources.abc.Traversable` object representing " "the resource container for the package (think directory) and its resources " @@ -1122,13 +1162,13 @@ msgid "" "subdirectories)." msgstr "" -#: ../../library/importlib.rst:899 ../../library/importlib.rst:1000 +#: ../../library/importlib.rst:939 ../../library/importlib.rst:1040 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements." msgstr "" -#: ../../library/importlib.rst:906 +#: ../../library/importlib.rst:946 msgid "" "Given a :class:`importlib.resources.abc.Traversable` object representing a " "file, typically from :func:`importlib.resources.files`, return a context " @@ -1136,23 +1176,23 @@ msgid "" "a :class:`pathlib.Path` object." msgstr "" -#: ../../library/importlib.rst:911 +#: ../../library/importlib.rst:951 msgid "" "Exiting the context manager cleans up any temporary file created when the " "resource was extracted from e.g. a zip file." msgstr "" -#: ../../library/importlib.rst:914 +#: ../../library/importlib.rst:954 msgid "" "Use ``as_file`` when the Traversable methods (``read_text``, etc) are " "insufficient and an actual file on the file system is required." msgstr "" -#: ../../library/importlib.rst:922 +#: ../../library/importlib.rst:962 msgid "Open for binary reading the *resource* within *package*." msgstr "" -#: ../../library/importlib.rst:924 +#: ../../library/importlib.rst:964 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1161,13 +1201,13 @@ msgid "" "BinaryIO`` instance, a binary I/O stream open for reading." msgstr "" -#: ../../library/importlib.rst:933 +#: ../../library/importlib.rst:973 msgid "" "Open for text reading the *resource* within *package*. By default, the " "resource is opened for reading as UTF-8." msgstr "" -#: ../../library/importlib.rst:936 +#: ../../library/importlib.rst:976 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1176,18 +1216,18 @@ msgid "" "same meaning as with built-in :func:`open`." msgstr "" -#: ../../library/importlib.rst:942 +#: ../../library/importlib.rst:982 msgid "" "This function returns a ``typing.TextIO`` instance, a text I/O stream open " "for reading." msgstr "" -#: ../../library/importlib.rst:948 +#: ../../library/importlib.rst:988 msgid "" "Read and return the contents of the *resource* within *package* as ``bytes``." msgstr "" -#: ../../library/importlib.rst:951 +#: ../../library/importlib.rst:991 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1196,13 +1236,13 @@ msgid "" "contents of the resource as :class:`bytes`." msgstr "" -#: ../../library/importlib.rst:960 +#: ../../library/importlib.rst:1000 msgid "" "Read and return the contents of *resource* within *package* as a ``str``. By " "default, the contents are read as strict UTF-8." msgstr "" -#: ../../library/importlib.rst:963 +#: ../../library/importlib.rst:1003 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1212,20 +1252,20 @@ msgid "" "contents of the resource as :class:`str`." msgstr "" -#: ../../library/importlib.rst:973 +#: ../../library/importlib.rst:1013 msgid "" "Return the path to the *resource* as an actual file system path. This " "function returns a context manager for use in a :keyword:`with` statement. " "The context manager provides a :class:`pathlib.Path` object." msgstr "" -#: ../../library/importlib.rst:977 +#: ../../library/importlib.rst:1017 msgid "" "Exiting the context manager cleans up any temporary file created when the " "resource needs to be extracted from e.g. a zip file." msgstr "" -#: ../../library/importlib.rst:980 +#: ../../library/importlib.rst:1020 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1233,7 +1273,7 @@ msgid "" "resources (i.e. it cannot be a directory)." msgstr "" -#: ../../library/importlib.rst:988 +#: ../../library/importlib.rst:1028 msgid "" "Return ``True`` if there is a resource named *name* in the package, " "otherwise ``False``. Remember that directories are *not* resources! " @@ -1241,66 +1281,66 @@ msgid "" "``Package`` requirements." msgstr "" -#: ../../library/importlib.rst:996 +#: ../../library/importlib.rst:1036 msgid "" "Return an iterable over the named items within the package. The iterable " "returns :class:`str` resources (e.g. files) and non-resources (e.g. " "directories). The iterable does not recurse into subdirectories." msgstr "" -#: ../../library/importlib.rst:1005 +#: ../../library/importlib.rst:1045 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:1010 +#: ../../library/importlib.rst:1050 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "" -#: ../../library/importlib.rst:1014 +#: ../../library/importlib.rst:1054 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:1019 +#: ../../library/importlib.rst:1059 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:1026 +#: ../../library/importlib.rst:1066 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:1031 ../../library/importlib.rst:1041 +#: ../../library/importlib.rst:1071 ../../library/importlib.rst:1081 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:1036 +#: ../../library/importlib.rst:1076 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:1046 +#: ../../library/importlib.rst:1086 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:1051 +#: ../../library/importlib.rst:1091 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:1056 +#: ../../library/importlib.rst:1096 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:1063 +#: ../../library/importlib.rst:1103 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1309,57 +1349,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:1074 +#: ../../library/importlib.rst:1114 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:1079 ../../library/importlib.rst:1093 -#: ../../library/importlib.rst:1106 ../../library/importlib.rst:1121 +#: ../../library/importlib.rst:1119 ../../library/importlib.rst:1133 +#: ../../library/importlib.rst:1146 ../../library/importlib.rst:1161 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:1082 +#: ../../library/importlib.rst:1122 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:1089 +#: ../../library/importlib.rst:1129 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:1096 +#: ../../library/importlib.rst:1136 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:1103 +#: ../../library/importlib.rst:1143 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:1111 +#: ../../library/importlib.rst:1151 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:1118 +#: ../../library/importlib.rst:1158 msgid "" "A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:1126 +#: ../../library/importlib.rst:1166 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1373,47 +1413,47 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:1140 +#: ../../library/importlib.rst:1180 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:1147 +#: ../../library/importlib.rst:1187 msgid "A legacy wrapper around :meth:`find_spec`." msgstr "" -#: ../../library/importlib.rst:1154 +#: ../../library/importlib.rst:1194 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:1159 +#: ../../library/importlib.rst:1199 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:1162 +#: ../../library/importlib.rst:1202 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:1169 +#: ../../library/importlib.rst:1209 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:1172 +#: ../../library/importlib.rst:1212 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:1175 +#: ../../library/importlib.rst:1215 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1421,7 +1461,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:1180 +#: ../../library/importlib.rst:1220 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1434,152 +1474,152 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:1194 +#: ../../library/importlib.rst:1234 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:1198 +#: ../../library/importlib.rst:1238 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1204 +#: ../../library/importlib.rst:1244 msgid "Attempt to find the loader to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1211 +#: ../../library/importlib.rst:1251 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:1215 +#: ../../library/importlib.rst:1255 msgid "" "A class method which returns a closure for use on :attr:`sys.path_hooks`. An " "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" -#: ../../library/importlib.rst:1220 +#: ../../library/importlib.rst:1260 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:1226 +#: ../../library/importlib.rst:1266 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:1234 +#: ../../library/importlib.rst:1274 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:1238 +#: ../../library/importlib.rst:1278 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:1242 +#: ../../library/importlib.rst:1282 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:1246 +#: ../../library/importlib.rst:1286 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1250 +#: ../../library/importlib.rst:1290 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1254 ../../library/importlib.rst:1297 +#: ../../library/importlib.rst:1294 ../../library/importlib.rst:1337 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:1259 ../../library/importlib.rst:1302 +#: ../../library/importlib.rst:1299 ../../library/importlib.rst:1342 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1264 +#: ../../library/importlib.rst:1304 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:1267 +#: ../../library/importlib.rst:1307 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:1276 +#: ../../library/importlib.rst:1316 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1280 +#: ../../library/importlib.rst:1320 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1284 +#: ../../library/importlib.rst:1324 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1288 +#: ../../library/importlib.rst:1328 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1292 +#: ../../library/importlib.rst:1332 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1307 +#: ../../library/importlib.rst:1347 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1310 +#: ../../library/importlib.rst:1350 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:1317 +#: ../../library/importlib.rst:1357 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1321 +#: ../../library/importlib.rst:1361 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1325 +#: ../../library/importlib.rst:1365 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1332 +#: ../../library/importlib.rst:1372 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1338 +#: ../../library/importlib.rst:1378 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1343 +#: ../../library/importlib.rst:1383 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1347 +#: ../../library/importlib.rst:1387 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1358 +#: ../../library/importlib.rst:1398 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's ``__spec__`` attribute. In the " @@ -1592,29 +1632,29 @@ msgid "" "``__spec__.submodule_search_locations``." msgstr "" -#: ../../library/importlib.rst:1372 +#: ../../library/importlib.rst:1412 msgid "(``__name__``)" msgstr "" -#: ../../library/importlib.rst:1374 +#: ../../library/importlib.rst:1414 msgid "A string for the fully-qualified name of the module." msgstr "" -#: ../../library/importlib.rst:1378 +#: ../../library/importlib.rst:1418 msgid "(``__loader__``)" msgstr "" -#: ../../library/importlib.rst:1380 +#: ../../library/importlib.rst:1420 msgid "" "The :term:`Loader ` that should be used when loading the module. :" "term:`Finders ` should always set this." msgstr "" -#: ../../library/importlib.rst:1385 +#: ../../library/importlib.rst:1425 msgid "(``__file__``)" msgstr "" -#: ../../library/importlib.rst:1387 +#: ../../library/importlib.rst:1427 msgid "" "Name of the place from which the module is loaded, e.g. \"builtin\" for " "built-in modules and the filename for modules loaded from source. Normally " @@ -1622,67 +1662,67 @@ msgid "" "indicates it is unspecified (e.g. for namespace packages)." msgstr "" -#: ../../library/importlib.rst:1394 +#: ../../library/importlib.rst:1434 msgid "(``__path__``)" msgstr "" -#: ../../library/importlib.rst:1396 +#: ../../library/importlib.rst:1436 msgid "" "List of strings for where to find submodules, if a package (``None`` " "otherwise)." msgstr "" -#: ../../library/importlib.rst:1401 +#: ../../library/importlib.rst:1441 msgid "" "Container of extra module-specific data for use during loading (or ``None``)." msgstr "" -#: ../../library/importlib.rst:1406 +#: ../../library/importlib.rst:1446 msgid "(``__cached__``)" msgstr "" -#: ../../library/importlib.rst:1408 +#: ../../library/importlib.rst:1448 msgid "String for where the compiled module should be stored (or ``None``)." msgstr "" -#: ../../library/importlib.rst:1412 +#: ../../library/importlib.rst:1452 msgid "(``__package__``)" msgstr "" -#: ../../library/importlib.rst:1414 +#: ../../library/importlib.rst:1454 msgid "" "(Read-only) The fully-qualified name of the package under which the module " "should be loaded as a submodule (or the empty string for top-level modules). " "For packages, it is the same as :attr:`__name__`." msgstr "" -#: ../../library/importlib.rst:1420 +#: ../../library/importlib.rst:1460 msgid "" "Boolean indicating whether or not the module's \"origin\" attribute refers " "to a loadable location." msgstr "" -#: ../../library/importlib.rst:1424 +#: ../../library/importlib.rst:1464 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1430 +#: ../../library/importlib.rst:1470 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "" -#: ../../library/importlib.rst:1434 +#: ../../library/importlib.rst:1474 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1439 +#: ../../library/importlib.rst:1479 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1446 +#: ../../library/importlib.rst:1486 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1692,7 +1732,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1453 +#: ../../library/importlib.rst:1493 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1705,7 +1745,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1463 +#: ../../library/importlib.rst:1503 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1714,18 +1754,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1471 +#: ../../library/importlib.rst:1511 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1475 ../../library/importlib.rst:1491 -#: ../../library/importlib.rst:1640 +#: ../../library/importlib.rst:1515 ../../library/importlib.rst:1531 +#: ../../library/importlib.rst:1680 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1481 +#: ../../library/importlib.rst:1521 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1735,25 +1775,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1496 +#: ../../library/importlib.rst:1536 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1504 +#: ../../library/importlib.rst:1544 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1506 +#: ../../library/importlib.rst:1546 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1511 +#: ../../library/importlib.rst:1551 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1761,13 +1801,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1518 +#: ../../library/importlib.rst:1558 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1525 +#: ../../library/importlib.rst:1565 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :attr:`sys.modules`, then " @@ -1777,30 +1817,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1532 +#: ../../library/importlib.rst:1572 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1535 +#: ../../library/importlib.rst:1575 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1539 +#: ../../library/importlib.rst:1579 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1546 +#: ../../library/importlib.rst:1586 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1549 +#: ../../library/importlib.rst:1589 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1808,14 +1848,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1554 +#: ../../library/importlib.rst:1594 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1562 +#: ../../library/importlib.rst:1602 msgid "" "A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to handle " "selecting the proper module object to load with. The decorated method is " @@ -1825,7 +1865,7 @@ msgid "" "work on static methods because of the assumption of two arguments." msgstr "" -#: ../../library/importlib.rst:1571 +#: ../../library/importlib.rst:1611 msgid "" "The decorated method will take in the **name** of the module to be loaded as " "expected for a :term:`loader`. If the module is not found in :data:`sys." @@ -1835,7 +1875,7 @@ msgid "" "available). These attributes are set unconditionally to support reloading." msgstr "" -#: ../../library/importlib.rst:1579 +#: ../../library/importlib.rst:1619 msgid "" "If an exception is raised by the decorated method and a module was added to :" "data:`sys.modules`, then the module will be removed to prevent a partially " @@ -1843,25 +1883,25 @@ msgid "" "was already in :data:`sys.modules` then it is left alone." msgstr "" -#: ../../library/importlib.rst:1584 +#: ../../library/importlib.rst:1624 msgid "" ":attr:`__loader__` and :attr:`__package__` are automatically set (when " "possible)." msgstr "" -#: ../../library/importlib.rst:1588 +#: ../../library/importlib.rst:1628 msgid "" "Set :attr:`__name__`, :attr:`__loader__` :attr:`__package__` unconditionally " "to support reloading." msgstr "" -#: ../../library/importlib.rst:1592 +#: ../../library/importlib.rst:1632 msgid "" "The import machinery now directly performs all the functionality provided by " "this function." msgstr "" -#: ../../library/importlib.rst:1598 +#: ../../library/importlib.rst:1638 msgid "" "A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to set the :" "attr:`__loader__` attribute on the returned module. If the attribute is " @@ -1870,23 +1910,23 @@ msgid "" "`__loader__` should be set to." msgstr "" -#: ../../library/importlib.rst:1605 +#: ../../library/importlib.rst:1645 msgid "" "Set ``__loader__`` if set to ``None``, as if the attribute does not exist." msgstr "" -#: ../../library/importlib.rst:1609 ../../library/importlib.rst:1618 +#: ../../library/importlib.rst:1649 ../../library/importlib.rst:1658 msgid "The import machinery takes care of this automatically." msgstr "" -#: ../../library/importlib.rst:1614 +#: ../../library/importlib.rst:1654 msgid "" "A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to set the :" "attr:`__package__` attribute on the returned module. If :attr:`__package__` " "is set and has a value other than ``None`` it will not be changed." msgstr "" -#: ../../library/importlib.rst:1623 +#: ../../library/importlib.rst:1663 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1895,7 +1935,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1633 +#: ../../library/importlib.rst:1673 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1903,20 +1943,20 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1645 +#: ../../library/importlib.rst:1685 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1653 +#: ../../library/importlib.rst:1693 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1656 +#: ../../library/importlib.rst:1696 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1929,7 +1969,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1667 +#: ../../library/importlib.rst:1707 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1938,66 +1978,66 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1675 +#: ../../library/importlib.rst:1715 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1682 +#: ../../library/importlib.rst:1722 msgid "" "A static method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" -#: ../../library/importlib.rst:1695 +#: ../../library/importlib.rst:1735 msgid "Examples" msgstr "" -#: ../../library/importlib.rst:1698 +#: ../../library/importlib.rst:1738 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1700 +#: ../../library/importlib.rst:1740 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1709 +#: ../../library/importlib.rst:1749 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1711 +#: ../../library/importlib.rst:1751 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`. ::" msgstr "" -#: ../../library/importlib.rst:1734 +#: ../../library/importlib.rst:1774 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1736 +#: ../../library/importlib.rst:1776 msgid "" "To import a Python source file directly, use the following recipe (Python " "3.5 and newer only)::" msgstr "" -#: ../../library/importlib.rst:1754 +#: ../../library/importlib.rst:1794 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1756 +#: ../../library/importlib.rst:1796 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1778 +#: ../../library/importlib.rst:1818 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1780 +#: ../../library/importlib.rst:1820 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -2011,11 +2051,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1812 +#: ../../library/importlib.rst:1852 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1814 +#: ../../library/importlib.rst:1854 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 0527e6a850..84461bd88e 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-10-29 00:08+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2284,7 +2284,7 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:2133 -#: ../../library/multiprocessing.rst:2692 +#: ../../library/multiprocessing.rst:2693 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." @@ -2840,28 +2840,29 @@ msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " "output to :data:`sys.stderr` using format ``'[%(levelname)s/%(processName)s] " -"%(message)s'``." +"%(message)s'``. You can modify ``levelname`` of the logger by passing a " +"``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2645 +#: ../../library/multiprocessing.rst:2646 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2660 +#: ../../library/multiprocessing.rst:2661 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2664 +#: ../../library/multiprocessing.rst:2665 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2669 +#: ../../library/multiprocessing.rst:2670 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2674 +#: ../../library/multiprocessing.rst:2675 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2869,7 +2870,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2682 +#: ../../library/multiprocessing.rst:2683 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2879,18 +2880,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2689 +#: ../../library/multiprocessing.rst:2690 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2695 +#: ../../library/multiprocessing.rst:2696 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2699 +#: ../../library/multiprocessing.rst:2700 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -2900,7 +2901,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2706 +#: ../../library/multiprocessing.rst:2707 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2909,69 +2910,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2716 +#: ../../library/multiprocessing.rst:2717 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2718 +#: ../../library/multiprocessing.rst:2719 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2723 +#: ../../library/multiprocessing.rst:2724 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2725 +#: ../../library/multiprocessing.rst:2726 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2727 +#: ../../library/multiprocessing.rst:2728 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2729 +#: ../../library/multiprocessing.rst:2730 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2732 +#: ../../library/multiprocessing.rst:2733 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:2736 +#: ../../library/multiprocessing.rst:2737 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2738 +#: ../../library/multiprocessing.rst:2739 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2740 +#: ../../library/multiprocessing.rst:2741 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2742 +#: ../../library/multiprocessing.rst:2743 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2745 +#: ../../library/multiprocessing.rst:2746 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2747 +#: ../../library/multiprocessing.rst:2748 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2749 +#: ../../library/multiprocessing.rst:2750 msgid "" "On Unix when a process finishes but has not been joined it becomes a zombie. " "There should never be very many because each time a new process starts (or :" @@ -2982,11 +2983,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2757 +#: ../../library/multiprocessing.rst:2758 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2759 +#: ../../library/multiprocessing.rst:2760 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -2996,11 +2997,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2767 +#: ../../library/multiprocessing.rst:2768 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2769 +#: ../../library/multiprocessing.rst:2770 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3008,18 +3009,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2775 +#: ../../library/multiprocessing.rst:2776 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:2779 +#: ../../library/multiprocessing.rst:2780 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2781 +#: ../../library/multiprocessing.rst:2782 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -3028,7 +3029,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2787 +#: ../../library/multiprocessing.rst:2788 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -3037,21 +3038,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2793 +#: ../../library/multiprocessing.rst:2794 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2807 +#: ../../library/multiprocessing.rst:2808 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2810 +#: ../../library/multiprocessing.rst:2811 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2812 +#: ../../library/multiprocessing.rst:2813 msgid "" "On Unix using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3059,7 +3060,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2817 +#: ../../library/multiprocessing.rst:2818 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -3068,29 +3069,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2825 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2836 +#: ../../library/multiprocessing.rst:2837 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2848 +#: ../../library/multiprocessing.rst:2849 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2850 +#: ../../library/multiprocessing.rst:2851 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2854 +#: ../../library/multiprocessing.rst:2855 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:2860 +#: ../../library/multiprocessing.rst:2861 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3100,33 +3101,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2867 +#: ../../library/multiprocessing.rst:2868 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2879 +#: ../../library/multiprocessing.rst:2880 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2882 +#: ../../library/multiprocessing.rst:2883 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2884 +#: ../../library/multiprocessing.rst:2885 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2887 +#: ../../library/multiprocessing.rst:2888 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2889 +#: ../../library/multiprocessing.rst:2890 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3134,11 +3135,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2894 +#: ../../library/multiprocessing.rst:2895 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2896 +#: ../../library/multiprocessing.rst:2897 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -3146,66 +3147,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2901 +#: ../../library/multiprocessing.rst:2902 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2904 +#: ../../library/multiprocessing.rst:2905 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2906 +#: ../../library/multiprocessing.rst:2907 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such a starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:2910 +#: ../../library/multiprocessing.rst:2911 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2922 +#: ../../library/multiprocessing.rst:2923 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2936 +#: ../../library/multiprocessing.rst:2937 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:2939 +#: ../../library/multiprocessing.rst:2940 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:2942 +#: ../../library/multiprocessing.rst:2943 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:2949 +#: ../../library/multiprocessing.rst:2950 msgid "Examples" msgstr "" -#: ../../library/multiprocessing.rst:2951 +#: ../../library/multiprocessing.rst:2952 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:2957 +#: ../../library/multiprocessing.rst:2958 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:2963 +#: ../../library/multiprocessing.rst:2964 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" diff --git a/library/os.po b/library/os.po index b3ee1b4b3e..53b207948b 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-10-30 00:08+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-" @@ -266,65 +266,66 @@ msgid "" "Return the filename corresponding to the controlling terminal of the process." msgstr "" -#: ../../library/os.rst:168 ../../library/os.rst:332 ../../library/os.rst:341 -#: ../../library/os.rst:350 ../../library/os.rst:360 ../../library/os.rst:369 -#: ../../library/os.rst:404 ../../library/os.rst:412 ../../library/os.rst:449 -#: ../../library/os.rst:460 ../../library/os.rst:470 ../../library/os.rst:480 -#: ../../library/os.rst:490 ../../library/os.rst:500 ../../library/os.rst:532 -#: ../../library/os.rst:539 ../../library/os.rst:546 ../../library/os.rst:556 -#: ../../library/os.rst:567 ../../library/os.rst:576 ../../library/os.rst:594 -#: ../../library/os.rst:602 ../../library/os.rst:610 ../../library/os.rst:619 -#: ../../library/os.rst:627 ../../library/os.rst:634 ../../library/os.rst:641 -#: ../../library/os.rst:650 ../../library/os.rst:855 ../../library/os.rst:867 -#: ../../library/os.rst:876 ../../library/os.rst:898 ../../library/os.rst:919 -#: ../../library/os.rst:956 ../../library/os.rst:977 ../../library/os.rst:989 -#: ../../library/os.rst:1169 ../../library/os.rst:1184 -#: ../../library/os.rst:1199 ../../library/os.rst:1212 -#: ../../library/os.rst:1281 ../../library/os.rst:1396 -#: ../../library/os.rst:1416 ../../library/os.rst:1428 -#: ../../library/os.rst:1479 ../../library/os.rst:1488 -#: ../../library/os.rst:1496 ../../library/os.rst:1505 -#: ../../library/os.rst:1541 ../../library/os.rst:1789 -#: ../../library/os.rst:1858 ../../library/os.rst:1872 -#: ../../library/os.rst:1885 ../../library/os.rst:1912 -#: ../../library/os.rst:1927 ../../library/os.rst:1940 -#: ../../library/os.rst:2128 ../../library/os.rst:2150 -#: ../../library/os.rst:2194 ../../library/os.rst:2205 -#: ../../library/os.rst:2882 ../../library/os.rst:3036 -#: ../../library/os.rst:3268 ../../library/os.rst:3661 -#: ../../library/os.rst:3669 ../../library/os.rst:3676 -#: ../../library/os.rst:3683 ../../library/os.rst:3690 -#: ../../library/os.rst:3697 ../../library/os.rst:3704 -#: ../../library/os.rst:3711 ../../library/os.rst:3719 -#: ../../library/os.rst:3727 ../../library/os.rst:3734 -#: ../../library/os.rst:3741 ../../library/os.rst:3750 -#: ../../library/os.rst:3758 ../../library/os.rst:3766 -#: ../../library/os.rst:3773 ../../library/os.rst:3780 -#: ../../library/os.rst:3801 ../../library/os.rst:3856 -#: ../../library/os.rst:3863 ../../library/os.rst:3884 -#: ../../library/os.rst:4000 ../../library/os.rst:4048 -#: ../../library/os.rst:4280 ../../library/os.rst:4301 -#: ../../library/os.rst:4312 ../../library/os.rst:4332 -#: ../../library/os.rst:4347 ../../library/os.rst:4402 -#: ../../library/os.rst:4416 ../../library/os.rst:4454 -#: ../../library/os.rst:4470 ../../library/os.rst:4484 -#: ../../library/os.rst:4495 ../../library/os.rst:4507 -#: ../../library/os.rst:4514 ../../library/os.rst:4523 -#: ../../library/os.rst:4532 ../../library/os.rst:4541 -#: ../../library/os.rst:4550 ../../library/os.rst:4696 -#: ../../library/os.rst:4705 ../../library/os.rst:4726 -#: ../../library/os.rst:4736 ../../library/os.rst:4745 +#: ../../library/os.rst:168 ../../library/os.rst:333 ../../library/os.rst:342 +#: ../../library/os.rst:351 ../../library/os.rst:361 ../../library/os.rst:370 +#: ../../library/os.rst:405 ../../library/os.rst:413 ../../library/os.rst:450 +#: ../../library/os.rst:461 ../../library/os.rst:471 ../../library/os.rst:481 +#: ../../library/os.rst:491 ../../library/os.rst:501 ../../library/os.rst:533 +#: ../../library/os.rst:540 ../../library/os.rst:547 ../../library/os.rst:557 +#: ../../library/os.rst:568 ../../library/os.rst:577 ../../library/os.rst:595 +#: ../../library/os.rst:603 ../../library/os.rst:611 ../../library/os.rst:620 +#: ../../library/os.rst:628 ../../library/os.rst:635 ../../library/os.rst:642 +#: ../../library/os.rst:651 ../../library/os.rst:856 ../../library/os.rst:868 +#: ../../library/os.rst:877 ../../library/os.rst:899 ../../library/os.rst:920 +#: ../../library/os.rst:957 ../../library/os.rst:978 ../../library/os.rst:990 +#: ../../library/os.rst:1170 ../../library/os.rst:1185 +#: ../../library/os.rst:1200 ../../library/os.rst:1213 +#: ../../library/os.rst:1282 ../../library/os.rst:1397 +#: ../../library/os.rst:1417 ../../library/os.rst:1429 +#: ../../library/os.rst:1480 ../../library/os.rst:1489 +#: ../../library/os.rst:1497 ../../library/os.rst:1506 +#: ../../library/os.rst:1542 ../../library/os.rst:1790 +#: ../../library/os.rst:1859 ../../library/os.rst:1873 +#: ../../library/os.rst:1886 ../../library/os.rst:1913 +#: ../../library/os.rst:1928 ../../library/os.rst:1941 +#: ../../library/os.rst:2129 ../../library/os.rst:2151 +#: ../../library/os.rst:2195 ../../library/os.rst:2206 +#: ../../library/os.rst:2883 ../../library/os.rst:3037 +#: ../../library/os.rst:3269 ../../library/os.rst:3662 +#: ../../library/os.rst:3670 ../../library/os.rst:3677 +#: ../../library/os.rst:3684 ../../library/os.rst:3691 +#: ../../library/os.rst:3698 ../../library/os.rst:3705 +#: ../../library/os.rst:3712 ../../library/os.rst:3720 +#: ../../library/os.rst:3728 ../../library/os.rst:3735 +#: ../../library/os.rst:3742 ../../library/os.rst:3751 +#: ../../library/os.rst:3759 ../../library/os.rst:3767 +#: ../../library/os.rst:3774 ../../library/os.rst:3781 +#: ../../library/os.rst:3802 ../../library/os.rst:3857 +#: ../../library/os.rst:3864 ../../library/os.rst:3885 +#: ../../library/os.rst:4001 ../../library/os.rst:4049 +#: ../../library/os.rst:4281 ../../library/os.rst:4302 +#: ../../library/os.rst:4313 ../../library/os.rst:4333 +#: ../../library/os.rst:4348 ../../library/os.rst:4403 +#: ../../library/os.rst:4417 ../../library/os.rst:4455 +#: ../../library/os.rst:4471 ../../library/os.rst:4485 +#: ../../library/os.rst:4496 ../../library/os.rst:4508 +#: ../../library/os.rst:4515 ../../library/os.rst:4524 +#: ../../library/os.rst:4533 ../../library/os.rst:4542 +#: ../../library/os.rst:4551 ../../library/os.rst:4697 +#: ../../library/os.rst:4706 ../../library/os.rst:4727 +#: ../../library/os.rst:4737 ../../library/os.rst:4746 msgid ":ref:`Availability `: Unix." msgstr "" #: ../../library/os.rst:173 msgid "" -"A :term:`mapping` object representing the string environment. For example, " -"``environ['HOME']`` is the pathname of your home directory (on some " -"platforms), and is equivalent to ``getenv(\"HOME\")`` in C." +"A :term:`mapping` object where keys and values are strings that represent " +"the process environment. For example, ``environ['HOME']`` is the pathname " +"of your home directory (on some platforms), and is equivalent to " +"``getenv(\"HOME\")`` in C." msgstr "" -#: ../../library/os.rst:177 +#: ../../library/os.rst:178 msgid "" "This mapping is captured the first time the :mod:`os` module is imported, " "typically during Python startup as part of processing :file:`site.py`. " @@ -332,33 +333,33 @@ msgid "" "environ``, except for changes made by modifying ``os.environ`` directly." msgstr "" -#: ../../library/os.rst:182 +#: ../../library/os.rst:183 msgid "" "This mapping may be used to modify the environment as well as query the " "environment. :func:`putenv` will be called automatically when the mapping " "is modified." msgstr "" -#: ../../library/os.rst:186 +#: ../../library/os.rst:187 msgid "" "On Unix, keys and values use :func:`sys.getfilesystemencoding` and " "``'surrogateescape'`` error handler. Use :data:`environb` if you would like " "to use a different encoding." msgstr "" -#: ../../library/os.rst:192 +#: ../../library/os.rst:193 msgid "" "Calling :func:`putenv` directly does not change ``os.environ``, so it's " "better to modify ``os.environ``." msgstr "" -#: ../../library/os.rst:197 +#: ../../library/os.rst:198 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." msgstr "" -#: ../../library/os.rst:201 +#: ../../library/os.rst:202 msgid "" "You can delete items in this mapping to unset environment variables. :func:" "`unsetenv` will be called automatically when an item is deleted from ``os." @@ -366,60 +367,60 @@ msgid "" "called." msgstr "" -#: ../../library/os.rst:206 ../../library/os.rst:222 +#: ../../library/os.rst:207 ../../library/os.rst:223 msgid "" "Updated to support :pep:`584`'s merge (``|``) and update (``|=``) operators." msgstr "" -#: ../../library/os.rst:212 +#: ../../library/os.rst:213 msgid "" -"Bytes version of :data:`environ`: a :term:`mapping` object representing the " -"environment as byte strings. :data:`environ` and :data:`environb` are " -"synchronized (modify :data:`environb` updates :data:`environ`, and vice " -"versa)." +"Bytes version of :data:`environ`: a :term:`mapping` object where both keys " +"and values are :class:`bytes` objects representing the process environment. :" +"data:`environ` and :data:`environb` are synchronized (modifying :data:" +"`environb` updates :data:`environ`, and vice versa)." msgstr "" -#: ../../library/os.rst:217 +#: ../../library/os.rst:218 msgid "" ":data:`environb` is only available if :data:`supports_bytes_environ` is " "``True``." msgstr "" -#: ../../library/os.rst:231 +#: ../../library/os.rst:232 msgid "These functions are described in :ref:`os-file-dir`." msgstr "" -#: ../../library/os.rst:236 +#: ../../library/os.rst:237 msgid "" "Encode :term:`path-like ` *filename* to the :term:" "`filesystem encoding and error handler`; return :class:`bytes` unchanged." msgstr "" -#: ../../library/os.rst:240 +#: ../../library/os.rst:241 msgid ":func:`fsdecode` is the reverse function." msgstr "" -#: ../../library/os.rst:244 ../../library/os.rst:259 +#: ../../library/os.rst:245 ../../library/os.rst:260 msgid "" "Support added to accept objects implementing the :class:`os.PathLike` " "interface." msgstr "" -#: ../../library/os.rst:251 +#: ../../library/os.rst:252 msgid "" "Decode the :term:`path-like ` *filename* from the :term:" "`filesystem encoding and error handler`; return :class:`str` unchanged." msgstr "" -#: ../../library/os.rst:255 +#: ../../library/os.rst:256 msgid ":func:`fsencode` is the reverse function." msgstr "" -#: ../../library/os.rst:266 +#: ../../library/os.rst:267 msgid "Return the file system representation of the path." msgstr "" -#: ../../library/os.rst:268 +#: ../../library/os.rst:269 msgid "" "If :class:`str` or :class:`bytes` is passed in, it is returned unchanged. " "Otherwise :meth:`~os.PathLike.__fspath__` is called and its value is " @@ -427,56 +428,56 @@ msgid "" "other cases, :exc:`TypeError` is raised." msgstr "" -#: ../../library/os.rst:278 +#: ../../library/os.rst:279 msgid "" "An :term:`abstract base class` for objects representing a file system path, " "e.g. :class:`pathlib.PurePath`." msgstr "" -#: ../../library/os.rst:285 +#: ../../library/os.rst:286 msgid "Return the file system path representation of the object." msgstr "" -#: ../../library/os.rst:287 +#: ../../library/os.rst:288 msgid "" "The method should only return a :class:`str` or :class:`bytes` object, with " "the preference being for :class:`str`." msgstr "" -#: ../../library/os.rst:293 +#: ../../library/os.rst:294 msgid "" "Return the value of the environment variable *key* if it exists, or " "*default* if it doesn't. *key*, *default* and the result are str." msgstr "" -#: ../../library/os.rst:296 +#: ../../library/os.rst:297 msgid "" "On Unix, keys and values are decoded with :func:`sys.getfilesystemencoding` " "and ``'surrogateescape'`` error handler. Use :func:`os.getenvb` if you would " "like to use a different encoding." msgstr "" -#: ../../library/os.rst:300 +#: ../../library/os.rst:301 msgid ":ref:`Availability `: most flavors of Unix, Windows." msgstr "" -#: ../../library/os.rst:305 +#: ../../library/os.rst:306 msgid "" "Return the value of the environment variable *key* if it exists, or " "*default* if it doesn't. *key*, *default* and the result are bytes." msgstr "" -#: ../../library/os.rst:308 +#: ../../library/os.rst:309 msgid "" ":func:`getenvb` is only available if :data:`supports_bytes_environ` is " "``True``." msgstr "" -#: ../../library/os.rst:312 +#: ../../library/os.rst:313 msgid ":ref:`Availability `: most flavors of Unix." msgstr "" -#: ../../library/os.rst:318 +#: ../../library/os.rst:319 msgid "" "Returns the list of directories that will be searched for a named " "executable, similar to a shell, when launching a process. *env*, when " @@ -484,33 +485,33 @@ msgid "" "in. By default, when *env* is ``None``, :data:`environ` is used." msgstr "" -#: ../../library/os.rst:329 +#: ../../library/os.rst:330 msgid "" "Return the effective group id of the current process. This corresponds to " "the \"set id\" bit on the file being executed in the current process." msgstr "" -#: ../../library/os.rst:339 +#: ../../library/os.rst:340 msgid "Return the current process's effective user id." msgstr "" -#: ../../library/os.rst:348 +#: ../../library/os.rst:349 msgid "Return the real group id of the current process." msgstr "" -#: ../../library/os.rst:355 +#: ../../library/os.rst:356 msgid "" "Return list of group ids that *user* belongs to. If *group* is not in the " "list, it is included; typically, *group* is specified as the group ID field " "from the password record for *user*." msgstr "" -#: ../../library/os.rst:366 +#: ../../library/os.rst:367 msgid "" "Return list of supplemental group ids associated with the current process." msgstr "" -#: ../../library/os.rst:372 +#: ../../library/os.rst:373 msgid "" "On macOS, :func:`getgroups` behavior differs somewhat from other Unix " "platforms. If the Python interpreter was built with a deployment target of :" @@ -527,7 +528,7 @@ msgid "" "get_config_var`." msgstr "" -#: ../../library/os.rst:389 +#: ../../library/os.rst:390 msgid "" "Return the name of the user logged in on the controlling terminal of the " "process. For most purposes, it is more useful to use :func:`getpass." @@ -536,42 +537,42 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:396 ../../library/os.rst:431 ../../library/os.rst:931 -#: ../../library/os.rst:943 ../../library/os.rst:1145 ../../library/os.rst:1567 -#: ../../library/os.rst:1956 ../../library/os.rst:2228 -#: ../../library/os.rst:3016 ../../library/os.rst:3050 -#: ../../library/os.rst:3628 ../../library/os.rst:4133 -#: ../../library/os.rst:4144 ../../library/os.rst:4238 -#: ../../library/os.rst:4262 +#: ../../library/os.rst:397 ../../library/os.rst:432 ../../library/os.rst:932 +#: ../../library/os.rst:944 ../../library/os.rst:1146 ../../library/os.rst:1568 +#: ../../library/os.rst:1957 ../../library/os.rst:2229 +#: ../../library/os.rst:3017 ../../library/os.rst:3051 +#: ../../library/os.rst:3629 ../../library/os.rst:4134 +#: ../../library/os.rst:4145 ../../library/os.rst:4239 +#: ../../library/os.rst:4263 msgid ":ref:`Availability `: Unix, Windows." msgstr "" -#: ../../library/os.rst:401 +#: ../../library/os.rst:402 msgid "" "Return the process group id of the process with process id *pid*. If *pid* " "is 0, the process group id of the current process is returned." msgstr "" -#: ../../library/os.rst:410 +#: ../../library/os.rst:411 msgid "Return the id of the current process group." msgstr "" -#: ../../library/os.rst:419 +#: ../../library/os.rst:420 msgid "Return the current process id." msgstr "" -#: ../../library/os.rst:426 +#: ../../library/os.rst:427 msgid "" "Return the parent's process id. When the parent process has exited, on Unix " "the id returned is the one of the init process (1), on Windows it is still " "the same id, which may be already reused by another process." msgstr "" -#: ../../library/os.rst:432 +#: ../../library/os.rst:433 msgid "Added support for Windows." msgstr "" -#: ../../library/os.rst:440 +#: ../../library/os.rst:441 msgid "" "Get program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -582,42 +583,42 @@ msgid "" "user ID of the calling process." msgstr "" -#: ../../library/os.rst:457 +#: ../../library/os.rst:458 msgid "" "Parameters for the :func:`getpriority` and :func:`setpriority` functions." msgstr "" -#: ../../library/os.rst:466 +#: ../../library/os.rst:467 msgid "" "Return a tuple (ruid, euid, suid) denoting the current process's real, " "effective, and saved user ids." msgstr "" -#: ../../library/os.rst:476 +#: ../../library/os.rst:477 msgid "" "Return a tuple (rgid, egid, sgid) denoting the current process's real, " "effective, and saved group ids." msgstr "" -#: ../../library/os.rst:488 +#: ../../library/os.rst:489 msgid "Return the current process's real user id." msgstr "" -#: ../../library/os.rst:495 +#: ../../library/os.rst:496 msgid "" "Call the system initgroups() to initialize the group access list with all of " "the groups of which the specified username is a member, plus the specified " "group id." msgstr "" -#: ../../library/os.rst:508 +#: ../../library/os.rst:509 msgid "" "Set the environment variable named *key* to the string *value*. Such " "changes to the environment affect subprocesses started with :func:`os." "system`, :func:`popen` or :func:`fork` and :func:`execv`." msgstr "" -#: ../../library/os.rst:512 +#: ../../library/os.rst:513 msgid "" "Assignments to items in ``os.environ`` are automatically translated into " "corresponding calls to :func:`putenv`; however, calls to :func:`putenv` " @@ -625,35 +626,35 @@ msgid "" "of ``os.environ``." msgstr "" -#: ../../library/os.rst:519 +#: ../../library/os.rst:520 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." msgstr "" -#: ../../library/os.rst:522 +#: ../../library/os.rst:523 msgid "" "Raises an :ref:`auditing event ` ``os.putenv`` with arguments " "``key``, ``value``." msgstr "" -#: ../../library/os.rst:524 +#: ../../library/os.rst:525 msgid "The function is now always available." msgstr "" -#: ../../library/os.rst:530 +#: ../../library/os.rst:531 msgid "Set the current process's effective group id." msgstr "" -#: ../../library/os.rst:537 +#: ../../library/os.rst:538 msgid "Set the current process's effective user id." msgstr "" -#: ../../library/os.rst:544 +#: ../../library/os.rst:545 msgid "Set the current process' group id." msgstr "" -#: ../../library/os.rst:551 +#: ../../library/os.rst:552 msgid "" "Set the list of supplemental group ids associated with the current process " "to *groups*. *groups* must be a sequence, and each element must be an " @@ -661,7 +662,7 @@ msgid "" "the superuser." msgstr "" -#: ../../library/os.rst:557 +#: ../../library/os.rst:558 msgid "" "On macOS, the length of *groups* may not exceed the system-defined maximum " "number of effective group ids, typically 16. See the documentation for :func:" @@ -669,21 +670,21 @@ msgid "" "calling setgroups()." msgstr "" -#: ../../library/os.rst:564 +#: ../../library/os.rst:565 msgid "" "Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on " "which version is implemented (if any). See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:572 +#: ../../library/os.rst:573 msgid "" "Call the system call :c:func:`setpgid` to set the process group id of the " "process with id *pid* to the process group with id *pgrp*. See the Unix " "manual for the semantics." msgstr "" -#: ../../library/os.rst:583 +#: ../../library/os.rst:584 msgid "" "Set program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -696,113 +697,113 @@ msgid "" "scheduling." msgstr "" -#: ../../library/os.rst:600 +#: ../../library/os.rst:601 msgid "Set the current process's real and effective group ids." msgstr "" -#: ../../library/os.rst:607 +#: ../../library/os.rst:608 msgid "Set the current process's real, effective, and saved group ids." msgstr "" -#: ../../library/os.rst:616 +#: ../../library/os.rst:617 msgid "Set the current process's real, effective, and saved user ids." msgstr "" -#: ../../library/os.rst:625 +#: ../../library/os.rst:626 msgid "Set the current process's real and effective user ids." msgstr "" -#: ../../library/os.rst:632 +#: ../../library/os.rst:633 msgid "" "Call the system call :c:func:`getsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:639 +#: ../../library/os.rst:640 msgid "" "Call the system call :c:func:`setsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:648 +#: ../../library/os.rst:649 msgid "Set the current process's user id." msgstr "" -#: ../../library/os.rst:656 +#: ../../library/os.rst:657 msgid "" "Return the error message corresponding to the error code in *code*. On " "platforms where :c:func:`strerror` returns ``NULL`` when given an unknown " "error number, :exc:`ValueError` is raised." msgstr "" -#: ../../library/os.rst:663 +#: ../../library/os.rst:664 msgid "" "``True`` if the native OS type of the environment is bytes (eg. ``False`` on " "Windows)." msgstr "" -#: ../../library/os.rst:671 +#: ../../library/os.rst:672 msgid "Set the current numeric umask and return the previous umask." msgstr "" -#: ../../library/os.rst:680 +#: ../../library/os.rst:681 msgid "" "Returns information identifying the current operating system. The return " "value is an object with five attributes:" msgstr "" -#: ../../library/os.rst:683 +#: ../../library/os.rst:684 msgid ":attr:`sysname` - operating system name" msgstr "" -#: ../../library/os.rst:684 +#: ../../library/os.rst:685 msgid ":attr:`nodename` - name of machine on network (implementation-defined)" msgstr "" -#: ../../library/os.rst:685 +#: ../../library/os.rst:686 msgid ":attr:`release` - operating system release" msgstr "" -#: ../../library/os.rst:686 +#: ../../library/os.rst:687 msgid ":attr:`version` - operating system version" msgstr "" -#: ../../library/os.rst:687 +#: ../../library/os.rst:688 msgid ":attr:`machine` - hardware identifier" msgstr "" -#: ../../library/os.rst:689 +#: ../../library/os.rst:690 msgid "" "For backwards compatibility, this object is also iterable, behaving like a " "five-tuple containing :attr:`sysname`, :attr:`nodename`, :attr:`release`, :" "attr:`version`, and :attr:`machine` in that order." msgstr "" -#: ../../library/os.rst:694 +#: ../../library/os.rst:695 msgid "" "Some systems truncate :attr:`nodename` to 8 characters or to the leading " "component; a better way to get the hostname is :func:`socket.gethostname` " "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:700 +#: ../../library/os.rst:701 msgid ":ref:`Availability `: recent flavors of Unix." msgstr "" -#: ../../library/os.rst:701 ../../library/os.rst:4263 +#: ../../library/os.rst:702 ../../library/os.rst:4264 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." msgstr "" -#: ../../library/os.rst:710 +#: ../../library/os.rst:711 msgid "" "Unset (delete) the environment variable named *key*. Such changes to the " "environment affect subprocesses started with :func:`os.system`, :func:" "`popen` or :func:`fork` and :func:`execv`." msgstr "" -#: ../../library/os.rst:714 +#: ../../library/os.rst:715 msgid "" "Deletion of items in ``os.environ`` is automatically translated into a " "corresponding call to :func:`unsetenv`; however, calls to :func:`unsetenv` " @@ -810,27 +811,27 @@ msgid "" "``os.environ``." msgstr "" -#: ../../library/os.rst:719 +#: ../../library/os.rst:720 msgid "" "Raises an :ref:`auditing event ` ``os.unsetenv`` with argument " "``key``." msgstr "" -#: ../../library/os.rst:721 +#: ../../library/os.rst:722 msgid "The function is now always available and is also available on Windows." msgstr "" -#: ../../library/os.rst:728 +#: ../../library/os.rst:729 msgid "File Object Creation" msgstr "" -#: ../../library/os.rst:730 +#: ../../library/os.rst:731 msgid "" "These functions create new :term:`file objects `. (See also :" "func:`~os.open` for opening file descriptors.)" msgstr "" -#: ../../library/os.rst:736 +#: ../../library/os.rst:737 msgid "" "Return an open file object connected to the file descriptor *fd*. This is " "an alias of the :func:`open` built-in function and accepts the same " @@ -838,16 +839,16 @@ msgid "" "must always be an integer." msgstr "" -#: ../../library/os.rst:745 +#: ../../library/os.rst:746 msgid "File Descriptor Operations" msgstr "" -#: ../../library/os.rst:747 +#: ../../library/os.rst:748 msgid "" "These functions operate on I/O streams referenced using file descriptors." msgstr "" -#: ../../library/os.rst:749 +#: ../../library/os.rst:750 msgid "" "File descriptors are small integers corresponding to a file that has been " "opened by the current process. For example, standard input is usually file " @@ -857,7 +858,7 @@ msgid "" "pipes are also referenced by file descriptors." msgstr "" -#: ../../library/os.rst:756 +#: ../../library/os.rst:757 msgid "" "The :meth:`~io.IOBase.fileno` method can be used to obtain the file " "descriptor associated with a :term:`file object` when required. Note that " @@ -865,11 +866,11 @@ msgid "" "ignoring aspects such as internal buffering of data." msgstr "" -#: ../../library/os.rst:764 +#: ../../library/os.rst:765 msgid "Close file descriptor *fd*." msgstr "" -#: ../../library/os.rst:768 +#: ../../library/os.rst:769 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To close a " @@ -877,13 +878,13 @@ msgid "" "`popen` or :func:`fdopen`, use its :meth:`~io.IOBase.close` method." msgstr "" -#: ../../library/os.rst:776 +#: ../../library/os.rst:777 msgid "" "Close all file descriptors from *fd_low* (inclusive) to *fd_high* " "(exclusive), ignoring errors. Equivalent to (but much faster than)::" msgstr "" -#: ../../library/os.rst:788 +#: ../../library/os.rst:789 msgid "" "Copy *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -893,7 +894,7 @@ msgid "" "attr:`~OSError.errno` set to :data:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:795 ../../library/os.rst:1443 +#: ../../library/os.rst:796 ../../library/os.rst:1444 msgid "" "This copy is done without the additional cost of transferring data from the " "kernel to user space and then back into the kernel. Additionally, some " @@ -901,50 +902,50 @@ msgid "" "files are opened as binary." msgstr "" -#: ../../library/os.rst:800 +#: ../../library/os.rst:801 msgid "" "The return value is the amount of bytes copied. This could be less than the " "amount requested." msgstr "" -#: ../../library/os.rst:804 +#: ../../library/os.rst:805 msgid "" ":ref:`Availability `: Linux kernel >= 4.5 or glibc >= 2.27." msgstr "" -#: ../../library/os.rst:810 +#: ../../library/os.rst:811 msgid "" "Return a string describing the encoding of the device associated with *fd* " "if it is connected to a terminal; else return :const:`None`." msgstr "" -#: ../../library/os.rst:813 +#: ../../library/os.rst:814 msgid "" "On Unix, if the :ref:`Python UTF-8 Mode ` is enabled, return " "``'UTF-8'`` rather than the device encoding." msgstr "" -#: ../../library/os.rst:816 +#: ../../library/os.rst:817 msgid "On Unix, the function now implements the Python UTF-8 Mode." msgstr "" -#: ../../library/os.rst:822 +#: ../../library/os.rst:823 msgid "" "Return a duplicate of file descriptor *fd*. The new file descriptor is :ref:" "`non-inheritable `." msgstr "" -#: ../../library/os.rst:825 +#: ../../library/os.rst:826 msgid "" "On Windows, when duplicating a standard stream (0: stdin, 1: stdout, 2: " "stderr), the new file descriptor is :ref:`inheritable `." msgstr "" -#: ../../library/os.rst:829 ../../library/os.rst:1031 +#: ../../library/os.rst:830 ../../library/os.rst:1032 msgid "The new file descriptor is now non-inheritable." msgstr "" -#: ../../library/os.rst:835 +#: ../../library/os.rst:836 msgid "" "Duplicate file descriptor *fd* to *fd2*, closing the latter first if " "necessary. Return *fd2*. The new file descriptor is :ref:`inheritable " @@ -952,51 +953,51 @@ msgid "" "``False``." msgstr "" -#: ../../library/os.rst:840 +#: ../../library/os.rst:841 msgid "Add the optional *inheritable* parameter." msgstr "" -#: ../../library/os.rst:843 +#: ../../library/os.rst:844 msgid "Return *fd2* on success. Previously, ``None`` was always returned." msgstr "" -#: ../../library/os.rst:849 +#: ../../library/os.rst:850 msgid "" "Change the mode of the file given by *fd* to the numeric *mode*. See the " "docs for :func:`chmod` for possible values of *mode*. As of Python 3.3, " "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:853 ../../library/os.rst:1833 ../../library/os.rst:1924 +#: ../../library/os.rst:854 ../../library/os.rst:1834 ../../library/os.rst:1925 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:860 +#: ../../library/os.rst:861 msgid "" "Change the owner and group id of the file given by *fd* to the numeric *uid* " "and *gid*. To leave one of the ids unchanged, set it to -1. See :func:" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:865 ../../library/os.rst:1855 ../../library/os.rst:1937 +#: ../../library/os.rst:866 ../../library/os.rst:1856 ../../library/os.rst:1938 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:872 +#: ../../library/os.rst:873 msgid "" "Force write of file with filedescriptor *fd* to disk. Does not force update " "of metadata." msgstr "" -#: ../../library/os.rst:878 +#: ../../library/os.rst:879 msgid "This function is not available on MacOS." msgstr "" -#: ../../library/os.rst:883 +#: ../../library/os.rst:884 msgid "" "Return system configuration information relevant to an open file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -1007,7 +1008,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:891 ../../library/os.rst:2185 +#: ../../library/os.rst:892 ../../library/os.rst:2186 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -1015,79 +1016,79 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:896 +#: ../../library/os.rst:897 msgid "As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``." msgstr "" -#: ../../library/os.rst:903 +#: ../../library/os.rst:904 msgid "" "Get the status of the file descriptor *fd*. Return a :class:`stat_result` " "object." msgstr "" -#: ../../library/os.rst:906 +#: ../../library/os.rst:907 msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:910 ../../library/os.rst:2021 +#: ../../library/os.rst:911 ../../library/os.rst:2022 msgid "The :func:`.stat` function." msgstr "" -#: ../../library/os.rst:915 +#: ../../library/os.rst:916 msgid "" "Return information about the filesystem containing the file associated with " "file descriptor *fd*, like :func:`statvfs`. As of Python 3.3, this is " "equivalent to ``os.statvfs(fd)``." msgstr "" -#: ../../library/os.rst:924 +#: ../../library/os.rst:925 msgid "" "Force write of file with filedescriptor *fd* to disk. On Unix, this calls " "the native :c:func:`fsync` function; on Windows, the MS :c:func:`_commit` " "function." msgstr "" -#: ../../library/os.rst:927 +#: ../../library/os.rst:928 msgid "" "If you're starting with a buffered Python :term:`file object` *f*, first do " "``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all " "internal buffers associated with *f* are written to disk." msgstr "" -#: ../../library/os.rst:936 +#: ../../library/os.rst:937 msgid "" "Truncate the file corresponding to file descriptor *fd*, so that it is at " "most *length* bytes in size. As of Python 3.3, this is equivalent to ``os." "truncate(fd, length)``." msgstr "" -#: ../../library/os.rst:940 +#: ../../library/os.rst:941 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``fd``, ``length``." msgstr "" -#: ../../library/os.rst:944 ../../library/os.rst:3053 +#: ../../library/os.rst:945 ../../library/os.rst:3054 msgid "Added support for Windows" msgstr "" -#: ../../library/os.rst:950 +#: ../../library/os.rst:951 msgid "" "Get the blocking mode of the file descriptor: ``False`` if the :data:" "`O_NONBLOCK` flag is set, ``True`` if the flag is cleared." msgstr "" -#: ../../library/os.rst:953 +#: ../../library/os.rst:954 msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" -#: ../../library/os.rst:962 +#: ../../library/os.rst:963 msgid "" "Return ``True`` if the file descriptor *fd* is open and connected to a tty(-" "like) device, else ``False``." msgstr "" -#: ../../library/os.rst:968 +#: ../../library/os.rst:969 msgid "" "Apply, test or remove a POSIX lock on an open file descriptor. *fd* is an " "open file descriptor. *cmd* specifies the command to use - one of :data:" @@ -1095,17 +1096,17 @@ msgid "" "specifies the section of the file to lock." msgstr "" -#: ../../library/os.rst:974 +#: ../../library/os.rst:975 msgid "" "Raises an :ref:`auditing event ` ``os.lockf`` with arguments " "``fd``, ``cmd``, ``len``." msgstr "" -#: ../../library/os.rst:986 +#: ../../library/os.rst:987 msgid "Flags that specify what action :func:`lockf` will take." msgstr "" -#: ../../library/os.rst:995 +#: ../../library/os.rst:996 msgid "" "Set the current position of file descriptor *fd* to position *pos*, modified " "by *how*: :const:`SEEK_SET` or ``0`` to set the position relative to the " @@ -1115,19 +1116,19 @@ msgid "" "beginning." msgstr "" -#: ../../library/os.rst:1006 +#: ../../library/os.rst:1007 msgid "" "Parameters to the :func:`lseek` function. Their values are 0, 1, and 2, " "respectively." msgstr "" -#: ../../library/os.rst:1009 +#: ../../library/os.rst:1010 msgid "" "Some operating systems could support additional values, like :data:`os." "SEEK_HOLE` or :data:`os.SEEK_DATA`." msgstr "" -#: ../../library/os.rst:1016 +#: ../../library/os.rst:1017 msgid "" "Open the file *path* and set various flags according to *flags* and possibly " "its mode according to *mode*. When computing *mode*, the current umask " @@ -1135,7 +1136,7 @@ msgid "" "file. The new file descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:1021 +#: ../../library/os.rst:1022 msgid "" "For a description of the flag and mode values, see the C run-time " "documentation; flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) " @@ -1143,19 +1144,19 @@ msgid "" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" -#: ../../library/os.rst:1026 +#: ../../library/os.rst:1027 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:1029 +#: ../../library/os.rst:1030 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." msgstr "" -#: ../../library/os.rst:1036 +#: ../../library/os.rst:1037 msgid "" "This function is intended for low-level I/O. For normal usage, use the " "built-in function :func:`open`, which returns a :term:`file object` with :" @@ -1163,39 +1164,39 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1041 ../../library/os.rst:2061 -#: ../../library/os.rst:2129 ../../library/os.rst:2151 -#: ../../library/os.rst:2232 ../../library/os.rst:2263 +#: ../../library/os.rst:1042 ../../library/os.rst:2062 +#: ../../library/os.rst:2130 ../../library/os.rst:2152 +#: ../../library/os.rst:2233 ../../library/os.rst:2264 msgid "The *dir_fd* argument." msgstr "" -#: ../../library/os.rst:1044 ../../library/os.rst:1363 -#: ../../library/os.rst:1522 ../../library/os.rst:4384 +#: ../../library/os.rst:1045 ../../library/os.rst:1364 +#: ../../library/os.rst:1523 ../../library/os.rst:4385 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" "exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/os.rst:1049 ../../library/os.rst:1730 -#: ../../library/os.rst:1762 ../../library/os.rst:1793 -#: ../../library/os.rst:1839 ../../library/os.rst:1873 -#: ../../library/os.rst:1913 ../../library/os.rst:1928 -#: ../../library/os.rst:1941 ../../library/os.rst:2000 -#: ../../library/os.rst:2029 ../../library/os.rst:2064 -#: ../../library/os.rst:2105 ../../library/os.rst:2132 -#: ../../library/os.rst:2154 ../../library/os.rst:2195 -#: ../../library/os.rst:2266 ../../library/os.rst:2285 -#: ../../library/os.rst:2371 ../../library/os.rst:2644 -#: ../../library/os.rst:2895 ../../library/os.rst:3056 -#: ../../library/os.rst:3072 ../../library/os.rst:3112 -#: ../../library/os.rst:3210 ../../library/os.rst:3271 -#: ../../library/os.rst:3454 ../../library/os.rst:3633 -#: ../../library/os.rst:4121 +#: ../../library/os.rst:1050 ../../library/os.rst:1731 +#: ../../library/os.rst:1763 ../../library/os.rst:1794 +#: ../../library/os.rst:1840 ../../library/os.rst:1874 +#: ../../library/os.rst:1914 ../../library/os.rst:1929 +#: ../../library/os.rst:1942 ../../library/os.rst:2001 +#: ../../library/os.rst:2030 ../../library/os.rst:2065 +#: ../../library/os.rst:2106 ../../library/os.rst:2133 +#: ../../library/os.rst:2155 ../../library/os.rst:2196 +#: ../../library/os.rst:2267 ../../library/os.rst:2286 +#: ../../library/os.rst:2372 ../../library/os.rst:2645 +#: ../../library/os.rst:2896 ../../library/os.rst:3057 +#: ../../library/os.rst:3073 ../../library/os.rst:3113 +#: ../../library/os.rst:3211 ../../library/os.rst:3272 +#: ../../library/os.rst:3455 ../../library/os.rst:3634 +#: ../../library/os.rst:4122 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1052 +#: ../../library/os.rst:1053 msgid "" "The following constants are options for the *flags* parameter to the :func:" "`~os.open` function. They can be combined using the bitwise OR operator ``|" @@ -1205,45 +1206,45 @@ msgid "" "on Windows." msgstr "" -#: ../../library/os.rst:1067 +#: ../../library/os.rst:1068 msgid "The above constants are available on Unix and Windows." msgstr "" -#: ../../library/os.rst:1078 +#: ../../library/os.rst:1079 msgid "The above constants are only available on Unix." msgstr "" -#: ../../library/os.rst:1080 +#: ../../library/os.rst:1081 msgid "Add :data:`O_CLOEXEC` constant." msgstr "" -#: ../../library/os.rst:1091 +#: ../../library/os.rst:1092 msgid "The above constants are only available on Windows." msgstr "" -#: ../../library/os.rst:1098 +#: ../../library/os.rst:1099 msgid "The above constants are only available on macOS." msgstr "" -#: ../../library/os.rst:1100 +#: ../../library/os.rst:1101 msgid "" "Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` and :data:" "`O_NOFOLLOW_ANY` constants." msgstr "" -#: ../../library/os.rst:1114 +#: ../../library/os.rst:1115 msgid "" "The above constants are extensions and not present if they are not defined " "by the C library." msgstr "" -#: ../../library/os.rst:1117 +#: ../../library/os.rst:1118 msgid "" "Add :data:`O_PATH` on systems that support it. Add :data:`O_TMPFILE`, only " "available on Linux Kernel 3.11 or newer." msgstr "" -#: ../../library/os.rst:1127 +#: ../../library/os.rst:1128 msgid "" "Open a new pseudo-terminal pair. Return a pair of file descriptors " "``(master, slave)`` for the pty and the tty, respectively. The new file " @@ -1251,23 +1252,23 @@ msgid "" "more portable approach, use the :mod:`pty` module." msgstr "" -#: ../../library/os.rst:1133 ../../library/os.rst:1159 -#: ../../library/os.rst:3818 +#: ../../library/os.rst:1134 ../../library/os.rst:1160 +#: ../../library/os.rst:3819 msgid ":ref:`Availability `: some flavors of Unix." msgstr "" -#: ../../library/os.rst:1134 ../../library/os.rst:1146 +#: ../../library/os.rst:1135 ../../library/os.rst:1147 msgid "The new file descriptors are now non-inheritable." msgstr "" -#: ../../library/os.rst:1140 +#: ../../library/os.rst:1141 msgid "" "Create a pipe. Return a pair of file descriptors ``(r, w)`` usable for " "reading and writing, respectively. The new file descriptor is :ref:`non-" "inheritable `." msgstr "" -#: ../../library/os.rst:1152 +#: ../../library/os.rst:1153 msgid "" "Create a pipe with *flags* set atomically. *flags* can be constructed by " "ORing together one or more of these values: :data:`O_NONBLOCK`, :data:" @@ -1275,13 +1276,13 @@ msgid "" "and writing, respectively." msgstr "" -#: ../../library/os.rst:1165 +#: ../../library/os.rst:1166 msgid "" "Ensures that enough disk space is allocated for the file specified by *fd* " "starting from *offset* and continuing for *len* bytes." msgstr "" -#: ../../library/os.rst:1175 +#: ../../library/os.rst:1176 msgid "" "Announces an intention to access data in a specific pattern thus allowing " "the kernel to make optimizations. The advice applies to the region of the " @@ -1292,25 +1293,25 @@ msgid "" "`POSIX_FADV_DONTNEED`." msgstr "" -#: ../../library/os.rst:1195 +#: ../../library/os.rst:1196 msgid "" "Flags that can be used in *advice* in :func:`posix_fadvise` that specify the " "access pattern that is likely to be used." msgstr "" -#: ../../library/os.rst:1205 +#: ../../library/os.rst:1206 msgid "" "Read at most *n* bytes from file descriptor *fd* at a position of *offset*, " "leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1208 ../../library/os.rst:1352 +#: ../../library/os.rst:1209 ../../library/os.rst:1353 msgid "" "Return a bytestring containing the bytes read. If the end of the file " "referred to by *fd* has been reached, an empty bytes object is returned." msgstr "" -#: ../../library/os.rst:1218 +#: ../../library/os.rst:1219 msgid "" "Read from a file descriptor *fd* at a position of *offset* into mutable :" "term:`bytes-like objects ` *buffers*, leaving the file " @@ -1318,89 +1319,89 @@ msgid "" "move on to the next buffer in the sequence to hold the rest of the data." msgstr "" -#: ../../library/os.rst:1223 ../../library/os.rst:1293 +#: ../../library/os.rst:1224 ../../library/os.rst:1294 msgid "" "The flags argument contains a bitwise OR of zero or more of the following " "flags:" msgstr "" -#: ../../library/os.rst:1226 +#: ../../library/os.rst:1227 msgid ":data:`RWF_HIPRI`" msgstr "" -#: ../../library/os.rst:1227 +#: ../../library/os.rst:1228 msgid ":data:`RWF_NOWAIT`" msgstr "" -#: ../../library/os.rst:1229 ../../library/os.rst:1472 +#: ../../library/os.rst:1230 ../../library/os.rst:1473 msgid "" "Return the total number of bytes actually read which can be less than the " "total capacity of all the objects." msgstr "" -#: ../../library/os.rst:1232 ../../library/os.rst:1302 -#: ../../library/os.rst:1475 ../../library/os.rst:1537 +#: ../../library/os.rst:1233 ../../library/os.rst:1303 +#: ../../library/os.rst:1476 ../../library/os.rst:1538 msgid "" "The operating system may set a limit (:func:`sysconf` value " "``'SC_IOV_MAX'``) on the number of buffers that can be used." msgstr "" -#: ../../library/os.rst:1235 +#: ../../library/os.rst:1236 msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:1240 +#: ../../library/os.rst:1241 msgid "" ":ref:`Availability `: Linux 2.6.30 and newer, FreeBSD 6.0 and " "newer, OpenBSD 2.7 and newer, AIX 7.1 and newer. Using flags requires Linux " "4.6 or newer." msgstr "" -#: ../../library/os.rst:1246 +#: ../../library/os.rst:1247 msgid "" "Do not wait for data which is not immediately available. If this flag is " "specified, the system call will return instantly if it would have to read " "data from the backing storage or wait for a lock." msgstr "" -#: ../../library/os.rst:1250 +#: ../../library/os.rst:1251 msgid "" "If some data was successfully read, it will return the number of bytes read. " "If no bytes were read, it will return ``-1`` and set errno to :data:`errno." "EAGAIN`." msgstr "" -#: ../../library/os.rst:1255 +#: ../../library/os.rst:1256 msgid ":ref:`Availability `: Linux 4.14 and newer." msgstr "" -#: ../../library/os.rst:1261 +#: ../../library/os.rst:1262 msgid "" "High priority read/write. Allows block-based filesystems to use polling of " "the device, which provides lower latency, but may use additional resources." msgstr "" -#: ../../library/os.rst:1265 +#: ../../library/os.rst:1266 msgid "" "Currently, on Linux, this feature is usable only on a file descriptor opened " "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1269 +#: ../../library/os.rst:1270 msgid ":ref:`Availability `: Linux 4.6 and newer." msgstr "" -#: ../../library/os.rst:1275 +#: ../../library/os.rst:1276 msgid "" "Write the bytestring in *str* to file descriptor *fd* at position of " "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1278 ../../library/os.rst:1512 +#: ../../library/os.rst:1279 ../../library/os.rst:1513 msgid "Return the number of bytes actually written." msgstr "" -#: ../../library/os.rst:1287 +#: ../../library/os.rst:1288 msgid "" "Write the *buffers* contents to file descriptor *fd* at a offset *offset*, " "leaving the file offset unchanged. *buffers* must be a sequence of :term:" @@ -1409,50 +1410,50 @@ msgid "" "the second, and so on." msgstr "" -#: ../../library/os.rst:1296 +#: ../../library/os.rst:1297 msgid ":data:`RWF_DSYNC`" msgstr "" -#: ../../library/os.rst:1297 +#: ../../library/os.rst:1298 msgid ":data:`RWF_SYNC`" msgstr "" -#: ../../library/os.rst:1298 +#: ../../library/os.rst:1299 msgid ":data:`RWF_APPEND`" msgstr "" -#: ../../library/os.rst:1300 +#: ../../library/os.rst:1301 msgid "Return the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1305 +#: ../../library/os.rst:1306 msgid "Combine the functionality of :func:`os.writev` and :func:`os.pwrite`." msgstr "" -#: ../../library/os.rst:1310 +#: ../../library/os.rst:1311 msgid "" ":ref:`Availability `: Linux 2.6.30 and newer, FreeBSD 6.0 and " "newer, OpenBSD 2.7 and newer, AIX 7.1 and newer. Using flags requires Linux " "4.7 or newer." msgstr "" -#: ../../library/os.rst:1316 +#: ../../library/os.rst:1317 msgid "" "Provide a per-write equivalent of the :data:`O_DSYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1320 ../../library/os.rst:1330 +#: ../../library/os.rst:1321 ../../library/os.rst:1331 msgid ":ref:`Availability `: Linux 4.7 and newer." msgstr "" -#: ../../library/os.rst:1326 +#: ../../library/os.rst:1327 msgid "" "Provide a per-write equivalent of the :data:`O_SYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1336 +#: ../../library/os.rst:1337 msgid "" "Provide a per-write equivalent of the :data:`O_APPEND` :func:`os.open` flag. " "This flag is meaningful only for :func:`os.pwritev`, and its effect applies " @@ -1462,15 +1463,15 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1344 +#: ../../library/os.rst:1345 msgid ":ref:`Availability `: Linux 4.16 and newer." msgstr "" -#: ../../library/os.rst:1350 +#: ../../library/os.rst:1351 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1357 +#: ../../library/os.rst:1358 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To read a \"file " @@ -1479,26 +1480,26 @@ msgid "" "`~file.readline` methods." msgstr "" -#: ../../library/os.rst:1372 +#: ../../library/os.rst:1373 msgid "" "Copy *count* bytes from file descriptor *in_fd* to file descriptor *out_fd* " "starting at *offset*. Return the number of bytes sent. When EOF is reached " "return ``0``." msgstr "" -#: ../../library/os.rst:1376 +#: ../../library/os.rst:1377 msgid "" "The first function notation is supported by all platforms that define :func:" "`sendfile`." msgstr "" -#: ../../library/os.rst:1379 +#: ../../library/os.rst:1380 msgid "" "On Linux, if *offset* is given as ``None``, the bytes are read from the " "current position of *in_fd* and the position of *in_fd* is updated." msgstr "" -#: ../../library/os.rst:1382 +#: ../../library/os.rst:1383 msgid "" "The second case may be used on macOS and FreeBSD where *headers* and " "*trailers* are arbitrary sequences of buffers that are written before and " @@ -1506,51 +1507,51 @@ msgid "" "case." msgstr "" -#: ../../library/os.rst:1386 +#: ../../library/os.rst:1387 msgid "" "On macOS and FreeBSD, a value of ``0`` for *count* specifies to send until " "the end of *in_fd* is reached." msgstr "" -#: ../../library/os.rst:1389 +#: ../../library/os.rst:1390 msgid "" "All platforms support sockets as *out_fd* file descriptor, and some " "platforms allow other types (e.g. regular file, pipe) as well." msgstr "" -#: ../../library/os.rst:1392 +#: ../../library/os.rst:1393 msgid "" "Cross-platform applications should not use *headers*, *trailers* and *flags* " "arguments." msgstr "" -#: ../../library/os.rst:1399 +#: ../../library/os.rst:1400 msgid "" "For a higher-level wrapper of :func:`sendfile`, see :meth:`socket.socket." "sendfile`." msgstr "" -#: ../../library/os.rst:1404 +#: ../../library/os.rst:1405 msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1410 +#: ../../library/os.rst:1411 msgid "" "Set the blocking mode of the specified file descriptor. Set the :data:" "`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." msgstr "" -#: ../../library/os.rst:1413 +#: ../../library/os.rst:1414 msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." msgstr "" -#: ../../library/os.rst:1424 +#: ../../library/os.rst:1425 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1434 +#: ../../library/os.rst:1435 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1562,7 +1563,7 @@ msgid "" "`~OSError.errno` set to :data:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1448 +#: ../../library/os.rst:1449 msgid "" "Upon successful completion, returns the number of bytes spliced to or from " "the pipe. A return value of 0 means end of input. If *src* refers to a pipe, " @@ -1571,12 +1572,12 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1455 +#: ../../library/os.rst:1456 msgid "" ":ref:`Availability `: Linux kernel >= 2.6.17 and glibc >= 2.5" msgstr "" -#: ../../library/os.rst:1467 +#: ../../library/os.rst:1468 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1584,30 +1585,30 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1485 +#: ../../library/os.rst:1486 msgid "" "Return the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`)." msgstr "" -#: ../../library/os.rst:1493 +#: ../../library/os.rst:1494 msgid "" "Set the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`) to *pg*." msgstr "" -#: ../../library/os.rst:1501 +#: ../../library/os.rst:1502 msgid "" "Return a string which specifies the terminal device associated with file " "descriptor *fd*. If *fd* is not associated with a terminal device, an " "exception is raised." msgstr "" -#: ../../library/os.rst:1510 +#: ../../library/os.rst:1511 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1516 +#: ../../library/os.rst:1517 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To write a " @@ -1616,7 +1617,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1530 +#: ../../library/os.rst:1531 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1624,70 +1625,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1535 +#: ../../library/os.rst:1536 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1548 +#: ../../library/os.rst:1549 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1554 +#: ../../library/os.rst:1555 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1557 +#: ../../library/os.rst:1558 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1560 +#: ../../library/os.rst:1561 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1563 +#: ../../library/os.rst:1564 msgid "" ":func:`shutil.get_terminal_size` is the high-level function which should " "normally be used, ``os.get_terminal_size`` is the low-level implementation." msgstr "" -#: ../../library/os.rst:1571 +#: ../../library/os.rst:1572 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1575 +#: ../../library/os.rst:1576 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1579 +#: ../../library/os.rst:1580 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1585 +#: ../../library/os.rst:1586 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1589 +#: ../../library/os.rst:1590 msgid "" "A file descriptor has an \"inheritable\" flag which indicates if the file " "descriptor can be inherited by child processes. Since Python 3.4, file " "descriptors created by Python are non-inheritable by default." msgstr "" -#: ../../library/os.rst:1593 +#: ../../library/os.rst:1594 msgid "" "On UNIX, non-inheritable file descriptors are closed in child processes at " "the execution of a new program, other file descriptors are inherited." msgstr "" -#: ../../library/os.rst:1596 +#: ../../library/os.rst:1597 msgid "" "On Windows, non-inheritable handles and file descriptors are closed in child " "processes, except for standard streams (file descriptors 0, 1 and 2: stdin, " @@ -1698,40 +1699,40 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1606 +#: ../../library/os.rst:1607 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1610 +#: ../../library/os.rst:1611 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1614 +#: ../../library/os.rst:1615 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1616 ../../library/os.rst:1622 -#: ../../library/os.rst:3560 ../../library/os.rst:4156 -#: ../../library/os.rst:4202 +#: ../../library/os.rst:1617 ../../library/os.rst:1623 +#: ../../library/os.rst:3561 ../../library/os.rst:4157 +#: ../../library/os.rst:4203 msgid ":ref:`Availability `: Windows." msgstr "" -#: ../../library/os.rst:1620 +#: ../../library/os.rst:1621 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1628 +#: ../../library/os.rst:1629 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1630 +#: ../../library/os.rst:1631 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1635 +#: ../../library/os.rst:1636 msgid "" "**specifying a file descriptor:** Normally the *path* argument provided to " "functions in the :mod:`os` module must be a string specifying a file path. " @@ -1742,7 +1743,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1643 +#: ../../library/os.rst:1644 msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " @@ -1750,13 +1751,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1648 +#: ../../library/os.rst:1649 msgid "" "If the function also supports *dir_fd* or *follow_symlinks* arguments, it's " "an error to specify one of those when supplying *path* as a file descriptor." msgstr "" -#: ../../library/os.rst:1653 +#: ../../library/os.rst:1654 msgid "" "**paths relative to directory descriptors:** If *dir_fd* is not ``None``, it " "should be a file descriptor referring to a directory, and the path to " @@ -1767,14 +1768,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1660 +#: ../../library/os.rst:1661 msgid "" "You can check whether or not *dir_fd* is supported for a particular function " "on your platform using :data:`os.supports_dir_fd`. If it's unavailable, " "using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1666 +#: ../../library/os.rst:1667 msgid "" "**not following symlinks:** If *follow_symlinks* is ``False``, and the last " "element of the path to operate on is a symbolic link, the function will " @@ -1783,14 +1784,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1672 +#: ../../library/os.rst:1673 msgid "" "You can check whether or not *follow_symlinks* is supported for a particular " "function on your platform using :data:`os.supports_follow_symlinks`. If it's " "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1680 +#: ../../library/os.rst:1681 msgid "" "Use the real uid/gid to test for access to *path*. Note that most " "operations will use the effective uid/gid, therefore this routine can be " @@ -1802,13 +1803,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1689 +#: ../../library/os.rst:1690 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1692 +#: ../../library/os.rst:1693 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -1817,7 +1818,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1700 +#: ../../library/os.rst:1701 msgid "" "Using :func:`access` to check if a user is authorized to e.g. open a file " "before actually doing so using :func:`open` creates a security hole, because " @@ -1826,279 +1827,279 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:1711 +#: ../../library/os.rst:1712 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:1723 +#: ../../library/os.rst:1724 msgid "" "I/O operations may fail even when :func:`access` indicates that they would " "succeed, particularly for operations on network filesystems which may have " "permissions semantics beyond the usual POSIX permission-bit model." msgstr "" -#: ../../library/os.rst:1727 +#: ../../library/os.rst:1728 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "" -#: ../../library/os.rst:1739 +#: ../../library/os.rst:1740 msgid "" "Values to pass as the *mode* parameter of :func:`access` to test the " "existence, readability, writability and executability of *path*, " "respectively." msgstr "" -#: ../../library/os.rst:1748 +#: ../../library/os.rst:1749 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:1750 +#: ../../library/os.rst:1751 msgid "" "This function can support :ref:`specifying a file descriptor `. " "The descriptor must refer to an opened directory, not an open file." msgstr "" -#: ../../library/os.rst:1753 +#: ../../library/os.rst:1754 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:1756 ../../library/os.rst:1883 +#: ../../library/os.rst:1757 ../../library/os.rst:1884 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:1758 +#: ../../library/os.rst:1759 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:1768 +#: ../../library/os.rst:1769 msgid "" "Set the flags of *path* to the numeric *flags*. *flags* may take a " "combination (bitwise OR) of the following values (as defined in the :mod:" "`stat` module):" msgstr "" -#: ../../library/os.rst:1771 +#: ../../library/os.rst:1772 msgid ":data:`stat.UF_NODUMP`" msgstr "" -#: ../../library/os.rst:1772 +#: ../../library/os.rst:1773 msgid ":data:`stat.UF_IMMUTABLE`" msgstr "" -#: ../../library/os.rst:1773 +#: ../../library/os.rst:1774 msgid ":data:`stat.UF_APPEND`" msgstr "" -#: ../../library/os.rst:1774 +#: ../../library/os.rst:1775 msgid ":data:`stat.UF_OPAQUE`" msgstr "" -#: ../../library/os.rst:1775 +#: ../../library/os.rst:1776 msgid ":data:`stat.UF_NOUNLINK`" msgstr "" -#: ../../library/os.rst:1776 +#: ../../library/os.rst:1777 msgid ":data:`stat.UF_COMPRESSED`" msgstr "" -#: ../../library/os.rst:1777 +#: ../../library/os.rst:1778 msgid ":data:`stat.UF_HIDDEN`" msgstr "" -#: ../../library/os.rst:1778 +#: ../../library/os.rst:1779 msgid ":data:`stat.SF_ARCHIVED`" msgstr "" -#: ../../library/os.rst:1779 +#: ../../library/os.rst:1780 msgid ":data:`stat.SF_IMMUTABLE`" msgstr "" -#: ../../library/os.rst:1780 +#: ../../library/os.rst:1781 msgid ":data:`stat.SF_APPEND`" msgstr "" -#: ../../library/os.rst:1781 +#: ../../library/os.rst:1782 msgid ":data:`stat.SF_NOUNLINK`" msgstr "" -#: ../../library/os.rst:1782 +#: ../../library/os.rst:1783 msgid ":data:`stat.SF_SNAPSHOT`" msgstr "" -#: ../../library/os.rst:1784 +#: ../../library/os.rst:1785 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1786 ../../library/os.rst:1909 +#: ../../library/os.rst:1787 ../../library/os.rst:1910 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." msgstr "" -#: ../../library/os.rst:1790 +#: ../../library/os.rst:1791 msgid "The *follow_symlinks* argument." msgstr "" -#: ../../library/os.rst:1799 +#: ../../library/os.rst:1800 msgid "" "Change the mode of *path* to the numeric *mode*. *mode* may take one of the " "following values (as defined in the :mod:`stat` module) or bitwise ORed " "combinations of them:" msgstr "" -#: ../../library/os.rst:1803 +#: ../../library/os.rst:1804 msgid ":data:`stat.S_ISUID`" msgstr "" -#: ../../library/os.rst:1804 +#: ../../library/os.rst:1805 msgid ":data:`stat.S_ISGID`" msgstr "" -#: ../../library/os.rst:1805 +#: ../../library/os.rst:1806 msgid ":data:`stat.S_ENFMT`" msgstr "" -#: ../../library/os.rst:1806 +#: ../../library/os.rst:1807 msgid ":data:`stat.S_ISVTX`" msgstr "" -#: ../../library/os.rst:1807 +#: ../../library/os.rst:1808 msgid ":data:`stat.S_IREAD`" msgstr "" -#: ../../library/os.rst:1808 +#: ../../library/os.rst:1809 msgid ":data:`stat.S_IWRITE`" msgstr "" -#: ../../library/os.rst:1809 +#: ../../library/os.rst:1810 msgid ":data:`stat.S_IEXEC`" msgstr "" -#: ../../library/os.rst:1810 +#: ../../library/os.rst:1811 msgid ":data:`stat.S_IRWXU`" msgstr "" -#: ../../library/os.rst:1811 +#: ../../library/os.rst:1812 msgid ":data:`stat.S_IRUSR`" msgstr "" -#: ../../library/os.rst:1812 +#: ../../library/os.rst:1813 msgid ":data:`stat.S_IWUSR`" msgstr "" -#: ../../library/os.rst:1813 +#: ../../library/os.rst:1814 msgid ":data:`stat.S_IXUSR`" msgstr "" -#: ../../library/os.rst:1814 +#: ../../library/os.rst:1815 msgid ":data:`stat.S_IRWXG`" msgstr "" -#: ../../library/os.rst:1815 +#: ../../library/os.rst:1816 msgid ":data:`stat.S_IRGRP`" msgstr "" -#: ../../library/os.rst:1816 +#: ../../library/os.rst:1817 msgid ":data:`stat.S_IWGRP`" msgstr "" -#: ../../library/os.rst:1817 +#: ../../library/os.rst:1818 msgid ":data:`stat.S_IXGRP`" msgstr "" -#: ../../library/os.rst:1818 +#: ../../library/os.rst:1819 msgid ":data:`stat.S_IRWXO`" msgstr "" -#: ../../library/os.rst:1819 +#: ../../library/os.rst:1820 msgid ":data:`stat.S_IROTH`" msgstr "" -#: ../../library/os.rst:1820 +#: ../../library/os.rst:1821 msgid ":data:`stat.S_IWOTH`" msgstr "" -#: ../../library/os.rst:1821 +#: ../../library/os.rst:1822 msgid ":data:`stat.S_IXOTH`" msgstr "" -#: ../../library/os.rst:1823 ../../library/os.rst:1848 -#: ../../library/os.rst:3102 +#: ../../library/os.rst:1824 ../../library/os.rst:1849 +#: ../../library/os.rst:3103 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " "following symlinks `." msgstr "" -#: ../../library/os.rst:1829 +#: ../../library/os.rst:1830 msgid "" "Although Windows supports :func:`chmod`, you can only set the file's read-" "only flag with it (via the ``stat.S_IWRITE`` and ``stat.S_IREAD`` constants " "or a corresponding integer value). All other bits are ignored." msgstr "" -#: ../../library/os.rst:1835 ../../library/os.rst:1859 +#: ../../library/os.rst:1836 ../../library/os.rst:1860 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:1845 +#: ../../library/os.rst:1846 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. To " "leave one of the ids unchanged, set it to -1." msgstr "" -#: ../../library/os.rst:1852 +#: ../../library/os.rst:1853 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:1863 +#: ../../library/os.rst:1864 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1869 +#: ../../library/os.rst:1870 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:1879 +#: ../../library/os.rst:1880 msgid "" "Change the current working directory to the directory represented by the " "file descriptor *fd*. The descriptor must refer to an opened directory, not " "an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``." msgstr "" -#: ../../library/os.rst:1890 +#: ../../library/os.rst:1891 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:1895 +#: ../../library/os.rst:1896 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:1897 +#: ../../library/os.rst:1898 msgid "" "The function now uses the UTF-8 encoding on Windows, rather than the ANSI " "code page: see :pep:`529` for the rationale. The function is no longer " "deprecated on Windows." msgstr "" -#: ../../library/os.rst:1905 +#: ../../library/os.rst:1906 msgid "" "Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do " "not follow symbolic links. As of Python 3.3, this is equivalent to ``os." "chflags(path, flags, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:1919 +#: ../../library/os.rst:1920 msgid "" "Change the mode of *path* to the numeric *mode*. If path is a symlink, this " "affects the symlink rather than the target. See the docs for :func:`chmod` " @@ -2106,44 +2107,44 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:1933 +#: ../../library/os.rst:1934 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " "This function will not follow symbolic links. As of Python 3.3, this is " "equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:1947 +#: ../../library/os.rst:1948 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:1949 +#: ../../library/os.rst:1950 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `, and :ref:" "`not following symlinks `." msgstr "" -#: ../../library/os.rst:1953 +#: ../../library/os.rst:1954 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: ../../library/os.rst:1957 +#: ../../library/os.rst:1958 msgid "Added Windows support." msgstr "" -#: ../../library/os.rst:1960 +#: ../../library/os.rst:1961 msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:1963 ../../library/os.rst:2315 -#: ../../library/os.rst:2352 ../../library/os.rst:3024 +#: ../../library/os.rst:1964 ../../library/os.rst:2316 +#: ../../library/os.rst:2353 ../../library/os.rst:3025 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:1969 +#: ../../library/os.rst:1970 msgid "" "Return a list containing the names of the entries in the directory given by " "*path*. The list is in arbitrary order, and does not include the special " @@ -2152,7 +2153,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:1975 +#: ../../library/os.rst:1976 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2160,73 +2161,73 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:1980 ../../library/os.rst:2400 +#: ../../library/os.rst:1981 ../../library/os.rst:2401 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:1983 +#: ../../library/os.rst:1984 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:1986 +#: ../../library/os.rst:1987 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:1990 +#: ../../library/os.rst:1991 msgid "" "The :func:`scandir` function returns directory entries along with file " "attribute information, giving better performance for many common use cases." msgstr "" -#: ../../library/os.rst:1994 +#: ../../library/os.rst:1995 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:1997 ../../library/os.rst:2886 +#: ../../library/os.rst:1998 ../../library/os.rst:2887 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2006 +#: ../../library/os.rst:2007 msgid "" "Perform the equivalent of an :c:func:`lstat` system call on the given path. " "Similar to :func:`~os.stat`, but does not follow symbolic links. Return a :" "class:`stat_result` object." msgstr "" -#: ../../library/os.rst:2010 +#: ../../library/os.rst:2011 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2013 +#: ../../library/os.rst:2014 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2016 ../../library/os.rst:2053 -#: ../../library/os.rst:2118 ../../library/os.rst:2146 -#: ../../library/os.rst:2220 +#: ../../library/os.rst:2017 ../../library/os.rst:2054 +#: ../../library/os.rst:2119 ../../library/os.rst:2147 +#: ../../library/os.rst:2221 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2023 ../../library/os.rst:2229 -#: ../../library/os.rst:3017 +#: ../../library/os.rst:2024 ../../library/os.rst:2230 +#: ../../library/os.rst:3018 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2026 +#: ../../library/os.rst:2027 msgid "Added the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:2032 +#: ../../library/os.rst:2033 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2234,15 +2235,15 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2041 +#: ../../library/os.rst:2042 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2043 +#: ../../library/os.rst:2044 msgid "If the directory already exists, :exc:`FileExistsError` is raised." msgstr "" -#: ../../library/os.rst:2047 +#: ../../library/os.rst:2048 msgid "" "On some systems, *mode* is ignored. Where it is used, the current umask " "value is first masked out. If bits other than the last 9 (i.e. the last 3 " @@ -2251,25 +2252,25 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2056 +#: ../../library/os.rst:2057 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:2059 ../../library/os.rst:2093 +#: ../../library/os.rst:2060 ../../library/os.rst:2094 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2074 +#: ../../library/os.rst:2075 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2077 +#: ../../library/os.rst:2078 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2278,27 +2279,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2083 +#: ../../library/os.rst:2084 msgid "" "If *exist_ok* is ``False`` (the default), an :exc:`FileExistsError` is " "raised if the target directory already exists." msgstr "" -#: ../../library/os.rst:2088 +#: ../../library/os.rst:2089 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2091 +#: ../../library/os.rst:2092 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2095 +#: ../../library/os.rst:2096 msgid "The *exist_ok* parameter." msgstr "" -#: ../../library/os.rst:2100 +#: ../../library/os.rst:2101 msgid "" "Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed, :" "func:`makedirs` would still raise an error if *mode* did not match the mode " @@ -2306,19 +2307,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2108 +#: ../../library/os.rst:2109 msgid "" "The *mode* argument no longer affects the file permission bits of newly-" "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2115 +#: ../../library/os.rst:2116 msgid "" "Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The " "current umask value is first masked out from the mode." msgstr "" -#: ../../library/os.rst:2121 +#: ../../library/os.rst:2122 msgid "" "FIFOs are pipes that can be accessed like regular files. FIFOs exist until " "they are deleted (for example with :func:`os.unlink`). Generally, FIFOs are " @@ -2328,7 +2329,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2138 +#: ../../library/os.rst:2139 msgid "" "Create a filesystem node (file, device special file or named pipe) named " "*path*. *mode* specifies both the permissions to use and the type of node to " @@ -2339,23 +2340,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2160 +#: ../../library/os.rst:2161 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:type:`stat`)." msgstr "" -#: ../../library/os.rst:2166 +#: ../../library/os.rst:2167 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:type:`stat`)." msgstr "" -#: ../../library/os.rst:2172 +#: ../../library/os.rst:2173 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2177 +#: ../../library/os.rst:2178 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2366,20 +2367,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2190 ../../library/os.rst:2879 -#: ../../library/os.rst:3045 +#: ../../library/os.rst:2191 ../../library/os.rst:2880 +#: ../../library/os.rst:3046 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2201 +#: ../../library/os.rst:2202 msgid "" "Dictionary mapping names accepted by :func:`pathconf` and :func:`fpathconf` " "to the integer values defined for those names by the host operating system. " "This can be used to determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:2210 +#: ../../library/os.rst:2211 msgid "" "Return a string representing the path to which the symbolic link points. " "The result may be either an absolute or relative pathname; if it is " @@ -2387,7 +2388,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2215 +#: ../../library/os.rst:2216 msgid "" "If the *path* is a string object (directly or indirectly through a :class:" "`PathLike` interface), the result will also be a string object, and the call " @@ -2395,42 +2396,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2223 +#: ../../library/os.rst:2224 msgid "" "When trying to resolve a path that may contain links, use :func:`~os.path." "realpath` to properly handle recursion and platform differences." msgstr "" -#: ../../library/os.rst:2235 +#: ../../library/os.rst:2236 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2238 +#: ../../library/os.rst:2239 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2241 +#: ../../library/os.rst:2242 msgid "" "Added support for directory junctions, and changed to return the " "substitution path (which typically includes ``\\\\?\\`` prefix) rather than " "the optional \"print name\" field that was previously returned." msgstr "" -#: ../../library/os.rst:2248 +#: ../../library/os.rst:2249 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`IsADirectoryError` is raised. Use :func:`rmdir` to remove directories. If " "the file does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2252 ../../library/os.rst:2363 -#: ../../library/os.rst:2999 +#: ../../library/os.rst:2253 ../../library/os.rst:2364 +#: ../../library/os.rst:3000 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2255 +#: ../../library/os.rst:2256 msgid "" "On Windows, attempting to remove a file that is in use causes an exception " "to be raised; on Unix, the directory entry is removed but the storage " @@ -2438,18 +2439,18 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2259 +#: ../../library/os.rst:2260 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2261 ../../library/os.rst:2283 -#: ../../library/os.rst:3067 +#: ../../library/os.rst:2262 ../../library/os.rst:2284 +#: ../../library/os.rst:3068 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2274 +#: ../../library/os.rst:2275 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2461,17 +2462,17 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2291 +#: ../../library/os.rst:2292 msgid "" "Rename the file or directory *src* to *dst*. If *dst* exists, the operation " "will fail with an :exc:`OSError` subclass in a number of cases:" msgstr "" -#: ../../library/os.rst:2294 +#: ../../library/os.rst:2295 msgid "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised." msgstr "" -#: ../../library/os.rst:2296 +#: ../../library/os.rst:2297 msgid "" "On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " @@ -2483,30 +2484,30 @@ msgid "" "atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2305 ../../library/os.rst:2345 +#: ../../library/os.rst:2306 ../../library/os.rst:2346 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -#: ../../library/os.rst:2308 +#: ../../library/os.rst:2309 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2310 ../../library/os.rst:2331 -#: ../../library/os.rst:2348 +#: ../../library/os.rst:2311 ../../library/os.rst:2332 +#: ../../library/os.rst:2349 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: ../../library/os.rst:2312 +#: ../../library/os.rst:2313 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "" -#: ../../library/os.rst:2321 +#: ../../library/os.rst:2322 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2515,17 +2516,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2328 +#: ../../library/os.rst:2329 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -#: ../../library/os.rst:2333 +#: ../../library/os.rst:2334 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2339 +#: ../../library/os.rst:2340 msgid "" "Rename the file or directory *src* to *dst*. If *dst* is a directory, :exc:" "`OSError` will be raised. If *dst* exists and is a file, it will be " @@ -2534,7 +2535,7 @@ msgid "" "will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2358 +#: ../../library/os.rst:2359 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, an :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2542,17 +2543,17 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2366 +#: ../../library/os.rst:2367 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2368 ../../library/os.rst:3069 +#: ../../library/os.rst:2369 ../../library/os.rst:3070 msgid "The *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:2377 +#: ../../library/os.rst:2378 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2562,7 +2563,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2384 +#: ../../library/os.rst:2385 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2574,7 +2575,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2394 +#: ../../library/os.rst:2395 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the type " @@ -2583,30 +2584,30 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2403 +#: ../../library/os.rst:2404 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:2405 +#: ../../library/os.rst:2406 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2410 +#: ../../library/os.rst:2411 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2412 +#: ../../library/os.rst:2413 msgid "" "This is called automatically when the iterator is exhausted or garbage " "collected, or when an error happens during iterating. However it is " "advisable to call it explicitly or use the :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:2419 +#: ../../library/os.rst:2420 msgid "" "The following example shows a simple use of :func:`scandir` to display all " "the files (excluding directories) in the given *path* that don't start with " @@ -2614,7 +2615,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2431 +#: ../../library/os.rst:2432 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -2625,7 +2626,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2443 +#: ../../library/os.rst:2444 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -2633,28 +2634,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2449 +#: ../../library/os.rst:2450 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2451 +#: ../../library/os.rst:2452 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2457 +#: ../../library/os.rst:2458 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2460 +#: ../../library/os.rst:2461 msgid "" ":func:`scandir` will provide as much of this information as possible without " "making additional system calls. When a ``stat()`` or ``lstat()`` system call " "is made, the ``os.DirEntry`` object will cache the result." msgstr "" -#: ../../library/os.rst:2464 +#: ../../library/os.rst:2465 msgid "" "``os.DirEntry`` instances are not intended to be stored in long-lived data " "structures; if you know the file metadata has changed or if a long time has " @@ -2662,7 +2663,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2469 +#: ../../library/os.rst:2470 msgid "" "Because the ``os.DirEntry`` methods can make operating system calls, they " "may also raise :exc:`OSError`. If you need very fine-grained control over " @@ -2670,29 +2671,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2474 +#: ../../library/os.rst:2475 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2477 +#: ../../library/os.rst:2478 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2481 +#: ../../library/os.rst:2482 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2484 +#: ../../library/os.rst:2485 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2490 +#: ../../library/os.rst:2491 msgid "" "The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." "name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " @@ -2702,51 +2703,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2497 +#: ../../library/os.rst:2498 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2503 +#: ../../library/os.rst:2504 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2505 +#: ../../library/os.rst:2506 msgid "" "The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." "path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2509 +#: ../../library/os.rst:2510 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2514 +#: ../../library/os.rst:2515 msgid "" "Return ``True`` if this entry is a directory or a symbolic link pointing to " "a directory; return ``False`` if the entry is or points to any other kind of " "file, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2518 +#: ../../library/os.rst:2519 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "directory (without following symlinks); return ``False`` if the entry is any " "other kind of file or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2522 +#: ../../library/os.rst:2523 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2526 +#: ../../library/os.rst:2527 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, for non-symlinks, neither Windows or Unix require a system " @@ -2756,46 +2757,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2533 ../../library/os.rst:2563 +#: ../../library/os.rst:2534 ../../library/os.rst:2564 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2538 +#: ../../library/os.rst:2539 msgid "" "Return ``True`` if this entry is a file or a symbolic link pointing to a " "file; return ``False`` if the entry is or points to a directory or other non-" "file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2542 +#: ../../library/os.rst:2543 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "file (without following symlinks); return ``False`` if the entry is a " "directory or other non-file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2546 +#: ../../library/os.rst:2547 msgid "" "The result is cached on the ``os.DirEntry`` object. Caching, system calls " "made, and exceptions raised are as per :func:`~os.DirEntry.is_dir`." msgstr "" -#: ../../library/os.rst:2551 +#: ../../library/os.rst:2552 msgid "" "Return ``True`` if this entry is a symbolic link (even if broken); return " "``False`` if the entry points to a directory or any kind of file, or if it " "doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2555 +#: ../../library/os.rst:2556 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "islink` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2558 +#: ../../library/os.rst:2559 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, neither Windows or Unix require a system call, except on " @@ -2803,35 +2804,35 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2568 +#: ../../library/os.rst:2569 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -#: ../../library/os.rst:2572 +#: ../../library/os.rst:2573 msgid "" "On Unix, this method always requires a system call. On Windows, it only " "requires a system call if *follow_symlinks* is ``True`` and the entry is a " "reparse point (for example, a symbolic link or directory junction)." msgstr "" -#: ../../library/os.rst:2577 +#: ../../library/os.rst:2578 msgid "" "On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" "class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" -#: ../../library/os.rst:2581 +#: ../../library/os.rst:2582 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -#: ../../library/os.rst:2585 +#: ../../library/os.rst:2586 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -2839,13 +2840,13 @@ msgid "" "``is_file()``, ``is_symlink()`` and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2593 +#: ../../library/os.rst:2594 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2600 +#: ../../library/os.rst:2601 msgid "" "Get the status of a file or a file descriptor. Perform the equivalent of a :" "c:func:`stat` system call on the given path. *path* may be specified as " @@ -2854,21 +2855,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2606 +#: ../../library/os.rst:2607 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2609 ../../library/os.rst:3433 -#: ../../library/os.rst:3449 ../../library/os.rst:3465 -#: ../../library/os.rst:3485 +#: ../../library/os.rst:2610 ../../library/os.rst:3434 +#: ../../library/os.rst:3450 ../../library/os.rst:3466 +#: ../../library/os.rst:3486 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2612 +#: ../../library/os.rst:2613 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -2882,21 +2883,21 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2625 ../../library/os.rst:3353 +#: ../../library/os.rst:2626 ../../library/os.rst:3354 msgid "Example::" msgstr "" -#: ../../library/os.rst:2638 +#: ../../library/os.rst:2639 msgid ":func:`fstat` and :func:`lstat` functions." msgstr "" -#: ../../library/os.rst:2640 +#: ../../library/os.rst:2641 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2647 +#: ../../library/os.rst:2648 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -2906,100 +2907,100 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2658 +#: ../../library/os.rst:2659 msgid "" "Object whose attributes correspond roughly to the members of the :c:type:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:2662 +#: ../../library/os.rst:2663 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2666 +#: ../../library/os.rst:2667 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2670 +#: ../../library/os.rst:2671 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2673 +#: ../../library/os.rst:2674 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2674 +#: ../../library/os.rst:2675 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:2680 +#: ../../library/os.rst:2681 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:2684 +#: ../../library/os.rst:2685 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:2688 +#: ../../library/os.rst:2689 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:2692 +#: ../../library/os.rst:2693 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:2696 +#: ../../library/os.rst:2697 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" -#: ../../library/os.rst:2700 +#: ../../library/os.rst:2701 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:2704 +#: ../../library/os.rst:2705 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:2708 +#: ../../library/os.rst:2709 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:2712 ../../library/os.rst:2728 +#: ../../library/os.rst:2713 ../../library/os.rst:2729 msgid "Platform dependent:" msgstr "" -#: ../../library/os.rst:2714 ../../library/os.rst:2730 +#: ../../library/os.rst:2715 ../../library/os.rst:2731 msgid "the time of most recent metadata change on Unix," msgstr "" -#: ../../library/os.rst:2715 +#: ../../library/os.rst:2716 msgid "the time of creation on Windows, expressed in seconds." msgstr "" -#: ../../library/os.rst:2719 +#: ../../library/os.rst:2720 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2723 +#: ../../library/os.rst:2724 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:2731 +#: ../../library/os.rst:2732 msgid "" "the time of creation on Windows, expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2736 +#: ../../library/os.rst:2737 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, " "and :attr:`st_ctime` attributes depend on the operating system and the file " @@ -3008,7 +3009,7 @@ msgid "" "only 1-day resolution. See your operating system documentation for details." msgstr "" -#: ../../library/os.rst:2743 +#: ../../library/os.rst:2744 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:" "`st_ctime_ns` are always expressed in nanoseconds, many systems do not " @@ -3019,78 +3020,78 @@ msgid "" "attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns`." msgstr "" -#: ../../library/os.rst:2752 +#: ../../library/os.rst:2753 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:2757 +#: ../../library/os.rst:2758 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: ../../library/os.rst:2762 +#: ../../library/os.rst:2763 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: ../../library/os.rst:2767 +#: ../../library/os.rst:2768 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:2771 +#: ../../library/os.rst:2772 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:2773 +#: ../../library/os.rst:2774 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: ../../library/os.rst:2778 +#: ../../library/os.rst:2779 msgid "File generation number." msgstr "" -#: ../../library/os.rst:2782 +#: ../../library/os.rst:2783 msgid "Time of file creation." msgstr "" -#: ../../library/os.rst:2784 +#: ../../library/os.rst:2785 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2789 +#: ../../library/os.rst:2790 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:2792 +#: ../../library/os.rst:2793 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2796 +#: ../../library/os.rst:2797 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:2800 +#: ../../library/os.rst:2801 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:2804 +#: ../../library/os.rst:2805 msgid "File type." msgstr "" -#: ../../library/os.rst:2806 +#: ../../library/os.rst:2807 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:2810 +#: ../../library/os.rst:2811 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:" @@ -3098,21 +3099,21 @@ msgid "" "mod:`stat` module." msgstr "" -#: ../../library/os.rst:2817 +#: ../../library/os.rst:2818 msgid "" "When :attr:`st_file_attributes` has the ``FILE_ATTRIBUTE_REPARSE_POINT`` " "set, this field contains the tag identifying the type of reparse point. See " "the ``IO_REPARSE_TAG_*`` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:2821 +#: ../../library/os.rst:2822 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:type:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:2825 +#: ../../library/os.rst:2826 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -3124,35 +3125,35 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:2834 +#: ../../library/os.rst:2835 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:2838 +#: ../../library/os.rst:2839 msgid "Added the :attr:`st_file_attributes` member on Windows." msgstr "" -#: ../../library/os.rst:2841 +#: ../../library/os.rst:2842 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:2845 +#: ../../library/os.rst:2846 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:2848 +#: ../../library/os.rst:2849 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "" -#: ../../library/os.rst:2851 +#: ../../library/os.rst:2852 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: ../../library/os.rst:2858 +#: ../../library/os.rst:2859 msgid "" "Perform a :c:func:`statvfs` system call on the given path. The return value " "is an object whose attributes describe the filesystem on the given path, and " @@ -3162,7 +3163,7 @@ msgid "" "`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:2865 +#: ../../library/os.rst:2866 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -3170,7 +3171,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:2870 +#: ../../library/os.rst:2871 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3183,11 +3184,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:2883 +#: ../../library/os.rst:2884 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "" -#: ../../library/os.rst:2889 +#: ../../library/os.rst:2890 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3195,11 +3196,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:2898 +#: ../../library/os.rst:2899 msgid "Added :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:2904 +#: ../../library/os.rst:2905 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3211,7 +3212,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:2914 +#: ../../library/os.rst:2915 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3219,13 +3220,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:2921 +#: ../../library/os.rst:2922 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:2929 +#: ../../library/os.rst:2930 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3234,19 +3235,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:2935 +#: ../../library/os.rst:2936 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:2940 +#: ../../library/os.rst:2941 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:2948 +#: ../../library/os.rst:2949 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3255,7 +3256,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:2955 +#: ../../library/os.rst:2956 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3264,7 +3265,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:2968 +#: ../../library/os.rst:2969 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3277,7 +3278,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:2978 +#: ../../library/os.rst:2979 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3286,11 +3287,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:2991 +#: ../../library/os.rst:2992 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2993 +#: ../../library/os.rst:2994 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -3300,7 +3301,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3004 +#: ../../library/os.rst:3005 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3308,83 +3309,83 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3010 +#: ../../library/os.rst:3011 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3013 +#: ../../library/os.rst:3014 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3020 +#: ../../library/os.rst:3021 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3027 +#: ../../library/os.rst:3028 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3033 +#: ../../library/os.rst:3034 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3042 +#: ../../library/os.rst:3043 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3047 +#: ../../library/os.rst:3048 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." msgstr "" -#: ../../library/os.rst:3062 +#: ../../library/os.rst:3063 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: ../../library/os.rst:3078 +#: ../../library/os.rst:3079 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3080 +#: ../../library/os.rst:3081 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: ../../library/os.rst:3083 +#: ../../library/os.rst:3084 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: ../../library/os.rst:3086 +#: ../../library/os.rst:3087 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: ../../library/os.rst:3089 +#: ../../library/os.rst:3090 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: ../../library/os.rst:3093 +#: ../../library/os.rst:3094 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3095 +#: ../../library/os.rst:3096 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -3394,19 +3395,19 @@ msgid "" "`utime`." msgstr "" -#: ../../library/os.rst:3106 +#: ../../library/os.rst:3107 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3108 +#: ../../library/os.rst:3109 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3122 +#: ../../library/os.rst:3123 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -3414,7 +3415,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3127 +#: ../../library/os.rst:3128 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (excluding ``'.'`` and " @@ -3427,7 +3428,7 @@ msgid "" "file be included is unspecified." msgstr "" -#: ../../library/os.rst:3137 +#: ../../library/os.rst:3138 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3438,7 +3439,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3145 +#: ../../library/os.rst:3146 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3451,7 +3452,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3154 +#: ../../library/os.rst:3155 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3461,66 +3462,66 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3160 +#: ../../library/os.rst:3161 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3166 +#: ../../library/os.rst:3167 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3172 +#: ../../library/os.rst:3173 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3176 ../../library/os.rst:3237 +#: ../../library/os.rst:3177 ../../library/os.rst:3238 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any CVS subdirectory::" msgstr "" -#: ../../library/os.rst:3189 +#: ../../library/os.rst:3190 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3204 +#: ../../library/os.rst:3205 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." msgstr "" -#: ../../library/os.rst:3206 +#: ../../library/os.rst:3207 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3220 +#: ../../library/os.rst:3221 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3223 +#: ../../library/os.rst:3224 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3226 +#: ../../library/os.rst:3227 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -3528,30 +3529,30 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3233 +#: ../../library/os.rst:3234 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3250 +#: ../../library/os.rst:3251 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3265 +#: ../../library/os.rst:3266 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3274 +#: ../../library/os.rst:3275 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3280 +#: ../../library/os.rst:3281 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -3559,7 +3560,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3285 +#: ../../library/os.rst:3286 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -3569,23 +3570,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3293 +#: ../../library/os.rst:3294 msgid "" ":ref:`Availability `: Linux 3.17 or newer with glibc 2.27 or " "newer." msgstr "" -#: ../../library/os.rst:3315 +#: ../../library/os.rst:3316 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3319 +#: ../../library/os.rst:3320 msgid "" ":ref:`Availability `: Linux 3.17 or newer with glibc 2.27 or " "newer. The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3325 +#: ../../library/os.rst:3326 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -3594,7 +3595,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3331 +#: ../../library/os.rst:3332 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be an 32 bit unsigned integer. Please note that the initial value is limited " @@ -3602,91 +3603,91 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3336 +#: ../../library/os.rst:3337 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3339 +#: ../../library/os.rst:3340 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3342 +#: ../../library/os.rst:3343 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3346 +#: ../../library/os.rst:3347 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3349 +#: ../../library/os.rst:3350 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3371 +#: ../../library/os.rst:3372 msgid "" ":ref:`Availability `: Linux 2.6.27 or newer with glibc 2.8 or " "newer." msgstr "" -#: ../../library/os.rst:3376 +#: ../../library/os.rst:3377 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3380 ../../library/os.rst:3389 -#: ../../library/os.rst:3397 ../../library/os.rst:3406 +#: ../../library/os.rst:3381 ../../library/os.rst:3390 +#: ../../library/os.rst:3398 ../../library/os.rst:3407 msgid ":ref:`Availability `: See :func:`eventfd`" msgstr "" -#: ../../library/os.rst:3385 +#: ../../library/os.rst:3386 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3394 +#: ../../library/os.rst:3395 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3402 +#: ../../library/os.rst:3403 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3411 +#: ../../library/os.rst:3412 msgid "" "Provide semaphore-like semantics for reads from a :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3415 +#: ../../library/os.rst:3416 msgid "" ":ref:`Availability `: Linux 2.6.30 or newer with glibc 2.8 or " "newer." msgstr "" -#: ../../library/os.rst:3420 +#: ../../library/os.rst:3421 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3424 +#: ../../library/os.rst:3425 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3428 +#: ../../library/os.rst:3429 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -3694,18 +3695,18 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3436 +#: ../../library/os.rst:3437 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3438 ../../library/os.rst:3470 -#: ../../library/os.rst:3495 +#: ../../library/os.rst:3439 ../../library/os.rst:3471 +#: ../../library/os.rst:3496 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3444 +#: ../../library/os.rst:3445 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -3713,13 +3714,13 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3452 +#: ../../library/os.rst:3453 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:3460 +#: ../../library/os.rst:3461 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -3727,13 +3728,13 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3468 +#: ../../library/os.rst:3469 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3476 +#: ../../library/os.rst:3477 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -3745,45 +3746,45 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3490 +#: ../../library/os.rst:3491 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:3493 +#: ../../library/os.rst:3494 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." msgstr "" -#: ../../library/os.rst:3501 +#: ../../library/os.rst:3502 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3507 +#: ../../library/os.rst:3508 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:3513 +#: ../../library/os.rst:3514 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:3520 +#: ../../library/os.rst:3521 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3522 +#: ../../library/os.rst:3523 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3524 +#: ../../library/os.rst:3525 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -3794,7 +3795,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3535 +#: ../../library/os.rst:3536 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -3803,37 +3804,37 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3544 +#: ../../library/os.rst:3545 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3546 +#: ../../library/os.rst:3547 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through sys.path), and also by :mod:" "`ctypes`." msgstr "" -#: ../../library/os.rst:3550 +#: ../../library/os.rst:3551 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3553 +#: ../../library/os.rst:3554 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3557 +#: ../../library/os.rst:3558 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." msgstr "" -#: ../../library/os.rst:3561 +#: ../../library/os.rst:3562 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -3841,14 +3842,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3568 +#: ../../library/os.rst:3569 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:3583 +#: ../../library/os.rst:3584 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -3856,7 +3857,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3588 +#: ../../library/os.rst:3589 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -3864,7 +3865,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3594 +#: ../../library/os.rst:3595 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -3877,7 +3878,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3603 +#: ../../library/os.rst:3604 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -3890,7 +3891,7 @@ msgid "" "absolute or relative path." msgstr "" -#: ../../library/os.rst:3613 +#: ../../library/os.rst:3614 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -3900,7 +3901,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3620 +#: ../../library/os.rst:3621 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -3909,31 +3910,31 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3625 +#: ../../library/os.rst:3626 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:3629 +#: ../../library/os.rst:3630 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3638 +#: ../../library/os.rst:3639 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:3643 +#: ../../library/os.rst:3644 msgid "" "The standard way to exit is ``sys.exit(n)``. :func:`_exit` should normally " "only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:3646 +#: ../../library/os.rst:3647 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -3941,123 +3942,123 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:3652 +#: ../../library/os.rst:3653 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:3659 +#: ../../library/os.rst:3660 msgid "Exit code that means no error occurred." msgstr "" -#: ../../library/os.rst:3666 +#: ../../library/os.rst:3667 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:3674 +#: ../../library/os.rst:3675 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:3681 +#: ../../library/os.rst:3682 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:3688 +#: ../../library/os.rst:3689 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:3695 +#: ../../library/os.rst:3696 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:3702 +#: ../../library/os.rst:3703 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:3709 +#: ../../library/os.rst:3710 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:3716 +#: ../../library/os.rst:3717 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:3724 +#: ../../library/os.rst:3725 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:3732 +#: ../../library/os.rst:3733 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:3739 +#: ../../library/os.rst:3740 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:3746 +#: ../../library/os.rst:3747 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:3755 +#: ../../library/os.rst:3756 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:3763 +#: ../../library/os.rst:3764 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:3771 +#: ../../library/os.rst:3772 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:3778 +#: ../../library/os.rst:3779 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:3785 +#: ../../library/os.rst:3786 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:3788 +#: ../../library/os.rst:3789 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:3791 +#: ../../library/os.rst:3792 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "" -#: ../../library/os.rst:3793 +#: ../../library/os.rst:3794 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3799 +#: ../../library/os.rst:3800 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:3806 +#: ../../library/os.rst:3807 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -4066,24 +4067,24 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:3812 +#: ../../library/os.rst:3813 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "" -#: ../../library/os.rst:3814 +#: ../../library/os.rst:3815 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3827 +#: ../../library/os.rst:3828 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:3830 +#: ../../library/os.rst:3831 msgid "" "Windows: The :data:`signal.CTRL_C_EVENT` and :data:`signal.CTRL_BREAK_EVENT` " "signals are special signals which can only be sent to console processes " @@ -4093,36 +4094,36 @@ msgid "" "version of :func:`kill` additionally takes process handles to be killed." msgstr "" -#: ../../library/os.rst:3838 +#: ../../library/os.rst:3839 msgid "See also :func:`signal.pthread_kill`." msgstr "" -#: ../../library/os.rst:3840 +#: ../../library/os.rst:3841 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." msgstr "" -#: ../../library/os.rst:3842 +#: ../../library/os.rst:3843 msgid "Windows support." msgstr "" -#: ../../library/os.rst:3852 +#: ../../library/os.rst:3853 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:3854 +#: ../../library/os.rst:3855 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." msgstr "" -#: ../../library/os.rst:3861 +#: ../../library/os.rst:3862 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:3868 +#: ../../library/os.rst:3869 msgid "" "Return a file descriptor referring to the process *pid*. This descriptor " "can be used to perform process management without races and signals. The " @@ -4130,21 +4131,21 @@ msgid "" "currently defined." msgstr "" -#: ../../library/os.rst:3873 +#: ../../library/os.rst:3874 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "" -#: ../../library/os.rst:3875 +#: ../../library/os.rst:3876 msgid ":ref:`Availability `: Linux 5.3+" msgstr "" -#: ../../library/os.rst:3881 +#: ../../library/os.rst:3882 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:3889 +#: ../../library/os.rst:3890 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4154,7 +4155,7 @@ msgid "" "bytes." msgstr "" -#: ../../library/os.rst:3896 +#: ../../library/os.rst:3897 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4166,43 +4167,43 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:3906 +#: ../../library/os.rst:3907 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:3911 +#: ../../library/os.rst:3912 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:3920 +#: ../../library/os.rst:3921 msgid "Wraps the :c:func:`posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:3922 +#: ../../library/os.rst:3923 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:3924 +#: ../../library/os.rst:3925 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3927 +#: ../../library/os.rst:3928 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:3931 +#: ../../library/os.rst:3932 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4211,31 +4212,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:3939 +#: ../../library/os.rst:3940 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "" -#: ../../library/os.rst:3941 +#: ../../library/os.rst:3942 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:3945 +#: ../../library/os.rst:3946 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "" -#: ../../library/os.rst:3947 +#: ../../library/os.rst:3948 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:3951 +#: ../../library/os.rst:3952 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "" -#: ../../library/os.rst:3953 +#: ../../library/os.rst:3954 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:3955 +#: ../../library/os.rst:3956 msgid "" "These tuples correspond to the C library :c:func:" "`posix_spawn_file_actions_addopen`, :c:func:" @@ -4244,7 +4245,7 @@ msgid "" "`posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:3961 +#: ../../library/os.rst:3962 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4253,7 +4254,7 @@ msgid "" "corresponds to the C library :c:data:`POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:3967 +#: ../../library/os.rst:3968 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4264,7 +4265,7 @@ msgid "" "library :c:data:`POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:3975 +#: ../../library/os.rst:3976 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "`posix_spawn`. *setsid* requires :c:data:`POSIX_SPAWN_SETSID` or :c:data:" @@ -4272,7 +4273,7 @@ msgid "" "raised." msgstr "" -#: ../../library/os.rst:3980 +#: ../../library/os.rst:3981 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4280,14 +4281,14 @@ msgid "" "`POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:3985 +#: ../../library/os.rst:3986 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:data:" "`POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:3989 +#: ../../library/os.rst:3990 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4297,79 +4298,79 @@ msgid "" "`POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:3996 ../../library/os.rst:4012 +#: ../../library/os.rst:3997 ../../library/os.rst:4013 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." msgstr "" -#: ../../library/os.rst:4006 +#: ../../library/os.rst:4007 msgid "Wraps the :c:func:`posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4008 +#: ../../library/os.rst:4009 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4016 +#: ../../library/os.rst:4017 msgid "" ":ref:`Availability `: See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4022 +#: ../../library/os.rst:4023 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4027 +#: ../../library/os.rst:4028 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4028 +#: ../../library/os.rst:4029 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4030 +#: ../../library/os.rst:4031 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4032 +#: ../../library/os.rst:4033 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4036 +#: ../../library/os.rst:4037 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4041 +#: ../../library/os.rst:4042 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4045 +#: ../../library/os.rst:4046 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4061 +#: ../../library/os.rst:4062 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4063 +#: ../../library/os.rst:4064 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4377,7 +4378,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4068 +#: ../../library/os.rst:4069 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4386,13 +4387,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4074 +#: ../../library/os.rst:4075 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4077 +#: ../../library/os.rst:4078 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4404,7 +4405,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4086 +#: ../../library/os.rst:4087 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4417,7 +4418,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4096 +#: ../../library/os.rst:4097 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4429,19 +4430,19 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4105 +#: ../../library/os.rst:4106 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4114 +#: ../../library/os.rst:4115 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:4120 +#: ../../library/os.rst:4121 msgid "" ":ref:`Availability `: Unix, Windows. :func:`spawnlp`, :func:" "`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are not available on " @@ -4449,7 +4450,7 @@ msgid "" "Windows; we advise you to use the :mod:`subprocess` module instead." msgstr "" -#: ../../library/os.rst:4128 +#: ../../library/os.rst:4129 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:`spawn" @@ -4457,7 +4458,7 @@ msgid "" "the process id as the return value." msgstr "" -#: ../../library/os.rst:4138 +#: ../../library/os.rst:4139 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -4466,7 +4467,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4150 +#: ../../library/os.rst:4151 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -4476,11 +4477,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4161 +#: ../../library/os.rst:4162 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4163 +#: ../../library/os.rst:4164 msgid "" "When *operation* is not specified or ``'open'``, this acts like double-" "clicking the file in Windows Explorer, or giving the file name as an " @@ -4489,7 +4490,7 @@ msgid "" "associated." msgstr "" -#: ../../library/os.rst:4168 +#: ../../library/os.rst:4169 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -4497,28 +4498,28 @@ msgid "" "``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4173 +#: ../../library/os.rst:4174 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4177 +#: ../../library/os.rst:4178 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4181 +#: ../../library/os.rst:4182 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`ShellExecute` function." msgstr "" -#: ../../library/os.rst:4185 +#: ../../library/os.rst:4186 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -4529,32 +4530,32 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4193 +#: ../../library/os.rst:4194 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:4197 +#: ../../library/os.rst:4198 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." msgstr "" -#: ../../library/os.rst:4199 +#: ../../library/os.rst:4200 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." msgstr "" -#: ../../library/os.rst:4203 +#: ../../library/os.rst:4204 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4210 +#: ../../library/os.rst:4211 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -4565,13 +4566,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4218 +#: ../../library/os.rst:4219 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4221 +#: ../../library/os.rst:4222 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -4580,7 +4581,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4227 +#: ../../library/os.rst:4228 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -4588,53 +4589,53 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4232 +#: ../../library/os.rst:4233 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:4236 +#: ../../library/os.rst:4237 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" -#: ../../library/os.rst:4243 +#: ../../library/os.rst:4244 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4246 +#: ../../library/os.rst:4247 msgid ":attr:`user` - user time" msgstr "" -#: ../../library/os.rst:4247 +#: ../../library/os.rst:4248 msgid ":attr:`system` - system time" msgstr "" -#: ../../library/os.rst:4248 +#: ../../library/os.rst:4249 msgid ":attr:`children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4249 +#: ../../library/os.rst:4250 msgid ":attr:`children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4250 +#: ../../library/os.rst:4251 msgid ":attr:`elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4252 +#: ../../library/os.rst:4253 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`user`, :attr:`system`, :attr:`children_user`, :attr:" "`children_system`, and :attr:`elapsed` in that order." msgstr "" -#: ../../library/os.rst:4256 +#: ../../library/os.rst:4257 msgid "" "See the Unix manual page :manpage:`times(2)` and :manpage:`times(3)` manual " "page on Unix or `the GetProcessTimes MSDN `: Linux 5.4+" msgstr "" -#: ../../library/os.rst:4328 +#: ../../library/os.rst:4329 msgid "" "Flags that can be used in *options* in :func:`waitid` that specify what " "child signal to wait for." msgstr "" -#: ../../library/os.rst:4343 +#: ../../library/os.rst:4344 msgid "" "These are the possible values for :attr:`si_code` in the result returned by :" "func:`waitid`." msgstr "" -#: ../../library/os.rst:4350 +#: ../../library/os.rst:4351 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4356 +#: ../../library/os.rst:4357 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4358 +#: ../../library/os.rst:4359 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -4722,7 +4723,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4363 +#: ../../library/os.rst:4364 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -4732,13 +4733,13 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4370 +#: ../../library/os.rst:4371 msgid "" "An :exc:`OSError` is raised with the value of errno when the syscall returns " "-1." msgstr "" -#: ../../library/os.rst:4373 +#: ../../library/os.rst:4374 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -4750,7 +4751,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4392 +#: ../../library/os.rst:4393 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -4759,13 +4760,13 @@ msgid "" "argument is the same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4399 ../../library/os.rst:4413 +#: ../../library/os.rst:4400 ../../library/os.rst:4414 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4407 +#: ../../library/os.rst:4408 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -4774,22 +4775,22 @@ msgid "" "the same as those provided to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4421 +#: ../../library/os.rst:4422 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4423 +#: ../../library/os.rst:4424 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4425 +#: ../../library/os.rst:4426 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4428 +#: ../../library/os.rst:4429 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -4797,15 +4798,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4432 +#: ../../library/os.rst:4433 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4434 +#: ../../library/os.rst:4435 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4436 +#: ../../library/os.rst:4437 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -4813,240 +4814,240 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4443 +#: ../../library/os.rst:4444 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4451 +#: ../../library/os.rst:4452 msgid "" "The option for :func:`waitpid` to return immediately if no child process " "status is available immediately. The function returns ``(0, 0)`` in this " "case." msgstr "" -#: ../../library/os.rst:4459 +#: ../../library/os.rst:4460 msgid "" "This option causes child processes to be reported if they have been " "continued from a job control stop since their status was last reported." msgstr "" -#: ../../library/os.rst:4462 +#: ../../library/os.rst:4463 msgid ":ref:`Availability `: some Unix systems." msgstr "" -#: ../../library/os.rst:4467 +#: ../../library/os.rst:4468 msgid "" "This option causes child processes to be reported if they have been stopped " "but their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4473 +#: ../../library/os.rst:4474 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4479 +#: ../../library/os.rst:4480 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4482 ../../library/os.rst:4548 +#: ../../library/os.rst:4483 ../../library/os.rst:4549 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4489 +#: ../../library/os.rst:4490 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :data:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4493 +#: ../../library/os.rst:4494 msgid "See :data:`WCONTINUED` option." msgstr "" -#: ../../library/os.rst:4500 +#: ../../library/os.rst:4501 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4503 +#: ../../library/os.rst:4504 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:4511 +#: ../../library/os.rst:4512 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4519 +#: ../../library/os.rst:4520 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4528 +#: ../../library/os.rst:4529 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4530 +#: ../../library/os.rst:4531 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4537 +#: ../../library/os.rst:4538 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4539 +#: ../../library/os.rst:4540 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4546 +#: ../../library/os.rst:4547 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:4554 +#: ../../library/os.rst:4555 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:4556 +#: ../../library/os.rst:4557 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:4562 +#: ../../library/os.rst:4563 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:4567 +#: ../../library/os.rst:4568 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:4571 +#: ../../library/os.rst:4572 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:4576 +#: ../../library/os.rst:4577 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:4580 +#: ../../library/os.rst:4581 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:4584 +#: ../../library/os.rst:4585 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:4588 +#: ../../library/os.rst:4589 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:4592 +#: ../../library/os.rst:4593 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:4599 +#: ../../library/os.rst:4600 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:4603 +#: ../../library/os.rst:4604 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:4607 +#: ../../library/os.rst:4608 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:4612 +#: ../../library/os.rst:4613 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4618 +#: ../../library/os.rst:4619 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4624 +#: ../../library/os.rst:4625 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4631 +#: ../../library/os.rst:4632 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:4638 +#: ../../library/os.rst:4639 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4644 +#: ../../library/os.rst:4645 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:4650 +#: ../../library/os.rst:4651 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:4656 +#: ../../library/os.rst:4657 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:4661 +#: ../../library/os.rst:4662 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:4668 +#: ../../library/os.rst:4669 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:4675 +#: ../../library/os.rst:4676 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:4680 +#: ../../library/os.rst:4681 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5057,13 +5058,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:4688 +#: ../../library/os.rst:4689 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:4691 +#: ../../library/os.rst:4692 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5071,33 +5072,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:4701 +#: ../../library/os.rst:4702 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:4710 +#: ../../library/os.rst:4711 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:4712 +#: ../../library/os.rst:4713 msgid "" "This number is not equivalent to the number of CPUs the current process can " "use. The number of usable CPUs can be obtained with ``len(os." "sched_getaffinity(0))``" msgstr "" -#: ../../library/os.rst:4722 +#: ../../library/os.rst:4723 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:4731 +#: ../../library/os.rst:4732 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5106,40 +5107,40 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:4741 +#: ../../library/os.rst:4742 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:4747 +#: ../../library/os.rst:4748 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:4750 +#: ../../library/os.rst:4751 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:4756 +#: ../../library/os.rst:4757 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:4764 +#: ../../library/os.rst:4765 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:4773 +#: ../../library/os.rst:4774 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5148,7 +5149,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4783 +#: ../../library/os.rst:4784 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5156,27 +5157,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4792 +#: ../../library/os.rst:4793 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4800 +#: ../../library/os.rst:4801 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4807 +#: ../../library/os.rst:4808 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:`spawn" "\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. Also " "available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4814 +#: ../../library/os.rst:4815 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5185,36 +5186,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:4823 +#: ../../library/os.rst:4824 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4834 +#: ../../library/os.rst:4835 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:4842 +#: ../../library/os.rst:4843 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:4847 +#: ../../library/os.rst:4848 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:4850 +#: ../../library/os.rst:4851 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:4853 +#: ../../library/os.rst:4854 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5222,35 +5223,35 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:4858 +#: ../../library/os.rst:4859 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:data:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:4862 +#: ../../library/os.rst:4863 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:4866 +#: ../../library/os.rst:4867 msgid ":ref:`Availability `: Linux 3.17 and newer." msgstr "" -#: ../../library/os.rst:4871 +#: ../../library/os.rst:4872 msgid "Return a string of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:4873 +#: ../../library/os.rst:4874 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:4877 +#: ../../library/os.rst:4878 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5260,57 +5261,57 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:4884 +#: ../../library/os.rst:4885 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:4888 +#: ../../library/os.rst:4889 msgid "On Windows, it will use ``CryptGenRandom()``." msgstr "" -#: ../../library/os.rst:4891 +#: ../../library/os.rst:4892 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:4895 +#: ../../library/os.rst:4896 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:4899 +#: ../../library/os.rst:4900 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:4903 +#: ../../library/os.rst:4904 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:4911 +#: ../../library/os.rst:4912 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:4915 +#: ../../library/os.rst:4916 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:4922 +#: ../../library/os.rst:4923 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." diff --git a/library/sqlite3.po b/library/sqlite3.po index 388b7a8868..e9914dc503 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-10-30 00:08+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -135,32 +135,68 @@ msgstr "" #: ../../library/sqlite3.rst:122 msgid "" +"String constant stating the supported DB-API level. Required by the DB-API. " +"Hard-coded to ``\"2.0\"``." +msgstr "" + +#: ../../library/sqlite3.rst:127 +msgid "" +"String constant stating the type of parameter marker formatting expected by " +"the :mod:`sqlite3` module. Required by the DB-API. Hard-coded to ``\"qmark" +"\"``." +msgstr "" + +#: ../../library/sqlite3.rst:133 +msgid "" +"The :mod:`sqlite3` module supports both ``qmark`` and ``numeric`` DB-API " +"parameter styles, because that is what the underlying SQLite library " +"supports. However, the DB-API does not allow multiple values for the " +"``paramstyle`` attribute." +msgstr "" + +#: ../../library/sqlite3.rst:140 +msgid "" "The version number of this module, as a string. This is not the version of " "the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:128 +#: ../../library/sqlite3.rst:146 msgid "" "The version number of this module, as a tuple of integers. This is not the " "version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:134 +#: ../../library/sqlite3.rst:152 msgid "The version number of the run-time SQLite library, as a string." msgstr "" -#: ../../library/sqlite3.rst:139 +#: ../../library/sqlite3.rst:157 msgid "" "The version number of the run-time SQLite library, as a tuple of integers." msgstr "" -#: ../../library/sqlite3.rst:144 ../../library/sqlite3.rst:157 +#: ../../library/sqlite3.rst:162 +msgid "" +"Integer constant required by the DB-API, stating the level of thread safety " +"the :mod:`sqlite3` module supports. Currently hard-coded to ``1``, meaning *" +"\"Threads may share the module, but not connections.\"* However, this may " +"not always be true. You can check the underlying SQLite library's compile-" +"time threaded mode using the following query::" +msgstr "" + +#: ../../library/sqlite3.rst:175 +msgid "" +"Note that the `SQLITE_THREADSAFE levels `_ do not match the DB-API 2.0 ``threadsafety`` levels." +msgstr "" + +#: ../../library/sqlite3.rst:182 ../../library/sqlite3.rst:195 msgid "" "This constant is meant to be used with the *detect_types* parameter of the :" "func:`connect` function." msgstr "" -#: ../../library/sqlite3.rst:147 +#: ../../library/sqlite3.rst:185 msgid "" "Setting it makes the :mod:`sqlite3` module parse the declared type for each " "column it returns. It will parse out the first word of the declared type, " @@ -170,7 +206,7 @@ msgid "" "registered for that type there." msgstr "" -#: ../../library/sqlite3.rst:160 +#: ../../library/sqlite3.rst:198 msgid "" "Setting this makes the SQLite interface parse the column name for each " "column it returns. It will look for a string formed [mytype] in there, and " @@ -183,13 +219,13 @@ msgid "" "preceding space: the column name would simply be \"Expiration date\"." msgstr "" -#: ../../library/sqlite3.rst:173 +#: ../../library/sqlite3.rst:211 msgid "" "Opens a connection to the SQLite database file *database*. By default " "returns a :class:`Connection` object, unless a custom *factory* is given." msgstr "" -#: ../../library/sqlite3.rst:176 +#: ../../library/sqlite3.rst:214 msgid "" "*database* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the database file to be " @@ -197,7 +233,7 @@ msgid "" "database that resides in RAM instead of on disk." msgstr "" -#: ../../library/sqlite3.rst:181 +#: ../../library/sqlite3.rst:219 msgid "" "When a database is accessed by multiple connections, and one of the " "processes modifies the database, the SQLite database is locked until that " @@ -206,13 +242,13 @@ msgid "" "The default for the timeout parameter is 5.0 (five seconds)." msgstr "" -#: ../../library/sqlite3.rst:187 +#: ../../library/sqlite3.rst:225 msgid "" "For the *isolation_level* parameter, please see the :attr:`~Connection." "isolation_level` property of :class:`Connection` objects." msgstr "" -#: ../../library/sqlite3.rst:190 +#: ../../library/sqlite3.rst:228 msgid "" "SQLite natively supports only the types TEXT, INTEGER, REAL, BLOB and NULL. " "If you want to use other types you must add support for them yourself. The " @@ -221,7 +257,7 @@ msgid "" "that." msgstr "" -#: ../../library/sqlite3.rst:195 +#: ../../library/sqlite3.rst:233 msgid "" "*detect_types* defaults to 0 (i. e. off, no type detection), you can set it " "to any combination of :const:`PARSE_DECLTYPES` and :const:`PARSE_COLNAMES` " @@ -230,7 +266,7 @@ msgid "" "parameter is set. In such case, the returned type is :class:`str`." msgstr "" -#: ../../library/sqlite3.rst:201 +#: ../../library/sqlite3.rst:239 msgid "" "By default, *check_same_thread* is :const:`True` and only the creating " "thread may use the connection. If set :const:`False`, the returned " @@ -239,7 +275,7 @@ msgid "" "the user to avoid data corruption." msgstr "" -#: ../../library/sqlite3.rst:206 +#: ../../library/sqlite3.rst:244 msgid "" "By default, the :mod:`sqlite3` module uses its :class:`Connection` class for " "the connect call. You can, however, subclass the :class:`Connection` class " @@ -247,11 +283,11 @@ msgid "" "the *factory* parameter." msgstr "" -#: ../../library/sqlite3.rst:211 +#: ../../library/sqlite3.rst:249 msgid "Consult the section :ref:`sqlite3-types` of this manual for details." msgstr "" -#: ../../library/sqlite3.rst:213 +#: ../../library/sqlite3.rst:251 msgid "" "The :mod:`sqlite3` module internally uses a statement cache to avoid SQL " "parsing overhead. If you want to explicitly set the number of statements " @@ -259,46 +295,46 @@ msgid "" "parameter. The currently implemented default is to cache 100 statements." msgstr "" -#: ../../library/sqlite3.rst:218 +#: ../../library/sqlite3.rst:256 msgid "" "If *uri* is true, *database* is interpreted as a URI. This allows you to " "specify options. For example, to open a database in read-only mode you can " "use::" msgstr "" -#: ../../library/sqlite3.rst:224 +#: ../../library/sqlite3.rst:262 msgid "" "More information about this feature, including a list of recognized options, " "can be found in the `SQLite URI documentation `_." msgstr "" -#: ../../library/sqlite3.rst:227 +#: ../../library/sqlite3.rst:265 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -#: ../../library/sqlite3.rst:228 +#: ../../library/sqlite3.rst:266 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." msgstr "" -#: ../../library/sqlite3.rst:230 +#: ../../library/sqlite3.rst:268 msgid "Added the *uri* parameter." msgstr "" -#: ../../library/sqlite3.rst:233 +#: ../../library/sqlite3.rst:271 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:236 +#: ../../library/sqlite3.rst:274 msgid "Added the ``sqlite3.connect/handle`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:242 +#: ../../library/sqlite3.rst:280 msgid "" "Registers a callable to convert a bytestring from the database into a custom " "Python type. The callable will be invoked for all database values that are " @@ -308,7 +344,7 @@ msgid "" "manner." msgstr "" -#: ../../library/sqlite3.rst:251 +#: ../../library/sqlite3.rst:289 msgid "" "Registers a callable to convert the custom Python type *type* into one of " "SQLite's supported types. The callable *callable* accepts as single " @@ -316,7 +352,7 @@ msgid "" "int, float, str or bytes." msgstr "" -#: ../../library/sqlite3.rst:259 +#: ../../library/sqlite3.rst:297 msgid "" "Returns :const:`True` if the string *sql* contains one or more complete SQL " "statements terminated by semicolons. It does not verify that the SQL is " @@ -324,12 +360,12 @@ msgid "" "the statement is terminated by a semicolon." msgstr "" -#: ../../library/sqlite3.rst:264 +#: ../../library/sqlite3.rst:302 msgid "" "This can be used to build a shell for SQLite, as in the following example:" msgstr "" -#: ../../library/sqlite3.rst:272 +#: ../../library/sqlite3.rst:310 msgid "" "By default you will not get any tracebacks in user-defined functions, " "aggregates, converters, authorizer callbacks etc. If you want to debug them, " @@ -338,35 +374,35 @@ msgid "" "disable the feature again." msgstr "" -#: ../../library/sqlite3.rst:282 +#: ../../library/sqlite3.rst:320 msgid "Connection Objects" msgstr "" -#: ../../library/sqlite3.rst:286 +#: ../../library/sqlite3.rst:324 msgid "A SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:290 +#: ../../library/sqlite3.rst:328 msgid "" "Get or set the current default isolation level. :const:`None` for autocommit " "mode or one of \"DEFERRED\", \"IMMEDIATE\" or \"EXCLUSIVE\". See section :" "ref:`sqlite3-controlling-transactions` for a more detailed explanation." msgstr "" -#: ../../library/sqlite3.rst:296 +#: ../../library/sqlite3.rst:334 msgid "" ":const:`True` if a transaction is active (there are uncommitted changes), :" "const:`False` otherwise. Read-only attribute." msgstr "" -#: ../../library/sqlite3.rst:303 +#: ../../library/sqlite3.rst:341 msgid "" "The cursor method accepts a single optional parameter *factory*. If " "supplied, this must be a callable returning an instance of :class:`Cursor` " "or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:309 +#: ../../library/sqlite3.rst:347 msgid "" "This method commits the current transaction. If you don't call this method, " "anything you did since the last call to ``commit()`` is not visible from " @@ -374,41 +410,41 @@ msgid "" "written to the database, please check you didn't forget to call this method." msgstr "" -#: ../../library/sqlite3.rst:316 +#: ../../library/sqlite3.rst:354 msgid "" "This method rolls back any changes to the database since the last call to :" "meth:`commit`." msgstr "" -#: ../../library/sqlite3.rst:321 +#: ../../library/sqlite3.rst:359 msgid "" "This closes the database connection. Note that this does not automatically " "call :meth:`commit`. If you just close your database connection without " "calling :meth:`commit` first, your changes will be lost!" msgstr "" -#: ../../library/sqlite3.rst:327 +#: ../../library/sqlite3.rst:365 msgid "" "This is a nonstandard shortcut that creates a cursor object by calling the :" "meth:`~Connection.cursor` method, calls the cursor's :meth:`~Cursor.execute` " "method with the *parameters* given, and returns the cursor." msgstr "" -#: ../../library/sqlite3.rst:334 +#: ../../library/sqlite3.rst:372 msgid "" "This is a nonstandard shortcut that creates a cursor object by calling the :" "meth:`~Connection.cursor` method, calls the cursor's :meth:`~Cursor." "executemany` method with the *parameters* given, and returns the cursor." msgstr "" -#: ../../library/sqlite3.rst:341 +#: ../../library/sqlite3.rst:379 msgid "" "This is a nonstandard shortcut that creates a cursor object by calling the :" "meth:`~Connection.cursor` method, calls the cursor's :meth:`~Cursor." "executescript` method with the given *sql_script*, and returns the cursor." msgstr "" -#: ../../library/sqlite3.rst:348 +#: ../../library/sqlite3.rst:386 msgid "" "Creates a user-defined function that you can later use from within SQL " "statements under the function name *name*. *num_params* is the number of " @@ -421,26 +457,26 @@ msgid "" "older versions." msgstr "" -#: ../../library/sqlite3.rst:358 +#: ../../library/sqlite3.rst:396 msgid "" "The function can return any of the types supported by SQLite: bytes, str, " "int, float and ``None``." msgstr "" -#: ../../library/sqlite3.rst:361 +#: ../../library/sqlite3.rst:399 msgid "The *deterministic* parameter was added." msgstr "" -#: ../../library/sqlite3.rst:364 ../../library/sqlite3.rst:381 -#: ../../library/sqlite3.rst:513 ../../library/sqlite3.rst:664 +#: ../../library/sqlite3.rst:402 ../../library/sqlite3.rst:419 +#: ../../library/sqlite3.rst:551 ../../library/sqlite3.rst:702 msgid "Example:" msgstr "" -#: ../../library/sqlite3.rst:371 +#: ../../library/sqlite3.rst:409 msgid "Creates a user-defined aggregate function." msgstr "" -#: ../../library/sqlite3.rst:373 +#: ../../library/sqlite3.rst:411 msgid "" "The aggregate class must implement a ``step`` method, which accepts the " "number of parameters *num_params* (if *num_params* is -1, the function may " @@ -448,13 +484,13 @@ msgid "" "the final result of the aggregate." msgstr "" -#: ../../library/sqlite3.rst:378 +#: ../../library/sqlite3.rst:416 msgid "" "The ``finalize`` method can return any of the types supported by SQLite: " "bytes, str, int, float and ``None``." msgstr "" -#: ../../library/sqlite3.rst:388 +#: ../../library/sqlite3.rst:426 msgid "" "Creates a collation with the specified *name* and *callable*. The callable " "will be passed two string arguments. It should return -1 if the first is " @@ -463,30 +499,30 @@ msgid "" "(ORDER BY in SQL) so your comparisons don't affect other SQL operations." msgstr "" -#: ../../library/sqlite3.rst:394 +#: ../../library/sqlite3.rst:432 msgid "" "Note that the callable will get its parameters as Python bytestrings, which " "will normally be encoded in UTF-8." msgstr "" -#: ../../library/sqlite3.rst:397 +#: ../../library/sqlite3.rst:435 msgid "" "The following example shows a custom collation that sorts \"the wrong way\":" msgstr "" -#: ../../library/sqlite3.rst:401 +#: ../../library/sqlite3.rst:439 msgid "" "To remove a collation, call ``create_collation`` with ``None`` as callable::" msgstr "" -#: ../../library/sqlite3.rst:408 +#: ../../library/sqlite3.rst:446 msgid "" "You can call this method from a different thread to abort any queries that " "might be executing on the connection. The query will then abort and the " "caller will get an exception." msgstr "" -#: ../../library/sqlite3.rst:415 +#: ../../library/sqlite3.rst:453 msgid "" "This routine registers a callback. The callback is invoked for each attempt " "to access a column of a table in the database. The callback should return :" @@ -496,7 +532,7 @@ msgid "" "in the :mod:`sqlite3` module." msgstr "" -#: ../../library/sqlite3.rst:422 +#: ../../library/sqlite3.rst:460 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or :const:`None` " @@ -507,7 +543,7 @@ msgid "" "code." msgstr "" -#: ../../library/sqlite3.rst:429 +#: ../../library/sqlite3.rst:467 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -515,7 +551,7 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:436 +#: ../../library/sqlite3.rst:474 msgid "" "This routine registers a callback. The callback is invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -523,26 +559,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:441 +#: ../../library/sqlite3.rst:479 msgid "" "If you want to clear any previously installed progress handler, call the " "method with :const:`None` for *handler*." msgstr "" -#: ../../library/sqlite3.rst:444 +#: ../../library/sqlite3.rst:482 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:451 +#: ../../library/sqlite3.rst:489 msgid "" "Registers *trace_callback* to be called for each SQL statement that is " "actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:454 +#: ../../library/sqlite3.rst:492 msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " @@ -552,19 +588,19 @@ msgid "" "of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:462 +#: ../../library/sqlite3.rst:500 msgid "" "Passing :const:`None` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:465 +#: ../../library/sqlite3.rst:503 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:475 +#: ../../library/sqlite3.rst:513 msgid "" "This routine allows/disallows the SQLite engine to load SQLite extensions " "from shared libraries. SQLite extensions can define new functions, " @@ -572,38 +608,38 @@ msgid "" "extension is the fulltext-search extension distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:480 ../../library/sqlite3.rst:497 +#: ../../library/sqlite3.rst:518 ../../library/sqlite3.rst:535 msgid "Loadable extensions are disabled by default. See [#f1]_." msgstr "" -#: ../../library/sqlite3.rst:482 +#: ../../library/sqlite3.rst:520 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:486 +#: ../../library/sqlite3.rst:524 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:493 +#: ../../library/sqlite3.rst:531 msgid "" "This routine loads a SQLite extension from a shared library. You have to " "enable extension loading with :meth:`enable_load_extension` before you can " "use this routine." msgstr "" -#: ../../library/sqlite3.rst:499 +#: ../../library/sqlite3.rst:537 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:503 +#: ../../library/sqlite3.rst:541 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:508 +#: ../../library/sqlite3.rst:546 msgid "" "You can change this attribute to a callable that accepts the cursor and the " "original row as a tuple and will return the real result row. This way, you " @@ -611,7 +647,7 @@ msgid "" "object that can also access columns by name." msgstr "" -#: ../../library/sqlite3.rst:517 +#: ../../library/sqlite3.rst:555 msgid "" "If returning a tuple doesn't suffice and you want name-based access to " "columns, you should consider setting :attr:`row_factory` to the highly-" @@ -621,7 +657,7 @@ msgid "" "approach or even a db_row based solution." msgstr "" -#: ../../library/sqlite3.rst:529 +#: ../../library/sqlite3.rst:567 msgid "" "Using this attribute you can control what objects are returned for the " "``TEXT`` data type. By default, this attribute is set to :class:`str` and " @@ -629,23 +665,23 @@ msgid "" "you want to return :class:`bytes` instead, you can set it to :class:`bytes`." msgstr "" -#: ../../library/sqlite3.rst:534 +#: ../../library/sqlite3.rst:572 msgid "" "You can also set it to any other callable that accepts a single bytestring " "parameter and returns the resulting object." msgstr "" -#: ../../library/sqlite3.rst:537 +#: ../../library/sqlite3.rst:575 msgid "See the following example code for illustration:" msgstr "" -#: ../../library/sqlite3.rst:544 +#: ../../library/sqlite3.rst:582 msgid "" "Returns the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:550 +#: ../../library/sqlite3.rst:588 msgid "" "Returns an iterator to dump the database in an SQL text format. Useful when " "saving an in-memory database for later restoration. This function provides " @@ -653,11 +689,11 @@ msgid "" "shell." msgstr "" -#: ../../library/sqlite3.rst:555 +#: ../../library/sqlite3.rst:593 msgid "Example::" msgstr "" -#: ../../library/sqlite3.rst:569 +#: ../../library/sqlite3.rst:607 msgid "" "This method makes a backup of a SQLite database even while it's being " "accessed by other clients, or concurrently by the same connection. The copy " @@ -665,14 +701,14 @@ msgid "" "class:`Connection` instance." msgstr "" -#: ../../library/sqlite3.rst:574 +#: ../../library/sqlite3.rst:612 msgid "" "By default, or when *pages* is either ``0`` or a negative integer, the " "entire database is copied in a single step; otherwise the method performs a " "loop copying up to *pages* pages at a time." msgstr "" -#: ../../library/sqlite3.rst:578 +#: ../../library/sqlite3.rst:616 msgid "" "If *progress* is specified, it must either be ``None`` or a callable object " "that will be executed at each iteration with three integer arguments, " @@ -680,7 +716,7 @@ msgid "" "pages still to be copied and the *total* number of pages." msgstr "" -#: ../../library/sqlite3.rst:583 +#: ../../library/sqlite3.rst:621 msgid "" "The *name* argument specifies the database name that will be copied: it must " "be a string containing either ``\"main\"``, the default, to indicate the " @@ -689,36 +725,36 @@ msgid "" "an attached database." msgstr "" -#: ../../library/sqlite3.rst:589 +#: ../../library/sqlite3.rst:627 msgid "" "The *sleep* argument specifies the number of seconds to sleep by between " "successive attempts to backup remaining pages, can be specified either as an " "integer or a floating point value." msgstr "" -#: ../../library/sqlite3.rst:593 +#: ../../library/sqlite3.rst:631 msgid "Example 1, copy an existing database into another::" msgstr "" -#: ../../library/sqlite3.rst:607 +#: ../../library/sqlite3.rst:645 msgid "Example 2, copy an existing database into a transient copy::" msgstr "" -#: ../../library/sqlite3.rst:621 +#: ../../library/sqlite3.rst:659 msgid "Cursor Objects" msgstr "" -#: ../../library/sqlite3.rst:625 +#: ../../library/sqlite3.rst:663 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:632 +#: ../../library/sqlite3.rst:670 msgid "" "Executes an SQL statement. Values may be bound to the statement using :ref:" "`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:635 +#: ../../library/sqlite3.rst:673 msgid "" ":meth:`execute` will only execute a single SQL statement. If you try to " "execute more than one statement with it, it will raise a :exc:`.Warning`. " @@ -726,7 +762,7 @@ msgid "" "with one call." msgstr "" -#: ../../library/sqlite3.rst:643 +#: ../../library/sqlite3.rst:681 msgid "" "Executes a :ref:`parameterized ` SQL command against " "all parameter sequences or mappings found in the sequence " @@ -734,11 +770,11 @@ msgid "" "`iterator` yielding parameters instead of a sequence." msgstr "" -#: ../../library/sqlite3.rst:650 +#: ../../library/sqlite3.rst:688 msgid "Here's a shorter example using a :term:`generator`:" msgstr "" -#: ../../library/sqlite3.rst:657 +#: ../../library/sqlite3.rst:695 msgid "" "This is a nonstandard convenience method for executing multiple SQL " "statements at once. It issues a ``COMMIT`` statement first, then executes " @@ -746,23 +782,23 @@ msgid "" "`isolation_level`; any transaction control must be added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:662 +#: ../../library/sqlite3.rst:700 msgid "*sql_script* can be an instance of :class:`str`." msgstr "" -#: ../../library/sqlite3.rst:671 +#: ../../library/sqlite3.rst:709 msgid "" "Fetches the next row of a query result set, returning a single sequence, or :" "const:`None` when no more data is available." msgstr "" -#: ../../library/sqlite3.rst:677 +#: ../../library/sqlite3.rst:715 msgid "" "Fetches the next set of rows of a query result, returning a list. An empty " "list is returned when no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:680 +#: ../../library/sqlite3.rst:718 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If it is not given, the cursor's arraysize determines the number of rows to " @@ -771,7 +807,7 @@ msgid "" "not being available, fewer rows may be returned." msgstr "" -#: ../../library/sqlite3.rst:686 +#: ../../library/sqlite3.rst:724 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -779,38 +815,42 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:693 +#: ../../library/sqlite3.rst:731 msgid "" "Fetches all (remaining) rows of a query result, returning a list. Note that " "the cursor's arraysize attribute can affect the performance of this " "operation. An empty list is returned when no rows are available." msgstr "" -#: ../../library/sqlite3.rst:699 +#: ../../library/sqlite3.rst:737 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:701 +#: ../../library/sqlite3.rst:739 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:706 +#: ../../library/sqlite3.rst:744 ../../library/sqlite3.rst:748 +msgid "Required by the DB-API. Is a no-op in :mod:`sqlite3`." +msgstr "" + +#: ../../library/sqlite3.rst:752 msgid "" "Although the :class:`Cursor` class of the :mod:`sqlite3` module implements " "this attribute, the database engine's own support for the determination of " "\"rows affected\"/\"rows selected\" is quirky." msgstr "" -#: ../../library/sqlite3.rst:710 +#: ../../library/sqlite3.rst:756 msgid "" "For :meth:`executemany` statements, the number of modifications are summed " "up into :attr:`rowcount`." msgstr "" -#: ../../library/sqlite3.rst:713 +#: ../../library/sqlite3.rst:759 msgid "" "As required by the Python DB API Spec, the :attr:`rowcount` attribute \"is " "-1 in case no ``executeXX()`` has been performed on the cursor or the " @@ -819,7 +859,7 @@ msgid "" "rows a query produced until all rows were fetched." msgstr "" -#: ../../library/sqlite3.rst:721 +#: ../../library/sqlite3.rst:767 msgid "" "This read-only attribute provides the rowid of the last modified row. It is " "only set if you issued an ``INSERT`` or a ``REPLACE`` statement using the :" @@ -828,35 +868,35 @@ msgid "" "`None`." msgstr "" -#: ../../library/sqlite3.rst:727 +#: ../../library/sqlite3.rst:773 msgid "" "If the ``INSERT`` or ``REPLACE`` statement failed to insert the previous " "successful rowid is returned." msgstr "" -#: ../../library/sqlite3.rst:730 +#: ../../library/sqlite3.rst:776 msgid "Added support for the ``REPLACE`` statement." msgstr "" -#: ../../library/sqlite3.rst:735 +#: ../../library/sqlite3.rst:781 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:740 +#: ../../library/sqlite3.rst:786 msgid "" "This read-only attribute provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are :const:`None`." msgstr "" -#: ../../library/sqlite3.rst:744 +#: ../../library/sqlite3.rst:790 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:748 +#: ../../library/sqlite3.rst:794 msgid "" "This read-only attribute provides the SQLite database :class:`Connection` " "used by the :class:`Cursor` object. A :class:`Cursor` object created by " @@ -864,79 +904,79 @@ msgid "" "`connection` attribute that refers to *con*::" msgstr "" -#: ../../library/sqlite3.rst:761 +#: ../../library/sqlite3.rst:807 msgid "Row Objects" msgstr "" -#: ../../library/sqlite3.rst:765 +#: ../../library/sqlite3.rst:811 msgid "" "A :class:`Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It tries to mimic a tuple in " "most of its features." msgstr "" -#: ../../library/sqlite3.rst:769 +#: ../../library/sqlite3.rst:815 msgid "" "It supports mapping access by column name and index, iteration, " "representation, equality testing and :func:`len`." msgstr "" -#: ../../library/sqlite3.rst:772 +#: ../../library/sqlite3.rst:818 msgid "" "If two :class:`Row` objects have exactly the same columns and their members " "are equal, they compare equal." msgstr "" -#: ../../library/sqlite3.rst:777 +#: ../../library/sqlite3.rst:823 msgid "" "This method returns a list of column names. Immediately after a query, it is " "the first member of each tuple in :attr:`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:780 +#: ../../library/sqlite3.rst:826 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:783 +#: ../../library/sqlite3.rst:829 msgid "Let's assume we initialize a table as in the example given above::" msgstr "" -#: ../../library/sqlite3.rst:795 +#: ../../library/sqlite3.rst:841 msgid "Now we plug :class:`Row` in::" msgstr "" -#: ../../library/sqlite3.rst:827 +#: ../../library/sqlite3.rst:873 msgid "Exceptions" msgstr "" -#: ../../library/sqlite3.rst:831 +#: ../../library/sqlite3.rst:877 msgid "A subclass of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:835 +#: ../../library/sqlite3.rst:881 msgid "" "The base class of the other exceptions in this module. It is a subclass of :" "exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:840 +#: ../../library/sqlite3.rst:886 msgid "Exception raised for errors that are related to the database." msgstr "" -#: ../../library/sqlite3.rst:844 +#: ../../library/sqlite3.rst:890 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:849 +#: ../../library/sqlite3.rst:895 msgid "" "Exception raised for programming errors, e.g. table not found or already " "exists, syntax error in the SQL statement, wrong number of parameters " "specified, etc. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:855 +#: ../../library/sqlite3.rst:901 msgid "" "Exception raised for errors that are related to the database's operation and " "not necessarily under the control of the programmer, e.g. an unexpected " @@ -944,7 +984,7 @@ msgid "" "not be processed, etc. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:862 +#: ../../library/sqlite3.rst:908 msgid "" "Exception raised in case a method or database API was used which is not " "supported by the database, e.g. calling the :meth:`~Connection.rollback` " @@ -952,82 +992,82 @@ msgid "" "turned off. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:871 +#: ../../library/sqlite3.rst:917 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:875 +#: ../../library/sqlite3.rst:921 msgid "Introduction" msgstr "簡介" -#: ../../library/sqlite3.rst:877 +#: ../../library/sqlite3.rst:923 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:880 +#: ../../library/sqlite3.rst:926 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:883 ../../library/sqlite3.rst:900 +#: ../../library/sqlite3.rst:929 ../../library/sqlite3.rst:946 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:883 ../../library/sqlite3.rst:900 +#: ../../library/sqlite3.rst:929 ../../library/sqlite3.rst:946 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:885 ../../library/sqlite3.rst:902 +#: ../../library/sqlite3.rst:931 ../../library/sqlite3.rst:948 msgid ":const:`None`" msgstr "" -#: ../../library/sqlite3.rst:885 ../../library/sqlite3.rst:902 +#: ../../library/sqlite3.rst:931 ../../library/sqlite3.rst:948 msgid "``NULL``" msgstr "" -#: ../../library/sqlite3.rst:887 ../../library/sqlite3.rst:904 +#: ../../library/sqlite3.rst:933 ../../library/sqlite3.rst:950 msgid ":class:`int`" msgstr "" -#: ../../library/sqlite3.rst:887 ../../library/sqlite3.rst:904 +#: ../../library/sqlite3.rst:933 ../../library/sqlite3.rst:950 msgid "``INTEGER``" msgstr "" -#: ../../library/sqlite3.rst:889 ../../library/sqlite3.rst:906 +#: ../../library/sqlite3.rst:935 ../../library/sqlite3.rst:952 msgid ":class:`float`" msgstr "" -#: ../../library/sqlite3.rst:889 ../../library/sqlite3.rst:906 +#: ../../library/sqlite3.rst:935 ../../library/sqlite3.rst:952 msgid "``REAL``" msgstr "" -#: ../../library/sqlite3.rst:891 +#: ../../library/sqlite3.rst:937 msgid ":class:`str`" msgstr "" -#: ../../library/sqlite3.rst:891 ../../library/sqlite3.rst:908 +#: ../../library/sqlite3.rst:937 ../../library/sqlite3.rst:954 msgid "``TEXT``" msgstr "" -#: ../../library/sqlite3.rst:893 ../../library/sqlite3.rst:911 +#: ../../library/sqlite3.rst:939 ../../library/sqlite3.rst:957 msgid ":class:`bytes`" msgstr "" -#: ../../library/sqlite3.rst:893 ../../library/sqlite3.rst:911 +#: ../../library/sqlite3.rst:939 ../../library/sqlite3.rst:957 msgid "``BLOB``" msgstr "" -#: ../../library/sqlite3.rst:897 +#: ../../library/sqlite3.rst:943 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:908 +#: ../../library/sqlite3.rst:954 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:914 +#: ../../library/sqlite3.rst:960 msgid "" "The type system of the :mod:`sqlite3` module is extensible in two ways: you " "can store additional Python types in a SQLite database via object " @@ -1035,11 +1075,11 @@ msgid "" "to different Python types via converters." msgstr "" -#: ../../library/sqlite3.rst:921 +#: ../../library/sqlite3.rst:967 msgid "Using adapters to store additional Python types in SQLite databases" msgstr "" -#: ../../library/sqlite3.rst:923 +#: ../../library/sqlite3.rst:969 msgid "" "As described before, SQLite supports only a limited set of types natively. " "To use other Python types with SQLite, you must **adapt** them to one of the " @@ -1047,23 +1087,23 @@ msgid "" "str, bytes." msgstr "" -#: ../../library/sqlite3.rst:928 +#: ../../library/sqlite3.rst:974 msgid "" "There are two ways to enable the :mod:`sqlite3` module to adapt a custom " "Python type to one of the supported ones." msgstr "" -#: ../../library/sqlite3.rst:933 +#: ../../library/sqlite3.rst:979 msgid "Letting your object adapt itself" msgstr "" -#: ../../library/sqlite3.rst:935 +#: ../../library/sqlite3.rst:981 msgid "" "This is a good approach if you write the class yourself. Let's suppose you " "have a class like this::" msgstr "" -#: ../../library/sqlite3.rst:942 +#: ../../library/sqlite3.rst:988 msgid "" "Now you want to store the point in a single SQLite column. First you'll " "have to choose one of the supported types to be used for representing the " @@ -1073,18 +1113,18 @@ msgid "" "class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:952 +#: ../../library/sqlite3.rst:998 msgid "Registering an adapter callable" msgstr "" -#: ../../library/sqlite3.rst:954 +#: ../../library/sqlite3.rst:1000 msgid "" "The other possibility is to create a function that converts the type to the " "string representation and register the function with :meth:" "`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:959 +#: ../../library/sqlite3.rst:1005 msgid "" "The :mod:`sqlite3` module has two default adapters for Python's built-in :" "class:`datetime.date` and :class:`datetime.datetime` types. Now let's " @@ -1092,110 +1132,118 @@ msgid "" "representation, but as a Unix timestamp." msgstr "" -#: ../../library/sqlite3.rst:968 +#: ../../library/sqlite3.rst:1014 msgid "Converting SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:970 +#: ../../library/sqlite3.rst:1016 msgid "" "Writing an adapter lets you send custom Python types to SQLite. But to make " "it really useful we need to make the Python to SQLite to Python roundtrip " "work." msgstr "" -#: ../../library/sqlite3.rst:973 +#: ../../library/sqlite3.rst:1019 msgid "Enter converters." msgstr "" -#: ../../library/sqlite3.rst:975 +#: ../../library/sqlite3.rst:1021 msgid "" "Let's go back to the :class:`Point` class. We stored the x and y coordinates " "separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:978 +#: ../../library/sqlite3.rst:1024 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:983 +#: ../../library/sqlite3.rst:1029 msgid "" "Converter functions **always** get called with a :class:`bytes` object, no " "matter under which data type you sent the value to SQLite." msgstr "" -#: ../../library/sqlite3.rst:992 +#: ../../library/sqlite3.rst:1038 msgid "" "Now you need to make the :mod:`sqlite3` module know that what you select " "from the database is actually a point. There are two ways of doing this:" msgstr "" -#: ../../library/sqlite3.rst:995 +#: ../../library/sqlite3.rst:1041 msgid "Implicitly via the declared type" msgstr "" -#: ../../library/sqlite3.rst:997 +#: ../../library/sqlite3.rst:1043 msgid "Explicitly via the column name" msgstr "" -#: ../../library/sqlite3.rst:999 +#: ../../library/sqlite3.rst:1045 msgid "" "Both ways are described in section :ref:`sqlite3-module-contents`, in the " "entries for the constants :const:`PARSE_DECLTYPES` and :const:" "`PARSE_COLNAMES`." msgstr "" -#: ../../library/sqlite3.rst:1002 +#: ../../library/sqlite3.rst:1048 msgid "The following example illustrates both approaches." msgstr "" -#: ../../library/sqlite3.rst:1008 +#: ../../library/sqlite3.rst:1054 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1010 +#: ../../library/sqlite3.rst:1056 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1013 +#: ../../library/sqlite3.rst:1059 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1017 +#: ../../library/sqlite3.rst:1063 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1021 +#: ../../library/sqlite3.rst:1067 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1025 +#: ../../library/sqlite3.rst:1071 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1033 +#: ../../library/sqlite3.rst:1077 +msgid "" +"The default \"timestamp\" converter ignores UTC offsets in the database and " +"always returns a naive :class:`datetime.datetime` object. To preserve UTC " +"offsets in timestamps, either leave converters disabled, or register an " +"offset-aware converter with :func:`register_converter`." +msgstr "" + +#: ../../library/sqlite3.rst:1085 msgid "Controlling Transactions" msgstr "" -#: ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1087 msgid "" "The underlying ``sqlite3`` library operates in ``autocommit`` mode by " "default, but the Python :mod:`sqlite3` module by default does not." msgstr "" -#: ../../library/sqlite3.rst:1038 +#: ../../library/sqlite3.rst:1090 msgid "" "``autocommit`` mode means that statements that modify the database take " "effect immediately. A ``BEGIN`` or ``SAVEPOINT`` statement disables " @@ -1203,14 +1251,14 @@ msgid "" "ends the outermost transaction, turns ``autocommit`` mode back on." msgstr "" -#: ../../library/sqlite3.rst:1043 +#: ../../library/sqlite3.rst:1095 msgid "" "The Python :mod:`sqlite3` module by default issues a ``BEGIN`` statement " "implicitly before a Data Modification Language (DML) statement (i.e. " "``INSERT``/``UPDATE``/``DELETE``/``REPLACE``)." msgstr "" -#: ../../library/sqlite3.rst:1047 +#: ../../library/sqlite3.rst:1099 msgid "" "You can control which kind of ``BEGIN`` statements :mod:`sqlite3` implicitly " "executes via the *isolation_level* parameter to the :func:`connect` call, or " @@ -1220,7 +1268,7 @@ msgid "" "``EXCLUSIVE``." msgstr "" -#: ../../library/sqlite3.rst:1054 +#: ../../library/sqlite3.rst:1106 msgid "" "You can disable the :mod:`sqlite3` module's implicit transaction management " "by setting :attr:`isolation_level` to ``None``. This will leave the " @@ -1230,27 +1278,27 @@ msgid "" "code." msgstr "" -#: ../../library/sqlite3.rst:1060 +#: ../../library/sqlite3.rst:1112 msgid "" "Note that :meth:`~Cursor.executescript` disregards :attr:`isolation_level`; " "any transaction control must be added explicitly." msgstr "" -#: ../../library/sqlite3.rst:1063 +#: ../../library/sqlite3.rst:1115 msgid "" ":mod:`sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1069 +#: ../../library/sqlite3.rst:1121 msgid "Using :mod:`sqlite3` efficiently" msgstr "" -#: ../../library/sqlite3.rst:1073 +#: ../../library/sqlite3.rst:1125 msgid "Using shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:1075 +#: ../../library/sqlite3.rst:1127 msgid "" "Using the nonstandard :meth:`execute`, :meth:`executemany` and :meth:" "`executescript` methods of the :class:`Connection` object, your code can be " @@ -1262,38 +1310,38 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:1087 +#: ../../library/sqlite3.rst:1139 msgid "Accessing columns by name instead of by index" msgstr "" -#: ../../library/sqlite3.rst:1089 +#: ../../library/sqlite3.rst:1141 msgid "" "One useful feature of the :mod:`sqlite3` module is the built-in :class:" "`sqlite3.Row` class designed to be used as a row factory." msgstr "" -#: ../../library/sqlite3.rst:1092 +#: ../../library/sqlite3.rst:1144 msgid "" "Rows wrapped with this class can be accessed both by index (like tuples) and " "case-insensitively by name:" msgstr "" -#: ../../library/sqlite3.rst:1099 +#: ../../library/sqlite3.rst:1151 msgid "Using the connection as a context manager" msgstr "" -#: ../../library/sqlite3.rst:1101 +#: ../../library/sqlite3.rst:1153 msgid "" "Connection objects can be used as context managers that automatically commit " "or rollback transactions. In the event of an exception, the transaction is " "rolled back; otherwise, the transaction is committed:" msgstr "" -#: ../../library/sqlite3.rst:1110 +#: ../../library/sqlite3.rst:1162 msgid "Footnotes" msgstr "註解" -#: ../../library/sqlite3.rst:1111 +#: ../../library/sqlite3.rst:1163 msgid "" "The sqlite3 module is not built with loadable extension support by default, " "because some platforms (notably macOS) have SQLite libraries which are " diff --git a/library/ssl.po b/library/ssl.po index a9d24a2502..a9ee966c1b 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-03 00:08+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1767,7 +1767,7 @@ msgstr "" msgid "" "Load a set of default \"certification authority\" (CA) certificates from " "default locations. On Windows it loads CA certs from the ``CA`` and ``ROOT`` " -"system stores. On other systems it calls :meth:`SSLContext." +"system stores. On all systems it calls :meth:`SSLContext." "set_default_verify_paths`. In the future the method may load CA certificates " "from other locations, too." msgstr "" diff --git a/library/typing.po b/library/typing.po index a3a8456789..e71e994f03 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-10-29 16:03+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,64 +35,170 @@ msgstr "" #: ../../library/typing.rst:20 msgid "" -"This module provides runtime support for type hints as specified by :pep:" -"`484`, :pep:`526`, :pep:`544`, :pep:`586`, :pep:`589`, :pep:`591`, :pep:" -"`593`, :pep:`612`, :pep:`613` and :pep:`647`. The most fundamental support " -"consists of the types :data:`Any`, :data:`Union`, :data:`Tuple`, :data:" -"`Callable`, :class:`TypeVar`, and :class:`Generic`. For full specification " -"please see :pep:`484`. For a simplified introduction to type hints see :pep:" -"`483`." +"This module provides runtime support for type hints. The most fundamental " +"support consists of the types :data:`Any`, :data:`Union`, :data:`Tuple`, :" +"data:`Callable`, :class:`TypeVar`, and :class:`Generic`. For a full " +"specification, please see :pep:`484`. For a simplified introduction to type " +"hints, see :pep:`483`." msgstr "" -#: ../../library/typing.rst:29 +#: ../../library/typing.rst:27 msgid "" "The function below takes and returns a string and is annotated as follows::" msgstr "" -#: ../../library/typing.rst:34 +#: ../../library/typing.rst:32 msgid "" "In the function ``greeting``, the argument ``name`` is expected to be of " "type :class:`str` and the return type :class:`str`. Subtypes are accepted as " "arguments." msgstr "" +#: ../../library/typing.rst:39 +msgid "Relevant PEPs" +msgstr "" + #: ../../library/typing.rst:41 +msgid "" +"Since the initial introduction of type hints in :pep:`484` and :pep:`483`, a " +"number of PEPs have modified and enhanced Python's framework for type " +"annotations. These include:" +msgstr "" + +#: ../../library/typing.rst:46 +msgid ":pep:`526`: Syntax for Variable Annotations" +msgstr "" + +#: ../../library/typing.rst:46 +msgid "" +"*Introducing* syntax for annotating variables outside of function " +"definitions, and :data:`ClassVar`" +msgstr "" + +#: ../../library/typing.rst:49 +msgid ":pep:`544`: Protocols: Structural subtyping (static duck typing)" +msgstr "" + +#: ../../library/typing.rst:49 +msgid "" +"*Introducing* :class:`Protocol` and the :func:" +"`@runtime_checkable` decorator" +msgstr "" + +#: ../../library/typing.rst:52 +msgid ":pep:`585`: Type Hinting Generics In Standard Collections" +msgstr "" + +#: ../../library/typing.rst:52 +msgid "" +"*Introducing* the ability to use builtin collections and ABCs as :term:" +"`generic types`" +msgstr "" + +#: ../../library/typing.rst:54 +msgid ":pep:`586`: Literal Types" +msgstr "" + +#: ../../library/typing.rst:55 +msgid "*Introducing* :data:`Literal`" +msgstr "" + +#: ../../library/typing.rst:56 +msgid "" +":pep:`589`: TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys" +msgstr "" + +#: ../../library/typing.rst:57 +msgid "*Introducing* :class:`TypedDict`" +msgstr "" + +#: ../../library/typing.rst:58 +msgid ":pep:`591`: Adding a final qualifier to typing" +msgstr "" + +#: ../../library/typing.rst:59 +msgid "*Introducing* :data:`Final` and the :func:`@final` decorator" +msgstr "" + +#: ../../library/typing.rst:60 +msgid ":pep:`593`: Flexible function and variable annotations" +msgstr "" + +#: ../../library/typing.rst:61 +msgid "*Introducing* :data:`Annotated`" +msgstr "" + +#: ../../library/typing.rst:64 +msgid ":pep:`604`: Allow writing union types as ``X | Y``" +msgstr "" + +#: ../../library/typing.rst:63 +msgid "" +"*Introducing* :data:`types.UnionType` and the ability to use the binary-or " +"operator ``|`` to signify a :ref:`union of types`" +msgstr "" + +#: ../../library/typing.rst:66 +msgid ":pep:`612`: Parameter Specification Variables" +msgstr "" + +#: ../../library/typing.rst:67 +msgid "*Introducing* :class:`ParamSpec` and :data:`Concatenate`" +msgstr "" + +#: ../../library/typing.rst:68 +msgid ":pep:`613`: Explicit Type Aliases" +msgstr "" + +#: ../../library/typing.rst:69 +msgid "*Introducing* :data:`TypeAlias`" +msgstr "" + +#: ../../library/typing.rst:71 +msgid ":pep:`647`: User-Defined Type Guards" +msgstr "" + +#: ../../library/typing.rst:71 +msgid "*Introducing* :data:`TypeGuard`" +msgstr "" + +#: ../../library/typing.rst:76 msgid "Type aliases" msgstr "" -#: ../../library/typing.rst:43 +#: ../../library/typing.rst:78 msgid "" "A type alias is defined by assigning the type to the alias. In this example, " "``Vector`` and ``list[float]`` will be treated as interchangeable synonyms::" msgstr "" -#: ../../library/typing.rst:54 +#: ../../library/typing.rst:89 msgid "" "Type aliases are useful for simplifying complex type signatures. For " "example::" msgstr "" -#: ../../library/typing.rst:72 +#: ../../library/typing.rst:107 msgid "" "Note that ``None`` as a type hint is a special case and is replaced by " "``type(None)``." msgstr "" -#: ../../library/typing.rst:78 +#: ../../library/typing.rst:113 msgid "NewType" msgstr "" -#: ../../library/typing.rst:80 +#: ../../library/typing.rst:115 msgid "Use the :class:`NewType` helper class to create distinct types::" msgstr "" -#: ../../library/typing.rst:87 +#: ../../library/typing.rst:122 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" -#: ../../library/typing.rst:99 +#: ../../library/typing.rst:134 msgid "" "You may still perform all ``int`` operations on a variable of type " "``UserId``, but the result will always be of type ``int``. This lets you " @@ -100,7 +206,7 @@ msgid "" "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" -#: ../../library/typing.rst:107 +#: ../../library/typing.rst:142 msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " @@ -109,31 +215,31 @@ msgid "" "class or introduce much overhead beyond that of a regular function call." msgstr "" -#: ../../library/typing.rst:113 +#: ../../library/typing.rst:148 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" -#: ../../library/typing.rst:116 +#: ../../library/typing.rst:151 msgid "It is invalid to create a subtype of ``Derived``::" msgstr "" -#: ../../library/typing.rst:125 +#: ../../library/typing.rst:160 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" -#: ../../library/typing.rst:133 +#: ../../library/typing.rst:168 msgid "and typechecking for ``ProUserId`` will work as expected." msgstr "" -#: ../../library/typing.rst:135 +#: ../../library/typing.rst:170 msgid "See :pep:`484` for more details." msgstr "" -#: ../../library/typing.rst:139 +#: ../../library/typing.rst:174 msgid "" "Recall that the use of a type alias declares two types to be *equivalent* to " "one another. Doing ``Alias = Original`` will make the static type checker " @@ -141,7 +247,7 @@ msgid "" "This is useful when you want to simplify complex type signatures." msgstr "" -#: ../../library/typing.rst:144 +#: ../../library/typing.rst:179 msgid "" "In contrast, ``NewType`` declares one type to be a *subtype* of another. " "Doing ``Derived = NewType('Derived', Original)`` will make the static type " @@ -151,36 +257,36 @@ msgid "" "errors with minimal runtime cost." msgstr "" -#: ../../library/typing.rst:153 +#: ../../library/typing.rst:188 msgid "" "``NewType`` is now a class rather than a function. There is some additional " "runtime cost when calling ``NewType`` over a regular function. However, " "this cost will be reduced in 3.11.0." msgstr "" -#: ../../library/typing.rst:160 +#: ../../library/typing.rst:195 msgid "Callable" msgstr "" -#: ../../library/typing.rst:162 +#: ../../library/typing.rst:197 msgid "" "Frameworks expecting callback functions of specific signatures might be type " "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:165 ../../library/typing.rst:976 -#: ../../library/typing.rst:2054 +#: ../../library/typing.rst:200 ../../library/typing.rst:1011 +#: ../../library/typing.rst:2089 msgid "For example::" msgstr "" -#: ../../library/typing.rst:176 +#: ../../library/typing.rst:211 msgid "" "It is possible to declare the return type of a callable without specifying " "the call signature by substituting a literal ellipsis for the list of " "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:180 ../../library/typing.rst:666 +#: ../../library/typing.rst:215 ../../library/typing.rst:701 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -191,97 +297,97 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:188 ../../library/typing.rst:678 +#: ../../library/typing.rst:223 ../../library/typing.rst:713 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more information." msgstr "" -#: ../../library/typing.rst:193 +#: ../../library/typing.rst:228 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:199 +#: ../../library/typing.rst:234 msgid "Generics" msgstr "" -#: ../../library/typing.rst:201 +#: ../../library/typing.rst:236 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, abstract base classes have been extended to " "support subscription to denote expected types for container elements." msgstr "" -#: ../../library/typing.rst:212 +#: ../../library/typing.rst:247 msgid "" "Generics can be parameterized by using a new factory available in typing " "called :class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:227 +#: ../../library/typing.rst:262 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:229 +#: ../../library/typing.rst:264 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:255 +#: ../../library/typing.rst:290 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:259 +#: ../../library/typing.rst:294 msgid "" "The :class:`Generic` base class defines :meth:`__class_getitem__` so that " "``LoggedVar[t]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:268 +#: ../../library/typing.rst:303 msgid "" "A generic type can have any number of type variables, and type variables may " "be constrained::" msgstr "" -#: ../../library/typing.rst:280 +#: ../../library/typing.rst:315 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:291 +#: ../../library/typing.rst:326 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:301 +#: ../../library/typing.rst:336 msgid "" "When inheriting from generic classes, some type variables could be fixed::" msgstr "" -#: ../../library/typing.rst:311 +#: ../../library/typing.rst:346 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:313 +#: ../../library/typing.rst:348 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``::" msgstr "" -#: ../../library/typing.rst:321 +#: ../../library/typing.rst:356 msgid "User defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:338 +#: ../../library/typing.rst:373 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:341 +#: ../../library/typing.rst:376 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -291,7 +397,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:358 +#: ../../library/typing.rst:393 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -299,20 +405,20 @@ msgid "" "converted to the former and are thus equivalent::" msgstr "" -#: ../../library/typing.rst:370 +#: ../../library/typing.rst:405 msgid "" "Do note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:374 +#: ../../library/typing.rst:409 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:378 +#: ../../library/typing.rst:413 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -320,24 +426,24 @@ msgid "" "hashable and comparable for equality." msgstr "" -#: ../../library/typing.rst:385 +#: ../../library/typing.rst:420 msgid "The :data:`Any` type" msgstr "" -#: ../../library/typing.rst:387 +#: ../../library/typing.rst:422 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:391 +#: ../../library/typing.rst:426 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:409 +#: ../../library/typing.rst:444 msgid "" "Notice that no typechecking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -346,19 +452,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:415 +#: ../../library/typing.rst:450 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:428 +#: ../../library/typing.rst:463 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:431 +#: ../../library/typing.rst:466 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -366,7 +472,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:436 +#: ../../library/typing.rst:471 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -374,24 +480,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:458 +#: ../../library/typing.rst:493 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:463 +#: ../../library/typing.rst:498 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:465 +#: ../../library/typing.rst:500 msgid "" "Initially :pep:`484` defined Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:469 +#: ../../library/typing.rst:504 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -400,7 +506,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:482 +#: ../../library/typing.rst:517 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -409,22 +515,22 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:498 +#: ../../library/typing.rst:533 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:503 +#: ../../library/typing.rst:538 msgid "Module contents" msgstr "" -#: ../../library/typing.rst:505 +#: ../../library/typing.rst:540 msgid "The module defines the following classes, functions and decorators." msgstr "" -#: ../../library/typing.rst:509 +#: ../../library/typing.rst:544 msgid "" "This module defines several types that are subclasses of pre-existing " "standard library classes which also extend :class:`Generic` to support type " @@ -432,7 +538,7 @@ msgid "" "corresponding pre-existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:515 +#: ../../library/typing.rst:550 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " "warnings will be issued by the interpreter. It is expected that type " @@ -440,147 +546,147 @@ msgid "" "Python 3.9 or newer." msgstr "" -#: ../../library/typing.rst:520 +#: ../../library/typing.rst:555 msgid "" "The deprecated types will be removed from the :mod:`typing` module in the " "first Python version released 5 years after the release of Python 3.9.0. See " "details in :pep:`585`—*Type Hinting Generics In Standard Collections*." msgstr "" -#: ../../library/typing.rst:526 +#: ../../library/typing.rst:561 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:529 +#: ../../library/typing.rst:564 msgid "Special types" msgstr "" -#: ../../library/typing.rst:531 +#: ../../library/typing.rst:566 msgid "These can be used as types in annotations and do not support ``[]``." msgstr "" -#: ../../library/typing.rst:535 +#: ../../library/typing.rst:570 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:537 +#: ../../library/typing.rst:572 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:538 +#: ../../library/typing.rst:573 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:542 +#: ../../library/typing.rst:577 msgid "Special type indicating that a function never returns. For example::" msgstr "" -#: ../../library/typing.rst:555 +#: ../../library/typing.rst:590 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `. For example::" msgstr "" -#: ../../library/typing.rst:562 +#: ../../library/typing.rst:597 msgid "See :pep:`613` for more details about explicit type aliases." msgstr "" -#: ../../library/typing.rst:567 +#: ../../library/typing.rst:602 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:569 +#: ../../library/typing.rst:604 msgid "" "These can be used as types in annotations using ``[]``, each having a unique " "syntax." msgstr "" -#: ../../library/typing.rst:573 +#: ../../library/typing.rst:608 msgid "" "Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the " "first item of type X and the second of type Y. The type of the empty tuple " "can be written as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:577 +#: ../../library/typing.rst:612 msgid "" "Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " "variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " "float and a string." msgstr "" -#: ../../library/typing.rst:581 +#: ../../library/typing.rst:616 msgid "" "To specify a variable-length tuple of homogeneous type, use literal " "ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` is equivalent to " "``Tuple[Any, ...]``, and in turn to :class:`tuple`." msgstr "" -#: ../../library/typing.rst:585 +#: ../../library/typing.rst:620 msgid "" ":class:`builtins.tuple ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:591 +#: ../../library/typing.rst:626 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:593 +#: ../../library/typing.rst:628 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Details:" msgstr "" -#: ../../library/typing.rst:595 +#: ../../library/typing.rst:630 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:597 +#: ../../library/typing.rst:632 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:601 +#: ../../library/typing.rst:636 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:605 +#: ../../library/typing.rst:640 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:609 +#: ../../library/typing.rst:644 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:613 +#: ../../library/typing.rst:648 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:615 +#: ../../library/typing.rst:650 msgid "You cannot write ``Union[X][Y]``." msgstr "" -#: ../../library/typing.rst:617 +#: ../../library/typing.rst:652 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:620 +#: ../../library/typing.rst:655 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:626 +#: ../../library/typing.rst:661 msgid "Optional type." msgstr "" -#: ../../library/typing.rst:628 +#: ../../library/typing.rst:663 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:630 +#: ../../library/typing.rst:665 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -588,31 +694,31 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:638 +#: ../../library/typing.rst:673 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:645 +#: ../../library/typing.rst:680 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:651 +#: ../../library/typing.rst:686 msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." msgstr "" -#: ../../library/typing.rst:653 +#: ../../library/typing.rst:688 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " "types or an ellipsis; the return type must be a single type." msgstr "" -#: ../../library/typing.rst:658 +#: ../../library/typing.rst:693 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -622,19 +728,19 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:674 +#: ../../library/typing.rst:709 msgid "" ":class:`collections.abc.Callable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:683 +#: ../../library/typing.rst:718 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:688 +#: ../../library/typing.rst:723 msgid "" "Used with :data:`Callable` and :class:`ParamSpec` to type annotate a higher " "order callable which adds, removes, or transforms parameters of another " @@ -644,7 +750,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec`." msgstr "" -#: ../../library/typing.rst:695 +#: ../../library/typing.rst:730 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -655,17 +761,17 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:735 ../../library/typing.rst:1155 +#: ../../library/typing.rst:770 ../../library/typing.rst:1190 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:737 +#: ../../library/typing.rst:772 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr "" -#: ../../library/typing.rst:742 +#: ../../library/typing.rst:777 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``Type[C]`` may accept values that are " @@ -673,11 +779,11 @@ msgid "" "``C``. For example::" msgstr "" -#: ../../library/typing.rst:751 +#: ../../library/typing.rst:786 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:763 +#: ../../library/typing.rst:798 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -687,39 +793,39 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:771 +#: ../../library/typing.rst:806 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:777 +#: ../../library/typing.rst:812 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:782 +#: ../../library/typing.rst:817 msgid "" ":class:`builtins.type ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:788 +#: ../../library/typing.rst:823 msgid "" "A type that can be used to indicate to type checkers that the corresponding " "variable or function parameter has a value equivalent to the provided " "literal (or one of several literals). For example::" msgstr "" -#: ../../library/typing.rst:802 +#: ../../library/typing.rst:837 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:808 +#: ../../library/typing.rst:843 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -727,22 +833,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:816 +#: ../../library/typing.rst:851 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:818 +#: ../../library/typing.rst:853 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:826 +#: ../../library/typing.rst:861 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:828 +#: ../../library/typing.rst:863 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -750,19 +856,19 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:842 +#: ../../library/typing.rst:877 msgid "" "A special typing construct to indicate to type checkers that a name cannot " "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:854 ../../library/typing.rst:1949 +#: ../../library/typing.rst:889 ../../library/typing.rst:1984 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:861 +#: ../../library/typing.rst:896 msgid "" "A type, introduced in :pep:`593` (``Flexible function and variable " "annotations``), to decorate existing types with context-specific metadata " @@ -779,7 +885,7 @@ msgid "" "``x`` within a specific application." msgstr "" -#: ../../library/typing.rst:875 +#: ../../library/typing.rst:910 msgid "" "Ultimately, the responsibility of how to interpret the annotations (if at " "all) is the responsibility of the tool or library encountering the " @@ -788,21 +894,21 @@ msgid "" "using ``isinstance()``)." msgstr "" -#: ../../library/typing.rst:881 +#: ../../library/typing.rst:916 msgid "" "When a tool or a library does not support annotations or encounters an " "unknown annotation it should just ignore it and treat annotated type as the " "underlying type." msgstr "" -#: ../../library/typing.rst:885 +#: ../../library/typing.rst:920 msgid "" "It's up to the tool consuming the annotations to decide whether the client " "is allowed to have several annotations on one type and how to merge those " "annotations." msgstr "" -#: ../../library/typing.rst:889 +#: ../../library/typing.rst:924 msgid "" "Since the ``Annotated`` type allows you to put several annotations of the " "same (or different) type(s) on any node, the tools or libraries consuming " @@ -810,59 +916,59 @@ msgid "" "example, if you are doing value range analysis you might allow this::" msgstr "" -#: ../../library/typing.rst:898 +#: ../../library/typing.rst:933 msgid "" "Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " "the extra annotations at runtime." msgstr "" -#: ../../library/typing.rst:901 +#: ../../library/typing.rst:936 msgid "The details of the syntax:" msgstr "" -#: ../../library/typing.rst:903 +#: ../../library/typing.rst:938 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:905 +#: ../../library/typing.rst:940 msgid "" "Multiple type annotations are supported (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:910 +#: ../../library/typing.rst:945 msgid "" "``Annotated`` must be called with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:913 +#: ../../library/typing.rst:948 msgid "" "The order of the annotations is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:920 +#: ../../library/typing.rst:955 msgid "" "Nested ``Annotated`` types are flattened, with metadata ordered starting " "with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:927 +#: ../../library/typing.rst:962 msgid "Duplicated annotations are not removed::" msgstr "" -#: ../../library/typing.rst:933 +#: ../../library/typing.rst:968 msgid "``Annotated`` can be used with nested and generic aliases::" msgstr "" -#: ../../library/typing.rst:946 +#: ../../library/typing.rst:981 msgid "" "Special typing form used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:950 +#: ../../library/typing.rst:985 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -871,44 +977,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:965 +#: ../../library/typing.rst:1000 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:969 +#: ../../library/typing.rst:1004 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:972 +#: ../../library/typing.rst:1007 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:973 +#: ../../library/typing.rst:1008 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:990 +#: ../../library/typing.rst:1025 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:994 +#: ../../library/typing.rst:1029 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1000 +#: ../../library/typing.rst:1035 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``List[object]`` " @@ -917,47 +1023,47 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1006 +#: ../../library/typing.rst:1041 msgid "" "``TypeGuard`` also works with type variables. For more information, see :" "pep:`647` (User-Defined Type Guards)." msgstr "" -#: ../../library/typing.rst:1013 +#: ../../library/typing.rst:1048 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1015 +#: ../../library/typing.rst:1050 msgid "" "These are not used in annotations. They are building blocks for creating " "generic types." msgstr "" -#: ../../library/typing.rst:1019 +#: ../../library/typing.rst:1054 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1021 +#: ../../library/typing.rst:1056 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1030 +#: ../../library/typing.rst:1065 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1043 +#: ../../library/typing.rst:1078 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1045 ../../library/typing.rst:1084 -#: ../../library/typing.rst:1261 +#: ../../library/typing.rst:1080 ../../library/typing.rst:1119 +#: ../../library/typing.rst:1296 msgid "Usage::" msgstr "" -#: ../../library/typing.rst:1050 +#: ../../library/typing.rst:1085 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -965,7 +1071,7 @@ msgid "" "types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1063 +#: ../../library/typing.rst:1098 msgid "" "The latter example's signature is essentially the overloading of ``(str, " "str) -> str`` and ``(bytes, bytes) -> bytes``. Also note that if the " @@ -973,13 +1079,13 @@ msgid "" "still plain :class:`str`." msgstr "" -#: ../../library/typing.rst:1068 +#: ../../library/typing.rst:1103 msgid "" "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, :" "func:`isinstance` and :func:`issubclass` should not be used with types." msgstr "" -#: ../../library/typing.rst:1071 +#: ../../library/typing.rst:1106 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " @@ -989,13 +1095,13 @@ msgid "" "must be a subclass of the boundary type, see :pep:`484`." msgstr "" -#: ../../library/typing.rst:1081 +#: ../../library/typing.rst:1116 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1088 +#: ../../library/typing.rst:1123 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1005,7 +1111,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1095 +#: ../../library/typing.rst:1130 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1013,27 +1119,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1119 +#: ../../library/typing.rst:1154 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1123 +#: ../../library/typing.rst:1158 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1125 +#: ../../library/typing.rst:1160 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1132 +#: ../../library/typing.rst:1167 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1046,7 +1152,7 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1142 +#: ../../library/typing.rst:1177 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1055,17 +1161,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1151 +#: ../../library/typing.rst:1186 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1157 +#: ../../library/typing.rst:1192 msgid ":class:`Callable` and :class:`Concatenate`." msgstr "" -#: ../../library/typing.rst:1162 +#: ../../library/typing.rst:1197 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1073,36 +1179,36 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1167 +#: ../../library/typing.rst:1202 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1179 +#: ../../library/typing.rst:1214 msgid "" "``AnyStr`` is a type variable defined as ``AnyStr = TypeVar('AnyStr', str, " "bytes)``." msgstr "" -#: ../../library/typing.rst:1182 +#: ../../library/typing.rst:1217 msgid "" "It is meant to be used for functions that may accept any kind of string " "without allowing different kinds of strings to mix. For example::" msgstr "" -#: ../../library/typing.rst:1194 +#: ../../library/typing.rst:1229 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1200 +#: ../../library/typing.rst:1235 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1212 +#: ../../library/typing.rst:1247 msgid "" "See :pep:`544` for details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1110,15 +1216,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1217 +#: ../../library/typing.rst:1252 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1227 +#: ../../library/typing.rst:1262 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1229 +#: ../../library/typing.rst:1264 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1127,7 +1233,7 @@ msgid "" "For example::" msgstr "" -#: ../../library/typing.rst:1242 +#: ../../library/typing.rst:1277 msgid "" ":func:`runtime_checkable` will check only the presence of the required " "methods, not their type signatures. For example, :class:`ssl.SSLObject` is a " @@ -1137,35 +1243,35 @@ msgid "" "making it impossible to call (instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:1253 +#: ../../library/typing.rst:1288 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1255 +#: ../../library/typing.rst:1290 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1259 +#: ../../library/typing.rst:1294 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1267 +#: ../../library/typing.rst:1302 msgid "This is equivalent to::" msgstr "" -#: ../../library/typing.rst:1271 +#: ../../library/typing.rst:1306 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1280 +#: ../../library/typing.rst:1315 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1282 +#: ../../library/typing.rst:1317 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1173,52 +1279,52 @@ msgid "" "attribute both of which are part of the namedtuple API.)" msgstr "" -#: ../../library/typing.rst:1288 +#: ../../library/typing.rst:1323 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1298 +#: ../../library/typing.rst:1333 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1302 +#: ../../library/typing.rst:1337 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1305 +#: ../../library/typing.rst:1340 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1308 +#: ../../library/typing.rst:1343 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1312 +#: ../../library/typing.rst:1347 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1318 +#: ../../library/typing.rst:1353 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1328 +#: ../../library/typing.rst:1363 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1333 +#: ../../library/typing.rst:1368 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1336 +#: ../../library/typing.rst:1371 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1226,7 +1332,7 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1352 +#: ../../library/typing.rst:1387 msgid "" "The type info for introspection can be accessed via ``Point2D." "__annotations__``, ``Point2D.__total__``, ``Point2D.__required_keys__``, and " @@ -1235,13 +1341,13 @@ msgid "" "two additional equivalent syntactic forms::" msgstr "" -#: ../../library/typing.rst:1362 +#: ../../library/typing.rst:1397 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "override this by specifying totality. Usage::" msgstr "" -#: ../../library/typing.rst:1370 +#: ../../library/typing.rst:1405 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1249,152 +1355,152 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1375 +#: ../../library/typing.rst:1410 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1380 +#: ../../library/typing.rst:1415 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1383 +#: ../../library/typing.rst:1418 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1387 +#: ../../library/typing.rst:1422 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1391 +#: ../../library/typing.rst:1426 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1396 +#: ../../library/typing.rst:1431 msgid "" ":class:`builtins.dict ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1402 +#: ../../library/typing.rst:1437 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1407 +#: ../../library/typing.rst:1442 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1417 +#: ../../library/typing.rst:1452 msgid "" ":class:`builtins.list ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1423 +#: ../../library/typing.rst:1458 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1427 +#: ../../library/typing.rst:1462 msgid "" ":class:`builtins.set ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1433 +#: ../../library/typing.rst:1468 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1435 +#: ../../library/typing.rst:1470 msgid "" ":class:`builtins.frozenset ` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1439 +#: ../../library/typing.rst:1474 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1442 +#: ../../library/typing.rst:1477 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1446 +#: ../../library/typing.rst:1481 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1450 +#: ../../library/typing.rst:1485 msgid "" ":class:`collections.defaultdict` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1456 +#: ../../library/typing.rst:1491 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1460 +#: ../../library/typing.rst:1495 msgid "" ":class:`collections.OrderedDict` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1466 +#: ../../library/typing.rst:1501 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:1471 +#: ../../library/typing.rst:1506 msgid "" ":class:`collections.ChainMap` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1477 +#: ../../library/typing.rst:1512 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:1482 +#: ../../library/typing.rst:1517 msgid "" ":class:`collections.Counter` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1488 +#: ../../library/typing.rst:1523 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:1493 +#: ../../library/typing.rst:1528 msgid "" ":class:`collections.deque` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1498 +#: ../../library/typing.rst:1533 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:1504 +#: ../../library/typing.rst:1539 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:1511 +#: ../../library/typing.rst:1546 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:1516 +#: ../../library/typing.rst:1551 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1402,413 +1508,413 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:1526 +#: ../../library/typing.rst:1561 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:1527 +#: ../../library/typing.rst:1562 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1533 +#: ../../library/typing.rst:1568 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:1537 +#: ../../library/typing.rst:1572 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:1546 +#: ../../library/typing.rst:1581 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:1549 +#: ../../library/typing.rst:1584 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:1553 +#: ../../library/typing.rst:1588 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:1555 +#: ../../library/typing.rst:1590 msgid "" ":class:`collections.abc.Set` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1561 +#: ../../library/typing.rst:1596 msgid "A generic version of :class:`collections.abc.ByteString`." msgstr "" -#: ../../library/typing.rst:1563 +#: ../../library/typing.rst:1598 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:1566 +#: ../../library/typing.rst:1601 msgid "" "As a shorthand for this type, :class:`bytes` can be used to annotate " "arguments of any of the types mentioned above." msgstr "" -#: ../../library/typing.rst:1569 +#: ../../library/typing.rst:1604 msgid "" ":class:`collections.abc.ByteString` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1575 +#: ../../library/typing.rst:1610 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:1579 +#: ../../library/typing.rst:1614 msgid "" ":class:`collections.abc.Collection` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1585 +#: ../../library/typing.rst:1620 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:1587 +#: ../../library/typing.rst:1622 msgid "" ":class:`collections.abc.Container` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1593 +#: ../../library/typing.rst:1628 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:1595 +#: ../../library/typing.rst:1630 msgid "" ":class:`collections.abc.ItemsView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1601 +#: ../../library/typing.rst:1636 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:1603 +#: ../../library/typing.rst:1638 msgid "" ":class:`collections.abc.KeysView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1609 +#: ../../library/typing.rst:1644 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:1615 +#: ../../library/typing.rst:1650 msgid "" ":class:`collections.abc.Mapping` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1621 +#: ../../library/typing.rst:1656 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:1623 +#: ../../library/typing.rst:1658 msgid "" ":class:`collections.abc.MappingView` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1629 +#: ../../library/typing.rst:1664 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:1631 +#: ../../library/typing.rst:1666 msgid "" ":class:`collections.abc.MutableMapping` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1637 +#: ../../library/typing.rst:1672 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:1639 +#: ../../library/typing.rst:1674 msgid "" ":class:`collections.abc.MutableSequence` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1645 +#: ../../library/typing.rst:1680 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:1647 +#: ../../library/typing.rst:1682 msgid "" ":class:`collections.abc.MutableSet` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1653 +#: ../../library/typing.rst:1688 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:1655 +#: ../../library/typing.rst:1690 msgid "" ":class:`collections.abc.Sequence` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1661 +#: ../../library/typing.rst:1696 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:1663 +#: ../../library/typing.rst:1698 msgid "" ":class:`collections.abc.ValuesView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1668 +#: ../../library/typing.rst:1703 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1707 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:1674 +#: ../../library/typing.rst:1709 msgid "" ":class:`collections.abc.Iterable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1680 +#: ../../library/typing.rst:1715 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:1682 +#: ../../library/typing.rst:1717 msgid "" ":class:`collections.abc.Iterator` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1688 +#: ../../library/typing.rst:1723 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:1697 +#: ../../library/typing.rst:1732 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:1701 +#: ../../library/typing.rst:1736 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:1709 +#: ../../library/typing.rst:1744 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:1717 +#: ../../library/typing.rst:1752 msgid "" ":class:`collections.abc.Generator` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1758 msgid "An alias to :class:`collections.abc.Hashable`" msgstr "" -#: ../../library/typing.rst:1727 +#: ../../library/typing.rst:1762 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:1729 +#: ../../library/typing.rst:1764 msgid "" ":class:`collections.abc.Reversible` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1735 +#: ../../library/typing.rst:1770 msgid "An alias to :class:`collections.abc.Sized`" msgstr "" -#: ../../library/typing.rst:1738 +#: ../../library/typing.rst:1773 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:1742 +#: ../../library/typing.rst:1777 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:1755 +#: ../../library/typing.rst:1790 msgid "" ":class:`collections.abc.Coroutine` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1761 +#: ../../library/typing.rst:1796 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:1770 +#: ../../library/typing.rst:1805 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:1774 +#: ../../library/typing.rst:1809 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:1782 +#: ../../library/typing.rst:1817 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:1792 +#: ../../library/typing.rst:1827 msgid "" ":class:`collections.abc.AsyncGenerator` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1798 +#: ../../library/typing.rst:1833 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:1802 +#: ../../library/typing.rst:1837 msgid "" ":class:`collections.abc.AsyncIterable` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1808 +#: ../../library/typing.rst:1843 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:1812 +#: ../../library/typing.rst:1847 msgid "" ":class:`collections.abc.AsyncIterator` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1818 +#: ../../library/typing.rst:1853 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:1822 +#: ../../library/typing.rst:1857 msgid "" ":class:`collections.abc.Awaitable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1828 +#: ../../library/typing.rst:1863 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:1832 +#: ../../library/typing.rst:1867 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:1837 +#: ../../library/typing.rst:1872 msgid "" ":class:`contextlib.AbstractContextManager` now supports ``[]``. See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1843 +#: ../../library/typing.rst:1878 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:1848 +#: ../../library/typing.rst:1883 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1853 +#: ../../library/typing.rst:1888 msgid "Protocols" msgstr "" -#: ../../library/typing.rst:1855 +#: ../../library/typing.rst:1890 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:1859 +#: ../../library/typing.rst:1894 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:1864 +#: ../../library/typing.rst:1899 msgid "An ABC with one abstract method ``__bytes__``." msgstr "" -#: ../../library/typing.rst:1868 +#: ../../library/typing.rst:1903 msgid "An ABC with one abstract method ``__complex__``." msgstr "" -#: ../../library/typing.rst:1872 +#: ../../library/typing.rst:1907 msgid "An ABC with one abstract method ``__float__``." msgstr "" -#: ../../library/typing.rst:1876 +#: ../../library/typing.rst:1911 msgid "An ABC with one abstract method ``__index__``." msgstr "" -#: ../../library/typing.rst:1882 +#: ../../library/typing.rst:1917 msgid "An ABC with one abstract method ``__int__``." msgstr "" -#: ../../library/typing.rst:1886 +#: ../../library/typing.rst:1921 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:1890 +#: ../../library/typing.rst:1925 msgid "Functions and decorators" msgstr "" -#: ../../library/typing.rst:1894 +#: ../../library/typing.rst:1929 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:1896 +#: ../../library/typing.rst:1931 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:1903 +#: ../../library/typing.rst:1938 msgid "" "The ``@overload`` decorator allows describing functions and methods that " "support multiple different combinations of argument types. A series of " @@ -1823,69 +1929,69 @@ msgid "" "variable::" msgstr "" -#: ../../library/typing.rst:1927 +#: ../../library/typing.rst:1962 msgid "See :pep:`484` for details and comparison with other typing semantics." msgstr "" -#: ../../library/typing.rst:1931 +#: ../../library/typing.rst:1966 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:1956 +#: ../../library/typing.rst:1991 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:1958 +#: ../../library/typing.rst:1993 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods defined in that class (but not to methods defined " "in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:1962 +#: ../../library/typing.rst:1997 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:1966 +#: ../../library/typing.rst:2001 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:1968 +#: ../../library/typing.rst:2003 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:1973 +#: ../../library/typing.rst:2008 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:1975 +#: ../../library/typing.rst:2010 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:1986 +#: ../../library/typing.rst:2021 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:1990 +#: ../../library/typing.rst:2025 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:1994 +#: ../../library/typing.rst:2029 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:1997 +#: ../../library/typing.rst:2032 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -1895,29 +2001,29 @@ msgid "" "merging all the ``__annotations__`` along ``C.__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2005 +#: ../../library/typing.rst:2040 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2020 +#: ../../library/typing.rst:2055 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2025 +#: ../../library/typing.rst:2060 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "" -#: ../../library/typing.rst:2031 +#: ../../library/typing.rst:2066 msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:2033 +#: ../../library/typing.rst:2068 msgid "" "For a typing object of the form ``X[Y, Z, ...]`` these functions return " "``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" @@ -1928,11 +2034,11 @@ msgid "" "and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:2052 +#: ../../library/typing.rst:2087 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2067 +#: ../../library/typing.rst:2102 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -1940,24 +2046,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2073 +#: ../../library/typing.rst:2108 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2080 +#: ../../library/typing.rst:2115 msgid "Constant" msgstr "" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2119 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2093 +#: ../../library/typing.rst:2128 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -1965,7 +2071,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2100 +#: ../../library/typing.rst:2135 msgid "" "If ``from __future__ import annotations`` is used in Python 3.7 or later, " "annotations are not evaluated at function definition time. Instead, they are " diff --git a/reference/datamodel.po b/reference/datamodel.po index f6fe9bd3d8..e263849ac3 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-10-29 00:08+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-" @@ -2964,8 +2964,8 @@ msgstr "" #: ../../reference/datamodel.rst:2544 msgid "" -"If :meth:`__int__` is not defined then the built-in function :func:`int` " -"falls back to :meth:`__trunc__`." +"The built-in function :func:`int` falls back to :meth:`__trunc__` if " +"neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" #: ../../reference/datamodel.rst:2551 pFad - Phonifier reborn

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

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


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy