Skip to content

Sync with CPython 3.12 #769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 29, 2023
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
16 changes: 8 additions & 8 deletions c-api/bytes.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-08-09 00:03+0000\n"
"POT-Creation-Date: 2023-12-26 00:03+0000\n"
"PO-Revision-Date: 2018-05-23 14:04+0000\n"
"Last-Translator: Adrian Liaw <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -272,17 +272,17 @@ msgstr ""
#: ../../c-api/bytes.rst:156
msgid ""
"Return the null-terminated contents of the object *obj* through the output "
"variables *buffer* and *length*."
"variables *buffer* and *length*. Returns ``0`` on success."
msgstr ""

#: ../../c-api/bytes.rst:159
#: ../../c-api/bytes.rst:160
msgid ""
"If *length* is ``NULL``, the bytes object may not contain embedded null "
"bytes; if it does, the function returns ``-1`` and a :exc:`ValueError` is "
"raised."
msgstr ""

#: ../../c-api/bytes.rst:163
#: ../../c-api/bytes.rst:164
msgid ""
"The buffer refers to an internal buffer of *obj*, which includes an "
"additional null byte at the end (not counted in *length*). The data must "
Expand All @@ -292,13 +292,13 @@ msgid ""
"returns ``-1`` and raises :exc:`TypeError`."
msgstr ""

#: ../../c-api/bytes.rst:170
#: ../../c-api/bytes.rst:171
msgid ""
"Previously, :exc:`TypeError` was raised when embedded null bytes were "
"encountered in the bytes object."
msgstr ""

#: ../../c-api/bytes.rst:177
#: ../../c-api/bytes.rst:178
msgid ""
"Create a new bytes object in *\\*bytes* containing the contents of *newpart* "
"appended to *bytes*; the caller will own the new reference. The reference "
Expand All @@ -307,14 +307,14 @@ msgid ""
"of *\\*bytes* will be set to ``NULL``; the appropriate exception will be set."
msgstr ""

#: ../../c-api/bytes.rst:186
#: ../../c-api/bytes.rst:187
msgid ""
"Create a new bytes object in *\\*bytes* containing the contents of *newpart* "
"appended to *bytes*. This version releases the :term:`strong reference` to "
"*newpart* (i.e. decrements its reference count)."
msgstr ""

#: ../../c-api/bytes.rst:193
#: ../../c-api/bytes.rst:194
msgid ""
"A way to resize a bytes object even though it is \"immutable\". Only use "
"this to build up a brand new bytes object; don't use this if the bytes may "
Expand Down
10 changes: 5 additions & 5 deletions howto/isolating-extensions.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-17 00:03+0000\n"
"POT-Creation-Date: 2023-12-27 00:03+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -439,7 +439,7 @@ msgstr ""
#: ../../howto/isolating-extensions.rst:339
msgid ""
"Define a traverse function using ``Py_tp_traverse``, which visits the type "
"(e.g. using :c:expr:`Py_VISIT(Py_TYPE(self))`)."
"(e.g. using ``Py_VISIT(Py_TYPE(self))``)."
msgstr ""

#: ../../howto/isolating-extensions.rst:342
Expand Down Expand Up @@ -617,9 +617,9 @@ msgstr ""

#: ../../howto/isolating-extensions.rst:485
msgid ""
"Do not confuse the defining class with :c:expr:`Py_TYPE(self)`. If the "
"method is called on a *subclass* of your type, ``Py_TYPE(self)`` will refer "
"to that subclass, which may be defined in different module than yours."
"Do not confuse the defining class with ``Py_TYPE(self)``. If the method is "
"called on a *subclass* of your type, ``Py_TYPE(self)`` will refer to that "
"subclass, which may be defined in different module than yours."
msgstr ""

