Skip to content

Sync with CPython 3.11 #381

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
Feb 6, 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
12 changes: 6 additions & 6 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: 2022-10-15 20:43+0000\n"
"POT-Creation-Date: 2023-02-05 00:18+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 @@ -105,36 +105,36 @@ msgstr ""
msgid "Returns ``1`` if the function succeeds and 0 otherwise."
msgstr ""

#: ../../c-api/code.rst:82
#: ../../c-api/code.rst:84
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
#: ../../c-api/code.rst:89
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
#: ../../c-api/code.rst:97
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
#: ../../c-api/code.rst:106
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
#: ../../c-api/code.rst:115
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 "
Expand Down
83 changes: 45 additions & 38 deletions c-api/long.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: 2022-10-06 00:23+0000\n"
"POT-Creation-Date: 2023-01-25 00:17+0000\n"
"PO-Revision-Date: 2018-05-23 14:06+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 @@ -118,210 +118,217 @@ msgid ""
"are no digits, :exc:`ValueError` will be raised."
msgstr ""

#: ../../c-api/long.rst:99
#: ../../c-api/long.rst:96
msgid ""
"Python methods :meth:`int.to_bytes` and :meth:`int.from_bytes` to convert a :"
"c:type:`PyLongObject` to/from an array of bytes in base ``256``. You can "
"call those from C using :c:func:`PyObject_CallMethod`."
msgstr ""

#: ../../c-api/long.rst:103
msgid ""
"Convert a sequence of Unicode digits in the string *u* to a Python integer "
"value."
msgstr ""

#: ../../c-api/long.rst:107
#: ../../c-api/long.rst:111
msgid ""
"Create a Python integer from the pointer *p*. The pointer value can be "
"retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`."
msgstr ""

#: ../../c-api/long.rst:118 ../../c-api/long.rst:136
#: ../../c-api/long.rst:122 ../../c-api/long.rst:140
msgid ""
"Return a C :c:expr:`long` representation of *obj*. If *obj* is not an "
"instance of :c:type:`PyLongObject`, first call its :meth:`__index__` method "
"(if present) to convert it to a :c:type:`PyLongObject`."
msgstr ""

#: ../../c-api/long.rst:122
#: ../../c-api/long.rst:126
msgid ""
"Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:"
"expr:`long`."
msgstr ""

#: ../../c-api/long.rst:125 ../../c-api/long.rst:145 ../../c-api/long.rst:166
#: ../../c-api/long.rst:186 ../../c-api/long.rst:209
#: ../../c-api/long.rst:129 ../../c-api/long.rst:149 ../../c-api/long.rst:170
#: ../../c-api/long.rst:190 ../../c-api/long.rst:213
msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate."
msgstr ""

#: ../../c-api/long.rst:127 ../../c-api/long.rst:147 ../../c-api/long.rst:168
#: ../../c-api/long.rst:190 ../../c-api/long.rst:274 ../../c-api/long.rst:294
#: ../../c-api/long.rst:131 ../../c-api/long.rst:151 ../../c-api/long.rst:172
#: ../../c-api/long.rst:194 ../../c-api/long.rst:278 ../../c-api/long.rst:298
msgid "Use :meth:`__index__` if available."
msgstr ""

#: ../../c-api/long.rst:130 ../../c-api/long.rst:150 ../../c-api/long.rst:171
#: ../../c-api/long.rst:193 ../../c-api/long.rst:277 ../../c-api/long.rst:297
#: ../../c-api/long.rst:134 ../../c-api/long.rst:154 ../../c-api/long.rst:175
#: ../../c-api/long.rst:197 ../../c-api/long.rst:281 ../../c-api/long.rst:301
msgid "This function will no longer use :meth:`__int__`."
msgstr ""

#: ../../c-api/long.rst:140
#: ../../c-api/long.rst:144
msgid ""
"If the value of *obj* is greater than :const:`LONG_MAX` or less than :const:"
"`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return "
"``-1``; otherwise, set *\\*overflow* to ``0``. If any other exception "
"occurs set *\\*overflow* to ``0`` and return ``-1`` as usual."
msgstr ""

#: ../../c-api/long.rst:159 ../../c-api/long.rst:177
#: ../../c-api/long.rst:163 ../../c-api/long.rst:181
msgid ""
"Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an "
"instance of :c:type:`PyLongObject`, first call its :meth:`__index__` method "
"(if present) to convert it to a :c:type:`PyLongObject`."
msgstr ""

