Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 37 additions & 31 deletions c-api/capsule.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-25 22:20+0000\n"
"POT-Creation-Date: 2025-11-07 15:15+0000\n"
"PO-Revision-Date: 2018-05-23 14:30+0000\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -37,141 +37,147 @@ msgid ""
msgstr ""

#: ../../c-api/capsule.rst:27
msgid ""
"The type object corresponding to capsule objects. This is the same object "
"as :class:`types.CapsuleType` in the Python layer."
msgstr ""

#: ../../c-api/capsule.rst:33
msgid "The type of a destructor callback for a capsule. Defined as::"
msgstr ""

#: ../../c-api/capsule.rst:29
#: ../../c-api/capsule.rst:35
msgid "typedef void (*PyCapsule_Destructor)(PyObject *);"
msgstr "typedef void (*PyCapsule_Destructor)(PyObject *);"

#: ../../c-api/capsule.rst:31
#: ../../c-api/capsule.rst:37
msgid ""
"See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor "
"callbacks."
msgstr ""

#: ../../c-api/capsule.rst:37
#: ../../c-api/capsule.rst:43
msgid ""
"Return true if its argument is a :c:type:`PyCapsule`. This function always "
"succeeds."
msgstr ""

#: ../../c-api/capsule.rst:43
#: ../../c-api/capsule.rst:49
msgid ""
"Create a :c:type:`PyCapsule` encapsulating the *pointer*. The *pointer* "
"argument may not be ``NULL``."
msgstr ""

#: ../../c-api/capsule.rst:46
#: ../../c-api/capsule.rst:52
msgid "On failure, set an exception and return ``NULL``."
msgstr ""

#: ../../c-api/capsule.rst:48
#: ../../c-api/capsule.rst:54
msgid ""
"The *name* string may either be ``NULL`` or a pointer to a valid C string. "
"If non-``NULL``, this string must outlive the capsule. (Though it is "
"permitted to free it inside the *destructor*.)"
msgstr ""

#: ../../c-api/capsule.rst:52
#: ../../c-api/capsule.rst:58
msgid ""
"If the *destructor* argument is not ``NULL``, it will be called with the "
"capsule as its argument when it is destroyed."
msgstr ""

#: ../../c-api/capsule.rst:55
#: ../../c-api/capsule.rst:61
msgid ""
"If this capsule will be stored as an attribute of a module, the *name* "
"should be specified as ``modulename.attributename``. This will enable other "
"modules to import the capsule using :c:func:`PyCapsule_Import`."
msgstr ""

#: ../../c-api/capsule.rst:62
#: ../../c-api/capsule.rst:68
msgid ""
"Retrieve the *pointer* stored in the capsule. On failure, set an exception "
"and return ``NULL``."
msgstr ""

#: ../../c-api/capsule.rst:65
#: ../../c-api/capsule.rst:71
msgid ""
"The *name* parameter must compare exactly to the name stored in the capsule. "
"If the name stored in the capsule is ``NULL``, the *name* passed in must "
"also be ``NULL``. Python uses the C function :c:func:`!strcmp` to compare "
"capsule names."
msgstr ""

#: ../../c-api/capsule.rst:73
#: ../../c-api/capsule.rst:79
msgid ""
"Return the current destructor stored in the capsule. On failure, set an "
"exception and return ``NULL``."
msgstr ""

#: ../../c-api/capsule.rst:76
#: ../../c-api/capsule.rst:82
msgid ""
"It is legal for a capsule to have a ``NULL`` destructor. This makes a "
"``NULL`` return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :"
"c:func:`PyErr_Occurred` to disambiguate."
msgstr ""

#: ../../c-api/capsule.rst:83
#: ../../c-api/capsule.rst:89
msgid ""
"Return the current context stored in the capsule. On failure, set an "
"exception and return ``NULL``."
msgstr ""

#: ../../c-api/capsule.rst:86
#: ../../c-api/capsule.rst:92
msgid ""
"It is legal for a capsule to have a ``NULL`` context. This makes a ``NULL`` "
"return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:"
"`PyErr_Occurred` to disambiguate."
msgstr ""