#: ../../howto/isolating-extensions.rst:490
Expand Down
42 changes: 17 additions & 25 deletions library/bisect.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: 2023-07-17 17:39+0800\n"
"POT-Creation-Date: 2023-12-27 00:03+0000\n"
"PO-Revision-Date: 2023-08-01 12:53+0800\n"
"Last-Translator: Matt Wang <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -47,15 +47,15 @@ msgid ""
"The module is called :mod:`bisect` because it uses a basic bisection "
"algorithm to do its work. Unlike other bisection tools that search for a "
"specific value, the functions in this module are designed to locate an "
"insertion point. Accordingly, the functions never call an :meth:`__eq__` "
"method to determine whether a value has been found. Instead, the functions "
"only call the :meth:`__lt__` method and will return an insertion point "
"between values in an array."
"insertion point. Accordingly, the functions never call an :meth:`~object."
"__eq__` method to determine whether a value has been found. Instead, the "
"functions only call the :meth:`~object.__lt__` method and will return an "
"insertion point between values in an array."
msgstr ""
"這個模組被稱為 :mod:`bisect` 是因為它使用基本二分演算法來完成其工作。不像其它"
"搜尋特定值的二分法工具,本模組中的函式旨在定位插入點。因此,這些函式永遠不會"
"呼叫 :meth:`__eq__` 方法來確認是否找到一個值。相反地,這些函式只呼叫 :meth:"
"`__lt__` 方法,並在陣列中的值回傳一個插入點。"
"呼叫 :meth:`~object.__eq__` 方法來確認是否找到一個值。相反地,這些函式只呼"
"叫 :meth:`~object.__lt__` 方法,並在陣列中的值回傳一個插入點。"

#: ../../library/bisect.rst:29
msgid "The following functions are provided:"
Expand Down Expand Up @@ -133,11 +133,11 @@ msgstr "將元素 *x* 插入 list *a*,並維持順序。"
#: ../../library/bisect.rst:75
msgid ""
"This function first runs :py:func:`~bisect.bisect_left` to locate an "
"insertion point. Next, it runs the :meth:`insert` method on *a* to insert "
"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert "
"*x* at the appropriate position to maintain sort order."
msgstr ""
"此函式先使用 :py:func:`~bisect.bisect_left` 搜索插入位置,接著用 :meth:"
"`insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。"
"此函式先使用 :py:func:`~bisect.bisect_left` 搜索插入位置,接著用 :meth:`!"
"insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。"

#: ../../library/bisect.rst:79 ../../library/bisect.rst:99
msgid ""
Expand All @@ -163,11 +163,11 @@ msgstr ""
#: ../../library/bisect.rst:95
msgid ""
"This function first runs :py:func:`~bisect.bisect_right` to locate an "
"insertion point. Next, it runs the :meth:`insert` method on *a* to insert "
"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert "
"*x* at the appropriate position to maintain sort order."
msgstr ""
"此函式先使用 :py:func:`~bisect.bisect_right` 搜索插入位置,接著用 :meth:"
"`insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。"
"此函式先使用 :py:func:`~bisect.bisect_right` 搜索插入位置,接著用 :meth:`!"
"insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。"

#: ../../library/bisect.rst:110
msgid "Performance Notes"
Expand Down Expand Up @@ -247,9 +247,7 @@ msgid ""
"sorted lists::"
msgstr ""
"上面的 `bisect functions`_ 在找到數值插入點上很有用,但一般的數值搜尋任務上就"
"不是那麼的方便。以下的五個函式展示了如何將其轉換成標準的有序列表查找函式:\n"
"\n"
"::"
"不是那麼的方便。以下的五個函式展示了如何將其轉換成標準的有序列表查找函式: ::"

#: ../../library/bisect.rst:187
msgid "Examples"
Expand All @@ -264,9 +262,7 @@ msgid ""
msgstr ""
":py:func:`~bisect.bisect` 函式可用於數值表中的查找 (numeric table lookup),這"
"個範例使用 :py:func:`~bisect.bisect` 以基於一組有序的數值分界點來為一個考試成"
"績找到相對應的字母等級:90 以上是 'A'、80 到 89 為 'B',依此類推:\n"
"\n"
"::"
"績找到相對應的字母等級:90 以上是 'A'、80 到 89 為 'B',依此類推: ::"

#: ../../library/bisect.rst:203
msgid ""
Expand All @@ -276,16 +272,12 @@ msgid ""
msgstr ""
":py:func:`~bisect.bisect` 與 :py:func:`~bisect.insort` 函式也適用於內容為 "
"tuples(元組)的 lists,*key* 引數可被用以取出在數值表中作為排序依據的欄"
"位:\n"
"\n"
"::"
"位: ::"

#: ../../library/bisect.rst:237
msgid ""
"If the key function is expensive, it is possible to avoid repeated function "
"calls by searching a list of precomputed keys to find the index of a record::"
msgstr ""
"如果鍵函式會消耗較多運算資源,那可以在預先計算好的鍵列表中搜索該紀錄的索引"
"值,以減少重複的函式呼叫:\n"
"\n"
"::"
"值,以減少重複的函式呼叫: ::"
Loading