#: ../../c-api/long.rst:163
#: ../../c-api/long.rst:167
msgid ""
"Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:"
"expr:`long long`."
msgstr ""

#: ../../c-api/long.rst:181
#: ../../c-api/long.rst:185
msgid ""
"If the value of *obj* is greater than :const:`LLONG_MAX` or less than :const:"
"`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return "
"``-1``; otherwise, set *\\*overflow* to ``0``. If any other exception "
"occurs set *\\*overflow* to ``0`` and return ``-1`` as usual."
msgstr ""

#: ../../c-api/long.rst:203
#: ../../c-api/long.rst:207
msgid ""
"Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must "
"be an instance of :c:type:`PyLongObject`."
msgstr ""

#: ../../c-api/long.rst:206
#: ../../c-api/long.rst:210
msgid ""
"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:"
"type:`Py_ssize_t`."
msgstr ""

#: ../../c-api/long.rst:218
#: ../../c-api/long.rst:222
msgid ""
"Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* "
"must be an instance of :c:type:`PyLongObject`."
msgstr ""

#: ../../c-api/long.rst:221
#: ../../c-api/long.rst:225
msgid ""
"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:"
"expr:`unsigned long`."
msgstr ""

#: ../../c-api/long.rst:224
#: ../../c-api/long.rst:228
msgid ""
"Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to "
"disambiguate."
msgstr ""

#: ../../c-api/long.rst:234
#: ../../c-api/long.rst:238
msgid ""
"Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an "
"instance of :c:type:`PyLongObject`."
msgstr ""

#: ../../c-api/long.rst:237
#: ../../c-api/long.rst:241
msgid ""
"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:"
"type:`size_t`."
msgstr ""

#: ../../c-api/long.rst:240
#: ../../c-api/long.rst:244
msgid ""
"Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to "
"disambiguate."
msgstr ""

#: ../../c-api/long.rst:249
#: ../../c-api/long.rst:253
msgid ""
"Return a C :c:expr:`unsigned long long` representation of *pylong*. "
"*pylong* must be an instance of :c:type:`PyLongObject`."
msgstr ""

#: ../../c-api/long.rst:252
#: ../../c-api/long.rst:256
msgid ""
"Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :"
"c:expr:`unsigned long long`."
msgstr ""

#: ../../c-api/long.rst:255
#: ../../c-api/long.rst:259
msgid ""
"Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to "
"disambiguate."
msgstr ""

#: ../../c-api/long.rst:258
#: ../../c-api/long.rst:262
msgid ""
"A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`."
msgstr ""

#: ../../c-api/long.rst:264
#: ../../c-api/long.rst:268
msgid ""
"Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not "
"an instance of :c:type:`PyLongObject`, first call its :meth:`__index__` "
"method (if present) to convert it to a :c:type:`PyLongObject`."
msgstr ""

#: ../../c-api/long.rst:268
#: ../../c-api/long.rst:272
msgid ""
"If the value of *obj* is out of range for an :c:expr:`unsigned long`, return "
"the reduction of that value modulo ``ULONG_MAX + 1``."
msgstr ""

#: ../../c-api/long.rst:271
#: ../../c-api/long.rst:275
msgid ""
"Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to "
"disambiguate."
msgstr ""

#: ../../c-api/long.rst:283
#: ../../c-api/long.rst:287
msgid ""
"Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* "
"is not an instance of :c:type:`PyLongObject`, first call its :meth:"
"`__index__` method (if present) to convert it to a :c:type:`PyLongObject`."
msgstr ""

#: ../../c-api/long.rst:288
#: ../../c-api/long.rst:292
msgid ""
"If the value of *obj* is out of range for an :c:expr:`unsigned long long`, "
"return the reduction of that value modulo ``ULLONG_MAX + 1``."
msgstr ""

#: ../../c-api/long.rst:291
#: ../../c-api/long.rst:295
msgid ""
"Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` "
"to disambiguate."
msgstr ""

#: ../../c-api/long.rst:303
#: ../../c-api/long.rst:307
msgid ""
"Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an "
"instance of :c:type:`PyLongObject`."
msgstr ""

#: ../../c-api/long.rst:306
#: ../../c-api/long.rst:310
msgid ""
"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:"
"expr:`double`."
msgstr ""

#: ../../c-api/long.rst:309
#: ../../c-api/long.rst:313
msgid ""
"Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate."
msgstr ""

