diff --git a/c-api/concrete.po b/c-api/concrete.po index 2f3d0f3feb..cfa7d8a04e 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-09 17:02+0000\n" +"POT-Creation-Date: 2025-11-17 00:14+0000\n" "PO-Revision-Date: 2022-11-13 20:37+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,7 +86,7 @@ msgstr "函式物件" msgid "Other Objects" msgstr "其他物件" -#: ../../c-api/concrete.rst:122 +#: ../../c-api/concrete.rst:123 msgid "C API for extension modules" msgstr "擴充模組的 C API" diff --git a/c-api/picklebuffer.po b/c-api/picklebuffer.po new file mode 100644 index 0000000000..1e73246ba7 --- /dev/null +++ b/c-api/picklebuffer.po @@ -0,0 +1,101 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001 Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.14\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-11-17 00:14+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../c-api/picklebuffer.rst:9 +msgid "Pickle buffer objects" +msgstr "" + +#: ../../c-api/picklebuffer.rst:13 +msgid "" +"A :class:`pickle.PickleBuffer` object wraps a :ref:`buffer-providing object " +"` for out-of-band data transfer with the :mod:`pickle` module." +msgstr "" + +#: ../../c-api/picklebuffer.rst:19 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python pickle buffer " +"type. This is the same object as :class:`pickle.PickleBuffer` in the Python " +"layer." +msgstr "" + +#: ../../c-api/picklebuffer.rst:25 +msgid "" +"Return true if *op* is a pickle buffer instance. This function always " +"succeeds." +msgstr "" + +#: ../../c-api/picklebuffer.rst:31 +msgid "Create a pickle buffer from the object *obj*." +msgstr "" + +#: ../../c-api/picklebuffer.rst:33 +msgid "" +"This function will fail if *obj* doesn't support the :ref:`buffer protocol " +"`." +msgstr "" + +#: ../../c-api/picklebuffer.rst:35 +msgid "" +"On success, return a new pickle buffer instance. On failure, set an " +"exception and return ``NULL``." +msgstr "" + +#: ../../c-api/picklebuffer.rst:38 +msgid "Analogous to calling :class:`pickle.PickleBuffer` with *obj* in Python." +msgstr "" + +#: ../../c-api/picklebuffer.rst:43 +msgid "" +"Get a pointer to the underlying :c:type:`Py_buffer` that the pickle buffer " +"wraps." +msgstr "" + +#: ../../c-api/picklebuffer.rst:45 +msgid "" +"The returned pointer is valid as long as *picklebuf* is alive and has not " +"been released. The caller must not modify or free the returned :c:type:" +"`Py_buffer`. If the pickle buffer has been released, raise :exc:`ValueError`." +msgstr "" + +#: ../../c-api/picklebuffer.rst:49 +msgid "" +"On success, return a pointer to the buffer view. On failure, set an " +"exception and return ``NULL``." +msgstr "" + +#: ../../c-api/picklebuffer.rst:55 +msgid "Release the underlying buffer held by the pickle buffer." +msgstr "" + +#: ../../c-api/picklebuffer.rst:57 +msgid "" +"Return ``0`` on success. On failure, set an exception and return ``-1``." +msgstr "" + +#: ../../c-api/picklebuffer.rst:59 +msgid "Analogous to calling :meth:`pickle.PickleBuffer.release` in Python." +msgstr "" + +#: ../../c-api/picklebuffer.rst:5 +msgid "object" +msgstr "" + +#: ../../c-api/picklebuffer.rst:5 +msgid "PickleBuffer" +msgstr "" diff --git a/c-api/structures.po b/c-api/structures.po index e23e123b63..0d9d63875e 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-17 00:14+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -56,8 +56,8 @@ msgstr "" #: ../../c-api/structures.rst:33 msgid "" -"The members must not be accessed directly; instead use macros such " -"as :c:macro:`Py_REFCNT` and :c:macro:`Py_TYPE`." +"The members must not be accessed directly; instead use macros such as :c:" +"macro:`Py_REFCNT` and :c:macro:`Py_TYPE`." msgstr "" #: ../../c-api/structures.rst:38 @@ -81,16 +81,16 @@ msgstr "" #: ../../c-api/structures.rst:54 msgid "" -"An extension of :c:type:`PyObject` that adds " -"the :c:member:`~PyVarObject.ob_size` field. This is intended for objects " -"that have some notion of *length*." +"An extension of :c:type:`PyObject` that adds the :c:member:`~PyVarObject." +"ob_size` field. This is intended for objects that have some notion of " +"*length*." msgstr "" #: ../../c-api/structures.rst:58 msgid "" "As with :c:type:`!PyObject`, the members must not be accessed directly; " -"instead use macros such as :c:macro:`Py_SIZE`, :c:macro:`Py_REFCNT` " -"and :c:macro:`Py_TYPE`." +"instead use macros such as :c:macro:`Py_SIZE`, :c:macro:`Py_REFCNT` and :c:" +"macro:`Py_TYPE`." msgstr "" #: ../../c-api/structures.rst:64 @@ -107,8 +107,8 @@ msgstr "" msgid "" "Object creation functions such as :c:func:`PyObject_NewVar` will generally " "set this field to the requested size (number of items). After creation, " -"arbitrary values can be stored in :c:member:`!ob_size` " -"using :c:macro:`Py_SET_SIZE`." +"arbitrary values can be stored in :c:member:`!ob_size` using :c:macro:" +"`Py_SET_SIZE`." msgstr "" #: ../../c-api/structures.rst:74 @@ -237,8 +237,8 @@ msgstr "" #: ../../c-api/structures.rst:193 msgid "" -"This is a macro which expands to initialization values for a " -"new :c:type:`PyObject` type. This macro expands to::" +"This is a macro which expands to initialization values for a new :c:type:" +"`PyObject` type. This macro expands to::" msgstr "" #: ../../c-api/structures.rst:196 @@ -251,9 +251,9 @@ msgstr "" #: ../../c-api/structures.rst:202 msgid "" -"This is a macro which expands to initialization values for a " -"new :c:type:`PyVarObject` type, including " -"the :c:member:`~PyVarObject.ob_size` field. This macro expands to::" +"This is a macro which expands to initialization values for a new :c:type:" +"`PyVarObject` type, including the :c:member:`~PyVarObject.ob_size` field. " +"This macro expands to::" msgstr "" #: ../../c-api/structures.rst:206 @@ -408,22 +408,21 @@ msgstr "" #: ../../c-api/structures.rst:312 msgid "" -"This is the typical calling convention, where the methods have the " -"type :c:type:`PyCFunction`. The function expects two :c:expr:`PyObject*` " -"values. The first one is the *self* object for methods; for module " -"functions, it is the module object. The second parameter (often called " -"*args*) is a tuple object representing all arguments. This parameter is " -"typically processed using :c:func:`PyArg_ParseTuple` " -"or :c:func:`PyArg_UnpackTuple`." +"This is the typical calling convention, where the methods have the type :c:" +"type:`PyCFunction`. The function expects two :c:expr:`PyObject*` values. The " +"first one is the *self* object for methods; for module functions, it is the " +"module object. The second parameter (often called *args*) is a tuple object " +"representing all arguments. This parameter is typically processed using :c:" +"func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`." msgstr "" #: ../../c-api/structures.rst:322 msgid "" -"Can only be used in certain combinations with other " -"flags: :ref:`METH_VARARGS | METH_KEYWORDS `, :ref:`METH_FASTCALL | METH_KEYWORDS ` and :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS " -"`." +"Can only be used in certain combinations with other flags: :ref:" +"`METH_VARARGS | METH_KEYWORDS `, :ref:" +"`METH_FASTCALL | METH_KEYWORDS ` and :ref:" +"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `." msgstr "" #: ../../c-api/structures.rst:330 @@ -504,16 +503,16 @@ msgstr "" #: ../../c-api/structures.rst:398 msgid "" -"The function must have 2 parameters. Since the second parameter is " -"unused, :c:macro:`Py_UNUSED` can be used to prevent a compiler warning." +"The function must have 2 parameters. Since the second parameter is unused, :" +"c:macro:`Py_UNUSED` can be used to prevent a compiler warning." msgstr "" #: ../../c-api/structures.rst:404 msgid "" -"Methods with a single object argument can be listed with " -"the :c:macro:`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` " -"with a ``\"O\"`` argument. They have the type :c:type:`PyCFunction`, with " -"the *self* parameter, and a :c:expr:`PyObject*` parameter representing the " +"Methods with a single object argument can be listed with the :c:macro:" +"`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` with a " +"``\"O\"`` argument. They have the type :c:type:`PyCFunction`, with the " +"*self* parameter, and a :c:expr:`PyObject*` parameter representing the " "single argument." msgstr "" @@ -550,28 +549,46 @@ msgid "" "The method will be loaded in place of existing definitions. Without " "*METH_COEXIST*, the default is to skip repeated definitions. Since slot " "wrappers are loaded before the method table, the existence of a " -"*sq_contains* slot, for example, would generate a wrapped method " -"named :meth:`~object.__contains__` and preclude the loading of a " -"corresponding PyCFunction with the same name. With the flag defined, the " -"PyCFunction will be loaded in place of the wrapper object and will co-exist " -"with the slot. This is helpful because calls to PyCFunctions are optimized " -"more than wrapper object calls." +"*sq_contains* slot, for example, would generate a wrapped method named :meth:" +"`~object.__contains__` and preclude the loading of a corresponding " +"PyCFunction with the same name. With the flag defined, the PyCFunction will " +"be loaded in place of the wrapper object and will co-exist with the slot. " +"This is helpful because calls to PyCFunctions are optimized more than " +"wrapper object calls." msgstr "" -#: ../../c-api/structures.rst:452 +#: ../../c-api/structures.rst:453 +msgid "" +"The type object corresponding to Python C method objects. This is available " +"as :class:`types.BuiltinMethodType` in the Python layer." +msgstr "" + +#: ../../c-api/structures.rst:459 +msgid "" +"Return true if *op* is an instance of the :c:type:`PyCMethod_Type` type or a " +"subtype of it. This function always succeeds." +msgstr "" + +#: ../../c-api/structures.rst:465 +msgid "" +"This is the same as :c:func:`PyCMethod_Check`, but does not account for " +"subtypes." +msgstr "" + +#: ../../c-api/structures.rst:471 msgid "" "Turn *ml* into a Python :term:`callable` object. The caller must ensure that " "*ml* outlives the :term:`callable`. Typically, *ml* is defined as a static " "variable." msgstr "" -#: ../../c-api/structures.rst:456 +#: ../../c-api/structures.rst:475 msgid "" "The *self* parameter will be passed as the *self* argument to the C function " "in ``ml->ml_meth`` when invoked. *self* can be ``NULL``." msgstr "" -#: ../../c-api/structures.rst:460 +#: ../../c-api/structures.rst:479 msgid "" "The :term:`callable` object's ``__module__`` attribute can be set from the " "given *module* argument. *module* should be a Python string, which will be " @@ -579,90 +596,171 @@ msgid "" "can be set to :const:`None` or ``NULL``." msgstr "" -#: ../../c-api/structures.rst:466 +#: ../../c-api/structures.rst:485 msgid ":attr:`function.__module__`" msgstr ":attr:`function.__module__`" -#: ../../c-api/structures.rst:468 +#: ../../c-api/structures.rst:487 msgid "" "The *cls* parameter will be passed as the *defining_class* argument to the C " "function. Must be set if :c:macro:`METH_METHOD` is set on ``ml->ml_flags``." msgstr "" -#: ../../c-api/structures.rst:477 +#: ../../c-api/structures.rst:496 +msgid "" +"The type object corresponding to Python C function objects. This is " +"available as :class:`types.BuiltinFunctionType` in the Python layer." +msgstr "" + +#: ../../c-api/structures.rst:502 +msgid "" +"Return true if *op* is an instance of the :c:type:`PyCFunction_Type` type or " +"a subtype of it. This function always succeeds." +msgstr "" + +#: ../../c-api/structures.rst:508 +msgid "" +"This is the same as :c:func:`PyCFunction_Check`, but does not account for " +"subtypes." +msgstr "" + +#: ../../c-api/structures.rst:514 msgid "Equivalent to ``PyCMethod_New(ml, self, module, NULL)``." msgstr "等價於 ``PyCMethod_New(ml, self, module, NULL)``。" -#: ../../c-api/structures.rst:482 +#: ../../c-api/structures.rst:519 msgid "Equivalent to ``PyCMethod_New(ml, self, NULL, NULL)``." msgstr "等價於 ``PyCMethod_New(ml, self, NULL, NULL)``。" -#: ../../c-api/structures.rst:486 +#: ../../c-api/structures.rst:524 +msgid "" +"Get the function's flags on *func* as they were passed to :c:member:" +"`~PyMethodDef.ml_flags`." +msgstr "" + +#: ../../c-api/structures.rst:527 ../../c-api/structures.rst:545 +#: ../../c-api/structures.rst:565 +msgid "" +"If *func* is not a C function object, this fails with an exception. *func* " +"must not be ``NULL``." +msgstr "" + +#: ../../c-api/structures.rst:530 +msgid "" +"This function returns the function's flags on success, and ``-1`` with an " +"exception set on failure." +msgstr "" + +#: ../../c-api/structures.rst:536 +msgid "" +"This is the same as :c:func:`PyCFunction_GetFlags`, but without error or " +"type checking." +msgstr "" + +#: ../../c-api/structures.rst:542 +msgid "" +"Get the function pointer on *func* as it was passed to :c:member:" +"`~PyMethodDef.ml_meth`." +msgstr "" + +#: ../../c-api/structures.rst:548 +msgid "" +"This function returns the function pointer on success, and ``NULL`` with an " +"exception set on failure." +msgstr "" + +#: ../../c-api/structures.rst:554 +msgid "" +"This is the same as :c:func:`PyCFunction_GetFunction`, but without error or " +"type checking." +msgstr "" + +#: ../../c-api/structures.rst:560 +msgid "" +"Get the \"self\" object on *func*. This is the object that would be passed " +"to the first argument of a :c:type:`PyCFunction`. For C function objects " +"created through a :c:type:`PyMethodDef` on a :c:type:`PyModuleDef`, this is " +"the resulting module object." +msgstr "" + +#: ../../c-api/structures.rst:568 +msgid "" +"This function returns a :term:`borrowed reference` to the \"self\" object on " +"success, and ``NULL`` with an exception set on failure." +msgstr "" + +#: ../../c-api/structures.rst:574 +msgid "" +"This is the same as :c:func:`PyCFunction_GetSelf`, but without error or type " +"checking." +msgstr "" + +#: ../../c-api/structures.rst:579 msgid "Accessing attributes of extension types" msgstr "" -#: ../../c-api/structures.rst:490 +#: ../../c-api/structures.rst:583 msgid "" "Structure which describes an attribute of a type which corresponds to a C " "struct member. When defining a class, put a NULL-terminated array of these " "structures in the :c:member:`~PyTypeObject.tp_members` slot." msgstr "" -#: ../../c-api/structures.rst:495 +#: ../../c-api/structures.rst:588 msgid "Its fields are, in order:" msgstr "" -#: ../../c-api/structures.rst:499 +#: ../../c-api/structures.rst:592 msgid "" "Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." msgstr "" -#: ../../c-api/structures.rst:502 +#: ../../c-api/structures.rst:595 msgid "The string should be static, no copy is made of it." msgstr "" -#: ../../c-api/structures.rst:506 +#: ../../c-api/structures.rst:599 msgid "" "The type of the member in the C struct. See :ref:`PyMemberDef-types` for the " "possible values." msgstr "" -#: ../../c-api/structures.rst:511 +#: ../../c-api/structures.rst:604 msgid "" "The offset in bytes that the member is located on the type’s object struct." msgstr "" -#: ../../c-api/structures.rst:515 +#: ../../c-api/structures.rst:608 msgid "" "Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." msgstr "" -#: ../../c-api/structures.rst:519 +#: ../../c-api/structures.rst:612 msgid "" "The docstring, or NULL. The string should be static, no copy is made of it. " "Typically, it is defined using :c:macro:`PyDoc_STR`." msgstr "" -#: ../../c-api/structures.rst:523 +#: ../../c-api/structures.rst:616 msgid "" "By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow " "both read and write access. Use the :c:macro:`Py_READONLY` flag for read-" -"only access. Certain types, like :c:macro:`Py_T_STRING`, " -"imply :c:macro:`Py_READONLY`. Only :c:macro:`Py_T_OBJECT_EX` (and " -"legacy :c:macro:`T_OBJECT`) members can be deleted." +"only access. Certain types, like :c:macro:`Py_T_STRING`, imply :c:macro:" +"`Py_READONLY`. Only :c:macro:`Py_T_OBJECT_EX` (and legacy :c:macro:" +"`T_OBJECT`) members can be deleted." msgstr "" -#: ../../c-api/structures.rst:532 +#: ../../c-api/structures.rst:625 msgid "" "For heap-allocated types (created using :c:func:`PyType_FromSpec` or " "similar), ``PyMemberDef`` may contain a definition for the special member " -"``\"__vectorcalloffset__\"``, corresponding " -"to :c:member:`~PyTypeObject.tp_vectorcall_offset` in type objects. This " -"member must be defined with ``Py_T_PYSSIZET``, and either ``Py_READONLY`` or " -"``Py_READONLY | Py_RELATIVE_OFFSET``. For example::" +"``\"__vectorcalloffset__\"``, corresponding to :c:member:`~PyTypeObject." +"tp_vectorcall_offset` in type objects. This member must be defined with " +"``Py_T_PYSSIZET``, and either ``Py_READONLY`` or ``Py_READONLY | " +"Py_RELATIVE_OFFSET``. For example::" msgstr "" -#: ../../c-api/structures.rst:539 +#: ../../c-api/structures.rst:632 msgid "" "static PyMemberDef spam_type_members[] = {\n" " {\"__vectorcalloffset__\", Py_T_PYSSIZET,\n" @@ -676,99 +774,97 @@ msgstr "" " {NULL} /* Sentinel */\n" "};" -#: ../../c-api/structures.rst:545 +#: ../../c-api/structures.rst:638 msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" msgstr "" -#: ../../c-api/structures.rst:547 +#: ../../c-api/structures.rst:640 msgid "" -"The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` " -"and :c:member:`~PyTypeObject.tp_weaklistoffset` can be defined similarly " -"using ``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"`` members, but " +"The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:" +"`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " +"``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"`` members, but " "extensions are strongly encouraged to use :c:macro:`Py_TPFLAGS_MANAGED_DICT` " "and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." msgstr "" -#: ../../c-api/structures.rst:555 +#: ../../c-api/structures.rst:648 msgid "" "``PyMemberDef`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:560 +#: ../../c-api/structures.rst:653 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` is now allowed for " "``\"__vectorcalloffset__\"``, ``\"__dictoffset__\"`` and " "``\"__weaklistoffset__\"``." msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:659 msgid "" "Get an attribute belonging to the object at address *obj_addr*. The " "attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:572 +#: ../../c-api/structures.rst:665 msgid "" "``PyMember_GetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:577 +#: ../../c-api/structures.rst:670 msgid "" "Set an attribute belonging to the object at address *obj_addr* to object " "*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " "``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:583 +#: ../../c-api/structures.rst:676 msgid "" "``PyMember_SetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:589 +#: ../../c-api/structures.rst:682 msgid "Member flags" msgstr "" -#: ../../c-api/structures.rst:591 +#: ../../c-api/structures.rst:684 msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" msgstr "" -#: ../../c-api/structures.rst:595 +#: ../../c-api/structures.rst:688 msgid "Not writable." msgstr "不可寫入。" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:692 msgid "" "Emit an ``object.__getattr__`` :ref:`audit event ` before " "reading." msgstr "" -#: ../../c-api/structures.rst:604 +#: ../../c-api/structures.rst:697 msgid "" "Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " "entry indicates an offset from the subclass-specific data, rather than from " "``PyObject``." msgstr "" -#: ../../c-api/structures.rst:608 +#: ../../c-api/structures.rst:701 msgid "" -"Can only be used as part of :c:member:`Py_tp_members " -"` :c:type:`slot ` when creating a " -"class using negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in " -"that case." +"Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using " +"negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in that case." msgstr "" -#: ../../c-api/structures.rst:613 +#: ../../c-api/structures.rst:706 msgid "" -"This flag is only used in :c:type:`PyType_Slot`. When " -"setting :c:member:`~PyTypeObject.tp_members` during class creation, Python " -"clears it and sets :c:member:`PyMemberDef.offset` to the offset from the " -"``PyObject`` struct." +"This flag is only used in :c:type:`PyType_Slot`. When setting :c:member:" +"`~PyTypeObject.tp_members` during class creation, Python clears it and sets :" +"c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." msgstr "" -#: ../../c-api/structures.rst:625 +#: ../../c-api/structures.rst:718 msgid "" "The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!" "WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are " @@ -777,20 +873,20 @@ msgid "" "nothing." msgstr "" -#: ../../c-api/structures.rst:636 +#: ../../c-api/structures.rst:729 msgid "" -"The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. " -"The :c:macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The " -"new names are now always available. Previously, these required ``#include " +"The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:" +"macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new " +"names are now always available. Previously, these required ``#include " "\"structmember.h\"``. The header is still available and it provides the old " "names." msgstr "" -#: ../../c-api/structures.rst:645 +#: ../../c-api/structures.rst:738 msgid "Member types" msgstr "" -#: ../../c-api/structures.rst:647 +#: ../../c-api/structures.rst:740 msgid "" ":c:member:`PyMemberDef.type` can be one of the following macros " "corresponding to various C types. When the member is accessed in Python, it " @@ -799,147 +895,147 @@ msgid "" "exception such as :exc:`TypeError` or :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/structures.rst:655 +#: ../../c-api/structures.rst:748 msgid "" -"Unless marked (D), attributes defined this way cannot be deleted using " -"e.g. :keyword:`del` or :py:func:`delattr`." +"Unless marked (D), attributes defined this way cannot be deleted using e.g. :" +"keyword:`del` or :py:func:`delattr`." msgstr "" -#: ../../c-api/structures.rst:659 +#: ../../c-api/structures.rst:752 msgid "Macro name" msgstr "巨集名稱" -#: ../../c-api/structures.rst:659 +#: ../../c-api/structures.rst:752 msgid "C type" msgstr "" -#: ../../c-api/structures.rst:659 +#: ../../c-api/structures.rst:752 msgid "Python type" msgstr "" -#: ../../c-api/structures.rst:661 +#: ../../c-api/structures.rst:754 msgid ":c:expr:`char`" msgstr ":c:expr:`char`" -#: ../../c-api/structures.rst:661 ../../c-api/structures.rst:662 -#: ../../c-api/structures.rst:663 ../../c-api/structures.rst:664 -#: ../../c-api/structures.rst:665 ../../c-api/structures.rst:666 -#: ../../c-api/structures.rst:667 ../../c-api/structures.rst:668 -#: ../../c-api/structures.rst:669 ../../c-api/structures.rst:670 -#: ../../c-api/structures.rst:671 +#: ../../c-api/structures.rst:754 ../../c-api/structures.rst:755 +#: ../../c-api/structures.rst:756 ../../c-api/structures.rst:757 +#: ../../c-api/structures.rst:758 ../../c-api/structures.rst:759 +#: ../../c-api/structures.rst:760 ../../c-api/structures.rst:761 +#: ../../c-api/structures.rst:762 ../../c-api/structures.rst:763 +#: ../../c-api/structures.rst:764 msgid ":py:class:`int`" msgstr ":py:class:`int`" -#: ../../c-api/structures.rst:662 +#: ../../c-api/structures.rst:755 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../c-api/structures.rst:663 +#: ../../c-api/structures.rst:756 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../c-api/structures.rst:664 +#: ../../c-api/structures.rst:757 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../c-api/structures.rst:665 +#: ../../c-api/structures.rst:758 msgid ":c:expr:`long long`" msgstr ":c:expr:`long long`" -#: ../../c-api/structures.rst:666 +#: ../../c-api/structures.rst:759 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../c-api/structures.rst:667 +#: ../../c-api/structures.rst:760 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../c-api/structures.rst:668 +#: ../../c-api/structures.rst:761 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../c-api/structures.rst:669 +#: ../../c-api/structures.rst:762 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../c-api/structures.rst:670 +#: ../../c-api/structures.rst:763 msgid ":c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned long long`" -#: ../../c-api/structures.rst:671 +#: ../../c-api/structures.rst:764 msgid ":c:expr:`Py_ssize_t`" msgstr ":c:expr:`Py_ssize_t`" -#: ../../c-api/structures.rst:672 +#: ../../c-api/structures.rst:765 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../c-api/structures.rst:672 ../../c-api/structures.rst:673 +#: ../../c-api/structures.rst:765 ../../c-api/structures.rst:766 msgid ":py:class:`float`" msgstr ":py:class:`float`" -#: ../../c-api/structures.rst:673 +#: ../../c-api/structures.rst:766 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../c-api/structures.rst:674 +#: ../../c-api/structures.rst:767 msgid ":c:expr:`char` (written as 0 or 1)" msgstr ":c:expr:`char` (寫成 0 或 1)" -#: ../../c-api/structures.rst:674 +#: ../../c-api/structures.rst:767 msgid ":py:class:`bool`" msgstr ":py:class:`bool`" -#: ../../c-api/structures.rst:676 +#: ../../c-api/structures.rst:769 msgid ":c:expr:`const char *` (*)" msgstr ":c:expr:`const char *` (*)" -#: ../../c-api/structures.rst:676 ../../c-api/structures.rst:677 +#: ../../c-api/structures.rst:769 ../../c-api/structures.rst:770 msgid ":py:class:`str` (RO)" msgstr ":py:class:`str` (RO)" -#: ../../c-api/structures.rst:677 +#: ../../c-api/structures.rst:770 msgid ":c:expr:`const char[]` (*)" msgstr ":c:expr:`const char[]` (*)" -#: ../../c-api/structures.rst:678 +#: ../../c-api/structures.rst:771 msgid ":c:expr:`char` (0-127)" msgstr ":c:expr:`char` (0-127)" -#: ../../c-api/structures.rst:678 +#: ../../c-api/structures.rst:771 msgid ":py:class:`str` (**)" msgstr ":py:class:`str` (**)" -#: ../../c-api/structures.rst:679 +#: ../../c-api/structures.rst:772 msgid ":c:expr:`PyObject *`" msgstr ":c:expr:`PyObject *`" -#: ../../c-api/structures.rst:679 +#: ../../c-api/structures.rst:772 msgid ":py:class:`object` (D)" msgstr ":py:class:`object` (D)" -#: ../../c-api/structures.rst:682 +#: ../../c-api/structures.rst:775 msgid "" "(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " "the C representation is a pointer; with :c:macro:`!Py_T_STRING_INPLACE` the " "string is stored directly in the structure." msgstr "" -#: ../../c-api/structures.rst:687 +#: ../../c-api/structures.rst:780 msgid "(**): String of length 1. Only ASCII is accepted." msgstr "" -#: ../../c-api/structures.rst:689 +#: ../../c-api/structures.rst:782 msgid "(RO): Implies :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:691 +#: ../../c-api/structures.rst:784 msgid "" "(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " "``NULL`` pointer raises :py:exc:`AttributeError`." msgstr "" -#: ../../c-api/structures.rst:717 +#: ../../c-api/structures.rst:810 msgid "" "In previous versions, the macros were only available with ``#include " "\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " @@ -947,69 +1043,69 @@ msgid "" "with the following deprecated types:" msgstr "" -#: ../../c-api/structures.rst:725 +#: ../../c-api/structures.rst:818 msgid "" "Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results " "in surprising behavior in Python: deleting the attribute effectively sets it " "to ``None``." msgstr "" -#: ../../c-api/structures.rst:731 +#: ../../c-api/structures.rst:824 msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:734 +#: ../../c-api/structures.rst:827 msgid "Defining Getters and Setters" msgstr "" -#: ../../c-api/structures.rst:738 +#: ../../c-api/structures.rst:831 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:743 +#: ../../c-api/structures.rst:836 msgid "attribute name" msgstr "屬性名稱" -#: ../../c-api/structures.rst:747 +#: ../../c-api/structures.rst:840 msgid "C function to get the attribute." msgstr "" -#: ../../c-api/structures.rst:751 +#: ../../c-api/structures.rst:844 msgid "" "Optional C function to set or delete the attribute. If ``NULL``, the " "attribute is read-only." msgstr "" -#: ../../c-api/structures.rst:756 +#: ../../c-api/structures.rst:849 msgid "optional docstring" msgstr "可選的文件字串" -#: ../../c-api/structures.rst:760 +#: ../../c-api/structures.rst:853 msgid "" "Optional user data pointer, providing additional data for getter and setter." msgstr "" -#: ../../c-api/structures.rst:764 +#: ../../c-api/structures.rst:857 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " "and a user data pointer (the associated ``closure``):" msgstr "" -#: ../../c-api/structures.rst:767 +#: ../../c-api/structures.rst:860 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:772 +#: ../../c-api/structures.rst:865 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " "the value to be set) and a user data pointer (the associated ``closure``):" msgstr "" -#: ../../c-api/structures.rst:775 +#: ../../c-api/structures.rst:868 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." @@ -1027,95 +1123,95 @@ msgstr "classmethod" msgid "staticmethod" msgstr "staticmethod" -#: ../../c-api/structures.rst:618 +#: ../../c-api/structures.rst:711 msgid "READ_RESTRICTED (C macro)" msgstr "READ_RESTRICTED(C 巨集)" -#: ../../c-api/structures.rst:618 +#: ../../c-api/structures.rst:711 msgid "WRITE_RESTRICTED (C macro)" msgstr "WRITE_RESTRICTED(C 巨集)" -#: ../../c-api/structures.rst:618 +#: ../../c-api/structures.rst:711 msgid "RESTRICTED (C macro)" msgstr "RESTRICTED(C 巨集)" -#: ../../c-api/structures.rst:631 +#: ../../c-api/structures.rst:724 msgid "READONLY (C macro)" msgstr "READONLY(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_BYTE (C macro)" msgstr "T_BYTE(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_SHORT (C macro)" msgstr "T_SHORT(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_INT (C macro)" msgstr "T_INT(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_LONG (C macro)" msgstr "T_LONG(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_LONGLONG (C macro)" msgstr "T_LONGLONG(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_UBYTE (C macro)" msgstr "T_UBYTE(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_USHORT (C macro)" msgstr "T_USHORT(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_UINT (C macro)" msgstr "T_UINT(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_ULONG (C macro)" msgstr "T_ULONG(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_ULONGULONG (C macro)" msgstr "T_ULONGULONG(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_PYSSIZET (C macro)" msgstr "T_PYSSIZET(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_FLOAT (C macro)" msgstr "T_FLOAT(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_DOUBLE (C macro)" msgstr "T_DOUBLE(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_BOOL (C macro)" msgstr "T_BOOL(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_CHAR (C macro)" msgstr "T_CHAR(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_STRING (C macro)" msgstr "T_STRING(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_STRING_INPLACE (C macro)" msgstr "T_STRING_INPLACE(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "T_OBJECT_EX (C macro)" msgstr "T_OBJECT_EX(C 巨集)" -#: ../../c-api/structures.rst:694 +#: ../../c-api/structures.rst:787 msgid "structmember.h" msgstr "structmember.h"