Skip to content

Sync with CPython 3.10 #321

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 15 commits into from
Oct 15, 2022
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
167 changes: 88 additions & 79 deletions c-api/arg.po

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions c-api/call.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-06-11 14:46+0800\n"
"PO-Revision-Date: 2022-06-12 14:46+0800\n"
"POT-Creation-Date: 2022-10-06 00:23+0000\n"
"PO-Revision-Date: 2022-10-16 03:20+0800\n"
"Last-Translator: Matt Wang <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
Expand All @@ -18,7 +18,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.1\n"
"X-Generator: Poedit 3.1.1\n"

#: ../../c-api/call.rst:6
msgid "Call Protocol"
Expand Down Expand Up @@ -525,10 +525,10 @@ msgstr ""

#: ../../c-api/call.rst:278
msgid ""
"Note that if you only pass :c:type:`PyObject *` args, :c:func:"
"Note that if you only pass :c:expr:`PyObject *` args, :c:func:"
"`PyObject_CallFunctionObjArgs` is a faster alternative."
msgstr ""
"注意,如果你只傳入 :c:type:`PyObject *` 引數,則 :c:func:"
"注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:"
"`PyObject_CallFunctionObjArgs` 是另一個更快速的選擇。"

#: ../../c-api/call.rst:281
Expand Down Expand Up @@ -556,10 +556,10 @@ msgstr "這等價於 Python 運算式 ``obj.name(arg1, arg2, ...)``。"

#: ../../c-api/call.rst:299
msgid ""
"Note that if you only pass :c:type:`PyObject *` args, :c:func:"
"Note that if you only pass :c:expr:`PyObject *` args, :c:func:"
"`PyObject_CallMethodObjArgs` is a faster alternative."
msgstr ""
"注意,如果你只傳入 :c:type:`PyObject *` 引數,則 :c:func:"
"注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:"
"`PyObject_CallMethodObjArgs` 是另一個更快速的選擇。"

#: ../../c-api/call.rst:302
Expand All @@ -568,11 +568,11 @@ msgstr "*name* 和 *format* 的型別已從 ``char *`` 更改。"

#: ../../c-api/call.rst:308
msgid ""
"Call a callable Python object *callable*, with a variable number of :c:type:"
"Call a callable Python object *callable*, with a variable number of :c:expr:"
"`PyObject *` arguments. The arguments are provided as a variable number of "
"parameters followed by *NULL*."
msgstr ""
"呼叫一個可呼叫的 Python 物件 *callable*,附帶數量可變的 :c:type:`PyObject *` "
"呼叫一個可呼叫的 Python 物件 *callable*,附帶數量可變的 :c:expr:`PyObject *` "
"引數。這些引數是以位置在 *NULL* 後面、數量可變的參數來提供。"

#: ../../c-api/call.rst:315
Expand All @@ -585,11 +585,11 @@ msgstr "這等價於 Python 運算式 ``callable(arg1, arg2, ...)``。"
msgid ""
"Call a method of the Python object *obj*, where the name of the method is "
"given as a Python string object in *name*. It is called with a variable "
"number of :c:type:`PyObject *` arguments. The arguments are provided as a "
"number of :c:expr:`PyObject *` arguments. The arguments are provided as a "
"variable number of parameters followed by *NULL*."
msgstr ""
"呼叫 Python 物件 *obj* 中的一個 method,其中 method 名稱由 *name* 中的 "
"Python 字串物件給定。被呼叫時會附帶數量可變的 :c:type:`PyObject *` 引數。這些"
"Python 字串物件給定。被呼叫時會附帶數量可變的 :c:expr:`PyObject *` 引數。這些"
"引數是以位置在 *NULL* 後面、且數量可變的參數來提供。"

