Skip to content
Draft
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
123 changes: 80 additions & 43 deletions c-api/allocation.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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-09 17:02+0000\n"
"PO-Revision-Date: 2022-10-16 15:35+0800\n"
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -37,10 +37,10 @@ msgstr ""

#: ../../c-api/allocation.rst:24
msgid ""
"In general, consider this function to be a low-level routine. "
"Use :c:member:`~PyTypeObject.tp_alloc` where possible. For "
"implementing :c:member:`!tp_alloc` for your type, "
"prefer :c:func:`PyType_GenericAlloc` or :c:func:`PyObject_New`."
"In general, consider this function to be a low-level routine. Use :c:member:"
"`~PyTypeObject.tp_alloc` where possible. For implementing :c:member:`!"
"tp_alloc` for your type, prefer :c:func:`PyType_GenericAlloc` or :c:func:"
"`PyObject_New`."
msgstr ""

#: ../../c-api/allocation.rst:31
Expand All @@ -66,15 +66,15 @@ msgstr ""
#: ../../c-api/allocation.rst:48
msgid ""
"Allocates a new Python object using the C structure type *TYPE* and the "
"Python type object *typeobj* (``PyTypeObject*``) by "
"calling :c:func:`PyObject_Malloc` to allocate memory and initializing it "
"like :c:func:`PyObject_Init`. The caller will own the only reference to the "
"object (i.e. its reference count will be one)."
"Python type object *typeobj* (``PyTypeObject*``) by calling :c:func:"
"`PyObject_Malloc` to allocate memory and initializing it like :c:func:"
"`PyObject_Init`. The caller will own the only reference to the object (i.e. "
"its reference count will be one)."
msgstr ""
"使用 C 結構型別 *TYPE* 和 Python 型別物件 *typeobj* (``PyTypeObject*``) 分配"
"一個新的 Python 物件。它會呼叫 :c:func:`PyObject_Malloc` 來分配記憶體,"
"並且會像 :c:func:`PyObject_Init` 一樣初始化它。呼叫者會擁有該物件的唯一參照"
"(也就是它的參照計數會是 1)。"
"一個新的 Python 物件。它會呼叫 :c:func:`PyObject_Malloc` 來分配記憶體,並且會"
" :c:func:`PyObject_Init` 一樣初始化它。呼叫者會擁有該物件的唯一參照(也就是"
"它的參照計數會是 1)。"

#: ../../c-api/allocation.rst:54 ../../c-api/allocation.rst:107
msgid ""
Expand All @@ -84,30 +84,28 @@ msgstr ""

#: ../../c-api/allocation.rst:57 ../../c-api/allocation.rst:110
msgid ""
"When populating a type's :c:member:`~PyTypeObject.tp_alloc` "
"slot, :c:func:`PyType_GenericAlloc` is preferred over a custom function that "
"simply calls this macro."
"When populating a type's :c:member:`~PyTypeObject.tp_alloc` slot, :c:func:"
"`PyType_GenericAlloc` is preferred over a custom function that simply calls "
"this macro."
msgstr ""

#: ../../c-api/allocation.rst:61
msgid ""
"This macro does not "
"call :c:member:`~PyTypeObject.tp_alloc`, :c:member:`~PyTypeObject.tp_new` "
"(:meth:`~object.__new__`), or :c:member:`~PyTypeObject.tp_init` "
"(:meth:`~object.__init__`)."
"This macro does not call :c:member:`~PyTypeObject.tp_alloc`, :c:member:"
"`~PyTypeObject.tp_new` (:meth:`~object.__new__`), or :c:member:"
"`~PyTypeObject.tp_init` (:meth:`~object.__init__`)."
msgstr ""
"這個巨集不會呼叫 :c:member:`~PyTypeObject.tp_alloc`、:c:member:`~PyTypeObject.tp_new` "
"(:meth:`~object.__new__`)、或 :c:member:`~PyTypeObject.tp_init` "
"(:meth:`~object.__init__`)。"
"這個巨集不會呼叫 :c:member:`~PyTypeObject.tp_alloc`、:c:member:"
"`~PyTypeObject.tp_new` (:meth:`~object.__new__`)、或 :c:member:"
"`~PyTypeObject.tp_init` (:meth:`~object.__init__`)。"

#: ../../c-api/allocation.rst:65
msgid ""
"This cannot be used for objects with :c:macro:`Py_TPFLAGS_HAVE_GC` set "
"in :c:member:`~PyTypeObject.tp_flags`; use :c:macro:`PyObject_GC_New` "
"instead."
"This cannot be used for objects with :c:macro:`Py_TPFLAGS_HAVE_GC` set in :c:"
"member:`~PyTypeObject.tp_flags`; use :c:macro:`PyObject_GC_New` instead."
msgstr ""
"這不能用於有在 :c:member:`~PyTypeObject.tp_flags` 中設定 "
":c:macro:`Py_TPFLAGS_HAVE_GC` 的物件;請改用 :c:macro:`PyObject_GC_New`。"
"這不能用於有在 :c:member:`~PyTypeObject.tp_flags` 中設定 :c:macro:"
"`Py_TPFLAGS_HAVE_GC` 的物件;請改用 :c:macro:`PyObject_GC_New`。"

