Skip to content

Sync with CPython 3.11 #325

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 2 commits into from
Oct 16, 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
15 changes: 13 additions & 2 deletions c-api/apiabiversion.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-26 16:47+0000\n"
"POT-Creation-Date: 2022-10-15 20:43+0000\n"
"PO-Revision-Date: 2022-01-24 22:34+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 @@ -172,6 +172,17 @@ msgstr ""
"因此 ``3.4.1a2`` 代表 hexversion ``0x030401a2``\\ 、\\ ``3.10.0`` 代表 "
"hexversion ``0x030a00f0``\\ 。"

#: ../../c-api/apiabiversion.rst:62
#: ../../c-api/apiabiversion.rst:61
msgid "This version is also available via the symbol :data:`Py_Version`."
msgstr ""

#: ../../c-api/apiabiversion.rst:65
msgid ""
"The Python runtime version number encoded in a single constant integer, with "
"the same format as the :c:macro:`PY_VERSION_HEX` macro. This contains the "
"Python version used at run time."
msgstr ""

#: ../../c-api/apiabiversion.rst:71
msgid "All the given macros are defined in :source:`Include/patchlevel.h`."
msgstr "所有提到的巨集都定義在 :source:`Include/patchlevel.h`\\ 。"
20 changes: 15 additions & 5 deletions c-api/buffer.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-13 00:11+0000\n"
"POT-Creation-Date: 2022-10-15 20:43+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 @@ -644,33 +644,43 @@ msgstr ""

#: ../../c-api/buffer.rst:504
msgid ""
"Copy data from *src* to *dest* buffer. Can convert between C-style and or "
"Fortran-style buffers."
msgstr ""

#: ../../c-api/buffer.rst:507
msgid "``0`` is returned on success, ``-1`` on error."
msgstr ""

#: ../../c-api/buffer.rst:511
msgid ""
"Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style "
"if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the "
"given shape with the given number of bytes per element."
msgstr ""

#: ../../c-api/buffer.rst:511
#: ../../c-api/buffer.rst:518
msgid ""
"Handle buffer requests for an exporter that wants to expose *buf* of size "
"*len* with writability set according to *readonly*. *buf* is interpreted as "
"a sequence of unsigned bytes."
msgstr ""

#: ../../c-api/buffer.rst:515
#: ../../c-api/buffer.rst:522
msgid ""
"The *flags* argument indicates the request type. This function always fills "
"in *view* as specified by flags, unless *buf* has been designated as read-"
"only and :c:macro:`PyBUF_WRITABLE` is set in *flags*."
msgstr ""

#: ../../c-api/buffer.rst:519
#: ../../c-api/buffer.rst:526
msgid ""
"On success, set ``view->obj`` to a new reference to *exporter* and return 0. "
"Otherwise, raise :c:data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` "
"and return ``-1``;"
msgstr ""

#: ../../c-api/buffer.rst:523
#: ../../c-api/buffer.rst:530
msgid ""
"If this function is used as part of a :ref:`getbufferproc <buffer-structs>`, "
"*exporter* MUST be set to the exporting object and *flags* must be passed "
Expand Down
6 changes: 3 additions & 3 deletions c-api/bytearray.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-03 00:14+0000\n"
"POT-Creation-Date: 2022-10-15 20:43+0000\n"
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
"Last-Translator: Liang-Bo Wang <me@liang2.tw>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -93,9 +93,9 @@ msgid "These macros trade safety for speed and they don't check pointers."
msgstr ""

#: ../../c-api/bytearray.rst:80
msgid "Macro version of :c:func:`PyByteArray_AsString`."
msgid "Similar to :c:func:`PyByteArray_AsString`, but without error checking."
msgstr ""

#: ../../c-api/bytearray.rst:85
msgid "Macro version of :c:func:`PyByteArray_Size`."
msgid "Similar to :c:func:`PyByteArray_Size`, but without error checking."
msgstr ""
6 changes: 3 additions & 3 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.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-21 17:35+0000\n"
"POT-Creation-Date: 2022-10-15 20:43+0000\n"
"PO-Revision-Date: 2018-05-23 14:04+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 @@ -251,7 +251,7 @@ msgid "Return the length of the bytes in bytes object *o*."
msgstr ""

#: ../../c-api/bytes.rst:137
msgid "Macro form of :c:func:`PyBytes_Size` but without error checking."
msgid "Similar to :c:func:`PyBytes_Size`, but without error checking."
msgstr ""

#: ../../c-api/bytes.rst:142
Expand All @@ -266,7 +266,7 @@ msgid ""
msgstr ""

#: ../../c-api/bytes.rst:154
msgid "Macro form of :c:func:`PyBytes_AsString` but without error checking."
msgid "Similar to :c:func:`PyBytes_AsString`, but without error checking."
msgstr ""

#: ../../c-api/bytes.rst:159
Expand Down
30 changes: 16 additions & 14 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.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-06 00:23+0000\n"
"POT-Creation-Date: 2022-10-15 20:43+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 @@ -141,18 +141,20 @@ 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. If *no_block* is true, import the module without blocking "
"(using :c:func:`PyImport_ImportModuleNoBlock`). If *no_block* is false, "
"import the module conventionally (using :c:func:`PyImport_ImportModule`)."
"string exactly."
msgstr ""

