diff --git a/c-api/typeobj.po b/c-api/typeobj.po index a5e9d4fcee..a8a77ff56a 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-08 00:19+0000\n" +"POT-Creation-Date: 2022-11-29 00:17+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-" @@ -20,7 +20,7 @@ msgstr "" #: ../../c-api/typeobj.rst:6 msgid "Type Objects" -msgstr "" +msgstr "型別物件" #: ../../c-api/typeobj.rst:8 msgid "" @@ -62,7 +62,7 @@ msgstr "" msgid "PyTypeObject Slot [#slots]_" msgstr "" -#: ../../c-api/typeobj.rst:40 ../../c-api/typeobj.rst:193 +#: ../../c-api/typeobj.rst:40 ../../c-api/typeobj.rst:199 msgid ":ref:`Type `" msgstr "" @@ -129,7 +129,7 @@ msgstr ":c:member:`~PyTypeObject.tp_basicsize`" #: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:46 #: ../../c-api/typeobj.rst:48 ../../c-api/typeobj.rst:52 #: ../../c-api/typeobj.rst:99 ../../c-api/typeobj.rst:120 -#: ../../c-api/typeobj.rst:408 +#: ../../c-api/typeobj.rst:414 msgid ":c:type:`Py_ssize_t`" msgstr ":c:type:`Py_ssize_t`" @@ -142,7 +142,7 @@ msgid ":c:member:`~PyTypeObject.tp_dealloc`" msgstr ":c:member:`~PyTypeObject.tp_dealloc`" #: ../../c-api/typeobj.rst:50 ../../c-api/typeobj.rst:142 -#: ../../c-api/typeobj.rst:146 ../../c-api/typeobj.rst:338 +#: ../../c-api/typeobj.rst:146 ../../c-api/typeobj.rst:344 msgid ":c:type:`destructor`" msgstr ":c:type:`destructor`" @@ -154,7 +154,7 @@ msgstr ":c:member:`~PyTypeObject.tp_vectorcall_offset`" msgid "(:c:member:`~PyTypeObject.tp_getattr`)" msgstr "(:c:member:`~PyTypeObject.tp_getattr`)" -#: ../../c-api/typeobj.rst:54 ../../c-api/typeobj.rst:362 +#: ../../c-api/typeobj.rst:54 ../../c-api/typeobj.rst:368 msgid ":c:type:`getattrfunc`" msgstr ":c:type:`getattrfunc`" @@ -173,7 +173,7 @@ msgstr "G" msgid "(:c:member:`~PyTypeObject.tp_setattr`)" msgstr "(:c:member:`~PyTypeObject.tp_setattr`)" -#: ../../c-api/typeobj.rst:57 ../../c-api/typeobj.rst:367 +#: ../../c-api/typeobj.rst:57 ../../c-api/typeobj.rst:373 msgid ":c:type:`setattrfunc`" msgstr ":c:type:`setattrfunc`" @@ -205,7 +205,7 @@ msgid ":c:member:`~PyTypeObject.tp_repr`" msgstr ":c:member:`~PyTypeObject.tp_repr`" #: ../../c-api/typeobj.rst:62 ../../c-api/typeobj.rst:74 -#: ../../c-api/typeobj.rst:360 +#: ../../c-api/typeobj.rst:366 msgid ":c:type:`reprfunc`" msgstr ":c:type:`reprfunc`" @@ -241,7 +241,7 @@ msgstr ":c:type:`PyMappingMethods` *" msgid ":c:member:`~PyTypeObject.tp_hash`" msgstr ":c:member:`~PyTypeObject.tp_hash`" -#: ../../c-api/typeobj.rst:70 ../../c-api/typeobj.rst:396 +#: ../../c-api/typeobj.rst:70 ../../c-api/typeobj.rst:402 msgid ":c:type:`hashfunc`" msgstr ":c:type:`hashfunc`" @@ -253,8 +253,8 @@ msgstr "__hash__" msgid ":c:member:`~PyTypeObject.tp_call`" msgstr ":c:member:`~PyTypeObject.tp_call`" -#: ../../c-api/typeobj.rst:72 ../../c-api/typeobj.rst:229 -#: ../../c-api/typeobj.rst:232 ../../c-api/typeobj.rst:432 +#: ../../c-api/typeobj.rst:72 ../../c-api/typeobj.rst:235 +#: ../../c-api/typeobj.rst:238 ../../c-api/typeobj.rst:438 msgid ":c:type:`ternaryfunc`" msgstr ":c:type:`ternaryfunc`" @@ -274,7 +274,7 @@ msgstr "__str__" msgid ":c:member:`~PyTypeObject.tp_getattro`" msgstr ":c:member:`~PyTypeObject.tp_getattro`" -#: ../../c-api/typeobj.rst:76 ../../c-api/typeobj.rst:373 +#: ../../c-api/typeobj.rst:76 ../../c-api/typeobj.rst:379 msgid ":c:type:`getattrofunc`" msgstr ":c:type:`getattrofunc`" @@ -282,7 +282,7 @@ msgstr ":c:type:`getattrofunc`" msgid ":c:member:`~PyTypeObject.tp_setattro`" msgstr ":c:member:`~PyTypeObject.tp_setattro`" -#: ../../c-api/typeobj.rst:79 ../../c-api/typeobj.rst:378 +#: ../../c-api/typeobj.rst:79 ../../c-api/typeobj.rst:384 msgid ":c:type:`setattrofunc`" msgstr ":c:type:`setattrofunc`" @@ -321,7 +321,7 @@ msgstr "__doc__" msgid ":c:member:`~PyTypeObject.tp_traverse`" msgstr ":c:member:`~PyTypeObject.tp_traverse`" -#: ../../c-api/typeobj.rst:88 ../../c-api/typeobj.rst:342 +#: ../../c-api/typeobj.rst:88 ../../c-api/typeobj.rst:348 msgid ":c:type:`traverseproc`" msgstr ":c:type:`traverseproc`" @@ -330,7 +330,7 @@ msgid ":c:member:`~PyTypeObject.tp_clear`" msgstr ":c:member:`~PyTypeObject.tp_clear`" #: ../../c-api/typeobj.rst:90 ../../c-api/typeobj.rst:130 -#: ../../c-api/typeobj.rst:240 ../../c-api/typeobj.rst:421 +#: ../../c-api/typeobj.rst:246 ../../c-api/typeobj.rst:427 msgid ":c:type:`inquiry`" msgstr ":c:type:`inquiry`" @@ -338,7 +338,7 @@ msgstr ":c:type:`inquiry`" msgid ":c:member:`~PyTypeObject.tp_richcompare`" msgstr ":c:member:`~PyTypeObject.tp_richcompare`" -#: ../../c-api/typeobj.rst:92 ../../c-api/typeobj.rst:398 +#: ../../c-api/typeobj.rst:92 ../../c-api/typeobj.rst:404 msgid ":c:type:`richcmpfunc`" msgstr ":c:type:`richcmpfunc`" @@ -354,7 +354,7 @@ msgstr ":c:member:`~PyTypeObject.tp_weaklistoffset`" msgid ":c:member:`~PyTypeObject.tp_iter`" msgstr ":c:member:`~PyTypeObject.tp_iter`" -#: ../../c-api/typeobj.rst:101 ../../c-api/typeobj.rst:404 +#: ../../c-api/typeobj.rst:101 ../../c-api/typeobj.rst:410 msgid ":c:type:`getiterfunc`" msgstr ":c:type:`getiterfunc`" @@ -366,7 +366,7 @@ msgstr "__iter__" msgid ":c:member:`~PyTypeObject.tp_iternext`" msgstr ":c:member:`~PyTypeObject.tp_iternext`" -#: ../../c-api/typeobj.rst:103 ../../c-api/typeobj.rst:406 +#: ../../c-api/typeobj.rst:103 ../../c-api/typeobj.rst:412 msgid ":c:type:`iternextfunc`" msgstr ":c:type:`iternextfunc`" @@ -417,14 +417,14 @@ msgstr ":c:member:`~PyTypeObject.tp_dict`" #: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:113 #: ../../c-api/typeobj.rst:132 ../../c-api/typeobj.rst:134 #: ../../c-api/typeobj.rst:136 ../../c-api/typeobj.rst:138 -#: ../../c-api/typeobj.rst:140 ../../c-api/typeobj.rst:333 -#: ../../c-api/typeobj.rst:348 ../../c-api/typeobj.rst:360 -#: ../../c-api/typeobj.rst:362 ../../c-api/typeobj.rst:373 -#: ../../c-api/typeobj.rst:384 ../../c-api/typeobj.rst:396 -#: ../../c-api/typeobj.rst:398 ../../c-api/typeobj.rst:404 -#: ../../c-api/typeobj.rst:406 ../../c-api/typeobj.rst:408 -#: ../../c-api/typeobj.rst:423 ../../c-api/typeobj.rst:427 -#: ../../c-api/typeobj.rst:432 ../../c-api/typeobj.rst:438 +#: ../../c-api/typeobj.rst:140 ../../c-api/typeobj.rst:339 +#: ../../c-api/typeobj.rst:354 ../../c-api/typeobj.rst:366 +#: ../../c-api/typeobj.rst:368 ../../c-api/typeobj.rst:379 +#: ../../c-api/typeobj.rst:390 ../../c-api/typeobj.rst:402 +#: ../../c-api/typeobj.rst:404 ../../c-api/typeobj.rst:410 +#: ../../c-api/typeobj.rst:412 ../../c-api/typeobj.rst:414 +#: ../../c-api/typeobj.rst:429 ../../c-api/typeobj.rst:433 +#: ../../c-api/typeobj.rst:438 ../../c-api/typeobj.rst:444 msgid ":c:type:`PyObject` *" msgstr ":c:type:`PyObject` *" @@ -436,7 +436,7 @@ msgstr "__dict__" msgid ":c:member:`~PyTypeObject.tp_descr_get`" msgstr ":c:member:`~PyTypeObject.tp_descr_get`" -#: ../../c-api/typeobj.rst:115 ../../c-api/typeobj.rst:384 +#: ../../c-api/typeobj.rst:115 ../../c-api/typeobj.rst:390 msgid ":c:type:`descrgetfunc`" msgstr ":c:type:`descrgetfunc`" @@ -448,7 +448,7 @@ msgstr "__get__" msgid ":c:member:`~PyTypeObject.tp_descr_set`" msgstr ":c:member:`~PyTypeObject.tp_descr_set`" -#: ../../c-api/typeobj.rst:117 ../../c-api/typeobj.rst:390 +#: ../../c-api/typeobj.rst:117 ../../c-api/typeobj.rst:396 msgid ":c:type:`descrsetfunc`" msgstr ":c:type:`descrsetfunc`" @@ -464,7 +464,7 @@ msgstr ":c:member:`~PyTypeObject.tp_dictoffset`" msgid ":c:member:`~PyTypeObject.tp_init`" msgstr ":c:member:`~PyTypeObject.tp_init`" -#: ../../c-api/typeobj.rst:122 ../../c-api/typeobj.rst:354 +#: ../../c-api/typeobj.rst:122 ../../c-api/typeobj.rst:360 msgid ":c:type:`initproc`" msgstr ":c:type:`initproc`" @@ -476,7 +476,7 @@ msgstr "__init__" msgid ":c:member:`~PyTypeObject.tp_alloc`" msgstr ":c:member:`~PyTypeObject.tp_alloc`" -#: ../../c-api/typeobj.rst:124 ../../c-api/typeobj.rst:333 +#: ../../c-api/typeobj.rst:124 ../../c-api/typeobj.rst:339 msgid ":c:type:`allocfunc`" msgstr ":c:type:`allocfunc`" @@ -484,7 +484,7 @@ msgstr ":c:type:`allocfunc`" msgid ":c:member:`~PyTypeObject.tp_new`" msgstr ":c:member:`~PyTypeObject.tp_new`" -#: ../../c-api/typeobj.rst:126 ../../c-api/typeobj.rst:348 +#: ../../c-api/typeobj.rst:126 ../../c-api/typeobj.rst:354 msgid ":c:type:`newfunc`" msgstr ":c:type:`newfunc`" @@ -496,7 +496,7 @@ msgstr "__new__" msgid ":c:member:`~PyTypeObject.tp_free`" msgstr ":c:member:`~PyTypeObject.tp_free`" -#: ../../c-api/typeobj.rst:128 ../../c-api/typeobj.rst:340 +#: ../../c-api/typeobj.rst:128 ../../c-api/typeobj.rst:346 msgid ":c:type:`freefunc`" msgstr ":c:type:`freefunc`" @@ -568,529 +568,541 @@ msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../c-api/typeobj.rst:152 +#: ../../c-api/typeobj.rst:153 msgid "" -"A slot name in parentheses indicates it is (effectively) deprecated. Names " -"in angle brackets should be treated as read-only. Names in square brackets " -"are for internal use only. \"\" (as a prefix) means the field is required " -"(must be non-``NULL``)." +"**()**: A slot name in parentheses indicates it is (effectively) deprecated." msgstr "" -#: ../../c-api/typeobj.rst:156 -msgid "Columns:" +#: ../../c-api/typeobj.rst:155 +msgid "" +"**<>**: Names in angle brackets should be initially set to ``NULL`` and " +"treated as read-only." msgstr "" #: ../../c-api/typeobj.rst:158 -msgid "**\"O\"**: set on :c:type:`PyBaseObject_Type`" +msgid "**[]**: Names in square brackets are for internal use only." msgstr "" #: ../../c-api/typeobj.rst:160 -msgid "**\"T\"**: set on :c:type:`PyType_Type`" +msgid "" +"**** (as a prefix) means the field is required (must be non-``NULL``)." msgstr "" #: ../../c-api/typeobj.rst:162 +msgid "Columns:" +msgstr "" + +#: ../../c-api/typeobj.rst:164 +msgid "**\"O\"**: set on :c:type:`PyBaseObject_Type`" +msgstr "" + +#: ../../c-api/typeobj.rst:166 +msgid "**\"T\"**: set on :c:type:`PyType_Type`" +msgstr "" + +#: ../../c-api/typeobj.rst:168 msgid "**\"D\"**: default (if slot is set to ``NULL``)" msgstr "" -#: ../../c-api/typeobj.rst:172 +#: ../../c-api/typeobj.rst:178 msgid "**\"I\"**: inheritance" msgstr "" -#: ../../c-api/typeobj.rst:181 +#: ../../c-api/typeobj.rst:187 msgid "" "Note that some slots are effectively inherited through the normal attribute " "lookup chain." msgstr "" -#: ../../c-api/typeobj.rst:187 +#: ../../c-api/typeobj.rst:193 msgid "sub-slots" msgstr "" -#: ../../c-api/typeobj.rst:193 +#: ../../c-api/typeobj.rst:199 msgid "Slot" msgstr "" -#: ../../c-api/typeobj.rst:193 +#: ../../c-api/typeobj.rst:199 msgid "special methods" msgstr "" -#: ../../c-api/typeobj.rst:196 +#: ../../c-api/typeobj.rst:202 msgid ":c:member:`~PyAsyncMethods.am_await`" msgstr ":c:member:`~PyAsyncMethods.am_await`" -#: ../../c-api/typeobj.rst:196 ../../c-api/typeobj.rst:198 -#: ../../c-api/typeobj.rst:200 ../../c-api/typeobj.rst:234 -#: ../../c-api/typeobj.rst:236 ../../c-api/typeobj.rst:238 -#: ../../c-api/typeobj.rst:242 ../../c-api/typeobj.rst:269 -#: ../../c-api/typeobj.rst:273 ../../c-api/typeobj.rst:283 -#: ../../c-api/typeobj.rst:423 +#: ../../c-api/typeobj.rst:202 ../../c-api/typeobj.rst:204 +#: ../../c-api/typeobj.rst:206 ../../c-api/typeobj.rst:240 +#: ../../c-api/typeobj.rst:242 ../../c-api/typeobj.rst:244 +#: ../../c-api/typeobj.rst:248 ../../c-api/typeobj.rst:275 +#: ../../c-api/typeobj.rst:279 ../../c-api/typeobj.rst:289 +#: ../../c-api/typeobj.rst:429 msgid ":c:type:`unaryfunc`" msgstr ":c:type:`unaryfunc`" -#: ../../c-api/typeobj.rst:196 +#: ../../c-api/typeobj.rst:202 msgid "__await__" msgstr "__await__" -#: ../../c-api/typeobj.rst:198 +#: ../../c-api/typeobj.rst:204 msgid ":c:member:`~PyAsyncMethods.am_aiter`" msgstr ":c:member:`~PyAsyncMethods.am_aiter`" -#: ../../c-api/typeobj.rst:198 +#: ../../c-api/typeobj.rst:204 msgid "__aiter__" msgstr "__aiter__" -#: ../../c-api/typeobj.rst:200 +#: ../../c-api/typeobj.rst:206 msgid ":c:member:`~PyAsyncMethods.am_anext`" msgstr ":c:member:`~PyAsyncMethods.am_anext`" -#: ../../c-api/typeobj.rst:200 +#: ../../c-api/typeobj.rst:206 msgid "__anext__" msgstr "__anext__" -#: ../../c-api/typeobj.rst:202 +#: ../../c-api/typeobj.rst:208 msgid ":c:member:`~PyAsyncMethods.am_send`" msgstr ":c:member:`~PyAsyncMethods.am_send`" -#: ../../c-api/typeobj.rst:202 +#: ../../c-api/typeobj.rst:208 msgid ":c:type:`sendfunc`" msgstr ":c:type:`sendfunc`" -#: ../../c-api/typeobj.rst:206 +#: ../../c-api/typeobj.rst:212 msgid ":c:member:`~PyNumberMethods.nb_add`" msgstr ":c:member:`~PyNumberMethods.nb_add`" -#: ../../c-api/typeobj.rst:206 ../../c-api/typeobj.rst:209 -#: ../../c-api/typeobj.rst:211 ../../c-api/typeobj.rst:214 -#: ../../c-api/typeobj.rst:216 ../../c-api/typeobj.rst:219 -#: ../../c-api/typeobj.rst:221 ../../c-api/typeobj.rst:224 -#: ../../c-api/typeobj.rst:226 ../../c-api/typeobj.rst:244 -#: ../../c-api/typeobj.rst:247 ../../c-api/typeobj.rst:249 -#: ../../c-api/typeobj.rst:252 ../../c-api/typeobj.rst:254 -#: ../../c-api/typeobj.rst:257 ../../c-api/typeobj.rst:259 -#: ../../c-api/typeobj.rst:262 ../../c-api/typeobj.rst:264 -#: ../../c-api/typeobj.rst:267 ../../c-api/typeobj.rst:275 -#: ../../c-api/typeobj.rst:277 ../../c-api/typeobj.rst:279 -#: ../../c-api/typeobj.rst:281 ../../c-api/typeobj.rst:285 -#: ../../c-api/typeobj.rst:288 ../../c-api/typeobj.rst:294 -#: ../../c-api/typeobj.rst:303 ../../c-api/typeobj.rst:314 -#: ../../c-api/typeobj.rst:427 +#: ../../c-api/typeobj.rst:212 ../../c-api/typeobj.rst:215 +#: ../../c-api/typeobj.rst:217 ../../c-api/typeobj.rst:220 +#: ../../c-api/typeobj.rst:222 ../../c-api/typeobj.rst:225 +#: ../../c-api/typeobj.rst:227 ../../c-api/typeobj.rst:230 +#: ../../c-api/typeobj.rst:232 ../../c-api/typeobj.rst:250 +#: ../../c-api/typeobj.rst:253 ../../c-api/typeobj.rst:255 +#: ../../c-api/typeobj.rst:258 ../../c-api/typeobj.rst:260 +#: ../../c-api/typeobj.rst:263 ../../c-api/typeobj.rst:265 +#: ../../c-api/typeobj.rst:268 ../../c-api/typeobj.rst:270 +#: ../../c-api/typeobj.rst:273 ../../c-api/typeobj.rst:281 +#: ../../c-api/typeobj.rst:283 ../../c-api/typeobj.rst:285 +#: ../../c-api/typeobj.rst:287 ../../c-api/typeobj.rst:291 +#: ../../c-api/typeobj.rst:294 ../../c-api/typeobj.rst:300 +#: ../../c-api/typeobj.rst:309 ../../c-api/typeobj.rst:320 +#: ../../c-api/typeobj.rst:433 msgid ":c:type:`binaryfunc`" msgstr ":c:type:`binaryfunc`" -#: ../../c-api/typeobj.rst:206 +#: ../../c-api/typeobj.rst:212 msgid "__add__ __radd__" msgstr "__add__ __radd__" -#: ../../c-api/typeobj.rst:209 +#: ../../c-api/typeobj.rst:215 msgid ":c:member:`~PyNumberMethods.nb_inplace_add`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_add`" -#: ../../c-api/typeobj.rst:209 ../../c-api/typeobj.rst:314 +#: ../../c-api/typeobj.rst:215 ../../c-api/typeobj.rst:320 msgid "__iadd__" msgstr "__iadd__" -#: ../../c-api/typeobj.rst:211 +#: ../../c-api/typeobj.rst:217 msgid ":c:member:`~PyNumberMethods.nb_subtract`" msgstr ":c:member:`~PyNumberMethods.nb_subtract`" -#: ../../c-api/typeobj.rst:211 +#: ../../c-api/typeobj.rst:217 msgid "__sub__ __rsub__" msgstr "__sub__ __rsub__" -#: ../../c-api/typeobj.rst:214 +#: ../../c-api/typeobj.rst:220 msgid ":c:member:`~PyNumberMethods.nb_inplace_subtract`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_subtract`" -#: ../../c-api/typeobj.rst:214 +#: ../../c-api/typeobj.rst:220 msgid "__isub__" msgstr "__isub__" -#: ../../c-api/typeobj.rst:216 +#: ../../c-api/typeobj.rst:222 msgid ":c:member:`~PyNumberMethods.nb_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_multiply`" -#: ../../c-api/typeobj.rst:216 +#: ../../c-api/typeobj.rst:222 msgid "__mul__ __rmul__" msgstr "__mul__ __rmul__" -#: ../../c-api/typeobj.rst:219 +#: ../../c-api/typeobj.rst:225 msgid ":c:member:`~PyNumberMethods.nb_inplace_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_multiply`" -#: ../../c-api/typeobj.rst:219 ../../c-api/typeobj.rst:316 +#: ../../c-api/typeobj.rst:225 ../../c-api/typeobj.rst:322 msgid "__imul__" msgstr "__imul__" -#: ../../c-api/typeobj.rst:221 +#: ../../c-api/typeobj.rst:227 msgid ":c:member:`~PyNumberMethods.nb_remainder`" msgstr ":c:member:`~PyNumberMethods.nb_remainder`" -#: ../../c-api/typeobj.rst:221 +#: ../../c-api/typeobj.rst:227 msgid "__mod__ __rmod__" msgstr "__mod__ __rmod__" -#: ../../c-api/typeobj.rst:224 +#: ../../c-api/typeobj.rst:230 msgid ":c:member:`~PyNumberMethods.nb_inplace_remainder`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_remainder`" -#: ../../c-api/typeobj.rst:224 +#: ../../c-api/typeobj.rst:230 msgid "__imod__" msgstr "__imod__" -#: ../../c-api/typeobj.rst:226 +#: ../../c-api/typeobj.rst:232 msgid ":c:member:`~PyNumberMethods.nb_divmod`" msgstr ":c:member:`~PyNumberMethods.nb_divmod`" -#: ../../c-api/typeobj.rst:226 +#: ../../c-api/typeobj.rst:232 msgid "__divmod__ __rdivmod__" msgstr "__divmod__ __rdivmod__" -#: ../../c-api/typeobj.rst:229 +#: ../../c-api/typeobj.rst:235 msgid ":c:member:`~PyNumberMethods.nb_power`" msgstr ":c:member:`~PyNumberMethods.nb_power`" -#: ../../c-api/typeobj.rst:229 +#: ../../c-api/typeobj.rst:235 msgid "__pow__ __rpow__" msgstr "__pow__ __rpow__" -#: ../../c-api/typeobj.rst:232 +#: ../../c-api/typeobj.rst:238 msgid ":c:member:`~PyNumberMethods.nb_inplace_power`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_power`" -#: ../../c-api/typeobj.rst:232 +#: ../../c-api/typeobj.rst:238 msgid "__ipow__" msgstr "__ipow__" -#: ../../c-api/typeobj.rst:234 +#: ../../c-api/typeobj.rst:240 msgid ":c:member:`~PyNumberMethods.nb_negative`" msgstr ":c:member:`~PyNumberMethods.nb_negative`" -#: ../../c-api/typeobj.rst:234 +#: ../../c-api/typeobj.rst:240 msgid "__neg__" msgstr "__neg__" -#: ../../c-api/typeobj.rst:236 +#: ../../c-api/typeobj.rst:242 msgid ":c:member:`~PyNumberMethods.nb_positive`" msgstr ":c:member:`~PyNumberMethods.nb_positive`" -#: ../../c-api/typeobj.rst:236 +#: ../../c-api/typeobj.rst:242 msgid "__pos__" msgstr "__pos__" -#: ../../c-api/typeobj.rst:238 +#: ../../c-api/typeobj.rst:244 msgid ":c:member:`~PyNumberMethods.nb_absolute`" msgstr ":c:member:`~PyNumberMethods.nb_absolute`" -#: ../../c-api/typeobj.rst:238 +#: ../../c-api/typeobj.rst:244 msgid "__abs__" msgstr "__abs__" -#: ../../c-api/typeobj.rst:240 +#: ../../c-api/typeobj.rst:246 msgid ":c:member:`~PyNumberMethods.nb_bool`" msgstr ":c:member:`~PyNumberMethods.nb_bool`" -#: ../../c-api/typeobj.rst:240 +#: ../../c-api/typeobj.rst:246 msgid "__bool__" msgstr "__bool__" -#: ../../c-api/typeobj.rst:242 +#: ../../c-api/typeobj.rst:248 msgid ":c:member:`~PyNumberMethods.nb_invert`" msgstr ":c:member:`~PyNumberMethods.nb_invert`" -#: ../../c-api/typeobj.rst:242 +#: ../../c-api/typeobj.rst:248 msgid "__invert__" msgstr "__invert__" -#: ../../c-api/typeobj.rst:244 +#: ../../c-api/typeobj.rst:250 msgid ":c:member:`~PyNumberMethods.nb_lshift`" msgstr ":c:member:`~PyNumberMethods.nb_lshift`" -#: ../../c-api/typeobj.rst:244 +#: ../../c-api/typeobj.rst:250 msgid "__lshift__ __rlshift__" msgstr "__lshift__ __rlshift__" -#: ../../c-api/typeobj.rst:247 +#: ../../c-api/typeobj.rst:253 msgid ":c:member:`~PyNumberMethods.nb_inplace_lshift`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_lshift`" -#: ../../c-api/typeobj.rst:247 +#: ../../c-api/typeobj.rst:253 msgid "__ilshift__" msgstr "__ilshift__" -#: ../../c-api/typeobj.rst:249 +#: ../../c-api/typeobj.rst:255 msgid ":c:member:`~PyNumberMethods.nb_rshift`" msgstr ":c:member:`~PyNumberMethods.nb_rshift`" -#: ../../c-api/typeobj.rst:249 +#: ../../c-api/typeobj.rst:255 msgid "__rshift__ __rrshift__" msgstr "__rshift__ __rrshift__" -#: ../../c-api/typeobj.rst:252 +#: ../../c-api/typeobj.rst:258 msgid ":c:member:`~PyNumberMethods.nb_inplace_rshift`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_rshift`" -#: ../../c-api/typeobj.rst:252 +#: ../../c-api/typeobj.rst:258 msgid "__irshift__" msgstr "__irshift__" -#: ../../c-api/typeobj.rst:254 +#: ../../c-api/typeobj.rst:260 msgid ":c:member:`~PyNumberMethods.nb_and`" msgstr ":c:member:`~PyNumberMethods.nb_and`" -#: ../../c-api/typeobj.rst:254 +#: ../../c-api/typeobj.rst:260 msgid "__and__ __rand__" msgstr "__and__ __rand__" -#: ../../c-api/typeobj.rst:257 +#: ../../c-api/typeobj.rst:263 msgid ":c:member:`~PyNumberMethods.nb_inplace_and`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_and`" -#: ../../c-api/typeobj.rst:257 +#: ../../c-api/typeobj.rst:263 msgid "__iand__" msgstr "__iand__" -#: ../../c-api/typeobj.rst:259 +#: ../../c-api/typeobj.rst:265 msgid ":c:member:`~PyNumberMethods.nb_xor`" msgstr ":c:member:`~PyNumberMethods.nb_xor`" -#: ../../c-api/typeobj.rst:259 +#: ../../c-api/typeobj.rst:265 msgid "__xor__ __rxor__" msgstr "__xor__ __rxor__" -#: ../../c-api/typeobj.rst:262 +#: ../../c-api/typeobj.rst:268 msgid ":c:member:`~PyNumberMethods.nb_inplace_xor`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_xor`" -#: ../../c-api/typeobj.rst:262 +#: ../../c-api/typeobj.rst:268 msgid "__ixor__" msgstr "__ixor__" -#: ../../c-api/typeobj.rst:264 +#: ../../c-api/typeobj.rst:270 msgid ":c:member:`~PyNumberMethods.nb_or`" msgstr ":c:member:`~PyNumberMethods.nb_or`" -#: ../../c-api/typeobj.rst:264 +#: ../../c-api/typeobj.rst:270 msgid "__or__ __ror__" msgstr "__or__ __ror__" -#: ../../c-api/typeobj.rst:267 +#: ../../c-api/typeobj.rst:273 msgid ":c:member:`~PyNumberMethods.nb_inplace_or`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_or`" -#: ../../c-api/typeobj.rst:267 +#: ../../c-api/typeobj.rst:273 msgid "__ior__" msgstr "__ior__" -#: ../../c-api/typeobj.rst:269 +#: ../../c-api/typeobj.rst:275 msgid ":c:member:`~PyNumberMethods.nb_int`" msgstr ":c:member:`~PyNumberMethods.nb_int`" -#: ../../c-api/typeobj.rst:269 +#: ../../c-api/typeobj.rst:275 msgid "__int__" msgstr "__int__" -#: ../../c-api/typeobj.rst:271 +#: ../../c-api/typeobj.rst:277 msgid ":c:member:`~PyNumberMethods.nb_reserved`" msgstr ":c:member:`~PyNumberMethods.nb_reserved`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:271 -#: ../../c-api/typeobj.rst:338 ../../c-api/typeobj.rst:340 -#: ../../c-api/typeobj.rst:421 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:277 +#: ../../c-api/typeobj.rst:344 ../../c-api/typeobj.rst:346 +#: ../../c-api/typeobj.rst:427 msgid "void *" msgstr "void *" -#: ../../c-api/typeobj.rst:273 +#: ../../c-api/typeobj.rst:279 msgid ":c:member:`~PyNumberMethods.nb_float`" msgstr ":c:member:`~PyNumberMethods.nb_float`" -#: ../../c-api/typeobj.rst:273 +#: ../../c-api/typeobj.rst:279 msgid "__float__" msgstr "__float__" -#: ../../c-api/typeobj.rst:275 +#: ../../c-api/typeobj.rst:281 msgid ":c:member:`~PyNumberMethods.nb_floor_divide`" msgstr ":c:member:`~PyNumberMethods.nb_floor_divide`" -#: ../../c-api/typeobj.rst:275 +#: ../../c-api/typeobj.rst:281 msgid "__floordiv__" msgstr "__floordiv__" -#: ../../c-api/typeobj.rst:277 +#: ../../c-api/typeobj.rst:283 msgid ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" -#: ../../c-api/typeobj.rst:277 +#: ../../c-api/typeobj.rst:283 msgid "__ifloordiv__" msgstr "__ifloordiv__" -#: ../../c-api/typeobj.rst:279 +#: ../../c-api/typeobj.rst:285 msgid ":c:member:`~PyNumberMethods.nb_true_divide`" msgstr ":c:member:`~PyNumberMethods.nb_true_divide`" -#: ../../c-api/typeobj.rst:279 +#: ../../c-api/typeobj.rst:285 msgid "__truediv__" msgstr "__truediv__" -#: ../../c-api/typeobj.rst:281 +#: ../../c-api/typeobj.rst:287 msgid ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" -#: ../../c-api/typeobj.rst:281 +#: ../../c-api/typeobj.rst:287 msgid "__itruediv__" msgstr "__itruediv__" -#: ../../c-api/typeobj.rst:283 +#: ../../c-api/typeobj.rst:289 msgid ":c:member:`~PyNumberMethods.nb_index`" msgstr ":c:member:`~PyNumberMethods.nb_index`" -#: ../../c-api/typeobj.rst:283 +#: ../../c-api/typeobj.rst:289 msgid "__index__" msgstr "__index__" -#: ../../c-api/typeobj.rst:285 +#: ../../c-api/typeobj.rst:291 msgid ":c:member:`~PyNumberMethods.nb_matrix_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_matrix_multiply`" -#: ../../c-api/typeobj.rst:285 +#: ../../c-api/typeobj.rst:291 msgid "__matmul__ __rmatmul__" msgstr "__matmul__ __rmatmul__" -#: ../../c-api/typeobj.rst:288 +#: ../../c-api/typeobj.rst:294 msgid ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" -#: ../../c-api/typeobj.rst:288 +#: ../../c-api/typeobj.rst:294 msgid "__imatmul__" msgstr "__imatmul__" -#: ../../c-api/typeobj.rst:292 +#: ../../c-api/typeobj.rst:298 msgid ":c:member:`~PyMappingMethods.mp_length`" msgstr ":c:member:`~PyMappingMethods.mp_length`" -#: ../../c-api/typeobj.rst:292 ../../c-api/typeobj.rst:301 -#: ../../c-api/typeobj.rst:408 +#: ../../c-api/typeobj.rst:298 ../../c-api/typeobj.rst:307 +#: ../../c-api/typeobj.rst:414 msgid ":c:type:`lenfunc`" msgstr ":c:type:`lenfunc`" -#: ../../c-api/typeobj.rst:292 ../../c-api/typeobj.rst:301 +#: ../../c-api/typeobj.rst:298 ../../c-api/typeobj.rst:307 msgid "__len__" msgstr "__len__" -#: ../../c-api/typeobj.rst:294 +#: ../../c-api/typeobj.rst:300 msgid ":c:member:`~PyMappingMethods.mp_subscript`" msgstr ":c:member:`~PyMappingMethods.mp_subscript`" -#: ../../c-api/typeobj.rst:294 ../../c-api/typeobj.rst:307 +#: ../../c-api/typeobj.rst:300 ../../c-api/typeobj.rst:313 msgid "__getitem__" msgstr "__getitem__" -#: ../../c-api/typeobj.rst:296 +#: ../../c-api/typeobj.rst:302 msgid ":c:member:`~PyMappingMethods.mp_ass_subscript`" msgstr ":c:member:`~PyMappingMethods.mp_ass_subscript`" -#: ../../c-api/typeobj.rst:296 ../../c-api/typeobj.rst:453 +#: ../../c-api/typeobj.rst:302 ../../c-api/typeobj.rst:459 msgid ":c:type:`objobjargproc`" msgstr ":c:type:`objobjargproc`" -#: ../../c-api/typeobj.rst:296 +#: ../../c-api/typeobj.rst:302 msgid "__setitem__, __delitem__" msgstr "__setitem__, __delitem__" -#: ../../c-api/typeobj.rst:301 +#: ../../c-api/typeobj.rst:307 msgid ":c:member:`~PySequenceMethods.sq_length`" msgstr ":c:member:`~PySequenceMethods.sq_length`" -#: ../../c-api/typeobj.rst:303 +#: ../../c-api/typeobj.rst:309 msgid ":c:member:`~PySequenceMethods.sq_concat`" msgstr ":c:member:`~PySequenceMethods.sq_concat`" -#: ../../c-api/typeobj.rst:303 +#: ../../c-api/typeobj.rst:309 msgid "__add__" msgstr "__add__" -#: ../../c-api/typeobj.rst:305 +#: ../../c-api/typeobj.rst:311 msgid ":c:member:`~PySequenceMethods.sq_repeat`" msgstr ":c:member:`~PySequenceMethods.sq_repeat`" -#: ../../c-api/typeobj.rst:305 ../../c-api/typeobj.rst:307 -#: ../../c-api/typeobj.rst:316 ../../c-api/typeobj.rst:438 +#: ../../c-api/typeobj.rst:311 ../../c-api/typeobj.rst:313 +#: ../../c-api/typeobj.rst:322 ../../c-api/typeobj.rst:444 msgid ":c:type:`ssizeargfunc`" msgstr ":c:type:`ssizeargfunc`" -#: ../../c-api/typeobj.rst:305 +#: ../../c-api/typeobj.rst:311 msgid "__mul__" msgstr "__mul__" -#: ../../c-api/typeobj.rst:307 +#: ../../c-api/typeobj.rst:313 msgid ":c:member:`~PySequenceMethods.sq_item`" msgstr ":c:member:`~PySequenceMethods.sq_item`" -#: ../../c-api/typeobj.rst:309 +#: ../../c-api/typeobj.rst:315 msgid ":c:member:`~PySequenceMethods.sq_ass_item`" msgstr ":c:member:`~PySequenceMethods.sq_ass_item`" -#: ../../c-api/typeobj.rst:309 ../../c-api/typeobj.rst:443 +#: ../../c-api/typeobj.rst:315 ../../c-api/typeobj.rst:449 msgid ":c:type:`ssizeobjargproc`" msgstr ":c:type:`ssizeobjargproc`" -#: ../../c-api/typeobj.rst:309 +#: ../../c-api/typeobj.rst:315 msgid "__setitem__ __delitem__" msgstr "__setitem__ __delitem__" -#: ../../c-api/typeobj.rst:312 +#: ../../c-api/typeobj.rst:318 msgid ":c:member:`~PySequenceMethods.sq_contains`" msgstr ":c:member:`~PySequenceMethods.sq_contains`" -#: ../../c-api/typeobj.rst:312 ../../c-api/typeobj.rst:448 +#: ../../c-api/typeobj.rst:318 ../../c-api/typeobj.rst:454 msgid ":c:type:`objobjproc`" msgstr ":c:type:`objobjproc`" -#: ../../c-api/typeobj.rst:312 +#: ../../c-api/typeobj.rst:318 msgid "__contains__" msgstr "__contains__" -#: ../../c-api/typeobj.rst:314 +#: ../../c-api/typeobj.rst:320 msgid ":c:member:`~PySequenceMethods.sq_inplace_concat`" msgstr ":c:member:`~PySequenceMethods.sq_inplace_concat`" -#: ../../c-api/typeobj.rst:316 +#: ../../c-api/typeobj.rst:322 msgid ":c:member:`~PySequenceMethods.sq_inplace_repeat`" msgstr ":c:member:`~PySequenceMethods.sq_inplace_repeat`" -#: ../../c-api/typeobj.rst:320 +#: ../../c-api/typeobj.rst:326 msgid ":c:member:`~PyBufferProcs.bf_getbuffer`" msgstr ":c:member:`~PyBufferProcs.bf_getbuffer`" -#: ../../c-api/typeobj.rst:320 +#: ../../c-api/typeobj.rst:326 msgid ":c:func:`getbufferproc`" msgstr ":c:func:`getbufferproc`" -#: ../../c-api/typeobj.rst:322 +#: ../../c-api/typeobj.rst:328 msgid ":c:member:`~PyBufferProcs.bf_releasebuffer`" msgstr ":c:member:`~PyBufferProcs.bf_releasebuffer`" -#: ../../c-api/typeobj.rst:322 +#: ../../c-api/typeobj.rst:328 msgid ":c:func:`releasebufferproc`" msgstr ":c:func:`releasebufferproc`" -#: ../../c-api/typeobj.rst:328 +#: ../../c-api/typeobj.rst:334 msgid "slot typedefs" msgstr "" -#: ../../c-api/typeobj.rst:331 +#: ../../c-api/typeobj.rst:337 msgid "typedef" msgstr "typedef" -#: ../../c-api/typeobj.rst:331 +#: ../../c-api/typeobj.rst:337 msgid "Parameter Types" msgstr "" -#: ../../c-api/typeobj.rst:331 +#: ../../c-api/typeobj.rst:337 msgid "Return Type" msgstr "" -#: ../../c-api/typeobj.rst:338 ../../c-api/typeobj.rst:340 -#: ../../c-api/typeobj.rst:416 +#: ../../c-api/typeobj.rst:344 ../../c-api/typeobj.rst:346 +#: ../../c-api/typeobj.rst:422 msgid "void" msgstr "void" @@ -1098,20 +1110,20 @@ msgstr "void" msgid ":c:type:`visitproc`" msgstr ":c:type:`visitproc`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:342 -#: ../../c-api/typeobj.rst:354 ../../c-api/typeobj.rst:367 -#: ../../c-api/typeobj.rst:378 ../../c-api/typeobj.rst:390 -#: ../../c-api/typeobj.rst:410 ../../c-api/typeobj.rst:421 -#: ../../c-api/typeobj.rst:443 ../../c-api/typeobj.rst:448 -#: ../../c-api/typeobj.rst:453 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:348 +#: ../../c-api/typeobj.rst:360 ../../c-api/typeobj.rst:373 +#: ../../c-api/typeobj.rst:384 ../../c-api/typeobj.rst:396 +#: ../../c-api/typeobj.rst:416 ../../c-api/typeobj.rst:427 +#: ../../c-api/typeobj.rst:449 ../../c-api/typeobj.rst:454 +#: ../../c-api/typeobj.rst:459 msgid "int" msgstr "int" -#: ../../c-api/typeobj.rst:396 +#: ../../c-api/typeobj.rst:402 msgid "Py_hash_t" msgstr "Py_hash_t" -#: ../../c-api/typeobj.rst:410 +#: ../../c-api/typeobj.rst:416 msgid ":c:type:`getbufferproc`" msgstr ":c:type:`getbufferproc`" @@ -1119,30 +1131,30 @@ msgstr ":c:type:`getbufferproc`" msgid ":c:type:`Py_buffer` *" msgstr ":c:type:`Py_buffer` *" -#: ../../c-api/typeobj.rst:416 +#: ../../c-api/typeobj.rst:422 msgid ":c:type:`releasebufferproc`" msgstr ":c:type:`releasebufferproc`" -#: ../../c-api/typeobj.rst:460 +#: ../../c-api/typeobj.rst:466 msgid "See :ref:`slot-typedefs` below for more detail." msgstr "更多細節請見下方的 :ref:`slot-typedefs`。" -#: ../../c-api/typeobj.rst:464 +#: ../../c-api/typeobj.rst:470 msgid "PyTypeObject Definition" msgstr "" -#: ../../c-api/typeobj.rst:466 +#: ../../c-api/typeobj.rst:472 msgid "" "The structure definition for :c:type:`PyTypeObject` can be found in :file:" "`Include/object.h`. For convenience of reference, this repeats the " "definition found there:" msgstr "" -#: ../../c-api/typeobj.rst:476 +#: ../../c-api/typeobj.rst:482 msgid "PyObject Slots" msgstr "" -#: ../../c-api/typeobj.rst:478 +#: ../../c-api/typeobj.rst:484 msgid "" "The type object structure extends the :c:type:`PyVarObject` structure. The :" "attr:`ob_size` field is used for dynamic types (created by :func:`type_new`, " @@ -1151,7 +1163,7 @@ msgid "" "that its instances (i.e. type objects) *must* have the :attr:`ob_size` field." msgstr "" -#: ../../c-api/typeobj.rst:487 +#: ../../c-api/typeobj.rst:493 msgid "" "This is the type object's reference count, initialized to ``1`` by the " "``PyObject_HEAD_INIT`` macro. Note that for :ref:`statically allocated type " @@ -1161,46 +1173,46 @@ msgid "" "as references." 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:698 ../../c-api/typeobj.rst:736 -#: ../../c-api/typeobj.rst:756 ../../c-api/typeobj.rst:773 -#: ../../c-api/typeobj.rst:791 ../../c-api/typeobj.rst:815 -#: ../../c-api/typeobj.rst:832 ../../c-api/typeobj.rst:844 -#: ../../c-api/typeobj.rst:856 ../../c-api/typeobj.rst:889 -#: ../../c-api/typeobj.rst:907 ../../c-api/typeobj.rst:927 -#: ../../c-api/typeobj.rst:948 ../../c-api/typeobj.rst:974 -#: ../../c-api/typeobj.rst:993 ../../c-api/typeobj.rst:1009 -#: ../../c-api/typeobj.rst:1046 ../../c-api/typeobj.rst:1057 -#: ../../c-api/typeobj.rst:1067 ../../c-api/typeobj.rst:1077 -#: ../../c-api/typeobj.rst:1091 ../../c-api/typeobj.rst:1109 -#: ../../c-api/typeobj.rst:1132 ../../c-api/typeobj.rst:1179 -#: ../../c-api/typeobj.rst:1194 ../../c-api/typeobj.rst:1213 -#: ../../c-api/typeobj.rst:1243 ../../c-api/typeobj.rst:1265 -#: ../../c-api/typeobj.rst:1281 ../../c-api/typeobj.rst:1349 -#: ../../c-api/typeobj.rst:1416 ../../c-api/typeobj.rst:1475 -#: ../../c-api/typeobj.rst:1505 ../../c-api/typeobj.rst:1537 -#: ../../c-api/typeobj.rst:1560 ../../c-api/typeobj.rst:1573 -#: ../../c-api/typeobj.rst:1588 ../../c-api/typeobj.rst:1602 -#: ../../c-api/typeobj.rst:1632 ../../c-api/typeobj.rst:1652 -#: ../../c-api/typeobj.rst:1678 ../../c-api/typeobj.rst:1696 -#: ../../c-api/typeobj.rst:1729 ../../c-api/typeobj.rst:1780 -#: ../../c-api/typeobj.rst:1797 ../../c-api/typeobj.rst:1838 -#: ../../c-api/typeobj.rst:1860 ../../c-api/typeobj.rst:1892 -#: ../../c-api/typeobj.rst:1909 ../../c-api/typeobj.rst:1920 -#: ../../c-api/typeobj.rst:1930 ../../c-api/typeobj.rst:1939 -#: ../../c-api/typeobj.rst:1949 ../../c-api/typeobj.rst:1963 -#: ../../c-api/typeobj.rst:2009 ../../c-api/typeobj.rst:2032 +#: ../../c-api/typeobj.rst:500 ../../c-api/typeobj.rst:523 +#: ../../c-api/typeobj.rst:545 ../../c-api/typeobj.rst:559 +#: ../../c-api/typeobj.rst:603 ../../c-api/typeobj.rst:646 +#: ../../c-api/typeobj.rst:704 ../../c-api/typeobj.rst:742 +#: ../../c-api/typeobj.rst:762 ../../c-api/typeobj.rst:779 +#: ../../c-api/typeobj.rst:797 ../../c-api/typeobj.rst:821 +#: ../../c-api/typeobj.rst:838 ../../c-api/typeobj.rst:850 +#: ../../c-api/typeobj.rst:862 ../../c-api/typeobj.rst:895 +#: ../../c-api/typeobj.rst:913 ../../c-api/typeobj.rst:933 +#: ../../c-api/typeobj.rst:954 ../../c-api/typeobj.rst:980 +#: ../../c-api/typeobj.rst:999 ../../c-api/typeobj.rst:1015 +#: ../../c-api/typeobj.rst:1052 ../../c-api/typeobj.rst:1063 +#: ../../c-api/typeobj.rst:1073 ../../c-api/typeobj.rst:1083 +#: ../../c-api/typeobj.rst:1097 ../../c-api/typeobj.rst:1115 +#: ../../c-api/typeobj.rst:1138 ../../c-api/typeobj.rst:1185 +#: ../../c-api/typeobj.rst:1200 ../../c-api/typeobj.rst:1219 +#: ../../c-api/typeobj.rst:1249 ../../c-api/typeobj.rst:1271 +#: ../../c-api/typeobj.rst:1287 ../../c-api/typeobj.rst:1355 +#: ../../c-api/typeobj.rst:1422 ../../c-api/typeobj.rst:1481 +#: ../../c-api/typeobj.rst:1511 ../../c-api/typeobj.rst:1543 +#: ../../c-api/typeobj.rst:1566 ../../c-api/typeobj.rst:1579 +#: ../../c-api/typeobj.rst:1594 ../../c-api/typeobj.rst:1608 +#: ../../c-api/typeobj.rst:1638 ../../c-api/typeobj.rst:1658 +#: ../../c-api/typeobj.rst:1684 ../../c-api/typeobj.rst:1702 +#: ../../c-api/typeobj.rst:1735 ../../c-api/typeobj.rst:1786 +#: ../../c-api/typeobj.rst:1803 ../../c-api/typeobj.rst:1844 +#: ../../c-api/typeobj.rst:1866 ../../c-api/typeobj.rst:1898 +#: ../../c-api/typeobj.rst:1926 ../../c-api/typeobj.rst:1939 +#: ../../c-api/typeobj.rst:1949 ../../c-api/typeobj.rst:1958 +#: ../../c-api/typeobj.rst:1968 ../../c-api/typeobj.rst:1982 +#: ../../c-api/typeobj.rst:2028 ../../c-api/typeobj.rst:2051 msgid "**Inheritance:**" msgstr "" -#: ../../c-api/typeobj.rst:496 ../../c-api/typeobj.rst:555 -#: ../../c-api/typeobj.rst:599 +#: ../../c-api/typeobj.rst:502 ../../c-api/typeobj.rst:561 +#: ../../c-api/typeobj.rst:605 msgid "This field is not inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:501 +#: ../../c-api/typeobj.rst:507 msgid "" "This is the type's type, in other words its metatype. It is initialized by " "the argument to the ``PyObject_HEAD_INIT`` macro, and its value should " @@ -1212,7 +1224,7 @@ msgid "" "doing anything else. This is typically done like this::" msgstr "" -#: ../../c-api/typeobj.rst:512 +#: ../../c-api/typeobj.rst:518 msgid "" "This should be done before any instances of the type are created. :c:func:" "`PyType_Ready` checks if :attr:`ob_type` is ``NULL``, and if so, initializes " @@ -1220,22 +1232,22 @@ msgid "" "will not change this field if it is non-zero." msgstr "" -#: ../../c-api/typeobj.rst:519 ../../c-api/typeobj.rst:700 -#: ../../c-api/typeobj.rst:817 ../../c-api/typeobj.rst:909 -#: ../../c-api/typeobj.rst:929 ../../c-api/typeobj.rst:1539 -#: ../../c-api/typeobj.rst:1562 ../../c-api/typeobj.rst:1680 -#: ../../c-api/typeobj.rst:1698 ../../c-api/typeobj.rst:1782 -#: ../../c-api/typeobj.rst:1894 ../../c-api/typeobj.rst:2011 +#: ../../c-api/typeobj.rst:525 ../../c-api/typeobj.rst:706 +#: ../../c-api/typeobj.rst:823 ../../c-api/typeobj.rst:915 +#: ../../c-api/typeobj.rst:935 ../../c-api/typeobj.rst:1545 +#: ../../c-api/typeobj.rst:1568 ../../c-api/typeobj.rst:1686 +#: ../../c-api/typeobj.rst:1704 ../../c-api/typeobj.rst:1788 +#: ../../c-api/typeobj.rst:1900 ../../c-api/typeobj.rst:2030 msgid "This field is inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:525 +#: ../../c-api/typeobj.rst:531 msgid "" "These fields are only present when the macro ``Py_TRACE_REFS`` is defined " "(see the :option:`configure --with-trace-refs option <--with-trace-refs>`)." msgstr "" -#: ../../c-api/typeobj.rst:528 +#: ../../c-api/typeobj.rst:534 msgid "" "Their initialization to ``NULL`` is taken care of by the " "``PyObject_HEAD_INIT`` macro. For :ref:`statically allocated objects " @@ -1244,7 +1256,7 @@ msgid "" "object into a doubly linked list of *all* live objects on the heap." msgstr "" -#: ../../c-api/typeobj.rst:534 +#: ../../c-api/typeobj.rst:540 msgid "" "This could be used for various debugging purposes; currently the only uses " "are the :func:`sys.getobjects` function and to print the objects that are " @@ -1252,26 +1264,26 @@ msgid "" "`PYTHONDUMPREFS` is set." msgstr "" -#: ../../c-api/typeobj.rst:541 +#: ../../c-api/typeobj.rst:547 msgid "These fields are not inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:545 +#: ../../c-api/typeobj.rst:551 msgid "PyVarObject Slots" msgstr "" -#: ../../c-api/typeobj.rst:549 +#: ../../c-api/typeobj.rst:555 msgid "" "For :ref:`statically allocated type objects `, this should be " "initialized to zero. For :ref:`dynamically allocated type objects `, this field has a special internal meaning." msgstr "" -#: ../../c-api/typeobj.rst:559 +#: ../../c-api/typeobj.rst:565 msgid "PyTypeObject Slots" msgstr "" -#: ../../c-api/typeobj.rst:561 +#: ../../c-api/typeobj.rst:567 msgid "" "Each slot has a section describing inheritance. If :c:func:`PyType_Ready` " "may set a value when the field is set to ``NULL`` then there will also be a " @@ -1279,7 +1291,7 @@ msgid "" "`PyBaseObject_Type` and :c:type:`PyType_Type` effectively act as defaults.)" msgstr "" -#: ../../c-api/typeobj.rst:568 +#: ../../c-api/typeobj.rst:574 msgid "" "Pointer to a NUL-terminated string containing the name of the type. For " "types that are accessible as module globals, the string should be the full " @@ -1291,14 +1303,14 @@ msgid "" "tp_name` initializer ``\"P.Q.M.T\"``." msgstr "" -#: ../../c-api/typeobj.rst:576 +#: ../../c-api/typeobj.rst:582 msgid "" "For :ref:`dynamically allocated type objects `, this should just " "be the type name, and the module name explicitly stored in the type dict as " "the value for key ``'__module__'``." msgstr "" -#: ../../c-api/typeobj.rst:581 +#: ../../c-api/typeobj.rst:587 msgid "" "For :ref:`statically allocated type objects `, the *tp_name* " "field should contain a dot. Everything before the last dot is made " @@ -1306,7 +1318,7 @@ msgid "" "last dot is made accessible as the :attr:`~definition.__name__` attribute." msgstr "" -#: ../../c-api/typeobj.rst:587 +#: ../../c-api/typeobj.rst:593 msgid "" "If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is " "made accessible as the :attr:`~definition.__name__` attribute, and the :attr:" @@ -1316,19 +1328,19 @@ msgid "" "created with pydoc." msgstr "" -#: ../../c-api/typeobj.rst:593 +#: ../../c-api/typeobj.rst:599 msgid "" "This field must not be ``NULL``. It is the only required field in :c:func:" "`PyTypeObject` (other than potentially :c:member:`~PyTypeObject." "tp_itemsize`)." msgstr "" -#: ../../c-api/typeobj.rst:605 +#: ../../c-api/typeobj.rst:611 msgid "" "These fields allow calculating the size in bytes of instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:607 +#: ../../c-api/typeobj.rst:613 msgid "" "There are two kinds of types: types with fixed-length instances have a zero :" "c:member:`~PyTypeObject.tp_itemsize` field, types with variable-length " @@ -1337,7 +1349,7 @@ msgid "" "in :c:member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:612 +#: ../../c-api/typeobj.rst:618 msgid "" "For a type with variable-length instances, the instances must have an :attr:" "`ob_size` field, and the instance size is :c:member:`~PyTypeObject." @@ -1351,7 +1363,7 @@ msgid "" "instances, yet those instances have a meaningful :attr:`ob_size` field)." msgstr "" -#: ../../c-api/typeobj.rst:623 +#: ../../c-api/typeobj.rst:629 msgid "" "The basic size includes the fields in the instance declared by the macro :c:" "macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD` (whichever is used to " @@ -1363,7 +1375,7 @@ msgid "" "size." msgstr "" -#: ../../c-api/typeobj.rst:631 +#: ../../c-api/typeobj.rst:637 msgid "" "A note about alignment: if the variable items require a particular " "alignment, this should be taken care of by the value of :c:member:" @@ -1374,12 +1386,12 @@ msgid "" "alignment requirement for ``double``)." msgstr "" -#: ../../c-api/typeobj.rst:638 +#: ../../c-api/typeobj.rst:644 msgid "" "For any type with variable-length instances, this field must not be ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:642 +#: ../../c-api/typeobj.rst:648 msgid "" "These fields are inherited separately by subtypes. If the base type has a " "non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is generally not safe to " @@ -1387,7 +1399,7 @@ msgid "" "subtype (though this depends on the implementation of the base type)." msgstr "" -#: ../../c-api/typeobj.rst:650 +#: ../../c-api/typeobj.rst:656 msgid "" "A pointer to the instance destructor function. This function must be " "defined unless the type guarantees that its instances will never be " @@ -1395,7 +1407,7 @@ msgid "" "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:656 +#: ../../c-api/typeobj.rst:662 msgid "" "The destructor function is called by the :c:func:`Py_DECREF` and :c:func:" "`Py_XDECREF` macros when the new reference count is zero. At this point, " @@ -1413,14 +1425,14 @@ msgid "" "allocated using :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`." msgstr "" -#: ../../c-api/typeobj.rst:671 +#: ../../c-api/typeobj.rst:677 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 +#: ../../c-api/typeobj.rst:689 msgid "" "Finally, if the type is heap allocated (:const:`Py_TPFLAGS_HEAPTYPE`), the " "deallocator should decrement the reference count for its type object after " @@ -1428,28 +1440,28 @@ msgid "" "recommended way to achieve this is:" msgstr "" -#: ../../c-api/typeobj.rst:705 +#: ../../c-api/typeobj.rst:711 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:710 +#: ../../c-api/typeobj.rst:716 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:714 +#: ../../c-api/typeobj.rst:720 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:718 +#: ../../c-api/typeobj.rst:724 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 " @@ -1457,7 +1469,7 @@ msgid "" "`PyVectorcall_Call`." msgstr "" -#: ../../c-api/typeobj.rst:725 +#: ../../c-api/typeobj.rst:731 msgid "" "It is not recommended for :ref:`mutable heap types ` to " "implement the vectorcall protocol. When a user sets :attr:`__call__` in " @@ -1465,13 +1477,13 @@ msgid "" "the vectorcall function." msgstr "" -#: ../../c-api/typeobj.rst:732 +#: ../../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:738 +#: ../../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 +1493,11 @@ msgid "" "subclasses defined in Python)." msgstr "" -#: ../../c-api/typeobj.rst:750 +#: ../../c-api/typeobj.rst:756 msgid "An optional pointer to the get-attribute-string function." msgstr "" -#: ../../c-api/typeobj.rst:752 +#: ../../c-api/typeobj.rst:758 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 +1505,11 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:758 ../../c-api/typeobj.rst:950 +#: ../../c-api/typeobj.rst:764 ../../c-api/typeobj.rst:956 msgid "Group: :attr:`tp_getattr`, :attr:`tp_getattro`" msgstr "" -#: ../../c-api/typeobj.rst:760 +#: ../../c-api/typeobj.rst:766 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 +1518,12 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:767 ../../c-api/typeobj.rst:963 +#: ../../c-api/typeobj.rst:773 ../../c-api/typeobj.rst:969 msgid "" "An optional pointer to the function for setting and deleting attributes." msgstr "" -#: ../../c-api/typeobj.rst:769 +#: ../../c-api/typeobj.rst:775 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 +1531,11 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:775 ../../c-api/typeobj.rst:976 +#: ../../c-api/typeobj.rst:781 ../../c-api/typeobj.rst:982 msgid "Group: :attr:`tp_setattr`, :attr:`tp_setattro`" msgstr "" -#: ../../c-api/typeobj.rst:777 +#: ../../c-api/typeobj.rst:783 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 +1544,34 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:784 +#: ../../c-api/typeobj.rst:790 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:788 +#: ../../c-api/typeobj.rst:794 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "" -#: ../../c-api/typeobj.rst:793 +#: ../../c-api/typeobj.rst:799 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:801 +#: ../../c-api/typeobj.rst:807 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." msgstr "" -#: ../../c-api/typeobj.rst:804 +#: ../../c-api/typeobj.rst:810 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" -#: ../../c-api/typeobj.rst:808 +#: ../../c-api/typeobj.rst:814 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 +1580,87 @@ msgid "" "``'>'`` from which both the type and the value of the object can be deduced." msgstr "" -#: ../../c-api/typeobj.rst:819 ../../c-api/typeobj.rst:931 -#: ../../c-api/typeobj.rst:956 ../../c-api/typeobj.rst:982 -#: ../../c-api/typeobj.rst:1024 ../../c-api/typeobj.rst:1484 -#: ../../c-api/typeobj.rst:1636 ../../c-api/typeobj.rst:1657 -#: ../../c-api/typeobj.rst:1748 ../../c-api/typeobj.rst:1784 -#: ../../c-api/typeobj.rst:1802 ../../c-api/typeobj.rst:1844 -#: ../../c-api/typeobj.rst:1865 ../../c-api/typeobj.rst:1896 +#: ../../c-api/typeobj.rst:825 ../../c-api/typeobj.rst:937 +#: ../../c-api/typeobj.rst:962 ../../c-api/typeobj.rst:988 +#: ../../c-api/typeobj.rst:1030 ../../c-api/typeobj.rst:1490 +#: ../../c-api/typeobj.rst:1642 ../../c-api/typeobj.rst:1663 +#: ../../c-api/typeobj.rst:1754 ../../c-api/typeobj.rst:1790 +#: ../../c-api/typeobj.rst:1808 ../../c-api/typeobj.rst:1850 +#: ../../c-api/typeobj.rst:1871 ../../c-api/typeobj.rst:1902 msgid "**Default:**" msgstr "**預設:**" -#: ../../c-api/typeobj.rst:821 +#: ../../c-api/typeobj.rst:827 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:828 +#: ../../c-api/typeobj.rst:834 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:834 +#: ../../c-api/typeobj.rst:840 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:840 +#: ../../c-api/typeobj.rst:846 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:846 +#: ../../c-api/typeobj.rst:852 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:852 +#: ../../c-api/typeobj.rst:858 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:858 +#: ../../c-api/typeobj.rst:864 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:866 +#: ../../c-api/typeobj.rst:872 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." msgstr "" -#: ../../c-api/typeobj.rst:869 +#: ../../c-api/typeobj.rst:875 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" -#: ../../c-api/typeobj.rst:873 +#: ../../c-api/typeobj.rst:879 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:877 +#: ../../c-api/typeobj.rst:883 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:881 +#: ../../c-api/typeobj.rst:887 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 +1671,11 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:891 ../../c-api/typeobj.rst:1477 +#: ../../c-api/typeobj.rst:897 ../../c-api/typeobj.rst:1483 msgid "Group: :attr:`tp_hash`, :attr:`tp_richcompare`" msgstr "" -#: ../../c-api/typeobj.rst:893 +#: ../../c-api/typeobj.rst:899 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -1672,14 +1684,14 @@ msgid "" "are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:901 +#: ../../c-api/typeobj.rst:907 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:914 +#: ../../c-api/typeobj.rst:920 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 +1700,11 @@ msgid "" "this handler.)" msgstr "" -#: ../../c-api/typeobj.rst:919 +#: ../../c-api/typeobj.rst:925 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" -#: ../../c-api/typeobj.rst:923 +#: ../../c-api/typeobj.rst:929 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 +1712,28 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:933 +#: ../../c-api/typeobj.rst:939 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." msgstr "" -#: ../../c-api/typeobj.rst:939 +#: ../../c-api/typeobj.rst:945 msgid "An optional pointer to the get-attribute function." msgstr "" -#: ../../c-api/typeobj.rst:941 +#: ../../c-api/typeobj.rst:947 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:945 +#: ../../c-api/typeobj.rst:951 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:952 +#: ../../c-api/typeobj.rst:958 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 +1742,15 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:958 +#: ../../c-api/typeobj.rst:964 msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:965 +#: ../../c-api/typeobj.rst:971 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:969 +#: ../../c-api/typeobj.rst:975 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 +1758,7 @@ msgid "" "attributes." msgstr "" -#: ../../c-api/typeobj.rst:978 +#: ../../c-api/typeobj.rst:984 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 +1767,24 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:984 +#: ../../c-api/typeobj.rst:990 msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:989 +#: ../../c-api/typeobj.rst:995 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:995 +#: ../../c-api/typeobj.rst:1001 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:1001 +#: ../../c-api/typeobj.rst:1007 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 +1796,7 @@ msgid "" "accessed and must be considered to have a zero or ``NULL`` value instead." msgstr "" -#: ../../c-api/typeobj.rst:1011 +#: ../../c-api/typeobj.rst:1017 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 +1811,17 @@ msgid "" "the subtype exist and have ``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1026 +#: ../../c-api/typeobj.rst:1032 msgid "" ":c:type:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." msgstr "" -#: ../../c-api/typeobj.rst:1029 +#: ../../c-api/typeobj.rst:1035 msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1031 +#: ../../c-api/typeobj.rst:1037 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 +1830,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1038 +#: ../../c-api/typeobj.rst:1044 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 +1841,32 @@ msgid "" "gets INCREF'ed or DECREF'ed)." msgstr "" -#: ../../c-api/typeobj.rst:1048 ../../c-api/typeobj.rst:1059 -#: ../../c-api/typeobj.rst:1069 ../../c-api/typeobj.rst:1079 -#: ../../c-api/typeobj.rst:1111 +#: ../../c-api/typeobj.rst:1054 ../../c-api/typeobj.rst:1065 +#: ../../c-api/typeobj.rst:1075 ../../c-api/typeobj.rst:1085 +#: ../../c-api/typeobj.rst:1117 msgid "???" msgstr "" -#: ../../c-api/typeobj.rst:1053 +#: ../../c-api/typeobj.rst:1059 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:1064 +#: ../../c-api/typeobj.rst:1070 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1074 +#: ../../c-api/typeobj.rst:1080 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1084 +#: ../../c-api/typeobj.rst:1090 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 +1876,13 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: ../../c-api/typeobj.rst:1093 ../../c-api/typeobj.rst:1351 -#: ../../c-api/typeobj.rst:1418 +#: ../../c-api/typeobj.rst:1099 ../../c-api/typeobj.rst:1357 +#: ../../c-api/typeobj.rst:1424 msgid "" "Group: :const:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1095 +#: ../../c-api/typeobj.rst:1101 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 +1891,48 @@ msgid "" "``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1105 +#: ../../c-api/typeobj.rst:1111 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:1116 +#: ../../c-api/typeobj.rst:1122 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1118 +#: ../../c-api/typeobj.rst:1124 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1120 +#: ../../c-api/typeobj.rst:1126 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1123 +#: ../../c-api/typeobj.rst:1129 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1126 +#: ../../c-api/typeobj.rst:1132 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:1134 +#: ../../c-api/typeobj.rst:1140 msgid "" "This flag is never inherited by types without the :const:" "`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " "whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1151 +#: ../../c-api/typeobj.rst:1157 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,81 +1942,81 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1162 +#: ../../c-api/typeobj.rst:1168 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1167 +#: ../../c-api/typeobj.rst:1173 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:1175 +#: ../../c-api/typeobj.rst:1181 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:1181 +#: ../../c-api/typeobj.rst:1187 msgid "" "This bit is inherited for types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` " "flag set, if :c:member:`~PyTypeObject.tp_call` is also inherited." msgstr "" -#: ../../c-api/typeobj.rst:1189 +#: ../../c-api/typeobj.rst:1195 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1191 +#: ../../c-api/typeobj.rst:1197 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1196 +#: ../../c-api/typeobj.rst:1202 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1202 +#: ../../c-api/typeobj.rst:1208 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:1206 +#: ../../c-api/typeobj.rst:1212 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:1209 +#: ../../c-api/typeobj.rst:1215 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:1221 msgid "" "This flag is not inherited. However, subclasses will not be instantiable " "unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " "only possible via the C API)." msgstr "" -#: ../../c-api/typeobj.rst:1222 +#: ../../c-api/typeobj.rst:1228 msgid "" "To disallow instantiating a class directly but allow instantiating its " "subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " "Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1233 +#: ../../c-api/typeobj.rst:1239 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 " @@ -2012,23 +2024,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1240 ../../c-api/typeobj.rst:1262 +#: ../../c-api/typeobj.rst:1246 ../../c-api/typeobj.rst:1268 msgid "" ":const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE` are mutually " "exclusive; it is an error to enable both flags simultaneously." msgstr "" -#: ../../c-api/typeobj.rst:1245 +#: ../../c-api/typeobj.rst:1251 msgid "" "This flag is inherited by types that do not already set :const:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1248 ../../c-api/typeobj.rst:1270 +#: ../../c-api/typeobj.rst:1254 ../../c-api/typeobj.rst:1276 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1255 +#: ../../c-api/typeobj.rst:1261 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 " @@ -2036,37 +2048,37 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1267 +#: ../../c-api/typeobj.rst:1273 msgid "" "This flag is inherited by types that do not already set :const:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1277 +#: ../../c-api/typeobj.rst:1283 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:1283 +#: ../../c-api/typeobj.rst:1289 msgid "This field is *not* inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:1288 +#: ../../c-api/typeobj.rst:1294 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:1293 ../../c-api/typeobj.rst:1413 +#: ../../c-api/typeobj.rst:1299 ../../c-api/typeobj.rst:1419 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1296 +#: ../../c-api/typeobj.rst:1302 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2076,7 +2088,7 @@ msgid "" "`_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1311 +#: ../../c-api/typeobj.rst:1317 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`` " @@ -2084,14 +2096,14 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1315 +#: ../../c-api/typeobj.rst:1321 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:1320 +#: ../../c-api/typeobj.rst:1326 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:" @@ -2120,14 +2132,14 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1344 +#: ../../c-api/typeobj.rst:1350 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:1353 +#: ../../c-api/typeobj.rst:1359 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:" @@ -2135,14 +2147,14 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1361 +#: ../../c-api/typeobj.rst:1367 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:1366 +#: ../../c-api/typeobj.rst:1372 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2157,7 +2169,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1376 +#: ../../c-api/typeobj.rst:1382 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2165,7 +2177,7 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1390 +#: ../../c-api/typeobj.rst:1396 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 " @@ -2180,7 +2192,7 @@ msgid "" "in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1401 +#: ../../c-api/typeobj.rst:1407 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2188,7 +2200,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: ../../c-api/typeobj.rst:1407 +#: ../../c-api/typeobj.rst:1413 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 " @@ -2198,7 +2210,7 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1420 +#: ../../c-api/typeobj.rst:1426 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:" @@ -2206,18 +2218,18 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1428 +#: ../../c-api/typeobj.rst:1434 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1432 +#: ../../c-api/typeobj.rst:1438 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:1435 +#: ../../c-api/typeobj.rst:1441 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2225,74 +2237,74 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1440 +#: ../../c-api/typeobj.rst:1446 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:1444 +#: ../../c-api/typeobj.rst:1450 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1444 +#: ../../c-api/typeobj.rst:1450 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1446 +#: ../../c-api/typeobj.rst:1452 msgid ":const:`Py_LT`" msgstr ":const:`Py_LT`" -#: ../../c-api/typeobj.rst:1446 +#: ../../c-api/typeobj.rst:1452 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1448 +#: ../../c-api/typeobj.rst:1454 msgid ":const:`Py_LE`" msgstr ":const:`Py_LE`" -#: ../../c-api/typeobj.rst:1448 +#: ../../c-api/typeobj.rst:1454 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1450 +#: ../../c-api/typeobj.rst:1456 msgid ":const:`Py_EQ`" msgstr ":const:`Py_EQ`" -#: ../../c-api/typeobj.rst:1450 +#: ../../c-api/typeobj.rst:1456 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1452 +#: ../../c-api/typeobj.rst:1458 msgid ":const:`Py_NE`" msgstr ":const:`Py_NE`" -#: ../../c-api/typeobj.rst:1452 +#: ../../c-api/typeobj.rst:1458 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1454 +#: ../../c-api/typeobj.rst:1460 msgid ":const:`Py_GT`" msgstr ":const:`Py_GT`" -#: ../../c-api/typeobj.rst:1454 +#: ../../c-api/typeobj.rst:1460 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1456 +#: ../../c-api/typeobj.rst:1462 msgid ":const:`Py_GE`" msgstr ":const:`Py_GE`" -#: ../../c-api/typeobj.rst:1456 +#: ../../c-api/typeobj.rst:1462 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1459 +#: ../../c-api/typeobj.rst:1465 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1469 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 " @@ -2300,15 +2312,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1469 +#: ../../c-api/typeobj.rst:1475 msgid "The return value's reference count is properly incremented." msgstr "" -#: ../../c-api/typeobj.rst:1471 +#: ../../c-api/typeobj.rst:1477 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1479 +#: ../../c-api/typeobj.rst:1485 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2316,7 +2328,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1486 +#: ../../c-api/typeobj.rst:1492 msgid "" ":c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare` " "implementation, which may be inherited. However, if only :attr:`tp_hash` is " @@ -2324,7 +2336,7 @@ msgid "" "will not be able to participate in any comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1495 +#: ../../c-api/typeobj.rst:1501 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 " @@ -2334,13 +2346,13 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1502 +#: ../../c-api/typeobj.rst:1508 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:1507 +#: ../../c-api/typeobj.rst:1513 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 " @@ -2349,7 +2361,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1512 +#: ../../c-api/typeobj.rst:1518 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 " @@ -2358,7 +2370,7 @@ msgid "" "tp_weaklistoffset` of that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1517 +#: ../../c-api/typeobj.rst:1523 msgid "" "When a type's :attr:`__slots__` declaration contains a slot named :attr:" "`__weakref__`, that slot becomes the weak reference list head for instances " @@ -2366,31 +2378,31 @@ msgid "" "`~PyTypeObject.tp_weaklistoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1522 +#: ../../c-api/typeobj.rst:1528 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:1529 +#: ../../c-api/typeobj.rst:1535 msgid "" "An optional pointer to a function that returns an :term:`iterator` for the " "object. Its presence normally signals that the instances of this type are :" "term:`iterable` (although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1533 +#: ../../c-api/typeobj.rst:1539 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1544 +#: ../../c-api/typeobj.rst:1550 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1549 +#: ../../c-api/typeobj.rst:1555 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2398,74 +2410,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1554 +#: ../../c-api/typeobj.rst:1560 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:1558 +#: ../../c-api/typeobj.rst:1564 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1567 +#: ../../c-api/typeobj.rst:1573 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:1570 +#: ../../c-api/typeobj.rst:1576 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:1575 +#: ../../c-api/typeobj.rst:1581 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1581 +#: ../../c-api/typeobj.rst:1587 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:1585 +#: ../../c-api/typeobj.rst:1591 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:1590 +#: ../../c-api/typeobj.rst:1596 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1596 +#: ../../c-api/typeobj.rst:1602 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:1599 +#: ../../c-api/typeobj.rst:1605 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:1604 +#: ../../c-api/typeobj.rst:1610 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1610 +#: ../../c-api/typeobj.rst:1616 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2473,7 +2485,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1618 +#: ../../c-api/typeobj.rst:1624 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2481,7 +2493,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1623 +#: ../../c-api/typeobj.rst:1629 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "func:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2489,27 +2501,27 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1629 +#: ../../c-api/typeobj.rst:1635 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1634 +#: ../../c-api/typeobj.rst:1640 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1638 +#: ../../c-api/typeobj.rst:1644 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1644 +#: ../../c-api/typeobj.rst:1650 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1646 +#: ../../c-api/typeobj.rst:1652 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2518,45 +2530,45 @@ msgid "" "they don't correspond to overloaded operations (like :meth:`__add__`)." msgstr "" -#: ../../c-api/typeobj.rst:1654 +#: ../../c-api/typeobj.rst:1660 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:1659 +#: ../../c-api/typeobj.rst:1665 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1664 +#: ../../c-api/typeobj.rst:1670 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:1670 +#: ../../c-api/typeobj.rst:1676 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1672 ../../c-api/typeobj.rst:1688 -#: ../../c-api/typeobj.rst:1763 ../../c-api/typeobj.rst:1793 -#: ../../c-api/typeobj.rst:1817 +#: ../../c-api/typeobj.rst:1678 ../../c-api/typeobj.rst:1694 +#: ../../c-api/typeobj.rst:1769 ../../c-api/typeobj.rst:1799 +#: ../../c-api/typeobj.rst:1823 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1685 +#: ../../c-api/typeobj.rst:1691 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1692 +#: ../../c-api/typeobj.rst:1698 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1703 +#: ../../c-api/typeobj.rst:1709 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 " @@ -2564,13 +2576,13 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1708 +#: ../../c-api/typeobj.rst:1714 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:1711 +#: ../../c-api/typeobj.rst:1717 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, " @@ -2586,7 +2598,7 @@ msgid "" "the very end of the structure." msgstr "" -#: ../../c-api/typeobj.rst:1723 +#: ../../c-api/typeobj.rst:1729 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -2595,7 +2607,7 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: ../../c-api/typeobj.rst:1731 +#: ../../c-api/typeobj.rst:1737 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 " @@ -2604,7 +2616,7 @@ msgid "" "should not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1736 +#: ../../c-api/typeobj.rst:1742 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, " @@ -2612,14 +2624,14 @@ msgid "" "`~PyTypeObject.tp_dictoffset` is set to that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1741 +#: ../../c-api/typeobj.rst:1747 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:1744 +#: ../../c-api/typeobj.rst:1750 msgid "" "(Adding a slot named :attr:`~object.__dict__` to the :attr:`__slots__` " "declaration does not have the expected effect, it just causes confusion. " @@ -2627,17 +2639,17 @@ msgid "" "though.)" msgstr "" -#: ../../c-api/typeobj.rst:1750 +#: ../../c-api/typeobj.rst:1756 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:1756 +#: ../../c-api/typeobj.rst:1762 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1758 +#: ../../c-api/typeobj.rst:1764 msgid "" "This function corresponds to the :meth:`__init__` method of classes. Like :" "meth:`__init__`, it is possible to create an instance without calling :meth:" @@ -2645,14 +2657,14 @@ msgid "" "meth:`__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1767 +#: ../../c-api/typeobj.rst:1773 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:1771 +#: ../../c-api/typeobj.rst:1777 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 :" @@ -2664,43 +2676,43 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1778 +#: ../../c-api/typeobj.rst:1784 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1786 +#: ../../c-api/typeobj.rst:1792 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1791 +#: ../../c-api/typeobj.rst:1797 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1799 +#: ../../c-api/typeobj.rst:1805 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1804 +#: ../../c-api/typeobj.rst:1810 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:1808 +#: ../../c-api/typeobj.rst:1814 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:1815 +#: ../../c-api/typeobj.rst:1821 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1821 +#: ../../c-api/typeobj.rst:1827 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 " @@ -2709,7 +2721,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1827 +#: ../../c-api/typeobj.rst:1833 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2721,20 +2733,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1835 +#: ../../c-api/typeobj.rst:1841 msgid "" "Set the :const:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow creating " "instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1840 +#: ../../c-api/typeobj.rst:1846 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:1846 +#: ../../c-api/typeobj.rst:1852 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 " @@ -2742,39 +2754,39 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1854 +#: ../../c-api/typeobj.rst:1860 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1858 +#: ../../c-api/typeobj.rst:1864 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1862 +#: ../../c-api/typeobj.rst:1868 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1867 +#: ../../c-api/typeobj.rst:1873 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:1871 +#: ../../c-api/typeobj.rst:1877 msgid "For static subtypes, :c:type:`PyBaseObject_Type` uses PyObject_Del." msgstr "" -#: ../../c-api/typeobj.rst:1876 +#: ../../c-api/typeobj.rst:1882 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1878 +#: ../../c-api/typeobj.rst:1884 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 " @@ -2786,76 +2798,90 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1888 +#: ../../c-api/typeobj.rst:1894 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:1898 +#: ../../c-api/typeobj.rst:1904 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:1904 +#: ../../c-api/typeobj.rst:1910 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1906 +#: ../../c-api/typeobj.rst:1912 ../../c-api/typeobj.rst:1936 msgid "" -"This is set for types created by a class statement. It should be ``NULL`` " -"for statically defined types." +"This field should be set to ``NULL`` and treated as read-only. Python will " +"fill it in when the type is :c:func:`initialized `." msgstr "" -#: ../../c-api/typeobj.rst:1911 ../../c-api/typeobj.rst:1932 -#: ../../c-api/typeobj.rst:1941 ../../c-api/typeobj.rst:1951 -#: ../../c-api/typeobj.rst:1965 +#: ../../c-api/typeobj.rst:1915 +msgid "" +"For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " +"` can be used instead of the *bases* argument of :c:func:" +"`PyType_FromSpecWithBases`. The argument form is preferred." +msgstr "" + +#: ../../c-api/typeobj.rst:1922 +msgid "" +"Multiple inheritance does not work well for statically defined types. If you " +"set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " +"will only be inherited from the first base." +msgstr "" + +#: ../../c-api/typeobj.rst:1928 ../../c-api/typeobj.rst:1951 +#: ../../c-api/typeobj.rst:1960 ../../c-api/typeobj.rst:1970 +#: ../../c-api/typeobj.rst:1984 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1916 +#: ../../c-api/typeobj.rst:1933 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:1922 +#: ../../c-api/typeobj.rst:1941 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1928 +#: ../../c-api/typeobj.rst:1947 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1937 +#: ../../c-api/typeobj.rst:1956 msgid "List of weak references to subclasses. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1946 +#: ../../c-api/typeobj.rst:1965 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1956 +#: ../../c-api/typeobj.rst:1975 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:1961 +#: ../../c-api/typeobj.rst:1980 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1970 +#: ../../c-api/typeobj.rst:1989 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1974 +#: ../../c-api/typeobj.rst:1993 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 " @@ -2865,14 +2891,14 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:1981 +#: ../../c-api/typeobj.rst:2000 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:1998 +#: ../../c-api/typeobj.rst:2017 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 " @@ -2885,18 +2911,18 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2017 +#: ../../c-api/typeobj.rst:2036 msgid "" "Before version 3.8 it was necessary to set the :const:" "`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " "This is no longer required." msgstr "" -#: ../../c-api/typeobj.rst:2021 +#: ../../c-api/typeobj.rst:2040 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2026 +#: ../../c-api/typeobj.rst:2045 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -2904,61 +2930,61 @@ msgid "" "attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2034 +#: ../../c-api/typeobj.rst:2053 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2036 +#: ../../c-api/typeobj.rst:2055 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2042 +#: ../../c-api/typeobj.rst:2061 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2044 +#: ../../c-api/typeobj.rst:2063 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:2048 +#: ../../c-api/typeobj.rst:2067 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2050 +#: ../../c-api/typeobj.rst:2069 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2052 +#: ../../c-api/typeobj.rst:2071 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:2054 +#: ../../c-api/typeobj.rst:2073 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2058 +#: ../../c-api/typeobj.rst:2077 msgid "" "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " "` as an opaque struct, any extension modules using static types must " "be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2066 +#: ../../c-api/typeobj.rst:2085 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2068 +#: ../../c-api/typeobj.rst:2087 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -2966,29 +2992,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2073 +#: ../../c-api/typeobj.rst:2092 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:2081 +#: ../../c-api/typeobj.rst:2100 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2088 +#: ../../c-api/typeobj.rst:2107 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:2094 ../../c-api/typeobj.rst:2418 +#: ../../c-api/typeobj.rst:2113 ../../c-api/typeobj.rst:2437 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2141 +#: ../../c-api/typeobj.rst:2160 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 " @@ -2998,30 +3024,30 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2150 +#: ../../c-api/typeobj.rst:2169 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:2195 +#: ../../c-api/typeobj.rst:2214 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2202 +#: ../../c-api/typeobj.rst:2221 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:2207 +#: ../../c-api/typeobj.rst:2226 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:2213 +#: ../../c-api/typeobj.rst:2232 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3029,7 +3055,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2221 +#: ../../c-api/typeobj.rst:2240 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" @@ -3039,17 +3065,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2232 +#: ../../c-api/typeobj.rst:2251 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2239 +#: ../../c-api/typeobj.rst:2258 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2244 +#: ../../c-api/typeobj.rst:2263 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 " @@ -3057,21 +3083,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2251 +#: ../../c-api/typeobj.rst:2270 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:2257 +#: ../../c-api/typeobj.rst:2276 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:2263 +#: ../../c-api/typeobj.rst:2282 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 " @@ -3080,7 +3106,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2269 +#: ../../c-api/typeobj.rst:2288 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 " @@ -3088,7 +3114,7 @@ msgid "" "the index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2276 +#: ../../c-api/typeobj.rst:2295 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:" @@ -3097,14 +3123,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2285 +#: ../../c-api/typeobj.rst:2304 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:2292 +#: ../../c-api/typeobj.rst:2311 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 " @@ -3114,7 +3140,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2301 +#: ../../c-api/typeobj.rst:2320 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 " @@ -3124,72 +3150,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2312 +#: ../../c-api/typeobj.rst:2331 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2320 +#: ../../c-api/typeobj.rst:2339 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:2326 ../../c-api/typeobj.rst:2375 -#: ../../c-api/typeobj.rst:2429 ../../c-api/typeobj.rst:2440 -#: ../../c-api/typeobj.rst:2452 ../../c-api/typeobj.rst:2461 +#: ../../c-api/typeobj.rst:2345 ../../c-api/typeobj.rst:2394 +#: ../../c-api/typeobj.rst:2448 ../../c-api/typeobj.rst:2459 +#: ../../c-api/typeobj.rst:2471 ../../c-api/typeobj.rst:2480 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2330 +#: ../../c-api/typeobj.rst:2349 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:2334 +#: ../../c-api/typeobj.rst:2353 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " "set :c:expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2337 +#: ../../c-api/typeobj.rst:2356 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2339 +#: ../../c-api/typeobj.rst:2358 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2341 +#: ../../c-api/typeobj.rst:2360 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2343 +#: ../../c-api/typeobj.rst:2362 msgid "Return ``0``." msgstr "" -#: ../../c-api/typeobj.rst:2345 +#: ../../c-api/typeobj.rst:2364 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2348 +#: ../../c-api/typeobj.rst:2367 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "expr:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2351 +#: ../../c-api/typeobj.rst:2370 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2355 +#: ../../c-api/typeobj.rst:2374 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3197,7 +3223,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2360 +#: ../../c-api/typeobj.rst:2379 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:" @@ -3206,19 +3232,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2367 +#: ../../c-api/typeobj.rst:2386 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:2370 +#: ../../c-api/typeobj.rst:2389 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2379 +#: ../../c-api/typeobj.rst:2398 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 " @@ -3226,15 +3252,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2384 +#: ../../c-api/typeobj.rst:2403 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2386 +#: ../../c-api/typeobj.rst:2405 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2388 +#: ../../c-api/typeobj.rst:2407 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 " @@ -3242,68 +3268,68 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2394 +#: ../../c-api/typeobj.rst:2413 msgid "" "This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2399 +#: ../../c-api/typeobj.rst:2418 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2407 +#: ../../c-api/typeobj.rst:2426 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2415 +#: ../../c-api/typeobj.rst:2434 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2433 +#: ../../c-api/typeobj.rst:2452 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " "must return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2436 +#: ../../c-api/typeobj.rst:2455 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2444 +#: ../../c-api/typeobj.rst:2463 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`__anext__` " "for details." msgstr "" -#: ../../c-api/typeobj.rst:2447 +#: ../../c-api/typeobj.rst:2466 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2456 +#: ../../c-api/typeobj.rst:2475 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " "This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2465 +#: ../../c-api/typeobj.rst:2484 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2474 +#: ../../c-api/typeobj.rst:2493 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2478 +#: ../../c-api/typeobj.rst:2497 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 " @@ -3317,80 +3343,80 @@ msgid "" "member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2488 +#: ../../c-api/typeobj.rst:2507 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:2495 +#: ../../c-api/typeobj.rst:2514 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2499 +#: ../../c-api/typeobj.rst:2518 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2503 +#: ../../c-api/typeobj.rst:2522 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2507 +#: ../../c-api/typeobj.rst:2526 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2511 ../../c-api/typeobj.rst:2520 +#: ../../c-api/typeobj.rst:2530 ../../c-api/typeobj.rst:2539 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2515 ../../c-api/typeobj.rst:2526 +#: ../../c-api/typeobj.rst:2534 ../../c-api/typeobj.rst:2545 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:2522 +#: ../../c-api/typeobj.rst:2541 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2529 +#: ../../c-api/typeobj.rst:2548 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2533 +#: ../../c-api/typeobj.rst:2552 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:2537 +#: ../../c-api/typeobj.rst:2556 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:2541 +#: ../../c-api/typeobj.rst:2560 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:2545 +#: ../../c-api/typeobj.rst:2564 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:2549 +#: ../../c-api/typeobj.rst:2568 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:2553 +#: ../../c-api/typeobj.rst:2572 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:2567 +#: ../../c-api/typeobj.rst:2586 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:2583 +#: ../../c-api/typeobj.rst:2602 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2585 +#: ../../c-api/typeobj.rst:2604 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3398,33 +3424,33 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2590 +#: ../../c-api/typeobj.rst:2609 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2607 +#: ../../c-api/typeobj.rst:2626 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2651 +#: ../../c-api/typeobj.rst:2670 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2678 +#: ../../c-api/typeobj.rst:2697 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:2697 +#: ../../c-api/typeobj.rst:2716 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2708 +#: ../../c-api/typeobj.rst:2727 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index fb13926ca6..cc633d8410 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,203 +28,211 @@ msgid "" "Tasks." msgstr "" -#: ../../library/asyncio-task.rst:19 ../../library/asyncio-task.rst:144 +#: ../../library/asyncio-task.rst:19 ../../library/asyncio-task.rst:148 msgid "Coroutines" msgstr "協程" #: ../../library/asyncio-task.rst:21 +msgid "**Source code:** :source:`Lib/asyncio/coroutines.py`" +msgstr "**原始碼:**\\ :source:`Lib/asyncio/coroutines.py`" + +#: ../../library/asyncio-task.rst:25 msgid "" ":term:`Coroutines ` declared with the async/await syntax is the " "preferred way of writing asyncio applications. For example, the following " "snippet of code prints \"hello\", waits 1 second, and then prints \"world\"::" msgstr "" -#: ../../library/asyncio-task.rst:37 +#: ../../library/asyncio-task.rst:41 msgid "" "Note that simply calling a coroutine will not schedule it to be executed::" msgstr "" -#: ../../library/asyncio-task.rst:43 +#: ../../library/asyncio-task.rst:47 msgid "To actually run a coroutine, asyncio provides the following mechanisms:" msgstr "" -#: ../../library/asyncio-task.rst:45 +#: ../../library/asyncio-task.rst:49 msgid "" "The :func:`asyncio.run` function to run the top-level entry point \"main()\" " "function (see the above example.)" msgstr "" -#: ../../library/asyncio-task.rst:48 +#: ../../library/asyncio-task.rst:52 msgid "" "Awaiting on a coroutine. The following snippet of code will print \"hello\" " "after waiting for 1 second, and then print \"world\" after waiting for " "*another* 2 seconds::" msgstr "" -#: ../../library/asyncio-task.rst:69 +#: ../../library/asyncio-task.rst:73 msgid "Expected output::" msgstr "" -#: ../../library/asyncio-task.rst:76 +#: ../../library/asyncio-task.rst:80 msgid "" "The :func:`asyncio.create_task` function to run coroutines concurrently as " "asyncio :class:`Tasks `." msgstr "" -#: ../../library/asyncio-task.rst:79 +#: ../../library/asyncio-task.rst:83 msgid "" "Let's modify the above example and run two ``say_after`` coroutines " "*concurrently*::" msgstr "" -#: ../../library/asyncio-task.rst:98 +#: ../../library/asyncio-task.rst:102 msgid "" "Note that expected output now shows that the snippet runs 1 second faster " "than before::" msgstr "" -#: ../../library/asyncio-task.rst:106 +#: ../../library/asyncio-task.rst:110 msgid "" "The :class:`asyncio.TaskGroup` class provides a more modern alternative to :" "func:`create_task`. Using this API, the last example becomes::" msgstr "" -#: ../../library/asyncio-task.rst:124 +#: ../../library/asyncio-task.rst:128 msgid "The timing and output should be the same as for the previous version." msgstr "" -#: ../../library/asyncio-task.rst:126 +#: ../../library/asyncio-task.rst:130 msgid ":class:`asyncio.TaskGroup`." msgstr "" -#: ../../library/asyncio-task.rst:133 +#: ../../library/asyncio-task.rst:137 msgid "Awaitables" msgstr "" -#: ../../library/asyncio-task.rst:135 +#: ../../library/asyncio-task.rst:139 msgid "" "We say that an object is an **awaitable** object if it can be used in an :" "keyword:`await` expression. Many asyncio APIs are designed to accept " "awaitables." msgstr "" -#: ../../library/asyncio-task.rst:139 +#: ../../library/asyncio-task.rst:143 msgid "" "There are three main types of *awaitable* objects: **coroutines**, " "**Tasks**, and **Futures**." msgstr "" -#: ../../library/asyncio-task.rst:145 +#: ../../library/asyncio-task.rst:149 msgid "" "Python coroutines are *awaitables* and therefore can be awaited from other " "coroutines::" msgstr "" -#: ../../library/asyncio-task.rst:166 +#: ../../library/asyncio-task.rst:170 msgid "" "In this documentation the term \"coroutine\" can be used for two closely " "related concepts:" msgstr "" -#: ../../library/asyncio-task.rst:169 +#: ../../library/asyncio-task.rst:173 msgid "a *coroutine function*: an :keyword:`async def` function;" msgstr "" -#: ../../library/asyncio-task.rst:171 +#: ../../library/asyncio-task.rst:175 msgid "" "a *coroutine object*: an object returned by calling a *coroutine function*." msgstr "" -#: ../../library/asyncio-task.rst:176 +#: ../../library/asyncio-task.rst:180 msgid "Tasks" msgstr "" -#: ../../library/asyncio-task.rst:177 +#: ../../library/asyncio-task.rst:181 msgid "*Tasks* are used to schedule coroutines *concurrently*." msgstr "" -#: ../../library/asyncio-task.rst:179 +#: ../../library/asyncio-task.rst:183 msgid "" "When a coroutine is wrapped into a *Task* with functions like :func:`asyncio." "create_task` the coroutine is automatically scheduled to run soon::" msgstr "" -#: ../../library/asyncio-task.rst:201 +#: ../../library/asyncio-task.rst:205 msgid "Futures" msgstr "" -#: ../../library/asyncio-task.rst:202 +#: ../../library/asyncio-task.rst:206 msgid "" "A :class:`Future` is a special **low-level** awaitable object that " "represents an **eventual result** of an asynchronous operation." msgstr "" -#: ../../library/asyncio-task.rst:205 +#: ../../library/asyncio-task.rst:209 msgid "" "When a Future object is *awaited* it means that the coroutine will wait " "until the Future is resolved in some other place." msgstr "" -#: ../../library/asyncio-task.rst:208 +#: ../../library/asyncio-task.rst:212 msgid "" "Future objects in asyncio are needed to allow callback-based code to be used " "with async/await." msgstr "" -#: ../../library/asyncio-task.rst:211 +#: ../../library/asyncio-task.rst:215 msgid "" "Normally **there is no need** to create Future objects at the application " "level code." msgstr "" -#: ../../library/asyncio-task.rst:214 +#: ../../library/asyncio-task.rst:218 msgid "" "Future objects, sometimes exposed by libraries and some asyncio APIs, can be " "awaited::" msgstr "" -#: ../../library/asyncio-task.rst:226 +#: ../../library/asyncio-task.rst:230 msgid "" "A good example of a low-level function that returns a Future object is :meth:" "`loop.run_in_executor`." msgstr "" -#: ../../library/asyncio-task.rst:231 +#: ../../library/asyncio-task.rst:235 msgid "Creating Tasks" msgstr "" -#: ../../library/asyncio-task.rst:235 +#: ../../library/asyncio-task.rst:237 +msgid "**Source code:** :source:`Lib/asyncio/tasks.py`" +msgstr "**原始碼:**\\ :source:`Lib/asyncio/tasks.py`" + +#: ../../library/asyncio-task.rst:243 msgid "" "Wrap the *coro* :ref:`coroutine ` into a :class:`Task` and " "schedule its execution. Return the Task object." msgstr "" -#: ../../library/asyncio-task.rst:238 +#: ../../library/asyncio-task.rst:246 msgid "" "If *name* is not ``None``, it is set as the name of the task using :meth:" "`Task.set_name`." msgstr "" -#: ../../library/asyncio-task.rst:241 +#: ../../library/asyncio-task.rst:249 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. The current context " "copy is created when no *context* is provided." msgstr "" -#: ../../library/asyncio-task.rst:245 +#: ../../library/asyncio-task.rst:253 msgid "" "The task is executed in the loop returned by :func:`get_running_loop`, :exc:" "`RuntimeError` is raised if there is no running loop in current thread." msgstr "" -#: ../../library/asyncio-task.rst:251 +#: ../../library/asyncio-task.rst:259 msgid "" ":meth:`asyncio.TaskGroup.create_task` is a newer alternative that allows for " "convenient waiting for a group of related tasks." msgstr "" -#: ../../library/asyncio-task.rst:256 +#: ../../library/asyncio-task.rst:264 msgid "" "Save a reference to the result of this function, to avoid a task " "disappearing mid-execution. The event loop only keeps weak references to " @@ -233,25 +241,25 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:278 ../../library/asyncio-task.rst:1001 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1009 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" -#: ../../library/asyncio-task.rst:281 +#: ../../library/asyncio-task.rst:289 msgid "Added the *context* parameter." msgstr "新增 *context* 參數。" -#: ../../library/asyncio-task.rst:286 +#: ../../library/asyncio-task.rst:294 msgid "Task Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:288 +#: ../../library/asyncio-task.rst:296 msgid "" "Tasks can easily and safely be cancelled. When a task is cancelled, :exc:" "`asyncio.CancelledError` will be raised in the task at the next opportunity." msgstr "" -#: ../../library/asyncio-task.rst:292 +#: ../../library/asyncio-task.rst:300 msgid "" "It is recommended that coroutines use ``try/finally`` blocks to robustly " "perform clean-up logic. In case :exc:`asyncio.CancelledError` is explicitly " @@ -259,7 +267,7 @@ msgid "" "code can safely ignore :exc:`asyncio.CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:297 +#: ../../library/asyncio-task.rst:305 msgid "" "The asyncio components that enable structured concurrency, like :class:" "`asyncio.TaskGroup` and :func:`asyncio.timeout`, are implemented using " @@ -268,40 +276,40 @@ msgid "" "`uncancel `." msgstr "" -#: ../../library/asyncio-task.rst:306 +#: ../../library/asyncio-task.rst:314 msgid "Task Groups" msgstr "" -#: ../../library/asyncio-task.rst:308 +#: ../../library/asyncio-task.rst:316 msgid "" "Task groups combine a task creation API with a convenient and reliable way " "to wait for all tasks in the group to finish." msgstr "" -#: ../../library/asyncio-task.rst:313 +#: ../../library/asyncio-task.rst:321 msgid "" "An :ref:`asynchronous context manager ` holding a " "group of tasks. Tasks can be added to the group using :meth:`create_task`. " "All tasks are awaited when the context manager exits." msgstr "" -#: ../../library/asyncio-task.rst:322 +#: ../../library/asyncio-task.rst:330 msgid "" "Create a task in this task group. The signature matches that of :func:" "`asyncio.create_task`." msgstr "" -#: ../../library/asyncio-task.rst:325 ../../library/asyncio-task.rst:455 -#: ../../library/asyncio-task.rst:583 ../../library/asyncio-task.rst:647 -#: ../../library/asyncio-task.rst:673 ../../library/asyncio-task.rst:716 -#: ../../library/asyncio-task.rst:812 +#: ../../library/asyncio-task.rst:333 ../../library/asyncio-task.rst:463 +#: ../../library/asyncio-task.rst:591 ../../library/asyncio-task.rst:655 +#: ../../library/asyncio-task.rst:681 ../../library/asyncio-task.rst:724 +#: ../../library/asyncio-task.rst:820 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/asyncio-task.rst:333 +#: ../../library/asyncio-task.rst:341 msgid "" "The ``async with`` statement will wait for all tasks in the group to finish. " "While waiting, new tasks may still be added to the group (for example, by " @@ -310,7 +318,7 @@ msgid "" "block is exited, no new tasks may be added to the group." msgstr "" -#: ../../library/asyncio-task.rst:340 +#: ../../library/asyncio-task.rst:348 msgid "" "The first time any of the tasks belonging to the group fails with an " "exception other than :exc:`asyncio.CancelledError`, the remaining tasks in " @@ -322,7 +330,7 @@ msgid "" "bubble out of the containing ``async with`` statement." msgstr "" -#: ../../library/asyncio-task.rst:350 +#: ../../library/asyncio-task.rst:358 msgid "" "Once all tasks have finished, if any tasks have failed with an exception " "other than :exc:`asyncio.CancelledError`, those exceptions are combined in " @@ -330,7 +338,7 @@ msgid "" "their documentation) which is then raised." msgstr "" -#: ../../library/asyncio-task.rst:357 +#: ../../library/asyncio-task.rst:365 msgid "" "Two base exceptions are treated specially: If any task fails with :exc:" "`KeyboardInterrupt` or :exc:`SystemExit`, the task group still cancels the " @@ -339,7 +347,7 @@ msgid "" "`ExceptionGroup` or :exc:`BaseExceptionGroup`." msgstr "" -#: ../../library/asyncio-task.rst:363 +#: ../../library/asyncio-task.rst:371 msgid "" "If the body of the ``async with`` statement exits with an exception (so :" "meth:`~object.__aexit__` is called with an exception set), this is treated " @@ -351,68 +359,68 @@ msgid "" "`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph." msgstr "" -#: ../../library/asyncio-task.rst:377 +#: ../../library/asyncio-task.rst:385 msgid "Sleeping" msgstr "" -#: ../../library/asyncio-task.rst:381 +#: ../../library/asyncio-task.rst:389 msgid "Block for *delay* seconds." msgstr "" -#: ../../library/asyncio-task.rst:383 +#: ../../library/asyncio-task.rst:391 msgid "" "If *result* is provided, it is returned to the caller when the coroutine " "completes." msgstr "" -#: ../../library/asyncio-task.rst:386 +#: ../../library/asyncio-task.rst:394 msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" -#: ../../library/asyncio-task.rst:389 +#: ../../library/asyncio-task.rst:397 msgid "" "Setting the delay to 0 provides an optimized path to allow other tasks to " "run. This can be used by long-running functions to avoid blocking the event " "loop for the full duration of the function call." msgstr "" -#: ../../library/asyncio-task.rst:395 +#: ../../library/asyncio-task.rst:403 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "" -#: ../../library/asyncio-task.rst:413 ../../library/asyncio-task.rst:504 -#: ../../library/asyncio-task.rst:558 ../../library/asyncio-task.rst:711 -#: ../../library/asyncio-task.rst:741 ../../library/asyncio-task.rst:793 -#: ../../library/asyncio-task.rst:809 ../../library/asyncio-task.rst:818 +#: ../../library/asyncio-task.rst:421 ../../library/asyncio-task.rst:512 +#: ../../library/asyncio-task.rst:566 ../../library/asyncio-task.rst:719 +#: ../../library/asyncio-task.rst:749 ../../library/asyncio-task.rst:801 +#: ../../library/asyncio-task.rst:817 ../../library/asyncio-task.rst:826 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-task.rst:418 +#: ../../library/asyncio-task.rst:426 msgid "Running Tasks Concurrently" msgstr "" -#: ../../library/asyncio-task.rst:422 +#: ../../library/asyncio-task.rst:430 msgid "" "Run :ref:`awaitable objects ` in the *aws* sequence " "*concurrently*." msgstr "" -#: ../../library/asyncio-task.rst:425 +#: ../../library/asyncio-task.rst:433 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." msgstr "" -#: ../../library/asyncio-task.rst:428 +#: ../../library/asyncio-task.rst:436 msgid "" "If all awaitables are completed successfully, the result is an aggregate " "list of returned values. The order of result values corresponds to the " "order of awaitables in *aws*." msgstr "" -#: ../../library/asyncio-task.rst:432 +#: ../../library/asyncio-task.rst:440 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -420,19 +428,19 @@ msgid "" "run." msgstr "" -#: ../../library/asyncio-task.rst:437 +#: ../../library/asyncio-task.rst:445 msgid "" "If *return_exceptions* is ``True``, exceptions are treated the same as " "successful results, and aggregated in the result list." msgstr "" -#: ../../library/asyncio-task.rst:440 +#: ../../library/asyncio-task.rst:448 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:443 +#: ../../library/asyncio-task.rst:451 msgid "" "If any Task or Future from the *aws* sequence is *cancelled*, it is treated " "as if it raised :exc:`CancelledError` -- the ``gather()`` call is **not** " @@ -440,13 +448,13 @@ msgid "" "submitted Task/Future to cause other Tasks/Futures to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:450 +#: ../../library/asyncio-task.rst:458 msgid "" "A more modern way to create and run tasks concurrently and wait for their " "completion is :class:`asyncio.TaskGroup`." msgstr "" -#: ../../library/asyncio-task.rst:493 +#: ../../library/asyncio-task.rst:501 msgid "" "If *return_exceptions* is False, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " @@ -455,42 +463,42 @@ msgid "" "the awaitables) from gather won't cancel any other awaitables." msgstr "" -#: ../../library/asyncio-task.rst:500 +#: ../../library/asyncio-task.rst:508 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." msgstr "" -#: ../../library/asyncio-task.rst:507 +#: ../../library/asyncio-task.rst:515 msgid "" "Deprecation warning is emitted if no positional arguments are provided or " "not all positional arguments are Future-like objects and there is no running " "event loop." msgstr "" -#: ../../library/asyncio-task.rst:514 +#: ../../library/asyncio-task.rst:522 msgid "Shielding From Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:518 +#: ../../library/asyncio-task.rst:526 msgid "" "Protect an :ref:`awaitable object ` from being :meth:" "`cancelled `." msgstr "" -#: ../../library/asyncio-task.rst:521 ../../library/asyncio-task.rst:693 +#: ../../library/asyncio-task.rst:529 ../../library/asyncio-task.rst:701 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" -#: ../../library/asyncio-task.rst:523 +#: ../../library/asyncio-task.rst:531 msgid "The statement::" msgstr "" -#: ../../library/asyncio-task.rst:528 +#: ../../library/asyncio-task.rst:536 msgid "is equivalent to::" msgstr "" -#: ../../library/asyncio-task.rst:532 +#: ../../library/asyncio-task.rst:540 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -499,20 +507,20 @@ msgid "" "`CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:538 +#: ../../library/asyncio-task.rst:546 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: ../../library/asyncio-task.rst:541 +#: ../../library/asyncio-task.rst:549 msgid "" "If it is desired to completely ignore cancellation (not recommended) the " "``shield()`` function should be combined with a try/except clause, as " "follows::" msgstr "" -#: ../../library/asyncio-task.rst:553 +#: ../../library/asyncio-task.rst:561 msgid "" "Save a reference to tasks passed to this function, to avoid a task " "disappearing mid-execution. The event loop only keeps weak references to " @@ -520,36 +528,36 @@ msgid "" "any time, even before it's done." msgstr "" -#: ../../library/asyncio-task.rst:561 +#: ../../library/asyncio-task.rst:569 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:567 +#: ../../library/asyncio-task.rst:575 msgid "Timeouts" msgstr "" -#: ../../library/asyncio-task.rst:571 +#: ../../library/asyncio-task.rst:579 msgid "" "An :ref:`asynchronous context manager ` that can be " "used to limit the amount of time spent waiting on something." msgstr "" -#: ../../library/asyncio-task.rst:575 +#: ../../library/asyncio-task.rst:583 msgid "" "*delay* can either be ``None``, or a float/int number of seconds to wait. If " "*delay* is ``None``, no time limit will be applied; this can be useful if " "the delay is unknown when the context manager is created." msgstr "" -#: ../../library/asyncio-task.rst:580 +#: ../../library/asyncio-task.rst:588 msgid "" "In either case, the context manager can be rescheduled after creation using :" "meth:`Timeout.reschedule`." msgstr "" -#: ../../library/asyncio-task.rst:589 +#: ../../library/asyncio-task.rst:597 msgid "" "If ``long_running_task`` takes more than 10 seconds to complete, the context " "manager will cancel the current task and handle the resulting :exc:`asyncio." @@ -557,7 +565,7 @@ msgid "" "TimeoutError` which can be caught and handled." msgstr "" -#: ../../library/asyncio-task.rst:596 +#: ../../library/asyncio-task.rst:604 msgid "" "The :func:`asyncio.timeout` context manager is what transforms the :exc:" "`asyncio.CancelledError` into an :exc:`asyncio.TimeoutError`, which means " @@ -565,198 +573,198 @@ msgid "" "manager." msgstr "" -#: ../../library/asyncio-task.rst:601 +#: ../../library/asyncio-task.rst:609 msgid "Example of catching :exc:`asyncio.TimeoutError`::" msgstr "" -#: ../../library/asyncio-task.rst:612 +#: ../../library/asyncio-task.rst:620 msgid "" "The context manager produced by :func:`asyncio.timeout` can be rescheduled " "to a different deadline and inspected." msgstr "" -#: ../../library/asyncio-task.rst:617 +#: ../../library/asyncio-task.rst:625 msgid "" "An :ref:`asynchronous context manager ` that limits " "time spent inside of it." msgstr "" -#: ../../library/asyncio-task.rst:624 +#: ../../library/asyncio-task.rst:632 msgid "" "Return the current deadline, or ``None`` if the current deadline is not set." msgstr "" -#: ../../library/asyncio-task.rst:627 +#: ../../library/asyncio-task.rst:635 msgid "" "The deadline is a float, consistent with the time returned by :meth:`loop." "time`." msgstr "" -#: ../../library/asyncio-task.rst:632 +#: ../../library/asyncio-task.rst:640 msgid "Change the time the timeout will trigger." msgstr "" -#: ../../library/asyncio-task.rst:634 +#: ../../library/asyncio-task.rst:642 msgid "" "If *when* is ``None``, any current deadline will be removed, and the context " "manager will wait indefinitely." msgstr "" -#: ../../library/asyncio-task.rst:637 +#: ../../library/asyncio-task.rst:645 msgid "If *when* is a float, it is set as the new deadline." msgstr "" -#: ../../library/asyncio-task.rst:639 +#: ../../library/asyncio-task.rst:647 msgid "" "if *when* is in the past, the timeout will trigger on the next iteration of " "the event loop." msgstr "" -#: ../../library/asyncio-task.rst:644 +#: ../../library/asyncio-task.rst:652 msgid "Return whether the context manager has exceeded its deadline (expired)." msgstr "" -#: ../../library/asyncio-task.rst:664 +#: ../../library/asyncio-task.rst:672 msgid "Timeout context managers can be safely nested." msgstr "" -#: ../../library/asyncio-task.rst:670 +#: ../../library/asyncio-task.rst:678 msgid "" "Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " "stop waiting, or ``None``." msgstr "" -#: ../../library/asyncio-task.rst:690 +#: ../../library/asyncio-task.rst:698 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:695 +#: ../../library/asyncio-task.rst:703 msgid "" "*timeout* can either be ``None`` or a float or int number of seconds to wait " "for. If *timeout* is ``None``, block until the future completes." msgstr "" -#: ../../library/asyncio-task.rst:699 +#: ../../library/asyncio-task.rst:707 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:702 +#: ../../library/asyncio-task.rst:710 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:705 +#: ../../library/asyncio-task.rst:713 msgid "" "The function will wait until the future is actually cancelled, so the total " "wait time may exceed the *timeout*. If an exception happens during " "cancellation, it is propagated." msgstr "" -#: ../../library/asyncio-task.rst:709 +#: ../../library/asyncio-task.rst:717 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:736 +#: ../../library/asyncio-task.rst:744 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`TimeoutError` immediately." msgstr "" -#: ../../library/asyncio-task.rst:746 +#: ../../library/asyncio-task.rst:754 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:750 +#: ../../library/asyncio-task.rst:758 msgid "" "Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the " "*aws* iterable concurrently and block until the condition specified by " "*return_when*." msgstr "" -#: ../../library/asyncio-task.rst:754 +#: ../../library/asyncio-task.rst:762 msgid "The *aws* iterable must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:756 +#: ../../library/asyncio-task.rst:764 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:758 +#: ../../library/asyncio-task.rst:766 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-task.rst:762 +#: ../../library/asyncio-task.rst:770 msgid "" "*timeout* (a float or int), if specified, can be used to control the maximum " "number of seconds to wait before returning." msgstr "" -#: ../../library/asyncio-task.rst:765 +#: ../../library/asyncio-task.rst:773 msgid "" "Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks " "that aren't done when the timeout occurs are simply returned in the second " "set." msgstr "" -#: ../../library/asyncio-task.rst:769 +#: ../../library/asyncio-task.rst:777 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:775 +#: ../../library/asyncio-task.rst:783 msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:775 +#: ../../library/asyncio-task.rst:783 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:777 +#: ../../library/asyncio-task.rst:785 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/asyncio-task.rst:777 +#: ../../library/asyncio-task.rst:785 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:780 +#: ../../library/asyncio-task.rst:788 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/asyncio-task.rst:780 +#: ../../library/asyncio-task.rst:788 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: ../../library/asyncio-task.rst:786 +#: ../../library/asyncio-task.rst:794 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/asyncio-task.rst:786 +#: ../../library/asyncio-task.rst:794 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:790 +#: ../../library/asyncio-task.rst:798 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:796 +#: ../../library/asyncio-task.rst:804 msgid "Passing coroutine objects to ``wait()`` directly is forbidden." msgstr "" -#: ../../library/asyncio-task.rst:801 +#: ../../library/asyncio-task.rst:809 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently. Return an iterator of coroutines. Each coroutine returned can " @@ -764,26 +772,26 @@ msgid "" "remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:806 +#: ../../library/asyncio-task.rst:814 msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" -#: ../../library/asyncio-task.rst:821 +#: ../../library/asyncio-task.rst:829 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:827 +#: ../../library/asyncio-task.rst:835 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:831 +#: ../../library/asyncio-task.rst:839 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:833 +#: ../../library/asyncio-task.rst:841 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -791,19 +799,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:838 +#: ../../library/asyncio-task.rst:846 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:840 +#: ../../library/asyncio-task.rst:848 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were run in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:870 +#: ../../library/asyncio-task.rst:878 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " "loop for its duration, resulting in an additional 1 second of run time. " @@ -811,7 +819,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:877 +#: ../../library/asyncio-task.rst:885 msgid "" "Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " "to make IO-bound functions non-blocking. However, for extension modules that " @@ -819,81 +827,81 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:886 +#: ../../library/asyncio-task.rst:894 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:890 +#: ../../library/asyncio-task.rst:898 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:892 +#: ../../library/asyncio-task.rst:900 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:895 +#: ../../library/asyncio-task.rst:903 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:907 +#: ../../library/asyncio-task.rst:915 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:921 +#: ../../library/asyncio-task.rst:929 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:924 +#: ../../library/asyncio-task.rst:932 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:931 +#: ../../library/asyncio-task.rst:939 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:936 +#: ../../library/asyncio-task.rst:944 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:939 +#: ../../library/asyncio-task.rst:947 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:947 +#: ../../library/asyncio-task.rst:955 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:950 +#: ../../library/asyncio-task.rst:958 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:957 +#: ../../library/asyncio-task.rst:965 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:961 +#: ../../library/asyncio-task.rst:969 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:964 +#: ../../library/asyncio-task.rst:972 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -901,21 +909,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:970 +#: ../../library/asyncio-task.rst:978 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:975 +#: ../../library/asyncio-task.rst:983 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:980 +#: ../../library/asyncio-task.rst:988 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -923,112 +931,112 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:985 +#: ../../library/asyncio-task.rst:993 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:990 +#: ../../library/asyncio-task.rst:998 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:994 +#: ../../library/asyncio-task.rst:1002 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:998 +#: ../../library/asyncio-task.rst:1006 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1004 +#: ../../library/asyncio-task.rst:1012 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1010 +#: ../../library/asyncio-task.rst:1018 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1012 +#: ../../library/asyncio-task.rst:1020 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1017 +#: ../../library/asyncio-task.rst:1025 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1019 +#: ../../library/asyncio-task.rst:1027 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:1023 ../../library/asyncio-task.rst:1037 +#: ../../library/asyncio-task.rst:1031 ../../library/asyncio-task.rst:1045 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1026 +#: ../../library/asyncio-task.rst:1034 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1031 +#: ../../library/asyncio-task.rst:1039 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1033 +#: ../../library/asyncio-task.rst:1041 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1040 +#: ../../library/asyncio-task.rst:1048 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1045 +#: ../../library/asyncio-task.rst:1053 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1047 ../../library/asyncio-task.rst:1056 +#: ../../library/asyncio-task.rst:1055 ../../library/asyncio-task.rst:1064 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1049 +#: ../../library/asyncio-task.rst:1057 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1054 +#: ../../library/asyncio-task.rst:1062 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1058 +#: ../../library/asyncio-task.rst:1066 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1063 +#: ../../library/asyncio-task.rst:1071 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1065 +#: ../../library/asyncio-task.rst:1073 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1036,15 +1044,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1071 +#: ../../library/asyncio-task.rst:1079 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1073 +#: ../../library/asyncio-task.rst:1081 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1075 +#: ../../library/asyncio-task.rst:1083 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1053,66 +1061,66 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1084 +#: ../../library/asyncio-task.rst:1092 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1086 +#: ../../library/asyncio-task.rst:1094 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1089 +#: ../../library/asyncio-task.rst:1097 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1091 +#: ../../library/asyncio-task.rst:1099 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stderr`." msgstr "" -#: ../../library/asyncio-task.rst:1096 +#: ../../library/asyncio-task.rst:1104 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1102 +#: ../../library/asyncio-task.rst:1110 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1104 +#: ../../library/asyncio-task.rst:1112 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1112 +#: ../../library/asyncio-task.rst:1120 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1114 +#: ../../library/asyncio-task.rst:1122 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1117 +#: ../../library/asyncio-task.rst:1125 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1124 +#: ../../library/asyncio-task.rst:1132 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1126 +#: ../../library/asyncio-task.rst:1134 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1129 +#: ../../library/asyncio-task.rst:1137 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1122,46 +1130,46 @@ msgid "" "is actively discouraged." msgstr "" -#: ../../library/asyncio-task.rst:1137 +#: ../../library/asyncio-task.rst:1145 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1140 +#: ../../library/asyncio-task.rst:1148 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1145 +#: ../../library/asyncio-task.rst:1153 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1184 +#: ../../library/asyncio-task.rst:1192 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1186 +#: ../../library/asyncio-task.rst:1194 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:1192 +#: ../../library/asyncio-task.rst:1200 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1194 +#: ../../library/asyncio-task.rst:1202 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1196 +#: ../../library/asyncio-task.rst:1204 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1201 +#: ../../library/asyncio-task.rst:1209 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1170,7 +1178,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1219 +#: ../../library/asyncio-task.rst:1227 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1179,13 +1187,13 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1227 +#: ../../library/asyncio-task.rst:1235 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1231 +#: ../../library/asyncio-task.rst:1239 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1194,7 +1202,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1237 +#: ../../library/asyncio-task.rst:1245 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/base64.po b/library/base64.po index 66048cdaab..7f43e98b63 100644 --- a/library/base64.po +++ b/library/base64.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-11-30 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,32 +93,39 @@ msgstr "" #: ../../library/base64.rst:56 msgid "" -"Optional *altchars* must be a :term:`bytes-like object` of at least length 2 " -"(additional characters are ignored) which specifies an alternative alphabet " -"for the ``+`` and ``/`` characters. This allows an application to e.g. " -"generate URL or filesystem safe Base64 strings. The default is ``None``, " -"for which the standard Base64 alphabet is used." +"Optional *altchars* must be a :term:`bytes-like object` of length 2 which " +"specifies an alternative alphabet for the ``+`` and ``/`` characters. This " +"allows an application to e.g. generate URL or filesystem safe Base64 " +"strings. The default is ``None``, for which the standard Base64 alphabet is " +"used." msgstr "" -#: ../../library/base64.rst:65 +#: ../../library/base64.rst:61 +msgid "" +"May assert or raise a a :exc:`ValueError` if the length of *altchars* is not " +"2. Raises a :exc:`TypeError` if *altchars* is not a :term:`bytes-like " +"object`." +msgstr "" + +#: ../../library/base64.rst:67 msgid "" "Decode the Base64 encoded :term:`bytes-like object` or ASCII string *s* and " "return the decoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:68 +#: ../../library/base64.rst:70 msgid "" "Optional *altchars* must be a :term:`bytes-like object` or ASCII string of " -"at least length 2 (additional characters are ignored) which specifies the " -"alternative alphabet used instead of the ``+`` and ``/`` characters." +"length 2 which specifies the alternative alphabet used instead of the ``+`` " +"and ``/`` characters." msgstr "" -#: ../../library/base64.rst:72 +#: ../../library/base64.rst:74 msgid "" "A :exc:`binascii.Error` exception is raised if *s* is incorrectly padded." msgstr "" -#: ../../library/base64.rst:75 +#: ../../library/base64.rst:77 msgid "" "If *validate* is ``False`` (the default), characters that are neither in the " "normal base-64 alphabet nor the alternative alphabet are discarded prior to " @@ -126,25 +133,30 @@ msgid "" "in the input result in a :exc:`binascii.Error`." msgstr "" -#: ../../library/base64.rst:81 +#: ../../library/base64.rst:83 msgid "" "For more information about the strict base64 check, see :func:`binascii." "a2b_base64`" msgstr "" -#: ../../library/base64.rst:86 +#: ../../library/base64.rst:85 +msgid "" +"May assert or raise a :exc:`ValueError` if the length of *altchars* is not 2." +msgstr "" + +#: ../../library/base64.rst:89 msgid "" "Encode :term:`bytes-like object` *s* using the standard Base64 alphabet and " "return the encoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:92 +#: ../../library/base64.rst:95 msgid "" "Decode :term:`bytes-like object` or ASCII string *s* using the standard " "Base64 alphabet and return the decoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:98 +#: ../../library/base64.rst:101 msgid "" "Encode :term:`bytes-like object` *s* using the URL- and filesystem-safe " "alphabet, which substitutes ``-`` instead of ``+`` and ``_`` instead of ``/" @@ -152,7 +164,7 @@ msgid "" "The result can still contain ``=``." msgstr "" -#: ../../library/base64.rst:107 +#: ../../library/base64.rst:110 msgid "" "Decode :term:`bytes-like object` or ASCII string *s* using the URL- and " "filesystem-safe alphabet, which substitutes ``-`` instead of ``+`` and ``_`` " @@ -160,25 +172,25 @@ msgid "" "class:`bytes`." msgstr "" -#: ../../library/base64.rst:116 +#: ../../library/base64.rst:119 msgid "" "Encode the :term:`bytes-like object` *s* using Base32 and return the " "encoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:122 +#: ../../library/base64.rst:125 msgid "" "Decode the Base32 encoded :term:`bytes-like object` or ASCII string *s* and " "return the decoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:125 ../../library/base64.rst:173 +#: ../../library/base64.rst:128 ../../library/base64.rst:176 msgid "" "Optional *casefold* is a flag specifying whether a lowercase alphabet is " "acceptable as input. For security purposes, the default is ``False``." msgstr "" -#: ../../library/base64.rst:129 +#: ../../library/base64.rst:132 msgid "" ":rfc:`4648` allows for optional mapping of the digit 0 (zero) to the letter " "O (oh), and for optional mapping of the digit 1 (one) to either the letter I " @@ -189,25 +201,25 @@ msgid "" "input." msgstr "" -#: ../../library/base64.rst:136 ../../library/base64.rst:177 +#: ../../library/base64.rst:139 ../../library/base64.rst:180 msgid "" "A :exc:`binascii.Error` is raised if *s* is incorrectly padded or if there " "are non-alphabet characters present in the input." msgstr "" -#: ../../library/base64.rst:143 +#: ../../library/base64.rst:146 msgid "" "Similar to :func:`b32encode` but uses the Extended Hex Alphabet, as defined " "in :rfc:`4648`." msgstr "" -#: ../../library/base64.rst:151 +#: ../../library/base64.rst:154 msgid "" "Similar to :func:`b32decode` but uses the Extended Hex Alphabet, as defined " "in :rfc:`4648`." msgstr "" -#: ../../library/base64.rst:154 +#: ../../library/base64.rst:157 msgid "" "This version does not allow the digit 0 (zero) to the letter O (oh) and " "digit 1 (one) to either the letter I (eye) or letter L (el) mappings, all " @@ -215,70 +227,70 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/base64.rst:164 +#: ../../library/base64.rst:167 msgid "" "Encode the :term:`bytes-like object` *s* using Base16 and return the " "encoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:170 +#: ../../library/base64.rst:173 msgid "" "Decode the Base16 encoded :term:`bytes-like object` or ASCII string *s* and " "return the decoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:184 +#: ../../library/base64.rst:187 msgid "" "Encode the :term:`bytes-like object` *b* using Ascii85 and return the " "encoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:187 +#: ../../library/base64.rst:190 msgid "" "*foldspaces* is an optional flag that uses the special short sequence 'y' " "instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This " "feature is not supported by the \"standard\" Ascii85 encoding." msgstr "" -#: ../../library/base64.rst:191 +#: ../../library/base64.rst:194 msgid "" "*wrapcol* controls whether the output should have newline (``b'\\n'``) " "characters added to it. If this is non-zero, each output line will be at " "most this many characters long." msgstr "" -#: ../../library/base64.rst:195 +#: ../../library/base64.rst:198 msgid "" "*pad* controls whether the input is padded to a multiple of 4 before " "encoding. Note that the ``btoa`` implementation always pads." msgstr "" -#: ../../library/base64.rst:198 +#: ../../library/base64.rst:201 msgid "" "*adobe* controls whether the encoded byte sequence is framed with ``<~`` and " "``~>``, which is used by the Adobe implementation." msgstr "" -#: ../../library/base64.rst:206 +#: ../../library/base64.rst:209 msgid "" "Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and " "return the decoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:209 +#: ../../library/base64.rst:212 msgid "" "*foldspaces* is a flag that specifies whether the 'y' short sequence should " "be accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature " "is not supported by the \"standard\" Ascii85 encoding." msgstr "" -#: ../../library/base64.rst:213 +#: ../../library/base64.rst:216 msgid "" "*adobe* controls whether the input sequence is in Adobe Ascii85 format (i.e. " "is framed with <~ and ~>)." msgstr "" -#: ../../library/base64.rst:216 +#: ../../library/base64.rst:219 msgid "" "*ignorechars* should be a :term:`bytes-like object` or ASCII string " "containing characters to ignore from the input. This should only contain " @@ -286,30 +298,30 @@ msgid "" "ASCII." msgstr "" -#: ../../library/base64.rst:226 +#: ../../library/base64.rst:229 msgid "" "Encode the :term:`bytes-like object` *b* using base85 (as used in e.g. git-" "style binary diffs) and return the encoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:229 +#: ../../library/base64.rst:232 msgid "" "If *pad* is true, the input is padded with ``b'\\0'`` so its length is a " "multiple of 4 bytes before encoding." msgstr "" -#: ../../library/base64.rst:237 +#: ../../library/base64.rst:240 msgid "" "Decode the base85-encoded :term:`bytes-like object` or ASCII string *b* and " "return the decoded :class:`bytes`. Padding is implicitly removed, if " "necessary." msgstr "" -#: ../../library/base64.rst:244 +#: ../../library/base64.rst:247 msgid "The legacy interface:" msgstr "" -#: ../../library/base64.rst:248 +#: ../../library/base64.rst:251 msgid "" "Decode the contents of the binary *input* file and write the resulting " "binary data to the *output* file. *input* and *output* must be :term:`file " @@ -317,13 +329,13 @@ msgid "" "returns an empty bytes object." msgstr "" -#: ../../library/base64.rst:256 +#: ../../library/base64.rst:259 msgid "" "Decode the :term:`bytes-like object` *s*, which must contain one or more " "lines of base64 encoded data, and return the decoded :class:`bytes`." msgstr "" -#: ../../library/base64.rst:264 +#: ../../library/base64.rst:267 msgid "" "Encode the contents of the binary *input* file and write the resulting " "base64 encoded data to the *output* file. *input* and *output* must be :term:" @@ -333,7 +345,7 @@ msgid "" "the output always ends with a newline, as per :rfc:`2045` (MIME)." msgstr "" -#: ../../library/base64.rst:274 +#: ../../library/base64.rst:277 msgid "" "Encode the :term:`bytes-like object` *s*, which can contain arbitrary binary " "data, and return :class:`bytes` containing the base64-encoded data, with " @@ -341,38 +353,38 @@ msgid "" "that there is a trailing newline, as per :rfc:`2045` (MIME)." msgstr "" -#: ../../library/base64.rst:282 +#: ../../library/base64.rst:285 msgid "An example usage of the module:" msgstr "" -#: ../../library/base64.rst:295 +#: ../../library/base64.rst:298 msgid "Security Considerations" msgstr "" -#: ../../library/base64.rst:297 +#: ../../library/base64.rst:300 msgid "" "A new security considerations section was added to :rfc:`4648` (section 12); " "it's recommended to review the security section for any code deployed to " "production." msgstr "" -#: ../../library/base64.rst:303 +#: ../../library/base64.rst:306 msgid "Module :mod:`binascii`" msgstr ":mod:`binascii` 模組" -#: ../../library/base64.rst:303 +#: ../../library/base64.rst:306 msgid "" "Support module containing ASCII-to-binary and binary-to-ASCII conversions." msgstr "" -#: ../../library/base64.rst:306 +#: ../../library/base64.rst:309 msgid "" ":rfc:`1521` - MIME (Multipurpose Internet Mail Extensions) Part One: " "Mechanisms for Specifying and Describing the Format of Internet Message " "Bodies" msgstr "" -#: ../../library/base64.rst:306 +#: ../../library/base64.rst:309 msgid "" "Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition " "of the base64 encoding." diff --git a/library/ctypes.po b/library/ctypes.po index b01e0c505f..79aa5fb865 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-23 00:17+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,25 +23,29 @@ msgstr "" msgid ":mod:`ctypes` --- A foreign function library for Python" msgstr "" -#: ../../library/ctypes.rst:11 +#: ../../library/ctypes.rst:9 +msgid "**Source code:** :source:`Lib/ctypes`" +msgstr "**原始碼:**\\ :source:`Lib/ctypes`" + +#: ../../library/ctypes.rst:13 msgid "" ":mod:`ctypes` is a foreign function library for Python. It provides C " "compatible data types, and allows calling functions in DLLs or shared " "libraries. It can be used to wrap these libraries in pure Python." msgstr "" -#: ../../library/ctypes.rst:19 +#: ../../library/ctypes.rst:21 msgid "ctypes tutorial" msgstr "" -#: ../../library/ctypes.rst:21 +#: ../../library/ctypes.rst:23 msgid "" "Note: The code samples in this tutorial use :mod:`doctest` to make sure that " "they actually work. Since some code samples behave differently under Linux, " "Windows, or macOS, they contain doctest directives in comments." msgstr "" -#: ../../library/ctypes.rst:25 +#: ../../library/ctypes.rst:27 msgid "" "Note: Some code samples reference the ctypes :class:`c_int` type. On " "platforms where ``sizeof(long) == sizeof(int)`` it is an alias to :class:" @@ -49,17 +53,17 @@ msgid "" "you would expect :class:`c_int` --- they are actually the same type." msgstr "" -#: ../../library/ctypes.rst:33 +#: ../../library/ctypes.rst:35 msgid "Loading dynamic link libraries" msgstr "" -#: ../../library/ctypes.rst:35 +#: ../../library/ctypes.rst:37 msgid "" ":mod:`ctypes` exports the *cdll*, and on Windows *windll* and *oledll* " "objects, for loading dynamic link libraries." msgstr "" -#: ../../library/ctypes.rst:38 +#: ../../library/ctypes.rst:40 msgid "" "You load libraries by accessing them as attributes of these objects. *cdll* " "loads libraries which export functions using the standard ``cdecl`` calling " @@ -70,24 +74,24 @@ msgid "" "the function call fails." msgstr "" -#: ../../library/ctypes.rst:46 +#: ../../library/ctypes.rst:48 msgid "" "Windows errors used to raise :exc:`WindowsError`, which is now an alias of :" "exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:51 +#: ../../library/ctypes.rst:53 msgid "" "Here are some examples for Windows. Note that ``msvcrt`` is the MS standard " "C library containing most standard C functions, and uses the cdecl calling " "convention::" msgstr "" -#: ../../library/ctypes.rst:63 +#: ../../library/ctypes.rst:65 msgid "Windows appends the usual ``.dll`` file suffix automatically." msgstr "" -#: ../../library/ctypes.rst:66 +#: ../../library/ctypes.rst:68 msgid "" "Accessing the standard C library through ``cdll.msvcrt`` will use an " "outdated version of the library that may be incompatible with the one being " @@ -95,7 +99,7 @@ msgid "" "import and use the ``msvcrt`` module." msgstr "" -#: ../../library/ctypes.rst:71 +#: ../../library/ctypes.rst:73 msgid "" "On Linux, it is required to specify the filename *including* the extension " "to load a library, so attribute access can not be used to load libraries. " @@ -104,15 +108,15 @@ msgid "" "constructor::" msgstr "" -#: ../../library/ctypes.rst:89 +#: ../../library/ctypes.rst:91 msgid "Accessing functions from loaded dlls" msgstr "" -#: ../../library/ctypes.rst:91 +#: ../../library/ctypes.rst:93 msgid "Functions are accessed as attributes of dll objects::" msgstr "" -#: ../../library/ctypes.rst:106 +#: ../../library/ctypes.rst:108 msgid "" "Note that win32 system dlls like ``kernel32`` and ``user32`` often export " "ANSI as well as UNICODE versions of a function. The UNICODE version is " @@ -123,32 +127,32 @@ msgid "" "``GetModuleHandle`` depending on whether UNICODE is defined or not::" msgstr "" -#: ../../library/ctypes.rst:119 +#: ../../library/ctypes.rst:121 msgid "" "*windll* does not try to select one of them by magic, you must access the " "version you need by specifying ``GetModuleHandleA`` or ``GetModuleHandleW`` " "explicitly, and then call it with bytes or string objects respectively." msgstr "" -#: ../../library/ctypes.rst:123 +#: ../../library/ctypes.rst:125 msgid "" "Sometimes, dlls export functions with names which aren't valid Python " "identifiers, like ``\"??2@YAPAXI@Z\"``. In this case you have to use :func:" "`getattr` to retrieve the function::" msgstr "" -#: ../../library/ctypes.rst:131 +#: ../../library/ctypes.rst:133 msgid "" "On Windows, some dlls export functions not by name but by ordinal. These " "functions can be accessed by indexing the dll object with the ordinal " "number::" msgstr "" -#: ../../library/ctypes.rst:148 +#: ../../library/ctypes.rst:150 msgid "Calling functions" msgstr "" -#: ../../library/ctypes.rst:150 +#: ../../library/ctypes.rst:152 msgid "" "You can call these functions like any other Python callable. This example " "uses the ``time()`` function, which returns system time in seconds since the " @@ -156,32 +160,32 @@ msgid "" "module handle." msgstr "" -#: ../../library/ctypes.rst:155 +#: ../../library/ctypes.rst:157 msgid "" "This example calls both functions with a ``NULL`` pointer (``None`` should " "be used as the ``NULL`` pointer)::" msgstr "" -#: ../../library/ctypes.rst:164 +#: ../../library/ctypes.rst:166 msgid "" ":exc:`ValueError` is raised when you call an ``stdcall`` function with the " "``cdecl`` calling convention, or vice versa::" msgstr "" -#: ../../library/ctypes.rst:179 +#: ../../library/ctypes.rst:181 msgid "" "To find out the correct calling convention you have to look into the C " "header file or the documentation for the function you want to call." msgstr "" -#: ../../library/ctypes.rst:182 +#: ../../library/ctypes.rst:184 msgid "" "On Windows, :mod:`ctypes` uses win32 structured exception handling to " "prevent crashes from general protection faults when functions are called " "with invalid argument values::" msgstr "" -#: ../../library/ctypes.rst:192 +#: ../../library/ctypes.rst:194 msgid "" "There are, however, enough ways to crash Python with :mod:`ctypes`, so you " "should be careful anyway. The :mod:`faulthandler` module can be helpful in " @@ -189,7 +193,7 @@ msgid "" "library calls)." msgstr "" -#: ../../library/ctypes.rst:197 +#: ../../library/ctypes.rst:199 msgid "" "``None``, integers, bytes objects and (unicode) strings are the only native " "Python objects that can directly be used as parameters in these function " @@ -200,250 +204,250 @@ msgid "" "the C type." msgstr "" -#: ../../library/ctypes.rst:204 +#: ../../library/ctypes.rst:206 msgid "" "Before we move on calling functions with other parameter types, we have to " "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:211 ../../library/ctypes.rst:2157 +#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2159 msgid "Fundamental data types" msgstr "" -#: ../../library/ctypes.rst:213 +#: ../../library/ctypes.rst:215 msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" msgstr "" -#: ../../library/ctypes.rst:216 +#: ../../library/ctypes.rst:218 msgid "ctypes type" msgstr "" -#: ../../library/ctypes.rst:216 +#: ../../library/ctypes.rst:218 msgid "C type" msgstr "" -#: ../../library/ctypes.rst:216 +#: ../../library/ctypes.rst:218 msgid "Python type" msgstr "" -#: ../../library/ctypes.rst:218 +#: ../../library/ctypes.rst:220 msgid ":class:`c_bool`" msgstr ":class:`c_bool`" -#: ../../library/ctypes.rst:218 +#: ../../library/ctypes.rst:220 msgid ":c:expr:`_Bool`" msgstr ":c:expr:`_Bool`" -#: ../../library/ctypes.rst:218 +#: ../../library/ctypes.rst:220 msgid "bool (1)" msgstr "bool (1)" -#: ../../library/ctypes.rst:220 +#: ../../library/ctypes.rst:222 msgid ":class:`c_char`" msgstr ":class:`c_char`" -#: ../../library/ctypes.rst:220 ../../library/ctypes.rst:224 +#: ../../library/ctypes.rst:222 ../../library/ctypes.rst:226 msgid ":c:expr:`char`" msgstr ":c:expr:`char`" -#: ../../library/ctypes.rst:220 +#: ../../library/ctypes.rst:222 msgid "1-character bytes object" msgstr "" -#: ../../library/ctypes.rst:222 +#: ../../library/ctypes.rst:224 msgid ":class:`c_wchar`" msgstr ":class:`c_wchar`" -#: ../../library/ctypes.rst:222 +#: ../../library/ctypes.rst:224 msgid ":c:expr:`wchar_t`" msgstr ":c:expr:`wchar_t`" -#: ../../library/ctypes.rst:222 +#: ../../library/ctypes.rst:224 msgid "1-character string" msgstr "" -#: ../../library/ctypes.rst:224 +#: ../../library/ctypes.rst:226 msgid ":class:`c_byte`" msgstr ":class:`c_byte`" -#: ../../library/ctypes.rst:224 ../../library/ctypes.rst:226 -#: ../../library/ctypes.rst:228 ../../library/ctypes.rst:230 -#: ../../library/ctypes.rst:232 ../../library/ctypes.rst:234 -#: ../../library/ctypes.rst:236 ../../library/ctypes.rst:238 -#: ../../library/ctypes.rst:240 ../../library/ctypes.rst:242 -#: ../../library/ctypes.rst:245 ../../library/ctypes.rst:247 +#: ../../library/ctypes.rst:226 ../../library/ctypes.rst:228 +#: ../../library/ctypes.rst:230 ../../library/ctypes.rst:232 +#: ../../library/ctypes.rst:234 ../../library/ctypes.rst:236 +#: ../../library/ctypes.rst:238 ../../library/ctypes.rst:240 +#: ../../library/ctypes.rst:242 ../../library/ctypes.rst:244 +#: ../../library/ctypes.rst:247 ../../library/ctypes.rst:249 msgid "int" msgstr "int" -#: ../../library/ctypes.rst:226 +#: ../../library/ctypes.rst:228 msgid ":class:`c_ubyte`" msgstr ":class:`c_ubyte`" -#: ../../library/ctypes.rst:226 +#: ../../library/ctypes.rst:228 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../library/ctypes.rst:228 +#: ../../library/ctypes.rst:230 msgid ":class:`c_short`" msgstr ":class:`c_short`" -#: ../../library/ctypes.rst:228 +#: ../../library/ctypes.rst:230 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../library/ctypes.rst:230 +#: ../../library/ctypes.rst:232 msgid ":class:`c_ushort`" msgstr ":class:`c_ushort`" -#: ../../library/ctypes.rst:230 +#: ../../library/ctypes.rst:232 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../library/ctypes.rst:232 +#: ../../library/ctypes.rst:234 msgid ":class:`c_int`" msgstr ":class:`c_int`" -#: ../../library/ctypes.rst:232 +#: ../../library/ctypes.rst:234 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../library/ctypes.rst:234 +#: ../../library/ctypes.rst:236 msgid ":class:`c_uint`" msgstr ":class:`c_uint`" -#: ../../library/ctypes.rst:234 +#: ../../library/ctypes.rst:236 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../library/ctypes.rst:236 +#: ../../library/ctypes.rst:238 msgid ":class:`c_long`" msgstr ":class:`c_long`" -#: ../../library/ctypes.rst:236 +#: ../../library/ctypes.rst:238 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../library/ctypes.rst:238 +#: ../../library/ctypes.rst:240 msgid ":class:`c_ulong`" msgstr ":class:`c_ulong`" -#: ../../library/ctypes.rst:238 +#: ../../library/ctypes.rst:240 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../library/ctypes.rst:240 +#: ../../library/ctypes.rst:242 msgid ":class:`c_longlong`" msgstr ":class:`c_longlong`" -#: ../../library/ctypes.rst:240 +#: ../../library/ctypes.rst:242 msgid ":c:expr:`__int64` or :c:expr:`long long`" msgstr ":c:expr:`__int64` 或 :c:expr:`long long`" -#: ../../library/ctypes.rst:242 +#: ../../library/ctypes.rst:244 msgid ":class:`c_ulonglong`" msgstr ":class:`c_ulonglong`" -#: ../../library/ctypes.rst:242 +#: ../../library/ctypes.rst:244 msgid ":c:expr:`unsigned __int64` or :c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned __int64` 或 :c:expr:`unsigned long long`" -#: ../../library/ctypes.rst:245 +#: ../../library/ctypes.rst:247 msgid ":class:`c_size_t`" msgstr ":class:`c_size_t`" -#: ../../library/ctypes.rst:245 +#: ../../library/ctypes.rst:247 msgid ":c:expr:`size_t`" msgstr ":c:expr:`size_t`" -#: ../../library/ctypes.rst:247 +#: ../../library/ctypes.rst:249 msgid ":class:`c_ssize_t`" msgstr ":class:`c_ssize_t`" -#: ../../library/ctypes.rst:247 +#: ../../library/ctypes.rst:249 msgid ":c:expr:`ssize_t` or :c:expr:`Py_ssize_t`" msgstr ":c:expr:`ssize_t` 或 :c:expr:`Py_ssize_t`" -#: ../../library/ctypes.rst:250 +#: ../../library/ctypes.rst:252 msgid ":class:`c_float`" msgstr ":class:`c_float`" -#: ../../library/ctypes.rst:250 +#: ../../library/ctypes.rst:252 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../library/ctypes.rst:250 ../../library/ctypes.rst:252 -#: ../../library/ctypes.rst:254 +#: ../../library/ctypes.rst:252 ../../library/ctypes.rst:254 +#: ../../library/ctypes.rst:256 msgid "float" msgstr "float" -#: ../../library/ctypes.rst:252 +#: ../../library/ctypes.rst:254 msgid ":class:`c_double`" msgstr ":class:`c_double`" -#: ../../library/ctypes.rst:252 +#: ../../library/ctypes.rst:254 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../library/ctypes.rst:254 +#: ../../library/ctypes.rst:256 msgid ":class:`c_longdouble`" msgstr ":class:`c_longdouble`" -#: ../../library/ctypes.rst:254 +#: ../../library/ctypes.rst:256 msgid ":c:expr:`long double`" msgstr ":c:expr:`long double`" -#: ../../library/ctypes.rst:256 +#: ../../library/ctypes.rst:258 msgid ":class:`c_char_p`" msgstr ":class:`c_char_p`" -#: ../../library/ctypes.rst:256 +#: ../../library/ctypes.rst:258 msgid ":c:expr:`char *` (NUL terminated)" msgstr "" -#: ../../library/ctypes.rst:256 +#: ../../library/ctypes.rst:258 msgid "bytes object or ``None``" msgstr "" -#: ../../library/ctypes.rst:258 +#: ../../library/ctypes.rst:260 msgid ":class:`c_wchar_p`" msgstr ":class:`c_wchar_p`" -#: ../../library/ctypes.rst:258 +#: ../../library/ctypes.rst:260 msgid ":c:expr:`wchar_t *` (NUL terminated)" msgstr "" -#: ../../library/ctypes.rst:258 +#: ../../library/ctypes.rst:260 msgid "string or ``None``" msgstr "字串或 ``None``" -#: ../../library/ctypes.rst:260 +#: ../../library/ctypes.rst:262 msgid ":class:`c_void_p`" msgstr ":class:`c_void_p`" -#: ../../library/ctypes.rst:260 +#: ../../library/ctypes.rst:262 msgid ":c:expr:`void *`" msgstr ":c:expr:`void *`" -#: ../../library/ctypes.rst:260 +#: ../../library/ctypes.rst:262 msgid "int or ``None``" msgstr "" -#: ../../library/ctypes.rst:264 +#: ../../library/ctypes.rst:266 msgid "The constructor accepts any object with a truth value." msgstr "" -#: ../../library/ctypes.rst:266 +#: ../../library/ctypes.rst:268 msgid "" "All these types can be created by calling them with an optional initializer " "of the correct type and value::" msgstr "" -#: ../../library/ctypes.rst:277 +#: ../../library/ctypes.rst:279 msgid "" "Since these types are mutable, their value can also be changed afterwards::" msgstr "" -#: ../../library/ctypes.rst:289 +#: ../../library/ctypes.rst:291 msgid "" "Assigning a new value to instances of the pointer types :class:`c_char_p`, :" "class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " @@ -451,7 +455,7 @@ msgid "" "Python bytes objects are immutable)::" msgstr "" -#: ../../library/ctypes.rst:309 +#: ../../library/ctypes.rst:311 msgid "" "You should be careful, however, not to pass them to functions expecting " "pointers to mutable memory. If you need mutable memory blocks, ctypes has a :" @@ -461,7 +465,7 @@ msgid "" "``value`` property::" msgstr "" -#: ../../library/ctypes.rst:333 +#: ../../library/ctypes.rst:335 msgid "" "The :func:`create_string_buffer` function replaces the old :func:`c_buffer` " "function (which is still available as an alias). To create a mutable memory " @@ -469,29 +473,29 @@ msgid "" "the :func:`create_unicode_buffer` function." msgstr "" -#: ../../library/ctypes.rst:342 +#: ../../library/ctypes.rst:344 msgid "Calling functions, continued" msgstr "" -#: ../../library/ctypes.rst:344 +#: ../../library/ctypes.rst:346 msgid "" "Note that printf prints to the real standard output channel, *not* to :data:" "`sys.stdout`, so these examples will only work at the console prompt, not " "from within *IDLE* or *PythonWin*::" msgstr "" -#: ../../library/ctypes.rst:364 +#: ../../library/ctypes.rst:366 msgid "" "As has been mentioned before, all Python types except integers, strings, and " "bytes objects have to be wrapped in their corresponding :mod:`ctypes` type, " "so that they can be converted to the required C data type::" msgstr "" -#: ../../library/ctypes.rst:376 +#: ../../library/ctypes.rst:378 msgid "Calling varadic functions" msgstr "" -#: ../../library/ctypes.rst:378 +#: ../../library/ctypes.rst:380 msgid "" "On a lot of platforms calling variadic functions through ctypes is exactly " "the same as calling functions with a fixed number of parameters. On some " @@ -500,23 +504,23 @@ msgid "" "functions." msgstr "" -#: ../../library/ctypes.rst:383 +#: ../../library/ctypes.rst:385 msgid "" "On those platforms it is required to specify the *argtypes* attribute for " "the regular, non-variadic, function arguments:" msgstr "" -#: ../../library/ctypes.rst:390 +#: ../../library/ctypes.rst:392 msgid "" "Because specifying the attribute does inhibit portability it is adviced to " "always specify ``argtypes`` for all variadic functions." msgstr "" -#: ../../library/ctypes.rst:397 +#: ../../library/ctypes.rst:399 msgid "Calling functions with your own custom data types" msgstr "" -#: ../../library/ctypes.rst:399 +#: ../../library/ctypes.rst:401 msgid "" "You can also customize :mod:`ctypes` argument conversion to allow instances " "of your own classes be used as function arguments. :mod:`ctypes` looks for " @@ -524,24 +528,24 @@ msgid "" "Of course, it must be one of integer, string, or bytes::" msgstr "" -#: ../../library/ctypes.rst:414 +#: ../../library/ctypes.rst:416 msgid "" "If you don't want to store the instance's data in the :attr:`_as_parameter_` " "instance variable, you could define a :class:`property` which makes the " "attribute available on request." msgstr "" -#: ../../library/ctypes.rst:422 +#: ../../library/ctypes.rst:424 msgid "Specifying the required argument types (function prototypes)" msgstr "" -#: ../../library/ctypes.rst:424 +#: ../../library/ctypes.rst:426 msgid "" "It is possible to specify the required argument types of functions exported " "from DLLs by setting the :attr:`argtypes` attribute." msgstr "" -#: ../../library/ctypes.rst:427 +#: ../../library/ctypes.rst:429 msgid "" ":attr:`argtypes` must be a sequence of C data types (the ``printf`` function " "is probably not a good example here, because it takes a variable number and " @@ -549,14 +553,14 @@ msgid "" "hand this is quite handy to experiment with this feature)::" msgstr "" -#: ../../library/ctypes.rst:438 +#: ../../library/ctypes.rst:440 msgid "" "Specifying a format protects against incompatible argument types (just as a " "prototype for a C function), and tries to convert the arguments to valid " "types::" msgstr "" -#: ../../library/ctypes.rst:450 +#: ../../library/ctypes.rst:452 msgid "" "If you have defined your own classes which you pass to function calls, you " "have to implement a :meth:`from_param` class method for them to be able to " @@ -569,31 +573,31 @@ msgid "" "an object with an :attr:`_as_parameter_` attribute." msgstr "" -#: ../../library/ctypes.rst:464 +#: ../../library/ctypes.rst:466 msgid "Return types" msgstr "" -#: ../../library/ctypes.rst:466 +#: ../../library/ctypes.rst:468 msgid "" "By default functions are assumed to return the C :c:expr:`int` type. Other " "return types can be specified by setting the :attr:`restype` attribute of " "the function object." msgstr "" -#: ../../library/ctypes.rst:470 +#: ../../library/ctypes.rst:472 msgid "" "Here is a more advanced example, it uses the ``strchr`` function, which " "expects a string pointer and a char, and returns a pointer to a string::" msgstr "" -#: ../../library/ctypes.rst:483 +#: ../../library/ctypes.rst:485 msgid "" "If you want to avoid the ``ord(\"x\")`` calls above, you can set the :attr:" "`argtypes` attribute, and the second argument will be converted from a " "single character Python bytes object into a C char::" msgstr "" -#: ../../library/ctypes.rst:501 +#: ../../library/ctypes.rst:503 msgid "" "You can also use a callable Python object (a function or a class for " "example) as the :attr:`restype` attribute, if the foreign function returns " @@ -603,7 +607,7 @@ msgid "" "automatically raise an exception::" msgstr "" -#: ../../library/ctypes.rst:524 +#: ../../library/ctypes.rst:526 msgid "" "``WinError`` is a function which will call Windows ``FormatMessage()`` api " "to get the string representation of an error code, and *returns* an " @@ -611,17 +615,17 @@ msgid "" "used, it calls :func:`GetLastError` to retrieve it." msgstr "" -#: ../../library/ctypes.rst:529 +#: ../../library/ctypes.rst:531 msgid "" "Please note that a much more powerful error checking mechanism is available " "through the :attr:`errcheck` attribute; see the reference manual for details." msgstr "" -#: ../../library/ctypes.rst:536 +#: ../../library/ctypes.rst:538 msgid "Passing pointers (or: passing parameters by reference)" msgstr "" -#: ../../library/ctypes.rst:538 +#: ../../library/ctypes.rst:540 msgid "" "Sometimes a C api function expects a *pointer* to a data type as parameter, " "probably to write into the corresponding location, or if the data is too " @@ -629,7 +633,7 @@ msgid "" "reference*." msgstr "" -#: ../../library/ctypes.rst:542 +#: ../../library/ctypes.rst:544 msgid "" ":mod:`ctypes` exports the :func:`byref` function which is used to pass " "parameters by reference. The same effect can be achieved with the :func:" @@ -638,11 +642,11 @@ msgid "" "you don't need the pointer object in Python itself::" msgstr "" -#: ../../library/ctypes.rst:564 +#: ../../library/ctypes.rst:566 msgid "Structures and unions" msgstr "" -#: ../../library/ctypes.rst:566 +#: ../../library/ctypes.rst:568 msgid "" "Structures and unions must derive from the :class:`Structure` and :class:" "`Union` base classes which are defined in the :mod:`ctypes` module. Each " @@ -650,44 +654,44 @@ msgid "" "a list of *2-tuples*, containing a *field name* and a *field type*." msgstr "" -#: ../../library/ctypes.rst:571 +#: ../../library/ctypes.rst:573 msgid "" "The field type must be a :mod:`ctypes` type like :class:`c_int`, or any " "other derived :mod:`ctypes` type: structure, union, array, pointer." msgstr "" -#: ../../library/ctypes.rst:574 +#: ../../library/ctypes.rst:576 msgid "" "Here is a simple example of a POINT structure, which contains two integers " "named *x* and *y*, and also shows how to initialize a structure in the " "constructor::" msgstr "" -#: ../../library/ctypes.rst:594 +#: ../../library/ctypes.rst:596 msgid "" "You can, however, build much more complicated structures. A structure can " "itself contain other structures by using a structure as a field type." msgstr "" -#: ../../library/ctypes.rst:597 +#: ../../library/ctypes.rst:599 msgid "" "Here is a RECT structure which contains two POINTs named *upperleft* and " "*lowerright*::" msgstr "" -#: ../../library/ctypes.rst:611 +#: ../../library/ctypes.rst:613 msgid "" "Nested structures can also be initialized in the constructor in several " "ways::" msgstr "" -#: ../../library/ctypes.rst:616 +#: ../../library/ctypes.rst:618 msgid "" "Field :term:`descriptor`\\s can be retrieved from the *class*, they are " "useful for debugging because they can provide useful information::" msgstr "" -#: ../../library/ctypes.rst:630 +#: ../../library/ctypes.rst:632 msgid "" ":mod:`ctypes` does not support passing unions or structures with bit-fields " "to functions by value. While this may work on 32-bit x86, it's not " @@ -695,11 +699,11 @@ msgid "" "structures with bit-fields should always be passed to functions by pointer." msgstr "" -#: ../../library/ctypes.rst:636 +#: ../../library/ctypes.rst:638 msgid "Structure/union alignment and byte order" msgstr "" -#: ../../library/ctypes.rst:638 +#: ../../library/ctypes.rst:640 msgid "" "By default, Structure and Union fields are aligned in the same way the C " "compiler does it. It is possible to override this behavior by specifying a :" @@ -708,7 +712,7 @@ msgid "" "This is what ``#pragma pack(n)`` also does in MSVC." msgstr "" -#: ../../library/ctypes.rst:644 +#: ../../library/ctypes.rst:646 msgid "" ":mod:`ctypes` uses the native byte order for Structures and Unions. To " "build structures with non-native byte order, you can use one of the :class:" @@ -717,91 +721,91 @@ msgid "" "classes cannot contain pointer fields." msgstr "" -#: ../../library/ctypes.rst:654 +#: ../../library/ctypes.rst:656 msgid "Bit fields in structures and unions" msgstr "" -#: ../../library/ctypes.rst:656 +#: ../../library/ctypes.rst:658 msgid "" "It is possible to create structures and unions containing bit fields. Bit " "fields are only possible for integer fields, the bit width is specified as " "the third item in the :attr:`_fields_` tuples::" msgstr "" -#: ../../library/ctypes.rst:674 +#: ../../library/ctypes.rst:676 msgid "Arrays" msgstr "" -#: ../../library/ctypes.rst:676 +#: ../../library/ctypes.rst:678 msgid "" "Arrays are sequences, containing a fixed number of instances of the same " "type." msgstr "" -#: ../../library/ctypes.rst:678 +#: ../../library/ctypes.rst:680 msgid "" "The recommended way to create array types is by multiplying a data type with " "a positive integer::" msgstr "" -#: ../../library/ctypes.rst:683 +#: ../../library/ctypes.rst:685 msgid "" "Here is an example of a somewhat artificial data type, a structure " "containing 4 POINTs among other stuff::" msgstr "" -#: ../../library/ctypes.rst:699 +#: ../../library/ctypes.rst:701 msgid "Instances are created in the usual way, by calling the class::" msgstr "" -#: ../../library/ctypes.rst:705 +#: ../../library/ctypes.rst:707 msgid "" "The above code print a series of ``0 0`` lines, because the array contents " "is initialized to zeros." msgstr "" -#: ../../library/ctypes.rst:708 +#: ../../library/ctypes.rst:710 msgid "Initializers of the correct type can also be specified::" msgstr "" -#: ../../library/ctypes.rst:724 +#: ../../library/ctypes.rst:726 msgid "Pointers" msgstr "" -#: ../../library/ctypes.rst:726 +#: ../../library/ctypes.rst:728 msgid "" "Pointer instances are created by calling the :func:`pointer` function on a :" "mod:`ctypes` type::" msgstr "" -#: ../../library/ctypes.rst:734 +#: ../../library/ctypes.rst:736 msgid "" "Pointer instances have a :attr:`~_Pointer.contents` attribute which returns " "the object to which the pointer points, the ``i`` object above::" msgstr "" -#: ../../library/ctypes.rst:741 +#: ../../library/ctypes.rst:743 msgid "" "Note that :mod:`ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" msgstr "" -#: ../../library/ctypes.rst:750 +#: ../../library/ctypes.rst:752 msgid "" "Assigning another :class:`c_int` instance to the pointer's contents " "attribute would cause the pointer to point to the memory location where this " "is stored::" msgstr "" -#: ../../library/ctypes.rst:762 +#: ../../library/ctypes.rst:764 msgid "Pointer instances can also be indexed with integers::" msgstr "" -#: ../../library/ctypes.rst:768 +#: ../../library/ctypes.rst:770 msgid "Assigning to an integer index changes the pointed to value::" msgstr "" -#: ../../library/ctypes.rst:777 +#: ../../library/ctypes.rst:779 msgid "" "It is also possible to use indexes different from 0, but you must know what " "you're doing, just as in C: You can access or change arbitrary memory " @@ -810,7 +814,7 @@ msgid "" "instead of a single item." msgstr "" -#: ../../library/ctypes.rst:783 +#: ../../library/ctypes.rst:785 msgid "" "Behind the scenes, the :func:`pointer` function does more than simply create " "pointer instances, it has to create pointer *types* first. This is done with " @@ -818,23 +822,23 @@ msgid "" "returns a new type::" msgstr "" -#: ../../library/ctypes.rst:799 +#: ../../library/ctypes.rst:801 msgid "" "Calling the pointer type without an argument creates a ``NULL`` pointer. " "``NULL`` pointers have a ``False`` boolean value::" msgstr "" -#: ../../library/ctypes.rst:807 +#: ../../library/ctypes.rst:809 msgid "" ":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" msgstr "" -#: ../../library/ctypes.rst:826 +#: ../../library/ctypes.rst:828 msgid "Type conversions" msgstr "" -#: ../../library/ctypes.rst:828 +#: ../../library/ctypes.rst:830 msgid "" "Usually, ctypes does strict type checking. This means, if you have " "``POINTER(c_int)`` in the :attr:`argtypes` list of a function or as the type " @@ -845,7 +849,7 @@ msgid "" "accepts an array of c_int::" msgstr "" -#: ../../library/ctypes.rst:849 +#: ../../library/ctypes.rst:851 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " "type (such as ``POINTER(c_int)``) in :attr:`argtypes`, an object of the " @@ -853,11 +857,11 @@ msgid "" "will apply the required :func:`byref` conversion in this case automatically." msgstr "" -#: ../../library/ctypes.rst:854 +#: ../../library/ctypes.rst:856 msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" msgstr "" -#: ../../library/ctypes.rst:861 +#: ../../library/ctypes.rst:863 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " "type into another type. :mod:`ctypes` provides a :func:`cast` function " @@ -866,11 +870,11 @@ msgid "" "``values`` field, but not instances of other types::" msgstr "" -#: ../../library/ctypes.rst:873 +#: ../../library/ctypes.rst:875 msgid "For these cases, the :func:`cast` function is handy." msgstr "" -#: ../../library/ctypes.rst:875 +#: ../../library/ctypes.rst:877 msgid "" "The :func:`cast` function can be used to cast a ctypes instance into a " "pointer to a different ctypes data type. :func:`cast` takes two parameters, " @@ -879,60 +883,60 @@ msgid "" "references the same memory block as the first argument::" msgstr "" -#: ../../library/ctypes.rst:886 +#: ../../library/ctypes.rst:888 msgid "" "So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` " "the structure::" msgstr "" -#: ../../library/ctypes.rst:899 +#: ../../library/ctypes.rst:901 msgid "Incomplete Types" msgstr "" -#: ../../library/ctypes.rst:901 +#: ../../library/ctypes.rst:903 msgid "" "*Incomplete Types* are structures, unions or arrays whose members are not " "yet specified. In C, they are specified by forward declarations, which are " "defined later::" msgstr "" -#: ../../library/ctypes.rst:912 +#: ../../library/ctypes.rst:914 msgid "" "The straightforward translation into ctypes code would be this, but it does " "not work::" msgstr "" -#: ../../library/ctypes.rst:925 +#: ../../library/ctypes.rst:927 msgid "" "because the new ``class cell`` is not available in the class statement " "itself. In :mod:`ctypes`, we can define the ``cell`` class and set the :attr:" "`_fields_` attribute later, after the class statement::" msgstr "" -#: ../../library/ctypes.rst:937 +#: ../../library/ctypes.rst:939 msgid "" "Let's try it. We create two instances of ``cell``, and let them point to " "each other, and finally follow the pointer chain a few times::" msgstr "" -#: ../../library/ctypes.rst:958 +#: ../../library/ctypes.rst:960 msgid "Callback functions" msgstr "" -#: ../../library/ctypes.rst:960 +#: ../../library/ctypes.rst:962 msgid "" ":mod:`ctypes` allows creating C callable function pointers from Python " "callables. These are sometimes called *callback functions*." msgstr "" -#: ../../library/ctypes.rst:963 +#: ../../library/ctypes.rst:965 msgid "" "First, you must create a class for the callback function. The class knows " "the calling convention, the return type, and the number and types of " "arguments this function will receive." msgstr "" -#: ../../library/ctypes.rst:967 +#: ../../library/ctypes.rst:969 msgid "" "The :func:`CFUNCTYPE` factory function creates types for callback functions " "using the ``cdecl`` calling convention. On Windows, the :func:`WINFUNCTYPE` " @@ -940,21 +944,21 @@ msgid "" "calling convention." msgstr "" -#: ../../library/ctypes.rst:972 +#: ../../library/ctypes.rst:974 msgid "" "Both of these factory functions are called with the result type as first " "argument, and the callback functions expected argument types as the " "remaining arguments." msgstr "" -#: ../../library/ctypes.rst:976 +#: ../../library/ctypes.rst:978 msgid "" "I will present an example here which uses the standard C library's :c:func:" "`qsort` function, that is used to sort items with the help of a callback " "function. :c:func:`qsort` will be used to sort an array of integers::" msgstr "" -#: ../../library/ctypes.rst:986 +#: ../../library/ctypes.rst:988 msgid "" ":func:`qsort` must be called with a pointer to the data to sort, the number " "of items in the data array, the size of one item, and a pointer to the " @@ -964,44 +968,44 @@ msgid "" "otherwise." msgstr "" -#: ../../library/ctypes.rst:992 +#: ../../library/ctypes.rst:994 msgid "" "So our callback function receives pointers to integers, and must return an " "integer. First we create the ``type`` for the callback function::" msgstr "" -#: ../../library/ctypes.rst:998 +#: ../../library/ctypes.rst:1000 msgid "" "To get started, here is a simple callback that shows the values it gets " "passed::" msgstr "" -#: ../../library/ctypes.rst:1008 +#: ../../library/ctypes.rst:1010 msgid "The result::" msgstr "" -#: ../../library/ctypes.rst:1018 +#: ../../library/ctypes.rst:1020 msgid "Now we can actually compare the two items and return a useful result::" msgstr "" -#: ../../library/ctypes.rst:1033 +#: ../../library/ctypes.rst:1035 msgid "As we can easily check, our array is sorted now::" msgstr "" -#: ../../library/ctypes.rst:1040 +#: ../../library/ctypes.rst:1042 msgid "" "The function factories can be used as decorator factories, so we may as well " "write::" msgstr "" -#: ../../library/ctypes.rst:1058 +#: ../../library/ctypes.rst:1060 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " "are used from C code. :mod:`ctypes` doesn't, and if you don't, they may be " "garbage collected, crashing your program when a callback is made." msgstr "" -#: ../../library/ctypes.rst:1062 +#: ../../library/ctypes.rst:1064 msgid "" "Also, note that if the callback function is called in a thread created " "outside of Python's control (e.g. by the foreign code that calls the " @@ -1011,11 +1015,11 @@ msgid "" "even when those calls are made from the same C thread." msgstr "" -#: ../../library/ctypes.rst:1072 +#: ../../library/ctypes.rst:1074 msgid "Accessing values exported from dlls" msgstr "" -#: ../../library/ctypes.rst:1074 +#: ../../library/ctypes.rst:1076 msgid "" "Some shared libraries not only export functions, they also export variables. " "An example in the Python library itself is the :c:data:`Py_OptimizeFlag`, an " @@ -1023,31 +1027,31 @@ msgid "" "flag given on startup." msgstr "" -#: ../../library/ctypes.rst:1079 +#: ../../library/ctypes.rst:1081 msgid "" ":mod:`ctypes` can access values like this with the :meth:`in_dll` class " "methods of the type. *pythonapi* is a predefined symbol giving access to " "the Python C api::" msgstr "" -#: ../../library/ctypes.rst:1088 +#: ../../library/ctypes.rst:1090 msgid "" "If the interpreter would have been started with :option:`-O`, the sample " "would have printed ``c_long(1)``, or ``c_long(2)`` if :option:`-OO` would " "have been specified." msgstr "" -#: ../../library/ctypes.rst:1092 +#: ../../library/ctypes.rst:1094 msgid "" "An extended example which also demonstrates the use of pointers accesses " "the :c:data:`PyImport_FrozenModules` pointer exported by Python." msgstr "" -#: ../../library/ctypes.rst:1095 +#: ../../library/ctypes.rst:1097 msgid "Quoting the docs for that value:" msgstr "" -#: ../../library/ctypes.rst:1097 +#: ../../library/ctypes.rst:1099 msgid "" "This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " @@ -1056,19 +1060,19 @@ msgid "" "frozen modules." msgstr "" -#: ../../library/ctypes.rst:1102 +#: ../../library/ctypes.rst:1104 msgid "" "So manipulating this pointer could even prove useful. To restrict the " "example size, we show only how this table can be read with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1116 +#: ../../library/ctypes.rst:1118 msgid "" "We have defined the :c:struct:`_frozen` data type, so we can get the pointer " "to the table::" msgstr "" -#: ../../library/ctypes.rst:1123 +#: ../../library/ctypes.rst:1125 msgid "" "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " "we can iterate over it, but we just have to make sure that our loop " @@ -1077,34 +1081,34 @@ msgid "" "the loop when we hit the ``NULL`` entry::" msgstr "" -#: ../../library/ctypes.rst:1139 +#: ../../library/ctypes.rst:1141 msgid "" "The fact that standard Python has a frozen module and a frozen package " "(indicated by the negative ``size`` member) is not well known, it is only " "used for testing. Try it out with ``import __hello__`` for example." msgstr "" -#: ../../library/ctypes.rst:1147 +#: ../../library/ctypes.rst:1149 msgid "Surprises" msgstr "" -#: ../../library/ctypes.rst:1149 +#: ../../library/ctypes.rst:1151 msgid "" "There are some edges in :mod:`ctypes` where you might expect something other " "than what actually happens." msgstr "" -#: ../../library/ctypes.rst:1152 +#: ../../library/ctypes.rst:1154 msgid "Consider the following example::" msgstr "" -#: ../../library/ctypes.rst:1172 +#: ../../library/ctypes.rst:1174 msgid "" "Hm. We certainly expected the last statement to print ``3 4 1 2``. What " "happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" msgstr "" -#: ../../library/ctypes.rst:1180 +#: ../../library/ctypes.rst:1182 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " "buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " @@ -1113,26 +1117,26 @@ msgid "" "have the expected effect." msgstr "" -#: ../../library/ctypes.rst:1186 +#: ../../library/ctypes.rst:1188 msgid "" "Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays " "doesn't *copy* the sub-object, instead it retrieves a wrapper object " "accessing the root-object's underlying buffer." msgstr "" -#: ../../library/ctypes.rst:1190 +#: ../../library/ctypes.rst:1192 msgid "" "Another example that may behave differently from what one would expect is " "this::" msgstr "" -#: ../../library/ctypes.rst:1202 +#: ../../library/ctypes.rst:1204 msgid "" "Objects instantiated from :class:`c_char_p` can only have their value set to " "bytes or integers." msgstr "" -#: ../../library/ctypes.rst:1205 +#: ../../library/ctypes.rst:1207 msgid "" "Why is it printing ``False``? ctypes instances are objects containing a " "memory block plus some :term:`descriptor`\\s accessing the contents of the " @@ -1141,16 +1145,16 @@ msgid "" "the contents again constructs a new Python object each time!" msgstr "" -#: ../../library/ctypes.rst:1215 +#: ../../library/ctypes.rst:1217 msgid "Variable-sized data types" msgstr "" -#: ../../library/ctypes.rst:1217 +#: ../../library/ctypes.rst:1219 msgid "" ":mod:`ctypes` provides some support for variable-sized arrays and structures." msgstr "" -#: ../../library/ctypes.rst:1219 +#: ../../library/ctypes.rst:1221 msgid "" "The :func:`resize` function can be used to resize the memory buffer of an " "existing ctypes object. The function takes the object as first argument, " @@ -1159,35 +1163,35 @@ msgid "" "objects type, a :exc:`ValueError` is raised if this is tried::" msgstr "" -#: ../../library/ctypes.rst:1239 +#: ../../library/ctypes.rst:1241 msgid "" "This is nice and fine, but how would one access the additional elements " "contained in this array? Since the type still only knows about 4 elements, " "we get errors accessing other elements::" msgstr "" -#: ../../library/ctypes.rst:1251 +#: ../../library/ctypes.rst:1253 msgid "" "Another way to use variable-sized data types with :mod:`ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " "required size is already known, on a case by case basis." msgstr "" -#: ../../library/ctypes.rst:1259 +#: ../../library/ctypes.rst:1261 msgid "ctypes reference" msgstr "" -#: ../../library/ctypes.rst:1265 +#: ../../library/ctypes.rst:1267 msgid "Finding shared libraries" msgstr "" -#: ../../library/ctypes.rst:1267 +#: ../../library/ctypes.rst:1269 msgid "" "When programming in a compiled language, shared libraries are accessed when " "compiling/linking a program, and when the program is run." msgstr "" -#: ../../library/ctypes.rst:1270 +#: ../../library/ctypes.rst:1272 msgid "" "The purpose of the :func:`find_library` function is to locate a library in a " "way similar to what the compiler or runtime loader does (on platforms with " @@ -1196,13 +1200,13 @@ msgid "" "the runtime loader directly." msgstr "" -#: ../../library/ctypes.rst:1276 +#: ../../library/ctypes.rst:1278 msgid "" "The :mod:`ctypes.util` module provides a function which can help to " "determine the library to load." msgstr "" -#: ../../library/ctypes.rst:1284 +#: ../../library/ctypes.rst:1286 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version " @@ -1210,45 +1214,45 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1289 ../../library/ctypes.rst:1932 +#: ../../library/ctypes.rst:1291 ../../library/ctypes.rst:1934 msgid "The exact functionality is system dependent." msgstr "" -#: ../../library/ctypes.rst:1291 +#: ../../library/ctypes.rst:1293 msgid "" "On Linux, :func:`find_library` tries to run external programs (``/sbin/" "ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library file. It " "returns the filename of the library file." msgstr "" -#: ../../library/ctypes.rst:1295 +#: ../../library/ctypes.rst:1297 msgid "" "On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used " "when searching for libraries, if a library cannot be found by any other " "means." msgstr "" -#: ../../library/ctypes.rst:1299 +#: ../../library/ctypes.rst:1301 msgid "Here are some examples::" msgstr "" "以下是一些範例:\n" "\n" "::" -#: ../../library/ctypes.rst:1310 +#: ../../library/ctypes.rst:1312 msgid "" "On macOS, :func:`find_library` tries several predefined naming schemes and " "paths to locate the library, and returns a full pathname if successful::" msgstr "" -#: ../../library/ctypes.rst:1324 +#: ../../library/ctypes.rst:1326 msgid "" "On Windows, :func:`find_library` searches along the system search path, and " "returns the full pathname, but since there is no predefined naming scheme a " "call like ``find_library(\"c\")`` will fail and return ``None``." msgstr "" -#: ../../library/ctypes.rst:1328 +#: ../../library/ctypes.rst:1330 msgid "" "If wrapping a shared library with :mod:`ctypes`, it *may* be better to " "determine the shared library name at development time, and hardcode that " @@ -1256,24 +1260,24 @@ msgid "" "library at runtime." msgstr "" -#: ../../library/ctypes.rst:1336 +#: ../../library/ctypes.rst:1338 msgid "Loading shared libraries" msgstr "" -#: ../../library/ctypes.rst:1338 +#: ../../library/ctypes.rst:1340 msgid "" "There are several ways to load shared libraries into the Python process. " "One way is to instantiate one of the following classes:" msgstr "" -#: ../../library/ctypes.rst:1344 +#: ../../library/ctypes.rst:1346 msgid "" "Instances of this class represent loaded shared libraries. Functions in " "these libraries use the standard C calling convention, and are assumed to " "return :c:expr:`int`." msgstr "" -#: ../../library/ctypes.rst:1348 +#: ../../library/ctypes.rst:1350 msgid "" "On Windows creating a :class:`CDLL` instance may fail even if the DLL name " "exists. When a dependent DLL of the loaded DLL is not found, a :exc:" @@ -1285,13 +1289,13 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1360 +#: ../../library/ctypes.rst:1362 msgid "" "`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." msgstr "" -#: ../../library/ctypes.rst:1366 +#: ../../library/ctypes.rst:1368 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " @@ -1301,24 +1305,24 @@ msgid "" "value signals a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1373 +#: ../../library/ctypes.rst:1375 msgid ":exc:`WindowsError` used to be raised." msgstr "" -#: ../../library/ctypes.rst:1379 +#: ../../library/ctypes.rst:1381 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " "assumed to return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1383 +#: ../../library/ctypes.rst:1385 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1389 +#: ../../library/ctypes.rst:1391 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -1326,11 +1330,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1394 +#: ../../library/ctypes.rst:1396 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1396 +#: ../../library/ctypes.rst:1398 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " @@ -1340,7 +1344,7 @@ msgid "" "to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1403 +#: ../../library/ctypes.rst:1405 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -1348,7 +1352,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1408 +#: ../../library/ctypes.rst:1410 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:" @@ -1358,14 +1362,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1415 +#: ../../library/ctypes.rst:1417 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " "private copy to a new value and returns the former value." msgstr "" -#: ../../library/ctypes.rst:1419 +#: ../../library/ctypes.rst:1421 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" @@ -1374,7 +1378,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1425 +#: ../../library/ctypes.rst:1427 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -1384,29 +1388,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1432 +#: ../../library/ctypes.rst:1434 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1439 +#: ../../library/ctypes.rst:1441 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." msgstr "" -#: ../../library/ctypes.rst:1446 +#: ../../library/ctypes.rst:1448 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." msgstr "" -#: ../../library/ctypes.rst:1453 +#: ../../library/ctypes.rst:1455 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." msgstr "" -#: ../../library/ctypes.rst:1456 +#: ../../library/ctypes.rst:1458 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -1415,21 +1419,21 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1469 +#: ../../library/ctypes.rst:1471 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1475 +#: ../../library/ctypes.rst:1477 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1480 +#: ../../library/ctypes.rst:1482 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1482 +#: ../../library/ctypes.rst:1484 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -1437,52 +1441,52 @@ msgid "" "attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1490 +#: ../../library/ctypes.rst:1492 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: ../../library/ctypes.rst:1493 +#: ../../library/ctypes.rst:1495 msgid "" ":meth:`__getattr__` has special behavior: It allows loading a shared library " "by accessing it as attribute of a library loader instance. The result is " "cached, so repeated attribute accesses return the same library each time." msgstr "" -#: ../../library/ctypes.rst:1499 +#: ../../library/ctypes.rst:1501 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." msgstr "" -#: ../../library/ctypes.rst:1503 +#: ../../library/ctypes.rst:1505 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1508 +#: ../../library/ctypes.rst:1510 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1514 +#: ../../library/ctypes.rst:1516 msgid "Windows only: Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1520 +#: ../../library/ctypes.rst:1522 msgid "Windows only: Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1526 +#: ../../library/ctypes.rst:1528 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1529 +#: ../../library/ctypes.rst:1531 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1535 +#: ../../library/ctypes.rst:1537 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:expr:" @@ -1490,50 +1494,50 @@ msgid "" "correct :attr:`restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1540 +#: ../../library/ctypes.rst:1542 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " "``name``." msgstr "" -#: ../../library/ctypes.rst:1542 +#: ../../library/ctypes.rst:1544 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: ../../library/ctypes.rst:1546 +#: ../../library/ctypes.rst:1548 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " "``library``, ``name``." msgstr "" -#: ../../library/ctypes.rst:1548 +#: ../../library/ctypes.rst:1550 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1552 +#: ../../library/ctypes.rst:1554 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " "arguments ``handle``, ``name``." msgstr "" -#: ../../library/ctypes.rst:1554 +#: ../../library/ctypes.rst:1556 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: ../../library/ctypes.rst:1561 +#: ../../library/ctypes.rst:1563 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1563 +#: ../../library/ctypes.rst:1565 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -1542,29 +1546,29 @@ msgid "" "library loader. They are instances of a private class:" msgstr "" -#: ../../library/ctypes.rst:1572 +#: ../../library/ctypes.rst:1574 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1574 +#: ../../library/ctypes.rst:1576 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1577 +#: ../../library/ctypes.rst:1579 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1582 +#: ../../library/ctypes.rst:1584 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1585 +#: ../../library/ctypes.rst:1587 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " @@ -1574,7 +1578,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1594 +#: ../../library/ctypes.rst:1596 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -1583,7 +1587,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1600 +#: ../../library/ctypes.rst:1602 msgid "" "When a foreign function is called, each actual argument is passed to the :" "meth:`from_param` class method of the items in the :attr:`argtypes` tuple, " @@ -1593,7 +1597,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1607 +#: ../../library/ctypes.rst:1609 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`from_param` method which returns a value " @@ -1601,50 +1605,50 @@ msgid "" "adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1614 +#: ../../library/ctypes.rst:1616 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: ../../library/ctypes.rst:1621 +#: ../../library/ctypes.rst:1623 msgid "" "*result* is what the foreign function returns, as specified by the :attr:" "`restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1624 +#: ../../library/ctypes.rst:1626 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: ../../library/ctypes.rst:1628 +#: ../../library/ctypes.rst:1630 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: ../../library/ctypes.rst:1632 +#: ../../library/ctypes.rst:1634 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: ../../library/ctypes.rst:1639 +#: ../../library/ctypes.rst:1641 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1643 +#: ../../library/ctypes.rst:1645 msgid "" "Raises an :ref:`auditing event ` ``ctypes.seh_exception`` with " "argument ``code``." msgstr "" -#: ../../library/ctypes.rst:1645 +#: ../../library/ctypes.rst:1647 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -1653,24 +1657,24 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1651 +#: ../../library/ctypes.rst:1653 msgid "" "Raises an :ref:`auditing event ` ``ctypes.call_function`` with " "arguments ``func_pointer``, ``arguments``." msgstr "" -#: ../../library/ctypes.rst:1653 +#: ../../library/ctypes.rst:1655 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " "``arguments``." msgstr "" -#: ../../library/ctypes.rst:1659 +#: ../../library/ctypes.rst:1661 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1661 +#: ../../library/ctypes.rst:1663 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -1681,7 +1685,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1672 +#: ../../library/ctypes.rst:1674 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -1690,37 +1694,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1682 +#: ../../library/ctypes.rst:1684 msgid "" "Windows only: The returned function prototype creates functions that use the " "``stdcall`` calling convention. The function will release the GIL during " "the call. *use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: ../../library/ctypes.rst:1690 +#: ../../library/ctypes.rst:1692 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: ../../library/ctypes.rst:1693 +#: ../../library/ctypes.rst:1695 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " "call:" msgstr "" -#: ../../library/ctypes.rst:1701 +#: ../../library/ctypes.rst:1703 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1708 +#: ../../library/ctypes.rst:1710 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1715 +#: ../../library/ctypes.rst:1717 msgid "" "Returns a foreign function exported by a shared library. *func_spec* must be " "a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " @@ -1728,7 +1732,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1725 +#: ../../library/ctypes.rst:1727 msgid "" "Returns a foreign function that will call a COM method. *vtbl_index* is the " "index into the virtual function table, a small non-negative integer. *name* " @@ -1736,85 +1740,85 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1730 +#: ../../library/ctypes.rst:1732 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " "specified in the :attr:`argtypes` tuple." msgstr "" -#: ../../library/ctypes.rst:1734 +#: ../../library/ctypes.rst:1736 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1737 +#: ../../library/ctypes.rst:1739 msgid "*paramflags* must be a tuple of the same length as :attr:`argtypes`." msgstr "" -#: ../../library/ctypes.rst:1739 +#: ../../library/ctypes.rst:1741 msgid "" "Each item in this tuple contains further information about a parameter, it " "must be a tuple containing one, two, or three items." msgstr "" -#: ../../library/ctypes.rst:1742 +#: ../../library/ctypes.rst:1744 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1746 +#: ../../library/ctypes.rst:1748 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1746 +#: ../../library/ctypes.rst:1748 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1749 +#: ../../library/ctypes.rst:1751 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1749 +#: ../../library/ctypes.rst:1751 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1752 +#: ../../library/ctypes.rst:1754 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1752 +#: ../../library/ctypes.rst:1754 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1754 +#: ../../library/ctypes.rst:1756 msgid "" "The optional second item is the parameter name as string. If this is " "specified, the foreign function can be called with named parameters." msgstr "" -#: ../../library/ctypes.rst:1757 +#: ../../library/ctypes.rst:1759 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1759 +#: ../../library/ctypes.rst:1761 msgid "" "This example demonstrates how to wrap the Windows ``MessageBoxW`` function " "so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: ../../library/ctypes.rst:1770 ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1772 ../../library/ctypes.rst:1795 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1778 +#: ../../library/ctypes.rst:1780 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1784 +#: ../../library/ctypes.rst:1786 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -1822,7 +1826,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1802 +#: ../../library/ctypes.rst:1804 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -1830,7 +1834,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1807 +#: ../../library/ctypes.rst:1809 msgid "" "Output parameters can be combined with the :attr:`errcheck` protocol to do " "further output processing and error checking. The win32 ``GetWindowRect`` " @@ -1839,7 +1843,7 @@ msgid "" "call failed::" msgstr "" -#: ../../library/ctypes.rst:1820 +#: ../../library/ctypes.rst:1822 msgid "" "If the :attr:`errcheck` function returns the argument tuple it receives " "unchanged, :mod:`ctypes` continues the normal processing it does on the " @@ -1848,11 +1852,11 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1839 +#: ../../library/ctypes.rst:1841 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1843 +#: ../../library/ctypes.rst:1845 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." @@ -1864,30 +1868,30 @@ msgid "" "argument ``obj``." msgstr "" -#: ../../library/ctypes.rst:1851 +#: ../../library/ctypes.rst:1853 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1857 +#: ../../library/ctypes.rst:1859 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: ../../library/ctypes.rst:1861 +#: ../../library/ctypes.rst:1863 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1865 +#: ../../library/ctypes.rst:1867 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: ../../library/ctypes.rst:1871 +#: ../../library/ctypes.rst:1873 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -1895,19 +1899,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1879 +#: ../../library/ctypes.rst:1881 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1882 +#: ../../library/ctypes.rst:1884 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a bytes object which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1885 +#: ../../library/ctypes.rst:1887 msgid "" "If a bytes object is specified as first argument, the buffer is made one " "item larger than its length so that the last element in the array is a NUL " @@ -1922,19 +1926,19 @@ msgid "" "with arguments ``init``, ``size``." msgstr "" -#: ../../library/ctypes.rst:1895 +#: ../../library/ctypes.rst:1897 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1898 +#: ../../library/ctypes.rst:1900 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a string which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1901 +#: ../../library/ctypes.rst:1903 msgid "" "If a string is specified as first argument, the buffer is made one item " "larger than the length of the string so that the last element in the array " @@ -1949,21 +1953,21 @@ msgid "" "with arguments ``init``, ``size``." msgstr "" -#: ../../library/ctypes.rst:1912 +#: ../../library/ctypes.rst:1914 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllCanUnloadNow function " "that the _ctypes extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1919 +#: ../../library/ctypes.rst:1921 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllGetClassObject function " "that the ``_ctypes`` extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1927 +#: ../../library/ctypes.rst:1929 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -1971,35 +1975,35 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1938 +#: ../../library/ctypes.rst:1940 msgid "" "Windows only: return the filename of the VC runtime library used by Python, " "and by the extension modules. If the name of the library cannot be " "determined, ``None`` is returned." msgstr "" -#: ../../library/ctypes.rst:1942 +#: ../../library/ctypes.rst:1944 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: ../../library/ctypes.rst:1949 +#: ../../library/ctypes.rst:1951 msgid "" "Windows only: Returns a textual description of the error code *code*. If no " "error code is specified, the last error code is used by calling the Windows " "api function GetLastError." msgstr "" -#: ../../library/ctypes.rst:1956 +#: ../../library/ctypes.rst:1958 msgid "" "Windows only: Returns the last error code set by Windows in the calling " "thread. This function calls the Windows ``GetLastError()`` function " "directly, it does not return the ctypes-private copy of the error code." msgstr "" -#: ../../library/ctypes.rst:1962 +#: ../../library/ctypes.rst:1964 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." @@ -2011,7 +2015,7 @@ msgid "" "arguments." msgstr "" -#: ../../library/ctypes.rst:1969 +#: ../../library/ctypes.rst:1971 msgid "" "Windows only: returns the current value of the ctypes-private copy of the " "system :data:`LastError` variable in the calling thread." @@ -2023,40 +2027,40 @@ msgid "" "arguments." msgstr "" -#: ../../library/ctypes.rst:1976 +#: ../../library/ctypes.rst:1978 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: ../../library/ctypes.rst:1983 +#: ../../library/ctypes.rst:1985 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: ../../library/ctypes.rst:1990 +#: ../../library/ctypes.rst:1992 msgid "" "This factory function creates and returns a new ctypes pointer type. Pointer " "types are cached and reused internally, so calling this function repeatedly " "is cheap. *type* must be a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1997 +#: ../../library/ctypes.rst:1999 msgid "" "This function creates a new pointer instance, pointing to *obj*. The " "returned object is of the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2000 +#: ../../library/ctypes.rst:2002 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: ../../library/ctypes.rst:2006 +#: ../../library/ctypes.rst:2008 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -2064,7 +2068,7 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2014 +#: ../../library/ctypes.rst:2016 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." @@ -2076,7 +2080,7 @@ msgid "" "argument ``errno``." msgstr "" -#: ../../library/ctypes.rst:2022 +#: ../../library/ctypes.rst:2024 msgid "" "Windows only: set the current value of the ctypes-private copy of the " "system :data:`LastError` variable in the calling thread to *value* and " @@ -2089,13 +2093,13 @@ msgid "" "argument ``error``." msgstr "" -#: ../../library/ctypes.rst:2031 +#: ../../library/ctypes.rst:2033 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: ../../library/ctypes.rst:2037 +#: ../../library/ctypes.rst:2039 msgid "" "This function returns the C string starting at memory address *address* as a " "bytes object. If size is specified, it is used as size, otherwise the string " @@ -2108,7 +2112,7 @@ msgid "" "arguments ``address``, ``size``." msgstr "" -#: ../../library/ctypes.rst:2046 +#: ../../library/ctypes.rst:2048 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " "creates an instance of OSError. If *code* is not specified, " @@ -2117,11 +2121,11 @@ msgid "" "error." msgstr "" -#: ../../library/ctypes.rst:2052 +#: ../../library/ctypes.rst:2054 msgid "An instance of :exc:`WindowsError` used to be created." msgstr "" -#: ../../library/ctypes.rst:2058 +#: ../../library/ctypes.rst:2060 msgid "" "This function returns the wide character string starting at memory address " "*address* as a string. If *size* is specified, it is used as the number of " @@ -2135,11 +2139,11 @@ msgid "" "arguments ``address``, ``size``." msgstr "" -#: ../../library/ctypes.rst:2069 +#: ../../library/ctypes.rst:2071 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2074 +#: ../../library/ctypes.rst:2076 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -2149,13 +2153,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2081 +#: ../../library/ctypes.rst:2083 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: ../../library/ctypes.rst:2086 +#: ../../library/ctypes.rst:2088 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -2170,7 +2174,7 @@ msgid "" "arguments ``pointer``, ``size``, ``offset``." msgstr "" -#: ../../library/ctypes.rst:2096 +#: ../../library/ctypes.rst:2098 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -2178,7 +2182,7 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2106 +#: ../../library/ctypes.rst:2108 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." @@ -2190,13 +2194,13 @@ msgid "" "``address``." msgstr "" -#: ../../library/ctypes.rst:2111 +#: ../../library/ctypes.rst:2113 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2117 +#: ../../library/ctypes.rst:2119 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " @@ -2204,25 +2208,25 @@ msgid "" "be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2122 +#: ../../library/ctypes.rst:2124 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: ../../library/ctypes.rst:2128 +#: ../../library/ctypes.rst:2130 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: ../../library/ctypes.rst:2132 +#: ../../library/ctypes.rst:2134 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2136 +#: ../../library/ctypes.rst:2138 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -2230,13 +2234,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2143 +#: ../../library/ctypes.rst:2145 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2148 +#: ../../library/ctypes.rst:2150 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -2244,7 +2248,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2161 +#: ../../library/ctypes.rst:2163 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -2253,11 +2257,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2167 +#: ../../library/ctypes.rst:2169 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2171 +#: ../../library/ctypes.rst:2173 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -2265,7 +2269,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2176 +#: ../../library/ctypes.rst:2178 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -2273,7 +2277,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2182 +#: ../../library/ctypes.rst:2184 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -2282,7 +2286,7 @@ msgid "" "receive a Python bytes object, *not* a :class:`c_char_p` instance." msgstr "" -#: ../../library/ctypes.rst:2190 +#: ../../library/ctypes.rst:2192 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`restype` is a subclass of :class:`c_void_p`, you " @@ -2290,25 +2294,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2195 +#: ../../library/ctypes.rst:2197 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2199 +#: ../../library/ctypes.rst:2201 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2206 +#: ../../library/ctypes.rst:2208 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2213 +#: ../../library/ctypes.rst:2215 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -2316,178 +2320,178 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2221 +#: ../../library/ctypes.rst:2223 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2227 +#: ../../library/ctypes.rst:2229 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2233 +#: ../../library/ctypes.rst:2235 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2239 +#: ../../library/ctypes.rst:2241 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2246 +#: ../../library/ctypes.rst:2248 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2252 +#: ../../library/ctypes.rst:2254 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2258 +#: ../../library/ctypes.rst:2260 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2264 +#: ../../library/ctypes.rst:2266 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2270 +#: ../../library/ctypes.rst:2272 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2276 +#: ../../library/ctypes.rst:2278 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2282 +#: ../../library/ctypes.rst:2284 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2288 +#: ../../library/ctypes.rst:2290 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2293 +#: ../../library/ctypes.rst:2295 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2300 +#: ../../library/ctypes.rst:2302 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2307 +#: ../../library/ctypes.rst:2309 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2314 +#: ../../library/ctypes.rst:2316 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2320 +#: ../../library/ctypes.rst:2322 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2326 +#: ../../library/ctypes.rst:2328 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2332 +#: ../../library/ctypes.rst:2334 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2338 +#: ../../library/ctypes.rst:2340 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2344 +#: ../../library/ctypes.rst:2346 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2350 +#: ../../library/ctypes.rst:2352 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2356 +#: ../../library/ctypes.rst:2358 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2362 +#: ../../library/ctypes.rst:2364 msgid "" "Represents the C :c:expr:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2369 +#: ../../library/ctypes.rst:2371 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2376 +#: ../../library/ctypes.rst:2378 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2383 +#: ../../library/ctypes.rst:2385 msgid "" "Windows only: Represents a :c:type:`HRESULT` value, which contains success " "or error information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2389 +#: ../../library/ctypes.rst:2391 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2392 +#: ../../library/ctypes.rst:2394 msgid "" "The :mod:`ctypes.wintypes` module provides quite some other Windows specific " "data types, for example :c:type:`HWND`, :c:type:`WPARAM`, or :c:type:" @@ -2495,41 +2499,41 @@ msgid "" "also defined." msgstr "" -#: ../../library/ctypes.rst:2400 +#: ../../library/ctypes.rst:2402 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2405 +#: ../../library/ctypes.rst:2407 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2410 +#: ../../library/ctypes.rst:2412 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2416 +#: ../../library/ctypes.rst:2418 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2422 +#: ../../library/ctypes.rst:2424 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2427 +#: ../../library/ctypes.rst:2429 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2429 +#: ../../library/ctypes.rst:2431 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2435 +#: ../../library/ctypes.rst:2437 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2437 +#: ../../library/ctypes.rst:2439 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -2537,34 +2541,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2445 +#: ../../library/ctypes.rst:2447 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: ../../library/ctypes.rst:2449 +#: ../../library/ctypes.rst:2451 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: ../../library/ctypes.rst:2453 +#: ../../library/ctypes.rst:2455 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: ../../library/ctypes.rst:2456 +#: ../../library/ctypes.rst:2458 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: ../../library/ctypes.rst:2466 +#: ../../library/ctypes.rst:2468 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " "type is first used (an instance is created, :func:`sizeof` is called on it, " @@ -2572,28 +2576,28 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2471 +#: ../../library/ctypes.rst:2473 msgid "" "It is possible to define sub-subclasses of structure types, they inherit the " "fields of the base class plus the :attr:`_fields_` defined in the sub-" "subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2478 +#: ../../library/ctypes.rst:2480 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" "`_fields_` is assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2485 +#: ../../library/ctypes.rst:2487 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2489 +#: ../../library/ctypes.rst:2491 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -2601,11 +2605,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2494 +#: ../../library/ctypes.rst:2496 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2507 +#: ../../library/ctypes.rst:2509 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -2615,7 +2619,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2519 +#: ../../library/ctypes.rst:2521 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -2623,7 +2627,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2524 +#: ../../library/ctypes.rst:2526 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -2633,15 +2637,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2535 +#: ../../library/ctypes.rst:2537 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2539 +#: ../../library/ctypes.rst:2541 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2541 +#: ../../library/ctypes.rst:2543 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -2651,34 +2655,34 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2551 +#: ../../library/ctypes.rst:2553 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2558 +#: ../../library/ctypes.rst:2560 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2561 +#: ../../library/ctypes.rst:2563 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2567 +#: ../../library/ctypes.rst:2569 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2569 +#: ../../library/ctypes.rst:2571 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:2573 +#: ../../library/ctypes.rst:2575 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -2687,11 +2691,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2583 +#: ../../library/ctypes.rst:2585 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2587 +#: ../../library/ctypes.rst:2589 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 11f85ca6ae..c647491464 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-11-05 17:14+0800\n" +"POT-Creation-Date: 2022-11-26 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,436 +20,440 @@ msgstr "" #: ../../library/curses.ascii.rst:2 msgid ":mod:`curses.ascii` --- Utilities for ASCII characters" -msgstr "" +msgstr ":mod:`curses.ascii` --- ASCII 字元的工具程式" + +#: ../../library/curses.ascii.rst:10 +msgid "**Source code:** :source:`Lib/curses/ascii.py`" +msgstr "**原始碼:**\\ :source:`Lib/curses/ascii.py`" -#: ../../library/curses.ascii.rst:12 +#: ../../library/curses.ascii.rst:14 msgid "" "The :mod:`curses.ascii` module supplies name constants for ASCII characters " "and functions to test membership in various ASCII character classes. The " "constants supplied are names for control characters as follows:" msgstr "" -#: ../../library/curses.ascii.rst:17 +#: ../../library/curses.ascii.rst:19 msgid "Name" msgstr "" -#: ../../library/curses.ascii.rst:17 +#: ../../library/curses.ascii.rst:19 msgid "Meaning" msgstr "" -#: ../../library/curses.ascii.rst:19 +#: ../../library/curses.ascii.rst:21 msgid ":const:`NUL`" msgstr ":const:`NUL`" -#: ../../library/curses.ascii.rst:21 +#: ../../library/curses.ascii.rst:23 msgid ":const:`SOH`" msgstr ":const:`SOH`" -#: ../../library/curses.ascii.rst:21 +#: ../../library/curses.ascii.rst:23 msgid "Start of heading, console interrupt" msgstr "" -#: ../../library/curses.ascii.rst:23 +#: ../../library/curses.ascii.rst:25 msgid ":const:`STX`" msgstr ":const:`STX`" -#: ../../library/curses.ascii.rst:23 +#: ../../library/curses.ascii.rst:25 msgid "Start of text" msgstr "" -#: ../../library/curses.ascii.rst:25 +#: ../../library/curses.ascii.rst:27 msgid ":const:`ETX`" msgstr ":const:`ETX`" -#: ../../library/curses.ascii.rst:25 +#: ../../library/curses.ascii.rst:27 msgid "End of text" msgstr "" -#: ../../library/curses.ascii.rst:27 +#: ../../library/curses.ascii.rst:29 msgid ":const:`EOT`" msgstr ":const:`EOT`" -#: ../../library/curses.ascii.rst:27 +#: ../../library/curses.ascii.rst:29 msgid "End of transmission" msgstr "" -#: ../../library/curses.ascii.rst:29 +#: ../../library/curses.ascii.rst:31 msgid ":const:`ENQ`" msgstr ":const:`ENQ`" -#: ../../library/curses.ascii.rst:29 +#: ../../library/curses.ascii.rst:31 msgid "Enquiry, goes with :const:`ACK` flow control" msgstr "" -#: ../../library/curses.ascii.rst:31 +#: ../../library/curses.ascii.rst:33 msgid ":const:`ACK`" msgstr ":const:`ACK`" -#: ../../library/curses.ascii.rst:31 +#: ../../library/curses.ascii.rst:33 msgid "Acknowledgement" msgstr "" -#: ../../library/curses.ascii.rst:33 +#: ../../library/curses.ascii.rst:35 msgid ":const:`BEL`" msgstr ":const:`BEL`" -#: ../../library/curses.ascii.rst:33 +#: ../../library/curses.ascii.rst:35 msgid "Bell" msgstr "" -#: ../../library/curses.ascii.rst:35 +#: ../../library/curses.ascii.rst:37 msgid ":const:`BS`" msgstr ":const:`BS`" -#: ../../library/curses.ascii.rst:35 +#: ../../library/curses.ascii.rst:37 msgid "Backspace" msgstr "" -#: ../../library/curses.ascii.rst:37 +#: ../../library/curses.ascii.rst:39 msgid ":const:`TAB`" msgstr ":const:`TAB`" -#: ../../library/curses.ascii.rst:37 +#: ../../library/curses.ascii.rst:39 msgid "Tab" msgstr "" -#: ../../library/curses.ascii.rst:39 +#: ../../library/curses.ascii.rst:41 msgid ":const:`HT`" msgstr ":const:`HT`" -#: ../../library/curses.ascii.rst:39 +#: ../../library/curses.ascii.rst:41 msgid "Alias for :const:`TAB`: \"Horizontal tab\"" msgstr "" -#: ../../library/curses.ascii.rst:41 +#: ../../library/curses.ascii.rst:43 msgid ":const:`LF`" msgstr ":const:`LF`" -#: ../../library/curses.ascii.rst:41 +#: ../../library/curses.ascii.rst:43 msgid "Line feed" msgstr "" -#: ../../library/curses.ascii.rst:43 +#: ../../library/curses.ascii.rst:45 msgid ":const:`NL`" msgstr ":const:`NL`" -#: ../../library/curses.ascii.rst:43 +#: ../../library/curses.ascii.rst:45 msgid "Alias for :const:`LF`: \"New line\"" msgstr "" -#: ../../library/curses.ascii.rst:45 +#: ../../library/curses.ascii.rst:47 msgid ":const:`VT`" msgstr ":const:`VT`" -#: ../../library/curses.ascii.rst:45 +#: ../../library/curses.ascii.rst:47 msgid "Vertical tab" msgstr "" -#: ../../library/curses.ascii.rst:47 +#: ../../library/curses.ascii.rst:49 msgid ":const:`FF`" msgstr ":const:`FF`" -#: ../../library/curses.ascii.rst:47 +#: ../../library/curses.ascii.rst:49 msgid "Form feed" msgstr "" -#: ../../library/curses.ascii.rst:49 +#: ../../library/curses.ascii.rst:51 msgid ":const:`CR`" msgstr ":const:`CR`" -#: ../../library/curses.ascii.rst:49 +#: ../../library/curses.ascii.rst:51 msgid "Carriage return" msgstr "" -#: ../../library/curses.ascii.rst:51 +#: ../../library/curses.ascii.rst:53 msgid ":const:`SO`" msgstr ":const:`SO`" -#: ../../library/curses.ascii.rst:51 +#: ../../library/curses.ascii.rst:53 msgid "Shift-out, begin alternate character set" msgstr "" -#: ../../library/curses.ascii.rst:53 +#: ../../library/curses.ascii.rst:55 msgid ":const:`SI`" msgstr ":const:`SI`" -#: ../../library/curses.ascii.rst:53 +#: ../../library/curses.ascii.rst:55 msgid "Shift-in, resume default character set" msgstr "" -#: ../../library/curses.ascii.rst:55 +#: ../../library/curses.ascii.rst:57 msgid ":const:`DLE`" msgstr ":const:`DLE`" -#: ../../library/curses.ascii.rst:55 +#: ../../library/curses.ascii.rst:57 msgid "Data-link escape" msgstr "" -#: ../../library/curses.ascii.rst:57 +#: ../../library/curses.ascii.rst:59 msgid ":const:`DC1`" msgstr ":const:`DC1`" -#: ../../library/curses.ascii.rst:57 +#: ../../library/curses.ascii.rst:59 msgid "XON, for flow control" msgstr "" -#: ../../library/curses.ascii.rst:59 +#: ../../library/curses.ascii.rst:61 msgid ":const:`DC2`" msgstr ":const:`DC2`" -#: ../../library/curses.ascii.rst:59 +#: ../../library/curses.ascii.rst:61 msgid "Device control 2, block-mode flow control" msgstr "" -#: ../../library/curses.ascii.rst:61 +#: ../../library/curses.ascii.rst:63 msgid ":const:`DC3`" msgstr ":const:`DC3`" -#: ../../library/curses.ascii.rst:61 +#: ../../library/curses.ascii.rst:63 msgid "XOFF, for flow control" msgstr "" -#: ../../library/curses.ascii.rst:63 +#: ../../library/curses.ascii.rst:65 msgid ":const:`DC4`" msgstr ":const:`DC4`" -#: ../../library/curses.ascii.rst:63 +#: ../../library/curses.ascii.rst:65 msgid "Device control 4" msgstr "" -#: ../../library/curses.ascii.rst:65 +#: ../../library/curses.ascii.rst:67 msgid ":const:`NAK`" msgstr ":const:`NAK`" -#: ../../library/curses.ascii.rst:65 +#: ../../library/curses.ascii.rst:67 msgid "Negative acknowledgement" msgstr "" -#: ../../library/curses.ascii.rst:67 +#: ../../library/curses.ascii.rst:69 msgid ":const:`SYN`" msgstr ":const:`SYN`" -#: ../../library/curses.ascii.rst:67 +#: ../../library/curses.ascii.rst:69 msgid "Synchronous idle" msgstr "" -#: ../../library/curses.ascii.rst:69 +#: ../../library/curses.ascii.rst:71 msgid ":const:`ETB`" msgstr ":const:`ETB`" -#: ../../library/curses.ascii.rst:69 +#: ../../library/curses.ascii.rst:71 msgid "End transmission block" msgstr "" -#: ../../library/curses.ascii.rst:71 +#: ../../library/curses.ascii.rst:73 msgid ":const:`CAN`" msgstr ":const:`CAN`" -#: ../../library/curses.ascii.rst:71 +#: ../../library/curses.ascii.rst:73 msgid "Cancel" msgstr "" -#: ../../library/curses.ascii.rst:73 +#: ../../library/curses.ascii.rst:75 msgid ":const:`EM`" msgstr ":const:`EM`" -#: ../../library/curses.ascii.rst:73 +#: ../../library/curses.ascii.rst:75 msgid "End of medium" msgstr "" -#: ../../library/curses.ascii.rst:75 +#: ../../library/curses.ascii.rst:77 msgid ":const:`SUB`" msgstr ":const:`SUB`" -#: ../../library/curses.ascii.rst:75 +#: ../../library/curses.ascii.rst:77 msgid "Substitute" msgstr "" -#: ../../library/curses.ascii.rst:77 +#: ../../library/curses.ascii.rst:79 msgid ":const:`ESC`" msgstr ":const:`ESC`" -#: ../../library/curses.ascii.rst:77 +#: ../../library/curses.ascii.rst:79 msgid "Escape" msgstr "" -#: ../../library/curses.ascii.rst:79 +#: ../../library/curses.ascii.rst:81 msgid ":const:`FS`" msgstr ":const:`FS`" -#: ../../library/curses.ascii.rst:79 +#: ../../library/curses.ascii.rst:81 msgid "File separator" msgstr "" -#: ../../library/curses.ascii.rst:81 +#: ../../library/curses.ascii.rst:83 msgid ":const:`GS`" msgstr ":const:`GS`" -#: ../../library/curses.ascii.rst:81 +#: ../../library/curses.ascii.rst:83 msgid "Group separator" msgstr "" -#: ../../library/curses.ascii.rst:83 +#: ../../library/curses.ascii.rst:85 msgid ":const:`RS`" msgstr ":const:`RS`" -#: ../../library/curses.ascii.rst:83 +#: ../../library/curses.ascii.rst:85 msgid "Record separator, block-mode terminator" msgstr "" -#: ../../library/curses.ascii.rst:85 +#: ../../library/curses.ascii.rst:87 msgid ":const:`US`" msgstr ":const:`US`" -#: ../../library/curses.ascii.rst:85 +#: ../../library/curses.ascii.rst:87 msgid "Unit separator" msgstr "" -#: ../../library/curses.ascii.rst:87 +#: ../../library/curses.ascii.rst:89 msgid ":const:`SP`" msgstr ":const:`SP`" -#: ../../library/curses.ascii.rst:87 +#: ../../library/curses.ascii.rst:89 msgid "Space" msgstr "" -#: ../../library/curses.ascii.rst:89 +#: ../../library/curses.ascii.rst:91 msgid ":const:`DEL`" msgstr ":const:`DEL`" -#: ../../library/curses.ascii.rst:89 +#: ../../library/curses.ascii.rst:91 msgid "Delete" msgstr "" -#: ../../library/curses.ascii.rst:92 +#: ../../library/curses.ascii.rst:94 msgid "" "Note that many of these have little practical significance in modern usage. " "The mnemonics derive from teleprinter conventions that predate digital " "computers." msgstr "" -#: ../../library/curses.ascii.rst:95 +#: ../../library/curses.ascii.rst:97 msgid "" "The module supplies the following functions, patterned on those in the " "standard C library:" msgstr "" -#: ../../library/curses.ascii.rst:101 +#: ../../library/curses.ascii.rst:103 msgid "" "Checks for an ASCII alphanumeric character; it is equivalent to ``isalpha(c) " "or isdigit(c)``." msgstr "" -#: ../../library/curses.ascii.rst:107 +#: ../../library/curses.ascii.rst:109 msgid "" "Checks for an ASCII alphabetic character; it is equivalent to ``isupper(c) " "or islower(c)``." msgstr "" -#: ../../library/curses.ascii.rst:113 +#: ../../library/curses.ascii.rst:115 msgid "Checks for a character value that fits in the 7-bit ASCII set." msgstr "" -#: ../../library/curses.ascii.rst:118 +#: ../../library/curses.ascii.rst:120 msgid "Checks for an ASCII whitespace character; space or horizontal tab." msgstr "" -#: ../../library/curses.ascii.rst:123 +#: ../../library/curses.ascii.rst:125 msgid "" "Checks for an ASCII control character (in the range 0x00 to 0x1f or 0x7f)." msgstr "" -#: ../../library/curses.ascii.rst:128 +#: ../../library/curses.ascii.rst:130 msgid "" "Checks for an ASCII decimal digit, ``'0'`` through ``'9'``. This is " "equivalent to ``c in string.digits``." msgstr "" -#: ../../library/curses.ascii.rst:134 +#: ../../library/curses.ascii.rst:136 msgid "Checks for ASCII any printable character except space." msgstr "" -#: ../../library/curses.ascii.rst:139 +#: ../../library/curses.ascii.rst:141 msgid "Checks for an ASCII lower-case character." msgstr "" -#: ../../library/curses.ascii.rst:144 +#: ../../library/curses.ascii.rst:146 msgid "Checks for any ASCII printable character including space." msgstr "" -#: ../../library/curses.ascii.rst:149 +#: ../../library/curses.ascii.rst:151 msgid "" "Checks for any printable ASCII character which is not a space or an " "alphanumeric character." msgstr "" -#: ../../library/curses.ascii.rst:155 +#: ../../library/curses.ascii.rst:157 msgid "" "Checks for ASCII white-space characters; space, line feed, carriage return, " "form feed, horizontal tab, vertical tab." msgstr "" -#: ../../library/curses.ascii.rst:161 +#: ../../library/curses.ascii.rst:163 msgid "Checks for an ASCII uppercase letter." msgstr "" -#: ../../library/curses.ascii.rst:166 +#: ../../library/curses.ascii.rst:168 msgid "" "Checks for an ASCII hexadecimal digit. This is equivalent to ``c in string." "hexdigits``." msgstr "" -#: ../../library/curses.ascii.rst:172 +#: ../../library/curses.ascii.rst:174 msgid "Checks for an ASCII control character (ordinal values 0 to 31)." msgstr "" -#: ../../library/curses.ascii.rst:177 +#: ../../library/curses.ascii.rst:179 msgid "Checks for a non-ASCII character (ordinal values 0x80 and above)." msgstr "" -#: ../../library/curses.ascii.rst:179 +#: ../../library/curses.ascii.rst:181 msgid "" "These functions accept either integers or single-character strings; when the " "argument is a string, it is first converted using the built-in function :" "func:`ord`." msgstr "" -#: ../../library/curses.ascii.rst:182 +#: ../../library/curses.ascii.rst:184 msgid "" "Note that all these functions check ordinal bit values derived from the " "character of the string you pass in; they do not actually know anything " "about the host machine's character encoding." msgstr "" -#: ../../library/curses.ascii.rst:186 +#: ../../library/curses.ascii.rst:188 msgid "" "The following two functions take either a single-character string or integer " "byte value; they return a value of the same type." msgstr "" -#: ../../library/curses.ascii.rst:192 +#: ../../library/curses.ascii.rst:194 msgid "Return the ASCII value corresponding to the low 7 bits of *c*." msgstr "" -#: ../../library/curses.ascii.rst:197 +#: ../../library/curses.ascii.rst:199 msgid "" "Return the control character corresponding to the given character (the " "character bit value is bitwise-anded with 0x1f)." msgstr "" -#: ../../library/curses.ascii.rst:203 +#: ../../library/curses.ascii.rst:205 msgid "" "Return the 8-bit character corresponding to the given ASCII character (the " "character bit value is bitwise-ored with 0x80)." msgstr "" -#: ../../library/curses.ascii.rst:206 +#: ../../library/curses.ascii.rst:208 msgid "" "The following function takes either a single-character string or integer " "value; it returns a string." msgstr "" -#: ../../library/curses.ascii.rst:216 +#: ../../library/curses.ascii.rst:218 msgid "" "Return a string representation of the ASCII character *c*. If *c* is " "printable, this string is the character itself. If the character is a " @@ -460,7 +464,7 @@ msgid "" "``'!'`` prepended to the result." msgstr "" -#: ../../library/curses.ascii.rst:226 +#: ../../library/curses.ascii.rst:228 msgid "" "A 33-element string array that contains the ASCII mnemonics for the thirty-" "two ASCII control characters from 0 (NUL) to 0x1f (US), in order, plus the " diff --git a/library/curses.po b/library/curses.po index e89005b9d1..f1ea35ad15 100644 --- a/library/curses.po +++ b/library/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -22,13 +22,17 @@ msgstr "" msgid ":mod:`curses` --- Terminal handling for character-cell displays" msgstr "" -#: ../../library/curses.rst:14 +#: ../../library/curses.rst:12 +msgid "**Source code:** :source:`Lib/curses`" +msgstr "**原始碼:**\\ :source:`Lib/curses`" + +#: ../../library/curses.rst:16 msgid "" "The :mod:`curses` module provides an interface to the curses library, the de-" "facto standard for portable advanced terminal handling." msgstr "" -#: ../../library/curses.rst:17 +#: ../../library/curses.rst:19 msgid "" "While curses is most widely used in the Unix environment, versions are " "available for Windows, DOS, and possibly other systems as well. This " @@ -36,87 +40,87 @@ msgid "" "curses library hosted on Linux and the BSD variants of Unix." msgstr "" -#: ../../library/curses.rst:24 +#: ../../library/curses.rst:26 msgid "" "Whenever the documentation mentions a *character* it can be specified as an " "integer, a one-character Unicode string or a one-byte byte string." msgstr "" -#: ../../library/curses.rst:27 +#: ../../library/curses.rst:29 msgid "" "Whenever the documentation mentions a *character string* it can be specified " "as a Unicode string or a byte string." msgstr "" -#: ../../library/curses.rst:33 +#: ../../library/curses.rst:35 msgid "Module :mod:`curses.ascii`" msgstr "" -#: ../../library/curses.rst:33 +#: ../../library/curses.rst:35 msgid "" "Utilities for working with ASCII characters, regardless of your locale " "settings." msgstr "" -#: ../../library/curses.rst:36 +#: ../../library/curses.rst:38 msgid "Module :mod:`curses.panel`" msgstr "" -#: ../../library/curses.rst:36 +#: ../../library/curses.rst:38 msgid "A panel stack extension that adds depth to curses windows." msgstr "" -#: ../../library/curses.rst:39 +#: ../../library/curses.rst:41 msgid "Module :mod:`curses.textpad`" msgstr "" -#: ../../library/curses.rst:39 +#: ../../library/curses.rst:41 msgid "" "Editable text widget for curses supporting :program:`Emacs`\\ -like " "bindings." msgstr "" -#: ../../library/curses.rst:43 +#: ../../library/curses.rst:45 msgid ":ref:`curses-howto`" msgstr ":ref:`curses-howto`" -#: ../../library/curses.rst:42 +#: ../../library/curses.rst:44 msgid "" "Tutorial material on using curses with Python, by Andrew Kuchling and Eric " "Raymond." msgstr "" -#: ../../library/curses.rst:45 +#: ../../library/curses.rst:47 msgid "" "The :source:`Tools/demo/` directory in the Python source distribution " "contains some example programs using the curses bindings provided by this " "module." msgstr "" -#: ../../library/curses.rst:52 +#: ../../library/curses.rst:54 msgid "Functions" msgstr "函式" -#: ../../library/curses.rst:54 +#: ../../library/curses.rst:56 msgid "The module :mod:`curses` defines the following exception:" msgstr "" -#: ../../library/curses.rst:59 +#: ../../library/curses.rst:61 msgid "Exception raised when a curses library function returns an error." msgstr "" -#: ../../library/curses.rst:63 +#: ../../library/curses.rst:65 msgid "" "Whenever *x* or *y* arguments to a function or a method are optional, they " "default to the current cursor location. Whenever *attr* is optional, it " "defaults to :const:`A_NORMAL`." msgstr "" -#: ../../library/curses.rst:67 +#: ../../library/curses.rst:69 msgid "The module :mod:`curses` defines the following functions:" msgstr "" -#: ../../library/curses.rst:72 +#: ../../library/curses.rst:74 msgid "" "Return the output speed of the terminal in bits per second. On software " "terminal emulators it will have a fixed high value. Included for historical " @@ -124,17 +128,17 @@ msgid "" "and occasionally to change interfaces depending on the line speed." msgstr "" -#: ../../library/curses.rst:80 +#: ../../library/curses.rst:82 msgid "Emit a short attention sound." msgstr "" -#: ../../library/curses.rst:85 +#: ../../library/curses.rst:87 msgid "" "Return ``True`` or ``False``, depending on whether the programmer can change " "the colors displayed by the terminal." msgstr "" -#: ../../library/curses.rst:91 +#: ../../library/curses.rst:93 msgid "" "Enter cbreak mode. In cbreak mode (sometimes called \"rare\" mode) normal " "tty line buffering is turned off and characters are available to be read one " @@ -144,7 +148,7 @@ msgid "" "terminal in cbreak mode." msgstr "" -#: ../../library/curses.rst:100 +#: ../../library/curses.rst:102 msgid "" "Return the intensity of the red, green, and blue (RGB) components in the " "color *color_number*, which must be between ``0`` and ``COLORS - 1``. " @@ -153,7 +157,7 @@ msgid "" "component)." msgstr "" -#: ../../library/curses.rst:108 +#: ../../library/curses.rst:110 msgid "" "Return the attribute value for displaying text in the specified color pair. " "Only the first 256 color pairs are supported. This attribute value can be " @@ -161,7 +165,7 @@ msgid "" "`A_\\*` attributes. :func:`pair_number` is the counterpart to this function." msgstr "" -#: ../../library/curses.rst:117 +#: ../../library/curses.rst:119 msgid "" "Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, " "for invisible, normal, or very visible. If the terminal supports the " @@ -170,7 +174,7 @@ msgid "" "and the \"very visible\" mode is a block cursor." msgstr "" -#: ../../library/curses.rst:126 +#: ../../library/curses.rst:128 msgid "" "Save the current terminal mode as the \"program\" mode, the mode when the " "running program is using curses. (Its counterpart is the \"shell\" mode, " @@ -178,7 +182,7 @@ msgid "" "`reset_prog_mode` will restore this mode." msgstr "" -#: ../../library/curses.rst:134 +#: ../../library/curses.rst:136 msgid "" "Save the current terminal mode as the \"shell\" mode, the mode when the " "running program is not using curses. (Its counterpart is the \"program\" " @@ -186,11 +190,11 @@ msgid "" "func:`reset_shell_mode` will restore this mode." msgstr "" -#: ../../library/curses.rst:142 +#: ../../library/curses.rst:144 msgid "Insert an *ms* millisecond pause in output." msgstr "" -#: ../../library/curses.rst:147 +#: ../../library/curses.rst:149 msgid "" "Update the physical screen. The curses library keeps two data structures, " "one representing the current physical screen contents and a virtual screen " @@ -198,7 +202,7 @@ msgid "" "the physical screen to match the virtual screen." msgstr "" -#: ../../library/curses.rst:152 +#: ../../library/curses.rst:154 msgid "" "The virtual screen may be updated by a :meth:`~window.noutrefresh` call " "after write operations such as :meth:`~window.addstr` have been performed on " @@ -209,24 +213,24 @@ msgid "" "func:`!doupdate`." msgstr "" -#: ../../library/curses.rst:162 +#: ../../library/curses.rst:164 msgid "" "Enter echo mode. In echo mode, each character input is echoed to the screen " "as it is entered." msgstr "" -#: ../../library/curses.rst:168 +#: ../../library/curses.rst:170 msgid "De-initialize the library, and return terminal to normal status." msgstr "" -#: ../../library/curses.rst:173 +#: ../../library/curses.rst:175 msgid "" "Return the user's current erase character as a one-byte bytes object. Under " "Unix operating systems this is a property of the controlling tty of the " "curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:180 +#: ../../library/curses.rst:182 msgid "" "The :func:`.filter` routine, if used, must be called before :func:`initscr` " "is called. The effect is that, during those calls, :envvar:`LINES` is set " @@ -237,20 +241,20 @@ msgid "" "time line editing without touching the rest of the screen." msgstr "" -#: ../../library/curses.rst:190 +#: ../../library/curses.rst:192 msgid "" "Flash the screen. That is, change it to reverse-video and then change it " "back in a short interval. Some people prefer such as 'visible bell' to the " "audible attention signal produced by :func:`beep`." msgstr "" -#: ../../library/curses.rst:197 +#: ../../library/curses.rst:199 msgid "" "Flush all input buffers. This throws away any typeahead that has been " "typed by the user and has not yet been processed by the program." msgstr "" -#: ../../library/curses.rst:203 +#: ../../library/curses.rst:205 msgid "" "After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse " "event, this method should be called to retrieve the queued mouse event, " @@ -265,51 +269,51 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: ../../library/curses.rst:214 +#: ../../library/curses.rst:216 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." msgstr "" -#: ../../library/curses.rst:221 +#: ../../library/curses.rst:223 msgid "" "Return the current coordinates of the virtual screen cursor as a tuple ``(y, " "x)``. If :meth:`leaveok ` is currently ``True``, then " "return ``(-1, -1)``." msgstr "" -#: ../../library/curses.rst:227 +#: ../../library/curses.rst:229 msgid "" "Read window related data stored in the file by an earlier :func:`putwin` " "call. The routine then creates and initializes a new window using that data, " "returning the new window object." msgstr "" -#: ../../library/curses.rst:234 +#: ../../library/curses.rst:236 msgid "" "Return ``True`` if the terminal can display colors; otherwise, return " "``False``." msgstr "" -#: ../../library/curses.rst:238 +#: ../../library/curses.rst:240 msgid "" "Return ``True`` if the module supports extended colors; otherwise, return " "``False``. Extended color support allows more than 256 color pairs for " "terminals that support more than 16 colors (e.g. xterm-256color)." msgstr "" -#: ../../library/curses.rst:242 +#: ../../library/curses.rst:244 msgid "Extended color support requires ncurses version 6.1 or later." msgstr "" -#: ../../library/curses.rst:248 +#: ../../library/curses.rst:250 msgid "" "Return ``True`` if the terminal has insert- and delete-character " "capabilities. This function is included for historical reasons only, as all " "modern software terminal emulators have such capabilities." msgstr "" -#: ../../library/curses.rst:255 +#: ../../library/curses.rst:257 msgid "" "Return ``True`` if the terminal has insert- and delete-line capabilities, or " "can simulate them using scrolling regions. This function is included for " @@ -317,13 +321,13 @@ msgid "" "capabilities." msgstr "" -#: ../../library/curses.rst:263 +#: ../../library/curses.rst:265 msgid "" "Take a key value *ch*, and return ``True`` if the current terminal type " "recognizes a key with that value." msgstr "" -#: ../../library/curses.rst:269 +#: ../../library/curses.rst:271 msgid "" "Used for half-delay mode, which is similar to cbreak mode in that characters " "typed by the user are immediately available to the program. However, after " @@ -332,7 +336,7 @@ msgid "" "``255``. Use :func:`nocbreak` to leave half-delay mode." msgstr "" -#: ../../library/curses.rst:278 +#: ../../library/curses.rst:280 msgid "" "Change the definition of a color, taking the number of the color to be " "changed followed by three RGB values (for the amounts of red, green, and " @@ -344,7 +348,7 @@ msgid "" "``True``." msgstr "" -#: ../../library/curses.rst:289 +#: ../../library/curses.rst:291 msgid "" "Change the definition of a color-pair. It takes three arguments: the number " "of the color-pair to be changed, the foreground color number, and the " @@ -357,31 +361,31 @@ msgid "" "definition." msgstr "" -#: ../../library/curses.rst:302 +#: ../../library/curses.rst:304 msgid "" "Initialize the library. Return a :ref:`window ` " "object which represents the whole screen." msgstr "" -#: ../../library/curses.rst:307 +#: ../../library/curses.rst:309 msgid "" "If there is an error opening the terminal, the underlying curses library may " "cause the interpreter to exit." msgstr "" -#: ../../library/curses.rst:313 +#: ../../library/curses.rst:315 msgid "" "Return ``True`` if :func:`resize_term` would modify the window structure, " "``False`` otherwise." msgstr "" -#: ../../library/curses.rst:319 +#: ../../library/curses.rst:321 msgid "" "Return ``True`` if :func:`endwin` has been called (that is, the curses " "library has been deinitialized)." msgstr "" -#: ../../library/curses.rst:325 +#: ../../library/curses.rst:327 msgid "" "Return the name of the key numbered *k* as a bytes object. The name of a " "key generating printable ASCII character is the key's character. The name " @@ -392,27 +396,27 @@ msgid "" "character." msgstr "" -#: ../../library/curses.rst:335 +#: ../../library/curses.rst:337 msgid "" "Return the user's current line kill character as a one-byte bytes object. " "Under Unix operating systems this is a property of the controlling tty of " "the curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:342 +#: ../../library/curses.rst:344 msgid "" "Return a bytes object containing the terminfo long name field describing the " "current terminal. The maximum length of a verbose description is 128 " "characters. It is defined only after the call to :func:`initscr`." msgstr "" -#: ../../library/curses.rst:349 +#: ../../library/curses.rst:351 msgid "" "If *flag* is ``True``, allow 8-bit characters to be input. If *flag* is " "``False``, allow only 7-bit chars." msgstr "" -#: ../../library/curses.rst:355 +#: ../../library/curses.rst:357 msgid "" "Set the maximum time in milliseconds that can elapse between press and " "release events in order for them to be recognized as a click, and return the " @@ -420,7 +424,7 @@ msgid "" "fifth of a second." msgstr "" -#: ../../library/curses.rst:362 +#: ../../library/curses.rst:364 msgid "" "Set the mouse events to be reported, and return a tuple ``(availmask, " "oldmask)``. *availmask* indicates which of the specified mouse events can " @@ -429,17 +433,17 @@ msgid "" "never called, no mouse events are ever reported." msgstr "" -#: ../../library/curses.rst:371 +#: ../../library/curses.rst:373 msgid "Sleep for *ms* milliseconds." msgstr "" -#: ../../library/curses.rst:376 +#: ../../library/curses.rst:378 msgid "" "Create and return a pointer to a new pad data structure with the given " "number of lines and columns. Return a pad as a window object." msgstr "" -#: ../../library/curses.rst:379 +#: ../../library/curses.rst:381 msgid "" "A pad is like a window, except that it is not restricted by the screen size, " "and is not necessarily associated with a particular part of the screen. " @@ -455,35 +459,35 @@ msgid "" "to be displayed." msgstr "" -#: ../../library/curses.rst:395 +#: ../../library/curses.rst:397 msgid "" "Return a new :ref:`window `, whose left-upper corner " "is at ``(begin_y, begin_x)``, and whose height/width is *nlines*/*ncols*." msgstr "" -#: ../../library/curses.rst:398 +#: ../../library/curses.rst:400 msgid "" "By default, the window will extend from the specified position to the lower " "right corner of the screen." msgstr "" -#: ../../library/curses.rst:404 +#: ../../library/curses.rst:406 msgid "" "Enter newline mode. This mode translates the return key into newline on " "input, and translates newline into return and line-feed on output. Newline " "mode is initially on." msgstr "" -#: ../../library/curses.rst:411 +#: ../../library/curses.rst:413 msgid "" "Leave cbreak mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: ../../library/curses.rst:416 +#: ../../library/curses.rst:418 msgid "Leave echo mode. Echoing of input characters is turned off." msgstr "" -#: ../../library/curses.rst:421 +#: ../../library/curses.rst:423 msgid "" "Leave newline mode. Disable translation of return into newline on input, " "and disable low-level translation of newline into newline/return on output " @@ -493,7 +497,7 @@ msgid "" "also, it will be able to detect the return key on input." msgstr "" -#: ../../library/curses.rst:431 +#: ../../library/curses.rst:433 msgid "" "When the :func:`!noqiflush` routine is used, normal flush of input and " "output queues associated with the ``INTR``, ``QUIT`` and ``SUSP`` characters " @@ -502,63 +506,63 @@ msgid "" "occurred, after the handler exits." msgstr "" -#: ../../library/curses.rst:439 +#: ../../library/curses.rst:441 msgid "Leave raw mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: ../../library/curses.rst:444 +#: ../../library/curses.rst:446 msgid "" "Return a tuple ``(fg, bg)`` containing the colors for the requested color " "pair. The value of *pair_number* must be between ``0`` and ``COLOR_PAIRS - " "1``." msgstr "" -#: ../../library/curses.rst:450 +#: ../../library/curses.rst:452 msgid "" "Return the number of the color-pair set by the attribute value *attr*. :func:" "`color_pair` is the counterpart to this function." msgstr "" -#: ../../library/curses.rst:456 +#: ../../library/curses.rst:458 msgid "" "Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " "terminfo capability for the current terminal. Note that the output of :func:" "`putp` always goes to standard output." msgstr "" -#: ../../library/curses.rst:463 +#: ../../library/curses.rst:465 msgid "" "If *flag* is ``False``, the effect is the same as calling :func:`noqiflush`. " "If *flag* is ``True``, or no argument is provided, the queues will be " "flushed when these control characters are read." msgstr "" -#: ../../library/curses.rst:470 +#: ../../library/curses.rst:472 msgid "" "Enter raw mode. In raw mode, normal line buffering and processing of " "interrupt, quit, suspend, and flow control keys are turned off; characters " "are presented to curses input functions one by one." msgstr "" -#: ../../library/curses.rst:477 +#: ../../library/curses.rst:479 msgid "" "Restore the terminal to \"program\" mode, as previously saved by :func:" "`def_prog_mode`." msgstr "" -#: ../../library/curses.rst:483 +#: ../../library/curses.rst:485 msgid "" "Restore the terminal to \"shell\" mode, as previously saved by :func:" "`def_shell_mode`." msgstr "" -#: ../../library/curses.rst:489 +#: ../../library/curses.rst:491 msgid "" "Restore the state of the terminal modes to what it was at the last call to :" "func:`savetty`." msgstr "" -#: ../../library/curses.rst:495 +#: ../../library/curses.rst:497 msgid "" "Backend function used by :func:`resizeterm`, performing most of the work; " "when resizing the windows, :func:`resize_term` blank-fills the areas that " @@ -568,47 +572,47 @@ msgid "" "to resize these without additional interaction with the application." msgstr "" -#: ../../library/curses.rst:505 +#: ../../library/curses.rst:507 msgid "" "Resize the standard and current windows to the specified dimensions, and " "adjusts other bookkeeping data used by the curses library that record the " "window dimensions (in particular the SIGWINCH handler)." msgstr "" -#: ../../library/curses.rst:512 +#: ../../library/curses.rst:514 msgid "" "Save the current state of the terminal modes in a buffer, usable by :func:" "`resetty`." msgstr "" -#: ../../library/curses.rst:517 +#: ../../library/curses.rst:519 msgid "Retrieves the value set by :func:`set_escdelay`." msgstr "" -#: ../../library/curses.rst:523 +#: ../../library/curses.rst:525 msgid "" "Sets the number of milliseconds to wait after reading an escape character, " "to distinguish between an individual escape character entered on the " "keyboard from escape sequences sent by cursor and function keys." msgstr "" -#: ../../library/curses.rst:531 +#: ../../library/curses.rst:533 msgid "Retrieves the value set by :func:`set_tabsize`." msgstr "" -#: ../../library/curses.rst:537 +#: ../../library/curses.rst:539 msgid "" "Sets the number of columns used by the curses library when converting a tab " "character to spaces as it adds the tab to a window." msgstr "" -#: ../../library/curses.rst:544 +#: ../../library/curses.rst:546 msgid "" "Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " "then :meth:`leaveok ` is set ``True``." msgstr "" -#: ../../library/curses.rst:550 +#: ../../library/curses.rst:552 msgid "" "Initialize the terminal. *term* is a string giving the terminal name, or " "``None``; if omitted or ``None``, the value of the :envvar:`TERM` " @@ -617,14 +621,14 @@ msgid "" "descriptor for ``sys.stdout`` will be used." msgstr "" -#: ../../library/curses.rst:559 +#: ../../library/curses.rst:561 msgid "" "Must be called if the programmer wants to use colors, and before any other " "color manipulation routine is called. It is good practice to call this " "routine right after :func:`initscr`." msgstr "" -#: ../../library/curses.rst:563 +#: ../../library/curses.rst:565 msgid "" ":func:`start_color` initializes eight basic colors (black, red, green, " "yellow, blue, magenta, cyan, and white), and two global variables in the :" @@ -634,20 +638,20 @@ msgid "" "terminal was just turned on." msgstr "" -#: ../../library/curses.rst:572 +#: ../../library/curses.rst:574 msgid "" "Return a logical OR of all video attributes supported by the terminal. This " "information is useful when a curses program needs complete control over the " "appearance of the screen." msgstr "" -#: ../../library/curses.rst:579 +#: ../../library/curses.rst:581 msgid "" "Return the value of the environment variable :envvar:`TERM`, as a bytes " "object, truncated to 14 characters." msgstr "" -#: ../../library/curses.rst:585 +#: ../../library/curses.rst:587 msgid "" "Return the value of the Boolean capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-1`` if " @@ -655,7 +659,7 @@ msgid "" "from the terminal description." msgstr "" -#: ../../library/curses.rst:593 +#: ../../library/curses.rst:595 msgid "" "Return the value of the numeric capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-2`` if " @@ -663,7 +667,7 @@ msgid "" "from the terminal description." msgstr "" -#: ../../library/curses.rst:601 +#: ../../library/curses.rst:603 msgid "" "Return the value of the string capability corresponding to the terminfo " "capability name *capname* as a bytes object. Return ``None`` if *capname* " @@ -671,7 +675,7 @@ msgid "" "terminal description." msgstr "" -#: ../../library/curses.rst:609 +#: ../../library/curses.rst:611 msgid "" "Instantiate the bytes object *str* with the supplied parameters, where *str* " "should be a parameterized string obtained from the terminfo database. E.g. " @@ -679,13 +683,13 @@ msgid "" "exact result depending on terminal type." msgstr "" -#: ../../library/curses.rst:617 +#: ../../library/curses.rst:619 msgid "" "Specify that the file descriptor *fd* be used for typeahead checking. If " "*fd* is ``-1``, then no typeahead checking is done." msgstr "" -#: ../../library/curses.rst:620 +#: ../../library/curses.rst:622 msgid "" "The curses library does \"line-breakout optimization\" by looking for " "typeahead periodically while updating the screen. If input is found, and it " @@ -695,7 +699,7 @@ msgid "" "typeahead checking." msgstr "" -#: ../../library/curses.rst:629 +#: ../../library/curses.rst:631 msgid "" "Return a bytes object which is a printable representation of the character " "*ch*. Control characters are represented as a caret followed by the " @@ -703,35 +707,35 @@ msgid "" "are." msgstr "" -#: ../../library/curses.rst:636 +#: ../../library/curses.rst:638 msgid "Push *ch* so the next :meth:`~window.getch` will return it." msgstr "" -#: ../../library/curses.rst:640 +#: ../../library/curses.rst:642 msgid "Only one *ch* can be pushed before :meth:`!getch` is called." msgstr "" -#: ../../library/curses.rst:645 +#: ../../library/curses.rst:647 msgid "" "Update :envvar:`LINES` and :envvar:`COLS`. Useful for detecting manual " "screen resize." msgstr "" -#: ../../library/curses.rst:652 +#: ../../library/curses.rst:654 msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." msgstr "" -#: ../../library/curses.rst:656 +#: ../../library/curses.rst:658 msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." msgstr "" -#: ../../library/curses.rst:663 +#: ../../library/curses.rst:665 msgid "" "Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " "state data with it." msgstr "" -#: ../../library/curses.rst:669 +#: ../../library/curses.rst:671 msgid "" "If used, this function should be called before :func:`initscr` or newterm " "are called. When *flag* is ``False``, the values of lines and columns " @@ -741,7 +745,7 @@ msgid "" "to use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." msgstr "" -#: ../../library/curses.rst:679 +#: ../../library/curses.rst:681 msgid "" "Allow use of default values for colors on terminals supporting this feature. " "Use this to support transparency in your application. The default color is " @@ -750,7 +754,7 @@ msgid "" "*x* to a red foreground color on the default background." msgstr "" -#: ../../library/curses.rst:688 +#: ../../library/curses.rst:690 msgid "" "Initialize curses and call another callable object, *func*, which should be " "the rest of your curses-using application. If the application raises an " @@ -764,50 +768,50 @@ msgid "" "echo, and disables the terminal keypad." msgstr "" -#: ../../library/curses.rst:702 +#: ../../library/curses.rst:704 msgid "Window Objects" msgstr "" -#: ../../library/curses.rst:704 +#: ../../library/curses.rst:706 msgid "" "Window objects, as returned by :func:`initscr` and :func:`newwin` above, " "have the following methods and attributes:" msgstr "" -#: ../../library/curses.rst:711 +#: ../../library/curses.rst:713 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " "character previously painted at that location. By default, the character " "position and attributes are the current settings for the window object." msgstr "" -#: ../../library/curses.rst:717 +#: ../../library/curses.rst:719 msgid "" "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" -#: ../../library/curses.rst:725 +#: ../../library/curses.rst:727 msgid "" "Paint at most *n* characters of the character string *str* at ``(y, x)`` " "with attributes *attr*, overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:733 +#: ../../library/curses.rst:735 msgid "" "Paint the character string *str* at ``(y, x)`` with attributes *attr*, " "overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:738 +#: ../../library/curses.rst:740 msgid "" "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" -#: ../../library/curses.rst:742 +#: ../../library/curses.rst:744 msgid "" "A `bug in ncurses `_, the backend for " "this Python module, can cause SegFaults when resizing windows. This is fixed " @@ -817,44 +821,44 @@ msgid "" "line." msgstr "" -#: ../../library/curses.rst:752 +#: ../../library/curses.rst:754 msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:758 +#: ../../library/curses.rst:760 msgid "" "Add attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:764 +#: ../../library/curses.rst:766 msgid "" "Set the \"background\" set of attributes to *attr*. This set is initially " "``0`` (no attributes)." msgstr "" -#: ../../library/curses.rst:770 +#: ../../library/curses.rst:772 msgid "" "Set the background property of the window to the character *ch*, with " "attributes *attr*. The change is then applied to every character position " "in that window:" msgstr "" -#: ../../library/curses.rst:774 +#: ../../library/curses.rst:776 msgid "" "The attribute of every character in the window is changed to the new " "background attribute." msgstr "" -#: ../../library/curses.rst:777 +#: ../../library/curses.rst:779 msgid "" "Wherever the former background character appears, it is changed to the new " "background character." msgstr "" -#: ../../library/curses.rst:783 +#: ../../library/curses.rst:785 msgid "" "Set the window's background. A window's background consists of a character " "and any combination of attributes. The attribute part of the background is " @@ -865,128 +869,128 @@ msgid "" "delete line/character operations." msgstr "" -#: ../../library/curses.rst:793 +#: ../../library/curses.rst:795 msgid "" "Draw a border around the edges of the window. Each parameter specifies the " "character to use for a specific part of the border; see the table below for " "more details." msgstr "" -#: ../../library/curses.rst:799 +#: ../../library/curses.rst:801 msgid "" "A ``0`` value for any parameter will cause the default character to be used " "for that parameter. Keyword parameters can *not* be used. The defaults are " "listed in this table:" msgstr "" -#: ../../library/curses.rst:804 +#: ../../library/curses.rst:806 msgid "Parameter" msgstr "參數" -#: ../../library/curses.rst:804 +#: ../../library/curses.rst:806 msgid "Description" msgstr "描述" -#: ../../library/curses.rst:804 +#: ../../library/curses.rst:806 msgid "Default value" msgstr "" -#: ../../library/curses.rst:806 +#: ../../library/curses.rst:808 msgid "*ls*" msgstr "*ls*" -#: ../../library/curses.rst:806 +#: ../../library/curses.rst:808 msgid "Left side" msgstr "" -#: ../../library/curses.rst:806 ../../library/curses.rst:808 +#: ../../library/curses.rst:808 ../../library/curses.rst:810 msgid ":const:`ACS_VLINE`" msgstr ":const:`ACS_VLINE`" -#: ../../library/curses.rst:808 +#: ../../library/curses.rst:810 msgid "*rs*" msgstr "*rs*" -#: ../../library/curses.rst:808 +#: ../../library/curses.rst:810 msgid "Right side" msgstr "" -#: ../../library/curses.rst:810 +#: ../../library/curses.rst:812 msgid "*ts*" msgstr "*ts*" -#: ../../library/curses.rst:810 +#: ../../library/curses.rst:812 msgid "Top" msgstr "" -#: ../../library/curses.rst:810 ../../library/curses.rst:812 +#: ../../library/curses.rst:812 ../../library/curses.rst:814 msgid ":const:`ACS_HLINE`" msgstr ":const:`ACS_HLINE`" -#: ../../library/curses.rst:812 +#: ../../library/curses.rst:814 msgid "*bs*" msgstr "*bs*" -#: ../../library/curses.rst:812 +#: ../../library/curses.rst:814 msgid "Bottom" msgstr "" -#: ../../library/curses.rst:814 +#: ../../library/curses.rst:816 msgid "*tl*" msgstr "*tl*" -#: ../../library/curses.rst:814 +#: ../../library/curses.rst:816 msgid "Upper-left corner" msgstr "" -#: ../../library/curses.rst:814 +#: ../../library/curses.rst:816 msgid ":const:`ACS_ULCORNER`" msgstr ":const:`ACS_ULCORNER`" -#: ../../library/curses.rst:816 +#: ../../library/curses.rst:818 msgid "*tr*" msgstr "*tr*" -#: ../../library/curses.rst:816 +#: ../../library/curses.rst:818 msgid "Upper-right corner" msgstr "" -#: ../../library/curses.rst:816 +#: ../../library/curses.rst:818 msgid ":const:`ACS_URCORNER`" msgstr ":const:`ACS_URCORNER`" -#: ../../library/curses.rst:818 +#: ../../library/curses.rst:820 msgid "*bl*" msgstr "*bl*" -#: ../../library/curses.rst:818 +#: ../../library/curses.rst:820 msgid "Bottom-left corner" msgstr "" -#: ../../library/curses.rst:818 +#: ../../library/curses.rst:820 msgid ":const:`ACS_LLCORNER`" msgstr ":const:`ACS_LLCORNER`" -#: ../../library/curses.rst:820 +#: ../../library/curses.rst:822 msgid "*br*" msgstr "*br*" -#: ../../library/curses.rst:820 +#: ../../library/curses.rst:822 msgid "Bottom-right corner" msgstr "" -#: ../../library/curses.rst:820 +#: ../../library/curses.rst:822 msgid ":const:`ACS_LRCORNER`" msgstr ":const:`ACS_LRCORNER`" -#: ../../library/curses.rst:826 +#: ../../library/curses.rst:828 msgid "" "Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " "and *bs* are *horch*. The default corner characters are always used by this " "function." msgstr "" -#: ../../library/curses.rst:835 +#: ../../library/curses.rst:837 msgid "" "Set the attributes of *num* characters at the current cursor position, or at " "position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " @@ -996,45 +1000,45 @@ msgid "" "be redisplayed by the next window refresh." msgstr "" -#: ../../library/curses.rst:845 +#: ../../library/curses.rst:847 msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " "next call to :meth:`refresh`." msgstr "" -#: ../../library/curses.rst:851 +#: ../../library/curses.rst:853 msgid "" "If *flag* is ``True``, the next call to :meth:`refresh` will clear the " "window completely." msgstr "" -#: ../../library/curses.rst:857 +#: ../../library/curses.rst:859 msgid "" "Erase from cursor to the end of the window: all lines below the cursor are " "deleted, and then the equivalent of :meth:`clrtoeol` is performed." msgstr "" -#: ../../library/curses.rst:863 +#: ../../library/curses.rst:865 msgid "Erase from cursor to the end of the line." msgstr "" -#: ../../library/curses.rst:868 +#: ../../library/curses.rst:870 msgid "" "Update the current cursor position of all the ancestors of the window to " "reflect the current cursor position of the window." msgstr "" -#: ../../library/curses.rst:874 +#: ../../library/curses.rst:876 msgid "Delete any character at ``(y, x)``." msgstr "" -#: ../../library/curses.rst:879 +#: ../../library/curses.rst:881 msgid "" "Delete the line under the cursor. All following lines are moved up by one " "line." msgstr "" -#: ../../library/curses.rst:885 +#: ../../library/curses.rst:887 msgid "" "An abbreviation for \"derive window\", :meth:`derwin` is the same as " "calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " @@ -1042,13 +1046,13 @@ msgid "" "a window object for the derived window." msgstr "" -#: ../../library/curses.rst:893 +#: ../../library/curses.rst:895 msgid "" "Add character *ch* with attribute *attr*, and immediately call :meth:" "`refresh` on the window." msgstr "" -#: ../../library/curses.rst:899 +#: ../../library/curses.rst:901 msgid "" "Test whether the given pair of screen-relative character-cell coordinates " "are enclosed by the given window, returning ``True`` or ``False``. It is " @@ -1056,11 +1060,11 @@ msgid "" "location of a mouse event." msgstr "" -#: ../../library/curses.rst:904 +#: ../../library/curses.rst:906 msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." msgstr "" -#: ../../library/curses.rst:910 +#: ../../library/curses.rst:912 msgid "" "Encoding used to encode method arguments (Unicode strings and characters). " "The encoding attribute is inherited from the parent window when a subwindow " @@ -1068,19 +1072,19 @@ msgid "" "locale encoding is used (see :func:`locale.getencoding`)." msgstr "" -#: ../../library/curses.rst:920 +#: ../../library/curses.rst:922 msgid "Clear the window." msgstr "" -#: ../../library/curses.rst:925 +#: ../../library/curses.rst:927 msgid "Return a tuple ``(y, x)`` of co-ordinates of upper-left corner." msgstr "" -#: ../../library/curses.rst:930 +#: ../../library/curses.rst:932 msgid "Return the given window's current background character/attribute pair." msgstr "" -#: ../../library/curses.rst:935 +#: ../../library/curses.rst:937 msgid "" "Get a character. Note that the integer returned does *not* have to be in " "ASCII range: function keys, keypad keys and so on are represented by numbers " @@ -1088,14 +1092,14 @@ msgid "" "otherwise wait until a key is pressed." msgstr "" -#: ../../library/curses.rst:943 +#: ../../library/curses.rst:945 msgid "" "Get a wide character. Return a character for most keys, or an integer for " "function keys, keypad keys, and other special keys. In no-delay mode, raise " "an exception if there is no input." msgstr "" -#: ../../library/curses.rst:952 +#: ../../library/curses.rst:954 msgid "" "Get a character, returning a string instead of an integer, as :meth:`getch` " "does. Function keys, keypad keys and other special keys return a multibyte " @@ -1103,35 +1107,35 @@ msgid "" "there is no input." msgstr "" -#: ../../library/curses.rst:960 +#: ../../library/curses.rst:962 msgid "Return a tuple ``(y, x)`` of the height and width of the window." msgstr "" -#: ../../library/curses.rst:965 +#: ../../library/curses.rst:967 msgid "" "Return the beginning coordinates of this window relative to its parent " "window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no " "parent." msgstr "" -#: ../../library/curses.rst:975 +#: ../../library/curses.rst:977 msgid "" "Read a bytes object from the user, with primitive line editing capacity." msgstr "" -#: ../../library/curses.rst:980 +#: ../../library/curses.rst:982 msgid "" "Return a tuple ``(y, x)`` of current cursor position relative to the " "window's upper-left corner." msgstr "" -#: ../../library/curses.rst:987 +#: ../../library/curses.rst:989 msgid "" "Display a horizontal line starting at ``(y, x)`` with length *n* consisting " "of the character *ch*." msgstr "" -#: ../../library/curses.rst:993 +#: ../../library/curses.rst:995 msgid "" "If *flag* is ``False``, curses no longer considers using the hardware insert/" "delete character feature of the terminal; if *flag* is ``True``, use of " @@ -1139,13 +1143,13 @@ msgid "" "initialized, use of character insert/delete is enabled by default." msgstr "" -#: ../../library/curses.rst:1001 +#: ../../library/curses.rst:1003 msgid "" "If *flag* is ``True``, :mod:`curses` will try and use hardware line editing " "facilities. Otherwise, line insertion/deletion are disabled." msgstr "" -#: ../../library/curses.rst:1007 +#: ../../library/curses.rst:1009 msgid "" "If *flag* is ``True``, any change in the window image automatically causes " "the window to be refreshed; you no longer have to call :meth:`refresh` " @@ -1153,19 +1157,19 @@ msgid "" "calls to wrefresh. This option is disabled by default." msgstr "" -#: ../../library/curses.rst:1015 +#: ../../library/curses.rst:1017 msgid "" "Return the character at the given position in the window. The bottom 8 bits " "are the character proper, and upper bits are the attributes." msgstr "" -#: ../../library/curses.rst:1022 +#: ../../library/curses.rst:1024 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line " "from position *x* right by one character." msgstr "" -#: ../../library/curses.rst:1028 +#: ../../library/curses.rst:1030 msgid "" "Insert *nlines* lines into the specified window above the current line. The " "*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " @@ -1174,13 +1178,13 @@ msgid "" "remains the same." msgstr "" -#: ../../library/curses.rst:1037 +#: ../../library/curses.rst:1039 msgid "" "Insert a blank line under the cursor. All following lines are moved down by " "one line." msgstr "" -#: ../../library/curses.rst:1044 +#: ../../library/curses.rst:1046 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor, up to *n* characters. If *n* is " @@ -1190,7 +1194,7 @@ msgid "" "if specified)." msgstr "" -#: ../../library/curses.rst:1054 +#: ../../library/curses.rst:1056 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor. All characters to the right of the " @@ -1199,7 +1203,7 @@ msgid "" "specified)." msgstr "" -#: ../../library/curses.rst:1063 +#: ../../library/curses.rst:1065 msgid "" "Return a bytes object of characters, extracted from the window starting at " "the current cursor position, or at *y*, *x* if specified. Attributes are " @@ -1207,76 +1211,76 @@ msgid "" "string at most *n* characters long (exclusive of the trailing NUL)." msgstr "" -#: ../../library/curses.rst:1071 +#: ../../library/curses.rst:1073 msgid "" "Return ``True`` if the specified line was modified since the last call to :" "meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " "exception if *line* is not valid for the given window." msgstr "" -#: ../../library/curses.rst:1078 +#: ../../library/curses.rst:1080 msgid "" "Return ``True`` if the specified window was modified since the last call to :" "meth:`refresh`; otherwise return ``False``." msgstr "" -#: ../../library/curses.rst:1084 +#: ../../library/curses.rst:1086 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " "function keys) will be interpreted by :mod:`curses`. If *flag* is ``False``, " "escape sequences will be left as is in the input stream." msgstr "" -#: ../../library/curses.rst:1091 +#: ../../library/curses.rst:1093 msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " "being at \"cursor position.\" This reduces cursor movement where possible. " "If possible the cursor will be made invisible." msgstr "" -#: ../../library/curses.rst:1095 +#: ../../library/curses.rst:1097 msgid "" "If *flag* is ``False``, cursor will always be at \"cursor position\" after " "an update." msgstr "" -#: ../../library/curses.rst:1100 +#: ../../library/curses.rst:1102 msgid "Move cursor to ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1105 +#: ../../library/curses.rst:1107 msgid "" "Move the window inside its parent window. The screen-relative parameters of " "the window are not changed. This routine is used to display different parts " "of the parent window at the same physical position on the screen." msgstr "" -#: ../../library/curses.rst:1112 +#: ../../library/curses.rst:1114 msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1117 +#: ../../library/curses.rst:1119 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." msgstr "" -#: ../../library/curses.rst:1122 +#: ../../library/curses.rst:1124 msgid "If *flag* is ``True``, escape sequences will not be timed out." msgstr "" -#: ../../library/curses.rst:1124 +#: ../../library/curses.rst:1126 msgid "" "If *flag* is ``False``, after a few milliseconds, an escape sequence will " "not be interpreted, and will be left in the input stream as is." msgstr "" -#: ../../library/curses.rst:1130 +#: ../../library/curses.rst:1132 msgid "" "Mark for refresh but wait. This function updates the data structure " "representing the desired state of the window, but does not force an update " "of the physical screen. To accomplish that, call :func:`doupdate`." msgstr "" -#: ../../library/curses.rst:1137 +#: ../../library/curses.rst:1139 msgid "" "Overlay the window on top of *destwin*. The windows need not be the same " "size, only the overlapping region is copied. This copy is non-destructive, " @@ -1284,7 +1288,7 @@ msgid "" "contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1142 +#: ../../library/curses.rst:1144 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overlay` can be used. *sminrow* and *smincol* are the upper-left " @@ -1292,7 +1296,7 @@ msgid "" "in the destination window." msgstr "" -#: ../../library/curses.rst:1150 +#: ../../library/curses.rst:1152 msgid "" "Overwrite the window on top of *destwin*. The windows need not be the same " "size, in which case only the overlapping region is copied. This copy is " @@ -1300,7 +1304,7 @@ msgid "" "the old contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1155 +#: ../../library/curses.rst:1157 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overwrite` can be used. *sminrow* and *smincol* are the upper-left " @@ -1308,31 +1312,31 @@ msgid "" "the destination window." msgstr "" -#: ../../library/curses.rst:1163 +#: ../../library/curses.rst:1165 msgid "" "Write all data associated with the window into the provided file object. " "This information can be later retrieved using the :func:`getwin` function." msgstr "" -#: ../../library/curses.rst:1169 +#: ../../library/curses.rst:1171 msgid "" "Indicate that the *num* screen lines, starting at line *beg*, are corrupted " "and should be completely redrawn on the next :meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1175 +#: ../../library/curses.rst:1177 msgid "" "Touch the entire window, causing it to be completely redrawn on the next :" "meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1181 +#: ../../library/curses.rst:1183 msgid "" "Update the display immediately (sync actual screen with previous drawing/" "deleting methods)." msgstr "" -#: ../../library/curses.rst:1184 +#: ../../library/curses.rst:1186 msgid "" "The 6 optional arguments can only be specified when the window is a pad " "created with :func:`newpad`. The additional parameters are needed to " @@ -1347,7 +1351,7 @@ msgid "" "*smincol* are treated as if they were zero." msgstr "" -#: ../../library/curses.rst:1198 +#: ../../library/curses.rst:1200 msgid "" "Reallocate storage for a curses window to adjust its dimensions to the " "specified values. If either dimension is larger than the current values, " @@ -1355,11 +1359,11 @@ msgid "" "rendition (as set by :meth:`bkgdset`) merged into them." msgstr "" -#: ../../library/curses.rst:1206 +#: ../../library/curses.rst:1208 msgid "Scroll the screen or scrolling region upward by *lines* lines." msgstr "" -#: ../../library/curses.rst:1211 +#: ../../library/curses.rst:1213 msgid "" "Control what happens when the cursor of a window is moved off the edge of " "the window or scrolling region, either as a result of a newline action on " @@ -1369,54 +1373,54 @@ msgid "" "scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." msgstr "" -#: ../../library/curses.rst:1221 +#: ../../library/curses.rst:1223 msgid "" "Set the scrolling region from line *top* to line *bottom*. All scrolling " "actions will take place in this region." msgstr "" -#: ../../library/curses.rst:1227 +#: ../../library/curses.rst:1229 msgid "" "Turn off the standout attribute. On some terminals this has the side effect " "of turning off all attributes." msgstr "" -#: ../../library/curses.rst:1233 +#: ../../library/curses.rst:1235 msgid "Turn on attribute *A_STANDOUT*." msgstr "" -#: ../../library/curses.rst:1239 ../../library/curses.rst:1246 +#: ../../library/curses.rst:1241 ../../library/curses.rst:1248 msgid "" "Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, " "and whose width/height is *ncols*/*nlines*." msgstr "" -#: ../../library/curses.rst:1249 +#: ../../library/curses.rst:1251 msgid "" "By default, the sub-window will extend from the specified position to the " "lower right corner of the window." msgstr "" -#: ../../library/curses.rst:1255 +#: ../../library/curses.rst:1257 msgid "" "Touch each location in the window that has been touched in any of its " "ancestor windows. This routine is called by :meth:`refresh`, so it should " "almost never be necessary to call it manually." msgstr "" -#: ../../library/curses.rst:1262 +#: ../../library/curses.rst:1264 msgid "" "If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " "there is a change in the window." msgstr "" -#: ../../library/curses.rst:1268 +#: ../../library/curses.rst:1270 msgid "" "Touch all locations in ancestors of the window that have been changed in " "the window." msgstr "" -#: ../../library/curses.rst:1274 +#: ../../library/curses.rst:1276 msgid "" "Set blocking or non-blocking read behavior for the window. If *delay* is " "negative, blocking read is used (which will wait indefinitely for input). " @@ -1426,7 +1430,7 @@ msgid "" "still no input at the end of that time." msgstr "" -#: ../../library/curses.rst:1284 +#: ../../library/curses.rst:1286 msgid "" "Pretend *count* lines have been changed, starting with line *start*. If " "*changed* is supplied, it specifies whether the affected lines are marked as " @@ -1434,51 +1438,51 @@ msgid "" "``=False``)." msgstr "" -#: ../../library/curses.rst:1291 +#: ../../library/curses.rst:1293 msgid "" "Pretend the whole window has been changed, for purposes of drawing " "optimizations." msgstr "" -#: ../../library/curses.rst:1297 +#: ../../library/curses.rst:1299 msgid "" "Mark all lines in the window as unchanged since the last call to :meth:" "`refresh`." msgstr "" -#: ../../library/curses.rst:1304 +#: ../../library/curses.rst:1306 msgid "" "Display a vertical line starting at ``(y, x)`` with length *n* consisting of " "the character *ch*." msgstr "" -#: ../../library/curses.rst:1309 +#: ../../library/curses.rst:1311 msgid "Constants" msgstr "" -#: ../../library/curses.rst:1311 +#: ../../library/curses.rst:1313 msgid "The :mod:`curses` module defines the following data members:" msgstr "" -#: ../../library/curses.rst:1316 +#: ../../library/curses.rst:1318 msgid "" "Some curses routines that return an integer, such as :meth:`~window." "getch`, return :const:`ERR` upon failure." msgstr "" -#: ../../library/curses.rst:1322 +#: ../../library/curses.rst:1324 msgid "" "Some curses routines that return an integer, such as :func:`napms`, " "return :const:`OK` upon success." msgstr "" -#: ../../library/curses.rst:1328 +#: ../../library/curses.rst:1330 msgid "" "A bytes object representing the current version of the module. Also " "available as :const:`__version__`." msgstr "" -#: ../../library/curses.rst:1334 +#: ../../library/curses.rst:1336 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " @@ -1486,966 +1490,966 @@ msgid "" "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" -#: ../../library/curses.rst:1339 +#: ../../library/curses.rst:1341 msgid "Availability: if the ncurses library is used." msgstr "" -#: ../../library/curses.rst:1344 +#: ../../library/curses.rst:1346 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: ../../library/curses.rst:1348 +#: ../../library/curses.rst:1350 msgid "Attribute" msgstr "" -#: ../../library/curses.rst:1348 ../../library/curses.rst:1396 -#: ../../library/curses.rst:1640 +#: ../../library/curses.rst:1350 ../../library/curses.rst:1398 +#: ../../library/curses.rst:1642 msgid "Meaning" msgstr "" -#: ../../library/curses.rst:1350 +#: ../../library/curses.rst:1352 msgid "``A_ALTCHARSET``" msgstr "``A_ALTCHARSET``" -#: ../../library/curses.rst:1350 +#: ../../library/curses.rst:1352 msgid "Alternate character set mode" msgstr "" -#: ../../library/curses.rst:1352 +#: ../../library/curses.rst:1354 msgid "``A_BLINK``" msgstr "``A_BLINK``" -#: ../../library/curses.rst:1352 +#: ../../library/curses.rst:1354 msgid "Blink mode" msgstr "" -#: ../../library/curses.rst:1354 +#: ../../library/curses.rst:1356 msgid "``A_BOLD``" msgstr "``A_BOLD``" -#: ../../library/curses.rst:1354 +#: ../../library/curses.rst:1356 msgid "Bold mode" msgstr "" -#: ../../library/curses.rst:1356 +#: ../../library/curses.rst:1358 msgid "``A_DIM``" msgstr "``A_DIM``" -#: ../../library/curses.rst:1356 +#: ../../library/curses.rst:1358 msgid "Dim mode" msgstr "" -#: ../../library/curses.rst:1358 +#: ../../library/curses.rst:1360 msgid "``A_INVIS``" msgstr "``A_INVIS``" -#: ../../library/curses.rst:1358 +#: ../../library/curses.rst:1360 msgid "Invisible or blank mode" msgstr "" -#: ../../library/curses.rst:1360 +#: ../../library/curses.rst:1362 msgid "``A_ITALIC``" msgstr "``A_ITALIC``" -#: ../../library/curses.rst:1360 +#: ../../library/curses.rst:1362 msgid "Italic mode" msgstr "" -#: ../../library/curses.rst:1362 +#: ../../library/curses.rst:1364 msgid "``A_NORMAL``" msgstr "``A_NORMAL``" -#: ../../library/curses.rst:1362 +#: ../../library/curses.rst:1364 msgid "Normal attribute" msgstr "" -#: ../../library/curses.rst:1364 +#: ../../library/curses.rst:1366 msgid "``A_PROTECT``" msgstr "``A_PROTECT``" -#: ../../library/curses.rst:1364 +#: ../../library/curses.rst:1366 msgid "Protected mode" msgstr "" -#: ../../library/curses.rst:1366 +#: ../../library/curses.rst:1368 msgid "``A_REVERSE``" msgstr "``A_REVERSE``" -#: ../../library/curses.rst:1366 +#: ../../library/curses.rst:1368 msgid "Reverse background and foreground colors" msgstr "" -#: ../../library/curses.rst:1369 +#: ../../library/curses.rst:1371 msgid "``A_STANDOUT``" msgstr "``A_STANDOUT``" -#: ../../library/curses.rst:1369 +#: ../../library/curses.rst:1371 msgid "Standout mode" msgstr "" -#: ../../library/curses.rst:1371 +#: ../../library/curses.rst:1373 msgid "``A_UNDERLINE``" msgstr "``A_UNDERLINE``" -#: ../../library/curses.rst:1371 +#: ../../library/curses.rst:1373 msgid "Underline mode" msgstr "" -#: ../../library/curses.rst:1373 +#: ../../library/curses.rst:1375 msgid "``A_HORIZONTAL``" msgstr "``A_HORIZONTAL``" -#: ../../library/curses.rst:1373 +#: ../../library/curses.rst:1375 msgid "Horizontal highlight" msgstr "" -#: ../../library/curses.rst:1375 +#: ../../library/curses.rst:1377 msgid "``A_LEFT``" msgstr "``A_LEFT``" -#: ../../library/curses.rst:1375 +#: ../../library/curses.rst:1377 msgid "Left highlight" msgstr "" -#: ../../library/curses.rst:1377 +#: ../../library/curses.rst:1379 msgid "``A_LOW``" msgstr "``A_LOW``" -#: ../../library/curses.rst:1377 +#: ../../library/curses.rst:1379 msgid "Low highlight" msgstr "" -#: ../../library/curses.rst:1379 +#: ../../library/curses.rst:1381 msgid "``A_RIGHT``" msgstr "``A_RIGHT``" -#: ../../library/curses.rst:1379 +#: ../../library/curses.rst:1381 msgid "Right highlight" msgstr "" -#: ../../library/curses.rst:1381 +#: ../../library/curses.rst:1383 msgid "``A_TOP``" msgstr "``A_TOP``" -#: ../../library/curses.rst:1381 +#: ../../library/curses.rst:1383 msgid "Top highlight" msgstr "" -#: ../../library/curses.rst:1383 +#: ../../library/curses.rst:1385 msgid "``A_VERTICAL``" msgstr "``A_VERTICAL``" -#: ../../library/curses.rst:1383 +#: ../../library/curses.rst:1385 msgid "Vertical highlight" msgstr "" -#: ../../library/curses.rst:1385 ../../library/curses.rst:1401 +#: ../../library/curses.rst:1387 ../../library/curses.rst:1403 msgid "``A_CHARTEXT``" msgstr "``A_CHARTEXT``" -#: ../../library/curses.rst:1385 ../../library/curses.rst:1401 +#: ../../library/curses.rst:1387 ../../library/curses.rst:1403 msgid "Bit-mask to extract a character" msgstr "" -#: ../../library/curses.rst:1389 +#: ../../library/curses.rst:1391 msgid "``A_ITALIC`` was added." msgstr "" -#: ../../library/curses.rst:1392 +#: ../../library/curses.rst:1394 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: ../../library/curses.rst:1396 +#: ../../library/curses.rst:1398 msgid "Bit-mask" msgstr "" -#: ../../library/curses.rst:1398 +#: ../../library/curses.rst:1400 msgid "``A_ATTRIBUTES``" msgstr "``A_ATTRIBUTES``" -#: ../../library/curses.rst:1398 +#: ../../library/curses.rst:1400 msgid "Bit-mask to extract attributes" msgstr "" -#: ../../library/curses.rst:1404 +#: ../../library/curses.rst:1406 msgid "``A_COLOR``" msgstr "``A_COLOR``" -#: ../../library/curses.rst:1404 +#: ../../library/curses.rst:1406 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: ../../library/curses.rst:1408 +#: ../../library/curses.rst:1410 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." msgstr "" -#: ../../library/curses.rst:1414 +#: ../../library/curses.rst:1416 msgid "Key constant" msgstr "" -#: ../../library/curses.rst:1414 +#: ../../library/curses.rst:1416 msgid "Key" msgstr "" -#: ../../library/curses.rst:1416 +#: ../../library/curses.rst:1418 msgid "``KEY_MIN``" msgstr "``KEY_MIN``" -#: ../../library/curses.rst:1416 +#: ../../library/curses.rst:1418 msgid "Minimum key value" msgstr "" -#: ../../library/curses.rst:1418 +#: ../../library/curses.rst:1420 msgid "``KEY_BREAK``" msgstr "``KEY_BREAK``" -#: ../../library/curses.rst:1418 +#: ../../library/curses.rst:1420 msgid "Break key (unreliable)" msgstr "" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1422 msgid "``KEY_DOWN``" msgstr "``KEY_DOWN``" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1422 msgid "Down-arrow" msgstr "" -#: ../../library/curses.rst:1422 +#: ../../library/curses.rst:1424 msgid "``KEY_UP``" msgstr "``KEY_UP``" -#: ../../library/curses.rst:1422 +#: ../../library/curses.rst:1424 msgid "Up-arrow" msgstr "" -#: ../../library/curses.rst:1424 +#: ../../library/curses.rst:1426 msgid "``KEY_LEFT``" msgstr "``KEY_LEFT``" -#: ../../library/curses.rst:1424 +#: ../../library/curses.rst:1426 msgid "Left-arrow" msgstr "" -#: ../../library/curses.rst:1426 +#: ../../library/curses.rst:1428 msgid "``KEY_RIGHT``" msgstr "``KEY_RIGHT``" -#: ../../library/curses.rst:1426 +#: ../../library/curses.rst:1428 msgid "Right-arrow" msgstr "" -#: ../../library/curses.rst:1428 +#: ../../library/curses.rst:1430 msgid "``KEY_HOME``" msgstr "``KEY_HOME``" -#: ../../library/curses.rst:1428 +#: ../../library/curses.rst:1430 msgid "Home key (upward+left arrow)" msgstr "" -#: ../../library/curses.rst:1430 +#: ../../library/curses.rst:1432 msgid "``KEY_BACKSPACE``" msgstr "``KEY_BACKSPACE``" -#: ../../library/curses.rst:1430 +#: ../../library/curses.rst:1432 msgid "Backspace (unreliable)" msgstr "" -#: ../../library/curses.rst:1432 +#: ../../library/curses.rst:1434 msgid "``KEY_F0``" msgstr "``KEY_F0``" -#: ../../library/curses.rst:1432 +#: ../../library/curses.rst:1434 msgid "Function keys. Up to 64 function keys are supported." msgstr "" -#: ../../library/curses.rst:1435 +#: ../../library/curses.rst:1437 msgid "``KEY_Fn``" msgstr "``KEY_Fn``" -#: ../../library/curses.rst:1435 +#: ../../library/curses.rst:1437 msgid "Value of function key *n*" msgstr "" -#: ../../library/curses.rst:1437 +#: ../../library/curses.rst:1439 msgid "``KEY_DL``" msgstr "``KEY_DL``" -#: ../../library/curses.rst:1437 +#: ../../library/curses.rst:1439 msgid "Delete line" msgstr "" -#: ../../library/curses.rst:1439 +#: ../../library/curses.rst:1441 msgid "``KEY_IL``" msgstr "``KEY_IL``" -#: ../../library/curses.rst:1439 +#: ../../library/curses.rst:1441 msgid "Insert line" msgstr "" -#: ../../library/curses.rst:1441 +#: ../../library/curses.rst:1443 msgid "``KEY_DC``" msgstr "``KEY_DC``" -#: ../../library/curses.rst:1441 +#: ../../library/curses.rst:1443 msgid "Delete character" msgstr "" -#: ../../library/curses.rst:1443 +#: ../../library/curses.rst:1445 msgid "``KEY_IC``" msgstr "``KEY_IC``" -#: ../../library/curses.rst:1443 +#: ../../library/curses.rst:1445 msgid "Insert char or enter insert mode" msgstr "" -#: ../../library/curses.rst:1445 +#: ../../library/curses.rst:1447 msgid "``KEY_EIC``" msgstr "``KEY_EIC``" -#: ../../library/curses.rst:1445 +#: ../../library/curses.rst:1447 msgid "Exit insert char mode" msgstr "" -#: ../../library/curses.rst:1447 +#: ../../library/curses.rst:1449 msgid "``KEY_CLEAR``" msgstr "``KEY_CLEAR``" -#: ../../library/curses.rst:1447 +#: ../../library/curses.rst:1449 msgid "Clear screen" msgstr "" -#: ../../library/curses.rst:1449 +#: ../../library/curses.rst:1451 msgid "``KEY_EOS``" msgstr "``KEY_EOS``" -#: ../../library/curses.rst:1449 +#: ../../library/curses.rst:1451 msgid "Clear to end of screen" msgstr "" -#: ../../library/curses.rst:1451 +#: ../../library/curses.rst:1453 msgid "``KEY_EOL``" msgstr "``KEY_EOL``" -#: ../../library/curses.rst:1451 +#: ../../library/curses.rst:1453 msgid "Clear to end of line" msgstr "" -#: ../../library/curses.rst:1453 +#: ../../library/curses.rst:1455 msgid "``KEY_SF``" msgstr "``KEY_SF``" -#: ../../library/curses.rst:1453 +#: ../../library/curses.rst:1455 msgid "Scroll 1 line forward" msgstr "" -#: ../../library/curses.rst:1455 +#: ../../library/curses.rst:1457 msgid "``KEY_SR``" msgstr "``KEY_SR``" -#: ../../library/curses.rst:1455 +#: ../../library/curses.rst:1457 msgid "Scroll 1 line backward (reverse)" msgstr "" -#: ../../library/curses.rst:1457 +#: ../../library/curses.rst:1459 msgid "``KEY_NPAGE``" msgstr "``KEY_NPAGE``" -#: ../../library/curses.rst:1457 +#: ../../library/curses.rst:1459 msgid "Next page" msgstr "" -#: ../../library/curses.rst:1459 +#: ../../library/curses.rst:1461 msgid "``KEY_PPAGE``" msgstr "``KEY_PPAGE``" -#: ../../library/curses.rst:1459 +#: ../../library/curses.rst:1461 msgid "Previous page" msgstr "" -#: ../../library/curses.rst:1461 +#: ../../library/curses.rst:1463 msgid "``KEY_STAB``" msgstr "``KEY_STAB``" -#: ../../library/curses.rst:1461 +#: ../../library/curses.rst:1463 msgid "Set tab" msgstr "" -#: ../../library/curses.rst:1463 +#: ../../library/curses.rst:1465 msgid "``KEY_CTAB``" msgstr "``KEY_CTAB``" -#: ../../library/curses.rst:1463 +#: ../../library/curses.rst:1465 msgid "Clear tab" msgstr "" -#: ../../library/curses.rst:1465 +#: ../../library/curses.rst:1467 msgid "``KEY_CATAB``" msgstr "``KEY_CATAB``" -#: ../../library/curses.rst:1465 +#: ../../library/curses.rst:1467 msgid "Clear all tabs" msgstr "" -#: ../../library/curses.rst:1467 +#: ../../library/curses.rst:1469 msgid "``KEY_ENTER``" msgstr "``KEY_ENTER``" -#: ../../library/curses.rst:1467 +#: ../../library/curses.rst:1469 msgid "Enter or send (unreliable)" msgstr "" -#: ../../library/curses.rst:1469 +#: ../../library/curses.rst:1471 msgid "``KEY_SRESET``" msgstr "``KEY_SRESET``" -#: ../../library/curses.rst:1469 +#: ../../library/curses.rst:1471 msgid "Soft (partial) reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1471 +#: ../../library/curses.rst:1473 msgid "``KEY_RESET``" msgstr "``KEY_RESET``" -#: ../../library/curses.rst:1471 +#: ../../library/curses.rst:1473 msgid "Reset or hard reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1473 +#: ../../library/curses.rst:1475 msgid "``KEY_PRINT``" msgstr "``KEY_PRINT``" -#: ../../library/curses.rst:1473 +#: ../../library/curses.rst:1475 msgid "Print" msgstr "" -#: ../../library/curses.rst:1475 +#: ../../library/curses.rst:1477 msgid "``KEY_LL``" msgstr "``KEY_LL``" -#: ../../library/curses.rst:1475 +#: ../../library/curses.rst:1477 msgid "Home down or bottom (lower left)" msgstr "" -#: ../../library/curses.rst:1477 +#: ../../library/curses.rst:1479 msgid "``KEY_A1``" msgstr "``KEY_A1``" -#: ../../library/curses.rst:1477 +#: ../../library/curses.rst:1479 msgid "Upper left of keypad" msgstr "" -#: ../../library/curses.rst:1479 +#: ../../library/curses.rst:1481 msgid "``KEY_A3``" msgstr "``KEY_A3``" -#: ../../library/curses.rst:1479 +#: ../../library/curses.rst:1481 msgid "Upper right of keypad" msgstr "" -#: ../../library/curses.rst:1481 +#: ../../library/curses.rst:1483 msgid "``KEY_B2``" msgstr "``KEY_B2``" -#: ../../library/curses.rst:1481 +#: ../../library/curses.rst:1483 msgid "Center of keypad" msgstr "" -#: ../../library/curses.rst:1483 +#: ../../library/curses.rst:1485 msgid "``KEY_C1``" msgstr "``KEY_C1``" -#: ../../library/curses.rst:1483 +#: ../../library/curses.rst:1485 msgid "Lower left of keypad" msgstr "" -#: ../../library/curses.rst:1485 +#: ../../library/curses.rst:1487 msgid "``KEY_C3``" msgstr "``KEY_C3``" -#: ../../library/curses.rst:1485 +#: ../../library/curses.rst:1487 msgid "Lower right of keypad" msgstr "" -#: ../../library/curses.rst:1487 +#: ../../library/curses.rst:1489 msgid "``KEY_BTAB``" msgstr "``KEY_BTAB``" -#: ../../library/curses.rst:1487 +#: ../../library/curses.rst:1489 msgid "Back tab" msgstr "" -#: ../../library/curses.rst:1489 +#: ../../library/curses.rst:1491 msgid "``KEY_BEG``" msgstr "``KEY_BEG``" -#: ../../library/curses.rst:1489 +#: ../../library/curses.rst:1491 msgid "Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1491 +#: ../../library/curses.rst:1493 msgid "``KEY_CANCEL``" msgstr "``KEY_CANCEL``" -#: ../../library/curses.rst:1491 +#: ../../library/curses.rst:1493 msgid "Cancel" msgstr "" -#: ../../library/curses.rst:1493 +#: ../../library/curses.rst:1495 msgid "``KEY_CLOSE``" msgstr "``KEY_CLOSE``" -#: ../../library/curses.rst:1493 +#: ../../library/curses.rst:1495 msgid "Close" msgstr "" -#: ../../library/curses.rst:1495 +#: ../../library/curses.rst:1497 msgid "``KEY_COMMAND``" msgstr "``KEY_COMMAND``" -#: ../../library/curses.rst:1495 +#: ../../library/curses.rst:1497 msgid "Cmd (command)" msgstr "" -#: ../../library/curses.rst:1497 +#: ../../library/curses.rst:1499 msgid "``KEY_COPY``" msgstr "``KEY_COPY``" -#: ../../library/curses.rst:1497 +#: ../../library/curses.rst:1499 msgid "Copy" msgstr "" -#: ../../library/curses.rst:1499 +#: ../../library/curses.rst:1501 msgid "``KEY_CREATE``" msgstr "``KEY_CREATE``" -#: ../../library/curses.rst:1499 +#: ../../library/curses.rst:1501 msgid "Create" msgstr "" -#: ../../library/curses.rst:1501 +#: ../../library/curses.rst:1503 msgid "``KEY_END``" msgstr "``KEY_END``" -#: ../../library/curses.rst:1501 +#: ../../library/curses.rst:1503 msgid "End" msgstr "" -#: ../../library/curses.rst:1503 +#: ../../library/curses.rst:1505 msgid "``KEY_EXIT``" msgstr "``KEY_EXIT``" -#: ../../library/curses.rst:1503 +#: ../../library/curses.rst:1505 msgid "Exit" msgstr "" -#: ../../library/curses.rst:1505 +#: ../../library/curses.rst:1507 msgid "``KEY_FIND``" msgstr "``KEY_FIND``" -#: ../../library/curses.rst:1505 +#: ../../library/curses.rst:1507 msgid "Find" msgstr "" -#: ../../library/curses.rst:1507 +#: ../../library/curses.rst:1509 msgid "``KEY_HELP``" msgstr "``KEY_HELP``" -#: ../../library/curses.rst:1507 +#: ../../library/curses.rst:1509 msgid "Help" msgstr "" -#: ../../library/curses.rst:1509 +#: ../../library/curses.rst:1511 msgid "``KEY_MARK``" msgstr "``KEY_MARK``" -#: ../../library/curses.rst:1509 +#: ../../library/curses.rst:1511 msgid "Mark" msgstr "" -#: ../../library/curses.rst:1511 +#: ../../library/curses.rst:1513 msgid "``KEY_MESSAGE``" msgstr "``KEY_MESSAGE``" -#: ../../library/curses.rst:1511 +#: ../../library/curses.rst:1513 msgid "Message" msgstr "" -#: ../../library/curses.rst:1513 +#: ../../library/curses.rst:1515 msgid "``KEY_MOVE``" msgstr "``KEY_MOVE``" -#: ../../library/curses.rst:1513 +#: ../../library/curses.rst:1515 msgid "Move" msgstr "" -#: ../../library/curses.rst:1515 +#: ../../library/curses.rst:1517 msgid "``KEY_NEXT``" msgstr "``KEY_NEXT``" -#: ../../library/curses.rst:1515 +#: ../../library/curses.rst:1517 msgid "Next" msgstr "" -#: ../../library/curses.rst:1517 +#: ../../library/curses.rst:1519 msgid "``KEY_OPEN``" msgstr "``KEY_OPEN``" -#: ../../library/curses.rst:1517 +#: ../../library/curses.rst:1519 msgid "Open" msgstr "" -#: ../../library/curses.rst:1519 +#: ../../library/curses.rst:1521 msgid "``KEY_OPTIONS``" msgstr "``KEY_OPTIONS``" -#: ../../library/curses.rst:1519 +#: ../../library/curses.rst:1521 msgid "Options" msgstr "" -#: ../../library/curses.rst:1521 +#: ../../library/curses.rst:1523 msgid "``KEY_PREVIOUS``" msgstr "``KEY_PREVIOUS``" -#: ../../library/curses.rst:1521 +#: ../../library/curses.rst:1523 msgid "Prev (previous)" msgstr "" -#: ../../library/curses.rst:1523 +#: ../../library/curses.rst:1525 msgid "``KEY_REDO``" msgstr "``KEY_REDO``" -#: ../../library/curses.rst:1523 +#: ../../library/curses.rst:1525 msgid "Redo" msgstr "" -#: ../../library/curses.rst:1525 +#: ../../library/curses.rst:1527 msgid "``KEY_REFERENCE``" msgstr "``KEY_REFERENCE``" -#: ../../library/curses.rst:1525 +#: ../../library/curses.rst:1527 msgid "Ref (reference)" msgstr "" -#: ../../library/curses.rst:1527 +#: ../../library/curses.rst:1529 msgid "``KEY_REFRESH``" msgstr "``KEY_REFRESH``" -#: ../../library/curses.rst:1527 +#: ../../library/curses.rst:1529 msgid "Refresh" msgstr "" -#: ../../library/curses.rst:1529 +#: ../../library/curses.rst:1531 msgid "``KEY_REPLACE``" msgstr "``KEY_REPLACE``" -#: ../../library/curses.rst:1529 +#: ../../library/curses.rst:1531 msgid "Replace" msgstr "" -#: ../../library/curses.rst:1531 +#: ../../library/curses.rst:1533 msgid "``KEY_RESTART``" msgstr "``KEY_RESTART``" -#: ../../library/curses.rst:1531 +#: ../../library/curses.rst:1533 msgid "Restart" msgstr "" -#: ../../library/curses.rst:1533 +#: ../../library/curses.rst:1535 msgid "``KEY_RESUME``" msgstr "``KEY_RESUME``" -#: ../../library/curses.rst:1533 +#: ../../library/curses.rst:1535 msgid "Resume" msgstr "" -#: ../../library/curses.rst:1535 +#: ../../library/curses.rst:1537 msgid "``KEY_SAVE``" msgstr "``KEY_SAVE``" -#: ../../library/curses.rst:1535 +#: ../../library/curses.rst:1537 msgid "Save" msgstr "" -#: ../../library/curses.rst:1537 +#: ../../library/curses.rst:1539 msgid "``KEY_SBEG``" msgstr "``KEY_SBEG``" -#: ../../library/curses.rst:1537 +#: ../../library/curses.rst:1539 msgid "Shifted Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1539 +#: ../../library/curses.rst:1541 msgid "``KEY_SCANCEL``" msgstr "``KEY_SCANCEL``" -#: ../../library/curses.rst:1539 +#: ../../library/curses.rst:1541 msgid "Shifted Cancel" msgstr "" -#: ../../library/curses.rst:1541 +#: ../../library/curses.rst:1543 msgid "``KEY_SCOMMAND``" msgstr "``KEY_SCOMMAND``" -#: ../../library/curses.rst:1541 +#: ../../library/curses.rst:1543 msgid "Shifted Command" msgstr "" -#: ../../library/curses.rst:1543 +#: ../../library/curses.rst:1545 msgid "``KEY_SCOPY``" msgstr "``KEY_SCOPY``" -#: ../../library/curses.rst:1543 +#: ../../library/curses.rst:1545 msgid "Shifted Copy" msgstr "" -#: ../../library/curses.rst:1545 +#: ../../library/curses.rst:1547 msgid "``KEY_SCREATE``" msgstr "``KEY_SCREATE``" -#: ../../library/curses.rst:1545 +#: ../../library/curses.rst:1547 msgid "Shifted Create" msgstr "" -#: ../../library/curses.rst:1547 +#: ../../library/curses.rst:1549 msgid "``KEY_SDC``" msgstr "``KEY_SDC``" -#: ../../library/curses.rst:1547 +#: ../../library/curses.rst:1549 msgid "Shifted Delete char" msgstr "" -#: ../../library/curses.rst:1549 +#: ../../library/curses.rst:1551 msgid "``KEY_SDL``" msgstr "``KEY_SDL``" -#: ../../library/curses.rst:1549 +#: ../../library/curses.rst:1551 msgid "Shifted Delete line" msgstr "" -#: ../../library/curses.rst:1551 +#: ../../library/curses.rst:1553 msgid "``KEY_SELECT``" msgstr "``KEY_SELECT``" -#: ../../library/curses.rst:1551 +#: ../../library/curses.rst:1553 msgid "Select" msgstr "" -#: ../../library/curses.rst:1553 +#: ../../library/curses.rst:1555 msgid "``KEY_SEND``" msgstr "``KEY_SEND``" -#: ../../library/curses.rst:1553 +#: ../../library/curses.rst:1555 msgid "Shifted End" msgstr "" -#: ../../library/curses.rst:1555 +#: ../../library/curses.rst:1557 msgid "``KEY_SEOL``" msgstr "``KEY_SEOL``" -#: ../../library/curses.rst:1555 +#: ../../library/curses.rst:1557 msgid "Shifted Clear line" msgstr "" -#: ../../library/curses.rst:1557 +#: ../../library/curses.rst:1559 msgid "``KEY_SEXIT``" msgstr "``KEY_SEXIT``" -#: ../../library/curses.rst:1557 +#: ../../library/curses.rst:1559 msgid "Shifted Exit" msgstr "" -#: ../../library/curses.rst:1559 +#: ../../library/curses.rst:1561 msgid "``KEY_SFIND``" msgstr "``KEY_SFIND``" -#: ../../library/curses.rst:1559 +#: ../../library/curses.rst:1561 msgid "Shifted Find" msgstr "" -#: ../../library/curses.rst:1561 +#: ../../library/curses.rst:1563 msgid "``KEY_SHELP``" msgstr "``KEY_SHELP``" -#: ../../library/curses.rst:1561 +#: ../../library/curses.rst:1563 msgid "Shifted Help" msgstr "" -#: ../../library/curses.rst:1563 +#: ../../library/curses.rst:1565 msgid "``KEY_SHOME``" msgstr "``KEY_SHOME``" -#: ../../library/curses.rst:1563 +#: ../../library/curses.rst:1565 msgid "Shifted Home" msgstr "" -#: ../../library/curses.rst:1565 +#: ../../library/curses.rst:1567 msgid "``KEY_SIC``" msgstr "``KEY_SIC``" -#: ../../library/curses.rst:1565 +#: ../../library/curses.rst:1567 msgid "Shifted Input" msgstr "" -#: ../../library/curses.rst:1567 +#: ../../library/curses.rst:1569 msgid "``KEY_SLEFT``" msgstr "``KEY_SLEFT``" -#: ../../library/curses.rst:1567 +#: ../../library/curses.rst:1569 msgid "Shifted Left arrow" msgstr "" -#: ../../library/curses.rst:1569 +#: ../../library/curses.rst:1571 msgid "``KEY_SMESSAGE``" msgstr "``KEY_SMESSAGE``" -#: ../../library/curses.rst:1569 +#: ../../library/curses.rst:1571 msgid "Shifted Message" msgstr "" -#: ../../library/curses.rst:1571 +#: ../../library/curses.rst:1573 msgid "``KEY_SMOVE``" msgstr "``KEY_SMOVE``" -#: ../../library/curses.rst:1571 +#: ../../library/curses.rst:1573 msgid "Shifted Move" msgstr "" -#: ../../library/curses.rst:1573 +#: ../../library/curses.rst:1575 msgid "``KEY_SNEXT``" msgstr "``KEY_SNEXT``" -#: ../../library/curses.rst:1573 +#: ../../library/curses.rst:1575 msgid "Shifted Next" msgstr "" -#: ../../library/curses.rst:1575 +#: ../../library/curses.rst:1577 msgid "``KEY_SOPTIONS``" msgstr "``KEY_SOPTIONS``" -#: ../../library/curses.rst:1575 +#: ../../library/curses.rst:1577 msgid "Shifted Options" msgstr "" -#: ../../library/curses.rst:1577 +#: ../../library/curses.rst:1579 msgid "``KEY_SPREVIOUS``" msgstr "``KEY_SPREVIOUS``" -#: ../../library/curses.rst:1577 +#: ../../library/curses.rst:1579 msgid "Shifted Prev" msgstr "" -#: ../../library/curses.rst:1579 +#: ../../library/curses.rst:1581 msgid "``KEY_SPRINT``" msgstr "``KEY_SPRINT``" -#: ../../library/curses.rst:1579 +#: ../../library/curses.rst:1581 msgid "Shifted Print" msgstr "" -#: ../../library/curses.rst:1581 +#: ../../library/curses.rst:1583 msgid "``KEY_SREDO``" msgstr "``KEY_SREDO``" -#: ../../library/curses.rst:1581 +#: ../../library/curses.rst:1583 msgid "Shifted Redo" msgstr "" -#: ../../library/curses.rst:1583 +#: ../../library/curses.rst:1585 msgid "``KEY_SREPLACE``" msgstr "``KEY_SREPLACE``" -#: ../../library/curses.rst:1583 +#: ../../library/curses.rst:1585 msgid "Shifted Replace" msgstr "" -#: ../../library/curses.rst:1585 +#: ../../library/curses.rst:1587 msgid "``KEY_SRIGHT``" msgstr "``KEY_SRIGHT``" -#: ../../library/curses.rst:1585 +#: ../../library/curses.rst:1587 msgid "Shifted Right arrow" msgstr "" -#: ../../library/curses.rst:1587 +#: ../../library/curses.rst:1589 msgid "``KEY_SRSUME``" msgstr "``KEY_SRSUME``" -#: ../../library/curses.rst:1587 +#: ../../library/curses.rst:1589 msgid "Shifted Resume" msgstr "" -#: ../../library/curses.rst:1589 +#: ../../library/curses.rst:1591 msgid "``KEY_SSAVE``" msgstr "``KEY_SSAVE``" -#: ../../library/curses.rst:1589 +#: ../../library/curses.rst:1591 msgid "Shifted Save" msgstr "" -#: ../../library/curses.rst:1591 +#: ../../library/curses.rst:1593 msgid "``KEY_SSUSPEND``" msgstr "``KEY_SSUSPEND``" -#: ../../library/curses.rst:1591 +#: ../../library/curses.rst:1593 msgid "Shifted Suspend" msgstr "" -#: ../../library/curses.rst:1593 +#: ../../library/curses.rst:1595 msgid "``KEY_SUNDO``" msgstr "``KEY_SUNDO``" -#: ../../library/curses.rst:1593 +#: ../../library/curses.rst:1595 msgid "Shifted Undo" msgstr "" -#: ../../library/curses.rst:1595 +#: ../../library/curses.rst:1597 msgid "``KEY_SUSPEND``" msgstr "``KEY_SUSPEND``" -#: ../../library/curses.rst:1595 +#: ../../library/curses.rst:1597 msgid "Suspend" msgstr "" -#: ../../library/curses.rst:1597 +#: ../../library/curses.rst:1599 msgid "``KEY_UNDO``" msgstr "``KEY_UNDO``" -#: ../../library/curses.rst:1597 +#: ../../library/curses.rst:1599 msgid "Undo" msgstr "" -#: ../../library/curses.rst:1599 +#: ../../library/curses.rst:1601 msgid "``KEY_MOUSE``" msgstr "``KEY_MOUSE``" -#: ../../library/curses.rst:1599 +#: ../../library/curses.rst:1601 msgid "Mouse event has occurred" msgstr "" -#: ../../library/curses.rst:1601 +#: ../../library/curses.rst:1603 msgid "``KEY_RESIZE``" msgstr "``KEY_RESIZE``" -#: ../../library/curses.rst:1601 +#: ../../library/curses.rst:1603 msgid "Terminal resize event" msgstr "" -#: ../../library/curses.rst:1603 +#: ../../library/curses.rst:1605 msgid "``KEY_MAX``" msgstr "``KEY_MAX``" -#: ../../library/curses.rst:1603 +#: ../../library/curses.rst:1605 msgid "Maximum key value" msgstr "" -#: ../../library/curses.rst:1606 +#: ../../library/curses.rst:1608 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " "are normally at least four function keys (:const:`KEY_F1`, :const:`KEY_F2`, :" @@ -2456,64 +2460,64 @@ msgid "" "function keys); also, the following keypad mappings are standard:" msgstr "" -#: ../../library/curses.rst:1615 +#: ../../library/curses.rst:1617 msgid "Keycap" msgstr "" -#: ../../library/curses.rst:1615 ../../library/curses.rst:1732 -#: ../../library/curses.rst:1856 +#: ../../library/curses.rst:1617 ../../library/curses.rst:1734 +#: ../../library/curses.rst:1858 msgid "Constant" msgstr "" -#: ../../library/curses.rst:1617 +#: ../../library/curses.rst:1619 msgid ":kbd:`Insert`" msgstr ":kbd:`Insert`" -#: ../../library/curses.rst:1617 +#: ../../library/curses.rst:1619 msgid "KEY_IC" msgstr "KEY_IC" -#: ../../library/curses.rst:1619 +#: ../../library/curses.rst:1621 msgid ":kbd:`Delete`" msgstr ":kbd:`Delete`" -#: ../../library/curses.rst:1619 +#: ../../library/curses.rst:1621 msgid "KEY_DC" msgstr "KEY_DC" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1623 msgid ":kbd:`Home`" msgstr ":kbd:`Home`" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1623 msgid "KEY_HOME" msgstr "KEY_HOME" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1625 msgid ":kbd:`End`" msgstr ":kbd:`End`" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1625 msgid "KEY_END" msgstr "KEY_END" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1627 msgid ":kbd:`Page Up`" msgstr ":kbd:`Page Up`" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1627 msgid "KEY_PPAGE" msgstr "KEY_PPAGE" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1629 msgid ":kbd:`Page Down`" msgstr ":kbd:`Page Down`" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1629 msgid "KEY_NPAGE" msgstr "KEY_NPAGE" -#: ../../library/curses.rst:1630 +#: ../../library/curses.rst:1632 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2521,435 +2525,435 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: ../../library/curses.rst:1637 +#: ../../library/curses.rst:1639 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: ../../library/curses.rst:1640 +#: ../../library/curses.rst:1642 msgid "ACS code" msgstr "" -#: ../../library/curses.rst:1642 +#: ../../library/curses.rst:1644 msgid "``ACS_BBSS``" msgstr "``ACS_BBSS``" -#: ../../library/curses.rst:1642 +#: ../../library/curses.rst:1644 msgid "alternate name for upper right corner" msgstr "" -#: ../../library/curses.rst:1644 +#: ../../library/curses.rst:1646 msgid "``ACS_BLOCK``" msgstr "``ACS_BLOCK``" -#: ../../library/curses.rst:1644 +#: ../../library/curses.rst:1646 msgid "solid square block" msgstr "" -#: ../../library/curses.rst:1646 +#: ../../library/curses.rst:1648 msgid "``ACS_BOARD``" msgstr "``ACS_BOARD``" -#: ../../library/curses.rst:1646 +#: ../../library/curses.rst:1648 msgid "board of squares" msgstr "" -#: ../../library/curses.rst:1648 +#: ../../library/curses.rst:1650 msgid "``ACS_BSBS``" msgstr "``ACS_BSBS``" -#: ../../library/curses.rst:1648 +#: ../../library/curses.rst:1650 msgid "alternate name for horizontal line" msgstr "" -#: ../../library/curses.rst:1650 +#: ../../library/curses.rst:1652 msgid "``ACS_BSSB``" msgstr "``ACS_BSSB``" -#: ../../library/curses.rst:1650 +#: ../../library/curses.rst:1652 msgid "alternate name for upper left corner" msgstr "" -#: ../../library/curses.rst:1652 +#: ../../library/curses.rst:1654 msgid "``ACS_BSSS``" msgstr "``ACS_BSSS``" -#: ../../library/curses.rst:1652 +#: ../../library/curses.rst:1654 msgid "alternate name for top tee" msgstr "" -#: ../../library/curses.rst:1654 +#: ../../library/curses.rst:1656 msgid "``ACS_BTEE``" msgstr "``ACS_BTEE``" -#: ../../library/curses.rst:1654 +#: ../../library/curses.rst:1656 msgid "bottom tee" msgstr "" -#: ../../library/curses.rst:1656 +#: ../../library/curses.rst:1658 msgid "``ACS_BULLET``" msgstr "``ACS_BULLET``" -#: ../../library/curses.rst:1656 +#: ../../library/curses.rst:1658 msgid "bullet" msgstr "" -#: ../../library/curses.rst:1658 +#: ../../library/curses.rst:1660 msgid "``ACS_CKBOARD``" msgstr "``ACS_CKBOARD``" -#: ../../library/curses.rst:1658 +#: ../../library/curses.rst:1660 msgid "checker board (stipple)" msgstr "" -#: ../../library/curses.rst:1660 +#: ../../library/curses.rst:1662 msgid "``ACS_DARROW``" msgstr "``ACS_DARROW``" -#: ../../library/curses.rst:1660 +#: ../../library/curses.rst:1662 msgid "arrow pointing down" msgstr "" -#: ../../library/curses.rst:1662 +#: ../../library/curses.rst:1664 msgid "``ACS_DEGREE``" msgstr "``ACS_DEGREE``" -#: ../../library/curses.rst:1662 +#: ../../library/curses.rst:1664 msgid "degree symbol" msgstr "" -#: ../../library/curses.rst:1664 +#: ../../library/curses.rst:1666 msgid "``ACS_DIAMOND``" msgstr "``ACS_DIAMOND``" -#: ../../library/curses.rst:1664 +#: ../../library/curses.rst:1666 msgid "diamond" msgstr "" -#: ../../library/curses.rst:1666 +#: ../../library/curses.rst:1668 msgid "``ACS_GEQUAL``" msgstr "``ACS_GEQUAL``" -#: ../../library/curses.rst:1666 +#: ../../library/curses.rst:1668 msgid "greater-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1668 +#: ../../library/curses.rst:1670 msgid "``ACS_HLINE``" msgstr "``ACS_HLINE``" -#: ../../library/curses.rst:1668 +#: ../../library/curses.rst:1670 msgid "horizontal line" msgstr "" -#: ../../library/curses.rst:1670 +#: ../../library/curses.rst:1672 msgid "``ACS_LANTERN``" msgstr "``ACS_LANTERN``" -#: ../../library/curses.rst:1670 +#: ../../library/curses.rst:1672 msgid "lantern symbol" msgstr "" -#: ../../library/curses.rst:1672 +#: ../../library/curses.rst:1674 msgid "``ACS_LARROW``" msgstr "``ACS_LARROW``" -#: ../../library/curses.rst:1672 +#: ../../library/curses.rst:1674 msgid "left arrow" msgstr "" -#: ../../library/curses.rst:1674 +#: ../../library/curses.rst:1676 msgid "``ACS_LEQUAL``" msgstr "``ACS_LEQUAL``" -#: ../../library/curses.rst:1674 +#: ../../library/curses.rst:1676 msgid "less-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1676 +#: ../../library/curses.rst:1678 msgid "``ACS_LLCORNER``" msgstr "``ACS_LLCORNER``" -#: ../../library/curses.rst:1676 +#: ../../library/curses.rst:1678 msgid "lower left-hand corner" msgstr "" -#: ../../library/curses.rst:1678 +#: ../../library/curses.rst:1680 msgid "``ACS_LRCORNER``" msgstr "``ACS_LRCORNER``" -#: ../../library/curses.rst:1678 +#: ../../library/curses.rst:1680 msgid "lower right-hand corner" msgstr "" -#: ../../library/curses.rst:1680 +#: ../../library/curses.rst:1682 msgid "``ACS_LTEE``" msgstr "``ACS_LTEE``" -#: ../../library/curses.rst:1680 +#: ../../library/curses.rst:1682 msgid "left tee" msgstr "" -#: ../../library/curses.rst:1682 +#: ../../library/curses.rst:1684 msgid "``ACS_NEQUAL``" msgstr "``ACS_NEQUAL``" -#: ../../library/curses.rst:1682 +#: ../../library/curses.rst:1684 msgid "not-equal sign" msgstr "" -#: ../../library/curses.rst:1684 +#: ../../library/curses.rst:1686 msgid "``ACS_PI``" msgstr "``ACS_PI``" -#: ../../library/curses.rst:1684 +#: ../../library/curses.rst:1686 msgid "letter pi" msgstr "" -#: ../../library/curses.rst:1686 +#: ../../library/curses.rst:1688 msgid "``ACS_PLMINUS``" msgstr "``ACS_PLMINUS``" -#: ../../library/curses.rst:1686 +#: ../../library/curses.rst:1688 msgid "plus-or-minus sign" msgstr "" -#: ../../library/curses.rst:1688 +#: ../../library/curses.rst:1690 msgid "``ACS_PLUS``" msgstr "``ACS_PLUS``" -#: ../../library/curses.rst:1688 +#: ../../library/curses.rst:1690 msgid "big plus sign" msgstr "" -#: ../../library/curses.rst:1690 +#: ../../library/curses.rst:1692 msgid "``ACS_RARROW``" msgstr "``ACS_RARROW``" -#: ../../library/curses.rst:1690 +#: ../../library/curses.rst:1692 msgid "right arrow" msgstr "" -#: ../../library/curses.rst:1692 +#: ../../library/curses.rst:1694 msgid "``ACS_RTEE``" msgstr "``ACS_RTEE``" -#: ../../library/curses.rst:1692 +#: ../../library/curses.rst:1694 msgid "right tee" msgstr "" -#: ../../library/curses.rst:1694 +#: ../../library/curses.rst:1696 msgid "``ACS_S1``" msgstr "``ACS_S1``" -#: ../../library/curses.rst:1694 +#: ../../library/curses.rst:1696 msgid "scan line 1" msgstr "" -#: ../../library/curses.rst:1696 +#: ../../library/curses.rst:1698 msgid "``ACS_S3``" msgstr "``ACS_S3``" -#: ../../library/curses.rst:1696 +#: ../../library/curses.rst:1698 msgid "scan line 3" msgstr "" -#: ../../library/curses.rst:1698 +#: ../../library/curses.rst:1700 msgid "``ACS_S7``" msgstr "``ACS_S7``" -#: ../../library/curses.rst:1698 +#: ../../library/curses.rst:1700 msgid "scan line 7" msgstr "" -#: ../../library/curses.rst:1700 +#: ../../library/curses.rst:1702 msgid "``ACS_S9``" msgstr "``ACS_S9``" -#: ../../library/curses.rst:1700 +#: ../../library/curses.rst:1702 msgid "scan line 9" msgstr "" -#: ../../library/curses.rst:1702 +#: ../../library/curses.rst:1704 msgid "``ACS_SBBS``" msgstr "``ACS_SBBS``" -#: ../../library/curses.rst:1702 +#: ../../library/curses.rst:1704 msgid "alternate name for lower right corner" msgstr "" -#: ../../library/curses.rst:1704 +#: ../../library/curses.rst:1706 msgid "``ACS_SBSB``" msgstr "``ACS_SBSB``" -#: ../../library/curses.rst:1704 +#: ../../library/curses.rst:1706 msgid "alternate name for vertical line" msgstr "" -#: ../../library/curses.rst:1706 +#: ../../library/curses.rst:1708 msgid "``ACS_SBSS``" msgstr "``ACS_SBSS``" -#: ../../library/curses.rst:1706 +#: ../../library/curses.rst:1708 msgid "alternate name for right tee" msgstr "" -#: ../../library/curses.rst:1708 +#: ../../library/curses.rst:1710 msgid "``ACS_SSBB``" msgstr "``ACS_SSBB``" -#: ../../library/curses.rst:1708 +#: ../../library/curses.rst:1710 msgid "alternate name for lower left corner" msgstr "" -#: ../../library/curses.rst:1710 +#: ../../library/curses.rst:1712 msgid "``ACS_SSBS``" msgstr "``ACS_SSBS``" -#: ../../library/curses.rst:1710 +#: ../../library/curses.rst:1712 msgid "alternate name for bottom tee" msgstr "" -#: ../../library/curses.rst:1712 +#: ../../library/curses.rst:1714 msgid "``ACS_SSSB``" msgstr "``ACS_SSSB``" -#: ../../library/curses.rst:1712 +#: ../../library/curses.rst:1714 msgid "alternate name for left tee" msgstr "" -#: ../../library/curses.rst:1714 +#: ../../library/curses.rst:1716 msgid "``ACS_SSSS``" msgstr "``ACS_SSSS``" -#: ../../library/curses.rst:1714 +#: ../../library/curses.rst:1716 msgid "alternate name for crossover or big plus" msgstr "" -#: ../../library/curses.rst:1716 +#: ../../library/curses.rst:1718 msgid "``ACS_STERLING``" msgstr "``ACS_STERLING``" -#: ../../library/curses.rst:1716 +#: ../../library/curses.rst:1718 msgid "pound sterling" msgstr "" -#: ../../library/curses.rst:1718 +#: ../../library/curses.rst:1720 msgid "``ACS_TTEE``" msgstr "``ACS_TTEE``" -#: ../../library/curses.rst:1718 +#: ../../library/curses.rst:1720 msgid "top tee" msgstr "" -#: ../../library/curses.rst:1720 +#: ../../library/curses.rst:1722 msgid "``ACS_UARROW``" msgstr "``ACS_UARROW``" -#: ../../library/curses.rst:1720 +#: ../../library/curses.rst:1722 msgid "up arrow" msgstr "" -#: ../../library/curses.rst:1722 +#: ../../library/curses.rst:1724 msgid "``ACS_ULCORNER``" msgstr "``ACS_ULCORNER``" -#: ../../library/curses.rst:1722 +#: ../../library/curses.rst:1724 msgid "upper left corner" msgstr "" -#: ../../library/curses.rst:1724 +#: ../../library/curses.rst:1726 msgid "``ACS_URCORNER``" msgstr "``ACS_URCORNER``" -#: ../../library/curses.rst:1724 +#: ../../library/curses.rst:1726 msgid "upper right corner" msgstr "" -#: ../../library/curses.rst:1726 +#: ../../library/curses.rst:1728 msgid "``ACS_VLINE``" msgstr "``ACS_VLINE``" -#: ../../library/curses.rst:1726 +#: ../../library/curses.rst:1728 msgid "vertical line" msgstr "" -#: ../../library/curses.rst:1729 +#: ../../library/curses.rst:1731 msgid "The following table lists the predefined colors:" msgstr "" -#: ../../library/curses.rst:1732 +#: ../../library/curses.rst:1734 msgid "Color" msgstr "顏色" -#: ../../library/curses.rst:1734 +#: ../../library/curses.rst:1736 msgid "``COLOR_BLACK``" msgstr "``COLOR_BLACK``" -#: ../../library/curses.rst:1734 +#: ../../library/curses.rst:1736 msgid "Black" msgstr "黑" -#: ../../library/curses.rst:1736 +#: ../../library/curses.rst:1738 msgid "``COLOR_BLUE``" msgstr "``COLOR_BLUE``" -#: ../../library/curses.rst:1736 +#: ../../library/curses.rst:1738 msgid "Blue" msgstr "藍" -#: ../../library/curses.rst:1738 +#: ../../library/curses.rst:1740 msgid "``COLOR_CYAN``" msgstr "``COLOR_CYAN``" -#: ../../library/curses.rst:1738 +#: ../../library/curses.rst:1740 msgid "Cyan (light greenish blue)" msgstr "" -#: ../../library/curses.rst:1740 +#: ../../library/curses.rst:1742 msgid "``COLOR_GREEN``" msgstr "``COLOR_GREEN``" -#: ../../library/curses.rst:1740 +#: ../../library/curses.rst:1742 msgid "Green" msgstr "綠" -#: ../../library/curses.rst:1742 +#: ../../library/curses.rst:1744 msgid "``COLOR_MAGENTA``" msgstr "``COLOR_MAGENTA``" -#: ../../library/curses.rst:1742 +#: ../../library/curses.rst:1744 msgid "Magenta (purplish red)" msgstr "" -#: ../../library/curses.rst:1744 +#: ../../library/curses.rst:1746 msgid "``COLOR_RED``" msgstr "``COLOR_RED``" -#: ../../library/curses.rst:1744 +#: ../../library/curses.rst:1746 msgid "Red" msgstr "紅" -#: ../../library/curses.rst:1746 +#: ../../library/curses.rst:1748 msgid "``COLOR_WHITE``" msgstr "``COLOR_WHITE``" -#: ../../library/curses.rst:1746 +#: ../../library/curses.rst:1748 msgid "White" msgstr "白" -#: ../../library/curses.rst:1748 +#: ../../library/curses.rst:1750 msgid "``COLOR_YELLOW``" msgstr "``COLOR_YELLOW``" -#: ../../library/curses.rst:1748 +#: ../../library/curses.rst:1750 msgid "Yellow" msgstr "" -#: ../../library/curses.rst:1753 +#: ../../library/curses.rst:1755 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" -#: ../../library/curses.rst:1761 +#: ../../library/curses.rst:1763 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2959,11 +2963,11 @@ msgid "" "purposes." msgstr "" -#: ../../library/curses.rst:1767 +#: ../../library/curses.rst:1769 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr "" -#: ../../library/curses.rst:1772 +#: ../../library/curses.rst:1774 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2975,15 +2979,15 @@ msgid "" "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: ../../library/curses.rst:1785 +#: ../../library/curses.rst:1787 msgid "Textbox objects" msgstr "" -#: ../../library/curses.rst:1787 +#: ../../library/curses.rst:1789 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: ../../library/curses.rst:1792 +#: ../../library/curses.rst:1794 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2992,11 +2996,11 @@ msgid "" "instance's :attr:`stripspaces` flag is initially on." msgstr "" -#: ../../library/curses.rst:1798 +#: ../../library/curses.rst:1800 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: ../../library/curses.rst:1803 +#: ../../library/curses.rst:1805 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -3007,167 +3011,167 @@ msgid "" "`stripspaces` attribute." msgstr "" -#: ../../library/curses.rst:1814 +#: ../../library/curses.rst:1816 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" msgstr "" -#: ../../library/curses.rst:1818 ../../library/curses.rst:1856 +#: ../../library/curses.rst:1820 ../../library/curses.rst:1858 msgid "Keystroke" msgstr "" -#: ../../library/curses.rst:1818 +#: ../../library/curses.rst:1820 msgid "Action" msgstr "" -#: ../../library/curses.rst:1820 +#: ../../library/curses.rst:1822 msgid ":kbd:`Control-A`" msgstr ":kbd:`Control-A`" -#: ../../library/curses.rst:1820 +#: ../../library/curses.rst:1822 msgid "Go to left edge of window." msgstr "" -#: ../../library/curses.rst:1822 ../../library/curses.rst:1858 +#: ../../library/curses.rst:1824 ../../library/curses.rst:1860 msgid ":kbd:`Control-B`" msgstr ":kbd:`Control-B`" -#: ../../library/curses.rst:1822 +#: ../../library/curses.rst:1824 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: ../../library/curses.rst:1825 +#: ../../library/curses.rst:1827 msgid ":kbd:`Control-D`" msgstr ":kbd:`Control-D`" -#: ../../library/curses.rst:1825 +#: ../../library/curses.rst:1827 msgid "Delete character under cursor." msgstr "" -#: ../../library/curses.rst:1827 +#: ../../library/curses.rst:1829 msgid ":kbd:`Control-E`" msgstr ":kbd:`Control-E`" -#: ../../library/curses.rst:1827 +#: ../../library/curses.rst:1829 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: ../../library/curses.rst:1830 ../../library/curses.rst:1860 +#: ../../library/curses.rst:1832 ../../library/curses.rst:1862 msgid ":kbd:`Control-F`" msgstr ":kbd:`Control-F`" -#: ../../library/curses.rst:1830 +#: ../../library/curses.rst:1832 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: ../../library/curses.rst:1833 +#: ../../library/curses.rst:1835 msgid ":kbd:`Control-G`" msgstr ":kbd:`Control-G`" -#: ../../library/curses.rst:1833 +#: ../../library/curses.rst:1835 msgid "Terminate, returning the window contents." msgstr "" -#: ../../library/curses.rst:1835 +#: ../../library/curses.rst:1837 msgid ":kbd:`Control-H`" msgstr ":kbd:`Control-H`" -#: ../../library/curses.rst:1835 +#: ../../library/curses.rst:1837 msgid "Delete character backward." msgstr "" -#: ../../library/curses.rst:1837 +#: ../../library/curses.rst:1839 msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:1837 +#: ../../library/curses.rst:1839 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "" -#: ../../library/curses.rst:1840 +#: ../../library/curses.rst:1842 msgid ":kbd:`Control-K`" msgstr ":kbd:`Control-K`" -#: ../../library/curses.rst:1840 +#: ../../library/curses.rst:1842 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: ../../library/curses.rst:1843 +#: ../../library/curses.rst:1845 msgid ":kbd:`Control-L`" msgstr ":kbd:`Control-L`" -#: ../../library/curses.rst:1843 +#: ../../library/curses.rst:1845 msgid "Refresh screen." msgstr "" -#: ../../library/curses.rst:1845 ../../library/curses.rst:1864 +#: ../../library/curses.rst:1847 ../../library/curses.rst:1866 msgid ":kbd:`Control-N`" msgstr ":kbd:`Control-N`" -#: ../../library/curses.rst:1845 +#: ../../library/curses.rst:1847 msgid "Cursor down; move down one line." msgstr "" -#: ../../library/curses.rst:1847 +#: ../../library/curses.rst:1849 msgid ":kbd:`Control-O`" msgstr ":kbd:`Control-O`" -#: ../../library/curses.rst:1847 +#: ../../library/curses.rst:1849 msgid "Insert a blank line at cursor location." msgstr "" -#: ../../library/curses.rst:1849 ../../library/curses.rst:1862 +#: ../../library/curses.rst:1851 ../../library/curses.rst:1864 msgid ":kbd:`Control-P`" msgstr ":kbd:`Control-P`" -#: ../../library/curses.rst:1849 +#: ../../library/curses.rst:1851 msgid "Cursor up; move up one line." msgstr "" -#: ../../library/curses.rst:1852 +#: ../../library/curses.rst:1854 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: ../../library/curses.rst:1858 +#: ../../library/curses.rst:1860 msgid ":const:`KEY_LEFT`" msgstr ":const:`KEY_LEFT`" -#: ../../library/curses.rst:1860 +#: ../../library/curses.rst:1862 msgid ":const:`KEY_RIGHT`" msgstr ":const:`KEY_RIGHT`" -#: ../../library/curses.rst:1862 +#: ../../library/curses.rst:1864 msgid ":const:`KEY_UP`" msgstr ":const:`KEY_UP`" -#: ../../library/curses.rst:1864 +#: ../../library/curses.rst:1866 msgid ":const:`KEY_DOWN`" msgstr ":const:`KEY_DOWN`" -#: ../../library/curses.rst:1866 +#: ../../library/curses.rst:1868 msgid ":const:`KEY_BACKSPACE`" msgstr ":const:`KEY_BACKSPACE`" -#: ../../library/curses.rst:1866 +#: ../../library/curses.rst:1868 msgid ":kbd:`Control-h`" msgstr ":kbd:`Control-h`" -#: ../../library/curses.rst:1869 +#: ../../library/curses.rst:1871 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: ../../library/curses.rst:1875 +#: ../../library/curses.rst:1877 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: ../../library/curses.rst:1881 +#: ../../library/curses.rst:1883 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/ensurepip.po b/library/ensurepip.po index 0e16796da4..02191ec7f4 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -22,7 +22,11 @@ msgstr "" msgid ":mod:`ensurepip` --- Bootstrapping the ``pip`` installer" msgstr "" -#: ../../library/ensurepip.rst:12 +#: ../../library/ensurepip.rst:10 +msgid "**Source code:** :source:`Lib/ensurepip`" +msgstr "**原始碼:**\\ :source:`Lib/ensurepip`" + +#: ../../library/ensurepip.rst:14 msgid "" "The :mod:`ensurepip` package provides support for bootstrapping the ``pip`` " "installer into an existing Python installation or virtual environment. This " @@ -32,7 +36,7 @@ msgid "" "interpreter." msgstr "" -#: ../../library/ensurepip.rst:19 +#: ../../library/ensurepip.rst:21 msgid "" "In most cases, end users of Python shouldn't need to invoke this module " "directly (as ``pip`` should be bootstrapped by default), but it may be " @@ -40,25 +44,25 @@ msgid "" "creating a virtual environment) or after explicitly uninstalling ``pip``." msgstr "" -#: ../../library/ensurepip.rst:27 +#: ../../library/ensurepip.rst:29 msgid "" "This module *does not* access the internet. All of the components needed to " "bootstrap ``pip`` are included as internal parts of the package." msgstr "" -#: ../../library/ensurepip.rst:34 +#: ../../library/ensurepip.rst:36 msgid ":ref:`installing-index`" msgstr ":ref:`installing-index`" -#: ../../library/ensurepip.rst:34 +#: ../../library/ensurepip.rst:36 msgid "The end user guide for installing Python packages" msgstr "" -#: ../../library/ensurepip.rst:36 +#: ../../library/ensurepip.rst:38 msgid ":pep:`453`: Explicit bootstrapping of pip in Python installations" msgstr "" -#: ../../library/ensurepip.rst:37 +#: ../../library/ensurepip.rst:39 msgid "The original rationale and specification for this module." msgstr "" @@ -73,20 +77,20 @@ msgid "" "more information." msgstr "" -#: ../../library/ensurepip.rst:42 +#: ../../library/ensurepip.rst:44 msgid "Command line interface" msgstr "" -#: ../../library/ensurepip.rst:44 +#: ../../library/ensurepip.rst:46 msgid "" "The command line interface is invoked using the interpreter's ``-m`` switch." msgstr "" -#: ../../library/ensurepip.rst:46 +#: ../../library/ensurepip.rst:48 msgid "The simplest possible invocation is::" msgstr "" -#: ../../library/ensurepip.rst:50 +#: ../../library/ensurepip.rst:52 msgid "" "This invocation will install ``pip`` if it is not already installed, but " "otherwise does nothing. To ensure the installed version of ``pip`` is at " @@ -94,7 +98,7 @@ msgid "" "upgrade`` option::" msgstr "" -#: ../../library/ensurepip.rst:57 +#: ../../library/ensurepip.rst:59 msgid "" "By default, ``pip`` is installed into the current virtual environment (if " "one is active) or into the system site packages (if there is no active " @@ -102,103 +106,103 @@ msgid "" "two additional command line options:" msgstr "" -#: ../../library/ensurepip.rst:62 +#: ../../library/ensurepip.rst:64 msgid "" "``--root ``: Installs ``pip`` relative to the given root directory " "rather than the root of the currently active virtual environment (if any) or " "the default root for the current Python installation." msgstr "" -#: ../../library/ensurepip.rst:65 +#: ../../library/ensurepip.rst:67 msgid "" "``--user``: Installs ``pip`` into the user site packages directory rather " "than globally for the current Python installation (this option is not " "permitted inside an active virtual environment)." msgstr "" -#: ../../library/ensurepip.rst:69 +#: ../../library/ensurepip.rst:71 msgid "" "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " "stands for the version of Python used to invoke ``ensurepip``). The scripts " "installed can be controlled through two additional command line options:" msgstr "" -#: ../../library/ensurepip.rst:74 +#: ../../library/ensurepip.rst:76 msgid "" "``--altinstall``: if an alternate installation is requested, the ``pipX`` " "script will *not* be installed." msgstr "" -#: ../../library/ensurepip.rst:77 +#: ../../library/ensurepip.rst:79 msgid "" "``--default-pip``: if a \"default pip\" installation is requested, the " "``pip`` script will be installed in addition to the two regular scripts." msgstr "" -#: ../../library/ensurepip.rst:80 +#: ../../library/ensurepip.rst:82 msgid "" "Providing both of the script selection options will trigger an exception." msgstr "" -#: ../../library/ensurepip.rst:84 +#: ../../library/ensurepip.rst:86 msgid "Module API" msgstr "模組 API" -#: ../../library/ensurepip.rst:86 +#: ../../library/ensurepip.rst:88 msgid ":mod:`ensurepip` exposes two functions for programmatic use:" msgstr "" -#: ../../library/ensurepip.rst:90 +#: ../../library/ensurepip.rst:92 msgid "" "Returns a string specifying the available version of pip that will be " "installed when bootstrapping an environment." msgstr "" -#: ../../library/ensurepip.rst:97 +#: ../../library/ensurepip.rst:99 msgid "Bootstraps ``pip`` into the current or designated environment." msgstr "" -#: ../../library/ensurepip.rst:99 +#: ../../library/ensurepip.rst:101 msgid "" "*root* specifies an alternative root directory to install relative to. If " "*root* is ``None``, then installation uses the default install location for " "the current environment." msgstr "" -#: ../../library/ensurepip.rst:103 +#: ../../library/ensurepip.rst:105 msgid "" "*upgrade* indicates whether or not to upgrade an existing installation of an " "earlier version of ``pip`` to the available version." msgstr "" -#: ../../library/ensurepip.rst:106 +#: ../../library/ensurepip.rst:108 msgid "" "*user* indicates whether to use the user scheme rather than installing " "globally." msgstr "" -#: ../../library/ensurepip.rst:109 +#: ../../library/ensurepip.rst:111 msgid "" "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " "stands for the current version of Python)." msgstr "" -#: ../../library/ensurepip.rst:112 +#: ../../library/ensurepip.rst:114 msgid "If *altinstall* is set, then ``pipX`` will *not* be installed." msgstr "" -#: ../../library/ensurepip.rst:114 +#: ../../library/ensurepip.rst:116 msgid "" "If *default_pip* is set, then ``pip`` will be installed in addition to the " "two regular scripts." msgstr "" -#: ../../library/ensurepip.rst:117 +#: ../../library/ensurepip.rst:119 msgid "" "Setting both *altinstall* and *default_pip* will trigger :exc:`ValueError`." msgstr "" -#: ../../library/ensurepip.rst:120 +#: ../../library/ensurepip.rst:122 msgid "" "*verbosity* controls the level of output to :data:`sys.stdout` from the " "bootstrapping operation." @@ -210,14 +214,14 @@ msgid "" "argument ``root``." msgstr "" -#: ../../library/ensurepip.rst:127 +#: ../../library/ensurepip.rst:129 msgid "" "The bootstrapping process has side effects on both ``sys.path`` and ``os." "environ``. Invoking the command line interface in a subprocess instead " "allows these side effects to be avoided." msgstr "" -#: ../../library/ensurepip.rst:133 +#: ../../library/ensurepip.rst:135 msgid "" "The bootstrapping process may install additional modules required by " "``pip``, but other software should not assume those dependencies will always " diff --git a/library/exceptions.po b/library/exceptions.po index 715e2e6fbb..996dfd7133 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-19 00:18+0000\n" +"POT-Creation-Date: 2022-11-24 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,9 +36,9 @@ msgstr "" #: ../../library/exceptions.rst:19 msgid "" "The built-in exceptions listed below can be generated by the interpreter or " -"built-in functions. Except where mentioned, they have an \"associated value" -"\" indicating the detailed cause of the error. This may be a string or a " -"tuple of several items of information (e.g., an error code and a string " +"built-in functions. Except where mentioned, they have an \"associated " +"value\" indicating the detailed cause of the error. This may be a string or " +"a tuple of several items of information (e.g., an error code and a string " "explaining the code). The associated value is usually passed as arguments " "to the exception class's constructor." msgstr "" @@ -369,8 +369,8 @@ msgstr "" #: ../../library/exceptions.rst:323 msgid "" "This exception is raised when a system function returns a system-related " -"error, including I/O failures such as \"file not found\" or \"disk full" -"\" (not for illegal argument types or other incidental errors)." +"error, including I/O failures such as \"file not found\" or \"disk " +"full\" (not for illegal argument types or other incidental errors)." msgstr "" #: ../../library/exceptions.rst:327 @@ -1071,19 +1071,26 @@ msgstr "" #: ../../library/exceptions.rst:937 msgid "" -"Returns an exception group with the same :attr:`message`, :attr:" -"`__traceback__`, :attr:`__cause__`, :attr:`__context__` and :attr:" -"`__notes__` but which wraps the exceptions in ``excs``." +"Returns an exception group with the same :attr:`message`, but which wraps " +"the exceptions in ``excs``." msgstr "" -#: ../../library/exceptions.rst:941 +#: ../../library/exceptions.rst:940 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`. A subclass needs " "to override it in order to make :meth:`subgroup` and :meth:`split` return " -"instances of the subclass rather than :exc:`ExceptionGroup`. ::" +"instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:953 +#: ../../library/exceptions.rst:945 +msgid "" +":meth:`subgroup` and :meth:`split` copy the :attr:`__traceback__`, :attr:" +"`__cause__`, :attr:`__context__` and :attr:`__notes__` fields from the " +"original exception group to the one returned by :meth:`derive`, so these " +"fields do not need to be updated by :meth:`derive`. ::" +msgstr "" + +#: ../../library/exceptions.rst:974 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`__new__`, so subclasses " "that need a different constructor signature need to override that rather " @@ -1092,17 +1099,17 @@ msgid "" "from it. ::" msgstr "" -#: ../../library/exceptions.rst:968 +#: ../../library/exceptions.rst:989 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" "`Exception`." msgstr "" -#: ../../library/exceptions.rst:976 +#: ../../library/exceptions.rst:997 msgid "Exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:978 +#: ../../library/exceptions.rst:999 msgid "The class hierarchy for built-in exceptions is:" msgstr "" diff --git a/library/fnmatch.po b/library/fnmatch.po index e39281c7eb..5c977a3147 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-11-29 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -92,7 +92,7 @@ msgstr "" msgid "" "Also note that :func:`functools.lru_cache` with the *maxsize* of 32768 is " "used to cache the compiled regex patterns in the following functions: :func:" -"`fnmatch`, :func:`fnmatchcase`, :func:`filter`." +"`fnmatch`, :func:`fnmatchcase`, :func:`.filter`." msgstr "" #: ../../library/fnmatch.rst:55 diff --git a/library/http.po b/library/http.po index 91587e064d..b125c79d38 100644 --- a/library/http.po +++ b/library/http.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -98,11 +98,11 @@ msgstr "" msgid "Code" msgstr "狀態碼" -#: ../../library/http.rst:60 ../../library/http.rst:170 +#: ../../library/http.rst:60 ../../library/http.rst:179 msgid "Enum Name" msgstr "枚舉名稱" -#: ../../library/http.rst:60 ../../library/http.rst:170 +#: ../../library/http.rst:60 ../../library/http.rst:179 msgid "Details" msgstr "詳情" @@ -878,11 +878,11 @@ msgid "" "descriptions written in English." msgstr ":class:`enum.StrEnum` 的子類別,它定義了一組 HTTP 方法以及英文描述。" -#: ../../library/http.rst:163 +#: ../../library/http.rst:172 msgid "HTTP methods" msgstr "HTTP 方法" -#: ../../library/http.rst:165 +#: ../../library/http.rst:174 msgid "" "Supported, `IANA-registered methods `_ available in :class:`http.HTTPMethod` are:" @@ -890,79 +890,79 @@ msgstr "" ":class:`http.HTTPStatus` 當中,已支援並且有於 `IANA 註冊的狀態碼 `_\\ 有:" -#: ../../library/http.rst:170 +#: ../../library/http.rst:179 msgid "Method" msgstr "方法" -#: ../../library/http.rst:172 +#: ../../library/http.rst:181 msgid "``GET``" msgstr "``GET``" -#: ../../library/http.rst:172 +#: ../../library/http.rst:181 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.1" msgstr "HTTP/1.1 :rfc:`7231`,4.3.1 節" -#: ../../library/http.rst:173 +#: ../../library/http.rst:182 msgid "``HEAD``" msgstr "``HEAD``" -#: ../../library/http.rst:173 +#: ../../library/http.rst:182 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.2" msgstr "HTTP/1.1 :rfc:`7231`,4.3.2 節" -#: ../../library/http.rst:174 +#: ../../library/http.rst:183 msgid "``POST``" msgstr "``POST``" -#: ../../library/http.rst:174 +#: ../../library/http.rst:183 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.3" msgstr "HTTP/1.1 :rfc:`7231`,4.3.3 節" -#: ../../library/http.rst:175 +#: ../../library/http.rst:184 msgid "``PUT``" msgstr "``PUT``" -#: ../../library/http.rst:175 +#: ../../library/http.rst:184 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.4" msgstr "HTTP/1.1 :rfc:`7231`,4.3.4 節" -#: ../../library/http.rst:176 +#: ../../library/http.rst:185 msgid "``DELETE``" msgstr "``DELETE``" -#: ../../library/http.rst:176 +#: ../../library/http.rst:185 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.5" msgstr "HTTP/1.1 :rfc:`7231`,6.3.5 節" -#: ../../library/http.rst:177 +#: ../../library/http.rst:186 msgid "``CONNECT``" msgstr "``CONNECT``" -#: ../../library/http.rst:177 +#: ../../library/http.rst:186 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.6" msgstr "HTTP/1.1 :rfc:`7231`,4.3.6 節" -#: ../../library/http.rst:178 +#: ../../library/http.rst:187 msgid "``OPTIONS``" msgstr "``OPTIONS``" -#: ../../library/http.rst:178 +#: ../../library/http.rst:187 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.7" msgstr "HTTP/1.1 :rfc:`7231`,4.3.7 節" -#: ../../library/http.rst:179 +#: ../../library/http.rst:188 msgid "``TRACE``" msgstr "``TRACE``" -#: ../../library/http.rst:179 +#: ../../library/http.rst:188 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.8" msgstr "HTTP/1.1 :rfc:`7231`,4.3.8 節" -#: ../../library/http.rst:180 +#: ../../library/http.rst:189 msgid "``PATCH``" msgstr "``PATCH``" -#: ../../library/http.rst:180 +#: ../../library/http.rst:189 msgid "HTTP/1.1 :rfc:`5789`" msgstr "HTTP/1.1 :rfc:`5789`" diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index 0735b31e4a..c8751d6a93 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-11-27 00:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -165,7 +165,7 @@ msgid "" "`importlib.resources.files` interface. Subclasses :class:`importlib." "resources.abc.ResourceReader` and provides concrete implementations of the :" "class:`importlib.resources.abc.ResourceReader`'s abstract methods. " -"Therefore, any loader supplying :class:`importlib.abc.TraversableReader` " +"Therefore, any loader supplying :class:`importlib.abc.TraversableResources` " "also supplies ResourceReader." msgstr "" diff --git a/library/inspect.po b/library/inspect.po index c04503ec41..97f5635339 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -54,7 +54,8 @@ msgid "" "class or module. The functions whose names begin with \"is\" are mainly " "provided as convenient choices for the second argument to :func:" "`getmembers`. They also help you determine when you can expect to find the " -"following special attributes:" +"following special attributes (see :ref:`import-mod-attrs` for module " +"attributes):" msgstr "" #: ../../library/inspect.rst:41 @@ -70,494 +71,480 @@ msgid "Description" msgstr "描述" #: ../../library/inspect.rst:43 -msgid "module" -msgstr "模組" +msgid "class" +msgstr "" -#: ../../library/inspect.rst:43 ../../library/inspect.rst:48 -#: ../../library/inspect.rst:58 ../../library/inspect.rst:76 -#: ../../library/inspect.rst:238 +#: ../../library/inspect.rst:43 ../../library/inspect.rst:53 +#: ../../library/inspect.rst:71 ../../library/inspect.rst:233 msgid "__doc__" msgstr "__doc__" -#: ../../library/inspect.rst:43 ../../library/inspect.rst:48 -#: ../../library/inspect.rst:58 ../../library/inspect.rst:76 -#: ../../library/inspect.rst:238 +#: ../../library/inspect.rst:43 ../../library/inspect.rst:53 +#: ../../library/inspect.rst:71 ../../library/inspect.rst:233 msgid "documentation string" msgstr "" -#: ../../library/inspect.rst:45 -msgid "__file__" -msgstr "__file__" - -#: ../../library/inspect.rst:45 -msgid "filename (missing for built-in modules)" -msgstr "" - -#: ../../library/inspect.rst:48 -msgid "class" -msgstr "" - -#: ../../library/inspect.rst:50 ../../library/inspect.rst:60 -#: ../../library/inspect.rst:78 ../../library/inspect.rst:207 -#: ../../library/inspect.rst:221 ../../library/inspect.rst:240 +#: ../../library/inspect.rst:45 ../../library/inspect.rst:55 +#: ../../library/inspect.rst:73 ../../library/inspect.rst:202 +#: ../../library/inspect.rst:216 ../../library/inspect.rst:235 msgid "__name__" msgstr "__name__" -#: ../../library/inspect.rst:50 +#: ../../library/inspect.rst:45 msgid "name with which this class was defined" msgstr "" -#: ../../library/inspect.rst:53 ../../library/inspect.rst:63 -#: ../../library/inspect.rst:81 ../../library/inspect.rst:209 -#: ../../library/inspect.rst:223 ../../library/inspect.rst:243 +#: ../../library/inspect.rst:48 ../../library/inspect.rst:58 +#: ../../library/inspect.rst:76 ../../library/inspect.rst:204 +#: ../../library/inspect.rst:218 ../../library/inspect.rst:238 msgid "__qualname__" msgstr "__qualname__" -#: ../../library/inspect.rst:53 ../../library/inspect.rst:63 -#: ../../library/inspect.rst:81 ../../library/inspect.rst:209 -#: ../../library/inspect.rst:223 ../../library/inspect.rst:243 +#: ../../library/inspect.rst:48 ../../library/inspect.rst:58 +#: ../../library/inspect.rst:76 ../../library/inspect.rst:204 +#: ../../library/inspect.rst:218 ../../library/inspect.rst:238 msgid "qualified name" msgstr "" -#: ../../library/inspect.rst:55 ../../library/inspect.rst:73 -#: ../../library/inspect.rst:106 +#: ../../library/inspect.rst:50 ../../library/inspect.rst:68 +#: ../../library/inspect.rst:101 msgid "__module__" msgstr "__module__" -#: ../../library/inspect.rst:55 +#: ../../library/inspect.rst:50 msgid "name of module in which this class was defined" msgstr "" -#: ../../library/inspect.rst:58 +#: ../../library/inspect.rst:53 msgid "method" msgstr "" -#: ../../library/inspect.rst:60 +#: ../../library/inspect.rst:55 msgid "name with which this method was defined" msgstr "" -#: ../../library/inspect.rst:65 +#: ../../library/inspect.rst:60 msgid "__func__" msgstr "__func__" -#: ../../library/inspect.rst:65 +#: ../../library/inspect.rst:60 msgid "function object containing implementation of method" msgstr "" -#: ../../library/inspect.rst:69 ../../library/inspect.rst:245 +#: ../../library/inspect.rst:64 ../../library/inspect.rst:240 msgid "__self__" msgstr "__self__" -#: ../../library/inspect.rst:69 +#: ../../library/inspect.rst:64 msgid "instance to which this method is bound, or ``None``" msgstr "" -#: ../../library/inspect.rst:73 +#: ../../library/inspect.rst:68 msgid "name of module in which this method was defined" msgstr "" -#: ../../library/inspect.rst:76 +#: ../../library/inspect.rst:71 msgid "function" msgstr "函式" -#: ../../library/inspect.rst:78 +#: ../../library/inspect.rst:73 msgid "name with which this function was defined" msgstr "" -#: ../../library/inspect.rst:83 +#: ../../library/inspect.rst:78 msgid "__code__" msgstr "__code__" -#: ../../library/inspect.rst:83 +#: ../../library/inspect.rst:78 msgid "code object containing compiled function :term:`bytecode`" msgstr "" -#: ../../library/inspect.rst:87 +#: ../../library/inspect.rst:82 msgid "__defaults__" msgstr "__defaults__" -#: ../../library/inspect.rst:87 +#: ../../library/inspect.rst:82 msgid "tuple of any default values for positional or keyword parameters" msgstr "" -#: ../../library/inspect.rst:91 +#: ../../library/inspect.rst:86 msgid "__kwdefaults__" msgstr "__kwdefaults__" -#: ../../library/inspect.rst:91 +#: ../../library/inspect.rst:86 msgid "mapping of any default values for keyword-only parameters" msgstr "" -#: ../../library/inspect.rst:95 +#: ../../library/inspect.rst:90 msgid "__globals__" msgstr "__globals__" -#: ../../library/inspect.rst:95 +#: ../../library/inspect.rst:90 msgid "global namespace in which this function was defined" msgstr "" -#: ../../library/inspect.rst:98 +#: ../../library/inspect.rst:93 msgid "__builtins__" msgstr "__builtins__" -#: ../../library/inspect.rst:98 +#: ../../library/inspect.rst:93 msgid "builtins namespace" msgstr "" -#: ../../library/inspect.rst:100 +#: ../../library/inspect.rst:95 msgid "__annotations__" msgstr "__annotations__" -#: ../../library/inspect.rst:100 +#: ../../library/inspect.rst:95 msgid "" "mapping of parameters names to annotations; ``\"return\"`` key is reserved " "for return annotations." msgstr "" -#: ../../library/inspect.rst:106 +#: ../../library/inspect.rst:101 msgid "name of module in which this function was defined" msgstr "" -#: ../../library/inspect.rst:109 +#: ../../library/inspect.rst:104 msgid "traceback" msgstr "" -#: ../../library/inspect.rst:109 +#: ../../library/inspect.rst:104 msgid "tb_frame" msgstr "tb_frame" -#: ../../library/inspect.rst:109 +#: ../../library/inspect.rst:104 msgid "frame object at this level" msgstr "" -#: ../../library/inspect.rst:112 +#: ../../library/inspect.rst:107 msgid "tb_lasti" msgstr "tb_lasti" -#: ../../library/inspect.rst:112 ../../library/inspect.rst:134 +#: ../../library/inspect.rst:107 ../../library/inspect.rst:129 msgid "index of last attempted instruction in bytecode" msgstr "" -#: ../../library/inspect.rst:115 +#: ../../library/inspect.rst:110 msgid "tb_lineno" msgstr "tb_lineno" -#: ../../library/inspect.rst:115 ../../library/inspect.rst:137 +#: ../../library/inspect.rst:110 ../../library/inspect.rst:132 msgid "current line number in Python source code" msgstr "" -#: ../../library/inspect.rst:118 +#: ../../library/inspect.rst:113 msgid "tb_next" msgstr "tb_next" -#: ../../library/inspect.rst:118 +#: ../../library/inspect.rst:113 msgid "next inner traceback object (called by this level)" msgstr "" -#: ../../library/inspect.rst:122 ../../library/inspect.rst:211 -#: ../../library/inspect.rst:228 +#: ../../library/inspect.rst:117 ../../library/inspect.rst:206 +#: ../../library/inspect.rst:223 msgid "frame" msgstr "" -#: ../../library/inspect.rst:122 +#: ../../library/inspect.rst:117 msgid "f_back" msgstr "f_back" -#: ../../library/inspect.rst:122 +#: ../../library/inspect.rst:117 msgid "next outer frame object (this frame's caller)" msgstr "" -#: ../../library/inspect.rst:125 +#: ../../library/inspect.rst:120 msgid "f_builtins" msgstr "f_builtins" -#: ../../library/inspect.rst:125 +#: ../../library/inspect.rst:120 msgid "builtins namespace seen by this frame" msgstr "" -#: ../../library/inspect.rst:128 +#: ../../library/inspect.rst:123 msgid "f_code" msgstr "f_code" -#: ../../library/inspect.rst:128 +#: ../../library/inspect.rst:123 msgid "code object being executed in this frame" msgstr "" -#: ../../library/inspect.rst:131 +#: ../../library/inspect.rst:126 msgid "f_globals" msgstr "f_globals" -#: ../../library/inspect.rst:131 +#: ../../library/inspect.rst:126 msgid "global namespace seen by this frame" msgstr "" -#: ../../library/inspect.rst:134 +#: ../../library/inspect.rst:129 msgid "f_lasti" msgstr "f_lasti" -#: ../../library/inspect.rst:137 +#: ../../library/inspect.rst:132 msgid "f_lineno" msgstr "f_lineno" -#: ../../library/inspect.rst:140 +#: ../../library/inspect.rst:135 msgid "f_locals" msgstr "f_locals" -#: ../../library/inspect.rst:140 +#: ../../library/inspect.rst:135 msgid "local namespace seen by this frame" msgstr "" -#: ../../library/inspect.rst:143 +#: ../../library/inspect.rst:138 msgid "f_trace" msgstr "f_trace" -#: ../../library/inspect.rst:143 +#: ../../library/inspect.rst:138 msgid "tracing function for this frame, or ``None``" msgstr "" -#: ../../library/inspect.rst:146 ../../library/inspect.rst:215 -#: ../../library/inspect.rst:232 +#: ../../library/inspect.rst:141 ../../library/inspect.rst:210 +#: ../../library/inspect.rst:227 msgid "code" msgstr "" -#: ../../library/inspect.rst:146 +#: ../../library/inspect.rst:141 msgid "co_argcount" msgstr "co_argcount" -#: ../../library/inspect.rst:146 +#: ../../library/inspect.rst:141 msgid "" "number of arguments (not including keyword only arguments, \\* or \\*\\* " "args)" msgstr "" -#: ../../library/inspect.rst:151 +#: ../../library/inspect.rst:146 msgid "co_code" msgstr "co_code" -#: ../../library/inspect.rst:151 +#: ../../library/inspect.rst:146 msgid "string of raw compiled bytecode" msgstr "" -#: ../../library/inspect.rst:154 +#: ../../library/inspect.rst:149 msgid "co_cellvars" msgstr "co_cellvars" -#: ../../library/inspect.rst:154 +#: ../../library/inspect.rst:149 msgid "tuple of names of cell variables (referenced by containing scopes)" msgstr "" -#: ../../library/inspect.rst:158 +#: ../../library/inspect.rst:153 msgid "co_consts" msgstr "co_consts" -#: ../../library/inspect.rst:158 +#: ../../library/inspect.rst:153 msgid "tuple of constants used in the bytecode" msgstr "" -#: ../../library/inspect.rst:161 +#: ../../library/inspect.rst:156 msgid "co_filename" msgstr "co_filename" -#: ../../library/inspect.rst:161 +#: ../../library/inspect.rst:156 msgid "name of file in which this code object was created" msgstr "" -#: ../../library/inspect.rst:165 +#: ../../library/inspect.rst:160 msgid "co_firstlineno" msgstr "co_firstlineno" -#: ../../library/inspect.rst:165 +#: ../../library/inspect.rst:160 msgid "number of first line in Python source code" msgstr "" -#: ../../library/inspect.rst:168 +#: ../../library/inspect.rst:163 msgid "co_flags" msgstr "co_flags" -#: ../../library/inspect.rst:168 +#: ../../library/inspect.rst:163 msgid "" "bitmap of ``CO_*`` flags, read more :ref:`here `" msgstr "" -#: ../../library/inspect.rst:172 +#: ../../library/inspect.rst:167 msgid "co_lnotab" msgstr "co_lnotab" -#: ../../library/inspect.rst:172 +#: ../../library/inspect.rst:167 msgid "encoded mapping of line numbers to bytecode indices" msgstr "" -#: ../../library/inspect.rst:176 +#: ../../library/inspect.rst:171 msgid "co_freevars" msgstr "co_freevars" -#: ../../library/inspect.rst:176 +#: ../../library/inspect.rst:171 msgid "tuple of names of free variables (referenced via a function's closure)" msgstr "" -#: ../../library/inspect.rst:180 +#: ../../library/inspect.rst:175 msgid "co_posonlyargcount" msgstr "co_posonlyargcount" -#: ../../library/inspect.rst:180 +#: ../../library/inspect.rst:175 msgid "number of positional only arguments" msgstr "" -#: ../../library/inspect.rst:183 +#: ../../library/inspect.rst:178 msgid "co_kwonlyargcount" msgstr "co_kwonlyargcount" -#: ../../library/inspect.rst:183 +#: ../../library/inspect.rst:178 msgid "number of keyword only arguments (not including \\*\\* arg)" msgstr "" -#: ../../library/inspect.rst:187 +#: ../../library/inspect.rst:182 msgid "co_name" msgstr "co_name" -#: ../../library/inspect.rst:187 +#: ../../library/inspect.rst:182 msgid "name with which this code object was defined" msgstr "" -#: ../../library/inspect.rst:190 +#: ../../library/inspect.rst:185 msgid "co_qualname" msgstr "co_qualname" -#: ../../library/inspect.rst:190 +#: ../../library/inspect.rst:185 msgid "fully qualified name with which this code object was defined" msgstr "" -#: ../../library/inspect.rst:194 +#: ../../library/inspect.rst:189 msgid "co_names" msgstr "co_names" -#: ../../library/inspect.rst:194 +#: ../../library/inspect.rst:189 msgid "tuple of names other than arguments and function locals" msgstr "" -#: ../../library/inspect.rst:198 +#: ../../library/inspect.rst:193 msgid "co_nlocals" msgstr "co_nlocals" -#: ../../library/inspect.rst:198 +#: ../../library/inspect.rst:193 msgid "number of local variables" msgstr "" -#: ../../library/inspect.rst:200 +#: ../../library/inspect.rst:195 msgid "co_stacksize" msgstr "co_stacksize" -#: ../../library/inspect.rst:200 +#: ../../library/inspect.rst:195 msgid "virtual machine stack space required" msgstr "" -#: ../../library/inspect.rst:203 +#: ../../library/inspect.rst:198 msgid "co_varnames" msgstr "co_varnames" -#: ../../library/inspect.rst:203 +#: ../../library/inspect.rst:198 msgid "tuple of names of arguments and local variables" msgstr "" -#: ../../library/inspect.rst:207 +#: ../../library/inspect.rst:202 msgid "generator" msgstr "" -#: ../../library/inspect.rst:207 ../../library/inspect.rst:221 +#: ../../library/inspect.rst:202 ../../library/inspect.rst:216 msgid "name" msgstr "" -#: ../../library/inspect.rst:211 +#: ../../library/inspect.rst:206 msgid "gi_frame" msgstr "gi_frame" -#: ../../library/inspect.rst:213 +#: ../../library/inspect.rst:208 msgid "gi_running" msgstr "gi_running" -#: ../../library/inspect.rst:213 +#: ../../library/inspect.rst:208 msgid "is the generator running?" msgstr "" -#: ../../library/inspect.rst:215 +#: ../../library/inspect.rst:210 msgid "gi_code" msgstr "gi_code" -#: ../../library/inspect.rst:217 +#: ../../library/inspect.rst:212 msgid "gi_yieldfrom" msgstr "gi_yieldfrom" -#: ../../library/inspect.rst:217 +#: ../../library/inspect.rst:212 msgid "object being iterated by ``yield from``, or ``None``" msgstr "" -#: ../../library/inspect.rst:221 +#: ../../library/inspect.rst:216 msgid "coroutine" msgstr "" -#: ../../library/inspect.rst:225 +#: ../../library/inspect.rst:220 msgid "cr_await" msgstr "cr_await" -#: ../../library/inspect.rst:225 +#: ../../library/inspect.rst:220 msgid "object being awaited on, or ``None``" msgstr "" -#: ../../library/inspect.rst:228 +#: ../../library/inspect.rst:223 msgid "cr_frame" msgstr "cr_frame" -#: ../../library/inspect.rst:230 +#: ../../library/inspect.rst:225 msgid "cr_running" msgstr "cr_running" -#: ../../library/inspect.rst:230 +#: ../../library/inspect.rst:225 msgid "is the coroutine running?" msgstr "" -#: ../../library/inspect.rst:232 +#: ../../library/inspect.rst:227 msgid "cr_code" msgstr "cr_code" -#: ../../library/inspect.rst:234 +#: ../../library/inspect.rst:229 msgid "cr_origin" msgstr "cr_origin" -#: ../../library/inspect.rst:234 +#: ../../library/inspect.rst:229 msgid "where coroutine was created, or ``None``. See |coroutine-origin-link|" msgstr "" -#: ../../library/inspect.rst:238 +#: ../../library/inspect.rst:233 msgid "builtin" msgstr "" -#: ../../library/inspect.rst:240 +#: ../../library/inspect.rst:235 msgid "original name of this function or method" msgstr "" -#: ../../library/inspect.rst:245 +#: ../../library/inspect.rst:240 msgid "instance to which a method is bound, or ``None``" msgstr "" -#: ../../library/inspect.rst:252 +#: ../../library/inspect.rst:247 msgid "Add ``__qualname__`` and ``gi_yieldfrom`` attributes to generators." msgstr "" -#: ../../library/inspect.rst:254 +#: ../../library/inspect.rst:249 msgid "" "The ``__name__`` attribute of generators is now set from the function name, " "instead of the code name, and it can now be modified." msgstr "" -#: ../../library/inspect.rst:259 +#: ../../library/inspect.rst:254 msgid "Add ``cr_origin`` attribute to coroutines." msgstr "" -#: ../../library/inspect.rst:263 +#: ../../library/inspect.rst:258 msgid "Add ``__builtins__`` attribute to functions." msgstr "" -#: ../../library/inspect.rst:267 +#: ../../library/inspect.rst:262 msgid "" "Return all the members of an object in a list of ``(name, value)`` pairs " "sorted by name. If the optional *predicate* argument—which will be called " @@ -565,14 +552,14 @@ msgid "" "the predicate returns a true value are included." msgstr "" -#: ../../library/inspect.rst:274 +#: ../../library/inspect.rst:269 msgid "" ":func:`getmembers` will only return class attributes defined in the " "metaclass when the argument is a class and those attributes have been listed " "in the metaclass' custom :meth:`__dir__`." msgstr "" -#: ../../library/inspect.rst:281 +#: ../../library/inspect.rst:276 msgid "" "Return all the members of an object in a list of ``(name, value)`` pairs " "sorted by name without triggering dynamic lookup via the descriptor " @@ -580,7 +567,7 @@ msgid "" "that satisfy a given predicate." msgstr "" -#: ../../library/inspect.rst:288 +#: ../../library/inspect.rst:283 msgid "" ":func:`getmembers_static` may not be able to retrieve all members that " "getmembers can fetch (like dynamically created attributes) and may find " @@ -589,7 +576,7 @@ msgid "" "cases." msgstr "" -#: ../../library/inspect.rst:299 +#: ../../library/inspect.rst:294 msgid "" "Return the name of the module named by the file *path*, without including " "the names of enclosing packages. The file extension is checked against all " @@ -598,145 +585,145 @@ msgid "" "``None`` is returned." msgstr "" -#: ../../library/inspect.rst:305 +#: ../../library/inspect.rst:300 msgid "" "Note that this function *only* returns a meaningful name for actual Python " "modules - paths that potentially refer to Python packages will still return " "``None``." msgstr "" -#: ../../library/inspect.rst:309 +#: ../../library/inspect.rst:304 msgid "The function is based directly on :mod:`importlib`." msgstr "" -#: ../../library/inspect.rst:315 +#: ../../library/inspect.rst:310 msgid "Return ``True`` if the object is a module." msgstr "" -#: ../../library/inspect.rst:320 +#: ../../library/inspect.rst:315 msgid "" "Return ``True`` if the object is a class, whether built-in or created in " "Python code." msgstr "" -#: ../../library/inspect.rst:326 +#: ../../library/inspect.rst:321 msgid "Return ``True`` if the object is a bound method written in Python." msgstr "" -#: ../../library/inspect.rst:331 +#: ../../library/inspect.rst:326 msgid "" "Return ``True`` if the object is a Python function, which includes functions " "created by a :term:`lambda` expression." msgstr "" -#: ../../library/inspect.rst:337 +#: ../../library/inspect.rst:332 msgid "Return ``True`` if the object is a Python generator function." msgstr "" -#: ../../library/inspect.rst:339 +#: ../../library/inspect.rst:334 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a Python generator function." msgstr "" -#: ../../library/inspect.rst:346 +#: ../../library/inspect.rst:341 msgid "Return ``True`` if the object is a generator." msgstr "" -#: ../../library/inspect.rst:351 +#: ../../library/inspect.rst:346 msgid "" "Return ``True`` if the object is a :term:`coroutine function` (a function " "defined with an :keyword:`async def` syntax)." msgstr "" -#: ../../library/inspect.rst:356 +#: ../../library/inspect.rst:351 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a :term:`coroutine function`." msgstr "" -#: ../../library/inspect.rst:363 +#: ../../library/inspect.rst:358 msgid "" "Return ``True`` if the object is a :term:`coroutine` created by an :keyword:" "`async def` function." msgstr "" -#: ../../library/inspect.rst:371 +#: ../../library/inspect.rst:366 msgid "" "Return ``True`` if the object can be used in :keyword:`await` expression." msgstr "" -#: ../../library/inspect.rst:373 +#: ../../library/inspect.rst:368 msgid "" "Can also be used to distinguish generator-based coroutines from regular " "generators::" msgstr "" -#: ../../library/inspect.rst:390 +#: ../../library/inspect.rst:385 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator` function, " "for example::" msgstr "" -#: ../../library/inspect.rst:401 +#: ../../library/inspect.rst:396 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:408 +#: ../../library/inspect.rst:403 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator iterator` " "created by an :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:415 +#: ../../library/inspect.rst:410 msgid "Return ``True`` if the object is a traceback." msgstr "" -#: ../../library/inspect.rst:420 +#: ../../library/inspect.rst:415 msgid "Return ``True`` if the object is a frame." msgstr "" -#: ../../library/inspect.rst:425 +#: ../../library/inspect.rst:420 msgid "Return ``True`` if the object is a code." msgstr "" -#: ../../library/inspect.rst:430 +#: ../../library/inspect.rst:425 msgid "" "Return ``True`` if the object is a built-in function or a bound built-in " "method." msgstr "" -#: ../../library/inspect.rst:435 +#: ../../library/inspect.rst:430 msgid "" "Return ``True`` if the type of object is a :class:`~types.MethodWrapperType`." msgstr "" -#: ../../library/inspect.rst:437 +#: ../../library/inspect.rst:432 msgid "" "These are instances of :class:`~types.MethodWrapperType`, such as :meth:" "`~object.__str__`, :meth:`~object.__eq__` and :meth:`~object.__repr__`." msgstr "" -#: ../../library/inspect.rst:445 +#: ../../library/inspect.rst:440 msgid "" "Return ``True`` if the object is a user-defined or built-in function or " "method." msgstr "" -#: ../../library/inspect.rst:450 +#: ../../library/inspect.rst:445 msgid "Return ``True`` if the object is an abstract base class." msgstr "" -#: ../../library/inspect.rst:455 +#: ../../library/inspect.rst:450 msgid "" "Return ``True`` if the object is a method descriptor, but not if :func:" "`ismethod`, :func:`isclass`, :func:`isfunction` or :func:`isbuiltin` are " "true." msgstr "" -#: ../../library/inspect.rst:459 +#: ../../library/inspect.rst:454 msgid "" "This, for example, is true of ``int.__add__``. An object passing this test " "has a :meth:`~object.__get__` method but not a :meth:`~object.__set__` " @@ -744,7 +731,7 @@ msgid "" "__name__` attribute is usually sensible, and :attr:`__doc__` often is." msgstr "" -#: ../../library/inspect.rst:465 +#: ../../library/inspect.rst:460 msgid "" "Methods implemented via descriptors that also pass one of the other tests " "return ``False`` from the :func:`ismethoddescriptor` test, simply because " @@ -752,11 +739,11 @@ msgid "" "`__func__` attribute (etc) when an object passes :func:`ismethod`." msgstr "" -#: ../../library/inspect.rst:473 +#: ../../library/inspect.rst:468 msgid "Return ``True`` if the object is a data descriptor." msgstr "" -#: ../../library/inspect.rst:475 +#: ../../library/inspect.rst:470 msgid "" "Data descriptors have a :attr:`~object.__set__` or a :attr:`~object." "__delete__` method. Examples are properties (defined in Python), getsets, " @@ -767,33 +754,33 @@ msgid "" "and members have both of these attributes), but this is not guaranteed." msgstr "" -#: ../../library/inspect.rst:486 +#: ../../library/inspect.rst:481 msgid "Return ``True`` if the object is a getset descriptor." msgstr "" -#: ../../library/inspect.rst:490 +#: ../../library/inspect.rst:485 msgid "" "getsets are attributes defined in extension modules via :c:type:" "`PyGetSetDef` structures. For Python implementations without such types, " "this method will always return ``False``." msgstr "" -#: ../../library/inspect.rst:497 +#: ../../library/inspect.rst:492 msgid "Return ``True`` if the object is a member descriptor." msgstr "" -#: ../../library/inspect.rst:501 +#: ../../library/inspect.rst:496 msgid "" "Member descriptors are attributes defined in extension modules via :c:type:" "`PyMemberDef` structures. For Python implementations without such types, " "this method will always return ``False``." msgstr "" -#: ../../library/inspect.rst:509 +#: ../../library/inspect.rst:504 msgid "Retrieving source code" msgstr "" -#: ../../library/inspect.rst:513 +#: ../../library/inspect.rst:508 msgid "" "Get the documentation string for an object, cleaned up with :func:" "`cleandoc`. If the documentation string for an object is not provided and " @@ -802,11 +789,11 @@ msgid "" "documentation string is invalid or missing." msgstr "" -#: ../../library/inspect.rst:519 +#: ../../library/inspect.rst:514 msgid "Documentation strings are now inherited if not overridden." msgstr "" -#: ../../library/inspect.rst:525 +#: ../../library/inspect.rst:520 msgid "" "Return in a single string any lines of comments immediately preceding the " "object's source code (for a class, function, or method), or at the top of " @@ -815,27 +802,27 @@ msgid "" "been defined in C or the interactive shell." msgstr "" -#: ../../library/inspect.rst:534 +#: ../../library/inspect.rst:529 msgid "" "Return the name of the (text or binary) file in which an object was defined. " "This will fail with a :exc:`TypeError` if the object is a built-in module, " "class, or function." msgstr "" -#: ../../library/inspect.rst:541 +#: ../../library/inspect.rst:536 msgid "" "Try to guess which module an object was defined in. Return ``None`` if the " "module cannot be determined." msgstr "" -#: ../../library/inspect.rst:547 +#: ../../library/inspect.rst:542 msgid "" "Return the name of the Python source file in which an object was defined or " "``None`` if no way can be identified to get the source. This will fail with " "a :exc:`TypeError` if the object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:555 +#: ../../library/inspect.rst:550 msgid "" "Return a list of source lines and starting line number for an object. The " "argument may be a module, class, method, function, traceback, frame, or code " @@ -845,13 +832,13 @@ msgid "" "code cannot be retrieved." msgstr "" -#: ../../library/inspect.rst:562 ../../library/inspect.rst:574 +#: ../../library/inspect.rst:557 ../../library/inspect.rst:569 msgid "" ":exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the " "former." msgstr "" -#: ../../library/inspect.rst:569 +#: ../../library/inspect.rst:564 msgid "" "Return the text of the source code for an object. The argument may be a " "module, class, method, function, traceback, frame, or code object. The " @@ -859,13 +846,13 @@ msgid "" "the source code cannot be retrieved." msgstr "" -#: ../../library/inspect.rst:581 +#: ../../library/inspect.rst:576 msgid "" "Clean up indentation from docstrings that are indented to line up with " "blocks of code." msgstr "" -#: ../../library/inspect.rst:584 +#: ../../library/inspect.rst:579 msgid "" "All leading whitespace is removed from the first line. Any leading " "whitespace that can be uniformly removed from the second line onwards is " @@ -873,28 +860,28 @@ msgid "" "Also, all tabs are expanded to spaces." msgstr "" -#: ../../library/inspect.rst:593 +#: ../../library/inspect.rst:588 msgid "Introspecting callables with the Signature object" msgstr "" -#: ../../library/inspect.rst:597 +#: ../../library/inspect.rst:592 msgid "" "The Signature object represents the call signature of a callable object and " "its return annotation. To retrieve a Signature object, use the :func:" "`signature` function." msgstr "" -#: ../../library/inspect.rst:603 +#: ../../library/inspect.rst:598 msgid "Return a :class:`Signature` object for the given ``callable``::" msgstr "" -#: ../../library/inspect.rst:620 +#: ../../library/inspect.rst:615 msgid "" "Accepts a wide range of Python callables, from plain functions and classes " "to :func:`functools.partial` objects." msgstr "" -#: ../../library/inspect.rst:623 +#: ../../library/inspect.rst:618 msgid "" "For objects defined in modules using stringized annotations (``from " "__future__ import annotations``), :func:`signature` will attempt to " @@ -905,7 +892,7 @@ msgid "" "instructions on how to use these parameters." msgstr "" -#: ../../library/inspect.rst:632 +#: ../../library/inspect.rst:627 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -914,39 +901,39 @@ msgid "" "exception." msgstr "" -#: ../../library/inspect.rst:638 +#: ../../library/inspect.rst:633 msgid "" "A slash(/) in the signature of a function denotes that the parameters prior " "to it are positional-only. For more info, see :ref:`the FAQ entry on " "positional-only parameters `." msgstr "" -#: ../../library/inspect.rst:642 +#: ../../library/inspect.rst:637 msgid "" "``follow_wrapped`` parameter. Pass ``False`` to get a signature of " "``callable`` specifically (``callable.__wrapped__`` will not be used to " "unwrap decorated callables.)" msgstr "" -#: ../../library/inspect.rst:647 +#: ../../library/inspect.rst:642 msgid "``globals``, ``locals``, and ``eval_str`` parameters." msgstr "" -#: ../../library/inspect.rst:652 +#: ../../library/inspect.rst:647 msgid "" "Some callables may not be introspectable in certain implementations of " "Python. For example, in CPython, some built-in functions defined in C " "provide no metadata about their arguments." msgstr "" -#: ../../library/inspect.rst:659 +#: ../../library/inspect.rst:654 msgid "" "A Signature object represents the call signature of a function and its " "return annotation. For each parameter accepted by the function it stores a :" "class:`Parameter` object in its :attr:`parameters` collection." msgstr "" -#: ../../library/inspect.rst:663 +#: ../../library/inspect.rst:658 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -955,54 +942,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:669 +#: ../../library/inspect.rst:664 msgid "" "The optional *return_annotation* argument, can be an arbitrary Python " "object, is the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:672 +#: ../../library/inspect.rst:667 msgid "" "Signature objects are *immutable*. Use :meth:`Signature.replace` to make a " "modified copy." msgstr "" -#: ../../library/inspect.rst:675 +#: ../../library/inspect.rst:670 msgid "Signature objects are picklable and hashable." msgstr "" -#: ../../library/inspect.rst:680 +#: ../../library/inspect.rst:675 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:684 +#: ../../library/inspect.rst:679 msgid "" "An ordered mapping of parameters' names to the corresponding :class:" "`Parameter` objects. Parameters appear in strict definition order, " "including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:688 ../../library/inspect.rst:1012 +#: ../../library/inspect.rst:683 ../../library/inspect.rst:1007 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " "had always been preserved in Python 3." msgstr "" -#: ../../library/inspect.rst:695 +#: ../../library/inspect.rst:690 msgid "" -"The \"return\" annotation for the callable. If the callable has no \"return" -"\" annotation, this attribute is set to :attr:`Signature.empty`." +"The \"return\" annotation for the callable. If the callable has no " +"\"return\" annotation, this attribute is set to :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:700 +#: ../../library/inspect.rst:695 msgid "" "Create a mapping from positional and keyword arguments to parameters. " "Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the " "signature, or raises a :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:706 +#: ../../library/inspect.rst:701 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -1010,7 +997,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:713 +#: ../../library/inspect.rst:708 msgid "" "Create a new Signature instance based on the instance replace was invoked " "on. It is possible to pass different ``parameters`` and/or " @@ -1019,7 +1006,7 @@ msgid "" "attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:730 +#: ../../library/inspect.rst:725 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj`` " @@ -1027,138 +1014,138 @@ msgid "" "will be used as the namespaces when resolving annotations." msgstr "" -#: ../../library/inspect.rst:735 +#: ../../library/inspect.rst:730 msgid "This method simplifies subclassing of :class:`Signature`::" msgstr "" -#: ../../library/inspect.rst:744 +#: ../../library/inspect.rst:739 msgid "``globalns`` and ``localns`` parameters." msgstr "" -#: ../../library/inspect.rst:750 +#: ../../library/inspect.rst:745 msgid "" "Parameter objects are *immutable*. Instead of modifying a Parameter object, " "you can use :meth:`Parameter.replace` to create a modified copy." msgstr "" -#: ../../library/inspect.rst:753 +#: ../../library/inspect.rst:748 msgid "Parameter objects are picklable and hashable." msgstr "" -#: ../../library/inspect.rst:758 +#: ../../library/inspect.rst:753 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:763 +#: ../../library/inspect.rst:758 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:768 +#: ../../library/inspect.rst:763 msgid "" "CPython generates implicit parameter names of the form ``.0`` on the code " "objects used to implement comprehensions and generator expressions." msgstr "" -#: ../../library/inspect.rst:772 +#: ../../library/inspect.rst:767 msgid "" "These parameter names are exposed by this module as names like ``implicit0``." msgstr "" -#: ../../library/inspect.rst:778 +#: ../../library/inspect.rst:773 msgid "" "The default value for the parameter. If the parameter has no default value, " "this attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:783 +#: ../../library/inspect.rst:778 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:788 +#: ../../library/inspect.rst:783 msgid "" "Describes how argument values are bound to the parameter. Possible values " "(accessible via :class:`Parameter`, like ``Parameter.KEYWORD_ONLY``):" msgstr "" -#: ../../library/inspect.rst:794 +#: ../../library/inspect.rst:789 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:794 +#: ../../library/inspect.rst:789 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:796 +#: ../../library/inspect.rst:791 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:796 +#: ../../library/inspect.rst:791 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: ../../library/inspect.rst:801 +#: ../../library/inspect.rst:796 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:801 +#: ../../library/inspect.rst:796 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: ../../library/inspect.rst:806 +#: ../../library/inspect.rst:801 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:806 +#: ../../library/inspect.rst:801 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:811 +#: ../../library/inspect.rst:806 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:811 +#: ../../library/inspect.rst:806 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: ../../library/inspect.rst:816 +#: ../../library/inspect.rst:811 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:816 +#: ../../library/inspect.rst:811 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:822 +#: ../../library/inspect.rst:817 msgid "Example: print all keyword-only arguments without default values::" msgstr "" -#: ../../library/inspect.rst:836 +#: ../../library/inspect.rst:831 msgid "Describes a enum value of Parameter.kind." msgstr "" -#: ../../library/inspect.rst:840 +#: ../../library/inspect.rst:835 msgid "Example: print all descriptions of arguments::" msgstr "" -#: ../../library/inspect.rst:855 +#: ../../library/inspect.rst:850 msgid "" "Create a new Parameter instance based on the instance replaced was invoked " "on. To override a :class:`Parameter` attribute, pass the corresponding " @@ -1166,94 +1153,94 @@ msgid "" "pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:873 +#: ../../library/inspect.rst:868 msgid "" "In Python 3.3 Parameter objects were allowed to have ``name`` set to " "``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no longer " "permitted." msgstr "" -#: ../../library/inspect.rst:880 +#: ../../library/inspect.rst:875 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: ../../library/inspect.rst:885 +#: ../../library/inspect.rst:880 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " "explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" "attr:`args` and :attr:`kwargs`." msgstr "" -#: ../../library/inspect.rst:889 +#: ../../library/inspect.rst:884 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:894 +#: ../../library/inspect.rst:889 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " "relied on a default value are skipped. However, if needed, use :meth:" "`BoundArguments.apply_defaults` to add them." msgstr "" -#: ../../library/inspect.rst:899 +#: ../../library/inspect.rst:894 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:905 +#: ../../library/inspect.rst:900 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:910 +#: ../../library/inspect.rst:905 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:915 +#: ../../library/inspect.rst:910 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:919 +#: ../../library/inspect.rst:914 msgid "Set default values for missing arguments." msgstr "" -#: ../../library/inspect.rst:921 +#: ../../library/inspect.rst:916 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:924 +#: ../../library/inspect.rst:919 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:937 +#: ../../library/inspect.rst:932 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions::" msgstr "" -#: ../../library/inspect.rst:950 +#: ../../library/inspect.rst:945 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:951 +#: ../../library/inspect.rst:946 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:957 +#: ../../library/inspect.rst:952 msgid "Classes and functions" msgstr "" -#: ../../library/inspect.rst:961 +#: ../../library/inspect.rst:956 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1264,19 +1251,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:972 +#: ../../library/inspect.rst:967 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:975 +#: ../../library/inspect.rst:970 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:978 +#: ../../library/inspect.rst:973 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1291,7 +1278,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:993 +#: ../../library/inspect.rst:988 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1301,14 +1288,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1000 +#: ../../library/inspect.rst:995 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: ../../library/inspect.rst:1005 +#: ../../library/inspect.rst:1000 msgid "" "This method was previously documented as deprecated in favour of :func:" "`signature` in Python 3.5, but that decision has been reversed in order to " @@ -1316,7 +1303,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1020 +#: ../../library/inspect.rst:1015 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1325,18 +1312,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1027 ../../library/inspect.rst:1037 +#: ../../library/inspect.rst:1022 ../../library/inspect.rst:1032 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1032 +#: ../../library/inspect.rst:1027 msgid "" "Format a pretty argument spec from the four values returned by :func:" "`getargvalues`. The format\\* arguments are the corresponding optional " "formatting functions that are called to turn names and values into strings." msgstr "" -#: ../../library/inspect.rst:1042 +#: ../../library/inspect.rst:1037 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1344,7 +1331,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1050 +#: ../../library/inspect.rst:1045 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1357,11 +1344,11 @@ msgid "" "example::" msgstr "" -#: ../../library/inspect.rst:1073 +#: ../../library/inspect.rst:1068 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: ../../library/inspect.rst:1079 +#: ../../library/inspect.rst:1074 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1373,18 +1360,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1088 +#: ../../library/inspect.rst:1083 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: ../../library/inspect.rst:1095 +#: ../../library/inspect.rst:1090 msgid "" "Get the object wrapped by *func*. It follows the chain of :attr:" "`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: ../../library/inspect.rst:1098 +#: ../../library/inspect.rst:1093 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " @@ -1394,68 +1381,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1105 +#: ../../library/inspect.rst:1100 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: ../../library/inspect.rst:1112 +#: ../../library/inspect.rst:1107 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1114 +#: ../../library/inspect.rst:1109 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1117 +#: ../../library/inspect.rst:1112 msgid "" "Returns a dict. ``get_annotations()`` returns a new dict every time it's " "called; calling it twice on the same object will return two different but " "equivalent dicts." msgstr "" -#: ../../library/inspect.rst:1121 +#: ../../library/inspect.rst:1116 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1123 +#: ../../library/inspect.rst:1118 msgid "" "If ``eval_str`` is true, values of type ``str`` will be un-stringized using :" "func:`eval()`. This is intended for use with stringized annotations (``from " "__future__ import annotations``)." msgstr "" -#: ../../library/inspect.rst:1127 +#: ../../library/inspect.rst:1122 msgid "" "If ``obj`` doesn't have an annotations dict, returns an empty dict. " "(Functions and methods always have an annotations dict; classes, modules, " "and other types of callables may not.)" msgstr "" -#: ../../library/inspect.rst:1131 +#: ../../library/inspect.rst:1126 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1133 +#: ../../library/inspect.rst:1128 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1135 +#: ../../library/inspect.rst:1130 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1137 +#: ../../library/inspect.rst:1132 msgid "" "``eval_str`` controls whether or not values of type ``str`` are replaced " "with the result of calling :func:`eval()` on those values:" msgstr "" -#: ../../library/inspect.rst:1140 +#: ../../library/inspect.rst:1135 msgid "" "If eval_str is true, :func:`eval()` is called on values of type ``str``. " "(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()` " @@ -1463,12 +1450,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1144 +#: ../../library/inspect.rst:1139 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1146 +#: ../../library/inspect.rst:1141 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1476,35 +1463,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1151 +#: ../../library/inspect.rst:1146 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1152 +#: ../../library/inspect.rst:1147 msgid "" "If ``obj`` is a class, ``globals`` defaults to ``sys.modules[obj.__module__]." "__dict__`` and ``locals`` defaults to the ``obj`` class namespace." msgstr "" -#: ../../library/inspect.rst:1155 +#: ../../library/inspect.rst:1150 msgid "" "If ``obj`` is a callable, ``globals`` defaults to ``obj.__globals__``, " "although if ``obj`` is a wrapped function (using ``functools." "update_wrapper()``) it is first unwrapped." msgstr "" -#: ../../library/inspect.rst:1159 +#: ../../library/inspect.rst:1154 msgid "" "Calling ``get_annotations`` is best practice for accessing the annotations " "dict of any object. See :ref:`annotations-howto` for more information on " "annotations best practices." msgstr "" -#: ../../library/inspect.rst:1169 +#: ../../library/inspect.rst:1164 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1171 +#: ../../library/inspect.rst:1166 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1512,95 +1499,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1180 +#: ../../library/inspect.rst:1175 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1184 +#: ../../library/inspect.rst:1179 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1189 +#: ../../library/inspect.rst:1184 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1194 +#: ../../library/inspect.rst:1189 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1198 +#: ../../library/inspect.rst:1193 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1203 ../../library/inspect.rst:1242 +#: ../../library/inspect.rst:1198 ../../library/inspect.rst:1237 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1207 +#: ../../library/inspect.rst:1202 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1211 +#: ../../library/inspect.rst:1206 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1214 +#: ../../library/inspect.rst:1209 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1223 +#: ../../library/inspect.rst:1218 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1228 +#: ../../library/inspect.rst:1223 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1233 +#: ../../library/inspect.rst:1228 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1237 +#: ../../library/inspect.rst:1232 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1246 +#: ../../library/inspect.rst:1241 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1251 +#: ../../library/inspect.rst:1246 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1258 +#: ../../library/inspect.rst:1253 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1612,7 +1599,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1266 +#: ../../library/inspect.rst:1261 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " "local variables) can be made deterministic by removing the cycle in a :" @@ -1620,31 +1607,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1278 +#: ../../library/inspect.rst:1273 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: ../../library/inspect.rst:1282 +#: ../../library/inspect.rst:1277 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: ../../library/inspect.rst:1289 +#: ../../library/inspect.rst:1284 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1292 +#: ../../library/inspect.rst:1287 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1297 +#: ../../library/inspect.rst:1292 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -1652,19 +1639,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1302 ../../library/inspect.rst:1317 -#: ../../library/inspect.rst:1343 ../../library/inspect.rst:1358 +#: ../../library/inspect.rst:1297 ../../library/inspect.rst:1312 +#: ../../library/inspect.rst:1338 ../../library/inspect.rst:1353 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1307 ../../library/inspect.rst:1322 -#: ../../library/inspect.rst:1348 ../../library/inspect.rst:1363 +#: ../../library/inspect.rst:1302 ../../library/inspect.rst:1317 +#: ../../library/inspect.rst:1343 ../../library/inspect.rst:1358 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "" -#: ../../library/inspect.rst:1312 +#: ../../library/inspect.rst:1307 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -1672,11 +1659,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1327 +#: ../../library/inspect.rst:1322 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1331 +#: ../../library/inspect.rst:1326 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -1684,14 +1671,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1339 +#: ../../library/inspect.rst:1334 msgid "" "Return a list of :class:`FrameInfo` objects for the caller's stack. The " "first entry in the returned list represents the caller; the last entry " "represents the outermost call on the stack." msgstr "" -#: ../../library/inspect.rst:1353 +#: ../../library/inspect.rst:1348 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -1699,11 +1686,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1367 +#: ../../library/inspect.rst:1362 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1369 +#: ../../library/inspect.rst:1364 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1711,20 +1698,20 @@ msgid "" "`__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1374 +#: ../../library/inspect.rst:1369 msgid "" "For cases where you want passive introspection, like documentation tools, " "this can be inconvenient. :func:`getattr_static` has the same signature as :" "func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: ../../library/inspect.rst:1380 +#: ../../library/inspect.rst:1375 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`__getattr__` or :meth:`__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1383 +#: ../../library/inspect.rst:1378 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -1732,31 +1719,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1389 +#: ../../library/inspect.rst:1384 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: ../../library/inspect.rst:1395 +#: ../../library/inspect.rst:1390 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: ../../library/inspect.rst:1399 +#: ../../library/inspect.rst:1394 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: ../../library/inspect.rst:1425 +#: ../../library/inspect.rst:1420 msgid "Current State of Generators and Coroutines" msgstr "" -#: ../../library/inspect.rst:1427 +#: ../../library/inspect.rst:1422 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1765,31 +1752,31 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1435 +#: ../../library/inspect.rst:1430 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1441 ../../library/inspect.rst:1456 +#: ../../library/inspect.rst:1436 ../../library/inspect.rst:1451 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1438 +#: ../../library/inspect.rst:1433 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1439 +#: ../../library/inspect.rst:1434 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1440 +#: ../../library/inspect.rst:1435 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1441 +#: ../../library/inspect.rst:1436 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1447 +#: ../../library/inspect.rst:1442 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -1797,30 +1784,30 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1453 +#: ../../library/inspect.rst:1448 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1454 +#: ../../library/inspect.rst:1449 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1455 +#: ../../library/inspect.rst:1450 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1456 +#: ../../library/inspect.rst:1451 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1460 +#: ../../library/inspect.rst:1455 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: ../../library/inspect.rst:1466 +#: ../../library/inspect.rst:1461 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -1828,14 +1815,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1471 +#: ../../library/inspect.rst:1466 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: ../../library/inspect.rst:1477 +#: ../../library/inspect.rst:1472 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -1843,72 +1830,72 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1486 +#: ../../library/inspect.rst:1481 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1490 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1497 +#: ../../library/inspect.rst:1492 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1502 +#: ../../library/inspect.rst:1497 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1506 +#: ../../library/inspect.rst:1501 msgid "" "If set, a new dict will be created for the frame's ``f_locals`` when the " "code object is executed." msgstr "" -#: ../../library/inspect.rst:1511 +#: ../../library/inspect.rst:1506 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1515 +#: ../../library/inspect.rst:1510 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1519 +#: ../../library/inspect.rst:1514 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1523 +#: ../../library/inspect.rst:1518 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1528 +#: ../../library/inspect.rst:1523 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: ../../library/inspect.rst:1536 +#: ../../library/inspect.rst:1531 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: ../../library/inspect.rst:1545 +#: ../../library/inspect.rst:1540 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: ../../library/inspect.rst:1552 +#: ../../library/inspect.rst:1547 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1916,24 +1903,30 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1562 +#: ../../library/inspect.rst:1557 msgid "Command Line Interface" msgstr "" -#: ../../library/inspect.rst:1564 +#: ../../library/inspect.rst:1559 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1569 +#: ../../library/inspect.rst:1564 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: ../../library/inspect.rst:1575 +#: ../../library/inspect.rst:1570 msgid "" "Print information about the specified object rather than the source code" msgstr "" + +#~ msgid "module" +#~ msgstr "模組" + +#~ msgid "__file__" +#~ msgstr "__file__" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index f8677a3243..097cdf7f2d 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-28 00:17+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-" @@ -1175,17 +1175,21 @@ msgstr "" #: ../../library/multiprocessing.rst:1094 msgid "" -"Set the method which should be used to start child processes. *method* can " -"be ``'fork'``, ``'spawn'`` or ``'forkserver'``." +"Set the method which should be used to start child processes. The *method* " +"argument can be ``'fork'``, ``'spawn'`` or ``'forkserver'``. Raises :exc:" +"`RuntimeError` if the start method has already been set and *force* is not " +"``True``. If *method* is ``None`` and *force* is ``True`` then the start " +"method is set to ``None``. If *method* is ``None`` and *force* is ``False`` " +"then the context is set to the default context." msgstr "" -#: ../../library/multiprocessing.rst:1097 +#: ../../library/multiprocessing.rst:1101 msgid "" "Note that this should be called at most once, and it should be protected " "inside the ``if __name__ == '__main__'`` clause of the main module." msgstr "" -#: ../../library/multiprocessing.rst:1105 +#: ../../library/multiprocessing.rst:1109 msgid "" ":mod:`multiprocessing` contains no analogues of :func:`threading." "active_count`, :func:`threading.enumerate`, :func:`threading.settrace`, :" @@ -1193,75 +1197,75 @@ msgid "" "local`." msgstr "" -#: ../../library/multiprocessing.rst:1112 +#: ../../library/multiprocessing.rst:1116 msgid "Connection Objects" msgstr "" -#: ../../library/multiprocessing.rst:1116 +#: ../../library/multiprocessing.rst:1120 msgid "" "Connection objects allow the sending and receiving of picklable objects or " "strings. They can be thought of as message oriented connected sockets." msgstr "" -#: ../../library/multiprocessing.rst:1119 +#: ../../library/multiprocessing.rst:1123 msgid "" "Connection objects are usually created using :func:`Pipe ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1127 +#: ../../library/multiprocessing.rst:1131 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1130 +#: ../../library/multiprocessing.rst:1134 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1135 +#: ../../library/multiprocessing.rst:1139 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1142 +#: ../../library/multiprocessing.rst:1146 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1146 +#: ../../library/multiprocessing.rst:1150 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1148 +#: ../../library/multiprocessing.rst:1152 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1152 +#: ../../library/multiprocessing.rst:1156 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1154 +#: ../../library/multiprocessing.rst:1158 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1158 +#: ../../library/multiprocessing.rst:1162 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1163 +#: ../../library/multiprocessing.rst:1167 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1165 +#: ../../library/multiprocessing.rst:1169 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1269,7 +1273,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1172 +#: ../../library/multiprocessing.rst:1176 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1277,19 +1281,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1177 +#: ../../library/multiprocessing.rst:1181 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1181 +#: ../../library/multiprocessing.rst:1185 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1188 +#: ../../library/multiprocessing.rst:1192 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1297,45 +1301,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1194 +#: ../../library/multiprocessing.rst:1198 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1199 +#: ../../library/multiprocessing.rst:1203 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1203 +#: ../../library/multiprocessing.rst:1207 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1207 +#: ../../library/multiprocessing.rst:1211 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1212 +#: ../../library/multiprocessing.rst:1216 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1237 +#: ../../library/multiprocessing.rst:1241 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1241 +#: ../../library/multiprocessing.rst:1245 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1343,73 +1347,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1248 +#: ../../library/multiprocessing.rst:1252 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1254 +#: ../../library/multiprocessing.rst:1258 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1258 +#: ../../library/multiprocessing.rst:1262 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1262 +#: ../../library/multiprocessing.rst:1266 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1267 +#: ../../library/multiprocessing.rst:1271 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1273 +#: ../../library/multiprocessing.rst:1277 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1276 -#: ../../library/multiprocessing.rst:1414 +#: ../../library/multiprocessing.rst:1280 +#: ../../library/multiprocessing.rst:1418 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1280 +#: ../../library/multiprocessing.rst:1284 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1285 +#: ../../library/multiprocessing.rst:1289 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1287 +#: ../../library/multiprocessing.rst:1291 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1290 -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1294 +#: ../../library/multiprocessing.rst:1843 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1295 +#: ../../library/multiprocessing.rst:1299 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1300 +#: ../../library/multiprocessing.rst:1304 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1420,25 +1424,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1308 +#: ../../library/multiprocessing.rst:1312 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1312 +#: ../../library/multiprocessing.rst:1316 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1317 -#: ../../library/multiprocessing.rst:1368 +#: ../../library/multiprocessing.rst:1321 +#: ../../library/multiprocessing.rst:1372 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1319 +#: ../../library/multiprocessing.rst:1323 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1446,14 +1450,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1324 +#: ../../library/multiprocessing.rst:1328 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1328 +#: ../../library/multiprocessing.rst:1332 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1467,19 +1471,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1343 +#: ../../library/multiprocessing.rst:1347 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1346 +#: ../../library/multiprocessing.rst:1350 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1352 +#: ../../library/multiprocessing.rst:1356 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1488,20 +1492,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1358 +#: ../../library/multiprocessing.rst:1362 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1362 +#: ../../library/multiprocessing.rst:1366 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1370 +#: ../../library/multiprocessing.rst:1374 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1514,7 +1518,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1380 +#: ../../library/multiprocessing.rst:1384 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1525,14 +1529,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1388 +#: ../../library/multiprocessing.rst:1392 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1395 +#: ../../library/multiprocessing.rst:1399 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1542,7 +1546,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1403 +#: ../../library/multiprocessing.rst:1407 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1551,17 +1555,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1412 +#: ../../library/multiprocessing.rst:1416 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1419 +#: ../../library/multiprocessing.rst:1423 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1424 +#: ../../library/multiprocessing.rst:1428 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1570,13 +1574,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1430 +#: ../../library/multiprocessing.rst:1434 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1435 +#: ../../library/multiprocessing.rst:1439 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1585,32 +1589,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1443 +#: ../../library/multiprocessing.rst:1447 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1445 +#: ../../library/multiprocessing.rst:1449 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1450 +#: ../../library/multiprocessing.rst:1454 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1454 -#: ../../library/multiprocessing.rst:1541 +#: ../../library/multiprocessing.rst:1458 +#: ../../library/multiprocessing.rst:1545 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1458 +#: ../../library/multiprocessing.rst:1462 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -1620,32 +1624,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1465 +#: ../../library/multiprocessing.rst:1469 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1471 +#: ../../library/multiprocessing.rst:1475 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1477 -#: ../../library/multiprocessing.rst:1567 -#: ../../library/multiprocessing.rst:1582 +#: ../../library/multiprocessing.rst:1481 +#: ../../library/multiprocessing.rst:1571 +#: ../../library/multiprocessing.rst:1586 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1481 +#: ../../library/multiprocessing.rst:1485 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1484 +#: ../../library/multiprocessing.rst:1488 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1655,7 +1659,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1491 +#: ../../library/multiprocessing.rst:1495 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -1665,28 +1669,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1498 +#: ../../library/multiprocessing.rst:1502 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1500 +#: ../../library/multiprocessing.rst:1504 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1505 +#: ../../library/multiprocessing.rst:1509 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1510 +#: ../../library/multiprocessing.rst:1514 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1516 +#: ../../library/multiprocessing.rst:1520 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -1695,11 +1699,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1524 +#: ../../library/multiprocessing.rst:1528 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1526 +#: ../../library/multiprocessing.rst:1530 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1709,40 +1713,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1533 +#: ../../library/multiprocessing.rst:1537 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1539 +#: ../../library/multiprocessing.rst:1543 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1545 +#: ../../library/multiprocessing.rst:1549 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1549 +#: ../../library/multiprocessing.rst:1553 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1555 +#: ../../library/multiprocessing.rst:1559 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1559 -#: ../../library/multiprocessing.rst:1575 +#: ../../library/multiprocessing.rst:1563 +#: ../../library/multiprocessing.rst:1579 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -1752,121 +1756,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1571 +#: ../../library/multiprocessing.rst:1575 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1586 +#: ../../library/multiprocessing.rst:1590 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1591 +#: ../../library/multiprocessing.rst:1595 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1595 +#: ../../library/multiprocessing.rst:1599 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1599 +#: ../../library/multiprocessing.rst:1603 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1602 +#: ../../library/multiprocessing.rst:1606 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1606 +#: ../../library/multiprocessing.rst:1610 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1611 +#: ../../library/multiprocessing.rst:1615 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1611 +#: ../../library/multiprocessing.rst:1615 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1611 +#: ../../library/multiprocessing.rst:1615 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1613 +#: ../../library/multiprocessing.rst:1617 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1613 +#: ../../library/multiprocessing.rst:1617 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1613 +#: ../../library/multiprocessing.rst:1617 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1614 +#: ../../library/multiprocessing.rst:1618 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1614 +#: ../../library/multiprocessing.rst:1618 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1619 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1619 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1619 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1616 +#: ../../library/multiprocessing.rst:1620 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1616 +#: ../../library/multiprocessing.rst:1620 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1616 +#: ../../library/multiprocessing.rst:1620 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1624 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1658 +#: ../../library/multiprocessing.rst:1662 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1671 +#: ../../library/multiprocessing.rst:1675 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1673 +#: ../../library/multiprocessing.rst:1677 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1875,7 +1879,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1682 +#: ../../library/multiprocessing.rst:1686 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1883,31 +1887,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1690 +#: ../../library/multiprocessing.rst:1694 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1696 +#: ../../library/multiprocessing.rst:1700 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1698 +#: ../../library/multiprocessing.rst:1702 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1701 +#: ../../library/multiprocessing.rst:1705 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1704 +#: ../../library/multiprocessing.rst:1708 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -1915,19 +1919,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1709 +#: ../../library/multiprocessing.rst:1713 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1712 +#: ../../library/multiprocessing.rst:1716 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1715 +#: ../../library/multiprocessing.rst:1719 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -1935,54 +1939,54 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1720 +#: ../../library/multiprocessing.rst:1724 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1725 +#: ../../library/multiprocessing.rst:1729 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1730 +#: ../../library/multiprocessing.rst:1734 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1739 +#: ../../library/multiprocessing.rst:1743 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1743 +#: ../../library/multiprocessing.rst:1747 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1751 +#: ../../library/multiprocessing.rst:1755 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1754 +#: ../../library/multiprocessing.rst:1758 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1758 +#: ../../library/multiprocessing.rst:1762 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1761 +#: ../../library/multiprocessing.rst:1765 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1764 +#: ../../library/multiprocessing.rst:1768 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -1990,14 +1994,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1770 +#: ../../library/multiprocessing.rst:1774 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1774 +#: ../../library/multiprocessing.rst:1778 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2008,7 +2012,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1783 +#: ../../library/multiprocessing.rst:1787 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -2018,22 +2022,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1790 +#: ../../library/multiprocessing.rst:1794 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1794 +#: ../../library/multiprocessing.rst:1798 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1798 +#: ../../library/multiprocessing.rst:1802 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1800 +#: ../../library/multiprocessing.rst:1804 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2041,173 +2045,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1806 +#: ../../library/multiprocessing.rst:1810 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:1811 +#: ../../library/multiprocessing.rst:1815 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:1815 +#: ../../library/multiprocessing.rst:1819 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:1821 +#: ../../library/multiprocessing.rst:1825 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1828 +#: ../../library/multiprocessing.rst:1832 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1833 +#: ../../library/multiprocessing.rst:1837 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1836 +#: ../../library/multiprocessing.rst:1840 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:1844 +#: ../../library/multiprocessing.rst:1848 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1848 +#: ../../library/multiprocessing.rst:1852 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1852 +#: ../../library/multiprocessing.rst:1856 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1856 +#: ../../library/multiprocessing.rst:1860 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1860 +#: ../../library/multiprocessing.rst:1864 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1864 +#: ../../library/multiprocessing.rst:1868 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1869 +#: ../../library/multiprocessing.rst:1873 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1873 +#: ../../library/multiprocessing.rst:1877 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1880 +#: ../../library/multiprocessing.rst:1884 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1885 +#: ../../library/multiprocessing.rst:1889 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1887 +#: ../../library/multiprocessing.rst:1891 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1894 +#: ../../library/multiprocessing.rst:1898 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1896 +#: ../../library/multiprocessing.rst:1900 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:1899 +#: ../../library/multiprocessing.rst:1903 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:1915 +#: ../../library/multiprocessing.rst:1919 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1917 +#: ../../library/multiprocessing.rst:1921 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:1942 +#: ../../library/multiprocessing.rst:1946 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1944 +#: ../../library/multiprocessing.rst:1948 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:1947 +#: ../../library/multiprocessing.rst:1951 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1959 +#: ../../library/multiprocessing.rst:1963 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1969 +#: ../../library/multiprocessing.rst:1973 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1980 +#: ../../library/multiprocessing.rst:1984 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2005 +#: ../../library/multiprocessing.rst:2009 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2007 +#: ../../library/multiprocessing.rst:2011 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:2011 +#: ../../library/multiprocessing.rst:2015 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2215,14 +2219,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2029 +#: ../../library/multiprocessing.rst:2033 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:2033 +#: ../../library/multiprocessing.rst:2037 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -2230,11 +2234,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2049 +#: ../../library/multiprocessing.rst:2053 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2062 +#: ../../library/multiprocessing.rst:2066 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -2245,53 +2249,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2081 +#: ../../library/multiprocessing.rst:2085 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2087 +#: ../../library/multiprocessing.rst:2091 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2095 +#: ../../library/multiprocessing.rst:2099 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2099 +#: ../../library/multiprocessing.rst:2103 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2103 +#: ../../library/multiprocessing.rst:2107 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2105 +#: ../../library/multiprocessing.rst:2109 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2109 +#: ../../library/multiprocessing.rst:2113 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2113 +#: ../../library/multiprocessing.rst:2117 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2115 +#: ../../library/multiprocessing.rst:2119 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2119 +#: ../../library/multiprocessing.rst:2123 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -2299,79 +2303,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2124 +#: ../../library/multiprocessing.rst:2128 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2127 +#: ../../library/multiprocessing.rst:2131 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2143 +#: ../../library/multiprocessing.rst:2147 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2145 +#: ../../library/multiprocessing.rst:2149 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2153 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2153 +#: ../../library/multiprocessing.rst:2157 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2157 +#: ../../library/multiprocessing.rst:2161 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2159 +#: ../../library/multiprocessing.rst:2163 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2162 +#: ../../library/multiprocessing.rst:2166 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2167 +#: ../../library/multiprocessing.rst:2171 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2172 +#: ../../library/multiprocessing.rst:2176 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2177 +#: ../../library/multiprocessing.rst:2181 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2181 +#: ../../library/multiprocessing.rst:2185 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2184 -#: ../../library/multiprocessing.rst:2745 +#: ../../library/multiprocessing.rst:2188 +#: ../../library/multiprocessing.rst:2749 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2187 +#: ../../library/multiprocessing.rst:2191 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -2379,7 +2383,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2192 +#: ../../library/multiprocessing.rst:2196 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2387,13 +2391,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2198 +#: ../../library/multiprocessing.rst:2202 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2202 +#: ../../library/multiprocessing.rst:2206 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -2401,22 +2405,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2207 +#: ../../library/multiprocessing.rst:2211 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2211 +#: ../../library/multiprocessing.rst:2215 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2214 +#: ../../library/multiprocessing.rst:2218 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2219 +#: ../../library/multiprocessing.rst:2223 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -2427,7 +2431,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2229 +#: ../../library/multiprocessing.rst:2233 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -2435,14 +2439,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2236 +#: ../../library/multiprocessing.rst:2240 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2239 -#: ../../library/multiprocessing.rst:2270 +#: ../../library/multiprocessing.rst:2243 +#: ../../library/multiprocessing.rst:2274 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -2450,60 +2454,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2244 -#: ../../library/multiprocessing.rst:2275 +#: ../../library/multiprocessing.rst:2248 +#: ../../library/multiprocessing.rst:2279 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2248 -#: ../../library/multiprocessing.rst:2279 +#: ../../library/multiprocessing.rst:2252 +#: ../../library/multiprocessing.rst:2283 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2253 +#: ../../library/multiprocessing.rst:2257 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2257 +#: ../../library/multiprocessing.rst:2261 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2261 +#: ../../library/multiprocessing.rst:2265 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2267 +#: ../../library/multiprocessing.rst:2271 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2284 +#: ../../library/multiprocessing.rst:2288 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2286 +#: ../../library/multiprocessing.rst:2290 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2291 +#: ../../library/multiprocessing.rst:2295 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -2511,65 +2515,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2298 +#: ../../library/multiprocessing.rst:2302 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2304 +#: ../../library/multiprocessing.rst:2308 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2308 +#: ../../library/multiprocessing.rst:2312 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2315 +#: ../../library/multiprocessing.rst:2319 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2323 +#: ../../library/multiprocessing.rst:2327 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2328 +#: ../../library/multiprocessing.rst:2332 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2334 +#: ../../library/multiprocessing.rst:2338 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2337 +#: ../../library/multiprocessing.rst:2341 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2345 +#: ../../library/multiprocessing.rst:2349 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2350 +#: ../../library/multiprocessing.rst:2354 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2577,41 +2581,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2357 +#: ../../library/multiprocessing.rst:2361 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2361 +#: ../../library/multiprocessing.rst:2365 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2365 +#: ../../library/multiprocessing.rst:2369 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2368 +#: ../../library/multiprocessing.rst:2372 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2372 +#: ../../library/multiprocessing.rst:2376 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2399 +#: ../../library/multiprocessing.rst:2403 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2404 +#: ../../library/multiprocessing.rst:2408 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2408 +#: ../../library/multiprocessing.rst:2412 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2620,46 +2624,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2417 +#: ../../library/multiprocessing.rst:2421 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2420 +#: ../../library/multiprocessing.rst:2424 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2426 +#: ../../library/multiprocessing.rst:2430 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2429 +#: ../../library/multiprocessing.rst:2433 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2434 +#: ../../library/multiprocessing.rst:2438 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2437 +#: ../../library/multiprocessing.rst:2441 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2441 -#: ../../library/multiprocessing.rst:2476 +#: ../../library/multiprocessing.rst:2445 +#: ../../library/multiprocessing.rst:2480 msgid "" "If *authkey* is given and not None, it should be a byte string and will be " "used as the secret key for an HMAC-based authentication challenge. No " @@ -2668,26 +2672,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2449 +#: ../../library/multiprocessing.rst:2453 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2452 +#: ../../library/multiprocessing.rst:2456 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2457 +#: ../../library/multiprocessing.rst:2461 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2461 +#: ../../library/multiprocessing.rst:2465 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -2701,49 +2705,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2472 +#: ../../library/multiprocessing.rst:2476 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2484 +#: ../../library/multiprocessing.rst:2488 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2491 +#: ../../library/multiprocessing.rst:2495 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2495 +#: ../../library/multiprocessing.rst:2499 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2499 +#: ../../library/multiprocessing.rst:2503 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2503 +#: ../../library/multiprocessing.rst:2507 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2506 +#: ../../library/multiprocessing.rst:2510 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2513 +#: ../../library/multiprocessing.rst:2517 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -2752,32 +2756,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2519 +#: ../../library/multiprocessing.rst:2523 msgid "" "For both Unix and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2522 +#: ../../library/multiprocessing.rst:2526 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2523 +#: ../../library/multiprocessing.rst:2527 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2524 +#: ../../library/multiprocessing.rst:2528 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2527 +#: ../../library/multiprocessing.rst:2531 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2530 +#: ../../library/multiprocessing.rst:2534 msgid "" "**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2785,7 +2789,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2536 +#: ../../library/multiprocessing.rst:2540 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -2794,46 +2798,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2546 +#: ../../library/multiprocessing.rst:2550 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2548 +#: ../../library/multiprocessing.rst:2552 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2567 +#: ../../library/multiprocessing.rst:2571 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2584 +#: ../../library/multiprocessing.rst:2588 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2623 +#: ../../library/multiprocessing.rst:2627 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2625 +#: ../../library/multiprocessing.rst:2629 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2628 +#: ../../library/multiprocessing.rst:2632 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2631 +#: ../../library/multiprocessing.rst:2635 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -2842,17 +2846,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2636 +#: ../../library/multiprocessing.rst:2640 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2643 +#: ../../library/multiprocessing.rst:2647 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2645 +#: ../../library/multiprocessing.rst:2649 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2860,7 +2864,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2651 +#: ../../library/multiprocessing.rst:2655 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -2868,7 +2872,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2657 +#: ../../library/multiprocessing.rst:2661 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2879,17 +2883,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2665 +#: ../../library/multiprocessing.rst:2669 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2669 +#: ../../library/multiprocessing.rst:2673 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2671 +#: ../../library/multiprocessing.rst:2675 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2897,27 +2901,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2678 +#: ../../library/multiprocessing.rst:2682 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2681 +#: ../../library/multiprocessing.rst:2685 msgid "" "When first created the logger has level :data:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2685 +#: ../../library/multiprocessing.rst:2689 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2692 +#: ../../library/multiprocessing.rst:2696 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 " @@ -2926,25 +2930,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2698 +#: ../../library/multiprocessing.rst:2702 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2713 +#: ../../library/multiprocessing.rst:2717 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2717 +#: ../../library/multiprocessing.rst:2721 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2722 +#: ../../library/multiprocessing.rst:2726 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:2727 +#: ../../library/multiprocessing.rst:2731 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2952,7 +2956,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2735 +#: ../../library/multiprocessing.rst:2739 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2962,18 +2966,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2742 +#: ../../library/multiprocessing.rst:2746 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:2748 +#: ../../library/multiprocessing.rst:2752 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2752 +#: ../../library/multiprocessing.rst:2756 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 :" @@ -2983,7 +2987,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2759 +#: ../../library/multiprocessing.rst:2763 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2992,69 +2996,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2769 +#: ../../library/multiprocessing.rst:2773 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2771 +#: ../../library/multiprocessing.rst:2775 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2776 +#: ../../library/multiprocessing.rst:2780 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2778 +#: ../../library/multiprocessing.rst:2782 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2780 +#: ../../library/multiprocessing.rst:2784 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2782 +#: ../../library/multiprocessing.rst:2786 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2785 +#: ../../library/multiprocessing.rst:2789 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:2789 +#: ../../library/multiprocessing.rst:2793 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2791 +#: ../../library/multiprocessing.rst:2795 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2793 +#: ../../library/multiprocessing.rst:2797 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2795 +#: ../../library/multiprocessing.rst:2799 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2798 +#: ../../library/multiprocessing.rst:2802 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2800 +#: ../../library/multiprocessing.rst:2804 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2802 +#: ../../library/multiprocessing.rst:2806 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 :" @@ -3065,11 +3069,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2810 +#: ../../library/multiprocessing.rst:2814 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2812 +#: ../../library/multiprocessing.rst:2816 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3079,11 +3083,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2820 +#: ../../library/multiprocessing.rst:2824 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2822 +#: ../../library/multiprocessing.rst:2826 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3091,18 +3095,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2828 +#: ../../library/multiprocessing.rst:2832 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:2832 +#: ../../library/multiprocessing.rst:2836 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2834 +#: ../../library/multiprocessing.rst:2838 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 " @@ -3111,7 +3115,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2840 +#: ../../library/multiprocessing.rst:2844 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 " @@ -3120,21 +3124,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2846 +#: ../../library/multiprocessing.rst:2850 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2860 +#: ../../library/multiprocessing.rst:2864 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2863 +#: ../../library/multiprocessing.rst:2867 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2865 +#: ../../library/multiprocessing.rst:2869 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. " @@ -3142,7 +3146,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2870 +#: ../../library/multiprocessing.rst:2874 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 " @@ -3151,29 +3155,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2877 +#: ../../library/multiprocessing.rst:2881 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2889 +#: ../../library/multiprocessing.rst:2893 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2901 +#: ../../library/multiprocessing.rst:2905 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2903 +#: ../../library/multiprocessing.rst:2907 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2907 +#: ../../library/multiprocessing.rst:2911 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:2913 +#: ../../library/multiprocessing.rst:2917 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3183,33 +3187,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2920 +#: ../../library/multiprocessing.rst:2924 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:2932 +#: ../../library/multiprocessing.rst:2936 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2935 +#: ../../library/multiprocessing.rst:2939 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2937 +#: ../../library/multiprocessing.rst:2941 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2940 +#: ../../library/multiprocessing.rst:2944 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2942 +#: ../../library/multiprocessing.rst:2946 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3217,11 +3221,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2947 +#: ../../library/multiprocessing.rst:2951 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2949 +#: ../../library/multiprocessing.rst:2953 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 " @@ -3229,66 +3233,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2954 +#: ../../library/multiprocessing.rst:2958 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2959 +#: ../../library/multiprocessing.rst:2963 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2961 +#: ../../library/multiprocessing.rst:2965 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:2965 +#: ../../library/multiprocessing.rst:2969 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2977 +#: ../../library/multiprocessing.rst:2981 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2991 +#: ../../library/multiprocessing.rst:2995 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:2994 +#: ../../library/multiprocessing.rst:2998 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:2997 +#: ../../library/multiprocessing.rst:3001 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3004 +#: ../../library/multiprocessing.rst:3008 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3006 +#: ../../library/multiprocessing.rst:3010 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3012 +#: ../../library/multiprocessing.rst:3016 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:3018 +#: ../../library/multiprocessing.rst:3022 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 7cfb12b743..45c93e853c 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-22 00:18+0000\n" +"POT-Creation-Date: 2022-11-29 00:17+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -21,7 +21,7 @@ msgstr "" #: ../../library/os.rst:2 msgid ":mod:`os` --- Miscellaneous operating system interfaces" -msgstr "" +msgstr ":mod:`os` --- 各種作業系統介面" #: ../../library/os.rst:7 msgid "**Source code:** :source:`Lib/os.py`" @@ -285,41 +285,42 @@ msgid "" "Return the filename corresponding to the controlling terminal of the process." msgstr "" -#: ../../library/os.rst:-1 ../../library/os.rst:181 ../../library/os.rst:353 -#: ../../library/os.rst:362 ../../library/os.rst:385 ../../library/os.rst:394 -#: ../../library/os.rst:429 ../../library/os.rst:437 ../../library/os.rst:476 -#: ../../library/os.rst:487 ../../library/os.rst:497 ../../library/os.rst:507 -#: ../../library/os.rst:530 ../../library/os.rst:563 ../../library/os.rst:570 -#: ../../library/os.rst:577 ../../library/os.rst:587 ../../library/os.rst:598 -#: ../../library/os.rst:607 ../../library/os.rst:625 ../../library/os.rst:633 -#: ../../library/os.rst:641 ../../library/os.rst:650 ../../library/os.rst:658 -#: ../../library/os.rst:665 ../../library/os.rst:672 ../../library/os.rst:681 -#: ../../library/os.rst:1047 ../../library/os.rst:1191 -#: ../../library/os.rst:1217 ../../library/os.rst:1454 -#: ../../library/os.rst:1489 ../../library/os.rst:1498 -#: ../../library/os.rst:1862 ../../library/os.rst:1951 -#: ../../library/os.rst:1991 ../../library/os.rst:2208 -#: ../../library/os.rst:2230 ../../library/os.rst:3755 -#: ../../library/os.rst:3762 ../../library/os.rst:3769 -#: ../../library/os.rst:3776 ../../library/os.rst:3783 -#: ../../library/os.rst:3790 ../../library/os.rst:3797 -#: ../../library/os.rst:3805 ../../library/os.rst:3813 -#: ../../library/os.rst:3820 ../../library/os.rst:3827 -#: ../../library/os.rst:3836 ../../library/os.rst:3844 -#: ../../library/os.rst:3852 ../../library/os.rst:3859 -#: ../../library/os.rst:3866 ../../library/os.rst:3887 -#: ../../library/os.rst:3904 ../../library/os.rst:3944 -#: ../../library/os.rst:3951 ../../library/os.rst:3972 -#: ../../library/os.rst:4099 ../../library/os.rst:4149 -#: ../../library/os.rst:4383 ../../library/os.rst:4404 -#: ../../library/os.rst:4415 ../../library/os.rst:4435 -#: ../../library/os.rst:4450 ../../library/os.rst:4488 -#: ../../library/os.rst:4507 ../../library/os.rst:4521 -#: ../../library/os.rst:4561 ../../library/os.rst:4579 -#: ../../library/os.rst:4593 ../../library/os.rst:4604 -#: ../../library/os.rst:4616 ../../library/os.rst:4623 -#: ../../library/os.rst:4632 ../../library/os.rst:4641 -#: ../../library/os.rst:4650 ../../library/os.rst:4659 +#: ../../library/os.rst:181 ../../library/os.rst:353 ../../library/os.rst:362 +#: ../../library/os.rst:385 ../../library/os.rst:394 ../../library/os.rst:429 +#: ../../library/os.rst:437 ../../library/os.rst:476 ../../library/os.rst:487 +#: ../../library/os.rst:497 ../../library/os.rst:507 ../../library/os.rst:530 +#: ../../library/os.rst:563 ../../library/os.rst:570 ../../library/os.rst:577 +#: ../../library/os.rst:587 ../../library/os.rst:598 ../../library/os.rst:607 +#: ../../library/os.rst:625 ../../library/os.rst:633 ../../library/os.rst:641 +#: ../../library/os.rst:650 ../../library/os.rst:658 ../../library/os.rst:665 +#: ../../library/os.rst:672 ../../library/os.rst:681 ../../library/os.rst:1047 +#: ../../library/os.rst:1191 ../../library/os.rst:1217 +#: ../../library/os.rst:1454 ../../library/os.rst:1489 +#: ../../library/os.rst:1498 ../../library/os.rst:1862 +#: ../../library/os.rst:1951 ../../library/os.rst:1991 +#: ../../library/os.rst:2208 ../../library/os.rst:2230 +#: ../../library/os.rst:3755 ../../library/os.rst:3762 +#: ../../library/os.rst:3769 ../../library/os.rst:3776 +#: ../../library/os.rst:3783 ../../library/os.rst:3790 +#: ../../library/os.rst:3797 ../../library/os.rst:3805 +#: ../../library/os.rst:3813 ../../library/os.rst:3820 +#: ../../library/os.rst:3827 ../../library/os.rst:3836 +#: ../../library/os.rst:3844 ../../library/os.rst:3852 +#: ../../library/os.rst:3859 ../../library/os.rst:3866 +#: ../../library/os.rst:3887 ../../library/os.rst:3904 +#: ../../library/os.rst:3944 ../../library/os.rst:3951 +#: ../../library/os.rst:3972 ../../library/os.rst:4099 +#: ../../library/os.rst:4149 ../../library/os.rst:4386 +#: ../../library/os.rst:4420 ../../library/os.rst:4477 +#: ../../library/os.rst:4491 ../../library/os.rst:4509 +#: ../../library/os.rst:4523 ../../library/os.rst:4535 +#: ../../library/os.rst:4547 ../../library/os.rst:4559 +#: ../../library/os.rst:4568 ../../library/os.rst:4578 +#: ../../library/os.rst:4592 ../../library/os.rst:4642 +#: ../../library/os.rst:4653 ../../library/os.rst:4665 +#: ../../library/os.rst:4672 ../../library/os.rst:4681 +#: ../../library/os.rst:4690 ../../library/os.rst:4699 +#: ../../library/os.rst:4708 #, fuzzy msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -503,9 +504,9 @@ msgstr "" #: ../../library/os.rst:2006 ../../library/os.rst:2019 #: ../../library/os.rst:2274 ../../library/os.rst:2285 #: ../../library/os.rst:2962 ../../library/os.rst:3119 -#: ../../library/os.rst:3352 ../../library/os.rst:4805 -#: ../../library/os.rst:4814 ../../library/os.rst:4835 -#: ../../library/os.rst:4845 ../../library/os.rst:4855 +#: ../../library/os.rst:3352 ../../library/os.rst:4854 +#: ../../library/os.rst:4863 ../../library/os.rst:4884 +#: ../../library/os.rst:4894 ../../library/os.rst:4904 #, fuzzy msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -580,7 +581,8 @@ msgstr "" #: ../../library/os.rst:-1 ../../library/os.rst:421 ../../library/os.rst:458 #: ../../library/os.rst:3713 ../../library/os.rst:3929 -#: ../../library/os.rst:4341 ../../library/os.rst:4552 +#: ../../library/os.rst:4341 ../../library/os.rst:4458 +#: ../../library/os.rst:4627 #, fuzzy msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." @@ -979,7 +981,7 @@ msgstr "" #: ../../library/os.rst:864 ../../library/os.rst:877 msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:分 WASI。" +msgstr ":ref:`適用 `:非 WASI。" #: ../../library/os.rst:865 ../../library/os.rst:1089 msgid "The new file descriptor is now non-inheritable." @@ -1227,7 +1229,7 @@ msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" #: ../../library/os.rst:1102 ../../library/os.rst:1421 -#: ../../library/os.rst:1592 ../../library/os.rst:4489 +#: ../../library/os.rst:1592 ../../library/os.rst:4459 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 :" @@ -4258,7 +4260,7 @@ msgstr "" #: ../../library/os.rst:4005 msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" +msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" #: ../../library/os.rst:4007 msgid "" @@ -4549,9 +4551,9 @@ msgstr "" #: ../../library/os.rst:4231 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " -"family of functions. If either of these values is given, the :func:`spawn" -"\\*` functions will return as soon as the new process has been created, with " -"the process id as the return value." +"family of functions. If either of these values is given, the :func:" +"`spawn\\*` functions will return as soon as the new process has been " +"created, with the process id as the return value." msgstr "" #: ../../library/os.rst:4241 @@ -4750,68 +4752,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4379 ../../library/os.rst:4484 +#: ../../library/os.rst:4379 +msgid "" +"If there are no children that could be waited for, :exc:`ChildProcessError` " +"is raised." +msgstr "" + +#: ../../library/os.rst:4382 ../../library/os.rst:4454 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4386 +#: ../../library/os.rst:4389 msgid "" -":func:`waitpid` can be used to wait for the completion of a specific child " -"process and has more options." +"The other :func:`!wait*` functions documented below can be used to wait for " +"the completion of a specific child process and have more options. :func:" +"`waitpid` is the only one also available on Windows." +msgstr "" + +#: ../../library/os.rst:4396 +msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4391 +#: ../../library/os.rst:4398 msgid "" -"Wait for the completion of one or more child processes. *idtype* can be :" -"data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or :data:`P_PIDFD` on Linux. " -"*id* specifies the pid to wait on. *options* is constructed from the ORing " -"of one or more of :data:`WEXITED`, :data:`WSTOPPED` or :data:`WCONTINUED` " -"and additionally may be ORed with :data:`WNOHANG` or :data:`WNOWAIT`. The " -"return value is an object representing the data contained in the :c:type:" -"`siginfo_t` structure, namely: :attr:`si_pid`, :attr:`si_uid`, :attr:" -"`si_signo`, :attr:`si_status`, :attr:`si_code` or ``None`` if :data:" -"`WNOHANG` is specified and there are no children in a waitable state." +"*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" +"data:`P_PIDFD`. The interpretation of *id* depends on it; see their " +"individual descriptions." msgstr "" -#: ../../library/os.rst:4411 +#: ../../library/os.rst:4401 msgid "" -"These are the possible values for *idtype* in :func:`waitid`. They affect " -"how *id* is interpreted." +"*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" +"data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" +"`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4420 +#: ../../library/os.rst:4405 msgid "" -"This is a Linux-specific *idtype* that indicates that *id* is a file " -"descriptor that refers to a process." +"The return value is an object representing the data contained in the :c:type:" +"`!siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4424 -msgid ":ref:`Availability `: Linux >= 5.4" -msgstr ":ref:`適用 `:Linux 5.4 以上" +#: ../../library/os.rst:4408 +msgid ":attr:`!si_pid` (process ID)" +msgstr "" -#: ../../library/os.rst:4431 -msgid "" -"Flags that can be used in *options* in :func:`waitid` that specify what " -"child signal to wait for." +#: ../../library/os.rst:4409 +msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4446 +#: ../../library/os.rst:4410 +msgid ":attr:`!si_signo` (always :data:`~signal.SIGCHLD`)" +msgstr "" + +#: ../../library/os.rst:4411 msgid "" -"These are the possible values for :attr:`si_code` in the result returned by :" -"func:`waitid`." +":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" +"si_code`)" msgstr "" -#: ../../library/os.rst:4453 -msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." +#: ../../library/os.rst:4412 +msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" +msgstr "" + +#: ../../library/os.rst:4414 +msgid "" +"If :data:`WNOHANG` is specified and there are no matching children in the " +"requested state, ``None`` is returned. Otherwise, if there are no matching " +"children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4459 +#: ../../library/os.rst:4426 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4461 +#: ../../library/os.rst:4428 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 " @@ -4820,7 +4837,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4466 +#: ../../library/os.rst:4433 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 " @@ -4830,13 +4847,16 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4473 +#: ../../library/os.rst:4440 msgid "" -"An :exc:`OSError` is raised with the value of errno when the syscall returns " -"-1." +"*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " +"there are no matching children in the requested state, ``(0, 0)`` is " +"returned. Otherwise, if there are no matching children that could be waited " +"for, :exc:`ChildProcessError` is raised. Other options that can be used " +"are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4476 +#: ../../library/os.rst:4446 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 " @@ -4848,46 +4868,142 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4497 +#: ../../library/os.rst:4467 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 " -"resource usage information is returned. Refer to :mod:`resource`.\\ :func:" -"`~resource.getrusage` for details on resource usage information. The option " -"argument is the same as that provided to :func:`waitpid` and :func:`wait4`." +"resource usage information is returned. Refer to :func:`resource.getrusage` " +"for details on resource usage information. The *options* argument is the " +"same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4504 ../../library/os.rst:4518 +#: ../../library/os.rst:4474 ../../library/os.rst:4488 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4512 +#: ../../library/os.rst:4482 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " -"returned. Refer to :mod:`resource`.\\ :func:`~resource.getrusage` for " -"details on resource usage information. The arguments to :func:`wait4` are " -"the same as those provided to :func:`waitpid`." +"returned. Refer to :func:`resource.getrusage` for details on resource usage " +"information. The arguments to :func:`wait4` are the same as those provided " +"to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4526 -msgid "Convert a wait status to an exit code." +#: ../../library/os.rst:4499 +msgid "" +"These are the possible values for *idtype* in :func:`waitid`. They affect " +"how *id* is interpreted:" +msgstr "" + +#: ../../library/os.rst:4502 +msgid ":data:`!P_PID` - wait for the child whose PID is *id*." +msgstr "" + +#: ../../library/os.rst:4503 +msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." +msgstr "" + +#: ../../library/os.rst:4504 +msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." +msgstr "" + +#: ../../library/os.rst:4505 +msgid "" +":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " +"(a process file descriptor created with :func:`pidfd_open`)." +msgstr "" + +#: ../../library/os.rst:4510 +msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." +msgstr "" + +#: ../../library/os.rst:4513 +msgid "The :data:`!P_PIDFD` constant." +msgstr "" + +#: ../../library/os.rst:4519 +msgid "" +"This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" +"func:`waitid` causes child processes to be reported if they have been " +"continued from a job control stop since they were last reported." msgstr "" #: ../../library/os.rst:4528 +msgid "" +"This *options* flag for :func:`waitid` causes child processes that have " +"terminated to be reported." +msgstr "" + +#: ../../library/os.rst:4531 +msgid "" +"The other ``wait*`` functions always report children that have terminated, " +"so this option is not available for them." +msgstr "" + +#: ../../library/os.rst:4541 +msgid "" +"This *options* flag for :func:`waitid` causes child processes that have been " +"stopped by the delivery of a signal to be reported." +msgstr "" + +#: ../../library/os.rst:4544 ../../library/os.rst:4576 +msgid "This option is not available for the other ``wait*`` functions." +msgstr "" + +#: ../../library/os.rst:4553 +msgid "" +"This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " +"causes child processes to also be reported if they have been stopped but " +"their current state has not been reported since they were stopped." +msgstr "" + +#: ../../library/os.rst:4557 +msgid "This option is not available for :func:`waitid`." +msgstr "" + +#: ../../library/os.rst:4564 +msgid "" +"This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " +"and :func:`waitid` to return right away if no child process status is " +"available immediately." +msgstr "" + +#: ../../library/os.rst:4573 +msgid "" +"This *options* flag causes :func:`waitid` to leave the child in a waitable " +"state, so that a later :func:`!wait*` call can be used to retrieve the child " +"status information again." +msgstr "" + +#: ../../library/os.rst:4588 +msgid "" +"These are the possible values for :attr:`!si_code` in the result returned " +"by :func:`waitid`." +msgstr "" + +#: ../../library/os.rst:4595 +msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." +msgstr "" + +#: ../../library/os.rst:4601 +msgid "Convert a wait status to an exit code." +msgstr "" + +#: ../../library/os.rst:4603 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4530 +#: ../../library/os.rst:4605 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:4533 +#: ../../library/os.rst:4608 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 " @@ -4895,15 +5011,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4537 +#: ../../library/os.rst:4612 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4539 +#: ../../library/os.rst:4614 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4541 +#: ../../library/os.rst:4616 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 " @@ -4911,240 +5027,217 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4548 +#: ../../library/os.rst:4623 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4558 -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:4566 -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:4571 -msgid "Some Unix systems." -msgstr "" - -#: ../../library/os.rst:4576 -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:4582 +#: ../../library/os.rst:4631 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:4588 +#: ../../library/os.rst:4637 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4591 ../../library/os.rst:4657 +#: ../../library/os.rst:4640 ../../library/os.rst:4706 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4598 +#: ../../library/os.rst:4647 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:4602 +#: ../../library/os.rst:4651 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4609 +#: ../../library/os.rst:4658 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4612 +#: ../../library/os.rst:4661 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:4620 +#: ../../library/os.rst:4669 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4628 +#: ../../library/os.rst:4677 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:4637 +#: ../../library/os.rst:4686 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4639 +#: ../../library/os.rst:4688 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4646 +#: ../../library/os.rst:4695 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4648 +#: ../../library/os.rst:4697 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4655 +#: ../../library/os.rst:4704 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:4663 +#: ../../library/os.rst:4712 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:4665 +#: ../../library/os.rst:4714 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:4671 +#: ../../library/os.rst:4720 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:4676 +#: ../../library/os.rst:4725 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:4680 +#: ../../library/os.rst:4729 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:4685 +#: ../../library/os.rst:4734 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:4689 +#: ../../library/os.rst:4738 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:4693 +#: ../../library/os.rst:4742 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:4697 +#: ../../library/os.rst:4746 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:4701 +#: ../../library/os.rst:4750 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:4708 +#: ../../library/os.rst:4757 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:4712 +#: ../../library/os.rst:4761 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:4716 +#: ../../library/os.rst:4765 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:4721 +#: ../../library/os.rst:4770 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4727 +#: ../../library/os.rst:4776 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4733 +#: ../../library/os.rst:4782 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:4740 +#: ../../library/os.rst:4789 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:4747 +#: ../../library/os.rst:4796 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:4753 +#: ../../library/os.rst:4802 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:4759 +#: ../../library/os.rst:4808 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:4765 +#: ../../library/os.rst:4814 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:4770 +#: ../../library/os.rst:4819 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:4777 +#: ../../library/os.rst:4826 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:4784 +#: ../../library/os.rst:4833 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:4789 +#: ../../library/os.rst:4838 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 " @@ -5155,13 +5248,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:4797 +#: ../../library/os.rst:4846 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:4800 +#: ../../library/os.rst:4849 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 " @@ -5169,33 +5262,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:4810 +#: ../../library/os.rst:4859 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:4819 +#: ../../library/os.rst:4868 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:4821 +#: ../../library/os.rst:4870 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:4831 +#: ../../library/os.rst:4880 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:4840 +#: ../../library/os.rst:4889 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5204,44 +5297,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:4850 +#: ../../library/os.rst:4899 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:4856 +#: ../../library/os.rst:4905 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:4859 +#: ../../library/os.rst:4908 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:4862 +#: ../../library/os.rst:4911 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:4868 +#: ../../library/os.rst:4917 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:4876 +#: ../../library/os.rst:4925 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:4885 +#: ../../library/os.rst:4934 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5250,7 +5343,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4895 +#: ../../library/os.rst:4944 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5258,27 +5351,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4904 +#: ../../library/os.rst:4953 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:4912 +#: ../../library/os.rst:4961 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:4919 +#: ../../library/os.rst:4968 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`." +"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:4926 +#: ../../library/os.rst:4975 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 " @@ -5287,36 +5380,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:4935 +#: ../../library/os.rst:4984 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:4946 +#: ../../library/os.rst:4995 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:4954 +#: ../../library/os.rst:5003 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:4959 +#: ../../library/os.rst:5008 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:4962 +#: ../../library/os.rst:5011 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:4965 +#: ../../library/os.rst:5014 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5324,36 +5417,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:4970 +#: ../../library/os.rst:5019 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:4974 +#: ../../library/os.rst:5023 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:4978 +#: ../../library/os.rst:5027 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:4983 +#: ../../library/os.rst:5032 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:4985 +#: ../../library/os.rst:5034 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:4989 +#: ../../library/os.rst:5038 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5363,91 +5456,64 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:4996 +#: ../../library/os.rst:5045 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:5000 +#: ../../library/os.rst:5049 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5003 +#: ../../library/os.rst:5052 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:5007 +#: ../../library/os.rst:5056 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5011 +#: ../../library/os.rst:5060 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:5015 +#: ../../library/os.rst:5064 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:5021 +#: ../../library/os.rst:5070 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5027 +#: ../../library/os.rst:5076 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:5031 +#: ../../library/os.rst:5080 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:5038 +#: ../../library/os.rst:5087 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." msgstr "" - -#~ msgid ":ref:`Availability `: most flavors of Unix, Windows." -#~ msgstr ":ref:`適用 `:大部分的 Unix、Windows。" - -#~ msgid ":ref:`Availability `: most flavors of Unix." -#~ msgstr ":ref:`適用 `:大部分的 Unix。" - -#~ msgid ":ref:`Availability `: recent flavors of Unix." -#~ msgstr ":ref:`適用 `:近期的 Unix。" - -#~ msgid ":ref:`Availability `: some flavors of Unix." -#~ msgstr ":ref:`適用 `:部分的 Unix。" - -#~ msgid ":ref:`Availability `: Linux 4.14 and newer." -#~ msgstr ":ref:`適用 `:Linux 4.14 以上。" - -#~ msgid ":ref:`Availability `: Linux 4.7 and newer." -#~ msgstr ":ref:`適用 `:Linux 4.7 以上。" - -#~ msgid ":ref:`Availability `: Linux 4.16 and newer." -#~ msgstr ":ref:`適用 `:Linux 4.16 以上。" - -#~ msgid ":ref:`Availability `: See :func:`eventfd`" -#~ msgstr ":ref:`適用 `:請見 :func:`eventfd`" - -#~ msgid ":ref:`Availability `: some Unix systems." -#~ msgstr ":ref:`適用 `:部分 Unix 系統。" diff --git a/library/secrets.po b/library/secrets.po index badc79ebdc..a4cc3f1697 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" -"PO-Revision-Date: 2022-06-11 14:07+0800\n" +"POT-Creation-Date: 2022-11-27 00:19+0000\n" +"PO-Revision-Date: 2022-11-30 13:42+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1\n" +"X-Generator: Poedit 3.2\n" #: ../../library/secrets.rst:2 msgid ":mod:`secrets` --- Generate secure random numbers for managing secrets" @@ -175,32 +175,32 @@ msgstr "其他函式" #: ../../library/secrets.rst:131 msgid "" -"Return ``True`` if strings *a* and *b* are equal, otherwise ``False``, using " -"a \"constant-time compare\" to reduce the risk of `timing attacks `_. See :func:`hmac.compare_digest` " -"for additional details." +"Return ``True`` if strings or :term:`bytes-like objects ` " +"*a* and *b* are equal, otherwise ``False``, using a \"constant-time compare" +"\" to reduce the risk of `timing attacks `_. See :func:`hmac.compare_digest` for additional details." msgstr "" -"如果字串 *a* 與 *b* 相等則回傳 ``True``,否則回傳 ``False``,以\"恆定時間比" -"較 (constant-time compare) \"的處理方式可降低\\ `時序攻擊 `_\\ 的風險。 請參閱 :func:`hmac." -"compare_digest` 以了解更多細節。" +"如果字串或\\ :term:`類位元組串物件 ` *a* 與 *b* 相等則回" +"傳 ``True``,否則回傳 ``False``,以\"恆定時間比較 (constant-time compare) " +"\"的處理方式可降低\\ `時序攻擊 `_\\ 的風險。 請參閱 :func:`hmac.compare_digest` 以了解更多細節。" -#: ../../library/secrets.rst:138 +#: ../../library/secrets.rst:140 msgid "Recipes and best practices" msgstr "應用技巧和典範實務(best practices)" -#: ../../library/secrets.rst:140 +#: ../../library/secrets.rst:142 msgid "" "This section shows recipes and best practices for using :mod:`secrets` to " "manage a basic level of security." msgstr "" "本節展示了一些使用 :mod:`secrets` 來管理基本安全等級的應用技巧和典範實務。" -#: ../../library/secrets.rst:143 +#: ../../library/secrets.rst:145 msgid "Generate an eight-character alphanumeric password:" msgstr "產生八個字元長的字母數字密碼:" -#: ../../library/secrets.rst:155 +#: ../../library/secrets.rst:157 msgid "" "Applications should not `store passwords in a recoverable format `_, whether plain text or " @@ -211,7 +211,7 @@ msgstr "" "definitions/257.html>`_,無論是用純文本還是經過加密。 它們應當先加鹽" "(salt),再使用高加密強度的單向(不可逆)雜湊函數來產生雜湊值。" -#: ../../library/secrets.rst:161 +#: ../../library/secrets.rst:163 msgid "" "Generate a ten-character alphanumeric password with at least one lowercase " "character, at least one uppercase character, and at least three digits:" @@ -219,11 +219,11 @@ msgstr "" "產生十個字元長的字母數字密碼,其中包含至少一個小寫字母,至少一個大寫字母以及" "至少三個數字:" -#: ../../library/secrets.rst:178 +#: ../../library/secrets.rst:180 msgid "Generate an `XKCD-style passphrase `_:" msgstr "產生 `XKCD 風格的 passphrase `_:" -#: ../../library/secrets.rst:190 +#: ../../library/secrets.rst:192 msgid "" "Generate a hard-to-guess temporary URL containing a security token suitable " "for password recovery applications:" diff --git a/library/signal.po b/library/signal.po index 6dc0ae9943..e21b977b5a 100644 --- a/library/signal.po +++ b/library/signal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-14 00:18+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+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-" @@ -22,15 +22,19 @@ msgstr "" msgid ":mod:`signal` --- Set handlers for asynchronous events" msgstr "" -#: ../../library/signal.rst:9 +#: ../../library/signal.rst:7 +msgid "**Source code:** :source:`Lib/signal.py`" +msgstr "**原始碼:**\\ :source:`Lib/signal.py`" + +#: ../../library/signal.rst:11 msgid "This module provides mechanisms to use signal handlers in Python." msgstr "" -#: ../../library/signal.rst:13 +#: ../../library/signal.rst:15 msgid "General rules" msgstr "" -#: ../../library/signal.rst:15 +#: ../../library/signal.rst:17 msgid "" "The :func:`signal.signal` function allows defining custom handlers to be " "executed when a signal is received. A small number of default handlers are " @@ -40,7 +44,7 @@ msgid "" "has not changed it." msgstr "" -#: ../../library/signal.rst:22 +#: ../../library/signal.rst:24 msgid "" "A handler for a particular signal, once set, remains installed until it is " "explicitly reset (Python emulates the BSD style interface regardless of the " @@ -48,18 +52,18 @@ msgid "" "`SIGCHLD`, which follows the underlying implementation." msgstr "" -#: ../../library/signal.rst:27 +#: ../../library/signal.rst:29 msgid "" "On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, signals " "are emulated and therefore behave differently. Several functions and signals " "are not available on these platforms." msgstr "" -#: ../../library/signal.rst:32 +#: ../../library/signal.rst:34 msgid "Execution of Python signal handlers" msgstr "" -#: ../../library/signal.rst:34 +#: ../../library/signal.rst:36 msgid "" "A Python signal handler does not get executed inside the low-level (C) " "signal handler. Instead, the low-level signal handler sets a flag which " @@ -68,7 +72,7 @@ msgid "" "instruction). This has consequences:" msgstr "" -#: ../../library/signal.rst:40 +#: ../../library/signal.rst:42 msgid "" "It makes little sense to catch synchronous errors like :const:`SIGFPE` or :" "const:`SIGSEGV` that are caused by an invalid operation in C code. Python " @@ -78,7 +82,7 @@ msgid "" "errors." msgstr "" -#: ../../library/signal.rst:47 +#: ../../library/signal.rst:49 msgid "" "A long-running calculation implemented purely in C (such as regular " "expression matching on a large body of text) may run uninterrupted for an " @@ -86,18 +90,18 @@ msgid "" "signal handlers will be called when the calculation finishes." msgstr "" -#: ../../library/signal.rst:52 +#: ../../library/signal.rst:54 msgid "" "If the handler raises an exception, it will be raised \"out of thin air\" in " "the main thread. See the :ref:`note below ` for a " "discussion." msgstr "" -#: ../../library/signal.rst:60 +#: ../../library/signal.rst:62 msgid "Signals and threads" msgstr "" -#: ../../library/signal.rst:62 +#: ../../library/signal.rst:64 msgid "" "Python signal handlers are always executed in the main Python thread of the " "main interpreter, even if the signal was received in another thread. This " @@ -106,17 +110,17 @@ msgid "" "instead." msgstr "" -#: ../../library/signal.rst:67 +#: ../../library/signal.rst:69 msgid "" "Besides, only the main thread of the main interpreter is allowed to set a " "new signal handler." msgstr "" -#: ../../library/signal.rst:71 +#: ../../library/signal.rst:73 msgid "Module contents" msgstr "模組內容" -#: ../../library/signal.rst:73 +#: ../../library/signal.rst:75 msgid "" "signal (SIG*), handler (:const:`SIG_DFL`, :const:`SIG_IGN`) and sigmask (:" "const:`SIG_BLOCK`, :const:`SIG_UNBLOCK`, :const:`SIG_SETMASK`) related " @@ -127,38 +131,38 @@ msgid "" "class:`Signals` objects." msgstr "" -#: ../../library/signal.rst:83 +#: ../../library/signal.rst:85 msgid "The signal module defines three enums:" msgstr "" -#: ../../library/signal.rst:87 +#: ../../library/signal.rst:89 msgid "" ":class:`enum.IntEnum` collection of SIG* constants and the CTRL_* constants." msgstr "" -#: ../../library/signal.rst:93 +#: ../../library/signal.rst:95 msgid "" ":class:`enum.IntEnum` collection the constants :const:`SIG_DFL` and :const:" "`SIG_IGN`." msgstr "" -#: ../../library/signal.rst:99 +#: ../../library/signal.rst:101 msgid "" ":class:`enum.IntEnum` collection the constants :const:`SIG_BLOCK`, :const:" "`SIG_UNBLOCK` and :const:`SIG_SETMASK`." msgstr "" -#: ../../library/signal.rst:-1 ../../library/signal.rst:134 -#: ../../library/signal.rst:146 ../../library/signal.rst:152 -#: ../../library/signal.rst:162 ../../library/signal.rst:176 -#: ../../library/signal.rst:194 ../../library/signal.rst:202 -#: ../../library/signal.rst:228 ../../library/signal.rst:234 -#: ../../library/signal.rst:240 ../../library/signal.rst:497 -#: ../../library/signal.rst:504 +#: ../../library/signal.rst:-1 ../../library/signal.rst:136 +#: ../../library/signal.rst:148 ../../library/signal.rst:154 +#: ../../library/signal.rst:164 ../../library/signal.rst:178 +#: ../../library/signal.rst:196 ../../library/signal.rst:204 +#: ../../library/signal.rst:230 ../../library/signal.rst:236 +#: ../../library/signal.rst:242 ../../library/signal.rst:499 +#: ../../library/signal.rst:506 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/signal.rst:103 ../../library/signal.rst:469 +#: ../../library/signal.rst:105 ../../library/signal.rst:471 msgid "" "See the man page :manpage:`sigprocmask(2)` and :manpage:`pthread_sigmask(3)` " "for further information." @@ -166,11 +170,11 @@ msgstr "" "更多資訊請見 :manpage:`sigprocmask(2)` 與 :manpage:`pthread_sigmask(3)` 手冊" "頁。" -#: ../../library/signal.rst:109 +#: ../../library/signal.rst:111 msgid "The variables defined in the :mod:`signal` module are:" msgstr "" -#: ../../library/signal.rst:114 +#: ../../library/signal.rst:116 msgid "" "This is one of two standard signal handling options; it will simply perform " "the default function for the signal. For example, on most systems the " @@ -178,93 +182,93 @@ msgid "" "default action for :const:`SIGCHLD` is to simply ignore it." msgstr "" -#: ../../library/signal.rst:122 +#: ../../library/signal.rst:124 msgid "" "This is another standard signal handler, which will simply ignore the given " "signal." msgstr "" -#: ../../library/signal.rst:128 +#: ../../library/signal.rst:130 msgid "Abort signal from :manpage:`abort(3)`." msgstr "" -#: ../../library/signal.rst:132 +#: ../../library/signal.rst:134 msgid "Timer signal from :manpage:`alarm(2)`." msgstr "" -#: ../../library/signal.rst:138 +#: ../../library/signal.rst:140 msgid "Interrupt from keyboard (CTRL + BREAK)." msgstr "" -#: ../../library/signal.rst:140 ../../library/signal.rst:259 -#: ../../library/signal.rst:269 +#: ../../library/signal.rst:142 ../../library/signal.rst:261 +#: ../../library/signal.rst:271 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/signal.rst:144 +#: ../../library/signal.rst:146 msgid "Bus error (bad memory access)." msgstr "" -#: ../../library/signal.rst:150 +#: ../../library/signal.rst:152 msgid "Child process stopped or terminated." msgstr "" -#: ../../library/signal.rst:156 +#: ../../library/signal.rst:158 msgid "Alias to :data:`SIGCHLD`." msgstr "" -#: ../../library/signal.rst:160 +#: ../../library/signal.rst:162 msgid "Continue the process if it is currently stopped" msgstr "" -#: ../../library/signal.rst:166 +#: ../../library/signal.rst:168 msgid "Floating-point exception. For example, division by zero." msgstr "" -#: ../../library/signal.rst:169 +#: ../../library/signal.rst:171 msgid "" ":exc:`ZeroDivisionError` is raised when the second argument of a division or " "modulo operation is zero." msgstr "" -#: ../../library/signal.rst:174 +#: ../../library/signal.rst:176 msgid "" "Hangup detected on controlling terminal or death of controlling process." msgstr "" -#: ../../library/signal.rst:180 +#: ../../library/signal.rst:182 msgid "Illegal instruction." msgstr "" -#: ../../library/signal.rst:184 +#: ../../library/signal.rst:186 msgid "Interrupt from keyboard (CTRL + C)." msgstr "" -#: ../../library/signal.rst:186 +#: ../../library/signal.rst:188 msgid "Default action is to raise :exc:`KeyboardInterrupt`." msgstr "" -#: ../../library/signal.rst:190 +#: ../../library/signal.rst:192 msgid "Kill signal." msgstr "" -#: ../../library/signal.rst:192 +#: ../../library/signal.rst:194 msgid "It cannot be caught, blocked, or ignored." msgstr "" -#: ../../library/signal.rst:198 +#: ../../library/signal.rst:200 msgid "Broken pipe: write to pipe with no readers." msgstr "" -#: ../../library/signal.rst:200 +#: ../../library/signal.rst:202 msgid "Default action is to ignore the signal." msgstr "" -#: ../../library/signal.rst:206 +#: ../../library/signal.rst:208 msgid "Segmentation fault: invalid memory reference." msgstr "" -#: ../../library/signal.rst:210 +#: ../../library/signal.rst:212 msgid "" "Stack fault on coprocessor. The Linux kernel does not raise this signal: it " "can only be raised in user space." @@ -274,29 +278,29 @@ msgstr "" msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/signal.rst:215 +#: ../../library/signal.rst:217 msgid "" "On architectures where the signal is available. See the man page :manpage:" "`signal(7)` for further information." msgstr "" -#: ../../library/signal.rst:222 +#: ../../library/signal.rst:224 msgid "Termination signal." msgstr "" -#: ../../library/signal.rst:226 +#: ../../library/signal.rst:228 msgid "User-defined signal 1." msgstr "" -#: ../../library/signal.rst:232 +#: ../../library/signal.rst:234 msgid "User-defined signal 2." msgstr "" -#: ../../library/signal.rst:238 +#: ../../library/signal.rst:240 msgid "Window resize signal." msgstr "" -#: ../../library/signal.rst:244 +#: ../../library/signal.rst:246 msgid "" "All the signal numbers are defined symbolically. For example, the hangup " "signal is defined as :const:`signal.SIGHUP`; the variable names are " @@ -307,37 +311,37 @@ msgid "" "only those names defined by the system are defined by this module." msgstr "" -#: ../../library/signal.rst:255 +#: ../../library/signal.rst:257 msgid "" "The signal corresponding to the :kbd:`Ctrl+C` keystroke event. This signal " "can only be used with :func:`os.kill`." msgstr "" -#: ../../library/signal.rst:265 +#: ../../library/signal.rst:267 msgid "" "The signal corresponding to the :kbd:`Ctrl+Break` keystroke event. This " "signal can only be used with :func:`os.kill`." msgstr "" -#: ../../library/signal.rst:275 +#: ../../library/signal.rst:277 msgid "" "One more than the number of the highest signal number. Use :func:" "`valid_signals` to get valid signal numbers." msgstr "" -#: ../../library/signal.rst:281 +#: ../../library/signal.rst:283 msgid "" "Decrements interval timer in real time, and delivers :const:`SIGALRM` upon " "expiration." msgstr "" -#: ../../library/signal.rst:287 +#: ../../library/signal.rst:289 msgid "" "Decrements interval timer only when the process is executing, and delivers " "SIGVTALRM upon expiration." msgstr "" -#: ../../library/signal.rst:293 +#: ../../library/signal.rst:295 msgid "" "Decrements interval timer both when the process executes and when the system " "is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, this " @@ -345,29 +349,29 @@ msgid "" "and kernel space. SIGPROF is delivered upon expiration." msgstr "" -#: ../../library/signal.rst:301 +#: ../../library/signal.rst:303 msgid "" "A possible value for the *how* parameter to :func:`pthread_sigmask` " "indicating that signals are to be blocked." msgstr "" -#: ../../library/signal.rst:308 +#: ../../library/signal.rst:310 msgid "" "A possible value for the *how* parameter to :func:`pthread_sigmask` " "indicating that signals are to be unblocked." msgstr "" -#: ../../library/signal.rst:315 +#: ../../library/signal.rst:317 msgid "" "A possible value for the *how* parameter to :func:`pthread_sigmask` " "indicating that the signal mask is to be replaced." msgstr "" -#: ../../library/signal.rst:321 +#: ../../library/signal.rst:323 msgid "The :mod:`signal` module defines one exception:" msgstr "" -#: ../../library/signal.rst:325 +#: ../../library/signal.rst:327 msgid "" "Raised to signal an error from the underlying :func:`setitimer` or :func:" "`getitimer` implementation. Expect this error if an invalid interval timer " @@ -375,17 +379,17 @@ msgid "" "of :exc:`OSError`." msgstr "" -#: ../../library/signal.rst:330 +#: ../../library/signal.rst:332 msgid "" "This error used to be a subtype of :exc:`IOError`, which is now an alias of :" "exc:`OSError`." msgstr "" -#: ../../library/signal.rst:335 +#: ../../library/signal.rst:337 msgid "The :mod:`signal` module defines the following functions:" msgstr "" -#: ../../library/signal.rst:340 +#: ../../library/signal.rst:342 msgid "" "If *time* is non-zero, this function requests that a :const:`SIGALRM` signal " "be sent to the process in *time* seconds. Any previously scheduled alarm is " @@ -396,11 +400,11 @@ msgid "" "scheduled." msgstr "" -#: ../../library/signal.rst:349 +#: ../../library/signal.rst:351 msgid "See the man page :manpage:`alarm(2)` for further information." msgstr "更多資訊請見 :manpage:`alarm(2)` 手冊頁。" -#: ../../library/signal.rst:354 +#: ../../library/signal.rst:356 msgid "" "Return the current signal handler for the signal *signalnum*. The returned " "value may be a callable Python object, or one of the special values :const:" @@ -411,41 +415,41 @@ msgid "" "not installed from Python." msgstr "" -#: ../../library/signal.rst:365 +#: ../../library/signal.rst:367 msgid "" "Returns the description of signal *signalnum*, such as \"Interrupt\" for :" "const:`SIGINT`. Returns :const:`None` if *signalnum* has no description. " "Raises :exc:`ValueError` if *signalnum* is invalid." msgstr "" -#: ../../library/signal.rst:374 +#: ../../library/signal.rst:376 msgid "" "Return the set of valid signal numbers on this platform. This can be less " "than ``range(1, NSIG)`` if some signals are reserved by the system for " "internal use." msgstr "" -#: ../../library/signal.rst:383 +#: ../../library/signal.rst:385 msgid "" "Cause the process to sleep until a signal is received; the appropriate " "handler will then be called. Returns nothing." msgstr "" -#: ../../library/signal.rst:388 +#: ../../library/signal.rst:390 msgid "See the man page :manpage:`signal(2)` for further information." msgstr "更多資訊請見 :manpage:`signal(2)` 手冊頁。" -#: ../../library/signal.rst:390 +#: ../../library/signal.rst:392 msgid "" "See also :func:`sigwait`, :func:`sigwaitinfo`, :func:`sigtimedwait` and :" "func:`sigpending`." msgstr "" -#: ../../library/signal.rst:396 +#: ../../library/signal.rst:398 msgid "Sends a signal to the calling process. Returns nothing." msgstr "" -#: ../../library/signal.rst:403 +#: ../../library/signal.rst:405 msgid "" "Send signal *sig* to the process referred to by file descriptor *pidfd*. " "Python does not currently support the *siginfo* parameter; it must be " @@ -453,15 +457,15 @@ msgid "" "values are currently defined." msgstr "" -#: ../../library/signal.rst:408 +#: ../../library/signal.rst:410 msgid "See the :manpage:`pidfd_send_signal(2)` man page for more information." msgstr "更多資訊請見 :manpage:`pidfd_send_signal(2)` 手冊頁。" -#: ../../library/signal.rst:410 +#: ../../library/signal.rst:412 msgid ":ref:`Availability `: Linux >= 5.1" msgstr ":ref:`適用 `:Linux 5.1 以上" -#: ../../library/signal.rst:416 +#: ../../library/signal.rst:418 msgid "" "Send the signal *signalnum* to the thread *thread_id*, another thread in the " "same process as the caller. The target thread can be executing any code " @@ -472,14 +476,14 @@ msgid "" "running system call to fail with :exc:`InterruptedError`." msgstr "" -#: ../../library/signal.rst:424 +#: ../../library/signal.rst:426 msgid "" "Use :func:`threading.get_ident()` or the :attr:`~threading.Thread.ident` " "attribute of :class:`threading.Thread` objects to get a suitable value for " "*thread_id*." msgstr "" -#: ../../library/signal.rst:428 +#: ../../library/signal.rst:430 msgid "" "If *signalnum* is 0, then no signal is sent, but error checking is still " "performed; this can be used to check if the target thread is still running." @@ -491,67 +495,67 @@ msgid "" "arguments ``thread_id``, ``signalnum``." msgstr "" -#: ../../library/signal.rst:435 +#: ../../library/signal.rst:437 msgid "See the man page :manpage:`pthread_kill(3)` for further information." msgstr "更多資訊請見 :manpage:`pthread_kill(3)` 手冊頁。" -#: ../../library/signal.rst:437 +#: ../../library/signal.rst:439 msgid "See also :func:`os.kill`." msgstr "另請參閱 :func:`os.kill`\\ 。" -#: ../../library/signal.rst:444 +#: ../../library/signal.rst:446 msgid "" "Fetch and/or change the signal mask of the calling thread. The signal mask " "is the set of signals whose delivery is currently blocked for the caller. " "Return the old signal mask as a set of signals." msgstr "" -#: ../../library/signal.rst:448 +#: ../../library/signal.rst:450 msgid "" "The behavior of the call is dependent on the value of *how*, as follows." msgstr "" -#: ../../library/signal.rst:450 +#: ../../library/signal.rst:452 msgid "" ":data:`SIG_BLOCK`: The set of blocked signals is the union of the current " "set and the *mask* argument." msgstr "" -#: ../../library/signal.rst:452 +#: ../../library/signal.rst:454 msgid "" ":data:`SIG_UNBLOCK`: The signals in *mask* are removed from the current set " "of blocked signals. It is permissible to attempt to unblock a signal which " "is not blocked." msgstr "" -#: ../../library/signal.rst:455 +#: ../../library/signal.rst:457 msgid "" ":data:`SIG_SETMASK`: The set of blocked signals is set to the *mask* " "argument." msgstr "" -#: ../../library/signal.rst:458 +#: ../../library/signal.rst:460 msgid "" "*mask* is a set of signal numbers (e.g. {:const:`signal.SIGINT`, :const:" "`signal.SIGTERM`}). Use :func:`~signal.valid_signals` for a full mask " "including all signals." msgstr "" -#: ../../library/signal.rst:462 +#: ../../library/signal.rst:464 msgid "" "For example, ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` reads the " "signal mask of the calling thread." msgstr "" -#: ../../library/signal.rst:465 +#: ../../library/signal.rst:467 msgid ":data:`SIGKILL` and :data:`SIGSTOP` cannot be blocked." msgstr "" -#: ../../library/signal.rst:472 +#: ../../library/signal.rst:474 msgid "See also :func:`pause`, :func:`sigpending` and :func:`sigwait`." msgstr "另請參閱 :func:`pause`\\ 、\\ :func:`sigpending` 與 :func:`sigwait`。" -#: ../../library/signal.rst:479 +#: ../../library/signal.rst:481 msgid "" "Sets given interval timer (one of :const:`signal.ITIMER_REAL`, :const:" "`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified by *which* " @@ -561,7 +565,7 @@ msgid "" "zero." msgstr "" -#: ../../library/signal.rst:486 +#: ../../library/signal.rst:488 msgid "" "When an interval timer fires, a signal is sent to the process. The signal " "sent is dependent on the timer being used; :const:`signal.ITIMER_REAL` will " @@ -569,21 +573,21 @@ msgid "" "`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`." msgstr "" -#: ../../library/signal.rst:492 +#: ../../library/signal.rst:494 msgid "The old values are returned as a tuple: (delay, interval)." msgstr "" -#: ../../library/signal.rst:494 +#: ../../library/signal.rst:496 msgid "" "Attempting to pass an invalid interval timer will cause an :exc:" "`ItimerError`." msgstr "" -#: ../../library/signal.rst:502 +#: ../../library/signal.rst:504 msgid "Returns current value of a given interval timer specified by *which*." msgstr "" -#: ../../library/signal.rst:509 +#: ../../library/signal.rst:511 msgid "" "Set the wakeup file descriptor to *fd*. When a signal is received, the " "signal number is written as a single byte into the fd. This can be used by " @@ -591,7 +595,7 @@ msgid "" "processed." msgstr "" -#: ../../library/signal.rst:514 +#: ../../library/signal.rst:516 msgid "" "The old wakeup fd is returned (or -1 if file descriptor wakeup was not " "enabled). If *fd* is -1, file descriptor wakeup is disabled. If not -1, " @@ -599,7 +603,7 @@ msgid "" "*fd* before calling poll or select again." msgstr "" -#: ../../library/signal.rst:519 ../../library/signal.rst:574 +#: ../../library/signal.rst:521 ../../library/signal.rst:576 msgid "" "When threads are enabled, this function can only be called from :ref:`the " "main thread of the main interpreter `; attempting to " @@ -607,14 +611,14 @@ msgid "" "raised." msgstr "" -#: ../../library/signal.rst:524 +#: ../../library/signal.rst:526 msgid "" "There are two common ways to use this function. In both approaches, you use " "the fd to wake up when a signal arrives, but then they differ in how they " "determine *which* signal or signals have arrived." msgstr "" -#: ../../library/signal.rst:529 +#: ../../library/signal.rst:531 msgid "" "In the first approach, we read the data out of the fd's buffer, and the byte " "values give you the signal numbers. This is simple, but in rare cases it can " @@ -625,7 +629,7 @@ msgid "" "warning to be printed to stderr when signals are lost." msgstr "" -#: ../../library/signal.rst:538 +#: ../../library/signal.rst:540 msgid "" "In the second approach, we use the wakeup fd *only* for wakeups, and ignore " "the actual byte values. In this case, all we care about is whether the fd's " @@ -635,33 +639,33 @@ msgid "" "spurious warning messages." msgstr "" -#: ../../library/signal.rst:545 +#: ../../library/signal.rst:547 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../library/signal.rst:548 +#: ../../library/signal.rst:550 msgid "Added ``warn_on_full_buffer`` parameter." msgstr "新增 ``warn_on_full_buffer`` 參數。" -#: ../../library/signal.rst:553 +#: ../../library/signal.rst:555 msgid "" "Change system call restart behaviour: if *flag* is :const:`False`, system " "calls will be restarted when interrupted by signal *signalnum*, otherwise " "system calls will be interrupted. Returns nothing." msgstr "" -#: ../../library/signal.rst:559 +#: ../../library/signal.rst:561 msgid "See the man page :manpage:`siginterrupt(3)` for further information." msgstr "更多資訊請見 :manpage:`siginterrupt(3)` 手冊頁。" -#: ../../library/signal.rst:561 +#: ../../library/signal.rst:563 msgid "" "Note that installing a signal handler with :func:`signal` will reset the " "restart behaviour to interruptible by implicitly calling :c:func:" "`siginterrupt` with a true *flag* value for the given signal." msgstr "" -#: ../../library/signal.rst:568 +#: ../../library/signal.rst:570 msgid "" "Set the handler for signal *signalnum* to the function *handler*. *handler* " "can be a callable Python object taking two arguments (see below), or one of " @@ -671,7 +675,7 @@ msgid "" "information.)" msgstr "" -#: ../../library/signal.rst:579 +#: ../../library/signal.rst:581 msgid "" "The *handler* is called with two arguments: the signal number and the " "current stack frame (``None`` or a frame object; for a description of frame " @@ -679,7 +683,7 @@ msgid "" "see the attribute descriptions in the :mod:`inspect` module)." msgstr "" -#: ../../library/signal.rst:584 +#: ../../library/signal.rst:586 msgid "" "On Windows, :func:`signal` can only be called with :const:`SIGABRT`, :const:" "`SIGFPE`, :const:`SIGILL`, :const:`SIGINT`, :const:`SIGSEGV`, :const:" @@ -689,23 +693,23 @@ msgid "" "``SIG*`` module level constant." msgstr "" -#: ../../library/signal.rst:595 +#: ../../library/signal.rst:597 msgid "" "Examine the set of signals that are pending for delivery to the calling " "thread (i.e., the signals which have been raised while blocked). Return the " "set of the pending signals." msgstr "" -#: ../../library/signal.rst:601 +#: ../../library/signal.rst:603 msgid "See the man page :manpage:`sigpending(2)` for further information." msgstr "更多資訊請見 :manpage:`sigpending(2)` 手冊頁。" -#: ../../library/signal.rst:603 +#: ../../library/signal.rst:605 msgid "See also :func:`pause`, :func:`pthread_sigmask` and :func:`sigwait`." msgstr "" "另請參閱 :func:`pause`\\ 、\\ :func:`pthread_sigmask` 與 :func:`sigwait`。" -#: ../../library/signal.rst:610 +#: ../../library/signal.rst:612 msgid "" "Suspend execution of the calling thread until the delivery of one of the " "signals specified in the signal set *sigset*. The function accepts the " @@ -713,17 +717,17 @@ msgid "" "number." msgstr "" -#: ../../library/signal.rst:616 +#: ../../library/signal.rst:618 msgid "See the man page :manpage:`sigwait(3)` for further information." msgstr "更多資訊請見 :manpage:`sigwait(3)` 手冊頁。" -#: ../../library/signal.rst:618 +#: ../../library/signal.rst:620 msgid "" "See also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`, :func:" "`sigwaitinfo` and :func:`sigtimedwait`." msgstr "" -#: ../../library/signal.rst:626 +#: ../../library/signal.rst:628 msgid "" "Suspend execution of the calling thread until the delivery of one of the " "signals specified in the signal set *sigset*. The function accepts the " @@ -734,7 +738,7 @@ msgid "" "`InterruptedError` if it is interrupted by a signal that is not in *sigset*." msgstr "" -#: ../../library/signal.rst:635 +#: ../../library/signal.rst:637 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure, namely: :attr:`si_signo`, :attr:`si_code`, :attr:" @@ -742,49 +746,49 @@ msgid "" "`si_band`." msgstr "" -#: ../../library/signal.rst:642 +#: ../../library/signal.rst:644 msgid "See the man page :manpage:`sigwaitinfo(2)` for further information." msgstr "更多資訊請見 :manpage:`sigwaitinfo(2)` 手冊頁。" -#: ../../library/signal.rst:644 +#: ../../library/signal.rst:646 msgid "See also :func:`pause`, :func:`sigwait` and :func:`sigtimedwait`." msgstr "" "另請參閱 :func:`pause`\\ 、\\ :func:`sigwait` 與 :func:`sigtimedwait`。" -#: ../../library/signal.rst:648 +#: ../../library/signal.rst:650 msgid "" "The function is now retried if interrupted by a signal not in *sigset* and " "the signal handler does not raise an exception (see :pep:`475` for the " "rationale)." msgstr "" -#: ../../library/signal.rst:656 +#: ../../library/signal.rst:658 msgid "" "Like :func:`sigwaitinfo`, but takes an additional *timeout* argument " "specifying a timeout. If *timeout* is specified as :const:`0`, a poll is " "performed. Returns :const:`None` if a timeout occurs." msgstr "" -#: ../../library/signal.rst:662 +#: ../../library/signal.rst:664 msgid "See the man page :manpage:`sigtimedwait(2)` for further information." msgstr "更多資訊請見 :manpage:`sigtimedwait(2)` 手冊頁。" -#: ../../library/signal.rst:664 +#: ../../library/signal.rst:666 msgid "See also :func:`pause`, :func:`sigwait` and :func:`sigwaitinfo`." msgstr "另請參閱 :func:`pause`\\ 、\\ :func:`sigwait` 與 :func:`sigwaitinfo`。" -#: ../../library/signal.rst:668 +#: ../../library/signal.rst:670 msgid "" "The function is now retried with the recomputed *timeout* if interrupted by " "a signal not in *sigset* and the signal handler does not raise an exception " "(see :pep:`475` for the rationale)." msgstr "" -#: ../../library/signal.rst:677 +#: ../../library/signal.rst:679 msgid "Examples" msgstr "範例" -#: ../../library/signal.rst:679 +#: ../../library/signal.rst:681 msgid "" "Here is a minimal example program. It uses the :func:`alarm` function to " "limit the time spent waiting to open a file; this is useful if the file is " @@ -794,11 +798,11 @@ msgid "" "signal will be sent, and the handler raises an exception. ::" msgstr "" -#: ../../library/signal.rst:703 +#: ../../library/signal.rst:705 msgid "Note on SIGPIPE" msgstr "" -#: ../../library/signal.rst:705 +#: ../../library/signal.rst:707 msgid "" "Piping output of your program to tools like :manpage:`head(1)` will cause a :" "const:`SIGPIPE` signal to be sent to your process when the receiver of its " @@ -807,7 +811,7 @@ msgid "" "entry point to catch this exception as follows::" msgstr "" -#: ../../library/signal.rst:732 +#: ../../library/signal.rst:734 msgid "" "Do not set :const:`SIGPIPE`'s disposition to :const:`SIG_DFL` in order to " "avoid :exc:`BrokenPipeError`. Doing that would cause your program to exit " @@ -815,11 +819,11 @@ msgid "" "program is still writing to it." msgstr "" -#: ../../library/signal.rst:741 +#: ../../library/signal.rst:743 msgid "Note on Signal Handlers and Exceptions" msgstr "" -#: ../../library/signal.rst:743 +#: ../../library/signal.rst:745 msgid "" "If a signal handler raises an exception, the exception will be propagated to " "the main thread and may be raised after any :term:`bytecode` instruction. " @@ -830,11 +834,11 @@ msgid "" "program in an unexpected state." msgstr "" -#: ../../library/signal.rst:750 +#: ../../library/signal.rst:752 msgid "To illustrate this issue, consider the following code::" msgstr "" -#: ../../library/signal.rst:767 +#: ../../library/signal.rst:769 msgid "" "For many programs, especially those that merely want to exit on :exc:" "`KeyboardInterrupt`, this is not a problem, but applications that are " diff --git a/library/socketserver.po b/library/socketserver.po index 24894cb830..463f3a2ad4 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-11-30 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -127,38 +127,37 @@ msgstr "" msgid "" "Note that :class:`UnixDatagramServer` derives from :class:`UDPServer`, not " "from :class:`UnixStreamServer` --- the only difference between an IP and a " -"Unix stream server is the address family, which is simply repeated in both " -"Unix server classes." +"Unix server is the address family." msgstr "" -#: ../../library/socketserver.rst:106 +#: ../../library/socketserver.rst:105 msgid "" "Forking and threading versions of each type of server can be created using " "these mix-in classes. For instance, :class:`ThreadingUDPServer` is created " "as follows::" msgstr "" -#: ../../library/socketserver.rst:113 +#: ../../library/socketserver.rst:112 msgid "" "The mix-in class comes first, since it overrides a method defined in :class:" "`UDPServer`. Setting the various attributes also changes the behavior of " "the underlying server mechanism." msgstr "" -#: ../../library/socketserver.rst:117 +#: ../../library/socketserver.rst:116 msgid "" ":class:`ForkingMixIn` and the Forking classes mentioned below are only " "available on POSIX platforms that support :func:`~os.fork`." msgstr "" -#: ../../library/socketserver.rst:120 +#: ../../library/socketserver.rst:119 msgid "" ":meth:`socketserver.ForkingMixIn.server_close` waits until all child " "processes complete, except if :attr:`socketserver.ForkingMixIn." "block_on_close` attribute is false." msgstr "" -#: ../../library/socketserver.rst:124 +#: ../../library/socketserver.rst:123 msgid "" ":meth:`socketserver.ThreadingMixIn.server_close` waits until all non-daemon " "threads complete, except if :attr:`socketserver.ThreadingMixIn." @@ -167,7 +166,7 @@ msgid "" "complete." msgstr "" -#: ../../library/socketserver.rst:133 +#: ../../library/socketserver.rst:132 msgid "" ":meth:`socketserver.ForkingMixIn.server_close` and :meth:`socketserver." "ThreadingMixIn.server_close` now waits until all child processes and non-" @@ -175,11 +174,11 @@ msgid "" "block_on_close` class attribute to opt-in for the pre-3.7 behaviour." msgstr "" -#: ../../library/socketserver.rst:145 +#: ../../library/socketserver.rst:144 msgid "These classes are pre-defined using the mix-in classes." msgstr "" -#: ../../library/socketserver.rst:148 +#: ../../library/socketserver.rst:147 msgid "" "To implement a service, you must derive a class from :class:" "`BaseRequestHandler` and redefine its :meth:`~BaseRequestHandler.handle` " @@ -190,7 +189,7 @@ msgid "" "`DatagramRequestHandler`." msgstr "" -#: ../../library/socketserver.rst:156 +#: ../../library/socketserver.rst:155 msgid "" "Of course, you still have to use your head! For instance, it makes no sense " "to use a forking server if the service contains state in memory that can be " @@ -200,7 +199,7 @@ msgid "" "probably have to use locks to protect the integrity of the shared data." msgstr "" -#: ../../library/socketserver.rst:163 +#: ../../library/socketserver.rst:162 msgid "" "On the other hand, if you are building an HTTP server where all data is " "stored externally (for instance, in the file system), a synchronous class " @@ -210,7 +209,7 @@ msgid "" "appropriate." msgstr "" -#: ../../library/socketserver.rst:169 +#: ../../library/socketserver.rst:168 msgid "" "In some cases, it may be appropriate to process part of a request " "synchronously, but to finish processing in a forked child depending on the " @@ -219,7 +218,7 @@ msgid "" "`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:174 +#: ../../library/socketserver.rst:173 msgid "" "Another approach to handling multiple simultaneous requests in an " "environment that supports neither threads nor :func:`~os.fork` (or where " @@ -232,11 +231,11 @@ msgid "" "this." msgstr "" -#: ../../library/socketserver.rst:188 +#: ../../library/socketserver.rst:187 msgid "Server Objects" msgstr "" -#: ../../library/socketserver.rst:192 +#: ../../library/socketserver.rst:191 msgid "" "This is the superclass of all Server objects in the module. It defines the " "interface, given below, but does not implement most of the methods, which is " @@ -244,14 +243,14 @@ msgid "" "`server_address` and :attr:`RequestHandlerClass` attributes." msgstr "" -#: ../../library/socketserver.rst:200 +#: ../../library/socketserver.rst:199 msgid "" "Return an integer file descriptor for the socket on which the server is " "listening. This function is most commonly passed to :mod:`selectors`, to " "allow monitoring multiple servers in the same process." msgstr "" -#: ../../library/socketserver.rst:207 +#: ../../library/socketserver.rst:206 msgid "" "Process a single request. This function calls the following methods in " "order: :meth:`get_request`, :meth:`verify_request`, and :meth:" @@ -262,7 +261,7 @@ msgid "" "`handle_request` will return." msgstr "" -#: ../../library/socketserver.rst:219 +#: ../../library/socketserver.rst:218 msgid "" "Handle requests until an explicit :meth:`shutdown` request. Poll for " "shutdown every *poll_interval* seconds. Ignores the :attr:`timeout` " @@ -272,41 +271,41 @@ msgid "" "clean up zombie child processes." msgstr "" -#: ../../library/socketserver.rst:227 +#: ../../library/socketserver.rst:226 msgid "Added ``service_actions`` call to the ``serve_forever`` method." msgstr "" -#: ../../library/socketserver.rst:233 +#: ../../library/socketserver.rst:232 msgid "" "This is called in the :meth:`serve_forever` loop. This method can be " "overridden by subclasses or mixin classes to perform actions specific to a " "given service, such as cleanup actions." msgstr "" -#: ../../library/socketserver.rst:241 +#: ../../library/socketserver.rst:240 msgid "" "Tell the :meth:`serve_forever` loop to stop and wait until it does. :meth:" "`shutdown` must be called while :meth:`serve_forever` is running in a " "different thread otherwise it will deadlock." msgstr "" -#: ../../library/socketserver.rst:248 +#: ../../library/socketserver.rst:247 msgid "Clean up the server. May be overridden." msgstr "" -#: ../../library/socketserver.rst:253 +#: ../../library/socketserver.rst:252 msgid "" "The family of protocols to which the server's socket belongs. Common " "examples are :const:`socket.AF_INET` and :const:`socket.AF_UNIX`." msgstr "" -#: ../../library/socketserver.rst:259 +#: ../../library/socketserver.rst:258 msgid "" "The user-provided request handler class; an instance of this class is " "created for each request." msgstr "" -#: ../../library/socketserver.rst:265 +#: ../../library/socketserver.rst:264 msgid "" "The address on which the server is listening. The format of addresses " "varies depending on the protocol family; see the documentation for the :mod:" @@ -315,22 +314,22 @@ msgid "" "``('127.0.0.1', 80)``, for example." msgstr "" -#: ../../library/socketserver.rst:274 +#: ../../library/socketserver.rst:273 msgid "" "The socket object on which the server will listen for incoming requests." msgstr "" -#: ../../library/socketserver.rst:277 +#: ../../library/socketserver.rst:276 msgid "The server classes support the following class variables:" msgstr "" -#: ../../library/socketserver.rst:283 +#: ../../library/socketserver.rst:282 msgid "" "Whether the server will allow the reuse of an address. This defaults to :" "const:`False`, and can be set in subclasses to change the policy." msgstr "" -#: ../../library/socketserver.rst:289 +#: ../../library/socketserver.rst:288 msgid "" "The size of the request queue. If it takes a long time to process a single " "request, any requests that arrive while the server is busy are placed into a " @@ -339,40 +338,40 @@ msgid "" "default value is usually 5, but this can be overridden by subclasses." msgstr "" -#: ../../library/socketserver.rst:298 +#: ../../library/socketserver.rst:297 msgid "" "The type of socket used by the server; :const:`socket.SOCK_STREAM` and :" "const:`socket.SOCK_DGRAM` are two common values." msgstr "" -#: ../../library/socketserver.rst:304 +#: ../../library/socketserver.rst:303 msgid "" "Timeout duration, measured in seconds, or :const:`None` if no timeout is " "desired. If :meth:`handle_request` receives no incoming requests within the " "timeout period, the :meth:`handle_timeout` method is called." msgstr "" -#: ../../library/socketserver.rst:309 +#: ../../library/socketserver.rst:308 msgid "" "There are various server methods that can be overridden by subclasses of " "base server classes like :class:`TCPServer`; these methods aren't useful to " "external users of the server object." msgstr "" -#: ../../library/socketserver.rst:318 +#: ../../library/socketserver.rst:317 msgid "" "Actually processes the request by instantiating :attr:`RequestHandlerClass` " "and calling its :meth:`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:324 +#: ../../library/socketserver.rst:323 msgid "" "Must accept a request from the socket, and return a 2-tuple containing the " "*new* socket object to be used to communicate with the client, and the " "client's address." msgstr "" -#: ../../library/socketserver.rst:331 +#: ../../library/socketserver.rst:330 msgid "" "This function is called if the :meth:`~BaseRequestHandler.handle` method of " "a :attr:`RequestHandlerClass` instance raises an exception. The default " @@ -380,11 +379,11 @@ msgid "" "further requests." msgstr "" -#: ../../library/socketserver.rst:336 +#: ../../library/socketserver.rst:335 msgid "Now only called for exceptions derived from the :exc:`Exception` class." msgstr "" -#: ../../library/socketserver.rst:343 +#: ../../library/socketserver.rst:342 msgid "" "This function is called when the :attr:`timeout` attribute has been set to a " "value other than :const:`None` and the timeout period has passed with no " @@ -393,7 +392,7 @@ msgid "" "threading servers this method does nothing." msgstr "" -#: ../../library/socketserver.rst:352 +#: ../../library/socketserver.rst:351 msgid "" "Calls :meth:`finish_request` to create an instance of the :attr:" "`RequestHandlerClass`. If desired, this function can create a new process " @@ -401,20 +400,20 @@ msgid "" "`ThreadingMixIn` classes do this." msgstr "" -#: ../../library/socketserver.rst:364 +#: ../../library/socketserver.rst:363 msgid "" "Called by the server's constructor to activate the server. The default " "behavior for a TCP server just invokes :meth:`~socket.socket.listen` on the " "server's socket. May be overridden." msgstr "" -#: ../../library/socketserver.rst:371 +#: ../../library/socketserver.rst:370 msgid "" "Called by the server's constructor to bind the socket to the desired " "address. May be overridden." msgstr "" -#: ../../library/socketserver.rst:377 +#: ../../library/socketserver.rst:376 msgid "" "Must return a Boolean value; if the value is :const:`True`, the request will " "be processed, and if it's :const:`False`, the request will be denied. This " @@ -422,17 +421,17 @@ msgid "" "default implementation always returns :const:`True`." msgstr "" -#: ../../library/socketserver.rst:383 +#: ../../library/socketserver.rst:382 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`server_close`." msgstr "" -#: ../../library/socketserver.rst:389 +#: ../../library/socketserver.rst:388 msgid "Request Handler Objects" msgstr "" -#: ../../library/socketserver.rst:393 +#: ../../library/socketserver.rst:392 msgid "" "This is the superclass of all request handler objects. It defines the " "interface, given below. A concrete request handler subclass must define a " @@ -440,13 +439,13 @@ msgid "" "instance of the subclass is created for each request." msgstr "" -#: ../../library/socketserver.rst:402 +#: ../../library/socketserver.rst:401 msgid "" "Called before the :meth:`handle` method to perform any initialization " "actions required. The default implementation does nothing." msgstr "" -#: ../../library/socketserver.rst:408 +#: ../../library/socketserver.rst:407 msgid "" "This function must do all the work required to service a request. The " "default implementation does nothing. Several instance attributes are " @@ -455,62 +454,58 @@ msgid "" "attr:`self.server`, in case it needs access to per-server information." msgstr "" -#: ../../library/socketserver.rst:414 +#: ../../library/socketserver.rst:413 msgid "" "The type of :attr:`self.request` is different for datagram or stream " "services. For stream services, :attr:`self.request` is a socket object; for " "datagram services, :attr:`self.request` is a pair of string and socket." msgstr "" -#: ../../library/socketserver.rst:421 +#: ../../library/socketserver.rst:420 msgid "" "Called after the :meth:`handle` method to perform any clean-up actions " "required. The default implementation does nothing. If :meth:`setup` raises " "an exception, this function will not be called." msgstr "" -#: ../../library/socketserver.rst:429 +#: ../../library/socketserver.rst:428 msgid "" "These :class:`BaseRequestHandler` subclasses override the :meth:" "`~BaseRequestHandler.setup` and :meth:`~BaseRequestHandler.finish` methods, " "and provide :attr:`self.rfile` and :attr:`self.wfile` attributes. The :attr:" "`self.rfile` and :attr:`self.wfile` attributes can be read or written, " -"respectively, to get the request data or return data to the client." -msgstr "" - -#: ../../library/socketserver.rst:436 -msgid "" -"The :attr:`rfile` attributes of both classes support the :class:`io." -"BufferedIOBase` readable interface, and :attr:`DatagramRequestHandler.wfile` " -"supports the :class:`io.BufferedIOBase` writable interface." +"respectively, to get the request data or return data to the client. The :" +"attr:`!rfile` attributes support the :class:`io.BufferedIOBase` readable " +"interface, and :attr:`!wfile` attributes support the :class:`!io." +"BufferedIOBase` writable interface." msgstr "" -#: ../../library/socketserver.rst:441 +#: ../../library/socketserver.rst:437 msgid "" ":attr:`StreamRequestHandler.wfile` also supports the :class:`io." "BufferedIOBase` writable interface." msgstr "" -#: ../../library/socketserver.rst:447 +#: ../../library/socketserver.rst:443 msgid "Examples" msgstr "範例" -#: ../../library/socketserver.rst:450 +#: ../../library/socketserver.rst:446 msgid ":class:`socketserver.TCPServer` Example" msgstr ":class:`socketserver.TCPServer` 範例" -#: ../../library/socketserver.rst:452 ../../library/socketserver.rst:551 +#: ../../library/socketserver.rst:448 ../../library/socketserver.rst:547 msgid "This is the server side::" msgstr "" -#: ../../library/socketserver.rst:482 +#: ../../library/socketserver.rst:478 msgid "" "An alternative request handler class that makes use of streams (file-like " "objects that simplify communication by providing the standard file " "interface)::" msgstr "" -#: ../../library/socketserver.rst:497 +#: ../../library/socketserver.rst:493 msgid "" "The difference is that the ``readline()`` call in the second handler will " "call ``recv()`` multiple times until it encounters a newline character, " @@ -518,47 +513,47 @@ msgid "" "has been sent from the client in one ``sendall()`` call." msgstr "" -#: ../../library/socketserver.rst:503 ../../library/socketserver.rst:575 +#: ../../library/socketserver.rst:499 ../../library/socketserver.rst:571 msgid "This is the client side::" msgstr "" -#: ../../library/socketserver.rst:524 ../../library/socketserver.rst:650 +#: ../../library/socketserver.rst:520 ../../library/socketserver.rst:646 msgid "The output of the example should look something like this:" msgstr "" -#: ../../library/socketserver.rst:526 +#: ../../library/socketserver.rst:522 msgid "Server:" msgstr "" -#: ../../library/socketserver.rst:536 +#: ../../library/socketserver.rst:532 msgid "Client:" msgstr "" -#: ../../library/socketserver.rst:549 +#: ../../library/socketserver.rst:545 msgid ":class:`socketserver.UDPServer` Example" msgstr ":class:`socketserver.UDPServer` 範例" -#: ../../library/socketserver.rst:594 +#: ../../library/socketserver.rst:590 msgid "" "The output of the example should look exactly like for the TCP server " "example." msgstr "" -#: ../../library/socketserver.rst:598 +#: ../../library/socketserver.rst:594 msgid "Asynchronous Mixins" msgstr "" -#: ../../library/socketserver.rst:600 +#: ../../library/socketserver.rst:596 msgid "" "To build asynchronous handlers, use the :class:`ThreadingMixIn` and :class:" "`ForkingMixIn` classes." msgstr "" -#: ../../library/socketserver.rst:603 +#: ../../library/socketserver.rst:599 msgid "An example for the :class:`ThreadingMixIn` class::" msgstr "" -#: ../../library/socketserver.rst:661 +#: ../../library/socketserver.rst:657 msgid "" "The :class:`ForkingMixIn` class is used in the same way, except that the " "server will spawn a new process for each request. Available only on POSIX " diff --git a/library/sqlite3.po b/library/sqlite3.po index db44c8b70d..b0b9e6e502 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-12 20:01+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+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-" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/sqlite3.rst:2 msgid ":mod:`sqlite3` --- DB-API 2.0 interface for SQLite databases" -msgstr "" +msgstr ":mod:`sqlite3` --- SQLite 資料庫的 DB-API 2.0 介面" #: ../../library/sqlite3.rst:9 msgid "**Source code:** :source:`Lib/sqlite3/`" @@ -236,24 +236,28 @@ msgstr ":ref:`sqlite3-adapters`" msgid ":ref:`sqlite3-converters`" msgstr ":ref:`sqlite3-converters`" -#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:557 +#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:558 msgid ":ref:`sqlite3-connection-context-manager`" msgstr ":ref:`sqlite3-connection-context-manager`" -#: ../../library/sqlite3.rst:243 +#: ../../library/sqlite3.rst:242 +msgid ":ref:`sqlite3-howto-row-factory`" +msgstr ":ref:`sqlite3-howto-row-factory`" + +#: ../../library/sqlite3.rst:244 msgid "" ":ref:`sqlite3-explanation` for in-depth background on transaction control." msgstr "" -#: ../../library/sqlite3.rst:248 +#: ../../library/sqlite3.rst:249 msgid "Reference" msgstr "" -#: ../../library/sqlite3.rst:256 +#: ../../library/sqlite3.rst:257 msgid "Module functions" msgstr "" -#: ../../library/sqlite3.rst:263 +#: ../../library/sqlite3.rst:264 msgid "Open a connection to an SQLite database." msgstr "" @@ -261,13 +265,13 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/sqlite3.rst:265 +#: ../../library/sqlite3.rst:266 msgid "" "The path to the database file to be opened. Pass ``\":memory:\"`` to open a " "connection to a database that is in RAM instead of on disk." msgstr "" -#: ../../library/sqlite3.rst:271 +#: ../../library/sqlite3.rst:272 msgid "" "How many seconds the connection should wait before raising an exception, if " "the database is locked by another connection. If another connection opens a " @@ -275,7 +279,7 @@ msgid "" "is committed. Default five seconds." msgstr "" -#: ../../library/sqlite3.rst:278 +#: ../../library/sqlite3.rst:279 msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " @@ -288,7 +292,7 @@ msgid "" "disabled." msgstr "" -#: ../../library/sqlite3.rst:292 +#: ../../library/sqlite3.rst:293 msgid "" "The :attr:`~Connection.isolation_level` of the connection, controlling " "whether and how transactions are implicitly opened. Can be ``\"DEFERRED\"`` " @@ -297,26 +301,26 @@ msgid "" "for more." msgstr "" -#: ../../library/sqlite3.rst:300 +#: ../../library/sqlite3.rst:301 msgid "" "If ``True`` (default), only the creating thread may use the connection. If " "``False``, the connection may be shared across multiple threads; if so, " "write operations should be serialized by the user to avoid data corruption." msgstr "" -#: ../../library/sqlite3.rst:306 +#: ../../library/sqlite3.rst:307 msgid "" "A custom subclass of :class:`Connection` to create the connection with, if " "not the default :class:`Connection` class." msgstr "" -#: ../../library/sqlite3.rst:310 +#: ../../library/sqlite3.rst:311 msgid "" "The number of statements that :mod:`!sqlite3` should internally cache for " "this connection, to avoid parsing overhead. By default, 128 statements." msgstr "" -#: ../../library/sqlite3.rst:315 +#: ../../library/sqlite3.rst:316 msgid "" "If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform " "Resource Identifier)` with a file path and an optional query string. The " @@ -341,20 +345,20 @@ msgid "" "argument ``connection_handle``." msgstr "" -#: ../../library/sqlite3.rst:329 +#: ../../library/sqlite3.rst:330 msgid "The *uri* parameter." msgstr "*uri* 參數。" -#: ../../library/sqlite3.rst:332 +#: ../../library/sqlite3.rst:333 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:335 +#: ../../library/sqlite3.rst:336 msgid "The ``sqlite3.connect/handle`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:340 +#: ../../library/sqlite3.rst:341 msgid "" "Return ``True`` if the string *statement* appears to contain one or more " "complete SQL statements. No syntactic verification or parsing of any kind is " @@ -362,18 +366,18 @@ msgid "" "and the statement is terminated by a semicolon." msgstr "" -#: ../../library/sqlite3.rst:346 +#: ../../library/sqlite3.rst:347 msgid "For example:" msgstr "範例:" -#: ../../library/sqlite3.rst:355 +#: ../../library/sqlite3.rst:356 msgid "" "This function may be useful during command-line input to determine if the " "entered text seems to form a complete SQL statement, or if additional input " "is needed before calling :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:361 +#: ../../library/sqlite3.rst:362 msgid "" "Enable or disable callback tracebacks. By default you will not get any " "tracebacks in user-defined functions, aggregates, converters, authorizer " @@ -382,13 +386,13 @@ msgid "" "on :data:`sys.stderr`. Use ``False`` to disable the feature again." msgstr "" -#: ../../library/sqlite3.rst:368 +#: ../../library/sqlite3.rst:369 msgid "" "Register an :func:`unraisable hook handler ` for an " "improved debug experience:" msgstr "" -#: ../../library/sqlite3.rst:393 +#: ../../library/sqlite3.rst:394 msgid "" "Register an *adapter* callable to adapt the Python type *type* into an " "SQLite type. The adapter is called with a Python object of type *type* as " @@ -396,7 +400,7 @@ msgid "" "natively understands `." msgstr "" -#: ../../library/sqlite3.rst:401 +#: ../../library/sqlite3.rst:402 msgid "" "Register the *converter* callable to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " @@ -406,17 +410,17 @@ msgid "" "type detection works." msgstr "" -#: ../../library/sqlite3.rst:409 +#: ../../library/sqlite3.rst:410 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" -#: ../../library/sqlite3.rst:416 +#: ../../library/sqlite3.rst:417 msgid "Module constants" msgstr "" -#: ../../library/sqlite3.rst:420 +#: ../../library/sqlite3.rst:421 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function by using the type name, parsed from the query " @@ -424,13 +428,13 @@ msgid "" "in square brackets (``[]``)." msgstr "" -#: ../../library/sqlite3.rst:430 +#: ../../library/sqlite3.rst:431 msgid "" "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:435 +#: ../../library/sqlite3.rst:436 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function using the declared types for each column. The " @@ -439,46 +443,46 @@ msgid "" "the converter dictionary key. For example:" msgstr "" -#: ../../library/sqlite3.rst:451 +#: ../../library/sqlite3.rst:452 msgid "" "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:458 +#: ../../library/sqlite3.rst:459 msgid "" "Flags that should be returned by the *authorizer_callback* callable passed " "to :meth:`Connection.set_authorizer`, to indicate whether:" msgstr "" -#: ../../library/sqlite3.rst:461 +#: ../../library/sqlite3.rst:462 msgid "Access is allowed (:const:`!SQLITE_OK`)," msgstr "" -#: ../../library/sqlite3.rst:462 +#: ../../library/sqlite3.rst:463 msgid "" "The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)" msgstr "" -#: ../../library/sqlite3.rst:463 +#: ../../library/sqlite3.rst:464 msgid "" "The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)" msgstr "" -#: ../../library/sqlite3.rst:467 +#: ../../library/sqlite3.rst:468 msgid "" "String constant stating the supported DB-API level. Required by the DB-API. " "Hard-coded to ``\"2.0\"``." msgstr "" -#: ../../library/sqlite3.rst:472 +#: ../../library/sqlite3.rst:473 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" -"\"``." +"the :mod:`!sqlite3` module. Required by the DB-API. Hard-coded to " +"``\"qmark\"``." msgstr "" -#: ../../library/sqlite3.rst:478 +#: ../../library/sqlite3.rst:479 msgid "" "The :mod:`!sqlite3` module supports ``qmark``, ``numeric``, and ``named`` DB-" "API parameter styles, because that is what the underlying SQLite library " @@ -486,18 +490,18 @@ msgid "" "``paramstyle`` attribute." msgstr "" -#: ../../library/sqlite3.rst:486 +#: ../../library/sqlite3.rst:487 msgid "" "Version number of the runtime SQLite library as a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:490 +#: ../../library/sqlite3.rst:491 msgid "" "Version number of the runtime SQLite library as a :class:`tuple` of :class:" "`integers `." msgstr "" -#: ../../library/sqlite3.rst:495 +#: ../../library/sqlite3.rst:496 msgid "" "Integer constant required by the DB-API 2.0, stating the level of thread " "safety the :mod:`!sqlite3` module supports. This attribute is set based on " @@ -505,154 +509,154 @@ msgid "" "underlying SQLite library is compiled with. The SQLite threading modes are:" msgstr "" -#: ../../library/sqlite3.rst:500 +#: ../../library/sqlite3.rst:501 msgid "" "**Single-thread**: In this mode, all mutexes are disabled and SQLite is " "unsafe to use in more than a single thread at once." msgstr "" -#: ../../library/sqlite3.rst:502 +#: ../../library/sqlite3.rst:503 msgid "" "**Multi-thread**: In this mode, SQLite can be safely used by multiple " "threads provided that no single database connection is used simultaneously " "in two or more threads." msgstr "" -#: ../../library/sqlite3.rst:505 +#: ../../library/sqlite3.rst:506 msgid "" "**Serialized**: In serialized mode, SQLite can be safely used by multiple " "threads with no restriction." msgstr "" -#: ../../library/sqlite3.rst:508 +#: ../../library/sqlite3.rst:509 msgid "" "The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels " "are as follows:" msgstr "" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "SQLite threading mode" msgstr "" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "`threadsafety`_" msgstr "`threadsafety`_" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "`SQLITE_THREADSAFE`_" msgstr "`SQLITE_THREADSAFE`_" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "DB-API 2.0 meaning" msgstr "" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:516 msgid "single-thread" msgstr "" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:516 msgid "0" msgstr "0" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:516 msgid "Threads may not share the module" msgstr "" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:519 msgid "multi-thread" msgstr "" -#: ../../library/sqlite3.rst:518 ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:519 ../../library/sqlite3.rst:522 msgid "1" msgstr "1" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:519 msgid "2" msgstr "2" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:519 msgid "Threads may share the module, but not connections" msgstr "" -#: ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:522 msgid "serialized" msgstr "" -#: ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:522 msgid "3" msgstr "3" -#: ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:522 msgid "Threads may share the module, connections and cursors" msgstr "" -#: ../../library/sqlite3.rst:528 +#: ../../library/sqlite3.rst:529 msgid "Set *threadsafety* dynamically instead of hard-coding it to ``1``." msgstr "" -#: ../../library/sqlite3.rst:533 +#: ../../library/sqlite3.rst:534 msgid "" "Version number of this module as a :class:`string `. This is not the " "version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:538 +#: ../../library/sqlite3.rst:539 msgid "" "Version number of this module as a :class:`tuple` of :class:`integers " "`. This is not the version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:545 +#: ../../library/sqlite3.rst:546 msgid "Connection objects" msgstr "" -#: ../../library/sqlite3.rst:549 +#: ../../library/sqlite3.rst:550 msgid "" "Each open SQLite database is represented by a ``Connection`` object, which " "is created using :func:`sqlite3.connect`. Their main purpose is creating :" "class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." msgstr "" -#: ../../library/sqlite3.rst:556 +#: ../../library/sqlite3.rst:557 msgid ":ref:`sqlite3-connection-shortcuts`" msgstr ":ref:`sqlite3-connection-shortcuts`" -#: ../../library/sqlite3.rst:559 +#: ../../library/sqlite3.rst:560 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:563 +#: ../../library/sqlite3.rst:564 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " "single optional parameter *factory*. If supplied, this must be a callable " "returning an instance of :class:`Cursor` or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:570 +#: ../../library/sqlite3.rst:571 msgid "" "Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large " "OBject)`." msgstr "" -#: ../../library/sqlite3.rst:573 +#: ../../library/sqlite3.rst:574 msgid "The name of the table where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:576 +#: ../../library/sqlite3.rst:577 msgid "The name of the column where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:579 +#: ../../library/sqlite3.rst:580 msgid "The name of the row where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:582 +#: ../../library/sqlite3.rst:583 msgid "" "Set to ``True`` if the blob should be opened without write permissions. " "Defaults to ``False``." msgstr "" -#: ../../library/sqlite3.rst:587 +#: ../../library/sqlite3.rst:588 msgid "" "The name of the database where the blob is located. Defaults to ``\"main\"``." msgstr "" @@ -661,112 +665,111 @@ msgstr "" msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:591 +#: ../../library/sqlite3.rst:592 msgid "When trying to open a blob in a ``WITHOUT ROWID`` table." msgstr "" -#: ../../library/sqlite3.rst:598 +#: ../../library/sqlite3.rst:599 msgid "" "The blob size cannot be changed using the :class:`Blob` class. Use the SQL " "function ``zeroblob`` to create a blob with a fixed size." msgstr "" -#: ../../library/sqlite3.rst:605 +#: ../../library/sqlite3.rst:606 msgid "" "Commit any pending transaction to the database. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:610 +#: ../../library/sqlite3.rst:611 msgid "" "Roll back to the start of any pending transaction. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:615 +#: ../../library/sqlite3.rst:616 msgid "" "Close the database connection. Any pending transaction is not committed " "implicitly; make sure to :meth:`commit` before closing to avoid losing " "pending changes." msgstr "" -#: ../../library/sqlite3.rst:622 +#: ../../library/sqlite3.rst:623 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it " "with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:628 +#: ../../library/sqlite3.rst:629 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on " "it with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:634 +#: ../../library/sqlite3.rst:635 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` " "on it with the given *sql_script*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:640 +#: ../../library/sqlite3.rst:641 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:642 +#: ../../library/sqlite3.rst:643 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:645 +#: ../../library/sqlite3.rst:646 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:649 +#: ../../library/sqlite3.rst:650 msgid "" "A callable that is called when the SQL function is invoked. The callable " "must return :ref:`a type natively supported by SQLite `. Set " "to ``None`` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:656 +#: ../../library/sqlite3.rst:657 msgid "" "If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " "optimizations." msgstr "" -#: ../../library/sqlite3.rst:661 +#: ../../library/sqlite3.rst:662 msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" -#: ../../library/sqlite3.rst:664 +#: ../../library/sqlite3.rst:665 msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:667 ../../library/sqlite3.rst:705 -#: ../../library/sqlite3.rst:768 ../../library/sqlite3.rst:1019 -#: ../../library/sqlite3.rst:1243 ../../library/sqlite3.rst:1273 -#: ../../library/sqlite3.rst:1379 ../../library/sqlite3.rst:1400 -#: ../../library/sqlite3.rst:1539 +#: ../../library/sqlite3.rst:668 ../../library/sqlite3.rst:706 +#: ../../library/sqlite3.rst:769 ../../library/sqlite3.rst:1020 +#: ../../library/sqlite3.rst:1257 ../../library/sqlite3.rst:1363 +#: ../../library/sqlite3.rst:1384 msgid "Example:" msgstr "範例:" -#: ../../library/sqlite3.rst:683 +#: ../../library/sqlite3.rst:684 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:685 +#: ../../library/sqlite3.rst:686 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:688 +#: ../../library/sqlite3.rst:689 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:692 +#: ../../library/sqlite3.rst:693 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -775,45 +778,45 @@ msgid "" "*n_arg*. Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:693 +#: ../../library/sqlite3.rst:694 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:695 +#: ../../library/sqlite3.rst:696 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:696 ../../library/sqlite3.rst:752 +#: ../../library/sqlite3.rst:697 ../../library/sqlite3.rst:753 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:699 +#: ../../library/sqlite3.rst:700 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:702 +#: ../../library/sqlite3.rst:703 msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:737 +#: ../../library/sqlite3.rst:738 msgid "Create or remove a user-defined aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:739 +#: ../../library/sqlite3.rst:740 msgid "The name of the SQL aggregate window function to create or remove." msgstr "" -#: ../../library/sqlite3.rst:742 +#: ../../library/sqlite3.rst:743 msgid "" "The number of arguments the SQL aggregate window function can accept. If " "``-1``, it may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:746 +#: ../../library/sqlite3.rst:747 msgid "" "A class that must implement the following methods: * ``step()``: Add a row " "to the current window. * ``value()``: Return the current value of the " @@ -825,78 +828,78 @@ msgid "" "function." msgstr "" -#: ../../library/sqlite3.rst:747 +#: ../../library/sqlite3.rst:748 msgid "A class that must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:749 +#: ../../library/sqlite3.rst:750 msgid "``step()``: Add a row to the current window." msgstr "" -#: ../../library/sqlite3.rst:750 +#: ../../library/sqlite3.rst:751 msgid "``value()``: Return the current value of the aggregate." msgstr "" -#: ../../library/sqlite3.rst:751 +#: ../../library/sqlite3.rst:752 msgid "``inverse()``: Remove a row from the current window." msgstr "" -#: ../../library/sqlite3.rst:755 +#: ../../library/sqlite3.rst:756 msgid "" "The number of arguments that the ``step()`` and ``value()`` methods must " "accept is controlled by *num_params*." msgstr "" -#: ../../library/sqlite3.rst:758 +#: ../../library/sqlite3.rst:759 msgid "Set to ``None`` to remove an existing SQL aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:760 +#: ../../library/sqlite3.rst:761 msgid "" "If used with a version of SQLite older than 3.25.0, which does not support " "aggregate window functions." msgstr "" -#: ../../library/sqlite3.rst:823 +#: ../../library/sqlite3.rst:824 msgid "" "Create a collation named *name* using the collating function *callable*. " "*callable* is passed two :class:`string ` arguments, and it should " "return an :class:`integer `:" msgstr "" -#: ../../library/sqlite3.rst:827 +#: ../../library/sqlite3.rst:828 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:828 +#: ../../library/sqlite3.rst:829 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:829 +#: ../../library/sqlite3.rst:830 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:831 +#: ../../library/sqlite3.rst:832 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:859 +#: ../../library/sqlite3.rst:860 msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" -#: ../../library/sqlite3.rst:861 +#: ../../library/sqlite3.rst:862 msgid "" "The collation name can contain any Unicode character. Earlier, only ASCII " "characters were allowed." msgstr "" -#: ../../library/sqlite3.rst:868 +#: ../../library/sqlite3.rst:869 msgid "" "Call this method from a different thread to abort any queries that might be " "executing on the connection. Aborted queries will raise an exception." msgstr "" -#: ../../library/sqlite3.rst:875 +#: ../../library/sqlite3.rst:876 msgid "" "Register callable *authorizer_callback* to be invoked for each attempt to " "access a column of a table in the database. The callback should return one " @@ -905,7 +908,7 @@ msgid "" "library." msgstr "" -#: ../../library/sqlite3.rst:881 +#: ../../library/sqlite3.rst:882 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or ``None`` " @@ -915,7 +918,7 @@ msgid "" "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: ../../library/sqlite3.rst:888 +#: ../../library/sqlite3.rst:889 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 " @@ -923,15 +926,15 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:892 +#: ../../library/sqlite3.rst:893 msgid "Passing ``None`` as *authorizer_callback* will disable the authorizer." msgstr "" -#: ../../library/sqlite3.rst:894 +#: ../../library/sqlite3.rst:895 msgid "Added support for disabling the authorizer using ``None``." msgstr "" -#: ../../library/sqlite3.rst:900 +#: ../../library/sqlite3.rst:901 msgid "" "Register callable *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -939,26 +942,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:905 +#: ../../library/sqlite3.rst:906 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:908 +#: ../../library/sqlite3.rst:909 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:915 +#: ../../library/sqlite3.rst:916 msgid "" "Register callable *trace_callback* to be invoked for each SQL statement that " "is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:918 +#: ../../library/sqlite3.rst:919 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 " @@ -968,18 +971,18 @@ msgid "" "execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:926 +#: ../../library/sqlite3.rst:927 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:929 +#: ../../library/sqlite3.rst:930 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:939 +#: ../../library/sqlite3.rst:940 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " @@ -988,7 +991,7 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:948 +#: ../../library/sqlite3.rst:949 msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " @@ -1003,11 +1006,11 @@ msgid "" "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:959 +#: ../../library/sqlite3.rst:960 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:1002 +#: ../../library/sqlite3.rst:1003 msgid "" "Load an SQLite extension from a shared library located at *path*. Enable " "extension loading with :meth:`enable_load_extension` before calling this " @@ -1020,38 +1023,38 @@ msgid "" "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:1010 +#: ../../library/sqlite3.rst:1011 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:1015 +#: ../../library/sqlite3.rst:1016 msgid "" "Return an :term:`iterator` to dump the database as SQL source code. Useful " "when saving an in-memory database for later restoration. Similar to the ``." "dump`` command in the :program:`sqlite3` shell." msgstr "" -#: ../../library/sqlite3.rst:1033 +#: ../../library/sqlite3.rst:1034 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1036 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1038 +#: ../../library/sqlite3.rst:1039 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1041 +#: ../../library/sqlite3.rst:1042 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:1047 +#: ../../library/sqlite3.rst:1048 msgid "" "If set to a callable, it is invoked with three integer arguments for every " "backup iteration: the *status* of the last iteration, the *remaining* number " @@ -1059,46 +1062,46 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1056 +#: ../../library/sqlite3.rst:1057 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1063 +#: ../../library/sqlite3.rst:1064 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1067 +#: ../../library/sqlite3.rst:1068 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1086 +#: ../../library/sqlite3.rst:1087 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1098 +#: ../../library/sqlite3.rst:1099 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1100 +#: ../../library/sqlite3.rst:1101 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1105 ../../library/sqlite3.rst:1142 +#: ../../library/sqlite3.rst:1106 ../../library/sqlite3.rst:1143 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1108 +#: ../../library/sqlite3.rst:1109 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1128 +#: ../../library/sqlite3.rst:1129 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1106,22 +1109,22 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1133 +#: ../../library/sqlite3.rst:1134 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1136 +#: ../../library/sqlite3.rst:1137 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1145 +#: ../../library/sqlite3.rst:1146 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1162 +#: ../../library/sqlite3.rst:1163 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1130,17 +1133,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1168 +#: ../../library/sqlite3.rst:1169 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1176 +#: ../../library/sqlite3.rst:1177 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1184 +#: ../../library/sqlite3.rst:1185 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1148,47 +1151,47 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1190 +#: ../../library/sqlite3.rst:1191 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1193 +#: ../../library/sqlite3.rst:1194 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1197 +#: ../../library/sqlite3.rst:1198 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1201 +#: ../../library/sqlite3.rst:1202 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1204 +#: ../../library/sqlite3.rst:1205 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1209 +#: ../../library/sqlite3.rst:1210 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1216 +#: ../../library/sqlite3.rst:1217 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1219 +#: ../../library/sqlite3.rst:1220 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1226 +#: ../../library/sqlite3.rst:1227 msgid "" "This attribute controls the :ref:`transaction handling ` performed by :mod:`!sqlite3`. If set to ``None``, " @@ -1198,30 +1201,27 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:1234 +#: ../../library/sqlite3.rst:1235 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:1239 +#: ../../library/sqlite3.rst:1240 msgid "" -"A callable that accepts two arguments, a :class:`Cursor` object and the raw " -"row results as a :class:`tuple`, and returns a custom object representing an " -"SQLite row." +"The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " +"from this connection. Assigning to this attribute does not affect the :attr:" +"`!row_factory` of existing cursors belonging to this connection, only new " +"ones. Is ``None`` by default, meaning each row is returned as a :class:" +"`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1256 -msgid "" -"If returning a tuple doesn't suffice and you want name-based access to " -"columns, you should consider setting :attr:`row_factory` to the highly " -"optimized :class:`sqlite3.Row` type. :class:`Row` provides both index-based " -"and case-insensitive name-based access to columns with almost no memory " -"overhead. It will probably be better than your own custom dictionary-based " -"approach or even a db_row based solution." +#: ../../library/sqlite3.rst:1247 ../../library/sqlite3.rst:1508 +#: ../../library/sqlite3.rst:1531 +msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "" -#: ../../library/sqlite3.rst:1267 +#: ../../library/sqlite3.rst:1251 msgid "" "A callable that accepts a :class:`bytes` parameter and returns a text " "representation of it. The callable is invoked for SQLite values with the " @@ -1229,17 +1229,17 @@ msgid "" "you want to return ``bytes`` instead, set *text_factory* to ``bytes``." msgstr "" -#: ../../library/sqlite3.rst:1307 +#: ../../library/sqlite3.rst:1291 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:1314 +#: ../../library/sqlite3.rst:1298 msgid "Cursor objects" msgstr "" -#: ../../library/sqlite3.rst:1316 +#: ../../library/sqlite3.rst:1300 msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " @@ -1247,25 +1247,25 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1323 +#: ../../library/sqlite3.rst:1307 msgid "" "Cursor objects are :term:`iterators `, meaning that if you :meth:" "`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " "to fetch the resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:1348 +#: ../../library/sqlite3.rst:1332 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1355 +#: ../../library/sqlite3.rst:1339 msgid "" "Execute SQL statement *sql*. Bind values to the statement using :ref:" "`placeholders ` that map to the :term:`sequence` or :" "class:`dict` *parameters*." msgstr "" -#: ../../library/sqlite3.rst:1360 +#: ../../library/sqlite3.rst:1344 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:" @@ -1273,7 +1273,7 @@ msgid "" "multiple SQL statements with one call." msgstr "" -#: ../../library/sqlite3.rst:1365 +#: ../../library/sqlite3.rst:1349 msgid "" "If :attr:`~Connection.isolation_level` is not ``None``, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -1281,7 +1281,7 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:1373 +#: ../../library/sqlite3.rst:1357 msgid "" "Execute :ref:`parameterized ` SQL statement *sql* " "against all parameter sequences or mappings found in the sequence " @@ -1290,7 +1290,7 @@ msgid "" "handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1392 +#: ../../library/sqlite3.rst:1376 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaction, an implicit ``COMMIT`` statement is executed first. No other " @@ -1298,24 +1298,24 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1398 +#: ../../library/sqlite3.rst:1382 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1416 +#: ../../library/sqlite3.rst:1400 msgid "" -"If :attr:`~Connection.row_factory` is ``None``, return the next row query " -"result set as a :class:`tuple`. Else, pass it to the row factory and return " -"its result. Return ``None`` if no more data is available." +"If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " +"set as a :class:`tuple`. Else, pass it to the row factory and return its " +"result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1424 +#: ../../library/sqlite3.rst:1408 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1427 +#: ../../library/sqlite3.rst:1411 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1323,7 +1323,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1433 +#: ../../library/sqlite3.rst:1417 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1331,36 +1331,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1440 +#: ../../library/sqlite3.rst:1424 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1447 +#: ../../library/sqlite3.rst:1431 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1449 +#: ../../library/sqlite3.rst:1433 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:1454 ../../library/sqlite3.rst:1458 +#: ../../library/sqlite3.rst:1438 ../../library/sqlite3.rst:1442 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1462 +#: ../../library/sqlite3.rst:1446 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:1467 +#: ../../library/sqlite3.rst:1451 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1368,18 +1368,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1481 +#: ../../library/sqlite3.rst:1465 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1485 +#: ../../library/sqlite3.rst:1469 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1489 +#: ../../library/sqlite3.rst:1473 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1389,15 +1389,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1497 +#: ../../library/sqlite3.rst:1481 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1499 +#: ../../library/sqlite3.rst:1483 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1504 +#: ../../library/sqlite3.rst:1488 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1406,6 +1406,22 @@ msgid "" "methods." msgstr "" +#: ../../library/sqlite3.rst:1496 +msgid "" +"Control how a row fetched from this :class:`!Cursor` is represented. If " +"``None``, a row is represented as a :class:`tuple`. Can be set to the " +"included :class:`sqlite3.Row`; or a :term:`callable` that accepts two " +"arguments, a :class:`Cursor` object and the :class:`!tuple` of row values, " +"and returns a custom object representing an SQLite row." +msgstr "" + +#: ../../library/sqlite3.rst:1503 +msgid "" +"Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" +"Cursor` was created. Assigning to this attribute does not affect :attr:" +"`Connection.row_factory` of the parent connection." +msgstr "" + #: ../../library/sqlite3.rst:1519 msgid "Row objects" msgstr "" @@ -1419,25 +1435,27 @@ msgid "" msgstr "" #: ../../library/sqlite3.rst:1528 -msgid "Two row objects compare equal if have equal columns and equal members." +msgid "" +"Two :class:`!Row` objects compare equal if they have identical column names " +"and values." msgstr "" -#: ../../library/sqlite3.rst:1532 +#: ../../library/sqlite3.rst:1535 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:1536 +#: ../../library/sqlite3.rst:1539 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1558 +#: ../../library/sqlite3.rst:1546 msgid "Blob objects" msgstr "" -#: ../../library/sqlite3.rst:1564 +#: ../../library/sqlite3.rst:1552 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " "write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" @@ -1445,24 +1463,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1569 +#: ../../library/sqlite3.rst:1557 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1599 +#: ../../library/sqlite3.rst:1587 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1601 +#: ../../library/sqlite3.rst:1589 msgid "" "The blob will be unusable from this point onward. An :class:`~sqlite3." "Error` (or subclass) exception will be raised if any further operation is " "attempted with the blob." msgstr "" -#: ../../library/sqlite3.rst:1607 +#: ../../library/sqlite3.rst:1595 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " @@ -1470,18 +1488,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1615 +#: ../../library/sqlite3.rst:1603 msgid "" "Write *data* to the blob at the current offset. This function cannot change " "the blob length. Writing beyond the end of the blob will raise :exc:" "`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1621 +#: ../../library/sqlite3.rst:1609 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1625 +#: ../../library/sqlite3.rst:1613 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1489,26 +1507,26 @@ msgid "" "position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1633 +#: ../../library/sqlite3.rst:1621 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1637 +#: ../../library/sqlite3.rst:1625 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1645 +#: ../../library/sqlite3.rst:1633 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1647 +#: ../../library/sqlite3.rst:1635 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1651 +#: ../../library/sqlite3.rst:1639 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1516,39 +1534,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1658 +#: ../../library/sqlite3.rst:1646 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1662 +#: ../../library/sqlite3.rst:1650 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1667 +#: ../../library/sqlite3.rst:1655 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1674 +#: ../../library/sqlite3.rst:1662 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1681 +#: ../../library/sqlite3.rst:1669 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1688 +#: ../../library/sqlite3.rst:1676 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1556,14 +1574,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1695 +#: ../../library/sqlite3.rst:1683 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1701 +#: ../../library/sqlite3.rst:1689 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1571,20 +1589,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1709 +#: ../../library/sqlite3.rst:1697 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:1714 +#: ../../library/sqlite3.rst:1702 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1721 +#: ../../library/sqlite3.rst:1709 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " @@ -1592,7 +1610,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1728 +#: ../../library/sqlite3.rst:1716 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1601,78 +1619,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1738 +#: ../../library/sqlite3.rst:1726 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1740 +#: ../../library/sqlite3.rst:1728 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1743 +#: ../../library/sqlite3.rst:1731 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1746 ../../library/sqlite3.rst:1763 +#: ../../library/sqlite3.rst:1734 ../../library/sqlite3.rst:1751 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1746 ../../library/sqlite3.rst:1763 +#: ../../library/sqlite3.rst:1734 ../../library/sqlite3.rst:1751 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1748 ../../library/sqlite3.rst:1765 +#: ../../library/sqlite3.rst:1736 ../../library/sqlite3.rst:1753 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1748 ../../library/sqlite3.rst:1765 +#: ../../library/sqlite3.rst:1736 ../../library/sqlite3.rst:1753 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1750 ../../library/sqlite3.rst:1767 +#: ../../library/sqlite3.rst:1738 ../../library/sqlite3.rst:1755 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1750 ../../library/sqlite3.rst:1767 +#: ../../library/sqlite3.rst:1738 ../../library/sqlite3.rst:1755 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1752 ../../library/sqlite3.rst:1769 +#: ../../library/sqlite3.rst:1740 ../../library/sqlite3.rst:1757 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1752 ../../library/sqlite3.rst:1769 +#: ../../library/sqlite3.rst:1740 ../../library/sqlite3.rst:1757 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1754 +#: ../../library/sqlite3.rst:1742 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1754 ../../library/sqlite3.rst:1771 +#: ../../library/sqlite3.rst:1742 ../../library/sqlite3.rst:1759 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1756 ../../library/sqlite3.rst:1774 +#: ../../library/sqlite3.rst:1744 ../../library/sqlite3.rst:1762 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1756 ../../library/sqlite3.rst:1774 +#: ../../library/sqlite3.rst:1744 ../../library/sqlite3.rst:1762 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1760 +#: ../../library/sqlite3.rst:1748 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1771 +#: ../../library/sqlite3.rst:1759 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1777 +#: ../../library/sqlite3.rst:1765 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1681,42 +1699,42 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1787 +#: ../../library/sqlite3.rst:1775 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1789 +#: ../../library/sqlite3.rst:1777 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:1792 +#: ../../library/sqlite3.rst:1780 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:1796 +#: ../../library/sqlite3.rst:1784 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:1800 +#: ../../library/sqlite3.rst:1788 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1804 +#: ../../library/sqlite3.rst:1792 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:1810 +#: ../../library/sqlite3.rst:1798 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1724,15 +1742,15 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1819 +#: ../../library/sqlite3.rst:1807 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1824 +#: ../../library/sqlite3.rst:1812 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1826 +#: ../../library/sqlite3.rst:1814 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1740,7 +1758,7 @@ msgid "" "com/327/>`_ for a humorous example of what can go wrong)::" msgstr "" -#: ../../library/sqlite3.rst:1835 +#: ../../library/sqlite3.rst:1823 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1756,18 +1774,18 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1877 +#: ../../library/sqlite3.rst:1865 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1879 +#: ../../library/sqlite3.rst:1867 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1883 +#: ../../library/sqlite3.rst:1871 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1777,11 +1795,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1895 +#: ../../library/sqlite3.rst:1883 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1897 +#: ../../library/sqlite3.rst:1885 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1791,84 +1809,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1928 +#: ../../library/sqlite3.rst:1916 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1930 +#: ../../library/sqlite3.rst:1918 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1960 +#: ../../library/sqlite3.rst:1948 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1962 +#: ../../library/sqlite3.rst:1950 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1967 +#: ../../library/sqlite3.rst:1955 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:1970 +#: ../../library/sqlite3.rst:1958 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:1975 +#: ../../library/sqlite3.rst:1963 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1984 +#: ../../library/sqlite3.rst:1972 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1988 +#: ../../library/sqlite3.rst:1976 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1989 +#: ../../library/sqlite3.rst:1977 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1990 +#: ../../library/sqlite3.rst:1978 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1994 +#: ../../library/sqlite3.rst:1982 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2045 +#: ../../library/sqlite3.rst:2033 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2047 +#: ../../library/sqlite3.rst:2035 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2109 +#: ../../library/sqlite3.rst:2097 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2111 +#: ../../library/sqlite3.rst:2099 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1880,11 +1898,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2152 +#: ../../library/sqlite3.rst:2140 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2154 +#: ../../library/sqlite3.rst:2142 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1894,61 +1912,118 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2163 +#: ../../library/sqlite3.rst:2151 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2168 +#: ../../library/sqlite3.rst:2156 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2201 +#: ../../library/sqlite3.rst:2189 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2203 +#: ../../library/sqlite3.rst:2191 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2205 +#: ../../library/sqlite3.rst:2193 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2214 +#: ../../library/sqlite3.rst:2202 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2224 +#: ../../library/sqlite3.rst:2212 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2238 +#: ../../library/sqlite3.rst:2226 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" +#: ../../library/sqlite3.rst:2235 +msgid "How to create and use row factories" +msgstr "" + +#: ../../library/sqlite3.rst:2237 +msgid "" +"By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" +"class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." +"Row` class or a custom :attr:`~Cursor.row_factory`." +msgstr "" + +#: ../../library/sqlite3.rst:2242 +msgid "" +"While :attr:`!row_factory` exists as an attribute both on the :class:" +"`Cursor` and the :class:`Connection`, it is recommended to set :class:" +"`Connection.row_factory`, so all cursors created from the connection will " +"use the same row factory." +msgstr "" + #: ../../library/sqlite3.rst:2247 +msgid "" +":class:`!Row` provides indexed and case-insensitive named access to columns, " +"with minimal memory overhead and performance impact over a :class:`!tuple`. " +"To use :class:`!Row` as a row factory, assign it to the :attr:`!row_factory` " +"attribute:" +msgstr "" + +#: ../../library/sqlite3.rst:2257 +msgid "Queries now return :class:`!Row` objects:" +msgstr "" + +#: ../../library/sqlite3.rst:2272 +msgid "" +"You can create a custom :attr:`~Cursor.row_factory` that returns each row as " +"a :class:`dict`, with column names mapped to values:" +msgstr "" + +#: ../../library/sqlite3.rst:2281 +msgid "" +"Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" +msgstr "" + +#: ../../library/sqlite3.rst:2291 +msgid "The following row factory returns a :term:`named tuple`:" +msgstr "" + +#: ../../library/sqlite3.rst:2302 +msgid ":func:`!namedtuple_factory` can be used as follows:" +msgstr "" + +#: ../../library/sqlite3.rst:2317 +msgid "" +"With some adjustments, the above recipe can be adapted to use a :class:" +"`~dataclasses.dataclass`, or any other custom class, instead of a :class:" +"`~collections.namedtuple`." +msgstr "" + +#: ../../library/sqlite3.rst:2325 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2252 +#: ../../library/sqlite3.rst:2330 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2254 +#: ../../library/sqlite3.rst:2332 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2257 +#: ../../library/sqlite3.rst:2335 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -1962,7 +2037,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2270 +#: ../../library/sqlite3.rst:2348 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -1972,14 +2047,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2278 +#: ../../library/sqlite3.rst:2356 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2282 +#: ../../library/sqlite3.rst:2360 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." diff --git a/library/wsgiref.po b/library/wsgiref.po index 510b13027a..649205a079 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -22,7 +22,11 @@ msgstr "" msgid ":mod:`wsgiref` --- WSGI Utilities and Reference Implementation" msgstr "" -#: ../../library/wsgiref.rst:12 +#: ../../library/wsgiref.rst:10 +msgid "**Source code:** :source:`Lib/wsgiref`" +msgstr "**原始碼:**\\ :source:`Lib/wsgiref`" + +#: ../../library/wsgiref.rst:14 msgid "" "The Web Server Gateway Interface (WSGI) is a standard interface between web " "server software and web applications written in Python. Having a standard " @@ -30,7 +34,7 @@ msgid "" "number of different web servers." msgstr "" -#: ../../library/wsgiref.rst:17 +#: ../../library/wsgiref.rst:19 msgid "" "Only authors of web servers and programming frameworks need to know every " "detail and corner case of the WSGI design. You don't need to understand " @@ -38,7 +42,7 @@ msgid "" "application using an existing framework." msgstr "" -#: ../../library/wsgiref.rst:22 +#: ../../library/wsgiref.rst:24 msgid "" ":mod:`wsgiref` is a reference implementation of the WSGI specification that " "can be used to add WSGI support to a web server or framework. It provides " @@ -49,17 +53,17 @@ msgid "" "specification (:pep:`3333`)." msgstr "" -#: ../../library/wsgiref.rst:30 +#: ../../library/wsgiref.rst:32 msgid "" "See `wsgi.readthedocs.io `_ for more " "information about WSGI, and links to tutorials and other resources." msgstr "" -#: ../../library/wsgiref.rst:37 +#: ../../library/wsgiref.rst:39 msgid ":mod:`wsgiref.util` -- WSGI environment utilities" msgstr "" -#: ../../library/wsgiref.rst:43 +#: ../../library/wsgiref.rst:45 msgid "" "This module provides a variety of utility functions for working with WSGI " "environments. A WSGI environment is a dictionary containing HTTP request " @@ -69,14 +73,14 @@ msgid "" "types.WSGIEnvironment` for a type alias that can be used in type annotations." msgstr "" -#: ../../library/wsgiref.rst:54 +#: ../../library/wsgiref.rst:56 msgid "" -"Return a guess for whether ``wsgi.url_scheme`` should be \"http\" or \"https" -"\", by checking for a ``HTTPS`` environment variable in the *environ* " +"Return a guess for whether ``wsgi.url_scheme`` should be \"http\" or " +"\"https\", by checking for a ``HTTPS`` environment variable in the *environ* " "dictionary. The return value is a string." msgstr "" -#: ../../library/wsgiref.rst:58 +#: ../../library/wsgiref.rst:60 msgid "" "This function is useful when creating a gateway that wraps CGI or a CGI-like " "protocol such as FastCGI. Typically, servers providing such protocols will " @@ -85,7 +89,7 @@ msgid "" "a value is found, and \"http\" otherwise." msgstr "" -#: ../../library/wsgiref.rst:67 +#: ../../library/wsgiref.rst:69 msgid "" "Return the full request URI, optionally including the query string, using " "the algorithm found in the \"URL Reconstruction\" section of :pep:`3333`. " @@ -93,27 +97,27 @@ msgid "" "resulting URI." msgstr "" -#: ../../library/wsgiref.rst:74 +#: ../../library/wsgiref.rst:76 msgid "" "Similar to :func:`request_uri`, except that the ``PATH_INFO`` and " "``QUERY_STRING`` variables are ignored. The result is the base URI of the " "application object addressed by the request." msgstr "" -#: ../../library/wsgiref.rst:81 +#: ../../library/wsgiref.rst:83 msgid "" "Shift a single name from ``PATH_INFO`` to ``SCRIPT_NAME`` and return the " "name. The *environ* dictionary is *modified* in-place; use a copy if you " "need to keep the original ``PATH_INFO`` or ``SCRIPT_NAME`` intact." msgstr "" -#: ../../library/wsgiref.rst:85 +#: ../../library/wsgiref.rst:87 msgid "" "If there are no remaining path segments in ``PATH_INFO``, ``None`` is " "returned." msgstr "" -#: ../../library/wsgiref.rst:87 +#: ../../library/wsgiref.rst:89 msgid "" "Typically, this routine is used to process each portion of a request URI " "path, for example to treat the path as a series of dictionary keys. This " @@ -127,7 +131,7 @@ msgid "" "and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." msgstr "" -#: ../../library/wsgiref.rst:98 +#: ../../library/wsgiref.rst:100 msgid "" "When ``PATH_INFO`` is just a \"/\", this routine returns an empty string and " "appends a trailing slash to ``SCRIPT_NAME``, even though empty path segments " @@ -137,11 +141,11 @@ msgid "" "using this routine to do object traversal." msgstr "" -#: ../../library/wsgiref.rst:108 +#: ../../library/wsgiref.rst:110 msgid "Update *environ* with trivial defaults for testing purposes." msgstr "" -#: ../../library/wsgiref.rst:110 +#: ../../library/wsgiref.rst:112 msgid "" "This routine adds various parameters required for WSGI, including " "``HTTP_HOST``, ``SERVER_NAME``, ``SERVER_PORT``, ``REQUEST_METHOD``, " @@ -150,34 +154,34 @@ msgid "" "existing settings for these variables." msgstr "" -#: ../../library/wsgiref.rst:116 +#: ../../library/wsgiref.rst:118 msgid "" "This routine is intended to make it easier for unit tests of WSGI servers " "and applications to set up dummy environments. It should NOT be used by " "actual WSGI servers or applications, since the data is fake!" msgstr "" -#: ../../library/wsgiref.rst:120 ../../library/wsgiref.rst:168 -#: ../../library/wsgiref.rst:290 ../../library/wsgiref.rst:423 +#: ../../library/wsgiref.rst:122 ../../library/wsgiref.rst:170 +#: ../../library/wsgiref.rst:292 ../../library/wsgiref.rst:425 msgid "Example usage::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../library/wsgiref.rst:144 +#: ../../library/wsgiref.rst:146 msgid "" "In addition to the environment functions above, the :mod:`wsgiref.util` " "module also provides these miscellaneous utilities:" msgstr "" -#: ../../library/wsgiref.rst:150 +#: ../../library/wsgiref.rst:152 msgid "" "Return ``True`` if 'header_name' is an HTTP/1.1 \"Hop-by-Hop\" header, as " "defined by :rfc:`2616`." msgstr "" -#: ../../library/wsgiref.rst:156 +#: ../../library/wsgiref.rst:158 msgid "" "A concrete implementation of the :class:`wsgiref.types.FileWrapper` protocol " "used to convert a file-like object to an :term:`iterator`. The resulting " @@ -187,35 +191,35 @@ msgid "" "`read` returns an empty bytestring, iteration is ended and is not resumable." msgstr "" -#: ../../library/wsgiref.rst:164 +#: ../../library/wsgiref.rst:166 msgid "" "If *filelike* has a :meth:`close` method, the returned object will also have " "a :meth:`close` method, and it will invoke the *filelike* object's :meth:" "`close` method when called." msgstr "" -#: ../../library/wsgiref.rst:180 +#: ../../library/wsgiref.rst:182 msgid "Support for :meth:`__getitem__` method has been removed." msgstr "" -#: ../../library/wsgiref.rst:185 +#: ../../library/wsgiref.rst:187 msgid ":mod:`wsgiref.headers` -- WSGI response header tools" msgstr "" -#: ../../library/wsgiref.rst:191 +#: ../../library/wsgiref.rst:193 msgid "" "This module provides a single class, :class:`Headers`, for convenient " "manipulation of WSGI response headers using a mapping-like interface." msgstr "" -#: ../../library/wsgiref.rst:197 +#: ../../library/wsgiref.rst:199 msgid "" "Create a mapping-like object wrapping *headers*, which must be a list of " "header name/value tuples as described in :pep:`3333`. The default value of " "*headers* is an empty list." msgstr "" -#: ../../library/wsgiref.rst:201 +#: ../../library/wsgiref.rst:203 msgid "" ":class:`Headers` objects support typical mapping operations including :meth:" "`__getitem__`, :meth:`get`, :meth:`__setitem__`, :meth:`setdefault`, :meth:" @@ -227,7 +231,7 @@ msgid "" "new headers added to the end of the wrapped list." msgstr "" -#: ../../library/wsgiref.rst:210 +#: ../../library/wsgiref.rst:212 msgid "" "Unlike a dictionary, :class:`Headers` objects do not raise an error when you " "try to get or delete a key that isn't in the wrapped header list. Getting a " @@ -235,7 +239,7 @@ msgid "" "does nothing." msgstr "" -#: ../../library/wsgiref.rst:215 +#: ../../library/wsgiref.rst:217 msgid "" ":class:`Headers` objects also support :meth:`keys`, :meth:`values`, and :" "meth:`items` methods. The lists returned by :meth:`keys` and :meth:`items` " @@ -246,7 +250,7 @@ msgid "" "list." msgstr "" -#: ../../library/wsgiref.rst:222 +#: ../../library/wsgiref.rst:224 msgid "" "Calling ``bytes()`` on a :class:`Headers` object returns a formatted " "bytestring suitable for transmission as HTTP response headers. Each header " @@ -255,18 +259,18 @@ msgid "" "terminated with a blank line." msgstr "" -#: ../../library/wsgiref.rst:228 +#: ../../library/wsgiref.rst:230 msgid "" "In addition to their mapping interface and formatting features, :class:" "`Headers` objects also have the following methods for querying and adding " "multi-valued headers, and for adding headers with MIME parameters:" msgstr "" -#: ../../library/wsgiref.rst:235 +#: ../../library/wsgiref.rst:237 msgid "Return a list of all the values for the named header." msgstr "" -#: ../../library/wsgiref.rst:237 +#: ../../library/wsgiref.rst:239 msgid "" "The returned list will be sorted in the order they appeared in the original " "header list or were added to this instance, and may contain duplicates. Any " @@ -274,13 +278,13 @@ msgid "" "no fields exist with the given name, returns an empty list." msgstr "" -#: ../../library/wsgiref.rst:245 +#: ../../library/wsgiref.rst:247 msgid "" "Add a (possibly multi-valued) header, with optional MIME parameters " "specified via keyword arguments." msgstr "" -#: ../../library/wsgiref.rst:248 +#: ../../library/wsgiref.rst:250 msgid "" "*name* is the header field to add. Keyword arguments can be used to set " "MIME parameters for the header field. Each parameter must be a string or " @@ -292,19 +296,19 @@ msgid "" "a value.) Example usage::" msgstr "" -#: ../../library/wsgiref.rst:258 +#: ../../library/wsgiref.rst:260 msgid "The above will add a header that looks like this::" msgstr "" -#: ../../library/wsgiref.rst:263 +#: ../../library/wsgiref.rst:265 msgid "*headers* parameter is optional." msgstr "" -#: ../../library/wsgiref.rst:268 +#: ../../library/wsgiref.rst:270 msgid ":mod:`wsgiref.simple_server` -- a simple WSGI HTTP server" msgstr "" -#: ../../library/wsgiref.rst:274 +#: ../../library/wsgiref.rst:276 msgid "" "This module implements a simple HTTP server (based on :mod:`http.server`) " "that serves WSGI applications. Each server instance serves a single WSGI " @@ -315,7 +319,7 @@ msgid "" "`wsgiref.util`.)" msgstr "" -#: ../../library/wsgiref.rst:285 +#: ../../library/wsgiref.rst:287 msgid "" "Create a new WSGI server listening on *host* and *port*, accepting " "connections for *app*. The return value is an instance of the supplied " @@ -324,7 +328,7 @@ msgid "" "pep:`3333`." msgstr "" -#: ../../library/wsgiref.rst:306 +#: ../../library/wsgiref.rst:308 msgid "" "This function is a small but complete WSGI application that returns a text " "page containing the message \"Hello world!\" and a list of the key/value " @@ -333,51 +337,51 @@ msgid "" "WSGI application correctly." msgstr "" -#: ../../library/wsgiref.rst:315 +#: ../../library/wsgiref.rst:317 msgid "" "Create a :class:`WSGIServer` instance. *server_address* should be a ``(host," "port)`` tuple, and *RequestHandlerClass* should be the subclass of :class:" "`http.server.BaseHTTPRequestHandler` that will be used to process requests." msgstr "" -#: ../../library/wsgiref.rst:320 +#: ../../library/wsgiref.rst:322 msgid "" "You do not normally need to call this constructor, as the :func:" "`make_server` function can handle all the details for you." msgstr "" -#: ../../library/wsgiref.rst:323 +#: ../../library/wsgiref.rst:325 msgid "" ":class:`WSGIServer` is a subclass of :class:`http.server.HTTPServer`, so all " "of its methods (such as :meth:`serve_forever` and :meth:`handle_request`) " "are available. :class:`WSGIServer` also provides these WSGI-specific methods:" msgstr "" -#: ../../library/wsgiref.rst:330 +#: ../../library/wsgiref.rst:332 msgid "" "Sets the callable *application* as the WSGI application that will receive " "requests." msgstr "" -#: ../../library/wsgiref.rst:336 +#: ../../library/wsgiref.rst:338 msgid "Returns the currently set application callable." msgstr "" -#: ../../library/wsgiref.rst:338 +#: ../../library/wsgiref.rst:340 msgid "" "Normally, however, you do not need to use these additional methods, as :meth:" "`set_app` is normally called by :func:`make_server`, and the :meth:`get_app` " "exists mainly for the benefit of request handler instances." msgstr "" -#: ../../library/wsgiref.rst:345 +#: ../../library/wsgiref.rst:347 msgid "" "Create an HTTP handler for the given *request* (i.e. a socket), " "*client_address* (a ``(host,port)`` tuple), and *server* (:class:" "`WSGIServer` instance)." msgstr "" -#: ../../library/wsgiref.rst:348 +#: ../../library/wsgiref.rst:350 msgid "" "You do not need to create instances of this class directly; they are " "automatically created as needed by :class:`WSGIServer` objects. You can, " @@ -386,7 +390,7 @@ msgid "" "subclasses:" msgstr "" -#: ../../library/wsgiref.rst:357 +#: ../../library/wsgiref.rst:359 msgid "" "Return a :data:`~wsgiref.types.WSGIEnvironment` dictionary for a request. " "The default implementation copies the contents of the :class:`WSGIServer` " @@ -396,24 +400,24 @@ msgid "" "variables as specified in :pep:`3333`." msgstr "" -#: ../../library/wsgiref.rst:368 +#: ../../library/wsgiref.rst:370 msgid "" "Return the object that should be used as the ``wsgi.errors`` stream. The " "default implementation just returns ``sys.stderr``." msgstr "" -#: ../../library/wsgiref.rst:374 +#: ../../library/wsgiref.rst:376 msgid "" "Process the HTTP request. The default implementation creates a handler " "instance using a :mod:`wsgiref.handlers` class to implement the actual WSGI " "application interface." msgstr "" -#: ../../library/wsgiref.rst:380 +#: ../../library/wsgiref.rst:382 msgid ":mod:`wsgiref.validate` --- WSGI conformance checker" msgstr "" -#: ../../library/wsgiref.rst:386 +#: ../../library/wsgiref.rst:388 msgid "" "When creating new WSGI application objects, frameworks, servers, or " "middleware, it can be useful to validate the new code's conformance using :" @@ -423,7 +427,7 @@ msgid "" "conformance." msgstr "" -#: ../../library/wsgiref.rst:393 +#: ../../library/wsgiref.rst:395 msgid "" "Note that this utility does not guarantee complete :pep:`3333` compliance; " "an absence of errors from this module does not necessarily mean that errors " @@ -432,13 +436,13 @@ msgid "" "compliant." msgstr "" -#: ../../library/wsgiref.rst:398 +#: ../../library/wsgiref.rst:400 msgid "" "This module is based on the :mod:`paste.lint` module from Ian Bicking's " "\"Python Paste\" library." msgstr "" -#: ../../library/wsgiref.rst:404 +#: ../../library/wsgiref.rst:406 msgid "" "Wrap *application* and return a new WSGI application object. The returned " "application will forward all requests to the original *application*, and " @@ -446,7 +450,7 @@ msgid "" "conforming to the WSGI specification and to :rfc:`2616`." msgstr "" -#: ../../library/wsgiref.rst:409 +#: ../../library/wsgiref.rst:411 msgid "" "Any detected nonconformance results in an :exc:`AssertionError` being " "raised; note, however, that how these errors are handled is server-" @@ -457,7 +461,7 @@ msgid "" "stream." msgstr "" -#: ../../library/wsgiref.rst:416 +#: ../../library/wsgiref.rst:418 msgid "" "This wrapper may also generate output using the :mod:`warnings` module to " "indicate behaviors that are questionable but which may not actually be " @@ -467,11 +471,11 @@ msgid "" "object)." msgstr "" -#: ../../library/wsgiref.rst:448 +#: ../../library/wsgiref.rst:450 msgid ":mod:`wsgiref.handlers` -- server/gateway base classes" msgstr "" -#: ../../library/wsgiref.rst:454 +#: ../../library/wsgiref.rst:456 msgid "" "This module provides base handler classes for implementing WSGI servers and " "gateways. These base classes handle most of the work of communicating with " @@ -479,7 +483,7 @@ msgid "" "with input, output, and error streams." msgstr "" -#: ../../library/wsgiref.rst:462 +#: ../../library/wsgiref.rst:464 msgid "" "CGI-based invocation via ``sys.stdin``, ``sys.stdout``, ``sys.stderr`` and " "``os.environ``. This is useful when you have a WSGI application and want to " @@ -487,7 +491,7 @@ msgid "" "``app`` is the WSGI application object you wish to invoke." msgstr "" -#: ../../library/wsgiref.rst:467 +#: ../../library/wsgiref.rst:469 msgid "" "This class is a subclass of :class:`BaseCGIHandler` that sets ``wsgi." "run_once`` to true, ``wsgi.multithread`` to false, and ``wsgi.multiprocess`` " @@ -495,21 +499,21 @@ msgid "" "CGI streams and environment." msgstr "" -#: ../../library/wsgiref.rst:475 +#: ../../library/wsgiref.rst:477 msgid "" "A specialized alternative to :class:`CGIHandler`, for use when deploying on " "Microsoft's IIS web server, without having set the config allowPathInfo " "option (IIS>=7) or metabase allowPathInfoForScriptMappings (IIS<7)." msgstr "" -#: ../../library/wsgiref.rst:479 +#: ../../library/wsgiref.rst:481 msgid "" "By default, IIS gives a ``PATH_INFO`` that duplicates the ``SCRIPT_NAME`` at " "the front, causing problems for WSGI applications that wish to implement " "routing. This handler strips any such duplicated path." msgstr "" -#: ../../library/wsgiref.rst:483 +#: ../../library/wsgiref.rst:485 msgid "" "IIS can be configured to pass the correct ``PATH_INFO``, but this causes " "another bug where ``PATH_TRANSLATED`` is wrong. Luckily this variable is " @@ -520,7 +524,7 @@ msgid "" "because there is still no UI for it.)." msgstr "" -#: ../../library/wsgiref.rst:491 +#: ../../library/wsgiref.rst:493 msgid "" "There is no way for CGI code to tell whether the option was set, so a " "separate handler class is provided. It is used in the same way as :class:" @@ -528,7 +532,7 @@ msgid "" "is the WSGI application object you wish to invoke." msgstr "" -#: ../../library/wsgiref.rst:501 +#: ../../library/wsgiref.rst:503 msgid "" "Similar to :class:`CGIHandler`, but instead of using the :mod:`sys` and :mod:" "`os` modules, the CGI environment and I/O streams are specified explicitly. " @@ -537,7 +541,7 @@ msgid "" "the handler instance." msgstr "" -#: ../../library/wsgiref.rst:507 +#: ../../library/wsgiref.rst:509 msgid "" "This class is a subclass of :class:`SimpleHandler` intended for use with " "software other than HTTP \"origin servers\". If you are writing a gateway " @@ -546,14 +550,14 @@ msgid "" "this instead of :class:`SimpleHandler`." msgstr "" -#: ../../library/wsgiref.rst:516 +#: ../../library/wsgiref.rst:518 msgid "" "Similar to :class:`BaseCGIHandler`, but designed for use with HTTP origin " "servers. If you are writing an HTTP server implementation, you will " "probably want to subclass this instead of :class:`BaseCGIHandler`." msgstr "" -#: ../../library/wsgiref.rst:520 +#: ../../library/wsgiref.rst:522 msgid "" "This class is a subclass of :class:`BaseHandler`. It overrides the :meth:" "`__init__`, :meth:`get_stdin`, :meth:`get_stderr`, :meth:`add_cgi_vars`, :" @@ -563,41 +567,41 @@ msgid "" "and :attr:`environ` attributes." msgstr "" -#: ../../library/wsgiref.rst:527 +#: ../../library/wsgiref.rst:529 msgid "" "The :meth:`~io.BufferedIOBase.write` method of *stdout* should write each " "chunk in full, like :class:`io.BufferedIOBase`." msgstr "" -#: ../../library/wsgiref.rst:533 +#: ../../library/wsgiref.rst:535 msgid "" "This is an abstract base class for running WSGI applications. Each instance " "will handle a single HTTP request, although in principle you could create a " "subclass that was reusable for multiple requests." msgstr "" -#: ../../library/wsgiref.rst:537 +#: ../../library/wsgiref.rst:539 msgid "" ":class:`BaseHandler` instances have only one method intended for external " "use:" msgstr "" -#: ../../library/wsgiref.rst:542 +#: ../../library/wsgiref.rst:544 msgid "Run the specified WSGI application, *app*." msgstr "" -#: ../../library/wsgiref.rst:544 +#: ../../library/wsgiref.rst:546 msgid "" "All of the other :class:`BaseHandler` methods are invoked by this method in " "the process of running the application, and thus exist primarily to allow " "customizing the process." msgstr "" -#: ../../library/wsgiref.rst:548 +#: ../../library/wsgiref.rst:550 msgid "The following methods MUST be overridden in a subclass:" msgstr "" -#: ../../library/wsgiref.rst:553 +#: ../../library/wsgiref.rst:555 msgid "" "Buffer the bytes *data* for transmission to the client. It's okay if this " "method actually transmits the data; :class:`BaseHandler` just separates " @@ -605,33 +609,33 @@ msgid "" "actually has such a distinction." msgstr "" -#: ../../library/wsgiref.rst:561 +#: ../../library/wsgiref.rst:563 msgid "" "Force buffered data to be transmitted to the client. It's okay if this " "method is a no-op (i.e., if :meth:`_write` actually sends the data)." msgstr "" -#: ../../library/wsgiref.rst:567 +#: ../../library/wsgiref.rst:569 msgid "" "Return an object compatible with :class:`~wsgiref.types.InputStream` " "suitable for use as the ``wsgi.input`` of the request currently being " "processed." msgstr "" -#: ../../library/wsgiref.rst:574 +#: ../../library/wsgiref.rst:576 msgid "" "Return an object compatible with :class:`~wsgiref.types.ErrorStream` " "suitable for use as the ``wsgi.errors`` of the request currently being " "processed." msgstr "" -#: ../../library/wsgiref.rst:581 +#: ../../library/wsgiref.rst:583 msgid "" "Insert CGI variables for the current request into the :attr:`environ` " "attribute." msgstr "" -#: ../../library/wsgiref.rst:583 +#: ../../library/wsgiref.rst:585 msgid "" "Here are some other methods and attributes you may wish to override. This " "list is only a summary, however, and does not include every method that can " @@ -640,32 +644,32 @@ msgid "" "`BaseHandler` subclass." msgstr "" -#: ../../library/wsgiref.rst:589 +#: ../../library/wsgiref.rst:591 msgid "Attributes and methods for customizing the WSGI environment:" msgstr "" -#: ../../library/wsgiref.rst:594 +#: ../../library/wsgiref.rst:596 msgid "" "The value to be used for the ``wsgi.multithread`` environment variable. It " "defaults to true in :class:`BaseHandler`, but may have a different default " "(or be set by the constructor) in the other subclasses." msgstr "" -#: ../../library/wsgiref.rst:601 +#: ../../library/wsgiref.rst:603 msgid "" "The value to be used for the ``wsgi.multiprocess`` environment variable. It " "defaults to true in :class:`BaseHandler`, but may have a different default " "(or be set by the constructor) in the other subclasses." msgstr "" -#: ../../library/wsgiref.rst:608 +#: ../../library/wsgiref.rst:610 msgid "" "The value to be used for the ``wsgi.run_once`` environment variable. It " "defaults to false in :class:`BaseHandler`, but :class:`CGIHandler` sets it " "to true by default." msgstr "" -#: ../../library/wsgiref.rst:615 +#: ../../library/wsgiref.rst:617 msgid "" "The default environment variables to be included in every request's WSGI " "environment. By default, this is a copy of ``os.environ`` at the time that :" @@ -675,7 +679,7 @@ msgid "" "classes and instances." msgstr "" -#: ../../library/wsgiref.rst:625 +#: ../../library/wsgiref.rst:627 msgid "" "If the :attr:`origin_server` attribute is set, this attribute's value is " "used to set the default ``SERVER_SOFTWARE`` WSGI environment variable, and " @@ -684,13 +688,13 @@ msgid "" "are not HTTP origin servers." msgstr "" -#: ../../library/wsgiref.rst:631 +#: ../../library/wsgiref.rst:633 msgid "" "The term \"Python\" is replaced with implementation specific term like " "\"CPython\", \"Jython\" etc." msgstr "" -#: ../../library/wsgiref.rst:637 +#: ../../library/wsgiref.rst:639 msgid "" "Return the URL scheme being used for the current request. The default " "implementation uses the :func:`guess_scheme` function from :mod:`wsgiref." @@ -698,7 +702,7 @@ msgid "" "the current request's :attr:`environ` variables." msgstr "" -#: ../../library/wsgiref.rst:645 +#: ../../library/wsgiref.rst:647 msgid "" "Set the :attr:`environ` attribute to a fully populated WSGI environment. " "The default implementation uses all of the above methods and attributes, " @@ -708,11 +712,11 @@ msgid "" "attribute is a true value and the :attr:`server_software` attribute is set." msgstr "" -#: ../../library/wsgiref.rst:652 +#: ../../library/wsgiref.rst:654 msgid "Methods and attributes for customizing exception handling:" msgstr "" -#: ../../library/wsgiref.rst:657 +#: ../../library/wsgiref.rst:659 msgid "" "Log the *exc_info* tuple in the server log. *exc_info* is a ``(type, value, " "traceback)`` tuple. The default implementation simply writes the traceback " @@ -722,33 +726,33 @@ msgid "" "suitable." msgstr "" -#: ../../library/wsgiref.rst:666 +#: ../../library/wsgiref.rst:668 msgid "" "The maximum number of frames to include in tracebacks output by the default :" "meth:`log_exception` method. If ``None``, all frames are included." msgstr "" -#: ../../library/wsgiref.rst:672 +#: ../../library/wsgiref.rst:674 msgid "" "This method is a WSGI application to generate an error page for the user. " "It is only invoked if an error occurs before headers are sent to the client." msgstr "" -#: ../../library/wsgiref.rst:675 +#: ../../library/wsgiref.rst:677 msgid "" "This method can access the current error information using ``sys." "exc_info()``, and should pass that information to *start_response* when " "calling it (as described in the \"Error Handling\" section of :pep:`3333`)." msgstr "" -#: ../../library/wsgiref.rst:679 +#: ../../library/wsgiref.rst:681 msgid "" "The default implementation just uses the :attr:`error_status`, :attr:" "`error_headers`, and :attr:`error_body` attributes to generate an output " "page. Subclasses can override this to produce more dynamic error output." msgstr "" -#: ../../library/wsgiref.rst:683 +#: ../../library/wsgiref.rst:685 msgid "" "Note, however, that it's not recommended from a security perspective to spit " "out diagnostics to any old user; ideally, you should have to do something " @@ -756,40 +760,40 @@ msgid "" "doesn't include any." msgstr "" -#: ../../library/wsgiref.rst:691 +#: ../../library/wsgiref.rst:693 msgid "" "The HTTP status used for error responses. This should be a status string as " "defined in :pep:`3333`; it defaults to a 500 code and message." msgstr "" -#: ../../library/wsgiref.rst:697 +#: ../../library/wsgiref.rst:699 msgid "" "The HTTP headers used for error responses. This should be a list of WSGI " "response headers (``(name, value)`` tuples), as described in :pep:`3333`. " "The default list just sets the content type to ``text/plain``." msgstr "" -#: ../../library/wsgiref.rst:704 +#: ../../library/wsgiref.rst:706 msgid "" "The error response body. This should be an HTTP response body bytestring. " "It defaults to the plain text, \"A server error occurred. Please contact " "the administrator.\"" msgstr "" -#: ../../library/wsgiref.rst:708 +#: ../../library/wsgiref.rst:710 msgid "" "Methods and attributes for :pep:`3333`'s \"Optional Platform-Specific File " "Handling\" feature:" msgstr "" -#: ../../library/wsgiref.rst:714 +#: ../../library/wsgiref.rst:716 msgid "" "A ``wsgi.file_wrapper`` factory, compatible with :class:`wsgiref.types." "FileWrapper`, or ``None``. The default value of this attribute is the :" "class:`wsgiref.util.FileWrapper` class." msgstr "" -#: ../../library/wsgiref.rst:721 +#: ../../library/wsgiref.rst:723 msgid "" "Override to implement platform-specific file transmission. This method is " "called only if the application's return value is an instance of the class " @@ -799,11 +803,11 @@ msgid "" "of this method just returns a false value." msgstr "" -#: ../../library/wsgiref.rst:728 +#: ../../library/wsgiref.rst:730 msgid "Miscellaneous methods and attributes:" msgstr "" -#: ../../library/wsgiref.rst:733 +#: ../../library/wsgiref.rst:735 msgid "" "This attribute should be set to a true value if the handler's :meth:`_write` " "and :meth:`_flush` are being used to communicate directly to the client, " @@ -811,89 +815,89 @@ msgid "" "special ``Status:`` header." msgstr "" -#: ../../library/wsgiref.rst:738 +#: ../../library/wsgiref.rst:740 msgid "" "This attribute's default value is true in :class:`BaseHandler`, but false " "in :class:`BaseCGIHandler` and :class:`CGIHandler`." msgstr "" -#: ../../library/wsgiref.rst:744 +#: ../../library/wsgiref.rst:746 msgid "" "If :attr:`origin_server` is true, this string attribute is used to set the " "HTTP version of the response set to the client. It defaults to ``\"1.0\"``." msgstr "" -#: ../../library/wsgiref.rst:750 +#: ../../library/wsgiref.rst:752 msgid "" -"Transcode CGI variables from ``os.environ`` to :pep:`3333` \"bytes in unicode" -"\" strings, returning a new dictionary. This function is used by :class:" -"`CGIHandler` and :class:`IISCGIHandler` in place of directly using ``os." -"environ``, which is not necessarily WSGI-compliant on all platforms and web " -"servers using Python 3 -- specifically, ones where the OS's actual " +"Transcode CGI variables from ``os.environ`` to :pep:`3333` \"bytes in " +"unicode\" strings, returning a new dictionary. This function is used by :" +"class:`CGIHandler` and :class:`IISCGIHandler` in place of directly using " +"``os.environ``, which is not necessarily WSGI-compliant on all platforms and " +"web servers using Python 3 -- specifically, ones where the OS's actual " "environment is Unicode (i.e. Windows), or ones where the environment is " "bytes, but the system encoding used by Python to decode it is anything other " "than ISO-8859-1 (e.g. Unix systems using UTF-8)." msgstr "" -#: ../../library/wsgiref.rst:759 +#: ../../library/wsgiref.rst:761 msgid "" "If you are implementing a CGI-based handler of your own, you probably want " "to use this routine instead of just copying values out of ``os.environ`` " "directly." msgstr "" -#: ../../library/wsgiref.rst:767 +#: ../../library/wsgiref.rst:769 msgid ":mod:`wsgiref.types` -- WSGI types for static type checking" msgstr "" -#: ../../library/wsgiref.rst:773 +#: ../../library/wsgiref.rst:775 msgid "" "This module provides various types for static type checking as described in :" "pep:`3333`." msgstr "" -#: ../../library/wsgiref.rst:781 +#: ../../library/wsgiref.rst:783 msgid "" "A :class:`typing.Protocol` describing `start_response() `_ callables (:pep:`3333`)." msgstr "" -#: ../../library/wsgiref.rst:787 +#: ../../library/wsgiref.rst:789 msgid "A type alias describing a WSGI environment dictionary." msgstr "" -#: ../../library/wsgiref.rst:791 +#: ../../library/wsgiref.rst:793 msgid "A type alias describing a WSGI application callable." msgstr "" -#: ../../library/wsgiref.rst:795 +#: ../../library/wsgiref.rst:797 msgid "" "A :class:`typing.Protocol` describing a `WSGI Input Stream `_." msgstr "" -#: ../../library/wsgiref.rst:800 +#: ../../library/wsgiref.rst:802 msgid "" "A :class:`typing.Protocol` describing a `WSGI Error Stream `_." msgstr "" -#: ../../library/wsgiref.rst:805 +#: ../../library/wsgiref.rst:807 msgid "" "A :class:`typing.Protocol` describing a `file wrapper `_. See :class:" "`wsgiref.util.FileWrapper` for a concrete implementation of this protocol." msgstr "" -#: ../../library/wsgiref.rst:812 +#: ../../library/wsgiref.rst:814 msgid "Examples" msgstr "範例" -#: ../../library/wsgiref.rst:814 +#: ../../library/wsgiref.rst:816 msgid "This is a working \"Hello World\" WSGI application::" msgstr "" -#: ../../library/wsgiref.rst:843 +#: ../../library/wsgiref.rst:845 msgid "" "Example of a WSGI application serving the current directory, accept optional " "directory and port number (default: 8000) on the command line::" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 7de7f2f74f..046b375b26 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -19,9 +19,13 @@ msgstr "" #: ../../library/zoneinfo.rst:2 msgid ":mod:`zoneinfo` --- IANA time zone support" -msgstr "" +msgstr ":mod:`zoneinfo` --- IANA 時區支援" + +#: ../../library/zoneinfo.rst:12 +msgid "**Source code:** :source:`Lib/zoneinfo`" +msgstr "**原始碼:**\\ :source:`Lib/zoneinfo`" -#: ../../library/zoneinfo.rst:14 +#: ../../library/zoneinfo.rst:16 msgid "" "The :mod:`zoneinfo` module provides a concrete time zone implementation to " "support the IANA time zone database as originally specified in :pep:`615`. " @@ -30,21 +34,21 @@ msgid "" "using the first-party `tzdata`_ package available on PyPI." msgstr "" -#: ../../library/zoneinfo.rst:24 +#: ../../library/zoneinfo.rst:26 msgid "Module: :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/zoneinfo.rst:23 +#: ../../library/zoneinfo.rst:25 msgid "" "Provides the :class:`~datetime.time` and :class:`~datetime.datetime` types " "with which the :class:`ZoneInfo` class is designed to be used." msgstr "" -#: ../../library/zoneinfo.rst:27 +#: ../../library/zoneinfo.rst:29 msgid "Package `tzdata`_" msgstr "" -#: ../../library/zoneinfo.rst:27 +#: ../../library/zoneinfo.rst:29 msgid "" "First-party package maintained by the CPython core developers to supply time " "zone data via PyPI." @@ -61,11 +65,11 @@ msgid "" "more information." msgstr "" -#: ../../library/zoneinfo.rst:33 +#: ../../library/zoneinfo.rst:35 msgid "Using ``ZoneInfo``" msgstr "" -#: ../../library/zoneinfo.rst:35 +#: ../../library/zoneinfo.rst:37 msgid "" ":class:`ZoneInfo` is a concrete implementation of the :class:`datetime." "tzinfo` abstract base class, and is intended to be attached to ``tzinfo``, " @@ -74,13 +78,13 @@ msgid "" "astimezone>`::" msgstr "" -#: ../../library/zoneinfo.rst:50 +#: ../../library/zoneinfo.rst:52 msgid "" "Datetimes constructed in this way are compatible with datetime arithmetic " "and handle daylight saving time transitions with no further intervention::" msgstr "" -#: ../../library/zoneinfo.rst:61 +#: ../../library/zoneinfo.rst:63 msgid "" "These time zones also support the :attr:`~datetime.datetime.fold` attribute " "introduced in :pep:`495`. During offset transitions which induce ambiguous " @@ -89,17 +93,17 @@ msgid "" "*after* the transition is used when ``fold=1``, for example::" msgstr "" -#: ../../library/zoneinfo.rst:74 +#: ../../library/zoneinfo.rst:76 msgid "" "When converting from another time zone, the fold will be set to the correct " "value::" msgstr "" -#: ../../library/zoneinfo.rst:90 +#: ../../library/zoneinfo.rst:92 msgid "Data sources" msgstr "" -#: ../../library/zoneinfo.rst:92 +#: ../../library/zoneinfo.rst:94 msgid "" "The ``zoneinfo`` module does not directly provide time zone data, and " "instead pulls time zone information from the system time zone database or " @@ -111,11 +115,11 @@ msgid "" "raise :exc:`ZoneInfoNotFoundError`." msgstr "" -#: ../../library/zoneinfo.rst:104 +#: ../../library/zoneinfo.rst:106 msgid "Configuring the data sources" msgstr "" -#: ../../library/zoneinfo.rst:106 +#: ../../library/zoneinfo.rst:108 msgid "" "When ``ZoneInfo(key)`` is called, the constructor first searches the " "directories specified in :data:`TZPATH` for a file matching ``key``, and on " @@ -123,29 +127,29 @@ msgid "" "configured in three ways:" msgstr "" -#: ../../library/zoneinfo.rst:111 +#: ../../library/zoneinfo.rst:113 msgid "" "The default :data:`TZPATH` when not otherwise specified can be configured " "at :ref:`compile time `." msgstr "" -#: ../../library/zoneinfo.rst:113 +#: ../../library/zoneinfo.rst:115 msgid "" ":data:`TZPATH` can be configured using :ref:`an environment variable " "`." msgstr "" -#: ../../library/zoneinfo.rst:115 +#: ../../library/zoneinfo.rst:117 msgid "" "At :ref:`runtime `, the search path can be " "manipulated using the :func:`reset_tzpath` function." msgstr "" -#: ../../library/zoneinfo.rst:121 +#: ../../library/zoneinfo.rst:123 msgid "Compile-time configuration" msgstr "" -#: ../../library/zoneinfo.rst:123 +#: ../../library/zoneinfo.rst:125 msgid "" "The default :data:`TZPATH` includes several common deployment locations for " "the time zone database (except on Windows, where there are no \"well-known\" " @@ -157,17 +161,17 @@ msgid "" "pathsep`." msgstr "" -#: ../../library/zoneinfo.rst:132 +#: ../../library/zoneinfo.rst:134 msgid "" "On all platforms, the configured value is available as the ``TZPATH`` key " "in :func:`sysconfig.get_config_var`." msgstr "" -#: ../../library/zoneinfo.rst:138 +#: ../../library/zoneinfo.rst:140 msgid "Environment configuration" msgstr "" -#: ../../library/zoneinfo.rst:140 +#: ../../library/zoneinfo.rst:142 msgid "" "When initializing :data:`TZPATH` (either at import time or whenever :func:" "`reset_tzpath` is called with no arguments), the ``zoneinfo`` module will " @@ -175,7 +179,7 @@ msgid "" "search path." msgstr "" -#: ../../library/zoneinfo.rst:147 +#: ../../library/zoneinfo.rst:149 msgid "" "This is an :data:`os.pathsep`-separated string containing the time zone " "search path to use. It must consist of only absolute rather than relative " @@ -186,17 +190,17 @@ msgid "" "raise an exception." msgstr "" -#: ../../library/zoneinfo.rst:155 +#: ../../library/zoneinfo.rst:157 msgid "" "To set the system to ignore the system data and use the tzdata package " "instead, set ``PYTHONTZPATH=\"\"``." msgstr "" -#: ../../library/zoneinfo.rst:161 +#: ../../library/zoneinfo.rst:163 msgid "Runtime configuration" msgstr "" -#: ../../library/zoneinfo.rst:163 +#: ../../library/zoneinfo.rst:165 msgid "" "The TZ search path can also be configured at runtime using the :func:" "`reset_tzpath` function. This is generally not an advisable operation, " @@ -205,11 +209,11 @@ msgid "" "zones)." msgstr "" -#: ../../library/zoneinfo.rst:170 +#: ../../library/zoneinfo.rst:172 msgid "The ``ZoneInfo`` class" msgstr "" -#: ../../library/zoneinfo.rst:174 +#: ../../library/zoneinfo.rst:176 msgid "" "A concrete :class:`datetime.tzinfo` subclass that represents an IANA time " "zone specified by the string ``key``. Calls to the primary constructor will " @@ -218,42 +222,42 @@ msgid "" "``key``, the following assertion will always be true:" msgstr "" -#: ../../library/zoneinfo.rst:186 +#: ../../library/zoneinfo.rst:188 msgid "" "``key`` must be in the form of a relative, normalized POSIX path, with no up-" "level references. The constructor will raise :exc:`ValueError` if a non-" "conforming key is passed." msgstr "" -#: ../../library/zoneinfo.rst:190 +#: ../../library/zoneinfo.rst:192 msgid "" "If no file matching ``key`` is found, the constructor will raise :exc:" "`ZoneInfoNotFoundError`." msgstr "" -#: ../../library/zoneinfo.rst:194 +#: ../../library/zoneinfo.rst:196 msgid "The ``ZoneInfo`` class has two alternate constructors:" msgstr "" -#: ../../library/zoneinfo.rst:198 +#: ../../library/zoneinfo.rst:200 msgid "" "Constructs a ``ZoneInfo`` object from a file-like object returning bytes (e." "g. a file opened in binary mode or an :class:`io.BytesIO` object). Unlike " "the primary constructor, this always constructs a new object." msgstr "" -#: ../../library/zoneinfo.rst:202 +#: ../../library/zoneinfo.rst:204 msgid "" "The ``key`` parameter sets the name of the zone for the purposes of :py:meth:" "`~object.__str__` and :py:meth:`~object.__repr__`." msgstr "" -#: ../../library/zoneinfo.rst:205 +#: ../../library/zoneinfo.rst:207 msgid "" "Objects created via this constructor cannot be pickled (see `pickling`_)." msgstr "" -#: ../../library/zoneinfo.rst:209 +#: ../../library/zoneinfo.rst:211 msgid "" "An alternate constructor that bypasses the constructor's cache. It is " "identical to the primary constructor, but returns a new object on each call. " @@ -262,48 +266,48 @@ msgid "" "strategy." msgstr "" -#: ../../library/zoneinfo.rst:215 +#: ../../library/zoneinfo.rst:217 msgid "" "Objects created via this constructor will also bypass the cache of a " "deserializing process when unpickled." msgstr "" -#: ../../library/zoneinfo.rst:222 +#: ../../library/zoneinfo.rst:224 msgid "" "Using this constructor may change the semantics of your datetimes in " "surprising ways, only use it if you know that you need to." msgstr "" -#: ../../library/zoneinfo.rst:225 +#: ../../library/zoneinfo.rst:227 msgid "The following class methods are also available:" msgstr "" -#: ../../library/zoneinfo.rst:229 +#: ../../library/zoneinfo.rst:231 msgid "" "A method for invalidating the cache on the ``ZoneInfo`` class. If no " "arguments are passed, all caches are invalidated and the next call to the " "primary constructor for each key will return a new instance." msgstr "" -#: ../../library/zoneinfo.rst:233 +#: ../../library/zoneinfo.rst:235 msgid "" "If an iterable of key names is passed to the ``only_keys`` parameter, only " "the specified keys will be removed from the cache. Keys passed to " "``only_keys`` but not found in the cache are ignored." msgstr "" -#: ../../library/zoneinfo.rst:241 +#: ../../library/zoneinfo.rst:243 msgid "" "Invoking this function may change the semantics of datetimes using " "``ZoneInfo`` in surprising ways; this modifies process-wide global state and " "thus may have wide-ranging effects. Only use it if you know that you need to." msgstr "" -#: ../../library/zoneinfo.rst:246 +#: ../../library/zoneinfo.rst:248 msgid "The class has one attribute:" msgstr "" -#: ../../library/zoneinfo.rst:250 +#: ../../library/zoneinfo.rst:252 msgid "" "This is a read-only :term:`attribute` that returns the value of ``key`` " "passed to the constructor, which should be a lookup key in the IANA time " @@ -311,13 +315,13 @@ msgid "" "Tokyo``)." msgstr "" -#: ../../library/zoneinfo.rst:255 +#: ../../library/zoneinfo.rst:257 msgid "" "For zones constructed from file without specifying a ``key`` parameter, this " "will be set to ``None``." msgstr "" -#: ../../library/zoneinfo.rst:260 +#: ../../library/zoneinfo.rst:262 msgid "" "Although it is a somewhat common practice to expose these to end users, " "these values are designed to be primary keys for representing the relevant " @@ -326,18 +330,18 @@ msgid "" "strings from these keys." msgstr "" -#: ../../library/zoneinfo.rst:267 +#: ../../library/zoneinfo.rst:269 msgid "String representations" msgstr "" -#: ../../library/zoneinfo.rst:269 +#: ../../library/zoneinfo.rst:271 msgid "" "The string representation returned when calling :py:class:`str` on a :class:" "`ZoneInfo` object defaults to using the :attr:`ZoneInfo.key` attribute (see " "the note on usage in the attribute documentation)::" msgstr "" -#: ../../library/zoneinfo.rst:281 +#: ../../library/zoneinfo.rst:283 msgid "" "For objects constructed from a file without specifying a ``key`` parameter, " "``str`` falls back to calling :func:`repr`. ``ZoneInfo``'s ``repr`` is " @@ -345,22 +349,22 @@ msgid "" "is guaranteed not to be a valid ``ZoneInfo`` key." msgstr "" -#: ../../library/zoneinfo.rst:289 +#: ../../library/zoneinfo.rst:291 msgid "Pickle serialization" msgstr "" -#: ../../library/zoneinfo.rst:291 +#: ../../library/zoneinfo.rst:293 msgid "" "Rather than serializing all transition data, ``ZoneInfo`` objects are " "serialized by key, and ``ZoneInfo`` objects constructed from files (even " "those with a value for ``key`` specified) cannot be pickled." msgstr "" -#: ../../library/zoneinfo.rst:295 +#: ../../library/zoneinfo.rst:297 msgid "The behavior of a ``ZoneInfo`` file depends on how it was constructed:" msgstr "" -#: ../../library/zoneinfo.rst:297 +#: ../../library/zoneinfo.rst:299 msgid "" "``ZoneInfo(key)``: When constructed with the primary constructor, a " "``ZoneInfo`` object is serialized by key, and when deserialized, the " @@ -371,7 +375,7 @@ msgid "" "following behavior:" msgstr "" -#: ../../library/zoneinfo.rst:312 +#: ../../library/zoneinfo.rst:314 msgid "" "``ZoneInfo.no_cache(key)``: When constructed from the cache-bypassing " "constructor, the ``ZoneInfo`` object is also serialized by key, but when " @@ -381,7 +385,7 @@ msgid "" "the following behavior:" msgstr "" -#: ../../library/zoneinfo.rst:326 +#: ../../library/zoneinfo.rst:328 msgid "" "``ZoneInfo.from_file(fobj, /, key=None)``: When constructed from a file, the " "``ZoneInfo`` object raises an exception on pickling. If an end user wants to " @@ -390,7 +394,7 @@ msgid "" "key or storing the contents of the file object and serializing that." msgstr "" -#: ../../library/zoneinfo.rst:332 +#: ../../library/zoneinfo.rst:334 msgid "" "This method of serialization requires that the time zone data for the " "required key be available on both the serializing and deserializing side, " @@ -401,32 +405,32 @@ msgid "" "time zone data." msgstr "" -#: ../../library/zoneinfo.rst:340 +#: ../../library/zoneinfo.rst:342 msgid "Functions" msgstr "函式" -#: ../../library/zoneinfo.rst:344 +#: ../../library/zoneinfo.rst:346 msgid "" "Get a set containing all the valid keys for IANA time zones available " "anywhere on the time zone path. This is recalculated on every call to the " "function." msgstr "" -#: ../../library/zoneinfo.rst:348 +#: ../../library/zoneinfo.rst:350 msgid "" "This function only includes canonical zone names and does not include " "\"special\" zones such as those under the ``posix/`` and ``right/`` " "directories, or the ``posixrules`` zone." msgstr "" -#: ../../library/zoneinfo.rst:354 +#: ../../library/zoneinfo.rst:356 msgid "" "This function may open a large number of files, as the best way to determine " "if a file on the time zone path is a valid time zone is to read the \"magic " "string\" at the beginning." msgstr "" -#: ../../library/zoneinfo.rst:360 +#: ../../library/zoneinfo.rst:362 msgid "" "These values are not designed to be exposed to end-users; for user facing " "elements, applications should use something like CLDR (the Unicode Common " @@ -434,20 +438,20 @@ msgid "" "cautionary note on :attr:`ZoneInfo.key`." msgstr "" -#: ../../library/zoneinfo.rst:367 +#: ../../library/zoneinfo.rst:369 msgid "" "Sets or resets the time zone search path (:data:`TZPATH`) for the module. " "When called with no arguments, :data:`TZPATH` is set to the default value." msgstr "" -#: ../../library/zoneinfo.rst:370 +#: ../../library/zoneinfo.rst:372 msgid "" "Calling ``reset_tzpath`` will not invalidate the :class:`ZoneInfo` cache, " "and so calls to the primary ``ZoneInfo`` constructor will only use the new " "``TZPATH`` in the case of a cache miss." msgstr "" -#: ../../library/zoneinfo.rst:374 +#: ../../library/zoneinfo.rst:376 msgid "" "The ``to`` parameter must be a :term:`sequence` of strings or :class:`os." "PathLike` and not a string, all of which must be absolute paths. :exc:" @@ -455,24 +459,24 @@ msgid "" "passed." msgstr "" -#: ../../library/zoneinfo.rst:380 +#: ../../library/zoneinfo.rst:382 msgid "Globals" msgstr "" -#: ../../library/zoneinfo.rst:384 +#: ../../library/zoneinfo.rst:386 msgid "" "A read-only sequence representing the time zone search path -- when " "constructing a ``ZoneInfo`` from a key, the key is joined to each entry in " "the ``TZPATH``, and the first file found is used." msgstr "" -#: ../../library/zoneinfo.rst:388 +#: ../../library/zoneinfo.rst:390 msgid "" "``TZPATH`` may contain only absolute paths, never relative paths, regardless " "of how it is configured." msgstr "" -#: ../../library/zoneinfo.rst:391 +#: ../../library/zoneinfo.rst:393 msgid "" "The object that ``zoneinfo.TZPATH`` points to may change in response to a " "call to :func:`reset_tzpath`, so it is recommended to use ``zoneinfo." @@ -480,24 +484,24 @@ msgid "" "long-lived variable to ``zoneinfo.TZPATH``." msgstr "" -#: ../../library/zoneinfo.rst:396 +#: ../../library/zoneinfo.rst:398 msgid "" "For more information on configuring the time zone search path, see :ref:" "`zoneinfo_data_configuration`." msgstr "" -#: ../../library/zoneinfo.rst:400 +#: ../../library/zoneinfo.rst:402 msgid "Exceptions and warnings" msgstr "" -#: ../../library/zoneinfo.rst:404 +#: ../../library/zoneinfo.rst:406 msgid "" "Raised when construction of a :class:`ZoneInfo` object fails because the " "specified key could not be found on the system. This is a subclass of :exc:" "`KeyError`." msgstr "" -#: ../../library/zoneinfo.rst:410 +#: ../../library/zoneinfo.rst:412 msgid "" "Raised when :envvar:`PYTHONTZPATH` contains an invalid component that will " "be filtered out, such as a relative path." diff --git a/license.po b/license.po index a3518a528d..54591426cb 100644 --- a/license.po +++ b/license.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-25 00:16+0000\n" "PO-Revision-Date: 2022-06-27 09:40+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -456,10 +456,10 @@ msgid "" "include a copy of the OpenSSL libraries, so we include a copy of the OpenSSL " "license here::" msgstr "" -"如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`\\ 、\\ :mod:`posix`" -"\\ 、\\ :mod:`ssl`\\ 、\\ :mod:`crypt` 模組會使用它來提升效能。此外,因為 " -"Windows 和 macOS 的 Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們也" -"在此收錄 OpenSSL 授權的副本:\n" +"如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`\\ 、\\ :mod:" +"`posix`\\ 、\\ :mod:`ssl`\\ 、\\ :mod:`crypt` 模組會使用它來提升效能。此外," +"因為 Windows 和 macOS 的 Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我" +"們也在此收錄 OpenSSL 授權的副本:\n" "\n" "::" @@ -550,30 +550,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:989 +#: ../../license.rst:990 msgid "Audioop" msgstr "" -#: ../../license.rst:1010 +#: ../../license.rst:992 msgid "" "The audioop module uses the code base in g771.c file of the SoX project::" msgstr "" - -#: ../../license.rst:991 -msgid "" -"Programming the AdLib/Sound Blaster FM Music Chips Version 2.0 (24 Feb 1992) " -"Copyright (c) 1991, 1992 by Jeffrey S. Lee jlee@smylex.uucp Warranty and " -"Copyright Policy This document is provided on an \"as-is\" basis, and its " -"author makes no warranty or representation, express or implied, with respect " -"to its quality performance or fitness for a particular purpose. In no event " -"will the author of this document be liable for direct, indirect, special, " -"incidental, or consequential damages arising out of the use or inability to " -"use the information contained within. Use of this document is at your own " -"risk. This file may be used and copied freely so long as the applicable " -"copyright notices are retained, and no modifications are made to the text of " -"the document. No money shall be charged for its distribution beyond " -"reasonable shipping, handling and duplication costs, nor shall proprietary " -"changes be made to this document so that it cannot be distributed freely. " -"This document may not be included in published material or commercial " -"packages without the written consent of its author." -msgstr "" diff --git a/reference/datamodel.po b/reference/datamodel.po index efa54ab3e2..6934a79b3c 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-26 00:17+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-" @@ -295,8 +295,8 @@ msgid "" "representing the values ``False`` and ``True`` are the only Boolean objects. " "The Boolean type is a subtype of the integer type, and Boolean values behave " "like the values 0 and 1, respectively, in almost all contexts, the exception " -"being that when converted to a string, the strings ``\"False\"`` or ``\"True" -"\"`` are returned, respectively." +"being that when converted to a string, the strings ``\"False\"`` or " +"``\"True\"`` are returned, respectively." msgstr "" #: ../../reference/datamodel.rst:240 @@ -1853,10 +1853,10 @@ msgstr "" #: ../../reference/datamodel.rst:1557 msgid "" -"By default, the :meth:`__hash__` values of str and bytes objects are \"salted" -"\" with an unpredictable random value. Although they remain constant within " -"an individual Python process, they are not predictable between repeated " -"invocations of Python." +"By default, the :meth:`__hash__` values of str and bytes objects are " +"\"salted\" with an unpredictable random value. Although they remain " +"constant within an individual Python process, they are not predictable " +"between repeated invocations of Python." msgstr "" #: ../../reference/datamodel.rst:1562 @@ -2071,9 +2071,9 @@ msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " "descriptor must be in either the owner's class dictionary or in the class " -"dictionary for one of its parents). In the examples below, \"the attribute" -"\" refers to the attribute whose name is the key of the property in the " -"owner class' :attr:`~object.__dict__`." +"dictionary for one of its parents). In the examples below, \"the " +"attribute\" refers to the attribute whose name is the key of the property in " +"the owner class' :attr:`~object.__dict__`." msgstr "" #: ../../reference/datamodel.rst:1750 @@ -2319,8 +2319,9 @@ msgstr "" #: ../../reference/datamodel.rst:1946 msgid "" -"Nonempty *__slots__* does not work for classes derived from \"variable-length" -"\" built-in types such as :class:`int`, :class:`bytes` and :class:`tuple`." +"Nonempty *__slots__* does not work for classes derived from \"variable-" +"length\" built-in types such as :class:`int`, :class:`bytes` and :class:" +"`tuple`." msgstr "" #: ../../reference/datamodel.rst:1949 @@ -3058,16 +3059,16 @@ msgstr "" #: ../../reference/datamodel.rst:2625 msgid "" -"These methods are called to implement the binary arithmetic operations (``" -"+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:`pow`, " -"``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For instance, to evaluate the " -"expression ``x + y``, where *x* is an instance of a class that has an :meth:" -"`__add__` method, ``type(x).__add__(x, y)`` is called. The :meth:" -"`__divmod__` method should be the equivalent to using :meth:`__floordiv__` " -"and :meth:`__mod__`; it should not be related to :meth:`__truediv__`. Note " -"that :meth:`__pow__` should be defined to accept an optional third argument " -"if the ternary version of the built-in :func:`pow` function is to be " -"supported." +"These methods are called to implement the binary arithmetic operations " +"(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" +"`pow`, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For instance, to " +"evaluate the expression ``x + y``, where *x* is an instance of a class that " +"has an :meth:`__add__` method, ``type(x).__add__(x, y)`` is called. The :" +"meth:`__divmod__` method should be the equivalent to using :meth:" +"`__floordiv__` and :meth:`__mod__`; it should not be related to :meth:" +"`__truediv__`. Note that :meth:`__pow__` should be defined to accept an " +"optional third argument if the ternary version of the built-in :func:`pow` " +"function is to be supported." msgstr "" #: ../../reference/datamodel.rst:2636 @@ -3078,9 +3079,9 @@ msgstr "" #: ../../reference/datamodel.rst:2659 msgid "" -"These methods are called to implement the binary arithmetic operations (``" -"+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:`pow`, " -"``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with reflected (swapped) " +"These methods are called to implement the binary arithmetic operations " +"(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" +"`pow`, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with reflected (swapped) " "operands. These functions are only called if the left operand does not " "support the corresponding operation [#]_ and the operands are of different " "types. [#]_ For instance, to evaluate the expression ``x - y``, where *y* is " @@ -3239,7 +3240,7 @@ msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " "without special support in ``MyClass``. To be able to use that kind of " -"patterns, the class needs to define a *__match_args__* attribute." +"pattern, the class needs to define a *__match_args__* attribute." msgstr "" #: ../../reference/datamodel.rst:2831 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 5bf3b8fd9b..29f8d42048 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-30 00:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -103,48 +103,52 @@ msgid ":pep:`604`, Allow writing union types as X | Y" msgstr "" #: ../../whatsnew/3.10.rst:80 -msgid ":pep:`613`, Explicit Type Aliases" +msgid ":pep:`612`, Parameter Specification Variables" msgstr "" #: ../../whatsnew/3.10.rst:81 -msgid ":pep:`612`, Parameter Specification Variables" +msgid ":pep:`613`, Explicit Type Aliases" msgstr "" -#: ../../whatsnew/3.10.rst:83 +#: ../../whatsnew/3.10.rst:82 +msgid ":pep:`647`, User-Defined Type Guards" +msgstr "" + +#: ../../whatsnew/3.10.rst:84 msgid "Important deprecations, removals or restrictions:" msgstr "" -#: ../../whatsnew/3.10.rst:85 +#: ../../whatsnew/3.10.rst:86 msgid ":pep:`644`, Require OpenSSL 1.1.1 or newer" msgstr "" -#: ../../whatsnew/3.10.rst:86 +#: ../../whatsnew/3.10.rst:87 msgid ":pep:`632`, Deprecate distutils module." msgstr "" -#: ../../whatsnew/3.10.rst:87 +#: ../../whatsnew/3.10.rst:88 msgid "" ":pep:`623`, Deprecate and prepare for the removal of the wstr member in " "PyUnicodeObject." msgstr "" -#: ../../whatsnew/3.10.rst:88 +#: ../../whatsnew/3.10.rst:89 msgid ":pep:`624`, Remove Py_UNICODE encoder APIs" msgstr "" -#: ../../whatsnew/3.10.rst:89 +#: ../../whatsnew/3.10.rst:90 msgid ":pep:`597`, Add optional EncodingWarning" msgstr "" -#: ../../whatsnew/3.10.rst:93 ../../whatsnew/3.10.rst:2055 +#: ../../whatsnew/3.10.rst:94 ../../whatsnew/3.10.rst:2056 msgid "New Features" msgstr "" -#: ../../whatsnew/3.10.rst:98 +#: ../../whatsnew/3.10.rst:99 msgid "Parenthesized context managers" msgstr "" -#: ../../whatsnew/3.10.rst:100 +#: ../../whatsnew/3.10.rst:101 msgid "" "Using enclosing parentheses for continuation across multiple lines in " "context managers is now supported. This allows formatting a long collection " @@ -153,32 +157,32 @@ msgid "" "valid:" msgstr "" -#: ../../whatsnew/3.10.rst:131 +#: ../../whatsnew/3.10.rst:132 msgid "" "it is also possible to use a trailing comma at the end of the enclosed group:" msgstr "" -#: ../../whatsnew/3.10.rst:143 +#: ../../whatsnew/3.10.rst:144 msgid "" "This new syntax uses the non LL(1) capacities of the new parser. Check :pep:" "`617` for more details." msgstr "" -#: ../../whatsnew/3.10.rst:146 +#: ../../whatsnew/3.10.rst:147 msgid "" "(Contributed by Guido van Rossum, Pablo Galindo and Lysandros Nikolaou in :" "issue:`12782` and :issue:`40334`.)" msgstr "" -#: ../../whatsnew/3.10.rst:151 +#: ../../whatsnew/3.10.rst:152 msgid "Better error messages" msgstr "" -#: ../../whatsnew/3.10.rst:154 +#: ../../whatsnew/3.10.rst:155 msgid "SyntaxErrors" msgstr "SyntaxErrors" -#: ../../whatsnew/3.10.rst:156 +#: ../../whatsnew/3.10.rst:157 msgid "" "When parsing code that contains unclosed parentheses or brackets the " "interpreter now includes the location of the unclosed bracket of parentheses " @@ -187,35 +191,35 @@ msgid "" "code (notice the unclosed '{'):" msgstr "" -#: ../../whatsnew/3.10.rst:167 +#: ../../whatsnew/3.10.rst:168 msgid "" "Previous versions of the interpreter reported confusing places as the " "location of the syntax error:" msgstr "" -#: ../../whatsnew/3.10.rst:177 +#: ../../whatsnew/3.10.rst:178 msgid "but in Python 3.10 a more informative error is emitted:" msgstr "" -#: ../../whatsnew/3.10.rst:187 +#: ../../whatsnew/3.10.rst:188 msgid "" "In a similar way, errors involving unclosed string literals (single and " "triple quoted) now point to the start of the string instead of reporting EOF/" "EOL." msgstr "" -#: ../../whatsnew/3.10.rst:190 +#: ../../whatsnew/3.10.rst:191 msgid "" "These improvements are inspired by previous work in the PyPy interpreter." msgstr "" -#: ../../whatsnew/3.10.rst:192 +#: ../../whatsnew/3.10.rst:193 msgid "" "(Contributed by Pablo Galindo in :issue:`42864` and Batuhan Taskaya in :" "issue:`40176`.)" msgstr "" -#: ../../whatsnew/3.10.rst:195 +#: ../../whatsnew/3.10.rst:196 msgid "" ":exc:`SyntaxError` exceptions raised by the interpreter will now highlight " "the full error range of the expression that constitutes the syntax error " @@ -223,141 +227,141 @@ msgid "" "of displaying (before Python 3.10):" msgstr "" -#: ../../whatsnew/3.10.rst:208 +#: ../../whatsnew/3.10.rst:209 msgid "now Python 3.10 will display the exception as:" msgstr "" -#: ../../whatsnew/3.10.rst:218 +#: ../../whatsnew/3.10.rst:219 msgid "This improvement was contributed by Pablo Galindo in :issue:`43914`." msgstr "" -#: ../../whatsnew/3.10.rst:220 +#: ../../whatsnew/3.10.rst:221 msgid "" "A considerable amount of new specialized messages for :exc:`SyntaxError` " "exceptions have been incorporated. Some of the most notable ones are as " "follows:" msgstr "" -#: ../../whatsnew/3.10.rst:223 +#: ../../whatsnew/3.10.rst:224 msgid "Missing ``:`` before blocks:" msgstr "" -#: ../../whatsnew/3.10.rst:233 +#: ../../whatsnew/3.10.rst:234 msgid "(Contributed by Pablo Galindo in :issue:`42997`.)" msgstr "" -#: ../../whatsnew/3.10.rst:235 +#: ../../whatsnew/3.10.rst:236 msgid "Unparenthesised tuples in comprehensions targets:" msgstr "" -#: ../../whatsnew/3.10.rst:245 +#: ../../whatsnew/3.10.rst:246 msgid "(Contributed by Pablo Galindo in :issue:`43017`.)" msgstr "" -#: ../../whatsnew/3.10.rst:247 +#: ../../whatsnew/3.10.rst:248 msgid "Missing commas in collection literals and between expressions:" msgstr "" -#: ../../whatsnew/3.10.rst:260 +#: ../../whatsnew/3.10.rst:261 msgid "(Contributed by Pablo Galindo in :issue:`43822`.)" msgstr "" -#: ../../whatsnew/3.10.rst:262 +#: ../../whatsnew/3.10.rst:263 msgid "Multiple Exception types without parentheses:" msgstr "" -#: ../../whatsnew/3.10.rst:274 +#: ../../whatsnew/3.10.rst:275 msgid "(Contributed by Pablo Galindo in :issue:`43149`.)" msgstr "" -#: ../../whatsnew/3.10.rst:276 +#: ../../whatsnew/3.10.rst:277 msgid "Missing ``:`` and values in dictionary literals:" msgstr "" -#: ../../whatsnew/3.10.rst:296 +#: ../../whatsnew/3.10.rst:297 msgid "(Contributed by Pablo Galindo in :issue:`43823`.)" msgstr "" -#: ../../whatsnew/3.10.rst:298 +#: ../../whatsnew/3.10.rst:299 msgid "``try`` blocks without ``except`` or ``finally`` blocks:" msgstr "" -#: ../../whatsnew/3.10.rst:310 +#: ../../whatsnew/3.10.rst:311 msgid "(Contributed by Pablo Galindo in :issue:`44305`.)" msgstr "" -#: ../../whatsnew/3.10.rst:312 +#: ../../whatsnew/3.10.rst:313 msgid "Usage of ``=`` instead of ``==`` in comparisons:" msgstr "" -#: ../../whatsnew/3.10.rst:322 +#: ../../whatsnew/3.10.rst:323 msgid "(Contributed by Pablo Galindo in :issue:`43797`.)" msgstr "" -#: ../../whatsnew/3.10.rst:324 +#: ../../whatsnew/3.10.rst:325 msgid "Usage of ``*`` in f-strings:" msgstr "" -#: ../../whatsnew/3.10.rst:334 +#: ../../whatsnew/3.10.rst:335 msgid "(Contributed by Pablo Galindo in :issue:`41064`.)" msgstr "" -#: ../../whatsnew/3.10.rst:337 +#: ../../whatsnew/3.10.rst:338 msgid "IndentationErrors" msgstr "IndentationErrors" -#: ../../whatsnew/3.10.rst:339 +#: ../../whatsnew/3.10.rst:340 msgid "" "Many :exc:`IndentationError` exceptions now have more context regarding what " "kind of block was expecting an indentation, including the location of the " "statement:" msgstr "" -#: ../../whatsnew/3.10.rst:354 +#: ../../whatsnew/3.10.rst:355 msgid "AttributeErrors" msgstr "AttributeErrors" -#: ../../whatsnew/3.10.rst:356 +#: ../../whatsnew/3.10.rst:357 msgid "" "When printing :exc:`AttributeError`, :c:func:`PyErr_Display` will offer " "suggestions of similar attribute names in the object that the exception was " "raised from:" msgstr "" -#: ../../whatsnew/3.10.rst:367 ../../whatsnew/3.10.rst:389 +#: ../../whatsnew/3.10.rst:368 ../../whatsnew/3.10.rst:390 msgid "(Contributed by Pablo Galindo in :issue:`38530`.)" msgstr "" -#: ../../whatsnew/3.10.rst:370 +#: ../../whatsnew/3.10.rst:371 msgid "" "Notice this won't work if :c:func:`PyErr_Display` is not called to display " "the error which can happen if some other custom error display function is " "used. This is a common scenario in some REPLs like IPython." msgstr "" -#: ../../whatsnew/3.10.rst:375 +#: ../../whatsnew/3.10.rst:376 msgid "NameErrors" msgstr "NameErrors" -#: ../../whatsnew/3.10.rst:377 +#: ../../whatsnew/3.10.rst:378 msgid "" "When printing :exc:`NameError` raised by the interpreter, :c:func:" "`PyErr_Display` will offer suggestions of similar variable names in the " "function that the exception was raised from:" msgstr "" -#: ../../whatsnew/3.10.rst:392 +#: ../../whatsnew/3.10.rst:393 msgid "" "Notice this won't work if :c:func:`PyErr_Display` is not called to display " "the error, which can happen if some other custom error display function is " "used. This is a common scenario in some REPLs like IPython." msgstr "" -#: ../../whatsnew/3.10.rst:398 +#: ../../whatsnew/3.10.rst:399 msgid "PEP 626: Precise line numbers for debugging and other tools" msgstr "" -#: ../../whatsnew/3.10.rst:400 +#: ../../whatsnew/3.10.rst:401 msgid "" "PEP 626 brings more precise and reliable line numbers for debugging, " "profiling and coverage tools. Tracing events, with the correct line number, " @@ -365,24 +369,24 @@ msgid "" "are executed." msgstr "" -#: ../../whatsnew/3.10.rst:403 +#: ../../whatsnew/3.10.rst:404 msgid "" "The ``f_lineno`` attribute of frame objects will always contain the expected " "line number." msgstr "" -#: ../../whatsnew/3.10.rst:405 +#: ../../whatsnew/3.10.rst:406 msgid "" "The ``co_lnotab`` attribute of code objects is deprecated and will be " "removed in 3.12. Code that needs to convert from offset to line number " "should use the new ``co_lines()`` method instead." msgstr "" -#: ../../whatsnew/3.10.rst:409 +#: ../../whatsnew/3.10.rst:410 msgid "PEP 634: Structural Pattern Matching" msgstr "" -#: ../../whatsnew/3.10.rst:411 +#: ../../whatsnew/3.10.rst:412 msgid "" "Structural pattern matching has been added in the form of a *match " "statement* and *case statements* of patterns with associated actions. " @@ -392,40 +396,40 @@ msgid "" "actions based on different forms of data." msgstr "" -#: ../../whatsnew/3.10.rst:419 +#: ../../whatsnew/3.10.rst:420 msgid "Syntax and operations" msgstr "" -#: ../../whatsnew/3.10.rst:421 +#: ../../whatsnew/3.10.rst:422 msgid "The generic syntax of pattern matching is::" msgstr "" -#: ../../whatsnew/3.10.rst:433 +#: ../../whatsnew/3.10.rst:434 msgid "" "A match statement takes an expression and compares its value to successive " "patterns given as one or more case blocks. Specifically, pattern matching " "operates by:" msgstr "" -#: ../../whatsnew/3.10.rst:437 +#: ../../whatsnew/3.10.rst:438 msgid "using data with type and shape (the ``subject``)" msgstr "" -#: ../../whatsnew/3.10.rst:438 +#: ../../whatsnew/3.10.rst:439 msgid "evaluating the ``subject`` in the ``match`` statement" msgstr "" -#: ../../whatsnew/3.10.rst:439 +#: ../../whatsnew/3.10.rst:440 msgid "" "comparing the subject with each pattern in a ``case`` statement from top to " "bottom until a match is confirmed." msgstr "" -#: ../../whatsnew/3.10.rst:441 +#: ../../whatsnew/3.10.rst:442 msgid "executing the action associated with the pattern of the confirmed match" msgstr "" -#: ../../whatsnew/3.10.rst:443 +#: ../../whatsnew/3.10.rst:444 msgid "" "If an exact match is not confirmed, the last case, a wildcard ``_``, if " "provided, will be used as the matching case. If an exact match is not " @@ -433,11 +437,11 @@ msgid "" "op." msgstr "" -#: ../../whatsnew/3.10.rst:449 +#: ../../whatsnew/3.10.rst:450 msgid "Declarative approach" msgstr "" -#: ../../whatsnew/3.10.rst:451 +#: ../../whatsnew/3.10.rst:452 msgid "" "Readers may be aware of pattern matching through the simple example of " "matching a subject (data object) to a literal (pattern) with the switch " @@ -446,7 +450,7 @@ msgid "" "case statements containing literals." msgstr "" -#: ../../whatsnew/3.10.rst:457 +#: ../../whatsnew/3.10.rst:458 msgid "" "More powerful examples of pattern matching can be found in languages such as " "Scala and Elixir. With structural pattern matching, the approach is " @@ -454,7 +458,7 @@ msgid "" "to match." msgstr "" -#: ../../whatsnew/3.10.rst:461 +#: ../../whatsnew/3.10.rst:462 msgid "" "While an \"imperative\" series of instructions using nested \"if\" " "statements could be used to accomplish something similar to structural " @@ -466,11 +470,11 @@ msgid "" "of the subject's type and shape." msgstr "" -#: ../../whatsnew/3.10.rst:470 +#: ../../whatsnew/3.10.rst:471 msgid "Simple pattern: match to a literal" msgstr "" -#: ../../whatsnew/3.10.rst:472 +#: ../../whatsnew/3.10.rst:473 msgid "" "Let's look at this example as pattern matching in its simplest form: a " "value, the subject, being matched to several literals, the patterns. In the " @@ -479,7 +483,7 @@ msgid "" "status codes. The associated action to the case is executed after a match::" msgstr "" -#: ../../whatsnew/3.10.rst:489 +#: ../../whatsnew/3.10.rst:490 msgid "" "If the above function is passed a ``status`` of 418, \"I'm a teapot\" is " "returned. If the above function is passed a ``status`` of 500, the case " @@ -489,40 +493,40 @@ msgid "" "``_`` is optional." msgstr "" -#: ../../whatsnew/3.10.rst:496 +#: ../../whatsnew/3.10.rst:497 msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "" -#: ../../whatsnew/3.10.rst:502 +#: ../../whatsnew/3.10.rst:503 msgid "Behavior without the wildcard" msgstr "" -#: ../../whatsnew/3.10.rst:504 +#: ../../whatsnew/3.10.rst:505 msgid "" "If we modify the above example by removing the last case block, the example " "becomes::" msgstr "" -#: ../../whatsnew/3.10.rst:516 +#: ../../whatsnew/3.10.rst:517 msgid "" "Without the use of ``_`` in a case statement, a match may not exist. If no " "match exists, the behavior is a no-op. For example, if ``status`` of 500 is " "passed, a no-op occurs." msgstr "" -#: ../../whatsnew/3.10.rst:521 +#: ../../whatsnew/3.10.rst:522 msgid "Patterns with a literal and variable" msgstr "" -#: ../../whatsnew/3.10.rst:523 +#: ../../whatsnew/3.10.rst:524 msgid "" "Patterns can look like unpacking assignments, and a pattern may be used to " "bind variables. In this example, a data point can be unpacked to its x-" "coordinate and y-coordinate::" msgstr "" -#: ../../whatsnew/3.10.rst:540 +#: ../../whatsnew/3.10.rst:541 msgid "" "The first pattern has two literals, ``(0, 0)``, and may be thought of as an " "extension of the literal pattern shown above. The next two patterns combine " @@ -531,22 +535,22 @@ msgid "" "conceptually similar to the unpacking assignment ``(x, y) = point``." msgstr "" -#: ../../whatsnew/3.10.rst:547 +#: ../../whatsnew/3.10.rst:548 msgid "Patterns and classes" msgstr "" -#: ../../whatsnew/3.10.rst:549 +#: ../../whatsnew/3.10.rst:550 msgid "" "If you are using classes to structure your data, you can use as a pattern " "the class name followed by an argument list resembling a constructor. This " "pattern has the ability to capture class attributes into variables::" msgstr "" -#: ../../whatsnew/3.10.rst:571 +#: ../../whatsnew/3.10.rst:572 msgid "Patterns with positional parameters" msgstr "" -#: ../../whatsnew/3.10.rst:573 +#: ../../whatsnew/3.10.rst:574 msgid "" "You can use positional parameters with some builtin classes that provide an " "ordering for their attributes (e.g. dataclasses). You can also define a " @@ -556,53 +560,53 @@ msgid "" "attribute to the ``var`` variable)::" msgstr "" -#: ../../whatsnew/3.10.rst:585 +#: ../../whatsnew/3.10.rst:586 msgid "Nested patterns" msgstr "" -#: ../../whatsnew/3.10.rst:587 +#: ../../whatsnew/3.10.rst:588 msgid "" "Patterns can be arbitrarily nested. For example, if our data is a short " "list of points, it could be matched like this::" msgstr "" -#: ../../whatsnew/3.10.rst:603 +#: ../../whatsnew/3.10.rst:604 msgid "Complex patterns and the wildcard" msgstr "" -#: ../../whatsnew/3.10.rst:605 +#: ../../whatsnew/3.10.rst:606 msgid "" "To this point, the examples have used ``_`` alone in the last case " "statement. A wildcard can be used in more complex patterns, such as " "``('error', code, _)``. For example::" msgstr "" -#: ../../whatsnew/3.10.rst:615 +#: ../../whatsnew/3.10.rst:616 msgid "" "In the above case, ``test_variable`` will match for ('error', code, 100) and " "('error', code, 800)." msgstr "" -#: ../../whatsnew/3.10.rst:619 +#: ../../whatsnew/3.10.rst:620 msgid "Guard" msgstr "" -#: ../../whatsnew/3.10.rst:621 +#: ../../whatsnew/3.10.rst:622 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " "value capture happens before the guard is evaluated::" msgstr "" -#: ../../whatsnew/3.10.rst:632 +#: ../../whatsnew/3.10.rst:633 msgid "Other Key Features" msgstr "" -#: ../../whatsnew/3.10.rst:634 +#: ../../whatsnew/3.10.rst:635 msgid "Several other key features:" msgstr "" -#: ../../whatsnew/3.10.rst:636 +#: ../../whatsnew/3.10.rst:637 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. Technically, the subject " @@ -611,7 +615,7 @@ msgid "" "match strings." msgstr "" -#: ../../whatsnew/3.10.rst:642 +#: ../../whatsnew/3.10.rst:643 msgid "" "Sequence patterns support wildcards: ``[x, y, *rest]`` and ``(x, y, *rest)`` " "work similar to wildcards in unpacking assignments. The name after ``*`` " @@ -619,48 +623,48 @@ msgid "" "items without binding the remaining items." msgstr "" -#: ../../whatsnew/3.10.rst:647 +#: ../../whatsnew/3.10.rst:648 msgid "" -"Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the ``" -"\"bandwidth\"`` and ``\"latency\"`` values from a dict. Unlike sequence " +"Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " +"``\"bandwidth\"`` and ``\"latency\"`` values from a dict. Unlike sequence " "patterns, extra keys are ignored. A wildcard ``**rest`` is also supported. " "(But ``**_`` would be redundant, so is not allowed.)" msgstr "" -#: ../../whatsnew/3.10.rst:652 +#: ../../whatsnew/3.10.rst:653 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "" -#: ../../whatsnew/3.10.rst:656 +#: ../../whatsnew/3.10.rst:657 msgid "" "This binds x1, y1, x2, y2 like you would expect without the ``as`` clause, " "and p2 to the entire second item of the subject." msgstr "" -#: ../../whatsnew/3.10.rst:659 +#: ../../whatsnew/3.10.rst:660 msgid "" "Most literals are compared by equality. However, the singletons ``True``, " "``False`` and ``None`` are compared by identity." msgstr "" -#: ../../whatsnew/3.10.rst:662 +#: ../../whatsnew/3.10.rst:663 msgid "" "Named constants may be used in patterns. These named constants must be " "dotted names to prevent the constant from being interpreted as a capture " "variable::" msgstr "" -#: ../../whatsnew/3.10.rst:680 +#: ../../whatsnew/3.10.rst:681 msgid "" "For the full specification see :pep:`634`. Motivation and rationale are in :" "pep:`635`, and a longer tutorial is in :pep:`636`." msgstr "" -#: ../../whatsnew/3.10.rst:687 +#: ../../whatsnew/3.10.rst:688 msgid "Optional ``EncodingWarning`` and ``encoding=\"locale\"`` option" msgstr "" -#: ../../whatsnew/3.10.rst:689 +#: ../../whatsnew/3.10.rst:690 msgid "" "The default encoding of :class:`TextIOWrapper` and :func:`open` is platform " "and locale dependent. Since UTF-8 is used on most Unix platforms, omitting " @@ -668,81 +672,81 @@ msgid "" "Markdown) is a very common bug. For example::" msgstr "" -#: ../../whatsnew/3.10.rst:698 +#: ../../whatsnew/3.10.rst:699 msgid "" "To find this type of bug, an optional ``EncodingWarning`` is added. It is " "emitted when :data:`sys.flags.warn_default_encoding ` is true and " "locale-specific default encoding is used." msgstr "" -#: ../../whatsnew/3.10.rst:702 +#: ../../whatsnew/3.10.rst:703 msgid "" "``-X warn_default_encoding`` option and :envvar:`PYTHONWARNDEFAULTENCODING` " "are added to enable the warning." msgstr "" -#: ../../whatsnew/3.10.rst:705 +#: ../../whatsnew/3.10.rst:706 msgid "See :ref:`io-text-encoding` for more information." msgstr "更多資訊請見 :ref:`io-text-encoding`\\ 。" -#: ../../whatsnew/3.10.rst:710 +#: ../../whatsnew/3.10.rst:711 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.10.rst:712 +#: ../../whatsnew/3.10.rst:713 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.10.rst:717 +#: ../../whatsnew/3.10.rst:718 msgid "PEP 604: New Type Union Operator" msgstr "" -#: ../../whatsnew/3.10.rst:719 +#: ../../whatsnew/3.10.rst:720 msgid "" "A new type union operator was introduced which enables the syntax ``X | Y``. " "This provides a cleaner way of expressing 'either type X or type Y' instead " "of using :data:`typing.Union`, especially in type hints." msgstr "" -#: ../../whatsnew/3.10.rst:723 +#: ../../whatsnew/3.10.rst:724 msgid "" "In previous versions of Python, to apply a type hint for functions accepting " "arguments of multiple types, :data:`typing.Union` was used::" msgstr "" -#: ../../whatsnew/3.10.rst:730 +#: ../../whatsnew/3.10.rst:731 msgid "Type hints can now be written in a more succinct manner::" msgstr "" -#: ../../whatsnew/3.10.rst:736 +#: ../../whatsnew/3.10.rst:737 msgid "" "This new syntax is also accepted as the second argument to :func:" "`isinstance` and :func:`issubclass`::" msgstr "" -#: ../../whatsnew/3.10.rst:742 +#: ../../whatsnew/3.10.rst:743 msgid "See :ref:`types-union` and :pep:`604` for more details." msgstr "更多資訊請見 :ref:`types-union` 與 :pep:`604`\\ 。" -#: ../../whatsnew/3.10.rst:744 +#: ../../whatsnew/3.10.rst:745 msgid "" "(Contributed by Maggie Moss and Philippe Prados in :issue:`41428`, with " "additions by Yurii Karabas and Serhiy Storchaka in :issue:`44490`.)" msgstr "" -#: ../../whatsnew/3.10.rst:749 +#: ../../whatsnew/3.10.rst:750 msgid "PEP 612: Parameter Specification Variables" msgstr "" -#: ../../whatsnew/3.10.rst:751 +#: ../../whatsnew/3.10.rst:752 msgid "" "Two new options to improve the information provided to static type checkers " "for :pep:`484`\\ 's ``Callable`` have been added to the :mod:`typing` module." msgstr "" -#: ../../whatsnew/3.10.rst:754 +#: ../../whatsnew/3.10.rst:755 msgid "" "The first is the parameter specification variable. They are used to forward " "the parameter types of one callable to another callable -- a pattern " @@ -751,7 +755,7 @@ msgid "" "to type annotate dependency of parameter types in such a precise manner." msgstr "" -#: ../../whatsnew/3.10.rst:760 +#: ../../whatsnew/3.10.rst:761 msgid "" "The second option is the new ``Concatenate`` operator. It's used in " "conjunction with parameter specification variables to type annotate a higher " @@ -759,24 +763,24 @@ msgid "" "Examples of usage can be found in :class:`typing.Concatenate`." msgstr "" -#: ../../whatsnew/3.10.rst:765 +#: ../../whatsnew/3.10.rst:766 msgid "" "See :class:`typing.Callable`, :class:`typing.ParamSpec`, :class:`typing." "Concatenate`, :class:`typing.ParamSpecArgs`, :class:`typing." "ParamSpecKwargs`, and :pep:`612` for more details." msgstr "" -#: ../../whatsnew/3.10.rst:769 +#: ../../whatsnew/3.10.rst:770 msgid "" "(Contributed by Ken Jin in :issue:`41559`, with minor enhancements by Jelle " "Zijlstra in :issue:`43783`. PEP written by Mark Mendoza.)" msgstr "" -#: ../../whatsnew/3.10.rst:774 +#: ../../whatsnew/3.10.rst:775 msgid "PEP 613: TypeAlias" msgstr "" -#: ../../whatsnew/3.10.rst:776 +#: ../../whatsnew/3.10.rst:777 msgid "" ":pep:`484` introduced the concept of type aliases, only requiring them to be " "top-level unannotated assignments. This simplicity sometimes made it " @@ -785,25 +789,25 @@ msgid "" "involved. Compare::" msgstr "" -#: ../../whatsnew/3.10.rst:784 +#: ../../whatsnew/3.10.rst:785 msgid "" "Now the :mod:`typing` module has a special value :data:`TypeAlias` which " "lets you declare type aliases more explicitly::" msgstr "" -#: ../../whatsnew/3.10.rst:790 +#: ../../whatsnew/3.10.rst:791 msgid "See :pep:`613` for more details." msgstr "更多資訊請見 :pep:`613`\\ 。" -#: ../../whatsnew/3.10.rst:792 +#: ../../whatsnew/3.10.rst:793 msgid "(Contributed by Mikhail Golubev in :issue:`41923`.)" msgstr "" -#: ../../whatsnew/3.10.rst:795 +#: ../../whatsnew/3.10.rst:796 msgid "PEP 647: User-Defined Type Guards" msgstr "" -#: ../../whatsnew/3.10.rst:797 +#: ../../whatsnew/3.10.rst:798 msgid "" ":data:`TypeGuard` has been added to the :mod:`typing` module to annotate " "type guard functions and improve information provided to static type " @@ -811,24 +815,24 @@ msgid "" "`TypeGuard`\\ 's documentation, and :pep:`647`." msgstr "" -#: ../../whatsnew/3.10.rst:802 +#: ../../whatsnew/3.10.rst:803 msgid "" "(Contributed by Ken Jin and Guido van Rossum in :issue:`43766`. PEP written " "by Eric Traut.)" msgstr "" -#: ../../whatsnew/3.10.rst:806 +#: ../../whatsnew/3.10.rst:807 msgid "Other Language Changes" msgstr "" -#: ../../whatsnew/3.10.rst:808 +#: ../../whatsnew/3.10.rst:809 msgid "" "The :class:`int` type has a new method :meth:`int.bit_count`, returning the " "number of ones in the binary expansion of a given integer, also known as the " "population count. (Contributed by Niklas Fiekas in :issue:`29882`.)" msgstr "" -#: ../../whatsnew/3.10.rst:812 +#: ../../whatsnew/3.10.rst:813 msgid "" "The views returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict." "items` now all have a ``mapping`` attribute that gives a :class:`types." @@ -836,13 +840,13 @@ msgid "" "Dennis Sweeney in :issue:`40890`.)" msgstr "" -#: ../../whatsnew/3.10.rst:817 +#: ../../whatsnew/3.10.rst:818 msgid "" ":pep:`618`: The :func:`zip` function now has an optional ``strict`` flag, " "used to require that all the iterables have an equal length." msgstr "" -#: ../../whatsnew/3.10.rst:820 +#: ../../whatsnew/3.10.rst:821 msgid "" "Builtin and extension functions that take integer arguments no longer " "accept :class:`~decimal.Decimal`\\ s, :class:`~fractions.Fraction`\\ s and " @@ -851,20 +855,20 @@ msgid "" "__index__` method). (Contributed by Serhiy Storchaka in :issue:`37999`.)" msgstr "" -#: ../../whatsnew/3.10.rst:827 +#: ../../whatsnew/3.10.rst:828 msgid "" "If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator " "will correctly fall back to :func:`object.__pow__` and :func:`object." "__rpow__` as expected. (Contributed by Alex Shkop in :issue:`38302`.)" msgstr "" -#: ../../whatsnew/3.10.rst:831 +#: ../../whatsnew/3.10.rst:832 msgid "" "Assignment expressions can now be used unparenthesized within set literals " "and set comprehensions, as well as in sequence indexes (but not slices)." msgstr "" -#: ../../whatsnew/3.10.rst:834 +#: ../../whatsnew/3.10.rst:835 msgid "" "Functions have a new ``__builtins__`` attribute which is used to look for " "builtin symbols when a function is executed, instead of looking into " @@ -873,7 +877,7 @@ msgid "" "builtins. (Contributed by Mark Shannon in :issue:`42990`.)" msgstr "" -#: ../../whatsnew/3.10.rst:840 +#: ../../whatsnew/3.10.rst:841 msgid "" "Two new builtin functions -- :func:`aiter` and :func:`anext` have been added " "to provide asynchronous counterparts to :func:`iter` and :func:`next`, " @@ -881,7 +885,7 @@ msgid "" "in :issue:`31861`.)" msgstr "" -#: ../../whatsnew/3.10.rst:845 +#: ../../whatsnew/3.10.rst:846 msgid "" "Static methods (:func:`@staticmethod `) and class methods (:" "func:`@classmethod `) now inherit the method attributes " @@ -891,7 +895,7 @@ msgid "" "Stinner in :issue:`43682`.)" msgstr "" -#: ../../whatsnew/3.10.rst:852 +#: ../../whatsnew/3.10.rst:853 msgid "" "Annotations for complex targets (everything beside ``simple name`` targets " "defined by :pep:`526`) no longer cause any runtime effects with ``from " @@ -899,7 +903,7 @@ msgid "" "`42737`.)" msgstr "" -#: ../../whatsnew/3.10.rst:856 +#: ../../whatsnew/3.10.rst:857 msgid "" "Class and module objects now lazy-create empty annotations dicts on demand. " "The annotations dicts are stored in the object’s ``__dict__`` for backwards " @@ -908,7 +912,7 @@ msgid "" "howto`. (Contributed by Larry Hastings in :issue:`43901`.)" msgstr "" -#: ../../whatsnew/3.10.rst:863 +#: ../../whatsnew/3.10.rst:864 msgid "" "Annotations consist of ``yield``, ``yield from``, ``await`` or named " "expressions are now forbidden under ``from __future__ import annotations`` " @@ -916,7 +920,7 @@ msgid "" "`42725`.)" msgstr "" -#: ../../whatsnew/3.10.rst:868 +#: ../../whatsnew/3.10.rst:869 msgid "" "Usage of unbound variables, ``super()`` and other expressions that might " "alter the processing of symbol table as annotations are now rendered " @@ -924,7 +928,7 @@ msgid "" "Batuhan Taskaya in :issue:`42725`.)" msgstr "" -#: ../../whatsnew/3.10.rst:873 +#: ../../whatsnew/3.10.rst:874 msgid "" "Hashes of NaN values of both :class:`float` type and :class:`decimal." "Decimal` type now depend on object identity. Formerly, they always hashed to " @@ -934,121 +938,121 @@ msgid "" "Raymond Hettinger in :issue:`43475`.)" msgstr "" -#: ../../whatsnew/3.10.rst:880 +#: ../../whatsnew/3.10.rst:881 msgid "" "A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when " "deleting the :const:`__debug__` constant. (Contributed by Dong-hee Na in :" "issue:`45000`.)" msgstr "" -#: ../../whatsnew/3.10.rst:883 +#: ../../whatsnew/3.10.rst:884 msgid "" ":exc:`SyntaxError` exceptions now have ``end_lineno`` and ``end_offset`` " "attributes. They will be ``None`` if not determined. (Contributed by Pablo " "Galindo in :issue:`43914`.)" msgstr "" -#: ../../whatsnew/3.10.rst:888 +#: ../../whatsnew/3.10.rst:889 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.10.rst:890 +#: ../../whatsnew/3.10.rst:891 msgid "None yet." msgstr "" -#: ../../whatsnew/3.10.rst:894 +#: ../../whatsnew/3.10.rst:895 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.10.rst:897 +#: ../../whatsnew/3.10.rst:898 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.10.rst:899 +#: ../../whatsnew/3.10.rst:900 msgid "" "Add missing :meth:`~asyncio.events.AbstractEventLoop." "connect_accepted_socket` method. (Contributed by Alex Grönholm in :issue:" "`41332`.)" msgstr "" -#: ../../whatsnew/3.10.rst:904 +#: ../../whatsnew/3.10.rst:905 msgid "argparse" msgstr "argparse" -#: ../../whatsnew/3.10.rst:906 +#: ../../whatsnew/3.10.rst:907 msgid "" "Misleading phrase \"optional arguments\" was replaced with \"options\" in " "argparse help. Some tests might require adaptation if they rely on exact " "output match. (Contributed by Raymond Hettinger in :issue:`9694`.)" msgstr "" -#: ../../whatsnew/3.10.rst:910 +#: ../../whatsnew/3.10.rst:911 msgid "array" msgstr "array" -#: ../../whatsnew/3.10.rst:912 +#: ../../whatsnew/3.10.rst:913 msgid "" "The :meth:`~array.array.index` method of :class:`array.array` now has " "optional *start* and *stop* parameters. (Contributed by Anders Lorentsen and " "Zackery Spytz in :issue:`31956`.)" msgstr "" -#: ../../whatsnew/3.10.rst:917 +#: ../../whatsnew/3.10.rst:918 msgid "asynchat, asyncore, smtpd" msgstr "asynchat, asyncore, smtpd" -#: ../../whatsnew/3.10.rst:918 +#: ../../whatsnew/3.10.rst:919 msgid "" "These modules have been marked as deprecated in their module documentation " "since Python 3.6. An import-time :class:`DeprecationWarning` has now been " "added to all three of these modules." msgstr "" -#: ../../whatsnew/3.10.rst:923 +#: ../../whatsnew/3.10.rst:924 msgid "base64" msgstr "base64" -#: ../../whatsnew/3.10.rst:925 +#: ../../whatsnew/3.10.rst:926 msgid "" "Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` to support " "the Base32 Encoding with Extended Hex Alphabet." msgstr "" -#: ../../whatsnew/3.10.rst:929 +#: ../../whatsnew/3.10.rst:930 msgid "bdb" msgstr "bdb" -#: ../../whatsnew/3.10.rst:931 +#: ../../whatsnew/3.10.rst:932 msgid "" "Add :meth:`~bdb.Breakpoint.clearBreakpoints` to reset all set breakpoints. " "(Contributed by Irit Katriel in :issue:`24160`.)" msgstr "" -#: ../../whatsnew/3.10.rst:935 +#: ../../whatsnew/3.10.rst:936 msgid "bisect" msgstr "bisect" -#: ../../whatsnew/3.10.rst:937 +#: ../../whatsnew/3.10.rst:938 msgid "" "Added the possibility of providing a *key* function to the APIs in the :mod:" "`bisect` module. (Contributed by Raymond Hettinger in :issue:`4356`.)" msgstr "" -#: ../../whatsnew/3.10.rst:941 +#: ../../whatsnew/3.10.rst:942 msgid "codecs" msgstr "codecs" -#: ../../whatsnew/3.10.rst:943 +#: ../../whatsnew/3.10.rst:944 msgid "" "Add a :func:`codecs.unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" msgstr "" -#: ../../whatsnew/3.10.rst:947 +#: ../../whatsnew/3.10.rst:948 msgid "collections.abc" msgstr "collections.abc" -#: ../../whatsnew/3.10.rst:949 +#: ../../whatsnew/3.10.rst:950 msgid "" "The ``__args__`` of the :ref:`parameterized generic ` " "for :class:`collections.abc.Callable` are now consistent with :data:`typing." @@ -1064,34 +1068,34 @@ msgid "" "`42195`.)" msgstr "" -#: ../../whatsnew/3.10.rst:962 +#: ../../whatsnew/3.10.rst:963 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.10.rst:964 +#: ../../whatsnew/3.10.rst:965 msgid "" "Add a :func:`contextlib.aclosing` context manager to safely close async " "generators and objects representing asynchronously released resources. " "(Contributed by Joongi Kim and John Belmonte in :issue:`41229`.)" msgstr "" -#: ../../whatsnew/3.10.rst:968 +#: ../../whatsnew/3.10.rst:969 msgid "" "Add asynchronous context manager support to :func:`contextlib.nullcontext`. " "(Contributed by Tom Gringauz in :issue:`41543`.)" msgstr "" -#: ../../whatsnew/3.10.rst:971 +#: ../../whatsnew/3.10.rst:972 msgid "" "Add :class:`AsyncContextDecorator`, for supporting usage of async context " "managers as decorators." msgstr "" -#: ../../whatsnew/3.10.rst:975 +#: ../../whatsnew/3.10.rst:976 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.10.rst:977 +#: ../../whatsnew/3.10.rst:978 msgid "" "The extended color functions added in ncurses 6.1 will be used transparently " "by :func:`curses.color_content`, :func:`curses.init_color`, :func:`curses." @@ -1101,53 +1105,53 @@ msgid "" "Kintscher and Hans Petter Jansson in :issue:`36982`.)" msgstr "" -#: ../../whatsnew/3.10.rst:984 +#: ../../whatsnew/3.10.rst:985 msgid "" "The ``BUTTON5_*`` constants are now exposed in the :mod:`curses` module if " "they are provided by the underlying curses library. (Contributed by Zackery " "Spytz in :issue:`39273`.)" msgstr "" -#: ../../whatsnew/3.10.rst:989 +#: ../../whatsnew/3.10.rst:990 msgid "dataclasses" msgstr "dataclasses" -#: ../../whatsnew/3.10.rst:992 +#: ../../whatsnew/3.10.rst:993 msgid "__slots__" msgstr "__slots__" -#: ../../whatsnew/3.10.rst:994 +#: ../../whatsnew/3.10.rst:995 msgid "" "Added ``slots`` parameter in :func:`dataclasses.dataclass` decorator. " "(Contributed by Yurii Karabas in :issue:`42269`)" msgstr "" -#: ../../whatsnew/3.10.rst:998 +#: ../../whatsnew/3.10.rst:999 msgid "Keyword-only fields" msgstr "" -#: ../../whatsnew/3.10.rst:1000 +#: ../../whatsnew/3.10.rst:1001 msgid "" "dataclasses now supports fields that are keyword-only in the generated " "__init__ method. There are a number of ways of specifying keyword-only " "fields." msgstr "" -#: ../../whatsnew/3.10.rst:1004 +#: ../../whatsnew/3.10.rst:1005 msgid "You can say that every field is keyword-only:" msgstr "" -#: ../../whatsnew/3.10.rst:1015 +#: ../../whatsnew/3.10.rst:1016 msgid "" "Both ``name`` and ``birthday`` are keyword-only parameters to the generated " "__init__ method." msgstr "" -#: ../../whatsnew/3.10.rst:1018 +#: ../../whatsnew/3.10.rst:1019 msgid "You can specify keyword-only on a per-field basis:" msgstr "" -#: ../../whatsnew/3.10.rst:1029 +#: ../../whatsnew/3.10.rst:1030 msgid "" "Here only ``birthday`` is keyword-only. If you set ``kw_only`` on " "individual fields, be aware that there are rules about re-ordering fields " @@ -1155,23 +1159,23 @@ msgid "" "the full dataclasses documentation for details." msgstr "" -#: ../../whatsnew/3.10.rst:1034 +#: ../../whatsnew/3.10.rst:1035 msgid "" "You can also specify that all fields following a KW_ONLY marker are keyword-" "only. This will probably be the most common usage:" msgstr "" -#: ../../whatsnew/3.10.rst:1049 +#: ../../whatsnew/3.10.rst:1050 msgid "" "Here, ``z`` and ``t`` are keyword-only parameters, while ``x`` and ``y`` are " "not. (Contributed by Eric V. Smith in :issue:`43532`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1056 +#: ../../whatsnew/3.10.rst:1057 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.10.rst:1058 +#: ../../whatsnew/3.10.rst:1059 msgid "" "The entire ``distutils`` package is deprecated, to be removed in Python " "3.12. Its functionality for specifying package builds has already been " @@ -1184,39 +1188,39 @@ msgid "" "`632` for discussion." msgstr "" -#: ../../whatsnew/3.10.rst:1068 +#: ../../whatsnew/3.10.rst:1069 msgid "" "The ``bdist_wininst`` command deprecated in Python 3.8 has been removed. The " "``bdist_wheel`` command is now recommended to distribute binary packages on " "Windows. (Contributed by Victor Stinner in :issue:`42802`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1074 +#: ../../whatsnew/3.10.rst:1075 msgid "doctest" msgstr "doctest" -#: ../../whatsnew/3.10.rst:1076 ../../whatsnew/3.10.rst:1211 -#: ../../whatsnew/3.10.rst:1238 ../../whatsnew/3.10.rst:1337 +#: ../../whatsnew/3.10.rst:1077 ../../whatsnew/3.10.rst:1212 +#: ../../whatsnew/3.10.rst:1239 ../../whatsnew/3.10.rst:1338 msgid "" "When a module does not define ``__loader__``, fall back to ``__spec__." "loader``. (Contributed by Brett Cannon in :issue:`42133`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1080 +#: ../../whatsnew/3.10.rst:1081 msgid "encodings" msgstr "encodings" -#: ../../whatsnew/3.10.rst:1082 +#: ../../whatsnew/3.10.rst:1083 msgid "" ":func:`encodings.normalize_encoding` now ignores non-ASCII characters. " "(Contributed by Hai Shi in :issue:`39337`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1086 +#: ../../whatsnew/3.10.rst:1087 msgid "enum" msgstr "" -#: ../../whatsnew/3.10.rst:1088 +#: ../../whatsnew/3.10.rst:1089 msgid "" ":class:`Enum` :func:`__repr__` now returns ``enum_name.member_name`` and :" "func:`__str__` now returns ``member_name``. Stdlib enums available as " @@ -1224,106 +1228,106 @@ msgid "" "(Contributed by Ethan Furman in :issue:`40066`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1093 +#: ../../whatsnew/3.10.rst:1094 msgid "" "Add :class:`enum.StrEnum` for enums where all members are strings. " "(Contributed by Ethan Furman in :issue:`41816`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1097 +#: ../../whatsnew/3.10.rst:1098 msgid "fileinput" msgstr "fileinput" -#: ../../whatsnew/3.10.rst:1099 +#: ../../whatsnew/3.10.rst:1100 msgid "" "Add *encoding* and *errors* parameters in :func:`fileinput.input` and :class:" "`fileinput.FileInput`. (Contributed by Inada Naoki in :issue:`43712`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1103 +#: ../../whatsnew/3.10.rst:1104 msgid "" ":func:`fileinput.hook_compressed` now returns :class:`TextIOWrapper` object " "when *mode* is \"r\" and file is compressed, like uncompressed files. " "(Contributed by Inada Naoki in :issue:`5758`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1108 +#: ../../whatsnew/3.10.rst:1109 msgid "faulthandler" msgstr "faulthandler" -#: ../../whatsnew/3.10.rst:1110 +#: ../../whatsnew/3.10.rst:1111 msgid "" "The :mod:`faulthandler` module now detects if a fatal error occurs during a " "garbage collector collection. (Contributed by Victor Stinner in :issue:" "`44466`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1115 +#: ../../whatsnew/3.10.rst:1116 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.10.rst:1117 +#: ../../whatsnew/3.10.rst:1118 msgid "" "Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and :" "func:`gc.get_referents`. (Contributed by Pablo Galindo in :issue:`43439`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1121 +#: ../../whatsnew/3.10.rst:1122 msgid "glob" msgstr "glob" -#: ../../whatsnew/3.10.rst:1123 +#: ../../whatsnew/3.10.rst:1124 msgid "" "Add the *root_dir* and *dir_fd* parameters in :func:`~glob.glob` and :func:" "`~glob.iglob` which allow to specify the root directory for searching. " "(Contributed by Serhiy Storchaka in :issue:`38144`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1128 +#: ../../whatsnew/3.10.rst:1129 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.10.rst:1130 +#: ../../whatsnew/3.10.rst:1131 msgid "" "The hashlib module requires OpenSSL 1.1.1 or newer. (Contributed by " "Christian Heimes in :pep:`644` and :issue:`43669`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1133 +#: ../../whatsnew/3.10.rst:1134 msgid "" "The hashlib module has preliminary support for OpenSSL 3.0.0. (Contributed " "by Christian Heimes in :issue:`38820` and other issues.)" msgstr "" -#: ../../whatsnew/3.10.rst:1136 +#: ../../whatsnew/3.10.rst:1137 msgid "" "The pure-Python fallback of :func:`~hashlib.pbkdf2_hmac` is deprecated. In " "the future PBKDF2-HMAC will only be available when Python has been built " "with OpenSSL support. (Contributed by Christian Heimes in :issue:`43880`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1142 +#: ../../whatsnew/3.10.rst:1143 msgid "hmac" msgstr "hmac" -#: ../../whatsnew/3.10.rst:1144 +#: ../../whatsnew/3.10.rst:1145 msgid "" "The hmac module now uses OpenSSL's HMAC implementation internally. " "(Contributed by Christian Heimes in :issue:`40645`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1148 +#: ../../whatsnew/3.10.rst:1149 msgid "IDLE and idlelib" msgstr "" -#: ../../whatsnew/3.10.rst:1150 +#: ../../whatsnew/3.10.rst:1151 msgid "" "Make IDLE invoke :func:`sys.excepthook` (when started without '-n'). User " "hooks were previously ignored. (Contributed by Ken Hilton in :issue:" "`43008`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1154 +#: ../../whatsnew/3.10.rst:1155 msgid "" "Rearrange the settings dialog. Split the General tab into Windows and Shell/" "Ed tabs. Move help sources, which extend the Help menu, to the Extensions " @@ -1334,11 +1338,11 @@ msgid "" "`33962`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1162 +#: ../../whatsnew/3.10.rst:1163 msgid "The changes above were backported to a 3.9 maintenance release." msgstr "" -#: ../../whatsnew/3.10.rst:1164 +#: ../../whatsnew/3.10.rst:1165 msgid "" "Add a Shell sidebar. Move the primary prompt ('>>>') to the sidebar. Add " "secondary prompts ('...') to the sidebar. Left click and optional drag " @@ -1349,7 +1353,7 @@ msgid "" "text. (Contributed by Tal Einat in :issue:`37903`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1173 +#: ../../whatsnew/3.10.rst:1174 msgid "" "Use spaces instead of tabs to indent interactive code. This makes " "interactive code entries 'look right'. Making this feasible was a major " @@ -1357,7 +1361,7 @@ msgid "" "in :issue:`37892`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1178 +#: ../../whatsnew/3.10.rst:1179 msgid "" "Highlight the new :ref:`soft keywords ` :keyword:`match`, :" "keyword:`case `, and :keyword:`_ ` in pattern-" @@ -1366,33 +1370,33 @@ msgid "" "(Contributed by Tal Einat in :issue:`44010`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1184 +#: ../../whatsnew/3.10.rst:1185 msgid "New in 3.10 maintenance releases." msgstr "" -#: ../../whatsnew/3.10.rst:1186 +#: ../../whatsnew/3.10.rst:1187 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1189 +#: ../../whatsnew/3.10.rst:1190 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1193 +#: ../../whatsnew/3.10.rst:1194 msgid "importlib.metadata" msgstr "importlib.metadata" -#: ../../whatsnew/3.10.rst:1195 +#: ../../whatsnew/3.10.rst:1196 msgid "" "Feature parity with ``importlib_metadata`` 4.6 (`history `_)." msgstr "" -#: ../../whatsnew/3.10.rst:1198 +#: ../../whatsnew/3.10.rst:1199 msgid "" ":ref:`importlib.metadata entry points ` now provide a nicer " "experience for selecting entry points by group and name through a new :class:" @@ -1400,18 +1404,18 @@ msgid "" "docs for more info on the deprecation and usage." msgstr "" -#: ../../whatsnew/3.10.rst:1204 +#: ../../whatsnew/3.10.rst:1205 msgid "" "Added :func:`importlib.metadata.packages_distributions` for resolving top-" "level Python modules and packages to their :class:`importlib.metadata." "Distribution`." msgstr "" -#: ../../whatsnew/3.10.rst:1209 +#: ../../whatsnew/3.10.rst:1210 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.10.rst:1214 +#: ../../whatsnew/3.10.rst:1215 msgid "" "Add :func:`inspect.get_annotations`, which safely computes the annotations " "defined on an object. It works around the quirks of accessing the " @@ -1429,38 +1433,38 @@ msgid "" "`43817`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1230 +#: ../../whatsnew/3.10.rst:1231 msgid "itertools" msgstr "" -#: ../../whatsnew/3.10.rst:1232 +#: ../../whatsnew/3.10.rst:1233 msgid "" "Add :func:`itertools.pairwise()`. (Contributed by Raymond Hettinger in :" "issue:`38200`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1236 +#: ../../whatsnew/3.10.rst:1237 msgid "linecache" msgstr "linecache" -#: ../../whatsnew/3.10.rst:1242 +#: ../../whatsnew/3.10.rst:1243 msgid "os" msgstr "os" -#: ../../whatsnew/3.10.rst:1244 +#: ../../whatsnew/3.10.rst:1245 msgid "" "Add :func:`os.cpu_count()` support for VxWorks RTOS. (Contributed by Peixing " "Xin in :issue:`41440`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1247 +#: ../../whatsnew/3.10.rst:1248 msgid "" "Add a new function :func:`os.eventfd` and related helpers to wrap the " "``eventfd2`` syscall on Linux. (Contributed by Christian Heimes in :issue:" "`41001`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1251 +#: ../../whatsnew/3.10.rst:1252 msgid "" "Add :func:`os.splice()` that allows to move data between two file " "descriptors without copying between kernel address space and user address " @@ -1468,41 +1472,41 @@ msgid "" "by Pablo Galindo in :issue:`41625`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1256 +#: ../../whatsnew/3.10.rst:1257 msgid "" "Add :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`, :data:`~os.O_SYMLINK` and :" "data:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Dong-hee Na in :issue:" "`43106`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1261 +#: ../../whatsnew/3.10.rst:1262 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.10.rst:1263 +#: ../../whatsnew/3.10.rst:1264 msgid "" ":func:`os.path.realpath` now accepts a *strict* keyword-only argument. When " "set to ``True``, :exc:`OSError` is raised if a path doesn't exist or a " "symlink loop is encountered. (Contributed by Barney Gale in :issue:`43757`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1269 +#: ../../whatsnew/3.10.rst:1270 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.10.rst:1271 +#: ../../whatsnew/3.10.rst:1272 msgid "" "Add slice support to :attr:`PurePath.parents `. " "(Contributed by Joshua Cannon in :issue:`35498`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1274 +#: ../../whatsnew/3.10.rst:1275 msgid "" "Add negative indexing support to :attr:`PurePath.parents `. (Contributed by Yaroslav Pankovych in :issue:`21041`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1278 +#: ../../whatsnew/3.10.rst:1279 msgid "" "Add :meth:`Path.hardlink_to ` method that " "supersedes :meth:`~pathlib.Path.link_to`. The new method has the same " @@ -1510,7 +1514,7 @@ msgid "" "Gale in :issue:`39950`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1283 +#: ../../whatsnew/3.10.rst:1284 msgid "" ":meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now accept a " "*follow_symlinks* keyword-only argument for consistency with corresponding " @@ -1518,11 +1522,11 @@ msgid "" "`39906`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1289 +#: ../../whatsnew/3.10.rst:1290 msgid "platform" msgstr "platform" -#: ../../whatsnew/3.10.rst:1291 +#: ../../whatsnew/3.10.rst:1292 msgid "" "Add :func:`platform.freedesktop_os_release()` to retrieve operation system " "identification from `freedesktop.org os-release ` section for " "more information." msgstr "" -#: ../../whatsnew/3.10.rst:1629 +#: ../../whatsnew/3.10.rst:1630 msgid "" "Non-integer arguments to :func:`random.randrange` are deprecated. The :exc:" "`ValueError` is deprecated in favor of a :exc:`TypeError`. (Contributed by " "Serhiy Storchaka and Raymond Hettinger in :issue:`37319`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1633 +#: ../../whatsnew/3.10.rst:1634 msgid "" "The various ``load_module()`` methods of :mod:`importlib` have been " "documented as deprecated since Python 3.6, but will now also trigger a :exc:" @@ -2038,21 +2042,21 @@ msgid "" "(Contributed by Brett Cannon in :issue:`26131`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1639 +#: ../../whatsnew/3.10.rst:1640 msgid "" ":meth:`zimport.zipimporter.load_module` has been deprecated in preference " "for :meth:`~zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon " "in :issue:`26131`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1643 +#: ../../whatsnew/3.10.rst:1644 msgid "" "The use of :meth:`~importlib.abc.Loader.load_module` by the import system " "now triggers an :exc:`ImportWarning` as :meth:`~importlib.abc.Loader." "exec_module` is preferred. (Contributed by Brett Cannon in :issue:`26131`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1648 +#: ../../whatsnew/3.10.rst:1649 msgid "" "The use of :meth:`importlib.abc.MetaPathFinder.find_module` and :meth:" "`importlib.abc.PathEntryFinder.find_module` by the import system now trigger " @@ -2062,7 +2066,7 @@ msgid "" "porting. (Contributed by Brett Cannon in :issue:`42134`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1657 +#: ../../whatsnew/3.10.rst:1658 msgid "" "The use of :meth:`importlib.abc.PathEntryFinder.find_loader` by the import " "system now triggers an :exc:`ImportWarning` as :meth:`importlib.abc." @@ -2071,7 +2075,7 @@ msgid "" "`43672`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1663 +#: ../../whatsnew/3.10.rst:1664 msgid "" "The various implementations of :meth:`importlib.abc.MetaPathFinder." "find_module` ( :meth:`importlib.machinery.BuiltinImporter.find_module`, :" @@ -2086,7 +2090,7 @@ msgid "" "Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1678 +#: ../../whatsnew/3.10.rst:1679 msgid "" ":class:`importlib.abc.Finder` is deprecated (including its sole method, :" "meth:`~importlib.abc.Finder.find_module`). Both :class:`importlib.abc." @@ -2095,7 +2099,7 @@ msgid "" "appropriate instead. (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1685 +#: ../../whatsnew/3.10.rst:1686 msgid "" "The deprecations of :mod:`imp`, :func:`importlib.find_loader`, :func:" "`importlib.util.set_package_wrapper`, :func:`importlib.util." @@ -2106,7 +2110,7 @@ msgid "" "Brett Cannon in :issue:`43720`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1695 +#: ../../whatsnew/3.10.rst:1696 msgid "" "The import system now uses the ``__spec__`` attribute on modules before " "falling back on :meth:`~importlib.abc.Loader.module_repr` for a module's " @@ -2114,7 +2118,7 @@ msgid "" "for Python 3.12. (Contributed by Brett Cannon in :issue:`42137`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1701 +#: ../../whatsnew/3.10.rst:1702 msgid "" ":meth:`importlib.abc.Loader.module_repr`, :meth:`importlib.machinery." "FrozenLoader.module_repr`, and :meth:`importlib.machinery.BuiltinLoader." @@ -2122,7 +2126,7 @@ msgid "" "(Contributed by Brett Cannon in :issue:`42136`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1707 +#: ../../whatsnew/3.10.rst:1708 msgid "" "``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python " "3.3, when it was made an alias to :class:`str`. It is now deprecated, " @@ -2130,7 +2134,7 @@ msgid "" "issue:`42264`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1712 +#: ../../whatsnew/3.10.rst:1713 msgid "" ":func:`asyncio.get_event_loop` now emits a deprecation warning if there is " "no running event loop. In the future it will be an alias of :func:`~asyncio." @@ -2144,7 +2148,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`39529`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1725 +#: ../../whatsnew/3.10.rst:1726 msgid "" "The undocumented built-in function ``sqlite3.enable_shared_cache`` is now " "deprecated, scheduled for removal in Python 3.12. Its use is strongly " @@ -2154,68 +2158,68 @@ msgid "" "query parameter. (Contributed by Erlend E. Aasland in :issue:`24464`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1733 +#: ../../whatsnew/3.10.rst:1734 msgid "The following ``threading`` methods are now deprecated:" msgstr "" -#: ../../whatsnew/3.10.rst:1735 +#: ../../whatsnew/3.10.rst:1736 msgid "``threading.currentThread`` => :func:`threading.current_thread`" msgstr "``threading.currentThread`` => :func:`threading.current_thread`" -#: ../../whatsnew/3.10.rst:1737 +#: ../../whatsnew/3.10.rst:1738 msgid "``threading.activeCount`` => :func:`threading.active_count`" msgstr "``threading.activeCount`` => :func:`threading.active_count`" -#: ../../whatsnew/3.10.rst:1739 +#: ../../whatsnew/3.10.rst:1740 msgid "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" msgstr "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" -#: ../../whatsnew/3.10.rst:1742 +#: ../../whatsnew/3.10.rst:1743 msgid "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" msgstr "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" -#: ../../whatsnew/3.10.rst:1744 +#: ../../whatsnew/3.10.rst:1745 msgid "``threading.Thread.setName`` => :attr:`threading.Thread.name`" msgstr "``threading.Thread.setName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1746 +#: ../../whatsnew/3.10.rst:1747 msgid "``threading.thread.getName`` => :attr:`threading.Thread.name`" msgstr "``threading.thread.getName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1748 +#: ../../whatsnew/3.10.rst:1749 msgid "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1750 +#: ../../whatsnew/3.10.rst:1751 msgid "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1752 +#: ../../whatsnew/3.10.rst:1753 msgid "(Contributed by Jelle Zijlstra in :gh:`87889`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1754 +#: ../../whatsnew/3.10.rst:1755 msgid "" ":meth:`pathlib.Path.link_to` is deprecated and slated for removal in Python " "3.12. Use :meth:`pathlib.Path.hardlink_to` instead. (Contributed by Barney " "Gale in :issue:`39950`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1758 +#: ../../whatsnew/3.10.rst:1759 msgid "" "``cgi.log()`` is deprecated and slated for removal in Python 3.12. " "(Contributed by Inada Naoki in :issue:`41139`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1761 +#: ../../whatsnew/3.10.rst:1762 msgid "" "The following :mod:`ssl` features have been deprecated since Python 3.6, " "Python 3.7, or OpenSSL 1.1.0 and will be removed in 3.11:" msgstr "" -#: ../../whatsnew/3.10.rst:1764 +#: ../../whatsnew/3.10.rst:1765 msgid "" ":data:`~ssl.OP_NO_SSLv2`, :data:`~ssl.OP_NO_SSLv3`, :data:`~ssl." "OP_NO_TLSv1`, :data:`~ssl.OP_NO_TLSv1_1`, :data:`~ssl.OP_NO_TLSv1_2`, and :" @@ -2223,7 +2227,7 @@ msgid "" "minimum_version` and :attr:`sslSSLContext.maximum_version`." msgstr "" -#: ../../whatsnew/3.10.rst:1770 +#: ../../whatsnew/3.10.rst:1771 msgid "" ":data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`, :data:`~ssl." "PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`, :data:`~ssl." @@ -2232,26 +2236,26 @@ msgid "" "and :data:`~ssl.PROTOCOL_TLS_SERVER`" msgstr "" -#: ../../whatsnew/3.10.rst:1776 +#: ../../whatsnew/3.10.rst:1777 msgid "" ":func:`~ssl.wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`" msgstr "" -#: ../../whatsnew/3.10.rst:1778 +#: ../../whatsnew/3.10.rst:1779 msgid ":func:`~ssl.match_hostname`" msgstr ":func:`~ssl.match_hostname`" -#: ../../whatsnew/3.10.rst:1780 +#: ../../whatsnew/3.10.rst:1781 msgid ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" msgstr ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" -#: ../../whatsnew/3.10.rst:1782 +#: ../../whatsnew/3.10.rst:1783 msgid "" "NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and :meth:`ssl." "SSLContext.set_npn_protocols` are replaced by ALPN." msgstr "" -#: ../../whatsnew/3.10.rst:1785 +#: ../../whatsnew/3.10.rst:1786 msgid "" "The threading debug (:envvar:`PYTHONTHREADDEBUG` environment variable) is " "deprecated in Python 3.10 and will be removed in Python 3.12. This feature " @@ -2259,7 +2263,7 @@ msgid "" "Victor Stinner in :issue:`44584`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1790 +#: ../../whatsnew/3.10.rst:1791 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules will be removed in a future " @@ -2268,11 +2272,11 @@ msgid "" "Rittau in :issue:`38291`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1799 ../../whatsnew/3.10.rst:2222 +#: ../../whatsnew/3.10.rst:1800 ../../whatsnew/3.10.rst:2223 msgid "Removed" msgstr "" -#: ../../whatsnew/3.10.rst:1801 +#: ../../whatsnew/3.10.rst:1802 msgid "" "Removed special methods ``__int__``, ``__float__``, ``__floordiv__``, " "``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and " @@ -2280,7 +2284,7 @@ msgid "" "`TypeError`. (Contributed by Serhiy Storchaka in :issue:`41974`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1807 +#: ../../whatsnew/3.10.rst:1808 msgid "" "The ``ParserBase.error()`` method from the private and undocumented " "``_markupbase`` module has been removed. :class:`html.parser.HTMLParser` is " @@ -2289,7 +2293,7 @@ msgid "" "`31844`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1813 +#: ../../whatsnew/3.10.rst:1814 msgid "" "Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal " "PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was " @@ -2297,7 +2301,7 @@ msgid "" "`42157`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1818 +#: ../../whatsnew/3.10.rst:1819 msgid "" "Removed the ``parser`` module, which was deprecated in 3.9 due to the switch " "to the new PEG parser, as well as all the C source and header files that " @@ -2305,7 +2309,7 @@ msgid "" "``graminit.h`` and ``grammar.h``." msgstr "" -#: ../../whatsnew/3.10.rst:1823 +#: ../../whatsnew/3.10.rst:1824 msgid "" "Removed the Public C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2313,7 +2317,7 @@ msgid "" "deprecated in 3.9 due to the switch to the new PEG parser." msgstr "" -#: ../../whatsnew/3.10.rst:1828 +#: ../../whatsnew/3.10.rst:1829 msgid "" "Removed the ``formatter`` module, which was deprecated in Python 3.4. It is " "somewhat obsolete, little used, and not tested. It was originally scheduled " @@ -2323,71 +2327,71 @@ msgid "" "`42299`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1835 +#: ../../whatsnew/3.10.rst:1836 msgid "" "Removed the :c:func:`PyModule_GetWarningsModule` function that was useless " "now due to the _warnings module was converted to a builtin module in 2.6. " "(Contributed by Hai Shi in :issue:`42599`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1839 +#: ../../whatsnew/3.10.rst:1840 msgid "" "Remove deprecated aliases to :ref:`collections-abstract-base-classes` from " "the :mod:`collections` module. (Contributed by Victor Stinner in :issue:" "`37324`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1843 +#: ../../whatsnew/3.10.rst:1844 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " "Python 3.8. The motivation behind this change is multifold:" msgstr "" -#: ../../whatsnew/3.10.rst:1847 +#: ../../whatsnew/3.10.rst:1848 msgid "This simplifies the high-level API." msgstr "" -#: ../../whatsnew/3.10.rst:1848 +#: ../../whatsnew/3.10.rst:1849 msgid "" "The functions in the high-level API have been implicitly getting the current " "thread's running event loop since Python 3.7. There isn't a need to pass " "the event loop to the API in most normal use cases." msgstr "" -#: ../../whatsnew/3.10.rst:1851 +#: ../../whatsnew/3.10.rst:1852 msgid "" "Event loop passing is error-prone especially when dealing with loops running " "in different threads." msgstr "" -#: ../../whatsnew/3.10.rst:1854 +#: ../../whatsnew/3.10.rst:1855 msgid "" "Note that the low-level API will still accept ``loop``. See :ref:`changes-" "python-api` for examples of how to replace existing code." msgstr "" -#: ../../whatsnew/3.10.rst:1857 ../../whatsnew/3.10.rst:1929 +#: ../../whatsnew/3.10.rst:1858 ../../whatsnew/3.10.rst:1930 msgid "" "(Contributed by Yurii Karabas, Andrew Svetlov, Yury Selivanov and Kyle " "Stanley in :issue:`42392`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1862 ../../whatsnew/3.10.rst:2149 +#: ../../whatsnew/3.10.rst:1863 ../../whatsnew/3.10.rst:2150 msgid "Porting to Python 3.10" msgstr "" -#: ../../whatsnew/3.10.rst:1864 +#: ../../whatsnew/3.10.rst:1865 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.10.rst:1869 +#: ../../whatsnew/3.10.rst:1870 msgid "Changes in the Python syntax" msgstr "" -#: ../../whatsnew/3.10.rst:1871 +#: ../../whatsnew/3.10.rst:1872 msgid "" "Deprecation warning is now emitted when compiling previously valid syntax if " "the numeric literal is immediately followed by a keyword (like in ``0in " @@ -2397,11 +2401,11 @@ msgid "" "following keyword. (Contributed by Serhiy Storchaka in :issue:`43833`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1882 +#: ../../whatsnew/3.10.rst:1883 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.10.rst:1884 +#: ../../whatsnew/3.10.rst:1885 msgid "" "The *etype* parameters of the :func:`~traceback.format_exception`, :func:" "`~traceback.format_exception_only`, and :func:`~traceback.print_exception` " @@ -2409,7 +2413,7 @@ msgid "" "(Contributed by Zackery Spytz and Matthias Bussonnier in :issue:`26389`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1890 +#: ../../whatsnew/3.10.rst:1891 msgid "" ":mod:`atexit`: At Python exit, if a callback registered with :func:`atexit." "register` fails, its exception is now logged. Previously, only some " @@ -2417,7 +2421,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`42639`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1896 +#: ../../whatsnew/3.10.rst:1897 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -2430,7 +2434,7 @@ msgid "" "`42195`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1906 +#: ../../whatsnew/3.10.rst:1907 msgid "" ":meth:`socket.htons` and :meth:`socket.ntohs` now raise :exc:`OverflowError` " "instead of :exc:`DeprecationWarning` if the given parameter will not fit in " @@ -2438,29 +2442,29 @@ msgid "" "`42393`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1911 +#: ../../whatsnew/3.10.rst:1912 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " "Python 3.8." msgstr "" -#: ../../whatsnew/3.10.rst:1915 +#: ../../whatsnew/3.10.rst:1916 msgid "A coroutine that currently looks like this::" msgstr "" -#: ../../whatsnew/3.10.rst:1920 +#: ../../whatsnew/3.10.rst:1921 msgid "Should be replaced with this::" msgstr "" -#: ../../whatsnew/3.10.rst:1925 +#: ../../whatsnew/3.10.rst:1926 msgid "" "If ``foo()`` was specifically designed *not* to run in the current thread's " "running event loop (e.g. running in another thread's event loop), consider " "using :func:`asyncio.run_coroutine_threadsafe` instead." msgstr "" -#: ../../whatsnew/3.10.rst:1932 +#: ../../whatsnew/3.10.rst:1933 msgid "" "The :data:`types.FunctionType` constructor now inherits the current builtins " "if the *globals* dictionary has no ``\"__builtins__\"`` key, rather than " @@ -2471,11 +2475,11 @@ msgid "" "`42990`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1941 +#: ../../whatsnew/3.10.rst:1942 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.10.rst:1943 +#: ../../whatsnew/3.10.rst:1944 msgid "" "The C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2484,31 +2488,31 @@ msgid "" "PEG parser." msgstr "" -#: ../../whatsnew/3.10.rst:1949 +#: ../../whatsnew/3.10.rst:1950 msgid "" "Source should be now be compiled directly to a code object using, for " "example, :c:func:`Py_CompileString`. The resulting code object can then be " "evaluated using, for example, :c:func:`PyEval_EvalCode`." msgstr "" -#: ../../whatsnew/3.10.rst:1953 +#: ../../whatsnew/3.10.rst:1954 msgid "Specifically:" msgstr "" -#: ../../whatsnew/3.10.rst:1955 +#: ../../whatsnew/3.10.rst:1956 msgid "" "A call to ``PyParser_SimpleParseStringFlags`` followed by ``PyNode_Compile`` " "can be replaced by calling :c:func:`Py_CompileString`." msgstr "" -#: ../../whatsnew/3.10.rst:1958 +#: ../../whatsnew/3.10.rst:1959 msgid "" "There is no direct replacement for ``PyParser_SimpleParseFileFlags``. To " "compile code from a ``FILE *`` argument, you will need to read the file in C " "and pass the resulting buffer to :c:func:`Py_CompileString`." msgstr "" -#: ../../whatsnew/3.10.rst:1962 +#: ../../whatsnew/3.10.rst:1963 msgid "" "To compile a file given a ``char *`` filename, explicitly open the file, " "read it and compile the result. One way to do this is using the :py:mod:`io` " @@ -2517,7 +2521,7 @@ msgid "" "(Declarations and error handling are omitted.) ::" msgstr "" -#: ../../whatsnew/3.10.rst:1975 +#: ../../whatsnew/3.10.rst:1976 msgid "" "For ``FrameObject`` objects, the ``f_lasti`` member now represents a " "wordcode offset instead of a simple offset into the bytecode string. This " @@ -2527,53 +2531,53 @@ msgid "" "considered stable: please use :c:func:`PyFrame_GetLineNumber` instead." msgstr "" -#: ../../whatsnew/3.10.rst:1983 +#: ../../whatsnew/3.10.rst:1984 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.10.rst:1985 +#: ../../whatsnew/3.10.rst:1986 msgid "" "The ``MAKE_FUNCTION`` instruction now accepts either a dict or a tuple of " "strings as the function's annotations. (Contributed by Yurii Karabas and " "Inada Naoki in :issue:`42202`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1990 +#: ../../whatsnew/3.10.rst:1991 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.10.rst:1992 +#: ../../whatsnew/3.10.rst:1993 msgid "" ":pep:`644`: Python now requires OpenSSL 1.1.1 or newer. OpenSSL 1.0.2 is no " "longer supported. (Contributed by Christian Heimes in :issue:`43669`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1996 +#: ../../whatsnew/3.10.rst:1997 msgid "" "The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now " "required to build Python. (Contributed by Victor Stinner in :issue:`36020`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2000 +#: ../../whatsnew/3.10.rst:2001 msgid "" ":mod:`sqlite3` requires SQLite 3.7.15 or higher. (Contributed by Sergey " "Fedoseev and Erlend E. Aasland in :issue:`40744` and :issue:`40810`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2003 +#: ../../whatsnew/3.10.rst:2004 msgid "" "The :mod:`atexit` module must now always be built as a built-in module. " "(Contributed by Victor Stinner in :issue:`42639`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2006 +#: ../../whatsnew/3.10.rst:2007 msgid "" "Add :option:`--disable-test-modules` option to the ``configure`` script: " "don't build nor install test modules. (Contributed by Xavier de Gaye, Thomas " "Petazzoni and Peixing Xin in :issue:`27640`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2010 +#: ../../whatsnew/3.10.rst:2011 msgid "" "Add :option:`--with-wheel-pkg-dir=PATH option <--with-wheel-pkg-dir>` to the " "``./configure`` script. If specified, the :mod:`ensurepip` module looks for " @@ -2582,7 +2586,7 @@ msgid "" "packages." msgstr "" -#: ../../whatsnew/3.10.rst:2016 +#: ../../whatsnew/3.10.rst:2017 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -2590,22 +2594,22 @@ msgid "" "_bundled`` package." msgstr "" -#: ../../whatsnew/3.10.rst:2021 +#: ../../whatsnew/3.10.rst:2022 msgid "(Contributed by Victor Stinner in :issue:`42856`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2023 +#: ../../whatsnew/3.10.rst:2024 msgid "" "Add a new :option:`configure --without-static-libpython option <--without-" "static-libpython>` to not build the ``libpythonMAJOR.MINOR.a`` static " "library and not install the ``python.o`` object file." msgstr "" -#: ../../whatsnew/3.10.rst:2027 +#: ../../whatsnew/3.10.rst:2028 msgid "(Contributed by Victor Stinner in :issue:`43103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2029 +#: ../../whatsnew/3.10.rst:2030 msgid "" "The ``configure`` script now uses the ``pkg-config`` utility, if available, " "to detect the location of Tcl/Tk headers and libraries. As before, those " @@ -2614,7 +2618,7 @@ msgid "" "Stamatogiannakis in :issue:`42603`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2035 +#: ../../whatsnew/3.10.rst:2036 msgid "" "Add :option:`--with-openssl-rpath` option to ``configure`` script. The " "option simplifies building Python with a custom OpenSSL installation, e.g. " @@ -2622,15 +2626,15 @@ msgid "" "(Contributed by Christian Heimes in :issue:`43466`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2042 +#: ../../whatsnew/3.10.rst:2043 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.10.rst:2045 +#: ../../whatsnew/3.10.rst:2046 msgid "PEP 652: Maintaining the Stable ABI" msgstr "" -#: ../../whatsnew/3.10.rst:2047 +#: ../../whatsnew/3.10.rst:2048 msgid "" "The Stable ABI (Application Binary Interface) for extension modules or " "embedding Python is now explicitly defined. :ref:`stable` describes C API " @@ -2638,25 +2642,25 @@ msgid "" "ABI." msgstr "" -#: ../../whatsnew/3.10.rst:2052 +#: ../../whatsnew/3.10.rst:2053 msgid "(Contributed by Petr Viktorin in :pep:`652` and :issue:`43795`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2057 +#: ../../whatsnew/3.10.rst:2058 msgid "" "The result of :c:func:`PyNumber_Index` now always has exact type :class:" "`int`. Previously, the result could have been an instance of a subclass of " "``int``. (Contributed by Serhiy Storchaka in :issue:`40792`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2061 +#: ../../whatsnew/3.10.rst:2062 msgid "" "Add a new :c:member:`~PyConfig.orig_argv` member to the :c:type:`PyConfig` " "structure: the list of the original command line arguments passed to the " "Python executable. (Contributed by Victor Stinner in :issue:`23427`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2066 +#: ../../whatsnew/3.10.rst:2067 msgid "" "The :c:func:`PyDateTime_DATE_GET_TZINFO` and :c:func:" "`PyDateTime_TIME_GET_TZINFO` macros have been added for accessing the " @@ -2664,72 +2668,72 @@ msgid "" "time` objects. (Contributed by Zackery Spytz in :issue:`30155`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2072 +#: ../../whatsnew/3.10.rst:2073 msgid "" "Add a :c:func:`PyCodec_Unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2076 +#: ../../whatsnew/3.10.rst:2077 msgid "" "The :c:func:`PyIter_Send` function was added to allow sending value into " "iterator without raising ``StopIteration`` exception. (Contributed by " "Vladimir Matveev in :issue:`41756`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2080 +#: ../../whatsnew/3.10.rst:2081 msgid "" "Add :c:func:`PyUnicode_AsUTF8AndSize` to the limited C API. (Contributed by " "Alex Gaynor in :issue:`41784`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2083 +#: ../../whatsnew/3.10.rst:2084 msgid "" "Add :c:func:`PyModule_AddObjectRef` function: similar to :c:func:" "`PyModule_AddObject` but don't steal a reference to the value on success. " "(Contributed by Victor Stinner in :issue:`1635741`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2088 +#: ../../whatsnew/3.10.rst:2089 msgid "" "Add :c:func:`Py_NewRef` and :c:func:`Py_XNewRef` functions to increment the " "reference count of an object and return the object. (Contributed by Victor " "Stinner in :issue:`42262`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2092 +#: ../../whatsnew/3.10.rst:2093 msgid "" "The :c:func:`PyType_FromSpecWithBases` and :c:func:" "`PyType_FromModuleAndSpec` functions now accept a single class as the " "*bases* argument. (Contributed by Serhiy Storchaka in :issue:`42423`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2096 +#: ../../whatsnew/3.10.rst:2097 msgid "" "The :c:func:`PyType_FromModuleAndSpec` function now accepts NULL ``tp_doc`` " "slot. (Contributed by Hai Shi in :issue:`41832`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2100 +#: ../../whatsnew/3.10.rst:2101 msgid "" "The :c:func:`PyType_GetSlot` function can accept :ref:`static types `. (Contributed by Hai Shi and Petr Viktorin in :issue:`41073`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2104 +#: ../../whatsnew/3.10.rst:2105 msgid "" "Add a new :c:func:`PySet_CheckExact` function to the C-API to check if an " "object is an instance of :class:`set` but not an instance of a subtype. " "(Contributed by Pablo Galindo in :issue:`43277`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2108 +#: ../../whatsnew/3.10.rst:2109 msgid "" "Add :c:func:`PyErr_SetInterruptEx` which allows passing a signal number to " "simulate. (Contributed by Antoine Pitrou in :issue:`43356`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2112 +#: ../../whatsnew/3.10.rst:2113 msgid "" "The limited C API is now supported if :ref:`Python is built in debug mode " "` (if the ``Py_DEBUG`` macro is defined). In the limited C API, " @@ -2742,14 +2746,14 @@ msgid "" "`36465`)." msgstr "" -#: ../../whatsnew/3.10.rst:2122 +#: ../../whatsnew/3.10.rst:2123 msgid "" "The limited C API is still not supported in the :option:`--with-trace-refs` " "special build (``Py_TRACE_REFS`` macro). (Contributed by Victor Stinner in :" "issue:`43688`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2126 +#: ../../whatsnew/3.10.rst:2127 msgid "" "Add the :c:func:`Py_Is(x, y) ` function to test if the *x* object is " "the *y* object, the same as ``x is y`` in Python. Add also the :c:func:" @@ -2759,7 +2763,7 @@ msgid "" "`43753`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2133 +#: ../../whatsnew/3.10.rst:2134 msgid "" "Add new functions to control the garbage collector from C code: :c:func:" "`PyGC_Enable()`, :c:func:`PyGC_Disable()`, :c:func:`PyGC_IsEnabled()`. These " @@ -2767,20 +2771,20 @@ msgid "" "collector from C code without having to import the :mod:`gc` module." msgstr "" -#: ../../whatsnew/3.10.rst:2140 +#: ../../whatsnew/3.10.rst:2141 msgid "" "Add a new :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " "creating type instances. (Contributed by Victor Stinner in :issue:`43916`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2144 +#: ../../whatsnew/3.10.rst:2145 msgid "" "Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " "immutable type objects: type attributes cannot be set nor deleted. " "(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2151 +#: ../../whatsnew/3.10.rst:2152 msgid "" "The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use :c:func:" "`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use ``#``: " @@ -2789,7 +2793,7 @@ msgid "" "`40943`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2157 +#: ../../whatsnew/3.10.rst:2158 msgid "" "Since :c:func:`Py_REFCNT()` is changed to the inline static function, " "``Py_REFCNT(obj) = new_refcnt`` must be replaced with ``Py_SET_REFCNT(obj, " @@ -2797,18 +2801,18 @@ msgid "" "For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.10.rst:2166 +#: ../../whatsnew/3.10.rst:2167 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2168 +#: ../../whatsnew/3.10.rst:2169 msgid "" "Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had been allowed " "for historical reason. It is no longer allowed. (Contributed by Victor " "Stinner in :issue:`40839`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2172 +#: ../../whatsnew/3.10.rst:2173 msgid "" "``PyUnicode_FromUnicode(NULL, size)`` and " "``PyUnicode_FromStringAndSize(NULL, size)`` raise ``DeprecationWarning`` " @@ -2816,14 +2820,14 @@ msgid "" "data. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2177 +#: ../../whatsnew/3.10.rst:2178 msgid "" "The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule API " "``unicodedata.ucnhash_CAPI`` has been moved to the internal C API. " "(Contributed by Victor Stinner in :issue:`42157`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2181 +#: ../../whatsnew/3.10.rst:2182 msgid "" ":c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:" "func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and :c:func:" @@ -2833,7 +2837,7 @@ msgid "" "Stinner in :issue:`42260`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2188 +#: ../../whatsnew/3.10.rst:2189 msgid "" ":c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` and :c:func:" "`PyCell_SET` macros can no longer be used as l-value or r-value. For " @@ -2843,7 +2847,7 @@ msgid "" "and Victor Stinner in :issue:`30459`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2195 +#: ../../whatsnew/3.10.rst:2196 msgid "" "The non-limited API files ``odictobject.h``, ``parser_interface.h``, " "``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``, ``pyfpe." @@ -2854,7 +2858,7 @@ msgid "" "issue:`35134`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2203 +#: ../../whatsnew/3.10.rst:2204 msgid "" "Use the :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable " "type objects. Do not rely on :c:data:`Py_TPFLAGS_HEAPTYPE` to decide if a " @@ -2863,85 +2867,85 @@ msgid "" "issue:`43908`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2209 +#: ../../whatsnew/3.10.rst:2210 msgid "" "The undocumented function ``Py_FrozenMain`` has been removed from the " "limited API. The function is mainly useful for custom builds of Python. " "(Contributed by Petr Viktorin in :issue:`26241`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2216 +#: ../../whatsnew/3.10.rst:2217 msgid "" "The ``PyUnicode_InternImmortal()`` function is now deprecated and will be " "removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` instead. " "(Contributed by Victor Stinner in :issue:`41692`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2224 +#: ../../whatsnew/3.10.rst:2225 msgid "" "Removed ``Py_UNICODE_str*`` functions manipulating ``Py_UNICODE*`` strings. " "(Contributed by Inada Naoki in :issue:`41123`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2227 +#: ../../whatsnew/3.10.rst:2228 msgid "" "``Py_UNICODE_strlen``: use :c:func:`PyUnicode_GetLength` or :c:macro:" "`PyUnicode_GET_LENGTH`" msgstr "" -#: ../../whatsnew/3.10.rst:2229 +#: ../../whatsnew/3.10.rst:2230 msgid "" "``Py_UNICODE_strcat``: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_FromFormat`" msgstr "" -#: ../../whatsnew/3.10.rst:2231 +#: ../../whatsnew/3.10.rst:2232 msgid "" "``Py_UNICODE_strcpy``, ``Py_UNICODE_strncpy``: use :c:func:" "`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`" msgstr "" -#: ../../whatsnew/3.10.rst:2233 +#: ../../whatsnew/3.10.rst:2234 msgid "``Py_UNICODE_strcmp``: use :c:func:`PyUnicode_Compare`" msgstr "" -#: ../../whatsnew/3.10.rst:2234 +#: ../../whatsnew/3.10.rst:2235 msgid "``Py_UNICODE_strncmp``: use :c:func:`PyUnicode_Tailmatch`" msgstr "" -#: ../../whatsnew/3.10.rst:2235 +#: ../../whatsnew/3.10.rst:2236 msgid "" "``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: use :c:func:" "`PyUnicode_FindChar`" msgstr "" -#: ../../whatsnew/3.10.rst:2238 +#: ../../whatsnew/3.10.rst:2239 msgid "" "Removed ``PyUnicode_GetMax()``. Please migrate to new (:pep:`393`) APIs. " "(Contributed by Inada Naoki in :issue:`41103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2241 +#: ../../whatsnew/3.10.rst:2242 msgid "" "Removed ``PyLong_FromUnicode()``. Please migrate to :c:func:" "`PyLong_FromUnicodeObject`. (Contributed by Inada Naoki in :issue:`41103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2244 +#: ../../whatsnew/3.10.rst:2245 msgid "" "Removed ``PyUnicode_AsUnicodeCopy()``. Please use :c:func:" "`PyUnicode_AsUCS4Copy` or :c:func:`PyUnicode_AsWideCharString` (Contributed " "by Inada Naoki in :issue:`41103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2248 +#: ../../whatsnew/3.10.rst:2249 msgid "" "Removed ``_Py_CheckRecursionLimit`` variable: it has been replaced by " "``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` structure. " "(Contributed by Victor Stinner in :issue:`41834`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2252 +#: ../../whatsnew/3.10.rst:2253 msgid "" "Removed undocumented macros ``Py_ALLOW_RECURSION`` and " "``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the :c:" @@ -2949,14 +2953,14 @@ msgid "" "issue:`41936`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2257 +#: ../../whatsnew/3.10.rst:2258 msgid "" "Removed the undocumented ``PyOS_InitInterrupts()`` function. Initializing " "Python already implicitly installs signal handlers: see :c:member:`PyConfig." "install_signal_handlers`. (Contributed by Victor Stinner in :issue:`41713`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2262 +#: ../../whatsnew/3.10.rst:2263 msgid "" "Remove the ``PyAST_Validate()`` function. It is no longer possible to build " "a AST object (``mod_ty`` type) with the public C API. The function was " @@ -2964,48 +2968,48 @@ msgid "" "Stinner in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2267 +#: ../../whatsnew/3.10.rst:2268 msgid "Remove the ``symtable.h`` header file and the undocumented functions:" msgstr "" -#: ../../whatsnew/3.10.rst:2269 +#: ../../whatsnew/3.10.rst:2270 msgid "``PyST_GetScope()``" msgstr "``PyST_GetScope()``" -#: ../../whatsnew/3.10.rst:2270 +#: ../../whatsnew/3.10.rst:2271 msgid "``PySymtable_Build()``" msgstr "``PySymtable_Build()``" -#: ../../whatsnew/3.10.rst:2271 +#: ../../whatsnew/3.10.rst:2272 msgid "``PySymtable_BuildObject()``" msgstr "``PySymtable_BuildObject()``" -#: ../../whatsnew/3.10.rst:2272 +#: ../../whatsnew/3.10.rst:2273 msgid "``PySymtable_Free()``" msgstr "``PySymtable_Free()``" -#: ../../whatsnew/3.10.rst:2273 +#: ../../whatsnew/3.10.rst:2274 msgid "``Py_SymtableString()``" msgstr "``Py_SymtableString()``" -#: ../../whatsnew/3.10.rst:2274 +#: ../../whatsnew/3.10.rst:2275 msgid "``Py_SymtableStringObject()``" msgstr "``Py_SymtableStringObject()``" -#: ../../whatsnew/3.10.rst:2276 +#: ../../whatsnew/3.10.rst:2277 msgid "" "The ``Py_SymtableString()`` function was part the stable ABI by mistake but " "it could not be used, because the ``symtable.h`` header file was excluded " "from the limited C API." msgstr "" -#: ../../whatsnew/3.10.rst:2280 +#: ../../whatsnew/3.10.rst:2281 msgid "" "Use Python :mod:`symtable` module instead. (Contributed by Victor Stinner " "in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2283 +#: ../../whatsnew/3.10.rst:2284 msgid "" "Remove :c:func:`PyOS_ReadlineFunctionPointer` from the limited C API headers " "and from ``python3.dll``, the library that provides the stable ABI on " @@ -3013,7 +3017,7 @@ msgid "" "cannot be guaranteed. (Contributed by Petr Viktorin in :issue:`43868`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2289 +#: ../../whatsnew/3.10.rst:2290 msgid "" "Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. These " "functions were undocumented and excluded from the limited C API. Most names " @@ -3024,86 +3028,86 @@ msgid "" "(Contributed by Victor Stinner in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2297 +#: ../../whatsnew/3.10.rst:2298 msgid "" "Remove the compiler and parser functions using ``struct _mod`` type, because " "the public AST C API was removed:" msgstr "" -#: ../../whatsnew/3.10.rst:2300 +#: ../../whatsnew/3.10.rst:2301 msgid "``PyAST_Compile()``" msgstr "``PyAST_Compile()``" -#: ../../whatsnew/3.10.rst:2301 +#: ../../whatsnew/3.10.rst:2302 msgid "``PyAST_CompileEx()``" msgstr "``PyAST_CompileEx()``" -#: ../../whatsnew/3.10.rst:2302 +#: ../../whatsnew/3.10.rst:2303 msgid "``PyAST_CompileObject()``" msgstr "``PyAST_CompileObject()``" -#: ../../whatsnew/3.10.rst:2303 +#: ../../whatsnew/3.10.rst:2304 msgid "``PyFuture_FromAST()``" msgstr "``PyFuture_FromAST()``" -#: ../../whatsnew/3.10.rst:2304 +#: ../../whatsnew/3.10.rst:2305 msgid "``PyFuture_FromASTObject()``" msgstr "``PyFuture_FromASTObject()``" -#: ../../whatsnew/3.10.rst:2305 +#: ../../whatsnew/3.10.rst:2306 msgid "``PyParser_ASTFromFile()``" msgstr "``PyParser_ASTFromFile()``" -#: ../../whatsnew/3.10.rst:2306 +#: ../../whatsnew/3.10.rst:2307 msgid "``PyParser_ASTFromFileObject()``" msgstr "``PyParser_ASTFromFileObject()``" -#: ../../whatsnew/3.10.rst:2307 +#: ../../whatsnew/3.10.rst:2308 msgid "``PyParser_ASTFromFilename()``" msgstr "``PyParser_ASTFromFilename()``" -#: ../../whatsnew/3.10.rst:2308 +#: ../../whatsnew/3.10.rst:2309 msgid "``PyParser_ASTFromString()``" msgstr "``PyParser_ASTFromString()``" -#: ../../whatsnew/3.10.rst:2309 +#: ../../whatsnew/3.10.rst:2310 msgid "``PyParser_ASTFromStringObject()``" msgstr "``PyParser_ASTFromStringObject()``" -#: ../../whatsnew/3.10.rst:2311 +#: ../../whatsnew/3.10.rst:2312 msgid "" "These functions were undocumented and excluded from the limited C API. " "(Contributed by Victor Stinner in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2314 +#: ../../whatsnew/3.10.rst:2315 msgid "Remove the ``pyarena.h`` header file with functions:" msgstr "" -#: ../../whatsnew/3.10.rst:2316 +#: ../../whatsnew/3.10.rst:2317 msgid "``PyArena_New()``" msgstr "``PyArena_New()``" -#: ../../whatsnew/3.10.rst:2317 +#: ../../whatsnew/3.10.rst:2318 msgid "``PyArena_Free()``" msgstr "``PyArena_Free()``" -#: ../../whatsnew/3.10.rst:2318 +#: ../../whatsnew/3.10.rst:2319 msgid "``PyArena_Malloc()``" msgstr "``PyArena_Malloc()``" -#: ../../whatsnew/3.10.rst:2319 +#: ../../whatsnew/3.10.rst:2320 msgid "``PyArena_AddPyObject()``" msgstr "``PyArena_AddPyObject()``" -#: ../../whatsnew/3.10.rst:2321 +#: ../../whatsnew/3.10.rst:2322 msgid "" "These functions were undocumented, excluded from the limited C API, and were " "only used internally by the compiler. (Contributed by Victor Stinner in :" "issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2325 +#: ../../whatsnew/3.10.rst:2326 msgid "" "The ``PyThreadState.use_tracing`` member has been removed to optimize " "Python. (Contributed by Mark Shannon in :issue:`43760`.)"