Skip to content

Commit

Permalink
Merge pull request #915 from python/cron/sync/3.12
Browse files Browse the repository at this point in the history
Sync with CPython 3.12
  • Loading branch information
mattwang44 authored Jul 18, 2024
2 parents c4b0c7f + dbc9d22 commit e17b9f3
Show file tree
Hide file tree
Showing 47 changed files with 7,177 additions and 6,830 deletions.
30 changes: 20 additions & 10 deletions c-api/cell.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-13 00:11+0000\n"
"POT-Creation-Date: 2024-07-10 00:04+0000\n"
"PO-Revision-Date: 2022-10-16 15:33+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 @@ -68,29 +68,39 @@ msgid ""
msgstr "建立並回傳一個包含 *ob* 的新 cell 物件。參數可以為 ``NULL``。"

#: ../../c-api/cell.rst:42
msgid "Return the contents of the cell *cell*."
msgstr "回傳 cell 內容中的 *cell*。"
msgid ""
"Return the contents of the cell *cell*, which can be ``NULL``. If *cell* is "
"not a cell object, returns ``NULL`` with an exception set."
msgstr ""
"回傳 cell 物件 *cell* 的內容,其可能為 ``NULL``。如果 *cell* 不是一個 cell 物"
"件,則將回傳 ``NULL`` 並設定例外。"

#: ../../c-api/cell.rst:47
#: ../../c-api/cell.rst:48
msgid ""
"Return the contents of the cell *cell*, but without checking that *cell* is "
"non-``NULL`` and a cell object."
msgstr ""
"回傳 cell 物件 *cell* 的內容,但是不檢查 *cell* 是否非 ``NULL`` 並且為一個 "
"cell 物件。"

#: ../../c-api/cell.rst:53
#: ../../c-api/cell.rst:54
msgid ""
"Set the contents of the cell object *cell* to *value*. This releases the "
"reference to any current content of the cell. *value* may be ``NULL``. "
"*cell* must be non-``NULL``; if it is not a cell object, ``-1`` will be "
"returned. On success, ``0`` will be returned."
"*cell* must be non-``NULL``."
msgstr ""
"將 cell 物件 *cell* 的內容設為 *value*。這將釋放任何對 cell 物件當前內容的參"
"照。*value* 可以為 ``NULL``。*cell* 必須不為 ``NULL``;如果它不是一個 cell 物"
"件則將回傳 ``-1``。如果設定成功則將回傳 ``0``。"
"照。*value* 可以為 ``NULL``。*cell* 必須不為 ``NULL``。"

#: ../../c-api/cell.rst:58
msgid ""
"On success, return ``0``. If *cell* is not a cell object, set an exception "
"and return ``-1``."
msgstr ""
"在成功時回傳 ``0``。如果 *cell* 不是一個 cell 物件,則將設定例外並回傳 "
"``-1``。"

#: ../../c-api/cell.rst:61
#: ../../c-api/cell.rst:64
msgid ""
"Sets the value of the cell object *cell* to *value*. No reference counts "
"are adjusted, and no checks are made for safety; *cell* must be non-``NULL`` "
Expand Down
87 changes: 56 additions & 31 deletions c-api/complex.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"POT-Creation-Date: 2024-07-18 00:03+0000\n"
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -52,136 +52,161 @@ msgid ""
"The C structure which corresponds to the value portion of a Python complex "
"number object. Most of the functions for dealing with complex number "
"objects use structures of this type as input or output values, as "
"appropriate. It is defined as::"
"appropriate."
msgstr ""
"相對於 Python 複數物件之數值部分的 C 結構。大多數處理複數物件的函式根據需求會"
"使用這種型別的結構作為輸入或輸出值。它定義為: ::"
"使用這種型別的結構作為輸入或輸出值。"

#: ../../c-api/complex.rst:39
#: ../../c-api/complex.rst:33
msgid "The structure is defined as::"
msgstr "該結構被定義為: ::"