#: ../../c-api/allocation.rst:68
msgid ""
Expand All @@ -124,16 +122,18 @@ msgstr ""
#: ../../c-api/allocation.rst:78 ../../c-api/allocation.rst:128
msgid ""
"This macro does not construct a fully initialized object of the given type; "
"it merely allocates memory and prepares it for further initialization "
"by :c:member:`~PyTypeObject.tp_init`. To construct a fully initialized "
"object, call *typeobj* instead. For example::"
"it merely allocates memory and prepares it for further initialization by :c:"
"member:`~PyTypeObject.tp_init`. To construct a fully initialized object, "
"call *typeobj* instead. For example::"
msgstr ""

#: ../../c-api/allocation.rst:83
msgid "PyObject *foo = PyObject_CallNoArgs((PyObject *)&PyFoo_Type);"
msgstr "PyObject *foo = PyObject_CallNoArgs((PyObject *)&PyFoo_Type);"

#: ../../c-api/allocation.rst:87 ../../c-api/allocation.rst:137
#: ../../c-api/allocation.rst:182 ../../c-api/allocation.rst:184
#: ../../c-api/allocation.rst:186
msgid ":c:func:`PyObject_Free`"
msgstr ":c:func:`PyObject_Free`"

Expand All @@ -156,8 +156,8 @@ msgstr "和 :c:macro:`PyObject_New` 類似,但有以下差異:"
#: ../../c-api/allocation.rst:97
msgid ""
"It allocates enough memory for the *TYPE* structure plus *size* "
"(``Py_ssize_t``) fields of the size given by "
"the :c:member:`~PyTypeObject.tp_itemsize` field of *typeobj*."
"(``Py_ssize_t``) fields of the size given by the :c:member:`~PyTypeObject."
"tp_itemsize` field of *typeobj*."
msgstr ""

#: ../../c-api/allocation.rst:100
Expand All @@ -174,12 +174,11 @@ msgstr ""

#: ../../c-api/allocation.rst:114
msgid ""
"This cannot be used for objects with :c:macro:`Py_TPFLAGS_HAVE_GC` set "
"in :c:member:`~PyTypeObject.tp_flags`; use :c:macro:`PyObject_GC_NewVar` "
"instead."
"This cannot be used for objects with :c:macro:`Py_TPFLAGS_HAVE_GC` set in :c:"
"member:`~PyTypeObject.tp_flags`; use :c:macro:`PyObject_GC_NewVar` instead."
msgstr ""
"這不能用於有在 :c:member:`~PyTypeObject.tp_flags` 中設定 "
":c:macro:`Py_TPFLAGS_HAVE_GC` 的物件;請改用 :c:macro:`PyObject_GC_NewVar`。"
"這不能用於有在 :c:member:`~PyTypeObject.tp_flags` 中設定 :c:macro:"
"`Py_TPFLAGS_HAVE_GC` 的物件;請改用 :c:macro:`PyObject_GC_NewVar`。"

#: ../../c-api/allocation.rst:118
msgid ""
Expand All @@ -198,10 +197,6 @@ msgid ":c:macro:`PyObject_GC_NewVar`"
msgstr ":c:macro:`PyObject_GC_NewVar`"

#: ../../c-api/allocation.rst:145
msgid "Same as :c:func:`PyObject_Free`."
msgstr "和 :c:func:`PyObject_Free` 相同。"

#: ../../c-api/allocation.rst:149
msgid ""
"Object which is visible in Python as ``None``. This should only be accessed "
"using the :c:macro:`Py_None` macro, which evaluates to a pointer to this "
Expand All @@ -210,10 +205,52 @@ msgstr ""
"這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存"
"取,該巨集的拿到指向該物件的指標。"

#: ../../c-api/allocation.rst:156
#: ../../c-api/allocation.rst:152
msgid ":ref:`moduleobjects`"
msgstr ":ref:`moduleobjects`"

#: ../../c-api/allocation.rst:157
#: ../../c-api/allocation.rst:153
msgid "To allocate and create extension modules."
msgstr "分配記憶體和建立擴充模組。"

#: ../../c-api/allocation.rst:157
msgid "Deprecated aliases"
msgstr "被棄用的別名"

#: ../../c-api/allocation.rst:159
msgid ""
"These are :term:`soft deprecated` aliases to existing functions and macros. "
"They exist solely for backwards compatibility."
msgstr ""

#: ../../c-api/allocation.rst:167
msgid "Deprecated alias"
msgstr "已棄用的別名"

#: ../../c-api/allocation.rst:168
msgid "Function"
msgstr "函式"

#: ../../c-api/allocation.rst:170
msgid ":c:macro:`PyObject_New`"
msgstr ":c:macro:`PyObject_New`"

#: ../../c-api/allocation.rst:172
msgid ":c:macro:`PyObject_NewVar`"
msgstr ":c:macro:`PyObject_NewVar`"

#: ../../c-api/allocation.rst:174
msgid ":c:func:`PyObject_Init`"
msgstr ":c:func:`PyObject_Init`"

#: ../../c-api/allocation.rst:176
msgid ":c:func:`PyObject_InitVar`"
msgstr ":c:func:`PyObject_InitVar`"

#: ../../c-api/allocation.rst:178
msgid ":c:func:`PyObject_Malloc`"
msgstr ":c:func:`PyObject_Malloc`"

#: ../../c-api/allocation.rst:180
msgid ":c:func:`PyObject_Realloc`"
msgstr ":c:func:`PyObject_Realloc`"
Loading