#: ../../c-api/call.rst:332
Expand Down
4 changes: 2 additions & 2 deletions c-api/capsule.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-13 00:11+0000\n"
"POT-Creation-Date: 2022-10-06 00:23+0000\n"
"PO-Revision-Date: 2018-05-23 14:30+0000\n"
"Last-Translator: Adrian Liaw <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand All @@ -30,7 +30,7 @@ msgstr ""
#: ../../c-api/capsule.rst:17
msgid ""
"This subtype of :c:type:`PyObject` represents an opaque value, useful for C "
"extension modules who need to pass an opaque value (as a :c:type:`void*` "
"extension modules who need to pass an opaque value (as a :c:expr:`void*` "
"pointer) through Python code to other C code. It is often used to make a C "
"function pointer defined in one module available to other modules, so the "
"regular import mechanism can be used to access C APIs defined in dynamically "
Expand Down
6 changes: 3 additions & 3 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.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-13 00:11+0000\n"
"POT-Creation-Date: 2022-10-06 00:23+0000\n"
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -135,11 +135,11 @@ msgid "Return a new :c:type:`PyComplexObject` object from *real* and *imag*."
msgstr ""

#: ../../c-api/complex.rst:118
msgid "Return the real part of *op* as a C :c:type:`double`."
msgid "Return the real part of *op* as a C :c:expr:`double`."
msgstr ""

#: ../../c-api/complex.rst:123
msgid "Return the imaginary part of *op* as a C :c:type:`double`."
msgid "Return the imaginary part of *op* as a C :c:expr:`double`."
msgstr ""

#: ../../c-api/complex.rst:128
Expand Down
50 changes: 26 additions & 24 deletions c-api/conversion.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-26 16:47+0000\n"
"POT-Creation-Date: 2022-10-08 00:21+0000\n"
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
"Last-Translator: Leon H.\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -55,58 +55,60 @@ msgid ""
"The wrappers ensure that ``str[size-1]`` is always ``'\\0'`` upon return. "
"They never write more than *size* bytes (including the trailing ``'\\0'``) "
"into str. Both functions require that ``str != NULL``, ``size > 0``, "
"``format != NULL`` and ``size < INT_MAX``."
"``format != NULL`` and ``size < INT_MAX``. Note that this means there is no "
"equivalent to the C99 ``n = snprintf(NULL, 0, ...)`` which would determine "
"the necessary buffer size."
msgstr ""

#: ../../c-api/conversion.rst:33
#: ../../c-api/conversion.rst:34
msgid ""
"The return value (*rv*) for these functions should be interpreted as follows:"
msgstr "當回傳值 (*rv*) 給這些函數應該被編譯如下:"

#: ../../c-api/conversion.rst:35
#: ../../c-api/conversion.rst:36
msgid ""
"When ``0 <= rv < size``, the output conversion was successful and *rv* "
"characters were written to *str* (excluding the trailing ``'\\0'`` byte at "
"``str[rv]``)."
msgstr ""

#: ../../c-api/conversion.rst:39
#: ../../c-api/conversion.rst:40
msgid ""
"When ``rv >= size``, the output conversion was truncated and a buffer with "
"``rv + 1`` bytes would have been needed to succeed. ``str[size-1]`` is "
"``'\\0'`` in this case."
msgstr ""

#: ../../c-api/conversion.rst:43
#: ../../c-api/conversion.rst:44
msgid ""
"When ``rv < 0``, \"something bad happened.\" ``str[size-1]`` is ``'\\0'`` in "
"this case too, but the rest of *str* is undefined. The exact cause of the "
"error depends on the underlying platform."
msgstr ""

#: ../../c-api/conversion.rst:48
#: ../../c-api/conversion.rst:49
msgid ""
"The following functions provide locale-independent string to number "
"conversions."
msgstr ""

#: ../../c-api/conversion.rst:52
#: ../../c-api/conversion.rst:53
msgid ""
"Convert a string ``s`` to a :c:type:`double`, raising a Python exception on "
"Convert a string ``s`` to a :c:expr:`double`, raising a Python exception on "
"failure. The set of accepted strings corresponds to the set of strings "
"accepted by Python's :func:`float` constructor, except that ``s`` must not "
"have leading or trailing whitespace. The conversion is independent of the "
"current locale."
msgstr ""

#: ../../c-api/conversion.rst:58
#: ../../c-api/conversion.rst:59
msgid ""
"If ``endptr`` is ``NULL``, convert the whole string. Raise :exc:"
"`ValueError` and return ``-1.0`` if the string is not a valid representation "
"of a floating-point number."
msgstr ""

#: ../../c-api/conversion.rst:62
#: ../../c-api/conversion.rst:63
msgid ""
"If endptr is not ``NULL``, convert as much of the string as possible and set "
"``*endptr`` to point to the first unconverted character. If no initial "
Expand All @@ -115,7 +117,7 @@ msgid ""
"ValueError, and return ``-1.0``."
msgstr ""