#: ../../c-api/complex.rst:43
msgid ""
"Return the sum of two complex numbers, using the C :c:type:`Py_complex` "
"representation."
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數之和。"

#: ../../c-api/complex.rst:45
#: ../../c-api/complex.rst:49
msgid ""
"Return the difference between two complex numbers, using the C :c:type:"
"`Py_complex` representation."
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數間的差。"

#: ../../c-api/complex.rst:51
#: ../../c-api/complex.rst:55
msgid ""
"Return the negation of the complex number *num*, using the C :c:type:"
"`Py_complex` representation."
msgstr ""
"以 C 的 :c:type:`Py_complex` 表示形式來回傳複數 *num* 的相反數 (negation)。"

#: ../../c-api/complex.rst:57
#: ../../c-api/complex.rst:61
msgid ""
"Return the product of two complex numbers, using the C :c:type:`Py_complex` "
"representation."
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數的乘積。"

#: ../../c-api/complex.rst:63
#: ../../c-api/complex.rst:67
msgid ""
"Return the quotient of two complex numbers, using the C :c:type:`Py_complex` "
"representation."
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數的商。"

#: ../../c-api/complex.rst:66
#: ../../c-api/complex.rst:70
msgid ""
"If *divisor* is null, this method returns zero and sets :c:data:`errno` to :"
"c:macro:`!EDOM`."
msgstr ""
"如果 *divisor* 為 null,則此方法會回傳零並將 :c:data:`errno` 設定為 :c:macro:"
"`!EDOM`。"

#: ../../c-api/complex.rst:72
#: ../../c-api/complex.rst:76
msgid ""
"Return the exponentiation of *num* by *exp*, using the C :c:type:"
"`Py_complex` representation."
msgstr ""
"以 C 的 :c:type:`Py_complex` 表示形式來回傳 *num* 的 *exp* 次方的結果。"

#: ../../c-api/complex.rst:75
#: ../../c-api/complex.rst:79
msgid ""
"If *num* is null and *exp* is not a positive real number, this method "
"returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`."
msgstr ""
"如果 *num* 為 null 且 *exp* 不是正實數,則此方法會回傳零並將 :c:data:`errno` "
"設定為 :c:macro:`!EDOM`。"

#: ../../c-api/complex.rst:80
#: ../../c-api/complex.rst:84
msgid "Complex Numbers as Python Objects"
msgstr "作為 Python 物件的複數"

#: ../../c-api/complex.rst:85
#: ../../c-api/complex.rst:89
msgid ""
"This subtype of :c:type:`PyObject` represents a Python complex number object."
msgstr "這個 :c:type:`PyObject` 的子型別代表一個 Python 複數物件。"

#: ../../c-api/complex.rst:90
#: ../../c-api/complex.rst:94
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python complex number "
"type. It is the same object as :class:`complex` in the Python layer."
msgstr ""
"這個 :c:type:`PyTypeObject` 的實例代表 Python 複數型別。它與 Python 層中的 :"
"class:`complex` 是同一個物件。"

#: ../../c-api/complex.rst:96
#: ../../c-api/complex.rst:100
msgid ""
"Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :"
"c:type:`PyComplexObject`. This function always succeeds."
msgstr ""
"如果其引數是一個 :c:type:`PyComplexObject` 或者是 :c:type:`PyComplexObject` "
"的子型別,則會回傳 true。這個函式不會失敗。"

#: ../../c-api/complex.rst:102
#: ../../c-api/complex.rst:106
msgid ""
"Return true if its argument is a :c:type:`PyComplexObject`, but not a "
"subtype of :c:type:`PyComplexObject`. This function always succeeds."
msgstr ""
"如果其引數是一個 :c:type:`PyComplexObject`,但不是 :c:type:`PyComplexObject` "
"的子型別,則會回傳 true。這個函式不會失敗。"

#: ../../c-api/complex.rst:108
#: ../../c-api/complex.rst:112
msgid ""
"Create a new Python complex number object from a C :c:type:`Py_complex` "
"value."
msgstr "從 C 的 :c:type:`Py_complex` 值建立一個新的 Python 複數物件。"