#: ../../c-api/capsule.rst:93
#: ../../c-api/capsule.rst:99
msgid ""
"Return the current name stored in the capsule. On failure, set an exception "
"and return ``NULL``."
msgstr ""

#: ../../c-api/capsule.rst:96
#: ../../c-api/capsule.rst:102
msgid ""
"It is legal for a capsule to have a ``NULL`` name. This makes a ``NULL`` "
"return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:"
"`PyErr_Occurred` to disambiguate."
msgstr ""

#: ../../c-api/capsule.rst:103
#: ../../c-api/capsule.rst:109
msgid ""
"Import a pointer to a C object from a capsule attribute in a module. The "
"*name* parameter should specify the full name to the attribute, as in "
"``module.attribute``. The *name* stored in the capsule must match this "
"string exactly."
msgstr ""

#: ../../c-api/capsule.rst:108
#: ../../c-api/capsule.rst:114
msgid ""
"This function splits *name* on the ``.`` character, and imports the first "
"element. It then processes further elements using attribute lookups."
msgstr ""

#: ../../c-api/capsule.rst:111
#: ../../c-api/capsule.rst:117
msgid ""
"Return the capsule's internal *pointer* on success. On failure, set an "
"exception and return ``NULL``."
msgstr ""

#: ../../c-api/capsule.rst:116
#: ../../c-api/capsule.rst:122
msgid ""
"If *name* points to an attribute of some submodule or subpackage, this "
"submodule or subpackage must be previously imported using other means (for "
"example, by using :c:func:`PyImport_ImportModule`) for the attribute lookups "
"to succeed."
msgstr ""

#: ../../c-api/capsule.rst:121
#: ../../c-api/capsule.rst:127
msgid "*no_block* has no effect anymore."
msgstr ""

#: ../../c-api/capsule.rst:127
#: ../../c-api/capsule.rst:133
msgid ""
"Determines whether or not *capsule* is a valid capsule. A valid capsule is "
"non-``NULL``, passes :c:func:`PyCapsule_CheckExact`, has a non-``NULL`` "
Expand All @@ -180,41 +186,41 @@ msgid ""
"compared.)"
msgstr ""

#: ../../c-api/capsule.rst:133
#: ../../c-api/capsule.rst:139
msgid ""
"In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls "
"to any of the accessors (any function starting with ``PyCapsule_Get``) are "
"guaranteed to succeed."
msgstr ""

#: ../../c-api/capsule.rst:137
#: ../../c-api/capsule.rst:143
msgid ""
"Return a nonzero value if the object is valid and matches the name passed "
"in. Return ``0`` otherwise. This function will not fail."
msgstr ""

#: ../../c-api/capsule.rst:143
#: ../../c-api/capsule.rst:149
msgid "Set the context pointer inside *capsule* to *context*."
msgstr ""

#: ../../c-api/capsule.rst:145 ../../c-api/capsule.rst:152
#: ../../c-api/capsule.rst:161 ../../c-api/capsule.rst:169
#: ../../c-api/capsule.rst:151 ../../c-api/capsule.rst:158
#: ../../c-api/capsule.rst:167 ../../c-api/capsule.rst:175
msgid ""
"Return ``0`` on success. Return nonzero and set an exception on failure."
msgstr ""

#: ../../c-api/capsule.rst:150
#: ../../c-api/capsule.rst:156
msgid "Set the destructor inside *capsule* to *destructor*."
msgstr ""

#: ../../c-api/capsule.rst:157
#: ../../c-api/capsule.rst:163
msgid ""
"Set the name inside *capsule* to *name*. If non-``NULL``, the name must "
"outlive the capsule. If the previous *name* stored in the capsule was not "
"``NULL``, no attempt is made to free it."
msgstr ""

#: ../../c-api/capsule.rst:166
#: ../../c-api/capsule.rst:172
msgid ""
"Set the void pointer inside *capsule* to *pointer*. The pointer may not be "
"``NULL``."
Expand Down
Loading