#: ../../c-api/capsule.rst:110
#: ../../c-api/capsule.rst:108
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:111
msgid "*no_block* has no effect anymore."
msgstr ""

#: ../../c-api/capsule.rst:117
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 @@ -161,41 +163,41 @@ msgid ""
"compared.)"
msgstr ""

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

#: ../../c-api/capsule.rst:126
#: ../../c-api/capsule.rst:127
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:132
#: ../../c-api/capsule.rst:133
msgid "Set the context pointer inside *capsule* to *context*."
msgstr ""

#: ../../c-api/capsule.rst:134 ../../c-api/capsule.rst:141
#: ../../c-api/capsule.rst:150 ../../c-api/capsule.rst:158
#: ../../c-api/capsule.rst:135 ../../c-api/capsule.rst:142
#: ../../c-api/capsule.rst:151 ../../c-api/capsule.rst:159
msgid ""
"Return ``0`` on success. Return nonzero and set an exception on failure."
msgstr ""

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

#: ../../c-api/capsule.rst:146
#: ../../c-api/capsule.rst:147
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:155
#: ../../c-api/capsule.rst:156
msgid ""
"Set the void pointer inside *capsule* to *pointer*. The pointer may not be "
"``NULL``."
Expand Down
79 changes: 67 additions & 12 deletions c-api/code.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-26 16:47+0000\n"
"POT-Creation-Date: 2022-10-15 20:43+0000\n"
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
"Last-Translator: Liang-Bo Wang <me@liang2.tw>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -55,33 +55,88 @@ msgstr ""
msgid ""
"Return a new code object. If you need a dummy code object to create a "
"frame, use :c:func:`PyCode_NewEmpty` instead. Calling :c:func:`PyCode_New` "
"directly can bind you to a precise Python version since the definition of "
"the bytecode changes often."
"directly will bind you to a precise Python version since the definition of "
"the bytecode changes often. The many arguments of this function are inter-"
"dependent in complex ways, meaning that subtle changes to values are likely "
"to result in incorrect execution or VM crashes. Use this function only with "
"extreme care."
msgstr ""

#: ../../c-api/code.rst:45
#: ../../c-api/code.rst:45 ../../c-api/code.rst:55
msgid "Added ``exceptiontable`` parameter."
msgstr ""

#: ../../c-api/code.rst:50
msgid ""
"Similar to :c:func:`PyCode_New`, but with an extra \"posonlyargcount\" for "
"positional-only arguments."
"positional-only arguments. The same caveats that apply to ``PyCode_New`` "
"also apply to this function."
msgstr ""

#: ../../c-api/code.rst:51
#: ../../c-api/code.rst:60
msgid ""
"Return a new empty code object with the specified filename, function name, "
"and first line number. It is illegal to :func:`exec` or :func:`eval` the "
"resulting code object."
"and first line number. The resulting code object will raise an ``Exception`` "
"if executed."
msgstr ""

#: ../../c-api/code.rst:57
#: ../../c-api/code.rst:66
msgid ""
"Return the line number of the instruction that occurs on or before "
"``byte_offset`` and ends after it. If you just need the line number of a "
"frame, use :c:func:`PyFrame_GetLineNumber` instead."
msgstr ""

#: ../../c-api/code.rst:60
#: ../../c-api/code.rst:69
msgid ""
"For efficiently iterating over the line numbers in a code object, use `the "
"API described in PEP 626 <https://www.python.org/dev/peps/pep-0626/#out-of-"
"process-debuggers-and-profilers>`_."
"API described in PEP 626 <https://peps.python.org/pep-0626/#out-of-process-"
"debuggers-and-profilers>`_."
msgstr ""

#: ../../c-api/code.rst:74
msgid ""
"Sets the passed ``int`` pointers to the source code line and column numbers "
"for the instruction at ``byte_offset``. Sets the value to ``0`` when "
"information is not available for any particular element."
msgstr ""

#: ../../c-api/code.rst:78
msgid "Returns ``1`` if the function succeeds and 0 otherwise."
msgstr ""

#: ../../c-api/code.rst:82
msgid ""
"Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong "
"reference to a :c:type:`PyBytesObject` representing the bytecode in a code "
"object. On error, ``NULL`` is returned and an exception is raised."
msgstr ""

#: ../../c-api/code.rst:87
msgid ""
"This ``PyBytesObject`` may be created on-demand by the interpreter and does "
"not necessarily represent the bytecode actually executed by CPython. The "
"primary use case for this function is debuggers and profilers."
msgstr ""

#: ../../c-api/code.rst:95
msgid ""
"Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new "
"reference to a :c:type:`PyTupleObject` containing the names of the local "
"variables. On error, ``NULL`` is returned and an exception is raised."
msgstr ""

#: ../../c-api/code.rst:104
msgid ""
"Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new "
"reference to a :c:type:`PyTupleObject` containing the names of the local "
"variables that are referenced by nested functions. On error, ``NULL`` is "
"returned and an exception is raised."
msgstr ""

#: ../../c-api/code.rst:113
msgid ""
"Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new "
"reference to a :c:type:`PyTupleObject` containing the names of the free "
"variables. On error, ``NULL`` is returned and an exception is raised."
msgstr ""
Loading