#: ../../c-api/complex.rst:113
msgid "Return a new :c:type:`PyComplexObject` object from *real* and *imag*."
msgstr "從 *real* 和 *imag* 回傳一個新的 :c:type:`PyComplexObject` 物件。"
"value. Return ``NULL`` with an exception set on error."
msgstr ""
"從 C 的 :c:type:`Py_complex` 值建立一個新的 Python 複數物件。在錯誤時回傳 "
"``NULL`` 並設定例外。"

#: ../../c-api/complex.rst:118
msgid ""
"Return a new :c:type:`PyComplexObject` object from *real* and *imag*. Return "
"``NULL`` with an exception set on error."
msgstr ""
"從 *real* 和 *imag* 回傳一個新的 :c:type:`PyComplexObject` 物件。在錯誤時回"
"傳 ``NULL`` 並設定例外。"

#: ../../c-api/complex.rst:124
msgid "Return the real part of *op* as a C :c:expr:`double`."
msgstr "以 C 的 :c:expr:`double` 形式回傳 *op* 的實部。"

#: ../../c-api/complex.rst:123
#: ../../c-api/complex.rst:126
msgid ""
"Upon failure, this method returns ``-1.0`` with an exception set, so one "
"should call :c:func:`PyErr_Occurred` to check for errors."
msgstr ""
"失敗時,此方法回傳 ``-1.0`` 並設定例外,因此應該呼叫 :c:func:"
"`PyErr_Occurred` 來檢查錯誤。"

#: ../../c-api/complex.rst:132
msgid "Return the imaginary part of *op* as a C :c:expr:`double`."
msgstr "將 *op* 的虛部作為 C 的 :c:expr:`double` 回傳。"

#: ../../c-api/complex.rst:128
#: ../../c-api/complex.rst:137
msgid "Return the :c:type:`Py_complex` value of the complex number *op*."
msgstr "回傳複數 *op* 的 :c:type:`Py_complex` 值。"

#: ../../c-api/complex.rst:130
#: ../../c-api/complex.rst:139
msgid ""
"If *op* is not a Python complex number object but has a :meth:`~object."
"__complex__` method, this method will first be called to convert *op* to a "
"Python complex number object. If :meth:`!__complex__` is not defined then "
"it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not "
"defined then it falls back to :meth:`~object.__index__`. Upon failure, this "
"method returns ``-1.0`` as a real value."
"defined then it falls back to :meth:`~object.__index__`."
msgstr ""
"如果 *op* 不是 Python 複數物件,但有一個 :meth:`~object.__complex__` 方法,則"
"首先會呼叫該方法將 *op* 轉換為 Python 複數物件。如果 :meth:`!__complex__` 並"
"未定義,那麼它會回退到 :meth:`~object.__float__`。如果 :meth:`!__float__` 未"
"定義,則它將繼續回退為 :meth:`~object.__index__`。失敗時,此方法回傳 "
"``-1.0`` 作為實部值。"
"定義,則它將繼續回退為 :meth:`~object.__index__`。"

#: ../../c-api/complex.rst:137
#: ../../c-api/complex.rst:145
msgid ""
"Upon failure, this method returns :c:type:`Py_complex` with :c:member:"
"`~Py_complex.real` set to ``-1.0`` and with an exception set, so one should "
"call :c:func:`PyErr_Occurred` to check for errors."
msgstr ""
"失敗時,此方法回傳 :c:type:`Py_complex` 並將 :c:member:`~Py_complex.real` 設"
"為 ``-1.0``,並設定例外,因此應該呼叫 :c:func:`PyErr_Occurred` 來檢查錯誤。"

#: ../../c-api/complex.rst:149
msgid "Use :meth:`~object.__index__` if available."
msgstr "如果可用則使用 :meth:`~object.__index__`。"

Expand Down
Loading

0 comments on commit e17b9f3

Please sign in to comment.