#: ../../c-api/conversion.rst:69
#: ../../c-api/conversion.rst:70
msgid ""
"If ``s`` represents a value that is too large to store in a float (for "
"example, ``\"1e500\"`` is such a string on many platforms) then if "
Expand All @@ -126,71 +128,71 @@ msgid ""
"the first character after the converted value."
msgstr ""

#: ../../c-api/conversion.rst:77
#: ../../c-api/conversion.rst:78
msgid ""
"If any other error occurs during the conversion (for example an out-of-"
"memory error), set the appropriate Python exception and return ``-1.0``."
msgstr ""

#: ../../c-api/conversion.rst:86
#: ../../c-api/conversion.rst:87
msgid ""
"Convert a :c:type:`double` *val* to a string using supplied *format_code*, "
"Convert a :c:expr:`double` *val* to a string using supplied *format_code*, "
"*precision*, and *flags*."
msgstr ""

#: ../../c-api/conversion.rst:89
#: ../../c-api/conversion.rst:90
msgid ""
"*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, "
"``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* must be 0 and is "
"ignored. The ``'r'`` format code specifies the standard :func:`repr` format."
msgstr ""

#: ../../c-api/conversion.rst:94
#: ../../c-api/conversion.rst:95
msgid ""
"*flags* can be zero or more of the values ``Py_DTSF_SIGN``, "
"``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:"
msgstr ""

#: ../../c-api/conversion.rst:97
#: ../../c-api/conversion.rst:98
msgid ""
"``Py_DTSF_SIGN`` means to always precede the returned string with a sign "
"character, even if *val* is non-negative."
msgstr ""

#: ../../c-api/conversion.rst:100
#: ../../c-api/conversion.rst:101
msgid ""
"``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look "
"like an integer."
msgstr ""

#: ../../c-api/conversion.rst:103
#: ../../c-api/conversion.rst:104
msgid ""
"``Py_DTSF_ALT`` means to apply \"alternate\" formatting rules. See the "
"documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details."
msgstr ""

#: ../../c-api/conversion.rst:107
#: ../../c-api/conversion.rst:108
msgid ""
"If *ptype* is non-``NULL``, then the value it points to will be set to one "
"of ``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying "
"that *val* is a finite number, an infinite number, or not a number, "
"respectively."
msgstr ""

#: ../../c-api/conversion.rst:111
#: ../../c-api/conversion.rst:112
msgid ""
"The return value is a pointer to *buffer* with the converted string or "
"``NULL`` if the conversion failed. The caller is responsible for freeing the "
"returned string by calling :c:func:`PyMem_Free`."
msgstr ""

#: ../../c-api/conversion.rst:120
#: ../../c-api/conversion.rst:121
msgid ""
"Case insensitive comparison of strings. The function works almost "
"identically to :c:func:`strcmp` except that it ignores the case."
msgstr ""

#: ../../c-api/conversion.rst:126
#: ../../c-api/conversion.rst:127
msgid ""
"Case insensitive comparison of strings. The function works almost "
"identically to :c:func:`strncmp` except that it ignores the case."
Expand Down
8 changes: 4 additions & 4 deletions c-api/dict.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-26 16:47+0000\n"
"POT-Creation-Date: 2022-10-06 00:23+0000\n"
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -91,7 +91,7 @@ msgstr ""
#: ../../c-api/dict.rst:75
msgid ""
"Insert *val* into the dictionary *p* using *key* as a key. *key* should be "
"a :c:type:`const char*`. The key object is created using "
"a :c:expr:`const char*`. The key object is created using "
"``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on "
"failure. This function *does not* steal a reference to *val*."
msgstr ""
Expand Down Expand Up @@ -139,7 +139,7 @@ msgstr ""
#: ../../c-api/dict.rst:120
msgid ""
"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:"
"type:`const char*`, rather than a :c:type:`PyObject*`."
"expr:`const char*`, rather than a :c:expr:`PyObject*`."
msgstr ""