#: ../../c-api/long.rst:314
#: ../../c-api/long.rst:318
msgid ""
"Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* "
"cannot be converted, an :exc:`OverflowError` will be raised. This is only "
"assured to produce a usable :c:expr:`void` pointer for values created with :"
"c:func:`PyLong_FromVoidPtr`."
msgstr ""

#: ../../c-api/long.rst:319
#: ../../c-api/long.rst:323
msgid ""
"Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate."
msgstr ""
36 changes: 12 additions & 24 deletions faq/general.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-15 20:43+0000\n"
"POT-Creation-Date: 2023-02-01 00:19+0000\n"
"PO-Revision-Date: 2022-10-16 06:51+0800\n"
"Last-Translator: Steven Hsu <hsuhaochun@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -507,9 +507,11 @@ msgstr "也許最好是引用你最喜歡的關於 Python 的書。"

#: ../../faq/general.rst:251
msgid ""
"The very first article about Python was written in 1991 and is now quite "
"outdated."
msgstr "最早討論 Python 的文章是在 1991 年寫的,但現在來看已經過時了。"
"The `very first article <https://ir.cwi.nl/pub/18204>`_ about Python was "
"written in 1991 and is now quite outdated."
msgstr ""
"`最早討論 Python 的文章 <https://ir.cwi.nl/pub/18204>`_\\ 是在 1991 年寫的,"
"但現在來看已經過時了。"

#: ../../faq/general.rst:254
msgid ""
Expand Down Expand Up @@ -675,10 +677,10 @@ msgid ""
"administration software in Python. Companies that use Python internally "
"include Google, Yahoo, and Lucasfilm Ltd."
msgstr ""
"備受矚目的 Python 專案包括 `Mailman 郵件討論群管理員 <https://www.list.org>`_"
"\\ 和 `Zope 應用程式伺服器 <https://www.zope.dev>`_。有一些 Linux 發行版,最"
"著名的是 `Red Hat <https://www.redhat.com>`_,已經用 Python 編寫了部分或全部"
"的安裝程式及系統管理軟體。內部使用 Python 的公司包括 Google、Yahoo 和 "
"備受矚目的 Python 專案包括 `Mailman 郵件討論群管理員 <https://www.list."
"org>`_\\ 和 `Zope 應用程式伺服器 <https://www.zope.dev>`_。有一些 Linux 發行"
"版,最著名的是 `Red Hat <https://www.redhat.com>`_,已經用 Python 編寫了部分"
"或全部的安裝程式及系統管理軟體。內部使用 Python 的公司包括 Google、Yahoo 和 "
"Lucasfilm Ltd。"

#: ../../faq/general.rst:346
Expand Down Expand Up @@ -805,8 +807,8 @@ msgid ""
"can't remember the methods for a list, they can do something like this::"
msgstr ""
"Python 的互動式直譯器使學生能夠在程式設計時測試語言的功能。他們可以開著一個運"
"行直譯器的視窗,同時在另一個視窗中輸入他們的程式原始碼。如果他們不記得 "
"list(串列)的 method(方法),他們可以像這樣做:\n"
"行直譯器的視窗,同時在另一個視窗中輸入他們的程式原始碼。如果他們不記得 list"
"(串列)的 method(方法),他們可以像這樣做:\n"
"\n"
"::"

Expand Down Expand Up @@ -840,17 +842,3 @@ msgid ""
msgstr ""
"如果你想討論 Python 在教育領域中的使用,你可能會有興趣加入 `edu-sig 郵件討論"
"群 <https://www.python.org/community/sigs/current/edu-sig>`_。"

#~ msgid ""
#~ "You must have a Roundup account to report bugs; this makes it possible "
#~ "for us to contact you if we have follow-up questions. It will also "
#~ "enable Roundup to send you updates as we act on your bug. If you had "
#~ "previously used SourceForge to report bugs to Python, you can obtain your "
#~ "Roundup password through Roundup's `password reset procedure <https://"
#~ "bugs.python.org/user?@template=forgotten>`_."
#~ msgstr ""
#~ "你必須擁有一個 Roundup 帳號才能回報錯誤;如果我們有後續的問題,我們才可以"
#~ "與你聯繫。這樣也能讓 Roundup 在我們處理你回報的錯誤時,為你發送最新消息。"
#~ "如果你以前使用過 SourceForge 來向 Python 回報錯誤,則可以透過 Roundup 的"
#~ "\\ `密碼重設過程 <https://bugs.python.org/user?@template=forgotten>`_,取"
#~ "得你的 Roundup 密碼。"
Loading