#: ../../c-api/dict.rst:123
Expand Down Expand Up @@ -187,7 +187,7 @@ msgid ""
"`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the "
"first call to this function to start the iteration; the function returns "
"true for each pair in the dictionary, and false once all pairs have been "
"reported. The parameters *pkey* and *pvalue* should either point to :c:type:"
"reported. The parameters *pkey* and *pvalue* should either point to :c:expr:"
"`PyObject*` variables that will be filled in with each key and value, "
"respectively, or may be ``NULL``. Any references returned through them are "
"borrowed. *ppos* should not be altered during iteration. Its value "
Expand Down
30 changes: 15 additions & 15 deletions c-api/exceptions.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-21 17:35+0000\n"
"POT-Creation-Date: 2022-10-06 00:23+0000\n"
"PO-Revision-Date: 2018-05-23 14:05+0000\n"
"Last-Translator: Adrian Liaw <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand All @@ -32,8 +32,8 @@ msgid ""
"occurred. Most C API functions don't clear this on success, but will set it "
"to indicate the cause of the error on failure. Most C API functions also "
"return an error indicator, usually ``NULL`` if they are supposed to return a "
"pointer, or ``-1`` if they return an integer (exception: the :c:func:`PyArg_"
"\\*` functions return ``1`` for success and ``0`` for failure)."
"pointer, or ``-1`` if they return an integer (exception: the ``PyArg_*`` "
"functions return ``1`` for success and ``0`` for failure)."
msgstr ""

#: ../../c-api/exceptions.rst:20
Expand Down Expand Up @@ -223,12 +223,12 @@ msgstr ""
#: ../../c-api/exceptions.rst:191
msgid ""
"This is a convenience function to raise :exc:`WindowsError`. If called with "
"*ierr* of :c:data:`0`, the error code returned by a call to :c:func:"
"`GetLastError` is used instead. It calls the Win32 function :c:func:"
"`FormatMessage` to retrieve the Windows description of error code given by "
"*ierr* or :c:func:`GetLastError`, then it constructs a tuple object whose "
"first item is the *ierr* value and whose second item is the corresponding "
"error message (gotten from :c:func:`FormatMessage`), and then calls "
"*ierr* of ``0``, the error code returned by a call to :c:func:`GetLastError` "
"is used instead. It calls the Win32 function :c:func:`FormatMessage` to "
"retrieve the Windows description of error code given by *ierr* or :c:func:"
"`GetLastError`, then it constructs a tuple object whose first item is the "
"*ierr* value and whose second item is the corresponding error message "
"(gotten from :c:func:`FormatMessage`), and then calls "
"``PyErr_SetObject(PyExc_WindowsError, object)``. This function always "
"returns ``NULL``."
msgstr ""
Expand Down Expand Up @@ -393,10 +393,10 @@ msgstr ""
#: ../../c-api/exceptions.rst:372
msgid ""
"Test whether the error indicator is set. If set, return the exception "
"*type* (the first argument to the last call to one of the :c:func:`PyErr_Set"
"\\*` functions or to :c:func:`PyErr_Restore`). If not set, return "
"``NULL``. You do not own a reference to the return value, so you do not "
"need to :c:func:`Py_DECREF` it."
"*type* (the first argument to the last call to one of the ``PyErr_Set*`` "
"functions or to :c:func:`PyErr_Restore`). If not set, return ``NULL``. You "
"do not own a reference to the return value, so you do not need to :c:func:"
"`Py_DECREF` it."
msgstr ""

#: ../../c-api/exceptions.rst:378
Expand Down Expand Up @@ -884,7 +884,7 @@ msgstr ""
msgid ""
"All standard Python exceptions are available as global variables whose names "
"are ``PyExc_`` followed by the Python exception name. These have the type :"
"c:type:`PyObject*`; they are all class objects. For completeness, here are "
"c:expr:`PyObject*`; they are all class objects. For completeness, here are "
"all the variables:"
msgstr ""

Expand Down Expand Up @@ -1407,7 +1407,7 @@ msgstr ""
msgid ""
"All standard Python warning categories are available as global variables "
"whose names are ``PyExc_`` followed by the Python exception name. These have "
"the type :c:type:`PyObject*`; they are all class objects. For completeness, "
"the type :c:expr:`PyObject*`; they are all class objects. For completeness, "
"here are all the variables:"
msgstr ""

Expand Down
Loading