From b565db29d2436e064b5e8af7df23d082b8013d74 Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Fri, 2 Jul 2021 01:44:23 +0800 Subject: [PATCH 01/39] Translate license.po Complete translation of license.po --- license.po | 289 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 181 insertions(+), 108 deletions(-) diff --git a/license.po b/license.po index 3be32ffa45..9dd66ea504 100644 --- a/license.po +++ b/license.po @@ -1,15 +1,16 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Leon H., 2017 +# Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2018-05-23 14:04+0000\n" +"PO-Revision-Date: 2021-07-02 01:38+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -18,14 +19,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.4.3\n" #: ../../license.rst:7 msgid "History and License" -msgstr "歷史與授權" +msgstr "沿革與授權" #: ../../license.rst:11 msgid "History of the software" -msgstr "" +msgstr "軟體沿革" #: ../../license.rst:13 msgid "" @@ -34,6 +36,9 @@ msgid "" "successor of a language called ABC. Guido remains Python's principal " "author, although it includes many contributions from others." msgstr "" +"Python 是由荷蘭數學和計算機科學研究學會(CWI,見 https://www.cwi.nl/)的 " +"Guido van Rossum 於 1990 年代早期所創造,目的是作為一種稱為 ABC 語言的後繼" +"者。儘管 Python 包含了許多來自其他人的貢獻,Guido 仍是其主要作者。" #: ../../license.rst:18 msgid "" @@ -41,6 +46,8 @@ msgid "" "Research Initiatives (CNRI, see https://www.cnri.reston.va.us/) in Reston, " "Virginia where he released several versions of the software." msgstr "" +"1995 年,Guido在維吉尼亞州雷斯頓的國家創新研究公司(CNRI,見 https://www." +"cnri.reston.va.us/)繼續他在 Python 的工作,並在那裡發佈了該軟體的多個版本。" #: ../../license.rst:22 msgid "" @@ -52,6 +59,11 @@ msgid "" "specifically to own Python-related Intellectual Property. Zope Corporation " "is a sponsoring member of the PSF." msgstr "" +"2000 年五月,Guido 和 Python 核心開發團隊轉移到 BeOpen.com 並成立了 BeOpen " +"PythonLabs 團隊。同年十月,PythonLabs 團隊轉移到 Digital Creations(現為 " +"Zope Corporation;見 https://www.zope.org/)。2001年,Python 軟體基金會" +"(PSF,見 https://www.python.org/psf/)成立,這是一個專為擁有 Python 相關的智" +"慧財產權而創立的非營利組織。Zope Corporation 是 PSF 的一個贊助會員。" #: ../../license.rst:30 msgid "" @@ -60,143 +72,146 @@ msgid "" "have also been GPL-compatible; the table below summarizes the various " "releases." msgstr "" +"所有的 Python 版本都是開源的(有關開源的定義,參閱 https://opensource." +"org/)。歷史上,大多數但非全部的 Python 版本,也是 GPL 相容的;以下表格總結各" +"個版本的差異。" #: ../../license.rst:35 msgid "Release" -msgstr "" +msgstr "發佈版本" #: ../../license.rst:35 msgid "Derived from" -msgstr "" +msgstr "源自" #: ../../license.rst:35 msgid "Year" -msgstr "" +msgstr "年份" #: ../../license.rst:35 msgid "Owner" -msgstr "" +msgstr "擁有者" #: ../../license.rst:35 msgid "GPL compatible?" -msgstr "" +msgstr "GPL 相容性" #: ../../license.rst:37 msgid "0.9.0 thru 1.2" -msgstr "" +msgstr "0.9.0 至 1.2" #: ../../license.rst:37 msgid "n/a" -msgstr "" +msgstr "不適用" #: ../../license.rst:37 msgid "1991-1995" -msgstr "" +msgstr "1991-1995" #: ../../license.rst:37 msgid "CWI" -msgstr "" +msgstr "CWI" #: ../../license.rst:37 ../../license.rst:39 ../../license.rst:49 #: ../../license.rst:51 ../../license.rst:53 ../../license.rst:55 #: ../../license.rst:57 msgid "yes" -msgstr "" +msgstr "是" #: ../../license.rst:39 msgid "1.3 thru 1.5.2" -msgstr "" +msgstr "1.3 至 1.5.2" #: ../../license.rst:39 msgid "1.2" -msgstr "" +msgstr "1.2" #: ../../license.rst:39 msgid "1995-1999" -msgstr "" +msgstr "1995-1999" #: ../../license.rst:39 ../../license.rst:41 ../../license.rst:45 msgid "CNRI" -msgstr "" +msgstr "CNRI" #: ../../license.rst:41 ../../license.rst:43 ../../license.rst:45 msgid "1.6" -msgstr "" +msgstr "1.6" #: ../../license.rst:41 msgid "1.5.2" -msgstr "" +msgstr "1.5.2" #: ../../license.rst:41 ../../license.rst:43 msgid "2000" -msgstr "" +msgstr "2000" #: ../../license.rst:41 ../../license.rst:43 ../../license.rst:45 #: ../../license.rst:47 msgid "no" -msgstr "" +msgstr "否" #: ../../license.rst:43 msgid "2.0" -msgstr "" +msgstr "2.0" #: ../../license.rst:43 msgid "BeOpen.com" -msgstr "" +msgstr "BeOpen.com" #: ../../license.rst:45 msgid "1.6.1" -msgstr "" +msgstr "1.6.1" #: ../../license.rst:45 ../../license.rst:47 ../../license.rst:49 #: ../../license.rst:51 msgid "2001" -msgstr "" +msgstr "2001" #: ../../license.rst:47 msgid "2.1" -msgstr "" +msgstr "2.1" #: ../../license.rst:47 ../../license.rst:49 msgid "2.0+1.6.1" -msgstr "" +msgstr "2.0+1.6.1" #: ../../license.rst:47 ../../license.rst:49 ../../license.rst:51 #: ../../license.rst:53 ../../license.rst:55 ../../license.rst:57 msgid "PSF" -msgstr "" +msgstr "PSF" #: ../../license.rst:49 msgid "2.0.1" -msgstr "" +msgstr "2.0.1" #: ../../license.rst:51 ../../license.rst:53 ../../license.rst:57 msgid "2.1.1" -msgstr "" +msgstr "2.1.1" #: ../../license.rst:51 msgid "2.1+2.0.1" -msgstr "" +msgstr "2.1+2.0.1" #: ../../license.rst:53 ../../license.rst:55 msgid "2.1.2" -msgstr "" +msgstr "2.1.2" #: ../../license.rst:53 ../../license.rst:55 msgid "2002" -msgstr "" +msgstr "2002" #: ../../license.rst:55 msgid "2.1.3" -msgstr "" +msgstr "2.1.3" #: ../../license.rst:57 msgid "2.2 and above" -msgstr "" +msgstr "2.2 以上" #: ../../license.rst:57 msgid "2001-now" -msgstr "" +msgstr "2001 至今" #: ../../license.rst:62 msgid "" @@ -206,40 +221,73 @@ msgid "" "possible to combine Python with other software that is released under the " "GPL; the others don't." msgstr "" +"GPL 相容並不表示我們是在 GPL 下發佈 Python。不像 GPL,所有的 Python 授權都可" +"以讓您發佈修改後的版本,但不一定要使您的變更成為開源。GPL 相容的授權使得 " +"Python 可以結合其他在 GPL 下發佈的軟體一起使用;但其它的授權則不行。" #: ../../license.rst:68 msgid "" "Thanks to the many outside volunteers who have worked under Guido's " "direction to make these releases possible." msgstr "" +"感謝許多的外部志工,在 Guido 指導下的付出,使得這些版本的發佈成為可能。" #: ../../license.rst:73 msgid "Terms and conditions for accessing or otherwise using Python" +msgstr "關於存取或以其他方式使用 Python 的合約條款" + +#: ../../license.rst:74 +msgid "" +"Python software and documentation are licensed under the :ref:`PSF License " +"Agreement `." +msgstr "" +"Python 軟體和說明文件的授權是基於 :ref:`PSF 授權合約 `\\ 。" + +#: ../../license.rst:75 +msgid "" +"Starting with Python 3.8.6, examples, recipes, and other code in the " +"documentation are dual licensed under the PSF License Agreement and the :ref:" +"`Zero-Clause BSD license `." msgstr "" +"從 Python 3.8.6開始,說明文件中的範例、程式庫和其他程式碼,是被雙重授權 " +"(dual licensed) 於 PSF 授權合約以及 :ref:`Zero-Clause BSD 授權 `\\ 。" + +#: ../../license.rst:76 +msgid "" +"Some software incorporated into Python is under different licenses. The " +"licenses are listed with code falling under that license. See :ref:" +"`OtherLicenses` for an incomplete list of these licenses." +msgstr "" +"有些被納入 Python 中的軟體是基於不同的授權。這些授權將會與其授權之程式碼一起" +"被列出。關於這些授權的不完整清單,請參閱\\ :ref:`OtherLicenses`\\ 。" #: ../../license.rst:77 msgid "PSF LICENSE AGREEMENT FOR PYTHON |release|" -msgstr "" +msgstr "用於 PYTHON |release| 的 PSF 授權合約" #: ../../license.rst:125 msgid "BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0" -msgstr "" +msgstr "用於 PYTHON 2.0 的 BEOPEN.COM 授權合約" #: ../../license.rst:127 msgid "BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1" -msgstr "" +msgstr "BEOPEN PYTHON 開源授權合約第 1 版" #: ../../license.rst:172 msgid "CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1" -msgstr "" +msgstr "用於 PYTHON 1.6.1 的 CNRI 授權合約" #: ../../license.rst:237 msgid "CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2" -msgstr "" +msgstr "用於 PYTHON 0.9.0 至 1.2 的 CWI 授權合約" + +#: ../../license.rst:252 +msgid "ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON |release| DOCUMENTATION" +msgstr "用於 PYTHON |release| 說明文件內程式碼的 ZERO-CLAUSE BSD 授權" #: ../../license.rst:262 msgid "Licenses and Acknowledgements for Incorporated Software" -msgstr "" +msgstr "被收錄軟體的授權與致謝" #: ../../license.rst:264 msgid "" @@ -247,10 +295,12 @@ msgid "" "acknowledgements for third-party software incorporated in the Python " "distribution." msgstr "" +"本節是一個不完整且不斷成長的授權與致謝清單,對象是在 Python 發佈版本中所收錄" +"的第三方軟體。" #: ../../license.rst:269 msgid "Mersenne Twister" -msgstr "" +msgstr "Mersenne Twister" #: ../../license.rst:271 msgid "" @@ -258,10 +308,15 @@ msgid "" "math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html. The following " "are the verbatim comments from the original code::" msgstr "" +":mod:`_random` 模組包含了以 http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/" +"MT2002/emt19937ar.html 的下載內容為基礎的程式碼。以下是原始程式碼的完整聲" +"明:\n" +"\n" +"::" #: ../../license.rst:318 msgid "Sockets" -msgstr "" +msgstr "Sockets" #: ../../license.rst:320 msgid "" @@ -269,80 +324,109 @@ msgid "" "`getnameinfo`, which are coded in separate source files from the WIDE " "Project, http://www.wide.ad.jp/. ::" msgstr "" +":mod:`socket` 模組使用 :func:`getaddrinfo` 和 :func:`getnameinfo` 函式,它們" +"在 WIDE 專案(http://www.wide.ad.jp/)內,於不同的原始檔案中被編碼。\n" +"\n" +"::" #: ../../license.rst:353 msgid "Asynchronous socket services" -msgstr "" +msgstr "非同步 socket 服務" #: ../../license.rst:355 msgid "" "The :mod:`asynchat` and :mod:`asyncore` modules contain the following " "notice::" msgstr "" +":mod:`asynchat` 和 :mod:`asyncore` 模組包含以下聲明:\n" +"\n" +"::" #: ../../license.rst:380 msgid "Cookie management" -msgstr "" +msgstr "Cookie 管理" #: ../../license.rst:382 msgid "The :mod:`http.cookies` module contains the following notice::" msgstr "" +":mod:`http.cookies` 模組包含以下聲明:\n" +"\n" +"::" #: ../../license.rst:408 msgid "Execution tracing" -msgstr "" +msgstr "執行追蹤" #: ../../license.rst:410 msgid "The :mod:`trace` module contains the following notice::" msgstr "" +":mod:`trace` 模組包含以下聲明:\n" +"\n" +"::" #: ../../license.rst:441 msgid "UUencode and UUdecode functions" -msgstr "" +msgstr "UUencode 與 UUdecode 函式" #: ../../license.rst:443 msgid "The :mod:`uu` module contains the following notice::" msgstr "" +":mod:`uu` 模組包含以下聲明:\n" +"\n" +"::" #: ../../license.rst:471 msgid "XML Remote Procedure Calls" -msgstr "" +msgstr "XML 遠端程序呼叫" #: ../../license.rst:473 msgid "The :mod:`xmlrpc.client` module contains the following notice::" msgstr "" +":mod:`xmlrpc.client` 模組包含以下聲明:\n" +"\n" +"::" #: ../../license.rst:504 msgid "test_epoll" -msgstr "" +msgstr "test_epoll" #: ../../license.rst:506 msgid "The :mod:`test_epoll` module contains the following notice::" msgstr "" +":mod:`test_epoll` 模組包含以下聲明:\n" +"\n" +"::" #: ../../license.rst:530 msgid "Select kqueue" -msgstr "" +msgstr "Select kqueue" #: ../../license.rst:532 msgid "" "The :mod:`select` module contains the following notice for the kqueue " "interface::" msgstr "" +":mod:`select` 模組對於 kqueue 介面包含以下聲明:\n" +"\n" +"::" #: ../../license.rst:561 msgid "SipHash24" -msgstr "" +msgstr "SipHash24" #: ../../license.rst:563 msgid "" "The file :file:`Python/pyhash.c` contains Marek Majkowski' implementation of " "Dan Bernstein's SipHash24 algorithm. It contains the following note::" msgstr "" +":file:`Python/pyhash.c` 檔案包含 Marek Majkowski' 基於 Dan Bernstein 的 " +"SipHash24 演算法的實作。它包含以下聲明:\n" +"\n" +"::" #: ../../license.rst:590 msgid "strtod and dtoa" -msgstr "" +msgstr "strtod 與 dtoa" #: ../../license.rst:592 msgid "" @@ -352,10 +436,16 @@ msgid "" "org/fp/. The original file, as retrieved on March 16, 2009, contains the " "following copyright and licensing notice::" msgstr "" +":file:`Python/dtoa.c` 檔案提供了 C 的 dtoa 和 strtod 函式,用於將 C 的雙精度" +"浮點數和字串互相轉換。該檔案是衍生自 David M. Gay 建立的同名檔案,後者現在可" +"以從 http://www.netlib.org/fp/ 下載。於 2009 年 3 月 16 日所檢索的原始檔案包" +"含以下版權與授權聲明:\n" +"\n" +"::" #: ../../license.rst:620 msgid "OpenSSL" -msgstr "" +msgstr "OpenSSL" #: ../../license.rst:622 msgid "" @@ -365,30 +455,44 @@ msgid "" "include a copy of the OpenSSL libraries, so we include a copy of the OpenSSL " "license here::" msgstr "" +"如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`\\ 、\\ :mod:`posix`" +"\\ 、\\ :mod:`ssl`\\ 、\\ :mod:`crypt` 模組會使用它來提升效能。此外,因為 " +"Windows 和 Mac OS X 的 Python 安裝程式可能包含 OpenSSL 函式庫的複本,所以我們" +"也在此收錄 OpenSSL 授權的複本:\n" +"\n" +"::" #: ../../license.rst:757 msgid "expat" -msgstr "" +msgstr "expat" #: ../../license.rst:759 msgid "" "The :mod:`pyexpat` extension is built using an included copy of the expat " "sources unless the build is configured ``--with-system-expat``::" msgstr "" +"除非在建置 :mod:`pyexpat` 擴充時設定為 ``--with-system-expat``\\ ,否則該擴充" +"會用一個內含 expat 原始碼的複本來建置:\n" +"\n" +"::" #: ../../license.rst:786 msgid "libffi" -msgstr "" +msgstr "libffi" #: ../../license.rst:788 msgid "" "The :mod:`_ctypes` extension is built using an included copy of the libffi " "sources unless the build is configured ``--with-system-libffi``::" msgstr "" +"除非在建置 :mod:`_ctypes` 擴充時設定為 ``--with-system-libffi``\\ ,否則該擴" +"充會用一個內含 libffi 原始碼的複本來建置:\n" +"\n" +"::" #: ../../license.rst:815 msgid "zlib" -msgstr "" +msgstr "zlib" #: ../../license.rst:817 msgid "" @@ -396,30 +500,42 @@ msgid "" "sources if the zlib version found on the system is too old to be used for " "the build::" msgstr "" +"如果在系統上找到的 zlib 版本太舊以致於無法用於建置 :mod:`zlib` 擴充,則該擴充" +"會用一個內含 zlib 原始碼的複本來建置:\n" +"\n" +"::" #: ../../license.rst:846 msgid "cfuhash" -msgstr "" +msgstr "cfuhash" #: ../../license.rst:848 msgid "" "The implementation of the hash table used by the :mod:`tracemalloc` is based " "on the cfuhash project::" msgstr "" +":mod:`tracemalloc` 使用的雜湊表 (hash table) 實作,是以 cfuhash 專案為基" +"礎:\n" +"\n" +"::" #: ../../license.rst:887 msgid "libmpdec" -msgstr "" +msgstr "libmpdec" #: ../../license.rst:889 msgid "" "The :mod:`_decimal` module is built using an included copy of the libmpdec " "library unless the build is configured ``--with-system-libmpdec``::" msgstr "" +"除非在建置 :mod:`_decimal` 模組時設定為 ``--with-system-libmpdec``\\ ,否則該" +"模組會用一個內含 libmpdec 函式庫的複本來建置:\n" +"\n" +"::" #: ../../license.rst:919 msgid "W3C C14N test suite" -msgstr "" +msgstr "W3C C14N 測試套件" #: ../../license.rst:921 msgid "" @@ -427,49 +543,6 @@ msgid "" "c14n-20/``) was retrieved from the W3C website at https://www.w3.org/TR/xml-" "c14n2-testcases/ and is distributed under the 3-clause BSD license:" msgstr "" - -#: ../../license.rst:926 -msgid "" -"Copyright (c) 2013 W3C(R) (MIT, ERCIM, Keio, Beihang), All Rights Reserved." -msgstr "" - -#: ../../license.rst:929 -msgid "" -"Redistribution and use in source and binary forms, with or without " -"modification, are permitted provided that the following conditions are met:" -msgstr "" - -#: ../../license.rst:933 -msgid "" -"Redistributions of works must retain the original copyright notice, this " -"list of conditions and the following disclaimer." -msgstr "" - -#: ../../license.rst:935 -msgid "" -"Redistributions in binary form must reproduce the original copyright notice, " -"this list of conditions and the following disclaimer in the documentation " -"and/or other materials provided with the distribution." -msgstr "" - -#: ../../license.rst:938 -msgid "" -"Neither the name of the W3C nor the names of its contributors may be used to " -"endorse or promote products derived from this work without specific prior " -"written permission." -msgstr "" - -#: ../../license.rst:942 -msgid "" -"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS" -"\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE " -"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE " -"ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE " -"LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR " -"CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF " -"SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS " -"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN " -"CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) " -"ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE " -"POSSIBILITY OF SUCH DAMAGE." -msgstr "" +":mod:`test` 程式包中的 C14N 2.0 測試套件 (``Lib/test/xmltestdata/c14n-20/``) " +"是從 W3C 網站 https://www.w3.org/TR/xml-c14n2-testcases/ 被檢索,且是基於 3-" +"clause BSD 授權被發佈:" From 097c23dcfae71759437823e3a91f9cb3e1d7825d Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Fri, 2 Jul 2021 17:09:15 +0800 Subject: [PATCH 02/39] Update license.po Fix a rST problem. --- license.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/license.po b/license.po index 9dd66ea504..6f464d2cb7 100644 --- a/license.po +++ b/license.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2021-07-02 01:38+0800\n" +"PO-Revision-Date: 2021-07-02 16:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -541,8 +541,10 @@ msgstr "W3C C14N 測試套件" msgid "" "The C14N 2.0 test suite in the :mod:`test` package (``Lib/test/xmltestdata/" "c14n-20/``) was retrieved from the W3C website at https://www.w3.org/TR/xml-" -"c14n2-testcases/ and is distributed under the 3-clause BSD license:" +"c14n2-testcases/ and is distributed under the 3-clause BSD license::" msgstr "" ":mod:`test` 程式包中的 C14N 2.0 測試套件 (``Lib/test/xmltestdata/c14n-20/``) " "是從 W3C 網站 https://www.w3.org/TR/xml-c14n2-testcases/ 被檢索,且是基於 3-" -"clause BSD 授權被發佈:" +"clause BSD 授權被發佈:\n" +"\n" +"::" From 41e5d1ffe5f973263d21aff25834255aa475fa79 Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Sun, 4 Jul 2021 01:17:03 +0800 Subject: [PATCH 03/39] Translate intalling/index.po MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Complete installing/index.po 2. Fix a term "開關參數" in tutorial/module.po --- installing/index.po | 133 +++++++++++++++++++++++++++++++++++++------- tutorial/modules.po | 12 ++-- 2 files changed, 120 insertions(+), 25 deletions(-) diff --git a/installing/index.po b/installing/index.po index 0f163b1013..48c64130e9 100644 --- a/installing/index.po +++ b/installing/index.po @@ -1,16 +1,17 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Leon H., 2017 # 豆豆 (Tommy Lin) , 2017 +# Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2018-05-23 14:37+0000\n" +"PO-Revision-Date: 2021-07-04 01:14+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -19,6 +20,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 2.4.3\n" #: ../../installing/index.rst:7 msgid "Installing Python Modules" @@ -26,7 +28,7 @@ msgstr "安裝 Python 模組" #: ../../installing/index.rst:0 msgid "Email" -msgstr "" +msgstr "電子郵件" #: ../../installing/index.rst:9 msgid "distutils-sig@python.org" @@ -38,6 +40,8 @@ msgid "" "supporting community of contributors and users that also make their software " "available for other Python developers to use under open source license terms." msgstr "" +"作為一個普及的開源開發專案,Python 有一個活躍的支持社群,由其貢獻者及使用者組" +"成,而他們也讓他們的軟體可被其他 Python 開發者在開源授權條款下使用。" #: ../../installing/index.rst:15 msgid "" @@ -46,6 +50,9 @@ msgid "" "rare!) problems, as well as potentially contributing their own solutions to " "the common pool." msgstr "" +"這樣可以讓 Python 使用者們有效地共享和合作,並受益於其他人對常見(有時甚至是" +"罕見)的問題已經建立的解決方案,更可以在公用社群中潛在地貢獻他們自己的解決方" +"案。" #: ../../installing/index.rst:20 msgid "" @@ -53,6 +60,8 @@ msgid "" "creating and sharing your own Python projects, refer to the :ref:" "`distribution guide `." msgstr "" +"這份指南涵蓋了上述過程中的安裝部分。如果是要建立及分享您自己的 Python 專案," +"請參考\\ :ref:`發布 Python 模組 `\\ 指南。" #: ../../installing/index.rst:26 msgid "" @@ -61,16 +70,20 @@ msgid "" "source software. Please take such policies into account when making use of " "the distribution and installation tools provided with Python." msgstr "" +"對於企業和其他機構的使用者,要注意到,許多組織對於使用和貢獻開源軟體都有自己" +"的政策。在開始使用配備 Python 的發布及安裝工具時,請將那些政策納入考量。" #: ../../installing/index.rst:33 msgid "Key terms" -msgstr "" +msgstr "關鍵術語" #: ../../installing/index.rst:35 msgid "" "``pip`` is the preferred installer program. Starting with Python 3.4, it is " "included by default with the Python binary installers." msgstr "" +"``pip`` 是首選的安裝程式。從 Python 3.4 開始,它被預設包含在 Python 二進制安" +"裝程式中。" #: ../../installing/index.rst:37 msgid "" @@ -78,6 +91,8 @@ msgid "" "packages to be installed for use by a particular application, rather than " "being installed system wide." msgstr "" +"*virtual environment(虛擬環境)*\\ 是一種半隔離的 Python 環境,可以為某個特" +"定應用程式安裝其所需的套件,而不用在整個系統上安裝它們。" #: ../../installing/index.rst:40 msgid "" @@ -85,6 +100,8 @@ msgid "" "been part of Python since Python 3.3. Starting with Python 3.4, it defaults " "to installing ``pip`` into all created virtual environments." msgstr "" +"``venv`` 是建立虛擬環境的標準工具,它從 Python 3.3 開始成為 Python 的一部分。" +"從 Python 3.4 開始,它會預設地安裝 ``pip`` 到所有被建立的虛擬環境。" #: ../../installing/index.rst:43 msgid "" @@ -93,12 +110,17 @@ msgid "" "3.4, which either don't provide ``venv`` at all, or aren't able to " "automatically install ``pip`` into created environments." msgstr "" +"``virtualenv`` 是 ``venv`` 的一個第三方替代方案(及其前身)。它使虛擬環境可以" +"在 Python 3.4 之前的版本被使用,那些版本要不是根本沒提供 ``venv``,就是無法自" +"動安裝 ``pip`` 到所建立的環境中。" #: ../../installing/index.rst:47 msgid "" "The `Python Packaging Index `__ is a public repository of " "open source licensed packages made available for use by other Python users." msgstr "" +"`Python 套件索引 (Python Package Index) `__ 是開源授權套件" +"的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用。" #: ../../installing/index.rst:50 msgid "" @@ -109,6 +131,11 @@ msgid "" "issue trackers on both `GitHub `__ and `Bitbucket " "`__." msgstr "" +"`Python 封裝管理站 (Python Packaging Authority) `__ 是" +"一個由開發者和說明文件作者組成的團隊,負責維護及改進標準封裝工具,以及相關的" +"元資料 (metadata) 和檔案格式標準。他們在 `GitHub `__ 和 `Bitbucket `__ 這兩個平台上維護各種" +"工具、說明文件及問題追蹤系統。" #: ../../installing/index.rst:57 msgid "" @@ -119,39 +146,51 @@ msgid "" "library, but its name lives on in other ways (such as the name of the " "mailing list used to coordinate Python packaging standards development)." msgstr "" +"``distutils`` 是最早的建置和發布系統,於 1998 年首次被加入 Python 標準函式" +"庫。雖然直接使用 ``distutils`` 的方式已經被逐步淘汰,它仍然是現今封裝和發布的" +"基礎結構根基,而且它不僅仍然是標準函式庫的一部分,它的名稱也以其他的方式存活" +"著(例如:用於協調 Python 封裝標準開發的郵寄清單就是以它命名)。" #: ../../installing/index.rst:65 msgid "" "The use of ``venv`` is now recommended for creating virtual environments." -msgstr "" +msgstr "對於建立虛擬環境,現在推薦使用 ``venv``。" #: ../../installing/index.rst:70 msgid "" "`Python Packaging User Guide: Creating and using virtual environments " "`__" msgstr "" +"`Python 封裝使用者指南:建立和使用虛擬環境 `__" #: ../../installing/index.rst:75 msgid "Basic usage" -msgstr "" +msgstr "基本用法" #: ../../installing/index.rst:77 msgid "" "The standard packaging tools are all designed to be used from the command " "line." -msgstr "" +msgstr "標準封裝工具皆是以能從命令列使用的方式被設計的。" #: ../../installing/index.rst:80 msgid "" "The following command will install the latest version of a module and its " "dependencies from the Python Packaging Index::" msgstr "" +"以下指令將從 Python 套件索引安裝一個模組的最新版本及其依賴套件 " +"(dependencies):\n" +"\n" +"::" #: ../../installing/index.rst:87 msgid "" "For POSIX users (including Mac OS X and Linux users), the examples in this " "guide assume the use of a :term:`virtual environment`." msgstr "" +"對於 POSIX 使用者(包括 Mac OS X 和 Linux 使用者),本指南中的範例皆假設有使" +"用 :term:`virtual environment`\\ 。" #: ../../installing/index.rst:90 msgid "" @@ -159,6 +198,8 @@ msgid "" "adjust the system PATH environment variable was selected when installing " "Python." msgstr "" +"對於 Windows 使用者,本指南中的範例皆假設在安裝 Python 時,「可調整系統 PATH " +"環境變數」的選項已被選取。" #: ../../installing/index.rst:94 msgid "" @@ -167,6 +208,11 @@ msgid "" "other special character which get interpreted by shell, the package name and " "the version should be enclosed within double quotes::" msgstr "" +"在命令列中直接指定一個明確的或最小的版本也是可行的。當使用像是 ``>``、``<`` " +"的比較運算子,或某些可被 shell 所解釋的其他特殊字元時,套件名稱與版本編號應該" +"要放在雙引號內:\n" +"\n" +"::" #: ../../installing/index.rst:102 msgid "" @@ -174,12 +220,18 @@ msgid "" "it again will have no effect. Upgrading existing modules must be requested " "explicitly::" msgstr "" +"通常,如果一個合適的模組已被安裝,嘗試再次安裝它將不會有任何效果。要升級現有" +"的模組就必須明確地請求:\n" +"\n" +"::" #: ../../installing/index.rst:108 msgid "" "More information and resources regarding ``pip`` and its capabilities can be " "found in the `Python Packaging User Guide `__." msgstr "" +"關於 ``pip`` 及其能力的更多資訊和資源,可以在 `Python 封裝使用者指南 " +"`__\\ 中找到。" #: ../../installing/index.rst:111 msgid "" @@ -187,24 +239,28 @@ msgid "" "Installing packages into an active virtual environment uses the commands " "shown above." msgstr "" +"虛擬環境的建立是使用 :mod:`venv` 模組來完成。要在一個已啟用的虛擬環境中安裝套" +"件,可使用前面展示的指令。" #: ../../installing/index.rst:117 msgid "" "`Python Packaging User Guide: Installing Python Distribution Packages " "`__" msgstr "" +"`Python 封裝使用者指南:安裝 Python 發布套件 `__" #: ../../installing/index.rst:122 msgid "How do I ...?" -msgstr "" +msgstr "我該如何...?" #: ../../installing/index.rst:124 msgid "These are quick answers or links for some common tasks." -msgstr "" +msgstr "接下來是關於一些常見任務的快速解答或連結。" #: ../../installing/index.rst:127 msgid "... install ``pip`` in versions of Python prior to Python 3.4?" -msgstr "" +msgstr "...在 Python 3.4 之前的 Python 版本中安裝 ``pip``?" #: ../../installing/index.rst:129 msgid "" @@ -212,26 +268,32 @@ msgid "" "``pip`` needs to be \"bootstrapped\" as described in the Python Packaging " "User Guide." msgstr "" +"Python 是從 Python 3.4 才開始綁定 ``pip`` 的。對於更早的版本,\\ ``pip`` 需要" +"被「自助安裝 (bootstrapped)」,請參考 Python 封裝使用者指南中的說明。" #: ../../installing/index.rst:135 msgid "" "`Python Packaging User Guide: Requirements for Installing Packages `__" msgstr "" +"`Python 封裝使用者指南:安裝套件的需求 `__" #: ../../installing/index.rst:142 msgid "... install packages just for the current user?" -msgstr "" +msgstr "...只為目前的使用者安裝套件?" #: ../../installing/index.rst:144 msgid "" "Passing the ``--user`` option to ``python -m pip install`` will install a " "package just for the current user, rather than for all users of the system." msgstr "" +"把 ``--user`` 選項傳給 ``python -m pip install``,這樣將會只為目前使用者而非" +"系統的所有使用者安裝套件。" #: ../../installing/index.rst:149 msgid "... install scientific Python packages?" -msgstr "" +msgstr "...安裝科學的 Python 套件?" #: ../../installing/index.rst:151 msgid "" @@ -241,16 +303,21 @@ msgid "" "means `__ rather than attempting to " "install them with ``pip``." msgstr "" +"許多科學類 Python 套件都有複雜的二進制依賴套件,且目前不太容易直接使用 " +"``pip`` 安裝。目前為止,使用\\ `其他方法 `__\\ 而非嘗試用 ``pip`` 來安裝它們,對使用者來說通常會更簡單。" #: ../../installing/index.rst:159 msgid "" "`Python Packaging User Guide: Installing Scientific Packages `__" msgstr "" +"`Python 封裝使用者指南:安裝科學套件 `__" #: ../../installing/index.rst:164 msgid "... work with multiple versions of Python installed in parallel?" -msgstr "" +msgstr "...平行安裝多個 Python 版本並使用它們?" #: ../../installing/index.rst:166 msgid "" @@ -258,24 +325,32 @@ msgid "" "commands in combination with the ``-m`` switch to run the appropriate copy " "of ``pip``::" msgstr "" +"在 Linux、Mac OS X 以及其他 POSIX 系統中,使用帶有版本編號的 Python 指令並結" +"合 ``-m`` 開關參數,來運行 ``pip`` 的適當副本:\n" +"\n" +"::" #: ../../installing/index.rst:175 msgid "Appropriately versioned ``pip`` commands may also be available." -msgstr "" +msgstr "使用帶有合適版本編號的 ``pip`` 指令,也是可行的。" #: ../../installing/index.rst:177 msgid "" "On Windows, use the ``py`` Python launcher in combination with the ``-m`` " "switch::" msgstr "" +"在 Windows 中,使用 Python 啟動指令 ``py`` 並結合 ``-m`` 開關參數 " +"(switch):\n" +"\n" +"::" #: ../../installing/index.rst:194 msgid "Common installation issues" -msgstr "" +msgstr "常見的安裝問題" #: ../../installing/index.rst:197 msgid "Installing into the system Python on Linux" -msgstr "" +msgstr "在 Linux 上安裝套件至系統 Python" #: ../../installing/index.rst:199 msgid "" @@ -285,22 +360,30 @@ msgid "" "package manager and other components of the system if a component is " "unexpectedly upgraded using ``pip``." msgstr "" +"在 Linux 系統,Python 的某個安裝版本通常會被內含在 Linux 的發行版中。要安裝套" +"件到這個 Python 版本上需要系統的 root 權限,並且可能會干擾到系統套件管理器的" +"運作。如果其他系統組件非預期地以 ``pip`` 被升級,也會干擾這些組件的運作。" #: ../../installing/index.rst:205 msgid "" "On such systems, it is often better to use a virtual environment or a per-" "user installation when installing packages with ``pip``." msgstr "" +"在這樣的系統上,以 ``pip`` 安裝套件時,通常較好的方式是使用虛擬環境,或以個別" +"使用者安裝。" #: ../../installing/index.rst:210 msgid "Pip not installed" -msgstr "" +msgstr "未安裝 pip" #: ../../installing/index.rst:212 msgid "" "It is possible that ``pip`` does not get installed by default. One potential " "fix is::" msgstr "" +"``pip`` 沒有預設被安裝也是有可能的。一個潛在的解法是:\n" +"\n" +"::" #: ../../installing/index.rst:216 msgid "" @@ -308,10 +391,12 @@ msgid "" "python.org/tutorials/installing-packages/#install-pip-setuptools-and-" "wheel>`__" msgstr "" +"關於\\ `安裝 pip `__\\ ,這裡還有其他的資源。" #: ../../installing/index.rst:221 msgid "Installing binary extensions" -msgstr "" +msgstr "安裝二進制擴充 (binary extension)" #: ../../installing/index.rst:223 msgid "" @@ -319,6 +404,8 @@ msgid "" "users being expected to compile extension modules from source as part of the " "installation process." msgstr "" +"Python 基本上相當倚賴以原始碼為基礎的發布方式,也會期望使用者在安裝過程的某個" +"階段,從原始碼來編譯擴充模組。" #: ../../installing/index.rst:227 msgid "" @@ -328,6 +415,9 @@ msgid "" "users are more regularly able to install pre-built extensions rather than " "needing to build them themselves." msgstr "" +"隨著引入對二進制 ``wheel`` 格式的支援,以及透過 Python 套件索引能夠至少在 " +"Windows 和 Mac OS X 發布 wheel 檔案,這個問題預期將會逐漸消失,因為使用者將能" +"夠更頻繁地安裝預建置 (pre-built) 的擴充,而不再需要自己建置它們。" #: ../../installing/index.rst:233 msgid "" @@ -336,9 +426,14 @@ msgid "" "files may also help with obtaining other binary extensions without needing " "to build them locally." msgstr "" +"有一些解決方案,可用來安裝那些還無法以預建置的 ``wheel`` 檔案被使用的\\ `科學" +"軟體 `__\\ ,這些方案也有助於取得其他" +"的二進制擴充,且無需在本機對它們進行建置。" #: ../../installing/index.rst:240 msgid "" "`Python Packaging User Guide: Binary Extensions `__" msgstr "" +"`Python 封裝使用者指南:二進制擴充 `__" diff --git a/tutorial/modules.po b/tutorial/modules.po index 5f15f088f6..8141cda1ac 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-28 20:03+0800\n" -"PO-Revision-Date: 2021-06-06 22:22+0800\n" +"PO-Revision-Date: 2021-07-03 16:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -187,11 +187,11 @@ msgstr "" #: ../../tutorial/modules.rst:115 msgid "" -"If the module name is followed by :keyword:`!as`, then the name following " -":keyword:`!as` is bound directly to the imported module." +"If the module name is followed by :keyword:`!as`, then the name following :" +"keyword:`!as` is bound directly to the imported module." msgstr "" -"如果模組名稱後面出現 :keyword:`!as`\\ ,則 :keyword:`!as` 之後的名稱將直接和被 " -"import 模組綁定在一起。" +"如果模組名稱後面出現 :keyword:`!as`\\ ,則 :keyword:`!as` 之後的名稱將直接和" +"被 import 模組綁定在一起。" #: ../../tutorial/modules.rst:124 msgid "" @@ -386,7 +386,7 @@ msgid "" "the effects of optimization." msgstr "" "可以在 Python 指令上使用開關參數 (switch) :option:`-O` 或 :option:`-OO` 來減" -"小已編譯模組的大小。指令參數 ``-O`` 刪除 assert(斷言)陳述式,\\ ``-OO`` 同" +"小已編譯模組的大小。開關參數 ``-O`` 刪除 assert(斷言)陳述式,而 ``-OO`` 同" "時刪除 assert 陳述式和 __doc__ 字串。由於有些程式可能依賴於上述這些內容,因此" "只有在您知道自己在做什麼時,才應使用此參數。「已優化」模組有 ``opt-`` 標記," "且通常較小。未來的版本可能會改變優化的效果。" From 242f116617d8fd71ba7628693a9f51dafe2acffa Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Sun, 4 Jul 2021 01:19:25 +0800 Subject: [PATCH 04/39] Update license.po MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the term "副本". --- license.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/license.po b/license.po index 6f464d2cb7..2be2e9e830 100644 --- a/license.po +++ b/license.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2021-07-02 16:49+0800\n" +"PO-Revision-Date: 2021-07-04 01:18+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -457,8 +457,8 @@ msgid "" msgstr "" "如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`\\ 、\\ :mod:`posix`" "\\ 、\\ :mod:`ssl`\\ 、\\ :mod:`crypt` 模組會使用它來提升效能。此外,因為 " -"Windows 和 Mac OS X 的 Python 安裝程式可能包含 OpenSSL 函式庫的複本,所以我們" -"也在此收錄 OpenSSL 授權的複本:\n" +"Windows 和 Mac OS X 的 Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們" +"也在此收錄 OpenSSL 授權的副本:\n" "\n" "::" @@ -472,7 +472,7 @@ msgid "" "sources unless the build is configured ``--with-system-expat``::" msgstr "" "除非在建置 :mod:`pyexpat` 擴充時設定為 ``--with-system-expat``\\ ,否則該擴充" -"會用一個內含 expat 原始碼的複本來建置:\n" +"會用一個內含 expat 原始碼的副本來建置:\n" "\n" "::" @@ -486,7 +486,7 @@ msgid "" "sources unless the build is configured ``--with-system-libffi``::" msgstr "" "除非在建置 :mod:`_ctypes` 擴充時設定為 ``--with-system-libffi``\\ ,否則該擴" -"充會用一個內含 libffi 原始碼的複本來建置:\n" +"充會用一個內含 libffi 原始碼的副本來建置:\n" "\n" "::" @@ -501,7 +501,7 @@ msgid "" "the build::" msgstr "" "如果在系統上找到的 zlib 版本太舊以致於無法用於建置 :mod:`zlib` 擴充,則該擴充" -"會用一個內含 zlib 原始碼的複本來建置:\n" +"會用一個內含 zlib 原始碼的副本來建置:\n" "\n" "::" @@ -529,7 +529,7 @@ msgid "" "library unless the build is configured ``--with-system-libmpdec``::" msgstr "" "除非在建置 :mod:`_decimal` 模組時設定為 ``--with-system-libmpdec``\\ ,否則該" -"模組會用一個內含 libmpdec 函式庫的複本來建置:\n" +"模組會用一個內含 libmpdec 函式庫的副本來建置:\n" "\n" "::" From bac89b9fffe09c3fdd436b6f465ed2b1121d3fb7 Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Sun, 4 Jul 2021 01:30:50 +0800 Subject: [PATCH 05/39] Update installing/index. Fix the position of "(switch)". --- installing/index.po | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/installing/index.po b/installing/index.po index 48c64130e9..97085cd4e4 100644 --- a/installing/index.po +++ b/installing/index.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2021-07-04 01:14+0800\n" +"PO-Revision-Date: 2021-07-04 01:29+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -326,7 +326,7 @@ msgid "" "of ``pip``::" msgstr "" "在 Linux、Mac OS X 以及其他 POSIX 系統中,使用帶有版本編號的 Python 指令並結" -"合 ``-m`` 開關參數,來運行 ``pip`` 的適當副本:\n" +"合 ``-m`` 開關參數 (switch),來運行 ``pip`` 的適當副本:\n" "\n" "::" @@ -339,8 +339,7 @@ msgid "" "On Windows, use the ``py`` Python launcher in combination with the ``-m`` " "switch::" msgstr "" -"在 Windows 中,使用 Python 啟動指令 ``py`` 並結合 ``-m`` 開關參數 " -"(switch):\n" +"在 Windows 中,使用 Python 啟動指令 ``py`` 並結合 ``-m`` 開關參數:\n" "\n" "::" From 40a67b23bfc8bfd9f6f5f24028115585ff2b2384 Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Mon, 5 Jul 2021 21:20:04 +0800 Subject: [PATCH 06/39] Update index pages. Translate and update several index pages. --- c-api/index.po | 13 +++++++++---- howto/index.po | 15 ++++++++++----- library/index.po | 23 ++++++++++++++--------- reference/index.po | 16 ++++++++++++---- using/index.po | 12 ++++++++---- 5 files changed, 53 insertions(+), 26 deletions(-) diff --git a/c-api/index.po b/c-api/index.po index 1b599a1f16..7ee4874fe4 100644 --- a/c-api/index.po +++ b/c-api/index.po @@ -1,16 +1,17 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Leon H., 2017 # 豆豆 (Tommy Lin) , 2017 +# Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2017-11-24 09:04+0000\n" +"PO-Revision-Date: 2021-07-05 21:11+0800\n" "Last-Translator: 豆豆 (Tommy Lin) \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -19,10 +20,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.4.3\n" #: ../../c-api/index.rst:5 msgid "Python/C API Reference Manual" -msgstr "Python / C API 參考手冊" +msgstr "Python/C API 參考手冊" #: ../../c-api/index.rst:7 msgid "" @@ -31,3 +33,6 @@ msgid "" "`extending-index`, which describes the general principles of extension " "writing but does not document the API functions in detail." msgstr "" +"對於想要編寫擴充模組或是嵌入 Python 的 C 和 C++ 程式設計師們,這份手冊記錄" +"了可使用的 API(應用程式介面)。在\\ :ref:`extending-index`\\ 中也有相關的" +"內容,它描述了編寫擴充的一般原則,但並沒有詳細說明 API 函式。" diff --git a/howto/index.po b/howto/index.po index 695fe8328a..fb81532066 100644 --- a/howto/index.po +++ b/howto/index.po @@ -1,14 +1,15 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2015-12-09 17:51+0000\n" +"PO-Revision-Date: 2021-07-05 12:45+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,10 +18,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.4.3\n" #: ../../howto/index.rst:3 msgid "Python HOWTOs" -msgstr "" +msgstr "Python 如何達成任務" #: ../../howto/index.rst:5 msgid "" @@ -29,7 +31,10 @@ msgid "" "HOWTO collection, this collection is an effort to foster documentation " "that's more detailed than the Python Library Reference." msgstr "" +"「Python 如何達成任務 (HOWTOs)」是一系列的說明文件,其內容會盡量完整地涵蓋某" +"些單一、特定的主題。以 Linux 說明文件專案的 HOWTO 系列為模範,本系列的目標是" +"提供比 Python 函式庫參考手冊更實用的說明文件。" #: ../../howto/index.rst:11 msgid "Currently, the HOWTOs are:" -msgstr "" +msgstr "目前有以下這些任務指南:" diff --git a/library/index.po b/library/index.po index 6e4aed7b85..3a4cfbba2d 100644 --- a/library/index.po +++ b/library/index.po @@ -1,17 +1,18 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Liang-Bo Wang , 2015-2016 # Liang-Bo Wang , 2016 # Frank Jheng , 2015 +# Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2018-05-23 16:04+0000\n" +"PO-Revision-Date: 2021-07-04 22:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -20,6 +21,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 2.4.3\n" #: ../../library/index.rst:5 msgid "The Python Standard Library" @@ -32,9 +34,9 @@ msgid "" "library that is distributed with Python. It also describes some of the " "optional components that are commonly included in Python distributions." msgstr "" -":ref:`reference-index` 說明 Python 這門語言確切的文法及語意,而這份函式庫參考" -"手冊則是說明隨著 Python 一起發佈的標準函式庫,除此之外,其內容也包含一些時常" -"出現在 Python 發佈版本中的非必要套件。" +":ref:`reference-index`\\ 說明 Python 這門語言確切的文法及語意,而這份函式庫參" +"考手冊則是說明隨著 Python 一起發佈的標準函式庫,除此之外,其內容也包含一些時" +"常出現在 Python 發佈版本中的非必要套件。" #: ../../library/index.rst:13 msgid "" @@ -62,9 +64,9 @@ msgid "" "packages, so it may be necessary to use the packaging tools provided with " "the operating system to obtain some or all of the optional components." msgstr "" -"Python 的 Windows 安裝檔基本上包含整個標準函式庫,且通常也包含許多額外套件;" -"而類 Unix 作業系統方面,Python 則提供一系列的套件,對於某些非必要性的套件,可" -"能得使用該作業系統提供的套件管理工具來安裝。" +"Python 的 Windows 安裝檔基本上包含整個標準函式庫,且通常也包含許多附加的組" +"件;而在類 Unix 作業系統方面,Python 通常是以一系列的套件被安裝,因此對於某些" +"或全部的可選組件,可能都必須使用該作業系統提供的套件管理工具來安裝。" #: ../../library/index.rst:30 msgid "" @@ -73,3 +75,6 @@ msgid "" "packages and entire application development frameworks), available from the " "`Python Package Index `_." msgstr "" +"在標準函式庫之外,還有成千上萬且不斷增加的組件(從個別的程式、模組、套件到完" +"整的應用程式開發框架),可以從 `Python 套件索引 (Python Package Index) " +"`_ 中取得。" diff --git a/reference/index.po b/reference/index.po index 8c4f8e9bf0..ed5bb1c227 100644 --- a/reference/index.po +++ b/reference/index.po @@ -1,14 +1,15 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2015-12-09 17:51+0000\n" +"PO-Revision-Date: 2021-07-05 10:57+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,10 +18,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.4.3\n" #: ../../reference/index.rst:5 msgid "The Python Language Reference" -msgstr "" +msgstr "Python 語言參考手冊" #: ../../reference/index.rst:7 msgid "" @@ -33,3 +35,9 @@ msgid "" "picture of how to write a Python extension module, and the :ref:`c-api-" "index` describes the interfaces available to C/C++ programmers in detail." msgstr "" +"這份參考手冊會描述 Python 語言的語法及「核心語意」。它雖然簡潔,但也盡量保持" +"精確並完整。關於非必要的 (non-essential) 內建物件型別、內建函式及模組的語" +"意,在 :ref:`library-index` 中說明。關於此語言的非正式介紹,請參閱 :ref:" +"`tutorial-index`\\ 。對於 C 或 C++ 程式設計師,還有另外兩個手冊:\\ :ref:" +"`extending-index`\\ 以高階的視野說明如何編寫 Python 擴充模組,而 :ref:`c-" +"api-index`\\ 則詳細說明 C/C++ 程式設計師可用的介面。" diff --git a/using/index.po b/using/index.po index 5a86b03b08..8ef7886d23 100644 --- a/using/index.po +++ b/using/index.po @@ -1,14 +1,15 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2018-05-23 16:19+0000\n" +"PO-Revision-Date: 2021-07-05 12:25+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,10 +18,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.4.3\n" #: ../../using/index.rst:5 msgid "Python Setup and Usage" -msgstr "" +msgstr "Python 設定與使用" #: ../../using/index.rst:8 msgid "" @@ -28,3 +30,5 @@ msgid "" "setup of the Python environment on different platforms, the invocation of " "the interpreter and things that make working with Python easier." msgstr "" +"這部分的說明文件是關於在不同平台上設定 Python 環境的綜合資訊、直譯器的呼" +"叫,以及讓 Python 更容易使用的一些方法。" From 097e0bbf0adfa8e40e193674d26cae6b557fa3a3 Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Tue, 6 Jul 2021 12:12:46 +0800 Subject: [PATCH 07/39] Translate extending/index.po Complete translation. --- extending/index.po | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/extending/index.po b/extending/index.po index e2f91ceff0..5de432b8c9 100644 --- a/extending/index.po +++ b/extending/index.po @@ -1,14 +1,15 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2018-05-23 14:34+0000\n" +"PO-Revision-Date: 2021-07-06 12:10+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,10 +18,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.4.3\n" #: ../../extending/index.rst:5 msgid "Extending and Embedding the Python Interpreter" -msgstr "" +msgstr "擴充和嵌入 Python 直譯器" #: ../../extending/index.rst:7 msgid "" @@ -32,6 +34,11 @@ msgid "" "extension modules so that they can be loaded dynamically (at run time) into " "the interpreter, if the underlying operating system supports this feature." msgstr "" +"這份說明文件描述如何在 C 或 C++ 中編寫模組,並使用新模組來擴充 Python 直譯器" +"功能。那些模組不僅可以定義新的函式,也可以定義新的物件型別及其方法 (method)。" +"文件內容也會描述如何將 Python 直譯器嵌入另一個應用程式中,做為一種擴充語言 " +"(extension language) 使用。最後,它會展示如何編譯及連結擴充模組,使那些模組可" +"以動態地(在運行時)被載入到直譯器中,前提是底層作業系統有支援這個功能。" #: ../../extending/index.rst:15 msgid "" @@ -41,16 +48,21 @@ msgid "" "documents the existing object types, functions and modules (both built-in " "and written in Python) that give the language its wide application range." msgstr "" +"這份說明文件假設您具備 Python 的基礎知識。關於此語言的非正式介紹,請參閱 :" +"ref:`tutorial-index`\\ 。\\ :ref:`reference-index`\\ 給予此語言更為正式的定" +"義。\\ :ref:`library-index` 記錄了現有的物件型別、函式與(內建的,和以 " +"Python 編寫的)模組,該函式庫賦予此語言廣泛的應用範圍。" #: ../../extending/index.rst:21 msgid "" "For a detailed description of the whole Python/C API, see the separate :ref:" "`c-api-index`." msgstr "" +"關於完整的 Python/C API 詳細介紹,請參閱另外一份 :ref:`c-api-index`\\ 。" #: ../../extending/index.rst:26 msgid "Recommended third party tools" -msgstr "" +msgstr "推薦的第三方工具" #: ../../extending/index.rst:28 msgid "" @@ -60,12 +72,19 @@ msgid "" "swig.org>`_ and `Numba `_ offer both simpler and " "more sophisticated approaches to creating C and C++ extensions for Python." msgstr "" +"這份指南僅涵蓋了此 CPython 版本所提供的、用以建立擴充的基本工具。第三方工具," +"例如 `Cython `_\\ 、\\ `cffi `_\\ 、\\ `SWIG `_ 和 `Numba `_\\ ,提供了更為簡單及更為複雜的多種方法,來為 Python 建立 C 和 C ++ 擴" +"充。" #: ../../extending/index.rst:40 msgid "" "`Python Packaging User Guide: Binary Extensions `_" msgstr "" +"`Python 封裝使用者指南:二進制擴充 `_" #: ../../extending/index.rst:38 msgid "" @@ -73,10 +92,13 @@ msgid "" "simplify the creation of binary extensions, but also discusses the various " "reasons why creating an extension module may be desirable in the first place." msgstr "" +"Python 封裝使用者指南 (Python Packaging User Guide) 不僅涵蓋了數個可以用來簡" +"化二進制擴充建立過程的工具,也會討論為何建立一個擴充模組可能會是您的優先考" +"量。" #: ../../extending/index.rst:45 msgid "Creating extensions without third party tools" -msgstr "" +msgstr "不使用第三方工具建立擴充" #: ../../extending/index.rst:47 msgid "" @@ -85,10 +107,12 @@ msgid "" "those tools, rather than being a recommended way to create your own C " "extensions." msgstr "" +"本指南中的這一節將說明,在沒有第三方工具的協助下,如何建立 C 和 C ++ 擴充。它" +"主要是寫給使用那些工具的創作者們,而不是讓你建立自己的 C 擴充的推薦方法。" #: ../../extending/index.rst:63 msgid "Embedding the CPython runtime in a larger application" -msgstr "" +msgstr "在更大的應用程式中嵌入 CPython 運行環境 (runtime)" #: ../../extending/index.rst:65 msgid "" @@ -97,3 +121,6 @@ msgid "" "CPython runtime inside a larger application. This section covers some of the " "details involved in doing that successfully." msgstr "" +"有時候,比起要建立一個擴充,使其在 Python 直譯器中可作為主應用程式運行,更讓" +"人期待的方法是將 CPython 運行環境嵌入至一個更大的應用程式中。本節將涵蓋一些要" +"成功完成此任務所涉及的細節。" From e417bc2acd31cb173806a243f700754538046bd3 Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Tue, 6 Jul 2021 22:23:42 +0800 Subject: [PATCH 08/39] Update index pages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Setup" -> "設置" --- extending/index.po | 6 +++--- reference/index.po | 4 ++-- sphinx.po | 4 ++-- using/index.po | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/extending/index.po b/extending/index.po index 5de432b8c9..0432daa610 100644 --- a/extending/index.po +++ b/extending/index.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2021-07-06 12:10+0800\n" +"PO-Revision-Date: 2021-07-06 22:18+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -121,6 +121,6 @@ msgid "" "CPython runtime inside a larger application. This section covers some of the " "details involved in doing that successfully." msgstr "" -"有時候,比起要建立一個擴充,使其在 Python 直譯器中可作為主應用程式運行,更讓" -"人期待的方法是將 CPython 運行環境嵌入至一個更大的應用程式中。本節將涵蓋一些要" +"有時候,相較於建立一個擴充,使其在 Python 直譯器中可作為主應用程式運行,還不" +"如將 CPython 運行環境嵌入至一個更大的應用程式中,更令人讚賞。本節將涵蓋一些要" "成功完成此任務所涉及的細節。" diff --git a/reference/index.po b/reference/index.po index ed5bb1c227..dd38e047ee 100644 --- a/reference/index.po +++ b/reference/index.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2021-07-05 10:57+0800\n" +"PO-Revision-Date: 2021-07-06 22:07+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -37,7 +37,7 @@ msgid "" msgstr "" "這份參考手冊會描述 Python 語言的語法及「核心語意」。它雖然簡潔,但也盡量保持" "精確並完整。關於非必要的 (non-essential) 內建物件型別、內建函式及模組的語" -"意,在 :ref:`library-index` 中說明。關於此語言的非正式介紹,請參閱 :ref:" +"意,則在 :ref:`library-index` 中說明。關於此語言的非正式介紹,請參閱 :ref:" "`tutorial-index`\\ 。對於 C 或 C++ 程式設計師,還有另外兩個手冊:\\ :ref:" "`extending-index`\\ 以高階的視野說明如何編寫 Python 擴充模組,而 :ref:`c-" "api-index`\\ 則詳細說明 C/C++ 程式設計師可用的介面。" diff --git a/sphinx.po b/sphinx.po index 04ffdf1363..d248fcd14b 100644 --- a/sphinx.po +++ b/sphinx.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2021-06-02 12:28+0800\n" +"PO-Revision-Date: 2021-07-06 22:22+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -90,7 +90,7 @@ msgstr "描述語法及語言要素" #: ../../tools/templates/indexcontent.html:21 msgid "Python Setup and Usage" -msgstr "Python 的安裝與使用" +msgstr "Python 的設置與使用" #: ../../tools/templates/indexcontent.html:22 msgid "how to use Python on different platforms" diff --git a/using/index.po b/using/index.po index 8ef7886d23..42a7d17034 100644 --- a/using/index.po +++ b/using/index.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2021-07-05 12:25+0800\n" +"PO-Revision-Date: 2021-07-06 22:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -22,7 +22,7 @@ msgstr "" #: ../../using/index.rst:5 msgid "Python Setup and Usage" -msgstr "Python 設定與使用" +msgstr "Python 的設置與使用" #: ../../using/index.rst:8 msgid "" From e0ae8ac10c863bdf2df350f087eb5e63a9d0d00b Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Wed, 7 Jul 2021 19:59:18 +0800 Subject: [PATCH 09/39] Update sphinx.po MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glossary: "術語表" --- sphinx.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx.po b/sphinx.po index d248fcd14b..8a4911c39c 100644 --- a/sphinx.po +++ b/sphinx.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2021-07-06 22:22+0800\n" +"PO-Revision-Date: 2021-07-07 19:58+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -166,7 +166,7 @@ msgstr "全部函式、類別、術語" #: ../../tools/templates/indexcontent.html:46 msgid "Glossary" -msgstr "詞彙表" +msgstr "術語表" #: ../../tools/templates/indexcontent.html:47 msgid "the most important terms explained" From 7a26ffad531ee91a48f301201f724dc4b5d894af Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Thu, 19 Aug 2021 16:32:36 +0800 Subject: [PATCH 10/39] Translate glossary.po Complete translation. --- glossary.po | 985 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 824 insertions(+), 161 deletions(-) diff --git a/glossary.po b/glossary.po index 4d6efa66f8..ae39b45ae2 100644 --- a/glossary.po +++ b/glossary.po @@ -1,12 +1,14 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. +# Translators: +# Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2018-07-15 18:56+0800\n" +"PO-Revision-Date: 2021-08-18 14:00+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -14,28 +16,32 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"Last-Translator: Steven Hsu \n" +"X-Generator: Poedit 2.4.3\n" #: ../../glossary.rst:5 msgid "Glossary" -msgstr "" +msgstr "術語表" #: ../../glossary.rst:10 msgid "``>>>``" -msgstr "" +msgstr "``>>>``" #: ../../glossary.rst:12 msgid "" "The default Python prompt of the interactive shell. Often seen for code " "examples which can be executed interactively in the interpreter." msgstr "" +"互動式 shell 的預設 Python 提示字元。常見於能在直譯器中以互動方式被執行的程式" +"碼範例。" #: ../../glossary.rst:14 msgid "``...``" -msgstr "" +msgstr "``...``" #: ../../glossary.rst:16 msgid "Can refer to:" -msgstr "" +msgstr "可以表示:" #: ../../glossary.rst:18 msgid "" @@ -44,14 +50,17 @@ msgid "" "delimiters (parentheses, square brackets, curly braces or triple quotes), or " "after specifying a decorator." msgstr "" +"在一個被縮排的程式碼區塊、在一對匹配的左右定界符(delimiter,例如括號、方括" +"號、花括號或三引號)內部,或是在指定一個裝飾器 (decorator) 之後,要輸入程式碼" +"時,互動式 shell 顯示的預設 Python 提示字元。" #: ../../glossary.rst:23 msgid "The :const:`Ellipsis` built-in constant." -msgstr "" +msgstr "內建常數 :const:`Ellipsis`\\ 。" #: ../../glossary.rst:24 msgid "2to3" -msgstr "" +msgstr "2to3" #: ../../glossary.rst:26 msgid "" @@ -59,6 +68,9 @@ msgid "" "most of the incompatibilities which can be detected by parsing the source " "and traversing the parse tree." msgstr "" +"一個試著將 Python 2.x 程式碼轉換為 Python 3.x 程式碼的工具,它是透過處理大部" +"分的不相容性來達成此目的,而這些不相容性能夠透過剖析原始碼和遍歷剖析樹而被檢" +"測出來。" #: ../../glossary.rst:30 msgid "" @@ -66,10 +78,12 @@ msgid "" "entry point is provided as :file:`Tools/scripts/2to3`. See :ref:`2to3-" "reference`." msgstr "" +"2to3 在可以標準函式庫中以 :mod:`lib2to3` 被使用;它提供了一個獨立的入口點," +"在 :file:`Tools/scripts/2to3`\\ 。請參閱 :ref:`2to3-reference`。" #: ../../glossary.rst:33 msgid "abstract base class" -msgstr "" +msgstr "abstract base class(抽象基底類別)" #: ../../glossary.rst:35 msgid "" @@ -84,16 +98,27 @@ msgid "" "module), import finders and loaders (in the :mod:`importlib.abc` module). " "You can create your own ABCs with the :mod:`abc` module." msgstr "" +"抽象基底類別(又稱為 ABC)提供了一種定義介面的方法,作為 :term:`duck-typing`" +"\\ (鴨子型別)的補充。其他類似的技術,像是 :func:`hasattr`\\ ,則顯得笨拙或" +"是帶有細微的錯誤(例如使用\\ :ref:`魔術方法 (magic method) `" +"\\ )。ABC 採用虛擬的 subclass(子類別),它們並不繼承自另一個 class,但仍可" +"被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參閱 :mod:`abc` 模組的說" +"明文件。Python 有許多內建的 ABC,用於資料結構(在 :mod:`collections.abc` 模" +"組)、數字(在 :mod:`numbers` 模組)、串流(在 :mod:`io` 模組)及 import 尋檢" +"器和載入器(在 :mod:`importlib.abc` 模組)。你可以使用 :mod:`abc` 模組建立自" +"己的 ABC。" #: ../../glossary.rst:46 msgid "annotation" -msgstr "" +msgstr "annotation(註釋)" #: ../../glossary.rst:48 msgid "" "A label associated with a variable, a class attribute or a function " "parameter or return value, used by convention as a :term:`type hint`." msgstr "" +"一個與變數、class(類別)屬性、函式的參數或回傳值相關聯的標籤。照慣例,它被用" +"來作為 :term:`type hint`\\ (型別提示)。" #: ../../glossary.rst:52 msgid "" @@ -102,22 +127,28 @@ msgid "" "in the :attr:`__annotations__` special attribute of modules, classes, and " "functions, respectively." msgstr "" +"在運行時 (runtime),區域變數的註釋無法被存取,但全域變數、class 屬性和函式的" +"註解,會分別被儲存在模組、class 和函式的 :attr:`__annotations__` 特殊屬性中。" #: ../../glossary.rst:58 msgid "" "See :term:`variable annotation`, :term:`function annotation`, :pep:`484` " "and :pep:`526`, which describe this functionality." msgstr "" +"請參閱 :term:`variable annotation`\\ 、\\ :term:`function annotation`" +"\\ 、\\ :pep:`484` 和 :pep:`526`,這些章節皆有此功能的說明。" #: ../../glossary.rst:60 msgid "argument" -msgstr "" +msgstr "argument(引數)" #: ../../glossary.rst:62 msgid "" "A value passed to a :term:`function` (or :term:`method`) when calling the " "function. There are two kinds of argument:" msgstr "" +"呼叫函式時被傳遞給 :term:`function`\\ (或 :term:`method`\\ )的值。引數有兩" +"種:" #: ../../glossary.rst:65 msgid "" @@ -126,6 +157,12 @@ msgid "" "by ``**``. For example, ``3`` and ``5`` are both keyword arguments in the " "following calls to :func:`complex`::" msgstr "" +":dfn:`關鍵字引數 (keyword argument)`\\ :在函式呼叫中,以識別字(identifier," +"例如 ``name=``\\ )開頭的引數, 或是以 ``**`` 後面 dictionary(字典)內的值被" +"傳遞的引數。例如,``3`` 和 ``5`` 都是以下 :func:`complex` 呼叫中的關鍵字引" +"數:\n" +"\n" +"::" #: ../../glossary.rst:73 msgid "" @@ -134,6 +171,11 @@ msgid "" "be passed as elements of an :term:`iterable` preceded by ``*``. For example, " "``3`` and ``5`` are both positional arguments in the following calls::" msgstr "" +":dfn:`位置引數 (positional argument)`\\ :不是關鍵字引數的引數。位置引數可在" +"一個引數列表的起始處出現,和(或)作為 ``*`` 之後的 :term:`iterable`\\ (可疊" +"代物件)中的元素被傳遞。例如,``3`` 和 ``5`` 都是以下呼叫中的位置引數:\n" +"\n" +"::" #: ../../glossary.rst:82 msgid "" @@ -142,6 +184,9 @@ msgid "" "Syntactically, any expression can be used to represent an argument; the " "evaluated value is assigned to the local variable." msgstr "" +"引數會被指定給函式主體中的附名區域變數。關於支配這個指定過程的規則,請參閱" +"\\ :ref:`calls`\\ 章節。在語法上,任何運算式都可以被用來表示一個引數;其評估" +"值會被指定給區域變數。" #: ../../glossary.rst:87 msgid "" @@ -149,10 +194,12 @@ msgid "" "difference between arguments and parameters `, " "and :pep:`362`." msgstr "" +"另請參閱術語表的 :term:`parameter`\\ (參數)條目、常見問題中的\\ :ref:`引數" +"和參數之間的差異 `\\ ,以及 :pep:`362`\\ 。" #: ../../glossary.rst:90 msgid "asynchronous context manager" -msgstr "" +msgstr "asynchronous context manager(非同步情境管理器)" #: ../../glossary.rst:92 msgid "" @@ -160,10 +207,13 @@ msgid "" "statement by defining :meth:`__aenter__` and :meth:`__aexit__` methods. " "Introduced by :pep:`492`." msgstr "" +"一個可以控制 :keyword:`async with` 陳述式中所見環境的物件,而它是透過定義 :" +"meth:`__aenter__` 和 :meth:`__aexit__` method(方法)來控制的。於 :pep:`492` " +"中介紹。" #: ../../glossary.rst:95 msgid "asynchronous generator" -msgstr "" +msgstr "asynchronous generator(非同步產生器)" #: ../../glossary.rst:97 msgid "" @@ -172,6 +222,10 @@ msgid "" "that it contains :keyword:`yield` expressions for producing a series of " "values usable in an :keyword:`async for` loop." msgstr "" +"一個會回傳 :term:`asynchronous generator iterator`\\ (非同步產生器疊代器)的" +"函式。它看起來像一個以 :keyword:`async def` 定義的協程函式 (coroutine " +"function),但不同的是它包含了 :keyword:`yield` 運算式,能生成一系列可用於 :" +"keyword:`async for` 迴圈的值。" #: ../../glossary.rst:102 msgid "" @@ -179,20 +233,26 @@ msgid "" "*asynchronous generator iterator* in some contexts. In cases where the " "intended meaning isn't clear, using the full terms avoids ambiguity." msgstr "" +"這個術語通常用來表示一個非同步產生器函式,但在某些情境中,也可能是表示\\ *非" +"同步產生器疊代器 (asynchronous generator iterator)*。萬一想表達的意思不夠清" +"楚,那就使用完整的術語,以避免歧義。" #: ../../glossary.rst:106 msgid "" "An asynchronous generator function may contain :keyword:`await` expressions " "as well as :keyword:`async for`, and :keyword:`async with` statements." msgstr "" +"一個非同步產生器函式可能包含 :keyword:`await` 運算式,以及 :keyword:`async " +"for` 和 :keyword:`async with` 陳述式。" #: ../../glossary.rst:109 msgid "asynchronous generator iterator" -msgstr "" +msgstr "asynchronous generator iterator(非同步產生器疊代器)" #: ../../glossary.rst:111 msgid "An object created by a :term:`asynchronous generator` function." msgstr "" +"一個由 :term:`asynchronous generator`\\ (非同步產生器)函式所建立的物件。" #: ../../glossary.rst:113 msgid "" @@ -201,6 +261,9 @@ msgid "" "of the asynchronous generator function until the next :keyword:`yield` " "expression." msgstr "" +"這是一個 :term:`asynchronous iterator`\\ (非同步疊代器),當它以 :meth:" +"`__anext__` method(方法)被呼叫時,會回傳一個可等待物件 (awaitable object)," +"該物件將執行非同步產生器的函式主體,直到遇到下一個 :keyword:`yield` 運算式。" #: ../../glossary.rst:118 msgid "" @@ -210,10 +273,14 @@ msgid "" "with another awaitable returned by :meth:`__anext__`, it picks up where it " "left off. See :pep:`492` and :pep:`525`." msgstr "" +"每個 :keyword:`yield` 會暫停處理程序,並記住位置執行狀態(包括區域變數及擱置" +"中的 try 陳述式)。當\\ *非同步產生器疊代器*\\ 以另一個被 :meth:`__anext__` " +"回傳的可等待物件有效地回復時,它會從停止的地方繼續執行。請參閱 :pep:`492` " +"和 :pep:`525`。" #: ../../glossary.rst:123 msgid "asynchronous iterable" -msgstr "" +msgstr "asynchronous iterable(非同步可疊代物件)" #: ../../glossary.rst:125 msgid "" @@ -221,10 +288,13 @@ msgid "" "return an :term:`asynchronous iterator` from its :meth:`__aiter__` method. " "Introduced by :pep:`492`." msgstr "" +"一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它的 :meth:" +"`__aiter__` method(方法)回傳一個 :term:`asynchronous iterator`\\ (非同步疊" +"代器)。於 :pep:`492` 中介紹。" #: ../../glossary.rst:128 msgid "asynchronous iterator" -msgstr "" +msgstr "asynchronous iterator(非同步疊代器)" #: ../../glossary.rst:130 msgid "" @@ -234,10 +304,14 @@ msgid "" "meth:`__anext__` method until it raises a :exc:`StopAsyncIteration` " "exception. Introduced by :pep:`492`." msgstr "" +"一個實作 :meth:`__aiter__` 和 :meth:`__anext__` method(方法)的物件。\\ " +"``__anext__`` 必須回傳一個 :term:`awaitable`\\ (可等待物件)。\\ :keyword:" +"`async for` 會解析非同步疊代器的 :meth:`__anext__` method 所回傳的可等待物" +"件,直到它引發 :exc:`StopAsyncIteration` 例外。於 :pep:`492` 中介紹。" #: ../../glossary.rst:135 msgid "attribute" -msgstr "" +msgstr "attribute(屬性)" #: ../../glossary.rst:137 msgid "" @@ -245,10 +319,12 @@ msgid "" "expressions. For example, if an object *o* has an attribute *a* it would be " "referenced as *o.a*." msgstr "" +"一個與某物件相關聯的值,該值能透過使用點分隔運算式 (dotted expression) 的名稱" +"被參照。例如,如果物件 *o* 有一個屬性 *a*,則該屬性能以 *o.a* 被參照。" #: ../../glossary.rst:140 msgid "awaitable" -msgstr "" +msgstr "awaitable(可等待物件)" #: ../../glossary.rst:142 msgid "" @@ -256,20 +332,25 @@ msgid "" "term:`coroutine` or an object with an :meth:`__await__` method. See also :" "pep:`492`." msgstr "" +"一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一個 :term:" +"`coroutine`\\ (協程),或是一個有 :meth:`__await__` method(方法)的物件。另" +"請參閱 :pep:`492`。" #: ../../glossary.rst:145 msgid "BDFL" -msgstr "" +msgstr "BDFL" #: ../../glossary.rst:147 msgid "" "Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." msgstr "" +"Benevolent Dictator For Life(終身仁慈獨裁者),又名 `Guido van Rossum " +"`_\\ ,Python 的創造者。" #: ../../glossary.rst:149 msgid "binary file" -msgstr "" +msgstr "binary file(二進制檔案)" #: ../../glossary.rst:151 msgid "" @@ -279,16 +360,23 @@ msgid "" "stdout.buffer`, and instances of :class:`io.BytesIO` and :class:`gzip." "GzipFile`." msgstr "" +"一個能夠讀取和寫入 :term:`bytes-like objects `\\ (類位元" +"組串物件)的 :term:`file object`\\ (檔案物件)。二進制檔案的例子有:以二進制" +"模式(``'rb'``、``'wb'`` 或 ``'rb+'``)開啟的檔案、\\ :data:`sys.stdin." +"buffer`、\\ :data:`sys.stdout.buffer`,以及 :class:`io.BytesIO` 和 :class:" +"`gzip.GzipFile` 實例。" #: ../../glossary.rst:158 msgid "" "See also :term:`text file` for a file object able to read and write :class:" "`str` objects." msgstr "" +"另請參閱 :term:`text file`\\ (文字檔案),它是一個能夠讀取和寫入 :class:" +"`str` 物件的檔案物件。" #: ../../glossary.rst:160 msgid "bytes-like object" -msgstr "" +msgstr "bytes-like object(類位元組串物件)" #: ../../glossary.rst:162 msgid "" @@ -299,6 +387,11 @@ msgid "" "with binary data; these include compression, saving to a binary file, and " "sending over a socket." msgstr "" +"一個支援\\ :ref:`bufferobjects`\\ 且能夠匯出 C-:term:`contiguous` 緩衝區的物" +"件。這包括所有的 :class:`bytes`、\\ :class:`bytearray` 和 :class:`array." +"array` 物件,以及許多常見的 :class:`memoryview` 物件。類位元組串物件可用於處" +"理二進制資料的各種運算;這些運算包括壓縮、儲存至二進制檔案和透過插座 " +"(socket) 發送。" #: ../../glossary.rst:169 msgid "" @@ -309,10 +402,15 @@ msgid "" "immutable objects (\"read-only bytes-like objects\"); examples of these " "include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." msgstr "" +"有些運算需要二進制資料是可變的。說明文件通常會將這些物件稱為「可讀寫的類位元" +"組串物件」。可變緩衝區的物件包括 :class:`bytearray`,以及 :class:`bytearray` " +"的 :class:`memoryview`。其他的運算需要讓二進制資料被儲存在不可變物件(「唯讀" +"的類位元組串物件」)中;這些物件包括 :class:`bytes`,以及 :class:`bytes` 物件" +"的 :class:`memoryview`。" #: ../../glossary.rst:177 msgid "bytecode" -msgstr "" +msgstr "bytecode(位元組碼)" #: ../../glossary.rst:179 msgid "" @@ -325,36 +423,59 @@ msgid "" "expected to work between different Python virtual machines, nor to be stable " "between Python releases." msgstr "" +"Python 的原始碼會被編譯成位元組碼,它是 Python 程式在 CPython 直譯器中的內部" +"表示法。該位元組碼也會被暫存在 ``.pyc`` 檔案中,以便第二次執行同一個檔案時能" +"夠更快速(可以不用從原始碼重新編譯為位元組碼)。這種「中間語言 (intermediate " +"language)」據說是運行在一個 :term:`virtual machine`\\ (虛擬機器)上,該虛擬" +"機器會執行與每個位元組碼對應的機器碼 (machine code)。要注意的是,位元組碼理論" +"上是無法在不同的 Python 虛擬機器之間運作的,也不能在不同版本的 Python 之間保" +"持穩定。" #: ../../glossary.rst:189 msgid "" "A list of bytecode instructions can be found in the documentation for :ref:" "`the dis module `." msgstr "" +"位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" + +#: ../../glossary.rst:190 +msgid "callback" +msgstr "callback(回呼)" #: ../../glossary.rst:191 -msgid "class" +msgid "" +"A subroutine function which is passed as an argument to be executed at some " +"point in the future." msgstr "" +"作為引數被傳遞的一個副程式 (subroutine) 函式,會在未來的某個時間點被執行。" + +#: ../../glossary.rst:192 +msgid "class" +msgstr "class(類別)" #: ../../glossary.rst:193 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." msgstr "" +"一個用於建立使用者定義物件的模板。Class 的定義通常會包含 method(方法)的定" +"義,這些 method 可以在 class 的實例上進行操作。" #: ../../glossary.rst:196 msgid "class variable" -msgstr "" +msgstr "class variable(類別變數)" #: ../../glossary.rst:198 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." msgstr "" +"一個在 class 中被定義,且應該只能在 class 層次(意即不是在 class 的實例中)被" +"修改的變數。" #: ../../glossary.rst:200 msgid "coercion" -msgstr "" +msgstr "coercion(強制轉型)" #: ../../glossary.rst:202 msgid "" @@ -367,10 +488,16 @@ msgid "" "compatible types would have to be normalized to the same value by the " "programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``." msgstr "" +"在涉及兩個不同型別引數的操作過程中,將某一種型別的實例換為另一種型別的隱式轉" +"換 (implicit conversion) 過程。例如,``int(3.15)`` 會將浮點數轉換為整數 " +"``3``,但在 ``3+4.5`` 中,每個引數是不同的型別(一個 int,一個 float),而這" +"兩個引數必須在被轉換為相同的型別之後才能相加,否則就會引發 :exc:`TypeError`" +"\\ 。如果沒有強制轉型,即使所有的引數型別皆相容,它們都必須要由程式設計師正規" +"化 (normalize) 為相同的值,例如,要用 ``float(3)+4.5`` 而不能只是 ``3+4.5``。" #: ../../glossary.rst:210 msgid "complex number" -msgstr "" +msgstr "complex number(複數)" #: ../../glossary.rst:212 msgid "" @@ -384,20 +511,30 @@ msgid "" "Use of complex numbers is a fairly advanced mathematical feature. If you're " "not aware of a need for them, it's almost certain you can safely ignore them." msgstr "" +"一個我們熟悉的實數系統的擴充,在此所有數字都會被表示為一個實部和一個虛部之" +"和。虛數就是虛數單位(``-1`` 的平方根)的實數倍,此單位通常在數學中被寫為 " +"``i``,在工程學中被寫為 ``j``。Python 內建了對複數的支援,它是用後者的記法來" +"表示複數;虛部會帶著一個後綴的 ``j`` 被編寫,例如 ``3+1j``。若要將 :mod:" +"`math` 模組內的工具等效地用於複數,請使用 :mod:`cmath` 模組。複數的使用是一個" +"相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" +"忽略它們。" #: ../../glossary.rst:222 msgid "context manager" -msgstr "" +msgstr "context manager(情境管理器)" #: ../../glossary.rst:224 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " "by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." msgstr "" +"一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" +"`__enter__` 和 :meth:`__exit__` method(方法)來控制的。請參閱 :pep:`343`" +"\\ 。" #: ../../glossary.rst:227 msgid "context variable" -msgstr "" +msgstr "context variable(情境變數)" #: ../../glossary.rst:229 msgid "" @@ -408,10 +545,15 @@ msgid "" "variables is to keep track of variables in concurrent asynchronous tasks. " "See :mod:`contextvars`." msgstr "" +"一個變數,其值可以根據上下文的情境而有所不同。這類似執行緒區域儲存區 (Thread-" +"Local Storage),在其中,一個變數在每個執行緒可能具有不同的值。然而,關於情境" +"變數,在一個執行緒中可能會有多個情境,而情境變數的主要用途,是在並行的非同步" +"任務 (concurrent asynchronous task) 中,對於變數狀態的追蹤。請參閱 :mod:" +"`contextvars`\\ 。" #: ../../glossary.rst:236 msgid "contiguous" -msgstr "" +msgstr "contiguous(連續的)" #: ../../glossary.rst:240 msgid "" @@ -423,10 +565,16 @@ msgid "" "visiting items in order of memory address. However, in Fortran contiguous " "arrays, the first index varies the fastest." msgstr "" +"如果一個緩衝區是 *C-contiguous* 或是 *Fortran contiguous*,則它會確切地被視為" +"是連續的。零維 (zero-dimensional) 的緩衝區都是 C 及 Fortran contiguous。在一" +"維 (one-dimensional) 陣列中,各項目必須在記憶體中彼此相鄰地排列,而其索引順序" +"是從零開始遞增。在多維的 (multidimensional) C-contiguous 陣列中,按記憶體位址" +"的順序訪問各個項目時,最後一個索引的變化最快。然而,在 Fortran contiguous 陣" +"列中,第一個索引的變化最快。" #: ../../glossary.rst:248 msgid "coroutine" -msgstr "" +msgstr "coroutine(協程)" #: ../../glossary.rst:250 msgid "" @@ -435,10 +583,13 @@ msgid "" "entered, exited, and resumed at many different points. They can be " "implemented with the :keyword:`async def` statement. See also :pep:`492`." msgstr "" +"協程是副程式 (subroutine) 的一種更為廣義的形式。副程式是在某個時間點被進入並" +"在另一個時間點被退出。協程可以在許多不同的時間點被進入、退出和回復。它們能夠" +"以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`\\ 。" #: ../../glossary.rst:255 msgid "coroutine function" -msgstr "" +msgstr "coroutine function(協程函式)" #: ../../glossary.rst:257 msgid "" @@ -447,10 +598,13 @@ msgid "" "keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords. " "These were introduced by :pep:`492`." msgstr "" +"一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能以 :keyword:" +"`async def` 陳述式被定義,並可能會包含 :keyword:`await`\\ 、\\ :keyword:" +"`async for` 和 :keyword:`async with` 關鍵字。這些關鍵字於 :pep:`492` 中介紹。" #: ../../glossary.rst:262 msgid "CPython" -msgstr "" +msgstr "CPython" #: ../../glossary.rst:264 msgid "" @@ -459,10 +613,13 @@ msgid "" "is used when necessary to distinguish this implementation from others such " "as Jython or IronPython." msgstr "" +"Python 程式語言的標準實作 (canonical implementation),被發布在 `python.org " +"`_ 上。「CPython」這個術語在必要時被使用,以區分此實" +"作與其它語言的實作,例如 Jython 或 IronPython。" #: ../../glossary.rst:268 msgid "decorator" -msgstr "" +msgstr "decorator(裝飾器)" #: ../../glossary.rst:270 msgid "" @@ -470,12 +627,18 @@ msgid "" "transformation using the ``@wrapper`` syntax. Common examples for " "decorators are :func:`classmethod` and :func:`staticmethod`." msgstr "" +"一個函式,它會回傳另一個函式,通常它會使用 ``@wrapper`` 語法,被應用為一種函" +"式的變換 (function transformation)。裝飾器的常見範例是 :func:`classmethod` " +"和 :func:`staticmethod`\\ 。" #: ../../glossary.rst:274 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" msgstr "" +"裝飾器語法只是語法糖。以下兩個函式定義在語義上是等效的:\n" +"\n" +"::" #: ../../glossary.rst:285 msgid "" @@ -483,10 +646,12 @@ msgid "" "the documentation for :ref:`function definitions ` and :ref:`class " "definitions ` for more about decorators." msgstr "" +"Class(類別)也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參" +"閱\\ :ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" #: ../../glossary.rst:288 msgid "descriptor" -msgstr "" +msgstr "descriptor(描述器)" #: ../../glossary.rst:290 msgid "" @@ -500,15 +665,25 @@ msgid "" "including functions, methods, properties, class methods, static methods, and " "reference to super classes." msgstr "" +"任何定義了 :meth:`__get__`\\ 、\\ :meth:`__set__` 或 :meth:`__delete__` " +"method(方法)的物件。當一個 class(類別)屬性是一個描述器時,它的特殊連結行" +"為會在屬性查找時被觸發。通常,使用 *a.b* 來取得、設定或刪除某個屬性時,會在 " +"*a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器, 則相對應" +"的描述器 method 會被呼叫。對描述器的理解是深入理解 Python 的關鍵,因為它們是" +"許多功能的基礎,這些功能包括函式、method、屬性 (property)、class method、靜" +"態 method,以及對 super class(父類別)的參照。" #: ../../glossary.rst:300 msgid "" -"For more information about descriptors' methods, see :ref:`descriptors`." +"For more information about descriptors' methods, see :ref:`descriptors` or " +"the :ref:`Descriptor How To Guide `." msgstr "" +"關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" +"使用指南 `\\ 。" #: ../../glossary.rst:301 msgid "dictionary" -msgstr "" +msgstr "dictionary(字典)" #: ../../glossary.rst:303 msgid "" @@ -516,10 +691,28 @@ msgid "" "can be any object with :meth:`__hash__` and :meth:`__eq__` methods. Called a " "hash in Perl." msgstr "" +"一個關聯陣列 (associative array),其中任意的鍵會被映射到值。鍵可以是任何帶" +"有 :meth:`__hash__` 和 :meth:`__eq__` method(方法)的物件。在 Perl 中被稱為" +"雜湊 (hash)。" + +#: ../../glossary.rst:304 +msgid "dictionary comprehension" +msgstr "dictionary comprehension(字典綜合運算)" + +#: ../../glossary.rst:305 +msgid "" +"A compact way to process all or part of the elements in an iterable and " +"return a dictionary with the results. ``results = {n: n ** 2 for n in " +"range(10)}`` generates a dictionary containing key ``n`` mapped to value ``n " +"** 2``. See :ref:`comprehensions`." +msgstr "" +"一種緊密的方法,用來處理一個可疊代物件中的全部或部分元素,並將處理結果以一個" +"字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" +"了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`\\ 。" #: ../../glossary.rst:306 msgid "dictionary view" -msgstr "" +msgstr "dictionary view(字典檢視)" #: ../../glossary.rst:308 msgid "" @@ -529,10 +722,14 @@ msgid "" "reflects these changes. To force the dictionary view to become a full list " "use ``list(dictview)``. See :ref:`dict-views`." msgstr "" +"從 :meth:`dict.keys`\\ 、\\ :meth:`dict.values` 及 :meth:`dict.items` 回傳的" +"物件被稱為字典檢視。它們提供了字典中項目的動態檢視,這表示當字典有變動時,該" +"檢視會反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " +"``list(dictview)``。請參閱\\ :ref:`dict-views`\\ 。" #: ../../glossary.rst:314 msgid "docstring" -msgstr "" +msgstr "docstring(說明字串)" #: ../../glossary.rst:316 msgid "" @@ -542,10 +739,14 @@ msgid "" "class, function or module. Since it is available via introspection, it is " "the canonical place for documentation of the object." msgstr "" +"一個在 class(類別)、函式或模組中,作為第一個運算式出現的字串文本。雖然它在" +"套件執行時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組的 :" +"attr:`__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此" +"它是物件的說明文件存放的標準位置。" #: ../../glossary.rst:322 msgid "duck-typing" -msgstr "" +msgstr "duck-typing(鴨子型別)" #: ../../glossary.rst:324 msgid "" @@ -559,10 +760,18 @@ msgid "" "term:`abstract base classes `.) Instead, it typically " "employs :func:`hasattr` tests or :term:`EAFP` programming." msgstr "" +"一種程式設計風格,它不是藉由檢查一個物件的型別來確定它是否具有正確的介面;取" +"而代之的是,method(方法)或屬性會單純地被呼叫或使用。(「如果它看起來像一隻" +"鴨子而且叫起來像一隻鴨子,那麼它一定是一隻鴨子。」)因為強調介面而非特定型" +"別,精心設計的程式碼能讓多形替代 (polymorphic substitution) 來增進它的靈活" +"性。鴨子型別要避免使用 :func:`type` 或 :func:`isinstance` 進行測試。(但是請" +"注意,鴨子型別可以用\\ :term:`抽象基底類別 (abstract base class) ` 來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:" +"`EAFP` 程式設計風格。" #: ../../glossary.rst:333 msgid "EAFP" -msgstr "" +msgstr "EAFP" #: ../../glossary.rst:335 msgid "" @@ -573,10 +782,15 @@ msgid "" "statements. The technique contrasts with the :term:`LBYL` style common to " "many other languages such as C." msgstr "" +"Easier to ask for forgiveness than permission.(請求寬恕比請求許可更容易。)" +"這種常見的 Python 編碼風格會先假設有效的鍵或屬性的存在,並在該假設被推翻時再" +"捕獲例外。這種乾淨且快速的風格,其特色是存在許多的 :keyword:`try` 和 :" +"keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" +"格形成了對比。" #: ../../glossary.rst:341 msgid "expression" -msgstr "" +msgstr "expression(運算式)" #: ../../glossary.rst:343 msgid "" @@ -588,20 +802,27 @@ msgid "" "expressions, such as :keyword:`while`. Assignments are also statements, not " "expressions." msgstr "" +"一段可以被評估並求值的語法。換句話說,一個運算式就是文字、名稱、屬性存取、運" +"算子或函式呼叫等運算式元件的累積,而這些元件都能回傳一個值。與許多其他語言不" +"同的是,並非所有的 Python 語言構造都是運算式。另外有一些 :term:`statement`\\ " +"(陳述式)不能被用作運算式,例如 :keyword:`while`\\ 。賦值 (assignment) 也是" +"陳述式,而不是運算式。" #: ../../glossary.rst:350 msgid "extension module" -msgstr "" +msgstr "extension module(擴充模組)" #: ../../glossary.rst:352 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." msgstr "" +"一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" +"互動。" #: ../../glossary.rst:354 msgid "f-string" -msgstr "" +msgstr "f-string(f 字串)" #: ../../glossary.rst:356 msgid "" @@ -609,10 +830,12 @@ msgid "" "strings\" which is short for :ref:`formatted string literals `. " "See also :pep:`498`." msgstr "" +"以 ``'f'`` 或 ``'F'`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" +"化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`\\ 。" #: ../../glossary.rst:359 msgid "file object" -msgstr "" +msgstr "file object(檔案物件)" #: ../../glossary.rst:361 msgid "" @@ -623,6 +846,11 @@ msgid "" "output, in-memory buffers, sockets, pipes, etc.). File objects are also " "called :dfn:`file-like objects` or :dfn:`streams`." msgstr "" +"一個能夠將檔案導向 (file-oriented) API(以 :meth:`read()` 或 :meth:`write()` " +"等 method)展現給底層資源的物件。根據檔案物件被建立的方式,它能夠協調對真實磁" +"碟檔案或是其他類型的儲存器或通訊裝置(例如標準輸入/輸出、記憶體內緩衝區、插" +"座 (socket)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔案物件 " +"(file-like object)` 或\\ :dfn:`串流 (stream)`\\ 。" #: ../../glossary.rst:369 msgid "" @@ -632,24 +860,29 @@ msgid "" "The canonical way to create a file object is by using the :func:`open` " "function." msgstr "" +"實際上,有三種檔案物件:原始的\\ :term:`二進制檔案 `\\ 、緩衝的" +"\\ :term:`二進制檔案 `\\ 和\\ :term:`文字檔案 `\\ 。" +"它們的介面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:" +"`open` 函式。" #: ../../glossary.rst:374 msgid "file-like object" -msgstr "" +msgstr "file-like object(類檔案物件)" #: ../../glossary.rst:376 msgid "A synonym for :term:`file object`." -msgstr "" +msgstr ":term:`file object`\\ (檔案物件)的同義字。" #: ../../glossary.rst:377 msgid "finder" -msgstr "" +msgstr "finder(尋檢器)" #: ../../glossary.rst:379 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" +"一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" #: ../../glossary.rst:382 msgid "" @@ -657,14 +890,18 @@ msgid "" "` for use with :data:`sys.meta_path`, and :term:`path " "entry finders ` for use with :data:`sys.path_hooks`." msgstr "" +"從 Python 3.3 開始,有兩種類型的尋檢器:\\ :term:`元路徑尋檢器 (meta path " +"finder) ` 會使用 :data:`sys.meta_path`\\ ,而\\ :term:`路徑" +"項目尋檢器 (path entry finder) ` 會使用 :data:`sys." +"path_hooks`\\ 。" #: ../../glossary.rst:386 msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." -msgstr "" +msgstr "請參閱 :pep:`302`\\ 、\\ :pep:`420` 和 :pep:`451` 以了解更多細節。" #: ../../glossary.rst:387 msgid "floor division" -msgstr "" +msgstr "floor division(向下取整除法)" #: ../../glossary.rst:389 msgid "" @@ -674,10 +911,14 @@ msgid "" "division. Note that ``(-11) // 4`` is ``-3`` because that is ``-2.75`` " "rounded *downward*. See :pep:`238`." msgstr "" +"向下無條件捨去到最接近整數的數學除法。向下取整除法的運算子是 ``//``。例如,運" +"算式 ``11 // 4`` 的計算結果為 ``2``,與 float(浮點數)真除法所回傳的 " +"``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " +"*向下*\\ 無條件捨去。請參閱 :pep:`238`\\ 。" #: ../../glossary.rst:394 msgid "function" -msgstr "" +msgstr "function(函式)" #: ../../glossary.rst:396 msgid "" @@ -686,14 +927,18 @@ msgid "" "execution of the body. See also :term:`parameter`, :term:`method`, and the :" "ref:`function` section." msgstr "" +"一連串的陳述式,它能夠向呼叫者回傳一些值。它也可以被傳遞零個或多個\\ :term:`" +"引數 `\\ ,這些引數可被使用於函式本體的執行。另請參閱 :term:" +"`parameter`\\ (參數)、\\ :term:`method`\\ (方法),以及\\ :ref:`function`" +"\\ 章節。" #: ../../glossary.rst:400 msgid "function annotation" -msgstr "" +msgstr "function annotation(函式註釋)" #: ../../glossary.rst:402 msgid "An :term:`annotation` of a function parameter or return value." -msgstr "" +msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" #: ../../glossary.rst:404 msgid "" @@ -701,37 +946,47 @@ msgid "" "for example, this function is expected to take two :class:`int` arguments " "and is also expected to have an :class:`int` return value::" msgstr "" +"函式註釋通常被使用於\\ :term:`型別提示 `\\ :例如,這個函式預期會" +"得到兩個 :class:`int` 引數,並會有一個 :class:`int` 回傳值:\n" +"\n" +"::" #: ../../glossary.rst:412 msgid "Function annotation syntax is explained in section :ref:`function`." -msgstr "" +msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" #: ../../glossary.rst:414 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality." msgstr "" +"請參閱 :term:`variable annotation` 和 :pep:`484`\\ ,皆有此功能的描述。" #: ../../glossary.rst:416 msgid "__future__" -msgstr "" +msgstr "__future__" #: ../../glossary.rst:418 msgid "" -"A pseudo-module which programmers can use to enable new language features " -"which are not compatible with the current interpreter." -msgstr "" - -#: ../../glossary.rst:421 -msgid "" -"By importing the :mod:`__future__` module and evaluating its variables, you " -"can see when a new feature was first added to the language and when it " -"becomes the default::" -msgstr "" +"A :ref:`future statement `, ``from __future__ import ``, " +"directs the compiler to compile the current module using syntax or semantics " +"that will become standard in a future release of Python. The :mod:" +"`__future__` module documents the possible values of *feature*. By " +"importing this module and evaluating its variables, you can see when a new " +"feature was first added to the language and when it will (or did) become the " +"default::" +msgstr "" +":ref:`future 陳述式 `\\ :``from __future__ import ``,會指" +"示編譯器使用那些在 Python 未來的發布版本中將成為標準的語法或語義,來編譯當前" +"的模組。而 :mod:`__future__` 模組則記錄了 *feature(功能)*\\ 可能的值。透過 " +"import 此模組並對其變數求值,你可以看見一個新的功能是何時首次被新增到此語言" +"中,以及它何時將會(或已經)成為預設的功能:\n" +"\n" +"::" #: ../../glossary.rst:428 msgid "garbage collection" -msgstr "" +msgstr "garbage collection(垃圾回收)" #: ../../glossary.rst:430 msgid "" @@ -740,10 +995,14 @@ msgid "" "that is able to detect and break reference cycles. The garbage collector " "can be controlled using the :mod:`gc` module." msgstr "" +"當記憶體不再被使用時,將其釋放的過程。Python 執行垃圾回收,是透過參照計數 " +"(reference counting),以及一個能夠檢測和中斷參照循環 (reference cycle) 的循環" +"垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" +"組對其進行控制。" #: ../../glossary.rst:436 msgid "generator" -msgstr "" +msgstr "generator(產生器)" #: ../../glossary.rst:438 msgid "" @@ -752,6 +1011,9 @@ msgid "" "producing a series of values usable in a for-loop or that can be retrieved " "one at a time with the :func:`next` function." msgstr "" +"一個會回傳 :term:`generator iterator`\\ (產生器疊代器)的函式。它看起來像一" +"個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," +"這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" #: ../../glossary.rst:443 msgid "" @@ -759,14 +1021,16 @@ msgid "" "iterator* in some contexts. In cases where the intended meaning isn't " "clear, using the full terms avoids ambiguity." msgstr "" +"這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" +"代器*\\ 。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" #: ../../glossary.rst:446 msgid "generator iterator" -msgstr "" +msgstr "generator iterator(產生器疊代器)" #: ../../glossary.rst:448 msgid "An object created by a :term:`generator` function." -msgstr "" +msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" #: ../../glossary.rst:450 msgid "" @@ -775,10 +1039,13 @@ msgid "" "statements). When the *generator iterator* resumes, it picks up where it " "left off (in contrast to functions which start fresh on every invocation)." msgstr "" +"每個 :keyword:`yield` 會暫停處理程序,並記住位置執行狀態(包括區域變數及擱置" +"中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" +"那些每次調用時都要重新開始的函式有所不同)。" #: ../../glossary.rst:457 msgid "generator expression" -msgstr "" +msgstr "generator expression(產生器運算式)" #: ../../glossary.rst:459 msgid "" @@ -787,10 +1054,15 @@ msgid "" "optional :keyword:`!if` clause. The combined expression generates values " "for an enclosing function::" msgstr "" +"一個會回傳疊代器的運算式。它看起來像一個正常的運算式,後面接著一個 :keyword:" +"`!for` 子句,該子句定義了迴圈變數、範圍以及一個選擇性的 :keyword:`!if` 子句。" +"該組合運算式會為外層函數產生多個值:\n" +"\n" +"::" #: ../../glossary.rst:466 msgid "generic function" -msgstr "" +msgstr "generic function(泛型函式)" #: ../../glossary.rst:468 msgid "" @@ -798,24 +1070,50 @@ msgid "" "for different types. Which implementation should be used during a call is " "determined by the dispatch algorithm." msgstr "" +"一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" +"用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" #: ../../glossary.rst:472 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." msgstr "" +"另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、\\ :func:" +"`functools.singledispatch` 裝飾器和 :pep:`443`\\ 。" + +#: ../../glossary.rst:473 +msgid "generic type" +msgstr "generic type(泛型型別)" + +#: ../../glossary.rst:474 +msgid "" +"A :term:`type` that can be parameterized; typically a container like :class:" +"`list`. Used for :term:`type hints ` and :term:`annotations " +"`." +msgstr "" +"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一個容器," +"像是 :class:`list`\\ (串列)。它被用於\\ :term:`型別提示 `\\ 和" +"\\ :term:`註釋 `\\ 。" #: ../../glossary.rst:475 -msgid "GIL" +msgid "" +"See :pep:`483` for more details, and :mod:`typing` or :ref:`generic alias " +"type ` for its uses." msgstr "" +"請參閱 :pep:`483` 了解更多細節,以及 :mod:`typing` 或 :ref:`泛型別名型別 " +"(generic alias type) ` 了解其用途。" + +#: ../../glossary.rst:476 +msgid "GIL" +msgstr "GIL" #: ../../glossary.rst:477 msgid "See :term:`global interpreter lock`." -msgstr "" +msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" #: ../../glossary.rst:478 msgid "global interpreter lock" -msgstr "" +msgstr "global interpreter lock(全域直譯器鎖)" #: ../../glossary.rst:480 msgid "" @@ -827,6 +1125,12 @@ msgid "" "multi-threaded, at the expense of much of the parallelism afforded by multi-" "processor machines." msgstr "" +":term:`CPython` 直譯器所使用的機制,用以確保每次都只有一個執行緒能執行 " +"Python 的 :term:`bytecode`\\ (位元組碼)。透過使物件模型(包括關鍵的內建型" +"別,如 :class:`dict`\\ )自動地避免並行存取 (concurrent access) 的危險,此機" +"制可以簡化 CPython 的實作。鎖定整個直譯器,會使直譯器更容易成為多執行緒 " +"(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " +"(parallelism)。" #: ../../glossary.rst:489 msgid "" @@ -835,6 +1139,9 @@ msgid "" "such as compression or hashing. Also, the GIL is always released when doing " "I/O." msgstr "" +"然而,有些擴充模組,無論是標準的或是第三方的,它們被設計成在執行壓縮或雜湊等" +"計算密集 (computationally-intensive) 的任務時,可以解除 GIL。另外,在執行 I/" +"O 時,GIL 總是會被解除。" #: ../../glossary.rst:494 msgid "" @@ -844,10 +1151,13 @@ msgid "" "that overcoming this performance issue would make the implementation much " "more complicated and therefore costlier to maintain." msgstr "" +"過去對於建立「無限制執行緒」直譯器(以更高的精細度鎖定共享資料的直譯器)的努" +"力並未成功,因為在一般的單一處理器情況下,效能會有所損失。一般認為,若要克服" +"這個效能問題,會使實作變得複雜許多,進而付出更高的維護成本。" #: ../../glossary.rst:500 msgid "hash-based pyc" -msgstr "" +msgstr "hash-based pyc(雜湊架構的 pyc)" #: ../../glossary.rst:502 msgid "" @@ -855,10 +1165,12 @@ msgid "" "of the corresponding source file to determine its validity. See :ref:`pyc-" "invalidation`." msgstr "" +"一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" +"間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`\\ 。" #: ../../glossary.rst:505 msgid "hashable" -msgstr "" +msgstr "hashable(可雜湊的)" #: ../../glossary.rst:507 msgid "" @@ -867,12 +1179,18 @@ msgid "" "other objects (it needs an :meth:`__eq__` method). Hashable objects which " "compare equal must have the same hash value." msgstr "" +"如果一個物件有一個雜湊值,該值在其生命週期中永不改變(它需要一個 :meth:" +"`__hash__` method),且可與其他物件互相比較(它需要一個 :meth:`__eq__` " +"method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的多個可雜湊物件," +"它們必須擁有相同的雜湊值。" #: ../../glossary.rst:512 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." msgstr "" +"可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" +"的成員,因為這些資料結構都在其內部使用了雜湊值。" #: ../../glossary.rst:515 msgid "" @@ -883,10 +1201,15 @@ msgid "" "default. They all compare unequal (except with themselves), and their hash " "value is derived from their :func:`id`." msgstr "" +"大多數的 Python 不可變內建物件都是可雜湊的;可變的容器(例如 list 或 " +"dictionary)並不是;而不可變的容器(例如 tuple(值組)和 frozenset),只有當" +"它們的元素是可雜湊的,它們本身才是可雜湊的。若物件是使用者自定 class(類別)" +"的實例,則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們" +"與自己比較),而它們的雜湊值則是衍生自它們的 :func:`id`\\ 。" #: ../../glossary.rst:522 msgid "IDLE" -msgstr "" +msgstr "IDLE" #: ../../glossary.rst:524 msgid "" @@ -894,10 +1217,12 @@ msgid "" "and interpreter environment which ships with the standard distribution of " "Python." msgstr "" +"Python 的 Integrated Development Environment(整合開發環境)。IDLE 是一個基本" +"的編輯器和直譯器環境,它和 Python 的標準發行版本一起被提供。" #: ../../glossary.rst:527 msgid "immutable" -msgstr "" +msgstr "immutable(不可變物件)" #: ../../glossary.rst:529 msgid "" @@ -907,10 +1232,13 @@ msgid "" "in places where a constant hash value is needed, for example as a key in a " "dictionary." msgstr "" +"一個具有固定值的物件。不可變物件包括數字、字串和 tuple(值組)。這類物件是不" +"能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" +"定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" #: ../../glossary.rst:534 msgid "import path" -msgstr "" +msgstr "import path(匯入路徑)" #: ../../glossary.rst:536 msgid "" @@ -919,30 +1247,38 @@ msgid "" "list of locations usually comes from :data:`sys.path`, but for subpackages " "it may also come from the parent package's ``__path__`` attribute." msgstr "" +"一個位置(或\\ :term:`路徑項目 `\\ )的列表,而那些位置就是在 " +"import 模組時,會被 :term:`path based finder`\\ (基於路徑的尋檢器)搜尋模組" +"的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`\\ ,但對於子套" +"件 (subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" #: ../../glossary.rst:541 msgid "importing" -msgstr "" +msgstr "importing(匯入)" #: ../../glossary.rst:543 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." msgstr "" +"一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " +"程式碼使用。" #: ../../glossary.rst:545 msgid "importer" -msgstr "" +msgstr "importer(匯入器)" #: ../../glossary.rst:547 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." msgstr "" +"一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" +"`loader`\\ (載入器)物件。" #: ../../glossary.rst:549 msgid "interactive" -msgstr "" +msgstr "interactive(互動的)" #: ../../glossary.rst:551 msgid "" @@ -952,10 +1288,14 @@ msgid "" "selecting it from your computer's main menu). It is a very powerful way to " "test out new ideas or inspect modules and packages (remember ``help(x)``)." msgstr "" +"Python 有一個互動式直譯器,這表示你可以在直譯器的提示字元輸入陳述式和運算式," +"立即執行它們並且看到它們的結果。只要啟動 ``python``,不需要任何引數(可能藉由" +"從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" +"記住help(x))。" #: ../../glossary.rst:557 msgid "interpreted" -msgstr "" +msgstr "interpreted(直譯的)" #: ../../glossary.rst:559 msgid "" @@ -966,10 +1306,14 @@ msgid "" "shorter development/debug cycle than compiled ones, though their programs " "generally also run more slowly. See also :term:`interactive`." msgstr "" +"Python 是一種直譯語言,而不是編譯語言,不過這個區分可能有些模糊,因為有位元組" +"碼 (bytecode) 編譯器的存在。這表示原始檔案可以直接被運行,而不需明確地建立另" +"一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" +"它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" #: ../../glossary.rst:566 msgid "interpreter shutdown" -msgstr "" +msgstr "interpreter shutdown(直譯器關閉)" #: ../../glossary.rst:568 msgid "" @@ -982,16 +1326,23 @@ msgid "" "relies on may not function anymore (common examples are library modules or " "the warnings machinery)." msgstr "" +"當 Python 直譯器被要求關閉時,它會進入一個特殊階段,在此它逐漸釋放所有被配置" +"的資源,例如模組和各種關鍵內部結構。它也會多次呼叫\\ :term:`垃圾回收器 " +"(garbage collector) `\\ 。這能夠觸發使用者自定的解構函式 " +"(destructor) 或弱引用的回呼 (weakref callback),並執行其中的程式碼。在關閉階" +"段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" +"子是函式庫模組或是警告機制)。" #: ../../glossary.rst:577 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" +"直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" #: ../../glossary.rst:579 msgid "iterable" -msgstr "" +msgstr "iterable(可疊代物件)" #: ../../glossary.rst:581 msgid "" @@ -1000,8 +1351,14 @@ msgid "" "and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" "`file objects `, and objects of any classes you define with an :" "meth:`__iter__` method or with a :meth:`__getitem__` method that implements :" -"term:`Sequence` semantics." +"term:`Sequence ` semantics." msgstr "" +"一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" +"是 :class:`list`\\ 、\\ :class:`str` 和 :class:`tuple`\\ )和某些非序列型別," +"像是 :class:`dict`\\ 、\\ :term:`檔案物件 `\\ ,以及你所定義的任" +"何 class(類別)物件,只要那些 class 有 :meth:`__iter__` method(方法)或是實" +"作 :term:`Sequence `\\ (序列)語意的 :meth:`__getitem__` method," +"該物件就是可疊代物件。" #: ../../glossary.rst:588 msgid "" @@ -1015,10 +1372,17 @@ msgid "" "unnamed variable to hold the iterator for the duration of the loop. See " "also :term:`iterator`, :term:`sequence`, and :term:`generator`." msgstr "" +"可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 (:func:`zip`" +"\\ 、\\ :func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函式 :func:" +"`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行一遍 (one " +"pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理疊代器物" +"件。``for`` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變數,用" +"於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、\\ :term:" +"`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" #: ../../glossary.rst:598 msgid "iterator" -msgstr "" +msgstr "iterator(疊代器)" #: ../../glossary.rst:600 msgid "" @@ -1037,14 +1401,25 @@ msgid "" "iterator will just return the same exhausted iterator object used in the " "previous iteration pass, making it appear like an empty container." msgstr "" +"一個表示資料流的物件。重複地呼叫疊代器的 :meth:`~iterator.__next__` " +"method(或是將它傳遞給內建函式 :func:`next`\\ )會依序回傳資料流中的各項目。" +"當不再有資料時,則會引發 :exc:`StopIteration` 例外。此時,該疊代器物件已被用" +"盡,而任何對其 :meth:`__next__` method 的進一步呼叫,都只會再次引發 :exc:" +"`StopIteration`\\ 。疊代器必須有一個 :meth:`__iter__` method,它會回傳疊代器" +"物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊代物件" +"的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程式碼。" +"一個容器物件(像是 :class:`list`\\ )在每次你將它傳遞給 :func:`iter` 函式或" +"在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試此" +"事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" +"件,使其看起來就像一個空的容器。" #: ../../glossary.rst:615 msgid "More information can be found in :ref:`typeiter`." -msgstr "" +msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" #: ../../glossary.rst:616 msgid "key function" -msgstr "" +msgstr "key function(鍵函式)" #: ../../glossary.rst:618 msgid "" @@ -1052,6 +1427,9 @@ msgid "" "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " "produce a sort key that is aware of locale specific sort conventions." msgstr "" +"鍵函式或理序函式 (collation function) 是一個可呼叫 (callable) 函式,它會回傳" +"一個用於排序 (sorting) 或定序 (ordering) 的值。例如,\\ :func:`locale." +"strxfrm` 被用來產生一個了解區域特定排序慣例的排序鍵。" #: ../../glossary.rst:623 msgid "" @@ -1060,6 +1438,10 @@ msgid "" "meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq." "nlargest`, and :func:`itertools.groupby`." msgstr "" +"Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包括 :" +"func:`min`\\ 、\\ :func:`max`\\ 、\\ :func:`sorted`\\ 、\\ :meth:`list.sort`" +"\\ 、\\ :func:`heapq.merge`\\ 、\\ :func:`heapq.nsmallest`\\ 、\\ :func:" +"`heapq.nlargest` 和 :func:`itertools.groupby`\\ 。" #: ../../glossary.rst:629 msgid "" @@ -1072,18 +1454,24 @@ msgid "" "methodcaller`. See the :ref:`Sorting HOW TO ` for examples of " "how to create and use key functions." msgstr "" +"有幾種方法可以建立一個鍵函式。例如,\\ :meth:`str.lower` method(方法)可以作" +"為不分大小寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被" +"建造,例如 ``lambda r: (r[0], r[2])``。另外,\\ :mod:`operator` 模組提供了三" +"個鍵函式的建構函式 (constructor):\\ :func:`~operator.attrgetter`\\ 、\\ :" +"func:`~operator.itemgetter` 和 :func:`~operator.methodcaller`\\ 。關於如何建" +"立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 `\\ 。" #: ../../glossary.rst:637 msgid "keyword argument" -msgstr "" +msgstr "keyword argument(關鍵字引數)" #: ../../glossary.rst:639 ../../glossary.rst:916 msgid "See :term:`argument`." -msgstr "" +msgstr "請參閱 :term:`argument`\\ (引數)。" #: ../../glossary.rst:640 msgid "lambda" -msgstr "" +msgstr "lambda" #: ../../glossary.rst:642 msgid "" @@ -1091,10 +1479,13 @@ msgid "" "is evaluated when the function is called. The syntax to create a lambda " "function is ``lambda [parameters]: expression``" msgstr "" +"由單一 :term:`expression`\\ (運算式)所組成的一個匿名行內函式 (inline " +"function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " +"[parameters]: expression``\\ 。" #: ../../glossary.rst:645 msgid "LBYL" -msgstr "" +msgstr "LBYL" #: ../../glossary.rst:647 msgid "" @@ -1103,6 +1494,9 @@ msgid "" "approach and is characterized by the presence of many :keyword:`if` " "statements." msgstr "" +"Look before you leap.(三思而後行。)這種編碼風格會在進行呼叫或查找之前,明確" +"地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" +"keyword:`if` 陳述式的存在。" #: ../../glossary.rst:652 msgid "" @@ -1112,10 +1506,15 @@ msgid "" "thread removes *key* from *mapping* after the test, but before the lookup. " "This issue can be solved with locks or by using the EAFP approach." msgstr "" +"在一個多執行緒環境中,LBYL 方式會因為在「三思」和「後行」之間引入了競爭條件 " +"(race condition),而存在風險。例如以下程式碼 ``if key in mapping: return " +"mapping[key]``,如果另一個執行緒在測試之後但在查找之前,從 *mapping* 中移除" +"了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" +"解決。" #: ../../glossary.rst:657 msgid "list" -msgstr "" +msgstr "list(串列)" #: ../../glossary.rst:659 msgid "" @@ -1123,10 +1522,13 @@ msgid "" "array in other languages than to a linked list since access to elements is " "O(1)." msgstr "" +"一個 Python 內建的 :term:`sequence` (序列)。儘管它的名字是 list,它其實更類" +"似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" +"素的時間複雜度是 O(1)。" #: ../../glossary.rst:662 msgid "list comprehension" -msgstr "" +msgstr "list comprehension(串列綜合運算)" #: ../../glossary.rst:664 msgid "" @@ -1136,10 +1538,15 @@ msgid "" "numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is " "optional. If omitted, all elements in ``range(256)`` are processed." msgstr "" +"一種緊密的方法,用來處理一個序列中的全部或部分元素,並將處理結果以一個 list " +"回傳。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會" +"產生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 " +"(0x..)。\\ :keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所" +"有元素都會被處理。" #: ../../glossary.rst:670 msgid "loader" -msgstr "" +msgstr "loader(載入器)" #: ../../glossary.rst:672 msgid "" @@ -1148,18 +1555,22 @@ msgid "" "`302` for details and :class:`importlib.abc.Loader` for an :term:`abstract " "base class`." msgstr "" +"一個能夠載入模組的物件。它必須定義一個名為 :meth:`load_module` 的 method(方" +"法)。載入器通常是被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱 :pep:" +"`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" +"`importlib.abc.Loader`\\ 。" #: ../../glossary.rst:676 msgid "magic method" -msgstr "" +msgstr "magic method(魔術方法)" #: ../../glossary.rst:680 msgid "An informal synonym for :term:`special method`." -msgstr "" +msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" #: ../../glossary.rst:681 msgid "mapping" -msgstr "" +msgstr "mapping(對映)" #: ../../glossary.rst:683 msgid "" @@ -1170,10 +1581,16 @@ msgid "" "`collections.defaultdict`, :class:`collections.OrderedDict` and :class:" "`collections.Counter`." msgstr "" +"一個容器物件,它支援任意鍵的查找,且能實作 :ref:`abstract base classes(抽象" +"基底類別) `\\ 中,\\ :class:" +"`~collections.abc.Mapping` 或 :class:`~collections.abc.MutableMapping` 所指定" +"的 method(方法)。範例包括 :class:`dict`\\ 、\\ :class:`collections." +"defaultdict`\\ 、\\ :class:`collections.OrderedDict` 和 :class:`collections." +"Counter`\\ 。" #: ../../glossary.rst:689 msgid "meta path finder" -msgstr "" +msgstr "meta path finder(元路徑尋檢器)" #: ../../glossary.rst:691 msgid "" @@ -1181,16 +1598,21 @@ msgid "" "finders are related to, but different from :term:`path entry finders `." msgstr "" +"一種經由搜尋 :data:`sys.meta_path` 而回傳的 :term:`finder`\\ (尋檢器)。元路" +"徑尋檢器與\\ :term:`路徑項目尋檢器 (path entry finder) ` " +"相關但是不同。" #: ../../glossary.rst:695 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" +"關於元路徑尋檢器實作的 method(方法),請參閱 :class:`importlib.abc." +"MetaPathFinder`\\ 。" #: ../../glossary.rst:697 msgid "metaclass" -msgstr "" +msgstr "metaclass(元類別)" #: ../../glossary.rst:699 msgid "" @@ -1204,14 +1626,21 @@ msgid "" "access, adding thread-safety, tracking object creation, implementing " "singletons, and many other tasks." msgstr "" +"一種 class(類別)的 class。Class 定義過程會建立一個 class 名稱、一個 class " +"dictionary(字典),以及一個 base class(基底類別)的列表。Metaclass 負責接受" +"這三個引數,並建立該 class。大多數的物件導向程式語言會提供一個預設的實作。" +"Python 的特別之處在於它能夠建立自訂的 metaclass。大部分的使用者從未需要此工" +"具,但是當需要時,metaclass 可以提供強大且優雅的解決方案。它們已被用於記錄屬" +"性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" +"他的任務。" #: ../../glossary.rst:709 msgid "More information can be found in :ref:`metaclasses`." -msgstr "" +msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" #: ../../glossary.rst:710 msgid "method" -msgstr "" +msgstr "method(方法)" #: ../../glossary.rst:712 msgid "" @@ -1220,10 +1649,14 @@ msgid "" "first :term:`argument` (which is usually called ``self``). See :term:" "`function` and :term:`nested scope`." msgstr "" +"一個在 class(類別)本體內被定義的函式。如果 method 作為其 class 實例的一個屬" +"性被呼叫,則它將會得到該實例物件成為它的第一個 :term:`argument`\\ (引數)" +"(此引數通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:" +"`nested scope`\\ (巢狀作用域)。" #: ../../glossary.rst:716 msgid "method resolution order" -msgstr "" +msgstr "method resolution order(方法解析順序)" #: ../../glossary.rst:718 msgid "" @@ -1232,10 +1665,13 @@ msgid "" "www.python.org/download/releases/2.3/mro/>`_ for details of the algorithm " "used by the Python interpreter since the 2.3 release." msgstr "" +"方法解析順序是在查找某個成員的過程中,base class(基底類別)被搜尋的順序。關" +"於第 2.3 版至今,Python 直譯器所使用的演算法細節,請參閱 `Python 2.3 版方法解" +"析順序 `_\\ 。" #: ../../glossary.rst:722 msgid "module" -msgstr "" +msgstr "module(模組)" #: ../../glossary.rst:724 msgid "" @@ -1243,42 +1679,49 @@ msgid "" "have a namespace containing arbitrary Python objects. Modules are loaded " "into Python by the process of :term:`importing`." msgstr "" +"一個擔任 Python 程式碼的組織單位 (organizational unit) 的物件。模組有一個命名" +"空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" +"至 Python。" #: ../../glossary.rst:728 msgid "See also :term:`package`." -msgstr "" +msgstr "另請參閱 :term:`package`\\ (套件)。" #: ../../glossary.rst:729 msgid "module spec" -msgstr "" +msgstr "module spec(模組規格)" #: ../../glossary.rst:731 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." msgstr "" +"一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." +"machinery.ModuleSpec` 的一個實例。" #: ../../glossary.rst:733 msgid "MRO" -msgstr "" +msgstr "MRO" #: ../../glossary.rst:735 msgid "See :term:`method resolution order`." -msgstr "" +msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" #: ../../glossary.rst:736 msgid "mutable" -msgstr "" +msgstr "mutable(可變物件)" #: ../../glossary.rst:738 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." msgstr "" +"可變物件可以改變它們的值,但維持它們的 :func:`id`\\ 。另請參閱 :term:" +"`immutable`\\ (不可變物件)。" #: ../../glossary.rst:740 msgid "named tuple" -msgstr "" +msgstr "named tuple(附名值組)" #: ../../glossary.rst:742 msgid "" @@ -1286,6 +1729,9 @@ msgid "" "tuple and whose indexable elements are also accessible using named " "attributes. The type or class may have other features as well." msgstr "" +"術語「named tuple(附名值組)」是指從 tuple 繼承的任何型別或 class(類別)," +"且它的可索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以" +"具有其他的特性。" #: ../../glossary.rst:746 msgid "" @@ -1293,6 +1739,10 @@ msgid "" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." "float_info`::" msgstr "" +"有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " +"回傳的值。另一個例子是 :data:`sys.float_info`\\ :\n" +"\n" +"::" #: ../../glossary.rst:757 msgid "" @@ -1303,10 +1753,16 @@ msgid "" "func:`collections.namedtuple`. The latter technique also adds some extra " "methods that may not be found in hand-written or built-in named tuples." msgstr "" +"有些 named tuple 是內建型別(如上例)。或者,一個 named tuple 也可以從一個正" +"規的 class 定義來建立,只要該 class 是繼承自 :class:`tuple`\\ ,且定義了附名" +"欄位 (named field) 即可。這類的 class 可以手工編寫,也可以使用工廠函式 " +"(factory function) :func:`collections.namedtuple` 來建立。後者技術也增加了一" +"些額外的 method(方法),這些 method 可能是在手寫或內建的 named tuple 中,無" +"法找到的。" #: ../../glossary.rst:764 msgid "namespace" -msgstr "" +msgstr "namespace(命名空間)" #: ../../glossary.rst:766 msgid "" @@ -1320,10 +1776,17 @@ msgid "" "func:`itertools.islice` makes it clear that those functions are implemented " "by the :mod:`random` and :mod:`itertools` modules, respectively." msgstr "" +"變數被儲存的地方。命名空間是以 dictionary(字典)被實作。有區域的、全域的及內" +"建的命名空間,而在物件中(在 method 中)也有巢狀的命名空間。命名空間藉由防止" +"命名衝突,來支援模組化。例如,函式 :func:`builtins.open <.open>` 和 :func:" +"`os.open` 是透過它們的命名空間來區分彼此。命名空間也藉由明確地區分是哪個模組" +"在實作一個函式,來增進可讀性及可維護性。例如,寫出 :func:`random.seed` 或 :" +"func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" +"`itertools` 模組在實作。" #: ../../glossary.rst:776 msgid "namespace package" -msgstr "" +msgstr "namespace package(命名空間套件)" #: ../../glossary.rst:778 msgid "" @@ -1332,14 +1795,17 @@ msgid "" "specifically are not like a :term:`regular package` because they have no " "``__init__.py`` file." msgstr "" +"一個 :pep:`420` :term:`package`\\ (套件),它只能作為子套件 (subpackage) 的" +"一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" +"`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" #: ../../glossary.rst:783 msgid "See also :term:`module`." -msgstr "" +msgstr "另請參閱 :term:`module`\\ (模組)。" #: ../../glossary.rst:784 msgid "nested scope" -msgstr "" +msgstr "nested scope(巢狀作用域)" #: ../../glossary.rst:786 msgid "" @@ -1350,10 +1816,15 @@ msgid "" "the innermost scope. Likewise, global variables read and write to the " "global namespace. The :keyword:`nonlocal` allows writing to outer scopes." msgstr "" +"能夠參照外層定義 (enclosing definition) 中的變數的能力。舉例來說,一個函式如" +"果是在另一個函式中被定義,則它便能夠參照外層函式中的變數。請注意,在預設情況" +"下,巢狀作用域僅適用於參照,而無法用於賦值。區域變數能在最內層作用域中讀取及" +"寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。\\ :keyword:`nonlocal` 容" +"許對外層作用域進行寫入。" #: ../../glossary.rst:793 msgid "new-style class" -msgstr "" +msgstr "new-style class(新式類別)" #: ../../glossary.rst:795 msgid "" @@ -1362,20 +1833,26 @@ msgid "" "versatile features like :attr:`~object.__slots__`, descriptors, properties, :" "meth:`__getattribute__`, class methods, and static methods." msgstr "" +"一個舊名,它是指現在所有的 class(類別)物件所使用的 class 風格。在早期的 " +"Python 版本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像是 :attr:" +"`~object.__slots__`\\ 、描述器 (descriptor)、屬性 (property)、\\ :meth:" +"`__getattribute__`\\ 、class method(類別方法)和 static method(靜態方法)。" #: ../../glossary.rst:799 msgid "object" -msgstr "" +msgstr "object(物件)" #: ../../glossary.rst:801 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." msgstr "" +"具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" +"`new-style class`\\ (新式類別)的最終 base class(基底類別)。" #: ../../glossary.rst:804 msgid "package" -msgstr "" +msgstr "package(套件)" #: ../../glossary.rst:806 msgid "" @@ -1383,14 +1860,19 @@ msgid "" "subpackages. Technically, a package is a Python module with an ``__path__`` " "attribute." msgstr "" +"一個 Python 的 :term:`module`\\ (模組),它可以包含子模組 (submodule) 或是遞" +"迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " +"Python 模組。" #: ../../glossary.rst:810 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" +"另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace package`" +"\\ (命名空間套件)。" #: ../../glossary.rst:811 msgid "parameter" -msgstr "" +msgstr "parameter(參數)" #: ../../glossary.rst:813 msgid "" @@ -1398,6 +1880,9 @@ msgid "" "an :term:`argument` (or in some cases, arguments) that the function can " "accept. There are five kinds of parameter:" msgstr "" +"在 :term:`function`\\ (函式)或 method(方法)定義中的一個命名實體 (named " +"entity),它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況" +"下指示多個引數。共有有五種不同的參數類型:" #: ../../glossary.rst:817 msgid "" @@ -1406,6 +1891,11 @@ msgid "" "`. This is the default kind of parameter, for example *foo* and " "*bar* in the following::" msgstr "" +":dfn:`positional-or-keyword`\\ (位置或關鍵字):指明一個可以\\ :term:`按照位" +"置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" +"是參數的預設類型,例如以下的 *foo* 和 *bar*:\n" +"\n" +"::" #: ../../glossary.rst:826 msgid "" @@ -1414,6 +1904,11 @@ msgid "" "character in the parameter list of the function definition after them, for " "example *posonly1* and *posonly2* in the following::" msgstr "" +":dfn:`positional-only`\\ (僅限位置):指明一個只能按照位置被提供的引數。在函" +"式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" +"如以下的 *posonly1* 和 *posonly2*:\n" +"\n" +"::" #: ../../glossary.rst:835 msgid "" @@ -1423,6 +1918,12 @@ msgid "" "definition before them, for example *kw_only1* and *kw_only2* in the " "following::" msgstr "" +":dfn:`keyword-only`\\ (僅限關鍵字):指明一個只能以關鍵字被提供的引數。在函" +"式定義的參數列表中,包含一個任意數量位置參數 (var-positional parameter) 或是" +"單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " +"和 *kw_only2*:\n" +"\n" +"::" #: ../../glossary.rst:843 msgid "" @@ -1432,6 +1933,11 @@ msgid "" "prepending the parameter name with ``*``, for example *args* in the " "following::" msgstr "" +":dfn:`var-positional`\\ (任意數量位置):指明一串能以任意序列被提供的位置引" +"數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" +"上 ``*`` 來定義的,例如以下的 *args*:\n" +"\n" +"::" #: ../../glossary.rst:851 msgid "" @@ -1440,12 +1946,16 @@ msgid "" "parameters). Such a parameter can be defined by prepending the parameter " "name with ``**``, for example *kwargs* in the example above." msgstr "" +":dfn:`var-keyword`\\ (任意數量關鍵字):指明可被提供的任意數量關鍵字引數(在" +"已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " +"``**`` 來定義的,例如上面範例中的 *kwargs*。" #: ../../glossary.rst:857 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" +"參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" #: ../../glossary.rst:860 msgid "" @@ -1454,20 +1964,25 @@ msgid "" "the :class:`inspect.Parameter` class, the :ref:`function` section, and :pep:" "`362`." msgstr "" +"另請參閱術語表的 :term:`argument`\\ (引數)條目、常見問題中的\\ :ref:`引數和" +"參數之間的差異 `\\ 、\\ :class:`inspect." +"Parameter` class(類別)、\\ :ref:`function`\\ 章節,以及 :pep:`362`\\ 。" #: ../../glossary.rst:864 msgid "path entry" -msgstr "" +msgstr "path entry(路徑項目)" #: ../../glossary.rst:866 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." msgstr "" +"在 :term:`import path`\\ (匯入路徑)中的一個位置,而 :term:`path based " +"finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" #: ../../glossary.rst:868 msgid "path entry finder" -msgstr "" +msgstr "path entry finder(路徑項目尋檢器)" #: ../../glossary.rst:870 msgid "" @@ -1475,16 +1990,21 @@ msgid "" "term:`path entry hook`) which knows how to locate modules given a :term:" "`path entry`." msgstr "" +"被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一個 :term:" +"`path entry hook`\\ )所回傳的一種 :term:`finder`\\ ,它知道如何以一個 :term:" +"`path entry`\\ 定位模組。" #: ../../glossary.rst:874 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" +"關於路徑項目尋檢器實作的 method(方法),請參閱 :class:`importlib.abc." +"PathEntryFinder`\\ 。" #: ../../glossary.rst:876 msgid "path entry hook" -msgstr "" +msgstr "path entry hook(路徑項目鉤)" #: ../../glossary.rst:878 msgid "" @@ -1492,20 +2012,25 @@ msgid "" "entry finder` if it knows how to find modules on a specific :term:`path " "entry`." msgstr "" +"在 :data:`sys.path_hook` 列表中的一個可呼叫物件 (callable),若它知道如何在一" +"個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " +"finder`\\ (路徑項目尋檢器)。" #: ../../glossary.rst:881 msgid "path based finder" -msgstr "" +msgstr "path based finder(基於路徑的尋檢器)" #: ../../glossary.rst:883 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." msgstr "" +"預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" +"會在一個 :term:`import path` 中搜尋模組。" #: ../../glossary.rst:885 msgid "path-like object" -msgstr "" +msgstr "path-like object(類路徑物件)" #: ../../glossary.rst:887 msgid "" @@ -1518,10 +2043,16 @@ msgid "" "`str` or :class:`bytes` result instead, respectively. Introduced by :pep:" "`519`." msgstr "" +"一個表示檔案系統路徑的物件。類路徑物件可以是一個表示路徑的 :class:`str` 或 :" +"class:`bytes` 物件,或是一個實作 :class:`os.PathLike` 協定的物件。透過呼叫 :" +"func:`os.fspath` 函式,一個支援 :class:`os.PathLike` 協定的物件可以被轉換為 :" +"class:`str` 或 :class:`bytes` 檔案系統路徑;而 :func:`os.fsdecode` 及 :func:" +"`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。於 :" +"pep:`519` 中介紹。" #: ../../glossary.rst:895 msgid "PEP" -msgstr "" +msgstr "PEP" #: ../../glossary.rst:897 msgid "" @@ -1530,6 +2061,9 @@ msgid "" "or its processes or environment. PEPs should provide a concise technical " "specification and a rationale for proposed features." msgstr "" +"Python Enhancement Proposal(Python 增強提案)。PEP 是一份設計說明文件,它能" +"為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" +"PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" #: ../../glossary.rst:903 msgid "" @@ -1539,28 +2073,33 @@ msgid "" "responsible for building consensus within the community and documenting " "dissenting opinions." msgstr "" +"PEP 的存在目的,是要成為重大新功能的提案、社群中關於某個問題的意見收集,以及" +"已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" +"建立共識並記錄反對意見。" #: ../../glossary.rst:909 msgid "See :pep:`1`." -msgstr "" +msgstr "請參閱 :pep:`1`\\ 。" #: ../../glossary.rst:910 msgid "portion" -msgstr "" +msgstr "portion(部分)" #: ../../glossary.rst:912 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." msgstr "" +"在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" +"套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" #: ../../glossary.rst:914 msgid "positional argument" -msgstr "" +msgstr "positional argument(位置引數)" #: ../../glossary.rst:917 msgid "provisional API" -msgstr "" +msgstr "provisional API(暫行 API)" #: ../../glossary.rst:919 msgid "" @@ -1572,6 +2111,11 @@ msgid "" "will not be made gratuitously -- they will occur only if serious fundamental " "flaws are uncovered that were missed prior to the inclusion of the API." msgstr "" +"暫行 API 是指,從標準函式庫的向後相容性 (backwards compatibility) 保證中,故" +"意被排除的 API。雖然此類介面,只要它們被標示為暫行的,理論上並不會有重大的變" +"更,但如果核心開發人員認為有必要,也可能會出現向後不相容的變更(甚至包括移除" +"該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" +"揭露時,它們才會發生。" #: ../../glossary.rst:928 msgid "" @@ -1579,6 +2123,8 @@ msgid "" "\"solution of last resort\" - every attempt will still be made to find a " "backwards compatible resolution to any identified problems." msgstr "" +"即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" +"現的問題,仍然會盡可能找出一個向後相容的解決方案。" #: ../../glossary.rst:932 msgid "" @@ -1586,18 +2132,20 @@ msgid "" "without locking in problematic design errors for extended periods of time. " "See :pep:`411` for more details." msgstr "" +"這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" +"設計錯誤。請參閱 :pep:`411` 了解更多細節。" #: ../../glossary.rst:935 msgid "provisional package" -msgstr "" +msgstr "provisional package(暫行套件)" #: ../../glossary.rst:937 msgid "See :term:`provisional API`." -msgstr "" +msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" #: ../../glossary.rst:938 msgid "Python 3000" -msgstr "" +msgstr "Python 3000" #: ../../glossary.rst:940 msgid "" @@ -1605,10 +2153,12 @@ msgid "" "of version 3 was something in the distant future.) This is also abbreviated " "\"Py3k\"." msgstr "" +"Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" +"來。)也可以縮寫為「Py3k」。" #: ../../glossary.rst:943 msgid "Pythonic" -msgstr "" +msgstr "Pythonic(Python 風格的)" #: ../../glossary.rst:945 msgid "" @@ -1619,14 +2169,23 @@ msgid "" "languages don't have this type of construct, so people unfamiliar with " "Python sometimes use a numerical counter instead::" msgstr "" +"一個想法或一段程式碼,它應用了 Python 語言最常見的慣用語,而不是使用其他語言" +"常見的概念來實作程式碼。例如,Python 中常見的一種習慣用法,是使用一個 :" +"keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" +"這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替:\n" +"\n" +"::" #: ../../glossary.rst:955 msgid "As opposed to the cleaner, Pythonic method::" msgstr "" +"相較之下,以下方法更簡潔、更具有 Python 風格:\n" +"\n" +"::" #: ../../glossary.rst:959 msgid "qualified name" -msgstr "" +msgstr "qualified name(限定名稱)" #: ../../glossary.rst:961 msgid "" @@ -1635,6 +2194,11 @@ msgid "" "top-level functions and classes, the qualified name is the same as the " "object's name::" msgstr "" +"一個「點分隔名稱」,它顯示從一個模組的全域作用域到該模組中定義的 class(類" +"別)、函式或 method(方法)的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函" +"式和 class 而言,限定名稱與其物件名稱相同:\n" +"\n" +"::" #: ../../glossary.rst:978 msgid "" @@ -1642,10 +2206,14 @@ msgid "" "dotted path to the module, including any parent packages, e.g. ``email.mime." "text``::" msgstr "" +"當用於引用模組時,\\ *完全限定名稱 (fully qualified name)* 是表示該模組的完整" +"點分隔路徑,包括任何的父套件,例如 ``email.mime.text``:\n" +"\n" +"::" #: ../../glossary.rst:985 msgid "reference count" -msgstr "" +msgstr "reference count(參照計數)" #: ../../glossary.rst:987 msgid "" @@ -1656,24 +2224,30 @@ msgid "" "function that programmers can call to return the reference count for a " "particular object." msgstr "" +"對於一個物件的參照次數。當一個物件的參照計數下降到零時,它會被解除配置 " +"(deallocated)。參照計數通常在 Python 程式碼中看不到,但它卻是 :term:" +"`CPython` 實作的一個關鍵元素。\\ :mod:`sys` 模組定義了一個 :func:`~sys." +"getrefcount` 函式,程序設計師可以呼叫該函式來回傳一個特定物件的參照計數。" #: ../../glossary.rst:993 msgid "regular package" -msgstr "" +msgstr "regular package(正規套件)" #: ../../glossary.rst:995 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." msgstr "" +"一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" +"錄。" #: ../../glossary.rst:998 msgid "See also :term:`namespace package`." -msgstr "" +msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" #: ../../glossary.rst:999 msgid "__slots__" -msgstr "" +msgstr "__slots__" #: ../../glossary.rst:1001 msgid "" @@ -1683,10 +2257,14 @@ msgid "" "cases where there are large numbers of instances in a memory-critical " "application." msgstr "" +"在 class 內部的一個宣告,它藉由預先宣告實例屬性的空間,以及消除實例 " +"dictionary(字典),來節省記憶體。雖然該技術很普遍,但它有點難以正確地使用," +"最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" +"見情況。" #: ../../glossary.rst:1006 msgid "sequence" -msgstr "" +msgstr "sequence(序列)" #: ../../glossary.rst:1008 msgid "" @@ -1698,6 +2276,13 @@ msgid "" "`__len__`, but is considered a mapping rather than a sequence because the " "lookups use arbitrary :term:`immutable` keys rather than integers." msgstr "" +"一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`__getitem__` special " +"method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一個 :meth:" +"`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:`list`" +"\\ 、\\ :class:`str`\\ 、\\ :class:`tuple` 和 :class:`bytes`\\ 。請注意,雖" +"然 :class:`dict` 也支援 :meth:`__getitem__` 和 :meth:`__len__`\\ ,但它被視為" +"對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` 鍵," +"而不是整數。" #: ../../glossary.rst:1017 msgid "" @@ -1705,22 +2290,44 @@ msgid "" "richer interface that goes beyond just :meth:`__getitem__` and :meth:" "`__len__`, adding :meth:`count`, :meth:`index`, :meth:`__contains__`, and :" "meth:`__reversed__`. Types that implement this expanded interface can be " -"registered explicitly using :func:`~abc.register`." +"registered explicitly using :func:`~abc.ABCMeta.register`." +msgstr "" +"抽象基底類別 (abstract base class) :class:`collections.abc.Sequence` 定義了一" +"個更加豐富的介面,並不僅止於 :meth:`__getitem__` 和 :meth:`__len__`\\ ,還增" +"加了 :meth:`count`\\ 、\\ :meth:`index`\\ 、\\ :meth:`__contains__` 和 :meth:" +"`__reversed__`\\ 。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta." +"register` 被明確地註冊。" + +#: ../../glossary.rst:1019 +msgid "set comprehension" +msgstr "set comprehension(集合綜合運算)" + +#: ../../glossary.rst:1020 +msgid "" +"A compact way to process all or part of the elements in an iterable and " +"return a set with the results. ``results = {c for c in 'abracadabra' if c " +"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See :ref:" +"`comprehensions`." msgstr "" +"一種緊密的方法,用來處理一個可疊代物件中的全部或部分元素,並將處理結果以一個 " +"set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" +"個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`\\ 。" #: ../../glossary.rst:1024 msgid "single dispatch" -msgstr "" +msgstr "single dispatch(單一調度)" #: ../../glossary.rst:1026 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." msgstr "" +":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" +"單一引數的型別。" #: ../../glossary.rst:1028 msgid "slice" -msgstr "" +msgstr "slice(切片)" #: ../../glossary.rst:1030 msgid "" @@ -1729,10 +2336,14 @@ msgid "" "when several are given, such as in ``variable_name[1:3:5]``. The bracket " "(subscript) notation uses :class:`slice` objects internally." msgstr "" +"一個物件,它通常包含一段 :term:`sequence`\\ (序列)的某一部分。建立一段切片" +"的方法是使用下標符號(subscript notation)``[]``,若要給出多個數字,則在數字" +"之間使用冒號,例如 ``in variable_name[1:3:5]``。在括號(下標)符號的內部,會" +"使用 :class:`slice` 物件。" #: ../../glossary.rst:1034 msgid "special method" -msgstr "" +msgstr "special method(特殊方法)" #: ../../glossary.rst:1038 msgid "" @@ -1741,10 +2352,13 @@ msgid "" "with double underscores. Special methods are documented in :ref:" "`specialnames`." msgstr "" +"一種會被 Python 自動呼叫的 method,用於對某種型別執行某種運算,例如加法。這" +"種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" +"`specialnames`\\ 中有詳細說明。" #: ../../glossary.rst:1042 msgid "statement" -msgstr "" +msgstr "statement(陳述式)" #: ../../glossary.rst:1044 msgid "" @@ -1752,18 +2366,21 @@ msgid "" "an :term:`expression` or one of several constructs with a keyword, such as :" "keyword:`if`, :keyword:`while` or :keyword:`for`." msgstr "" +"陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一個 :" +"term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`\\ 、\\ :" +"keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" #: ../../glossary.rst:1047 msgid "text encoding" -msgstr "" +msgstr "text encoding(文字編碼)" #: ../../glossary.rst:1049 msgid "A codec which encodes Unicode strings to bytes." -msgstr "" +msgstr "將 Unicode 字串編碼為位元組的一個編解碼器 (codec)。" #: ../../glossary.rst:1050 msgid "text file" -msgstr "" +msgstr "text file(文字檔案)" #: ../../glossary.rst:1052 msgid "" @@ -1773,16 +2390,23 @@ msgid "" "text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and " "instances of :class:`io.StringIO`." msgstr "" +"一個能夠讀取和寫入 :class:`str` 物件的一個 :term:`file object`\\ (檔案物" +"件)。通常,文字檔案實際上是存取位元組導向的資料流 (byte-oriented " +"datastream) 並會自動處理 :term:`text encoding`\\ (文字編碼)。文字檔案的例子" +"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`\\ 、\\ :" +"data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" #: ../../glossary.rst:1059 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." msgstr "" +"另請參閱 :term:`binary file`\\ (二進制檔案),它是一個能夠讀取和寫入\\ :" +"term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" #: ../../glossary.rst:1061 msgid "triple-quoted string" -msgstr "" +msgstr "triple-quoted string(三引號內字串)" #: ../../glossary.rst:1063 msgid "" @@ -1794,10 +2418,14 @@ msgid "" "continuation character, making them especially useful when writing " "docstrings." msgstr "" +"由三個雙引號 (“) 或單引號 (') 的作為邊界的一個字串。雖然它們並沒有提供異於單" +"引號字串的任何額外功能,但基於許多原因,它們仍是很有用的。它們讓你可以在字串" +"中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " +"(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" #: ../../glossary.rst:1070 msgid "type" -msgstr "" +msgstr "type(型別)" #: ../../glossary.rst:1072 msgid "" @@ -1805,38 +2433,49 @@ msgid "" "object has a type. An object's type is accessible as its :attr:`~instance." "__class__` attribute or can be retrieved with ``type(obj)``." msgstr "" +"一個 Python 物件的型別決定了它是什麼類型的物件;每個物件都有一個型別。一個物" +"件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " +"``type(obj)`` 來檢索。" #: ../../glossary.rst:1076 msgid "type alias" -msgstr "" +msgstr "type alias(型別別名)" #: ../../glossary.rst:1078 msgid "A synonym for a type, created by assigning the type to an identifier." -msgstr "" +msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" #: ../../glossary.rst:1080 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" +"型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如:\n" +"\n" +"::" #: ../../glossary.rst:1089 msgid "could be made more readable like this::" msgstr "" +"可以寫成這樣,更具有可讀性:\n" +"\n" +"::" #: ../../glossary.rst:1098 ../../glossary.rst:1112 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." -msgstr "" +msgstr "請參閱 :mod:`typing` 和 :pep:`484`\\ ,有此功能的描述。" #: ../../glossary.rst:1099 msgid "type hint" -msgstr "" +msgstr "type hint(型別提示)" #: ../../glossary.rst:1101 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." msgstr "" +"一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class(類別)屬性或" +"一個函式的參數或回傳值的預期型別。" #: ../../glossary.rst:1104 msgid "" @@ -1844,16 +2483,20 @@ msgid "" "to static type analysis tools, and aid IDEs with code completion and " "refactoring." msgstr "" +"型別提示是選擇性的,而不是被 Python 強制的,但它們對靜態型別分析工具很有用," +"並能協助 IDE 完成程式碼的補全 (completion) 和重構 (refactoring)。" #: ../../glossary.rst:1108 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." msgstr "" +"全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" +"`typing.get_type_hints` 來存取。" #: ../../glossary.rst:1113 msgid "universal newlines" -msgstr "" +msgstr "universal newlines(通用換行字元)" #: ../../glossary.rst:1115 msgid "" @@ -1863,39 +2506,52 @@ msgid "" "``'\\r'``. See :pep:`278` and :pep:`3116`, as well as :func:`bytes." "splitlines` for an additional use." msgstr "" +"一種解譯文字流 (text stream) 的方式,會將以下所有的情況識別為一行的結束:" +"Unix 行尾慣例 ``'\\n'``、Windows 慣例 ``'\\r\\n'`` 和舊的 Macintosh 慣例 " +"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`\\ ,以及用於 :func:`bytes." +"splitlines` 的附加用途。" #: ../../glossary.rst:1120 msgid "variable annotation" -msgstr "" +msgstr "variable annotation(變數註釋)" #: ../../glossary.rst:1122 msgid "An :term:`annotation` of a variable or a class attribute." -msgstr "" +msgstr "一個變數或 class(類別)屬性的 :term:`annotation`\\ (註釋)。" #: ../../glossary.rst:1124 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "" +"註釋變數或 class 屬性時,賦值是選擇性的:\n" +"\n" +"::" #: ../../glossary.rst:1129 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" msgstr "" +"變數註釋通常用於\\ :term:`型別提示 (type hint) `\\ :例如,這個變" +"數預期會取得 :class:`int`\\ (整數)值:\n" +"\n" +"::" #: ../../glossary.rst:1135 msgid "Variable annotation syntax is explained in section :ref:`annassign`." -msgstr "" +msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" #: ../../glossary.rst:1137 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality." msgstr "" +"請參閱 :term:`function annotation`\\ (函式註釋)、\\ :pep:`484` 和 :pep:" +"`526`\\ ,皆有此功能的描述。" #: ../../glossary.rst:1139 msgid "virtual environment" -msgstr "" +msgstr "virtual environment(虛擬環境)" #: ../../glossary.rst:1141 msgid "" @@ -1904,24 +2560,29 @@ msgid "" "interfering with the behaviour of other Python applications running on the " "same system." msgstr "" +"一個協作隔離 (cooperatively isolated) 的執行環境,能讓 Python 的使用者和應用" +"程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" +"用程式的行為產生干擾。" #: ../../glossary.rst:1146 msgid "See also :mod:`venv`." -msgstr "" +msgstr "另請參閱 :mod:`venv`\\ 。" #: ../../glossary.rst:1147 msgid "virtual machine" -msgstr "" +msgstr "virtual machine(虛擬機器)" #: ../../glossary.rst:1149 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." msgstr "" +"一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" +"`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" #: ../../glossary.rst:1151 msgid "Zen of Python" -msgstr "" +msgstr "Zen of Python(Python 之禪)" #: ../../glossary.rst:1153 msgid "" @@ -1929,3 +2590,5 @@ msgid "" "understanding and using the language. The listing can be found by typing " "\"``import this``\" at the interactive prompt." msgstr "" +"Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" +"動式提式字元後輸入「``import this``」來找到它。" From 657e006525bd18665ee2c45cf3a35d1c5d8866b4 Mon Sep 17 00:00:00 2001 From: Steven Hsu <81967953+StevenHsuYL@users.noreply.github.com> Date: Thu, 19 Aug 2021 17:54:55 +0800 Subject: [PATCH 11/39] Update sphinx.po Update the welcome message in sphinx.po --- sphinx.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sphinx.po b/sphinx.po index 8a4911c39c..87ab518742 100644 --- a/sphinx.po +++ b/sphinx.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2021-07-07 19:58+0800\n" +"PO-Revision-Date: 2021-08-19 17:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -47,8 +47,8 @@ msgid "Deprecated since version {deprecated}, removed in version {removed}" msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" #: ../../tools/templates/indexcontent.html:8 -msgid "Welcome! This is the documentation for Python %(release)s." -msgstr "歡迎!這是 Python %(release)s 的說明文件。" +msgid "Welcome! This is the official documentation for Python %(release)s." +msgstr "歡迎!這是 Python %(release)s 的官方說明文件。" #: ../../tools/templates/indexcontent.html:10 msgid "Parts of the documentation:" @@ -210,7 +210,7 @@ msgstr "Python 的沿革與授權" #: ../../tools/templates/indexcontent.html:64 msgid "Copyright" -msgstr "版權" +msgstr "版權所有" #: ../../tools/templates/indexsidebar.html:1 msgid "Download" From 0acb12fca206369e4cc3dd00c995a38f460602d6 Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Wed, 22 Sep 2021 14:49:18 +0800 Subject: [PATCH 12/39] Update sphinx.po Sync with zh-tw branch 3.9 --- sphinx.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sphinx.po b/sphinx.po index 60d3f9d704..1168ba989a 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2021-08-19 17:19+0800\n" +"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"PO-Revision-Date: 2021-06-02 12:28+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -90,7 +90,7 @@ msgstr "描述語法及語言要素" #: ../../tools/templates/indexcontent.html:21 msgid "Python Setup and Usage" -msgstr "Python 的設置與使用" +msgstr "Python 的安裝與使用" #: ../../tools/templates/indexcontent.html:22 msgid "how to use Python on different platforms" @@ -166,7 +166,7 @@ msgstr "全部函式、類別、術語" #: ../../tools/templates/indexcontent.html:46 msgid "Glossary" -msgstr "術語表" +msgstr "詞彙表" #: ../../tools/templates/indexcontent.html:47 msgid "the most important terms explained" @@ -210,7 +210,7 @@ msgstr "Python 的沿革與授權" #: ../../tools/templates/indexcontent.html:64 msgid "Copyright" -msgstr "版權所有" +msgstr "版權" #: ../../tools/templates/indexsidebar.html:1 msgid "Download" From 1aa70ace5d112496a0d7edc17a92d73f081757a6 Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Wed, 29 Sep 2021 14:02:21 +0800 Subject: [PATCH 13/39] Update sphinx.po MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "glossary" to "術語表", sync with glossary.po --- sphinx.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx.po b/sphinx.po index 1168ba989a..33d2295266 100644 --- a/sphinx.po +++ b/sphinx.po @@ -166,7 +166,7 @@ msgstr "全部函式、類別、術語" #: ../../tools/templates/indexcontent.html:46 msgid "Glossary" -msgstr "詞彙表" +msgstr "術語表" #: ../../tools/templates/indexcontent.html:47 msgid "the most important terms explained" From bb356f6ea6ccfb827df9c12a4a1f912473fb14f6 Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Sun, 3 Oct 2021 01:03:20 +0800 Subject: [PATCH 14/39] Update installing/index.po PyPI: "Python Package Index". Sync with cpython. --- installing/index.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installing/index.po b/installing/index.po index 97085cd4e4..9f0975687b 100644 --- a/installing/index.po +++ b/installing/index.po @@ -116,7 +116,7 @@ msgstr "" #: ../../installing/index.rst:47 msgid "" -"The `Python Packaging Index `__ is a public repository of " +"The `Python Package Index `__ is a public repository of " "open source licensed packages made available for use by other Python users." msgstr "" "`Python 套件索引 (Python Package Index) `__ 是開源授權套件" @@ -177,7 +177,7 @@ msgstr "標準封裝工具皆是以能從命令列使用的方式被設計的。 #: ../../installing/index.rst:80 msgid "" "The following command will install the latest version of a module and its " -"dependencies from the Python Packaging Index::" +"dependencies from the Python Package Index::" msgstr "" "以下指令將從 Python 套件索引安裝一個模組的最新版本及其依賴套件 " "(dependencies):\n" @@ -410,7 +410,7 @@ msgstr "" msgid "" "With the introduction of support for the binary ``wheel`` format, and the " "ability to publish wheels for at least Windows and Mac OS X through the " -"Python Packaging Index, this problem is expected to diminish over time, as " +"Python Package Index, this problem is expected to diminish over time, as " "users are more regularly able to install pre-built extensions rather than " "needing to build them themselves." msgstr "" From 1c134bf1d1b05c961e0b9aa0dcce834936246b83 Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Sun, 3 Oct 2021 09:47:06 +0800 Subject: [PATCH 15/39] Update installing/index.po Sync with cpython, "macOS". --- installing/index.po | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/installing/index.po b/installing/index.po index 9f0975687b..c468e7b0e8 100644 --- a/installing/index.po +++ b/installing/index.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2021-07-04 01:29+0800\n" +"PO-Revision-Date: 2021-10-03 09:41+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -186,11 +186,11 @@ msgstr "" #: ../../installing/index.rst:87 msgid "" -"For POSIX users (including Mac OS X and Linux users), the examples in this " +"For POSIX users (including macOS and Linux users), the examples in this " "guide assume the use of a :term:`virtual environment`." msgstr "" -"對於 POSIX 使用者(包括 Mac OS X 和 Linux 使用者),本指南中的範例皆假設有使" -"用 :term:`virtual environment`\\ 。" +"對於 POSIX 使用者(包括 macOS 和 Linux 使用者),本指南中的範例皆假設有使用 :" +"term:`virtual environment`\\ 。" #: ../../installing/index.rst:90 msgid "" @@ -321,12 +321,12 @@ msgstr "...平行安裝多個 Python 版本並使用它們?" #: ../../installing/index.rst:166 msgid "" -"On Linux, Mac OS X, and other POSIX systems, use the versioned Python " -"commands in combination with the ``-m`` switch to run the appropriate copy " -"of ``pip``::" +"On Linux, macOS, and other POSIX systems, use the versioned Python commands " +"in combination with the ``-m`` switch to run the appropriate copy of " +"``pip``::" msgstr "" -"在 Linux、Mac OS X 以及其他 POSIX 系統中,使用帶有版本編號的 Python 指令並結" -"合 ``-m`` 開關參數 (switch),來運行 ``pip`` 的適當副本:\n" +"在 Linux、macOS 以及其他 POSIX 系統中,使用帶有版本編號的 Python 指令並結合 " +"``-m`` 開關參數,來運行 ``pip`` 的適當副本:\n" "\n" "::" @@ -339,7 +339,8 @@ msgid "" "On Windows, use the ``py`` Python launcher in combination with the ``-m`` " "switch::" msgstr "" -"在 Windows 中,使用 Python 啟動指令 ``py`` 並結合 ``-m`` 開關參數:\n" +"在 Windows 中,使用 Python 啟動指令 ``py`` 並結合 ``-m`` 開關參數 " +"(switch):\n" "\n" "::" @@ -409,14 +410,14 @@ msgstr "" #: ../../installing/index.rst:227 msgid "" "With the introduction of support for the binary ``wheel`` format, and the " -"ability to publish wheels for at least Windows and Mac OS X through the " -"Python Package Index, this problem is expected to diminish over time, as " -"users are more regularly able to install pre-built extensions rather than " -"needing to build them themselves." +"ability to publish wheels for at least Windows and macOS through the Python " +"Package Index, this problem is expected to diminish over time, as users are " +"more regularly able to install pre-built extensions rather than needing to " +"build them themselves." msgstr "" "隨著引入對二進制 ``wheel`` 格式的支援,以及透過 Python 套件索引能夠至少在 " -"Windows 和 Mac OS X 發布 wheel 檔案,這個問題預期將會逐漸消失,因為使用者將能" -"夠更頻繁地安裝預建置 (pre-built) 的擴充,而不再需要自己建置它們。" +"Windows 和 macOS 發布 wheel 檔案,這個問題預期將會逐漸消失,因為使用者將能夠" +"更頻繁地安裝預建置 (pre-built) 的擴充,而不再需要自己建置它們。" #: ../../installing/index.rst:233 msgid "" From 6b750f06213c10ba300dc0abc8fac4dbe02738fe Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Sun, 3 Oct 2021 17:00:02 +0800 Subject: [PATCH 16/39] Update installing/index.po MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add "(switch)" for "開關參數". --- installing/index.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installing/index.po b/installing/index.po index c468e7b0e8..2f9aba7789 100644 --- a/installing/index.po +++ b/installing/index.po @@ -326,7 +326,7 @@ msgid "" "``pip``::" msgstr "" "在 Linux、macOS 以及其他 POSIX 系統中,使用帶有版本編號的 Python 指令並結合 " -"``-m`` 開關參數,來運行 ``pip`` 的適當副本:\n" +"``-m`` 開關參數 (switch),來運行 ``pip`` 的適當副本:\n" "\n" "::" From 4b8215b72e43f9259096336475155505fe35f159 Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Sun, 3 Oct 2021 17:24:53 +0800 Subject: [PATCH 17/39] Update license.po sync with cpython, "macOS". --- license.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/license.po b/license.po index b3f1d0cac9..f1f010e398 100644 --- a/license.po +++ b/license.po @@ -475,13 +475,13 @@ msgstr "OpenSSL" msgid "" "The modules :mod:`hashlib`, :mod:`posix`, :mod:`ssl`, :mod:`crypt` use the " "OpenSSL library for added performance if made available by the operating " -"system. Additionally, the Windows and Mac OS X installers for Python may " +"system. Additionally, the Windows and macOS installers for Python may " "include a copy of the OpenSSL libraries, so we include a copy of the OpenSSL " "license here::" msgstr "" "如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`\\ 、\\ :mod:`posix`" "\\ 、\\ :mod:`ssl`\\ 、\\ :mod:`crypt` 模組會使用它來提升效能。此外,因為 " -"Windows 和 Mac OS X 的 Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們" +"Windows 和 macOS 的 Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們" "也在此收錄 OpenSSL 授權的副本:\n" "\n" "::" From c22e6142fd3cc0814d6147bfbd6476b1be017351 Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Sun, 3 Oct 2021 17:41:04 +0800 Subject: [PATCH 18/39] Update tutorial/appetite.po sync with cpython, "macOS". --- tutorial/appetite.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tutorial/appetite.po b/tutorial/appetite.po index 55aceab567..5fc6773bc0 100644 --- a/tutorial/appetite.po +++ b/tutorial/appetite.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2021-06-06 13:25+0800\n" +"PO-Revision-Date: 2021-10-03 17:39+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -61,14 +61,14 @@ msgid "" "tasks, but shell scripts are best at moving around files and changing text " "data, not well-suited for GUI applications or games. You could write a C/C++/" "Java program, but it can take a lot of development time to get even a first-" -"draft program. Python is simpler to use, available on Windows, Mac OS X, " -"and Unix operating systems, and will help you get the job done more quickly." +"draft program. Python is simpler to use, available on Windows, macOS, and " +"Unix operating systems, and will help you get the job done more quickly." msgstr "" "也許你可以為了某些任務而寫個 Unix shell 腳本或者 Windows 批次檔來處理,但 " "shell 腳本最適合於搬動檔案或更動文字內容,而不適於圖形應用程式或遊戲。你可以" "為此寫個 C/C++/Java 程式,但僅僅是完成個草稿也需要很長的開發時間。相較而言," -"Python 更易於使用,並能在 Windows、Mac OSX、Unix 作業系統上執行,且能更快速地" -"幫助你完成工作。" +"Python 更易於使用,並能在 Windows、macOS、Unix 作業系統上執行,且能更快速地幫" +"助你完成工作。" #: ../../tutorial/appetite.rst:29 msgid "" From 62cf8693f8f3d958b642ee1c811abdd8640d2bba Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Sun, 3 Oct 2021 22:46:00 +0800 Subject: [PATCH 19/39] Update tutorial/modules.po sync with cpython. --- tutorial/modules.po | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tutorial/modules.po b/tutorial/modules.po index f2b8c7f7b3..01fcc3308f 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-28 20:03+0800\n" -"PO-Revision-Date: 2021-07-03 16:36+0800\n" +"PO-Revision-Date: 2021-10-03 22:25+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -23,7 +23,7 @@ msgstr "" #: ../../tutorial/modules.rst:5 msgid "Modules" -msgstr "模組" +msgstr "模組 (Module)" #: ../../tutorial/modules.rst:7 msgid "" @@ -299,8 +299,12 @@ msgstr "" "夾名稱)。" #: ../../tutorial/modules.rst:194 -msgid "The installation-dependent default." -msgstr "安裝相關的預設值。" +msgid "" +"The installation-dependent default (by convention including a ``site-" +"packages`` directory, handled by the :mod:`site` module)." +msgstr "" +"與安裝相關的預設值(按慣例會包含一個 ``site-packages`` 資料夾,它是由 :mod:" +"`site` 模組所處理)。" #: ../../tutorial/modules.rst:197 msgid "" From b5e12a09b4366f4ddc0a3fe9d22dcbd184de6352 Mon Sep 17 00:00:00 2001 From: jordanSu Date: Mon, 11 Oct 2021 00:26:49 +0800 Subject: [PATCH 20/39] Translate library/text.po --- library/text.po | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/library/text.po b/library/text.po index 7fc0a9a94f..9ec0db46c8 100644 --- a/library/text.po +++ b/library/text.po @@ -3,13 +3,14 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Liang-Bo Wang , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2015-12-09 17:51+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"PO-Revision-Date: 2021-10-11 00:40+0800\n" +"Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,16 +18,18 @@ 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.0\n" #: ../../library/text.rst:6 msgid "Text Processing Services" -msgstr "" +msgstr "文本處理 (Text Processing) 服務" #: ../../library/text.rst:8 msgid "" "The modules described in this chapter provide a wide range of string " "manipulation operations and other text processing services." msgstr "" +"本章節介紹的 module(模組)提供了廣泛的字串處理運算與其他文本處理服務。" #: ../../library/text.rst:11 msgid "" @@ -34,3 +37,6 @@ msgid "" "highly relevant to text processing. In addition, see the documentation for " "Python's built-in string type in :ref:`textseq`." msgstr "" +"在 :ref:`binaryservices` 下所描述的 :mod:`codecs` module(模組)也與文本處" +"理高度相關。另外也請參閱在 :ref:`textseq` 中所描述的 Python 內建字串型別的" +"相關文件。" From f5dc0701a09488f7d800118caca340b2a11c0b2c Mon Sep 17 00:00:00 2001 From: grimmer Date: Sun, 17 Oct 2021 20:07:48 +0800 Subject: [PATCH 21/39] docs: improve wording and add introduction to pot file --- README.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index e23a9e27f0..ff8df1420b 100644 --- a/README.rst +++ b/README.rst @@ -61,10 +61,10 @@ the PSF for inclusion in the documentation. 您在對 PSF 送出說明文件貢獻的同時,即表示同意上述的協議。 -參加翻譯 +參與翻譯 ======== -如何參加翻譯 +如何參與翻譯 ------------ **事先需要有:** @@ -385,6 +385,9 @@ branch clone 下來。 與 CPython 同步最新的 pot 檔 ---------------------------- +pot 檔為翻譯的樣板檔案,它包含需要翻譯的原始字串 (*msgid*) 跟其對應的空白翻譯字串 (*msgstr*),\ +此步驟會更新 po 檔,我們在 po 檔的每一個 (*msgstr*) 填上翻譯。 + .. code-block:: bash $ make merge @@ -392,7 +395,7 @@ branch clone 下來。 尋找 fuzzy entries ------------------ -*Fuzzy entries* 係指更新 po 檔的原始字串(*msgid*)以後,大部分內容相同但有\ +*Fuzzy entries* 是指更新 po 檔的原始字串(*msgid*)以後,大部分內容相同但有\ 些許差異的字串,即表示該字串的翻譯需要更新。在 po 檔中,您會看到 ``#, fuzzy`` 的字樣,這就表示了接下來的字串是 fuzzy entry,需要更新翻譯。 From 240d2020323f00cb708c6f279f37a9db8c8e25c2 Mon Sep 17 00:00:00 2001 From: jordanSu Date: Sun, 17 Oct 2021 22:21:13 +0800 Subject: [PATCH 22/39] update library/text.po according to suggestions --- library/text.po | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/library/text.po b/library/text.po index 9ec0db46c8..54a9dab0fd 100644 --- a/library/text.po +++ b/library/text.po @@ -4,12 +4,13 @@ # # Translators: # Liang-Bo Wang , 2015 +# Jordan Su , 2021 msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2021-10-11 00:40+0800\n" +"PO-Revision-Date: 2021-10-17 22:18+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -28,8 +29,7 @@ msgstr "文本處理 (Text Processing) 服務" msgid "" "The modules described in this chapter provide a wide range of string " "manipulation operations and other text processing services." -msgstr "" -"本章節介紹的 module(模組)提供了廣泛的字串處理運算與其他文本處理服務。" +msgstr "本章節介紹的模組 (module) 提供了廣泛的字串操作與其他文本處理服務。" #: ../../library/text.rst:11 msgid "" @@ -37,6 +37,5 @@ msgid "" "highly relevant to text processing. In addition, see the documentation for " "Python's built-in string type in :ref:`textseq`." msgstr "" -"在 :ref:`binaryservices` 下所描述的 :mod:`codecs` module(模組)也與文本處" -"理高度相關。另外也請參閱在 :ref:`textseq` 中所描述的 Python 內建字串型別的" -"相關文件。" +"在 :ref:`binaryservices` 下所描述的 :mod:`codecs` 模組也與文本處理高度相" +"關。另外也請參閱在 :ref:`textseq` 中所描述的 Python 內建字串型別。" From 9e3ccd8e63d1d603ae8223548fb1417a5c59fd89 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Mon, 18 Oct 2021 03:25:07 +0800 Subject: [PATCH 23/39] fix(README): broken anchor due to modified title --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index ff8df1420b..48c5a4ff2c 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Python 官方說明文件臺灣繁體中文翻譯計畫 這是 Python 3.9 官方說明文件的臺灣繁體中文(zh_TW)翻譯。 -翻譯之前,請務必詳讀並同意\ `授權與 License`_。參與方式請參考\ `參加翻譯`_。 +翻譯之前,請務必詳讀並同意\ `授權與 License`_。參與方式請參考\ `參與翻譯`_。 您可以在 https://python.github.io/python-docs-zh-tw/ 瀏覽目前翻譯的成果。 From c6f8ec3f731e2823589603a882ded7d2f76f228a Mon Sep 17 00:00:00 2001 From: grimmer Date: Mon, 18 Oct 2021 16:34:30 +0800 Subject: [PATCH 24/39] docs: add more detailed introduction to readme --- README.rst | 70 +++++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/README.rst b/README.rst index 48c5a4ff2c..50f21cc437 100644 --- a/README.rst +++ b/README.rst @@ -64,16 +64,23 @@ the PSF for inclusion in the documentation. 參與翻譯 ======== -如何參與翻譯 +關於 po (Portable Object) 檔 +----------------------------- + +此為所需翻譯的文字檔,副檔名為 ``.po``,不同語系就會有一個 po 檔。主要內容為翻譯的參考原始字串 (*msgid*),\ +及需要填入的翻譯字串 (*msgstr*)。有時你會看到 ``#, fuzzy`` 的註記,它代表此翻譯字串需要校閱。 + +翻譯流程 ------------ -**事先需要有:** +事先需要有 +~~~~~~~~~~ - 一個 `GitHub 帳號 `_ - `安裝好 git `_\ (Windows 上請參考 https://gitforwindows.org/) -- 一個 ``.po`` 檔的編輯器,如果還沒有的話請使用 `poedit `_ -- MacOS 的使用者還需要先利用 `homebrew `_ 安裝 gettext ,屆時 Sphinx 會使用到。 +- 一個 ``.po`` 檔的編輯器。推薦使用 `Poedit `_,若熟悉 po 檔用一般文字編輯器亦可。 +- macOS 的使用者還需要先利用 `homebrew `_ 安裝 gettext ,屆時 Sphinx 會使用到。 .. code-block:: bash brew install gettext @@ -84,7 +91,10 @@ the PSF for inclusion in the documentation. 按鈕),這樣會把整個專案複製一份到你的 GitHub 帳號底下,你可以對這個 fork 進行修改。 -在\ **第一次貢獻以前**\ (還沒有 clone 過),請在 terminal 裡依照以下步驟: +第一次貢獻以前(還沒有 clone 過) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +請在 terminal 裡依照以下步驟: .. code-block:: bash @@ -97,7 +107,10 @@ the PSF for inclusion in the documentation. # 將 python/python-docs-zh-tw 設為 upstream remote git remote add upstream https://github.com/python/python-docs-zh-tw.git -在\ **每一次翻譯時**\ 請遵照以下步驟(`GitHub Flow`_): +每一次翻譯時 +~~~~~~~~~~~~ + +請遵照以下步驟(`GitHub Flow`_): .. _GitHub Flow: https://guides.github.com/introduction/flow/ @@ -106,27 +119,30 @@ the PSF for inclusion in the documentation. 接著在 terminal 裡按照以下步驟: -1. 基於最新版本的 ``upstream/3.9`` 開啟一個 branch,現在假設我們想要翻譯 Glossary +1. 基於最新版本的 ``upstream/3.9`` 開啟一個 branch,現在假設我們想要翻譯 Glossary \ 所以把這個 branch 叫做 ``glossary`` :: git fetch upstream git checkout -b glossary upstream/3.9 -2. 接著就可以開始翻譯,你可以使用 Poedit 應用程式將檔案打開,或是用以下指令\ - (翻譯不同檔案時將 glossary 換成別的檔名) :: +2. 接著就可以開始翻譯,你可以手動開啟 Poedit 應用程式再選檔案或用以下指令請 Poedit 將檔案\ + 打開,翻譯不同檔案時將 glossary 換成別的檔名) :: poedit glossary.po -3. 存檔以後,可以輸出文件以確保你的修改沒有 rST 的語法錯誤或警告 :: +3. 存檔以後,執行以下列指令編譯輸出文件,以確保你的修改沒有 rST 的語法錯誤或警告 :: make - 這個過程中 Sphinx 會幫你檢查 rST 語法錯誤,我們盡量保持沒有 warning + 如果你還沒有執行 `維護、預覽`_ 的 clone CPython 的動作,此指令會自動幫你 clone CPython,\ + 並且會使用 Sphinx 幫你檢查 rST 語法錯誤,我們盡量保持沒有 warning \ 的狀態,因此如果有出現 warning 的話請修復它。另外也記得檢查是否符合\ `翻譯守則`_ -4. 在瀏覽器中打開編譯出來的文件以確認整份文件的語意通暢\ - (翻譯別的檔案時將 glossary 換成別的檔名) :: +4. 輸出的文件會被放置在您的本地端 CPython clone(見 `維護、預覽`_ 段落的圖示)\ + 底下的 ``Doc/build/html``,切換到該目錄再使用 ``python3 -m http.server`` \ + 或類似的靜態網頁伺服器即可以預覽成果。你可以執行下列指令請瀏覽器打開編譯出來的文件\ + 以確認整份文件的語意通暢(翻譯別的檔案時將 glossary 換成別的檔名) :: open ../cpython/Doc/build/html/glossary.html @@ -165,7 +181,9 @@ the PSF for inclusion in the documentation. 要翻譯哪些東西 -------------- -最簡單的貢獻方式就是更新 *fuzzy entries*,讓翻譯的內容保持與最新版本的文件\ +主要是填入翻譯字串 (*msgid*) 以及更新有標記為 ``#, fuzzy`` 的字串。 + +其中最簡單的貢獻方式就是更新 *fuzzy entries*,讓翻譯的內容保持與最新版本的文件\ 同步。請參考 `尋找 fuzzy entries`_ 段落。 此外,當前的目標為完成 **Tutorial** 的翻譯,因此在 ``tutorial/`` 底下的所有 @@ -382,11 +400,12 @@ type 型別 這樣可以避免下載完整的 commit 歷史(對輸出文件沒什麼幫助),但仍然能把所有的 branch clone 下來。 -與 CPython 同步最新的 pot 檔 ----------------------------- +與 CPython 同步最新的 pot 檔 (目前由 GitHub Actions 代為執行) +---------------------------------------------------------- pot 檔為翻譯的樣板檔案,它包含需要翻譯的原始字串 (*msgid*) 跟其對應的空白翻譯字串 (*msgstr*),\ -此步驟會更新 po 檔,我們在 po 檔的每一個 (*msgstr*) 填上翻譯。 +此步驟會參考最新的 Cpython 中的 pot 檔來更新 po 檔。如果是之前在 po 檔中已填入過翻議字串但參考的 \ +pot 檔的 ``msgid`` 已有變動,則此指令會自動加上 ``#, fuzzy`` 的標記,代表內容有些許差異需要更新。 .. code-block:: bash @@ -395,26 +414,13 @@ pot 檔為翻譯的樣板檔案,它包含需要翻譯的原始字串 (*msgid*) 尋找 fuzzy entries ------------------ -*Fuzzy entries* 是指更新 po 檔的原始字串(*msgid*)以後,大部分內容相同但有\ -些許差異的字串,即表示該字串的翻譯需要更新。在 po 檔中,您會看到 ``#, fuzzy`` -的字樣,這就表示了接下來的字串是 fuzzy entry,需要更新翻譯。 +在 po 檔中,您會看到 ``#, fuzzy`` 的字樣,這就表示了接下來的字串是 fuzzy entry,需要更新翻譯。\ +執行下列指令會列出有 *Fuzzy entries* 的檔案。 .. code-block:: bash $ make fuzzy -本地端編譯輸出文件 ------------------- - -輸出的文件會被放置在您的本地端 CPython clone(見 `維護、預覽`_ 段落的圖示)\ -底下的 ``Doc/build/html``,切換到該目錄再使用 ``python3 -m http.server`` -或類似的靜態網頁伺服器即可以預覽成果。編譯程序則使用: - -.. code-block:: bash - - $ make - - Project History =============== From f60a084c77d3997835b4b658ebcc0d5206a0bfaa Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Tue, 19 Oct 2021 13:32:44 +0800 Subject: [PATCH 25/39] Apply suggestions from code review Apply the suggestion. Co-authored-by: Wei-Hsiang (Matt) Wang --- installing/index.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installing/index.po b/installing/index.po index 52422011d0..62c4d707bd 100644 --- a/installing/index.po +++ b/installing/index.po @@ -391,8 +391,8 @@ msgid "" "python.org/tutorials/installing-packages/#install-pip-setuptools-and-" "wheel>`__" msgstr "" -"關於\\ `安裝 pip `__\\ ,這裡還有其他的資源。" +"這裡還有其他關於\\ `安裝 pip `__\\ 的資源。" #: ../../installing/index.rst:221 msgid "Installing binary extensions" From 5373f0bd71cfeb3085b4bba81aec8098758f7574 Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Tue, 19 Oct 2021 13:37:42 +0800 Subject: [PATCH 26/39] Apply suggestions from code review Apply all suggestions. Co-authored-by: Wei-Hsiang (Matt) Wang --- license.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/license.po b/license.po index 6679718514..5088a53a9c 100644 --- a/license.po +++ b/license.po @@ -46,7 +46,7 @@ msgid "" "Research Initiatives (CNRI, see https://www.cnri.reston.va.us/) in Reston, " "Virginia where he released several versions of the software." msgstr "" -"1995 年,Guido在維吉尼亞州雷斯頓的國家創新研究公司(CNRI,見 https://www." +"1995 年,Guido 在維吉尼亞州雷斯頓的國家創新研究公司(CNRI,見 https://www." "cnri.reston.va.us/)繼續他在 Python 的工作,並在那裡發佈了該軟體的多個版本。" #: ../../license.rst:22 @@ -61,7 +61,7 @@ msgid "" msgstr "" "2000 年五月,Guido 和 Python 核心開發團隊轉移到 BeOpen.com 並成立了 BeOpen " "PythonLabs 團隊。同年十月,PythonLabs 團隊轉移到 Digital Creations(現為 " -"Zope Corporation;見 https://www.zope.org/)。2001年,Python 軟體基金會" +"Zope Corporation;見 https://www.zope.org/)。2001 年,Python 軟體基金會" "(PSF,見 https://www.python.org/psf/)成立,這是一個專為擁有 Python 相關的智" "慧財產權而創立的非營利組織。Zope Corporation 是 PSF 的一個贊助會員。" @@ -249,7 +249,7 @@ msgid "" "documentation are dual licensed under the PSF License Agreement and the :ref:" "`Zero-Clause BSD license `." msgstr "" -"從 Python 3.8.6開始,說明文件中的範例、程式庫和其他程式碼,是被雙重授權 " +"從 Python 3.8.6 開始,說明文件中的範例、程式庫和其他程式碼,是被雙重授權 " "(dual licensed) 於 PSF 授權合約以及 :ref:`Zero-Clause BSD 授權 `\\ 。" #: ../../license.rst:76 @@ -319,7 +319,7 @@ msgid "" "acknowledgements for third-party software incorporated in the Python " "distribution." msgstr "" -"本節是一個不完整且不斷成長的授權與致謝清單,對象是在 Python 發佈版本中所收錄" +"本節是一個不完整但持續增加的授權與致謝清單,對象是在 Python 發佈版本中所收錄" "的第三方軟體。" #: ../../license.rst:303 @@ -349,7 +349,7 @@ msgid "" "Project, http://www.wide.ad.jp/. ::" msgstr "" ":mod:`socket` 模組使用 :func:`getaddrinfo` 和 :func:`getnameinfo` 函式,它們" -"在 WIDE 專案(http://www.wide.ad.jp/)內,於不同的原始檔案中被編碼。\n" +"在 WIDE 專案(http://www.wide.ad.jp/)內,於不同的原始檔案中被編碼:\n" "\n" "::" From 170b5227badb268d254cb5157ce1e0aa304a8717 Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Tue, 19 Oct 2021 14:59:12 +0800 Subject: [PATCH 27/39] Apply suggestions from code review Apply part of suggestions. Pending further reply. Co-authored-by: Wei-Hsiang (Matt) Wang --- extending/index.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extending/index.po b/extending/index.po index 0432daa610..ba5dd0789f 100644 --- a/extending/index.po +++ b/extending/index.po @@ -50,8 +50,8 @@ msgid "" msgstr "" "這份說明文件假設您具備 Python 的基礎知識。關於此語言的非正式介紹,請參閱 :" "ref:`tutorial-index`\\ 。\\ :ref:`reference-index`\\ 給予此語言更為正式的定" -"義。\\ :ref:`library-index` 記錄了現有的物件型別、函式與(內建的,和以 " -"Python 編寫的)模組,該函式庫賦予此語言廣泛的應用範圍。" +"義。\\ :ref:`library-index` 記錄了賦予此語言廣泛應用範圍的物件型別、函式" +"與(內建的和以 Python 編寫的)模組。" #: ../../extending/index.rst:21 msgid "" @@ -122,5 +122,5 @@ msgid "" "details involved in doing that successfully." msgstr "" "有時候,相較於建立一個擴充,使其在 Python 直譯器中可作為主應用程式運行,還不" -"如將 CPython 運行環境嵌入至一個更大的應用程式中,更令人讚賞。本節將涵蓋一些要" +"如將 CPython 運行環境嵌入至一個更大的應用程式中更可取。本節將涵蓋一些要" "成功完成此任務所涉及的細節。" From 8d59554b260ec86a78566d4636c1e66cc15fd62a Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Tue, 19 Oct 2021 16:01:31 +0800 Subject: [PATCH 28/39] Sync with CPython 3.9 (#121) Co-authored-by: github-actions[bot] Co-authored-by: Matt.Wang --- faq/programming.po | 446 +++++++++++++++++++----------------- library/hashlib.po | 7 +- library/html.entities.po | 6 +- library/http.cookiejar.po | 4 +- library/ipaddress.po | 4 +- library/json.po | 24 +- library/random.po | 20 +- library/xml.dom.minidom.po | 59 ++--- license.po | 38 +-- reference/executionmodel.po | 14 +- 10 files changed, 310 insertions(+), 312 deletions(-) diff --git a/faq/programming.po b/faq/programming.po index 6a63b9dba6..16a9b3d023 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-07 00:10+0000\n" +"POT-Creation-Date: 2021-10-13 20:21+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -937,17 +937,33 @@ msgid "" msgstr "" #: ../../faq/programming.rst:840 -msgid "How do I convert a string to a number?" +msgid "How do I get int literal attribute instead of SyntaxError?" msgstr "" #: ../../faq/programming.rst:842 msgid "" +"Trying to lookup an ``int`` literal attribute in the normal manner gives a " +"syntax error because the period is seen as a decimal point::" +msgstr "" + +#: ../../faq/programming.rst:851 +msgid "" +"The solution is to separate the literal from the period with either a space " +"or parentheses." +msgstr "" + +#: ../../faq/programming.rst:861 +msgid "How do I convert a string to a number?" +msgstr "" + +#: ../../faq/programming.rst:863 +msgid "" "For integers, use the built-in :func:`int` type constructor, e.g. " "``int('144') == 144``. Similarly, :func:`float` converts to floating-point, " "e.g. ``float('144') == 144.0``." msgstr "" -#: ../../faq/programming.rst:846 +#: ../../faq/programming.rst:867 msgid "" "By default, these interpret the number as decimal, so that ``int('0144') == " "144`` holds true, and ``int('0x144')`` raises :exc:`ValueError`. " @@ -957,7 +973,7 @@ msgid "" "octal, and '0x' indicates a hex number." msgstr "" -#: ../../faq/programming.rst:853 +#: ../../faq/programming.rst:874 msgid "" "Do not use the built-in function :func:`eval` if all you need is to convert " "strings to numbers. :func:`eval` will be significantly slower and it " @@ -967,18 +983,18 @@ msgid "" "directory." msgstr "" -#: ../../faq/programming.rst:860 +#: ../../faq/programming.rst:881 msgid "" ":func:`eval` also has the effect of interpreting numbers as Python " "expressions, so that e.g. ``eval('09')`` gives a syntax error because Python " "does not allow leading '0' in a decimal number (except '0')." msgstr "" -#: ../../faq/programming.rst:866 +#: ../../faq/programming.rst:887 msgid "How do I convert a number to a string?" msgstr "" -#: ../../faq/programming.rst:868 +#: ../../faq/programming.rst:889 msgid "" "To convert, e.g., the number 144 to the string '144', use the built-in type " "constructor :func:`str`. If you want a hexadecimal or octal representation, " @@ -988,11 +1004,11 @@ msgid "" "format(1.0/3.0)`` yields ``'0.333'``." msgstr "" -#: ../../faq/programming.rst:877 +#: ../../faq/programming.rst:898 msgid "How do I modify a string in place?" msgstr "" -#: ../../faq/programming.rst:879 +#: ../../faq/programming.rst:900 msgid "" "You can't, because strings are immutable. In most situations, you should " "simply construct a new string from the various parts you want to assemble it " @@ -1001,15 +1017,15 @@ msgid "" "module::" msgstr "" -#: ../../faq/programming.rst:909 +#: ../../faq/programming.rst:930 msgid "How do I use strings to call functions/methods?" msgstr "" -#: ../../faq/programming.rst:911 +#: ../../faq/programming.rst:932 msgid "There are various techniques." msgstr "" -#: ../../faq/programming.rst:913 +#: ../../faq/programming.rst:934 msgid "" "The best is to use a dictionary that maps strings to functions. The primary " "advantage of this technique is that the strings do not need to match the " @@ -1017,31 +1033,31 @@ msgid "" "a case construct::" msgstr "" -#: ../../faq/programming.rst:928 +#: ../../faq/programming.rst:949 msgid "Use the built-in function :func:`getattr`::" msgstr "" -#: ../../faq/programming.rst:933 +#: ../../faq/programming.rst:954 msgid "" "Note that :func:`getattr` works on any object, including classes, class " "instances, modules, and so on." msgstr "" -#: ../../faq/programming.rst:936 +#: ../../faq/programming.rst:957 msgid "This is used in several places in the standard library, like this::" msgstr "" -#: ../../faq/programming.rst:949 +#: ../../faq/programming.rst:970 msgid "Use :func:`locals` to resolve the function name::" msgstr "" -#: ../../faq/programming.rst:961 +#: ../../faq/programming.rst:982 msgid "" "Is there an equivalent to Perl's chomp() for removing trailing newlines from " "strings?" msgstr "" -#: ../../faq/programming.rst:963 +#: ../../faq/programming.rst:984 msgid "" "You can use ``S.rstrip(\"\\r\\n\")`` to remove all occurrences of any line " "terminator from the end of the string ``S`` without removing other trailing " @@ -1050,21 +1066,21 @@ msgid "" "removed::" msgstr "" -#: ../../faq/programming.rst:975 +#: ../../faq/programming.rst:996 msgid "" "Since this is typically only desired when reading text one line at a time, " "using ``S.rstrip()`` this way works well." msgstr "" -#: ../../faq/programming.rst:980 +#: ../../faq/programming.rst:1001 msgid "Is there a scanf() or sscanf() equivalent?" msgstr "" -#: ../../faq/programming.rst:982 +#: ../../faq/programming.rst:1003 msgid "Not as such." msgstr "" -#: ../../faq/programming.rst:984 +#: ../../faq/programming.rst:1005 msgid "" "For simple input parsing, the easiest approach is usually to split the line " "into whitespace-delimited words using the :meth:`~str.split` method of " @@ -1074,86 +1090,86 @@ msgid "" "as a separator." msgstr "" -#: ../../faq/programming.rst:990 +#: ../../faq/programming.rst:1011 msgid "" "For more complicated input parsing, regular expressions are more powerful " "than C's :c:func:`sscanf` and better suited for the task." msgstr "" -#: ../../faq/programming.rst:995 +#: ../../faq/programming.rst:1016 msgid "What does 'UnicodeDecodeError' or 'UnicodeEncodeError' error mean?" msgstr "" -#: ../../faq/programming.rst:997 +#: ../../faq/programming.rst:1018 msgid "See the :ref:`unicode-howto`." msgstr "" -#: ../../faq/programming.rst:1001 +#: ../../faq/programming.rst:1022 msgid "Performance" msgstr "" -#: ../../faq/programming.rst:1004 +#: ../../faq/programming.rst:1025 msgid "My program is too slow. How do I speed it up?" msgstr "" -#: ../../faq/programming.rst:1006 +#: ../../faq/programming.rst:1027 msgid "" "That's a tough one, in general. First, here are a list of things to " "remember before diving further:" msgstr "" -#: ../../faq/programming.rst:1009 +#: ../../faq/programming.rst:1030 msgid "" "Performance characteristics vary across Python implementations. This FAQ " "focuses on :term:`CPython`." msgstr "" -#: ../../faq/programming.rst:1011 +#: ../../faq/programming.rst:1032 msgid "" "Behaviour can vary across operating systems, especially when talking about I/" "O or multi-threading." msgstr "" -#: ../../faq/programming.rst:1013 +#: ../../faq/programming.rst:1034 msgid "" "You should always find the hot spots in your program *before* attempting to " "optimize any code (see the :mod:`profile` module)." msgstr "" -#: ../../faq/programming.rst:1015 +#: ../../faq/programming.rst:1036 msgid "" "Writing benchmark scripts will allow you to iterate quickly when searching " "for improvements (see the :mod:`timeit` module)." msgstr "" -#: ../../faq/programming.rst:1017 +#: ../../faq/programming.rst:1038 msgid "" "It is highly recommended to have good code coverage (through unit testing or " "any other technique) before potentially introducing regressions hidden in " "sophisticated optimizations." msgstr "" -#: ../../faq/programming.rst:1021 +#: ../../faq/programming.rst:1042 msgid "" "That being said, there are many tricks to speed up Python code. Here are " "some general principles which go a long way towards reaching acceptable " "performance levels:" msgstr "" -#: ../../faq/programming.rst:1025 +#: ../../faq/programming.rst:1046 msgid "" "Making your algorithms faster (or changing to faster ones) can yield much " "larger benefits than trying to sprinkle micro-optimization tricks all over " "your code." msgstr "" -#: ../../faq/programming.rst:1029 +#: ../../faq/programming.rst:1050 msgid "" "Use the right data structures. Study documentation for the :ref:`bltin-" "types` and the :mod:`collections` module." msgstr "" -#: ../../faq/programming.rst:1032 +#: ../../faq/programming.rst:1053 msgid "" "When the standard library provides a primitive for doing something, it is " "likely (although not guaranteed) to be faster than any alternative you may " @@ -1164,7 +1180,7 @@ msgid "" "advanced usage)." msgstr "" -#: ../../faq/programming.rst:1040 +#: ../../faq/programming.rst:1061 msgid "" "Abstractions tend to create indirections and force the interpreter to work " "more. If the levels of indirection outweigh the amount of useful work done, " @@ -1173,7 +1189,7 @@ msgid "" "detrimental to readability)." msgstr "" -#: ../../faq/programming.rst:1046 +#: ../../faq/programming.rst:1067 msgid "" "If you have reached the limit of what pure Python can allow, there are tools " "to take you further away. For example, `Cython `_ can " @@ -1185,17 +1201,17 @@ msgid "" "yourself." msgstr "" -#: ../../faq/programming.rst:1056 +#: ../../faq/programming.rst:1077 msgid "" "The wiki page devoted to `performance tips `_." msgstr "" -#: ../../faq/programming.rst:1062 +#: ../../faq/programming.rst:1083 msgid "What is the most efficient way to concatenate many strings together?" msgstr "" -#: ../../faq/programming.rst:1064 +#: ../../faq/programming.rst:1085 msgid "" ":class:`str` and :class:`bytes` objects are immutable, therefore " "concatenating many strings together is inefficient as each concatenation " @@ -1203,38 +1219,38 @@ msgid "" "quadratic in the total string length." msgstr "" -#: ../../faq/programming.rst:1069 +#: ../../faq/programming.rst:1090 msgid "" "To accumulate many :class:`str` objects, the recommended idiom is to place " "them into a list and call :meth:`str.join` at the end::" msgstr "" -#: ../../faq/programming.rst:1077 +#: ../../faq/programming.rst:1098 msgid "(another reasonably efficient idiom is to use :class:`io.StringIO`)" msgstr "" -#: ../../faq/programming.rst:1079 +#: ../../faq/programming.rst:1100 msgid "" "To accumulate many :class:`bytes` objects, the recommended idiom is to " "extend a :class:`bytearray` object using in-place concatenation (the ``+=`` " "operator)::" msgstr "" -#: ../../faq/programming.rst:1088 +#: ../../faq/programming.rst:1109 msgid "Sequences (Tuples/Lists)" msgstr "" -#: ../../faq/programming.rst:1091 +#: ../../faq/programming.rst:1112 msgid "How do I convert between tuples and lists?" msgstr "" -#: ../../faq/programming.rst:1093 +#: ../../faq/programming.rst:1114 msgid "" "The type constructor ``tuple(seq)`` converts any sequence (actually, any " "iterable) into a tuple with the same items in the same order." msgstr "" -#: ../../faq/programming.rst:1096 +#: ../../faq/programming.rst:1117 msgid "" "For example, ``tuple([1, 2, 3])`` yields ``(1, 2, 3)`` and ``tuple('abc')`` " "yields ``('a', 'b', 'c')``. If the argument is a tuple, it does not make a " @@ -1242,7 +1258,7 @@ msgid "" "you aren't sure that an object is already a tuple." msgstr "" -#: ../../faq/programming.rst:1101 +#: ../../faq/programming.rst:1122 msgid "" "The type constructor ``list(seq)`` converts any sequence or iterable into a " "list with the same items in the same order. For example, ``list((1, 2, " @@ -1250,11 +1266,11 @@ msgid "" "If the argument is a list, it makes a copy just like ``seq[:]`` would." msgstr "" -#: ../../faq/programming.rst:1108 +#: ../../faq/programming.rst:1129 msgid "What's a negative index?" msgstr "" -#: ../../faq/programming.rst:1110 +#: ../../faq/programming.rst:1131 msgid "" "Python sequences are indexed with positive numbers and negative numbers. " "For positive numbers 0 is the first index 1 is the second index and so " @@ -1263,62 +1279,62 @@ msgid "" "``seq[len(seq)-n]``." msgstr "" -#: ../../faq/programming.rst:1115 +#: ../../faq/programming.rst:1136 msgid "" "Using negative indices can be very convenient. For example ``S[:-1]`` is " "all of the string except for its last character, which is useful for " "removing the trailing newline from a string." msgstr "" -#: ../../faq/programming.rst:1121 +#: ../../faq/programming.rst:1142 msgid "How do I iterate over a sequence in reverse order?" msgstr "" -#: ../../faq/programming.rst:1123 +#: ../../faq/programming.rst:1144 msgid "Use the :func:`reversed` built-in function::" msgstr "" -#: ../../faq/programming.rst:1128 +#: ../../faq/programming.rst:1149 msgid "" "This won't touch your original sequence, but build a new copy with reversed " "order to iterate over." msgstr "" -#: ../../faq/programming.rst:1133 +#: ../../faq/programming.rst:1154 msgid "How do you remove duplicates from a list?" msgstr "" -#: ../../faq/programming.rst:1135 +#: ../../faq/programming.rst:1156 msgid "See the Python Cookbook for a long discussion of many ways to do this:" msgstr "" -#: ../../faq/programming.rst:1137 +#: ../../faq/programming.rst:1158 msgid "https://code.activestate.com/recipes/52560/" msgstr "" -#: ../../faq/programming.rst:1139 +#: ../../faq/programming.rst:1160 msgid "" "If you don't mind reordering the list, sort it and then scan from the end of " "the list, deleting duplicates as you go::" msgstr "" -#: ../../faq/programming.rst:1151 +#: ../../faq/programming.rst:1172 msgid "" "If all elements of the list may be used as set keys (i.e. they are all :term:" "`hashable`) this is often faster ::" msgstr "" -#: ../../faq/programming.rst:1156 +#: ../../faq/programming.rst:1177 msgid "" "This converts the list into a set, thereby removing duplicates, and then " "back into a list." msgstr "" -#: ../../faq/programming.rst:1161 +#: ../../faq/programming.rst:1182 msgid "How do you remove multiple items from a list" msgstr "" -#: ../../faq/programming.rst:1163 +#: ../../faq/programming.rst:1184 msgid "" "As with removing duplicates, explicitly iterating in reverse with a delete " "condition is one possibility. However, it is easier and faster to use slice " @@ -1326,26 +1342,26 @@ msgid "" "variations.::" msgstr "" -#: ../../faq/programming.rst:1172 +#: ../../faq/programming.rst:1193 msgid "The list comprehension may be fastest." msgstr "" -#: ../../faq/programming.rst:1176 +#: ../../faq/programming.rst:1197 msgid "How do you make an array in Python?" msgstr "" -#: ../../faq/programming.rst:1178 +#: ../../faq/programming.rst:1199 msgid "Use a list::" msgstr "" -#: ../../faq/programming.rst:1182 +#: ../../faq/programming.rst:1203 msgid "" "Lists are equivalent to C or Pascal arrays in their time complexity; the " "primary difference is that a Python list can contain objects of many " "different types." msgstr "" -#: ../../faq/programming.rst:1185 +#: ../../faq/programming.rst:1206 msgid "" "The ``array`` module also provides methods for creating arrays of fixed " "types with compact representations, but they are slower to index than " @@ -1353,12 +1369,12 @@ msgid "" "like structures with various characteristics as well." msgstr "" -#: ../../faq/programming.rst:1190 +#: ../../faq/programming.rst:1211 msgid "" "To get Lisp-style linked lists, you can emulate cons cells using tuples::" msgstr "" -#: ../../faq/programming.rst:1194 +#: ../../faq/programming.rst:1215 msgid "" "If mutability is desired, you could use lists instead of tuples. Here the " "analogue of lisp car is ``lisp_list[0]`` and the analogue of cdr is " @@ -1366,23 +1382,23 @@ msgid "" "it's usually a lot slower than using Python lists." msgstr "" -#: ../../faq/programming.rst:1203 +#: ../../faq/programming.rst:1224 msgid "How do I create a multidimensional list?" msgstr "" -#: ../../faq/programming.rst:1205 +#: ../../faq/programming.rst:1226 msgid "You probably tried to make a multidimensional array like this::" msgstr "" -#: ../../faq/programming.rst:1209 +#: ../../faq/programming.rst:1230 msgid "This looks correct if you print it:" msgstr "" -#: ../../faq/programming.rst:1220 +#: ../../faq/programming.rst:1241 msgid "But when you assign a value, it shows up in multiple places:" msgstr "" -#: ../../faq/programming.rst:1232 +#: ../../faq/programming.rst:1253 msgid "" "The reason is that replicating a list with ``*`` doesn't create copies, it " "only creates references to the existing objects. The ``*3`` creates a list " @@ -1390,56 +1406,56 @@ msgid "" "will show in all rows, which is almost certainly not what you want." msgstr "" -#: ../../faq/programming.rst:1237 +#: ../../faq/programming.rst:1258 msgid "" "The suggested approach is to create a list of the desired length first and " "then fill in each element with a newly created list::" msgstr "" -#: ../../faq/programming.rst:1244 +#: ../../faq/programming.rst:1265 msgid "" "This generates a list containing 3 different lists of length two. You can " "also use a list comprehension::" msgstr "" -#: ../../faq/programming.rst:1250 +#: ../../faq/programming.rst:1271 msgid "" "Or, you can use an extension that provides a matrix datatype; `NumPy `_ is the best known." msgstr "" -#: ../../faq/programming.rst:1255 +#: ../../faq/programming.rst:1276 msgid "How do I apply a method to a sequence of objects?" msgstr "" -#: ../../faq/programming.rst:1257 +#: ../../faq/programming.rst:1278 msgid "Use a list comprehension::" msgstr "" -#: ../../faq/programming.rst:1264 +#: ../../faq/programming.rst:1285 msgid "" "Why does a_tuple[i] += ['item'] raise an exception when the addition works?" msgstr "" -#: ../../faq/programming.rst:1266 +#: ../../faq/programming.rst:1287 msgid "" "This is because of a combination of the fact that augmented assignment " "operators are *assignment* operators, and the difference between mutable and " "immutable objects in Python." msgstr "" -#: ../../faq/programming.rst:1270 +#: ../../faq/programming.rst:1291 msgid "" "This discussion applies in general when augmented assignment operators are " "applied to elements of a tuple that point to mutable objects, but we'll use " "a ``list`` and ``+=`` as our exemplar." msgstr "" -#: ../../faq/programming.rst:1274 +#: ../../faq/programming.rst:1295 msgid "If you wrote::" msgstr "" -#: ../../faq/programming.rst:1282 +#: ../../faq/programming.rst:1303 msgid "" "The reason for the exception should be immediately clear: ``1`` is added to " "the object ``a_tuple[0]`` points to (``1``), producing the result object, " @@ -1448,29 +1464,29 @@ msgid "" "an element of a tuple points to." msgstr "" -#: ../../faq/programming.rst:1288 +#: ../../faq/programming.rst:1309 msgid "" "Under the covers, what this augmented assignment statement is doing is " "approximately this::" msgstr "" -#: ../../faq/programming.rst:1297 +#: ../../faq/programming.rst:1318 msgid "" "It is the assignment part of the operation that produces the error, since a " "tuple is immutable." msgstr "" -#: ../../faq/programming.rst:1300 +#: ../../faq/programming.rst:1321 msgid "When you write something like::" msgstr "" -#: ../../faq/programming.rst:1308 +#: ../../faq/programming.rst:1329 msgid "" "The exception is a bit more surprising, and even more surprising is the fact " "that even though there was an error, the append worked::" msgstr "" -#: ../../faq/programming.rst:1314 +#: ../../faq/programming.rst:1335 msgid "" "To see why this happens, you need to know that (a) if an object implements " "an ``__iadd__`` magic method, it gets called when the ``+=`` augmented " @@ -1480,11 +1496,11 @@ msgid "" "that for lists, ``+=`` is a \"shorthand\" for ``list.extend``::" msgstr "" -#: ../../faq/programming.rst:1326 +#: ../../faq/programming.rst:1347 msgid "This is equivalent to::" msgstr "" -#: ../../faq/programming.rst:1331 +#: ../../faq/programming.rst:1352 msgid "" "The object pointed to by a_list has been mutated, and the pointer to the " "mutated object is assigned back to ``a_list``. The end result of the " @@ -1492,11 +1508,11 @@ msgid "" "``a_list`` was previously pointing to, but the assignment still happens." msgstr "" -#: ../../faq/programming.rst:1336 +#: ../../faq/programming.rst:1357 msgid "Thus, in our tuple example what is happening is equivalent to::" msgstr "" -#: ../../faq/programming.rst:1344 +#: ../../faq/programming.rst:1365 msgid "" "The ``__iadd__`` succeeds, and thus the list is extended, but even though " "``result`` points to the same object that ``a_tuple[0]`` already points to, " @@ -1504,13 +1520,13 @@ msgid "" "immutable." msgstr "" -#: ../../faq/programming.rst:1350 +#: ../../faq/programming.rst:1371 msgid "" "I want to do a complicated sort: can you do a Schwartzian Transform in " "Python?" msgstr "" -#: ../../faq/programming.rst:1352 +#: ../../faq/programming.rst:1373 msgid "" "The technique, attributed to Randal Schwartz of the Perl community, sorts " "the elements of a list by a metric which maps each element to its \"sort " @@ -1518,25 +1534,25 @@ msgid "" "method::" msgstr "" -#: ../../faq/programming.rst:1361 +#: ../../faq/programming.rst:1382 msgid "How can I sort one list by values from another list?" msgstr "" -#: ../../faq/programming.rst:1363 +#: ../../faq/programming.rst:1384 msgid "" "Merge them into an iterator of tuples, sort the resulting list, and then " "pick out the element you want. ::" msgstr "" -#: ../../faq/programming.rst:1378 +#: ../../faq/programming.rst:1399 msgid "Objects" msgstr "" -#: ../../faq/programming.rst:1381 +#: ../../faq/programming.rst:1402 msgid "What is a class?" msgstr "" -#: ../../faq/programming.rst:1383 +#: ../../faq/programming.rst:1404 msgid "" "A class is the particular object type created by executing a class " "statement. Class objects are used as templates to create instance objects, " @@ -1544,7 +1560,7 @@ msgid "" "datatype." msgstr "" -#: ../../faq/programming.rst:1387 +#: ../../faq/programming.rst:1408 msgid "" "A class can be based on one or more other classes, called its base " "class(es). It then inherits the attributes and methods of its base classes. " @@ -1554,22 +1570,22 @@ msgid "" "``OutlookMailbox`` that handle various specific mailbox formats." msgstr "" -#: ../../faq/programming.rst:1396 +#: ../../faq/programming.rst:1417 msgid "What is a method?" msgstr "" -#: ../../faq/programming.rst:1398 +#: ../../faq/programming.rst:1419 msgid "" "A method is a function on some object ``x`` that you normally call as ``x." "name(arguments...)``. Methods are defined as functions inside the class " "definition::" msgstr "" -#: ../../faq/programming.rst:1408 +#: ../../faq/programming.rst:1429 msgid "What is self?" msgstr "" -#: ../../faq/programming.rst:1410 +#: ../../faq/programming.rst:1431 msgid "" "Self is merely a conventional name for the first argument of a method. A " "method defined as ``meth(self, a, b, c)`` should be called as ``x.meth(a, b, " @@ -1577,17 +1593,17 @@ msgid "" "the called method will think it is called as ``meth(x, a, b, c)``." msgstr "" -#: ../../faq/programming.rst:1415 +#: ../../faq/programming.rst:1436 msgid "See also :ref:`why-self`." msgstr "" -#: ../../faq/programming.rst:1419 +#: ../../faq/programming.rst:1440 msgid "" "How do I check if an object is an instance of a given class or of a subclass " "of it?" msgstr "" -#: ../../faq/programming.rst:1421 +#: ../../faq/programming.rst:1442 msgid "" "Use the built-in function ``isinstance(obj, cls)``. You can check if an " "object is an instance of any of a number of classes by providing a tuple " @@ -1596,7 +1612,7 @@ msgid "" "``isinstance(obj, str)`` or ``isinstance(obj, (int, float, complex))``." msgstr "" -#: ../../faq/programming.rst:1427 +#: ../../faq/programming.rst:1448 msgid "" "Note that :func:`isinstance` also checks for virtual inheritance from an :" "term:`abstract base class`. So, the test will return ``True`` for a " @@ -1604,7 +1620,7 @@ msgid "" "To test for \"true inheritance\", scan the :term:`MRO` of the class:" msgstr "" -#: ../../faq/programming.rst:1462 +#: ../../faq/programming.rst:1483 msgid "" "Note that most programs do not use :func:`isinstance` on user-defined " "classes very often. If you are developing the classes yourself, a more " @@ -1614,17 +1630,17 @@ msgid "" "have a function that does something::" msgstr "" -#: ../../faq/programming.rst:1476 +#: ../../faq/programming.rst:1497 msgid "" "A better approach is to define a ``search()`` method on all the classes and " "just call it::" msgstr "" -#: ../../faq/programming.rst:1491 +#: ../../faq/programming.rst:1512 msgid "What is delegation?" msgstr "" -#: ../../faq/programming.rst:1493 +#: ../../faq/programming.rst:1514 msgid "" "Delegation is an object oriented technique (also called a design pattern). " "Let's say you have an object ``x`` and want to change the behaviour of just " @@ -1633,14 +1649,14 @@ msgid "" "other methods to the corresponding method of ``x``." msgstr "" -#: ../../faq/programming.rst:1499 +#: ../../faq/programming.rst:1520 msgid "" "Python programmers can easily implement delegation. For example, the " "following class implements a class that behaves like a file but converts all " "written data to uppercase::" msgstr "" -#: ../../faq/programming.rst:1514 +#: ../../faq/programming.rst:1535 msgid "" "Here the ``UpperOut`` class redefines the ``write()`` method to convert the " "argument string to uppercase before calling the underlying ``self._outfile." @@ -1650,7 +1666,7 @@ msgid "" "information about controlling attribute access." msgstr "" -#: ../../faq/programming.rst:1521 +#: ../../faq/programming.rst:1542 msgid "" "Note that for more general cases delegation can get trickier. When " "attributes must be set as well as retrieved, the class must define a :meth:" @@ -1659,23 +1675,23 @@ msgid "" "following::" msgstr "" -#: ../../faq/programming.rst:1532 +#: ../../faq/programming.rst:1553 msgid "" "Most :meth:`__setattr__` implementations must modify ``self.__dict__`` to " "store local state for self without causing an infinite recursion." msgstr "" -#: ../../faq/programming.rst:1537 +#: ../../faq/programming.rst:1558 msgid "" "How do I call a method defined in a base class from a derived class that " "overrides it?" msgstr "" -#: ../../faq/programming.rst:1539 +#: ../../faq/programming.rst:1560 msgid "Use the built-in :func:`super` function::" msgstr "" -#: ../../faq/programming.rst:1545 +#: ../../faq/programming.rst:1566 msgid "" "For version prior to 3.0, you may be using classic classes: For a class " "definition such as ``class Derived(Base): ...`` you can call method " @@ -1684,11 +1700,11 @@ msgid "" "you need to provide the ``self`` argument." msgstr "" -#: ../../faq/programming.rst:1553 +#: ../../faq/programming.rst:1574 msgid "How can I organize my code to make it easier to change the base class?" msgstr "" -#: ../../faq/programming.rst:1555 +#: ../../faq/programming.rst:1576 msgid "" "You could assign the base class to an alias and derive from the alias. Then " "all you have to change is the value assigned to the alias. Incidentally, " @@ -1696,30 +1712,30 @@ msgid "" "on availability of resources) which base class to use. Example::" msgstr "" -#: ../../faq/programming.rst:1570 +#: ../../faq/programming.rst:1591 msgid "How do I create static class data and static class methods?" msgstr "" -#: ../../faq/programming.rst:1572 +#: ../../faq/programming.rst:1593 msgid "" "Both static data and static methods (in the sense of C++ or Java) are " "supported in Python." msgstr "" -#: ../../faq/programming.rst:1575 +#: ../../faq/programming.rst:1596 msgid "" "For static data, simply define a class attribute. To assign a new value to " "the attribute, you have to explicitly use the class name in the assignment::" msgstr "" -#: ../../faq/programming.rst:1587 +#: ../../faq/programming.rst:1608 msgid "" "``c.count`` also refers to ``C.count`` for any ``c`` such that " "``isinstance(c, C)`` holds, unless overridden by ``c`` itself or by some " "class on the base-class search path from ``c.__class__`` back to ``C``." msgstr "" -#: ../../faq/programming.rst:1591 +#: ../../faq/programming.rst:1612 msgid "" "Caution: within a method of C, an assignment like ``self.count = 42`` " "creates a new and unrelated instance named \"count\" in ``self``'s own " @@ -1727,59 +1743,59 @@ msgid "" "whether inside a method or not::" msgstr "" -#: ../../faq/programming.rst:1598 +#: ../../faq/programming.rst:1619 msgid "Static methods are possible::" msgstr "" -#: ../../faq/programming.rst:1606 +#: ../../faq/programming.rst:1627 msgid "" "However, a far more straightforward way to get the effect of a static method " "is via a simple module-level function::" msgstr "" -#: ../../faq/programming.rst:1612 +#: ../../faq/programming.rst:1633 msgid "" "If your code is structured so as to define one class (or tightly related " "class hierarchy) per module, this supplies the desired encapsulation." msgstr "" -#: ../../faq/programming.rst:1617 +#: ../../faq/programming.rst:1638 msgid "How can I overload constructors (or methods) in Python?" msgstr "" -#: ../../faq/programming.rst:1619 +#: ../../faq/programming.rst:1640 msgid "" "This answer actually applies to all methods, but the question usually comes " "up first in the context of constructors." msgstr "" -#: ../../faq/programming.rst:1622 +#: ../../faq/programming.rst:1643 msgid "In C++ you'd write" msgstr "" -#: ../../faq/programming.rst:1631 +#: ../../faq/programming.rst:1652 msgid "" "In Python you have to write a single constructor that catches all cases " "using default arguments. For example::" msgstr "" -#: ../../faq/programming.rst:1641 +#: ../../faq/programming.rst:1662 msgid "This is not entirely equivalent, but close enough in practice." msgstr "" -#: ../../faq/programming.rst:1643 +#: ../../faq/programming.rst:1664 msgid "You could also try a variable-length argument list, e.g. ::" msgstr "" -#: ../../faq/programming.rst:1648 +#: ../../faq/programming.rst:1669 msgid "The same approach works for all method definitions." msgstr "" -#: ../../faq/programming.rst:1652 +#: ../../faq/programming.rst:1673 msgid "I try to use __spam and I get an error about _SomeClassName__spam." msgstr "" -#: ../../faq/programming.rst:1654 +#: ../../faq/programming.rst:1675 msgid "" "Variable names with double leading underscores are \"mangled\" to provide a " "simple but effective way to define class private variables. Any identifier " @@ -1789,7 +1805,7 @@ msgid "" "stripped." msgstr "" -#: ../../faq/programming.rst:1660 +#: ../../faq/programming.rst:1681 msgid "" "This doesn't guarantee privacy: an outside user can still deliberately " "access the \"_classname__spam\" attribute, and private values are visible in " @@ -1797,22 +1813,22 @@ msgid "" "private variable names at all." msgstr "" -#: ../../faq/programming.rst:1667 +#: ../../faq/programming.rst:1688 msgid "My class defines __del__ but it is not called when I delete the object." msgstr "" -#: ../../faq/programming.rst:1669 +#: ../../faq/programming.rst:1690 msgid "There are several possible reasons for this." msgstr "" -#: ../../faq/programming.rst:1671 +#: ../../faq/programming.rst:1692 msgid "" "The del statement does not necessarily call :meth:`__del__` -- it simply " "decrements the object's reference count, and if this reaches zero :meth:" "`__del__` is called." msgstr "" -#: ../../faq/programming.rst:1675 +#: ../../faq/programming.rst:1696 msgid "" "If your data structures contain circular links (e.g. a tree where each child " "has a parent reference and each parent has a list of children) the reference " @@ -1826,7 +1842,7 @@ msgid "" "cases where objects will never be collected." msgstr "" -#: ../../faq/programming.rst:1686 +#: ../../faq/programming.rst:1707 msgid "" "Despite the cycle collector, it's still a good idea to define an explicit " "``close()`` method on objects to be called whenever you're done with them. " @@ -1836,7 +1852,7 @@ msgid "" "once for the same object." msgstr "" -#: ../../faq/programming.rst:1693 +#: ../../faq/programming.rst:1714 msgid "" "Another way to avoid cyclical references is to use the :mod:`weakref` " "module, which allows you to point to objects without incrementing their " @@ -1844,28 +1860,28 @@ msgid "" "references for their parent and sibling references (if they need them!)." msgstr "" -#: ../../faq/programming.rst:1706 +#: ../../faq/programming.rst:1727 msgid "" "Finally, if your :meth:`__del__` method raises an exception, a warning " "message is printed to :data:`sys.stderr`." msgstr "" -#: ../../faq/programming.rst:1711 +#: ../../faq/programming.rst:1732 msgid "How do I get a list of all instances of a given class?" msgstr "" -#: ../../faq/programming.rst:1713 +#: ../../faq/programming.rst:1734 msgid "" "Python does not keep track of all instances of a class (or of a built-in " "type). You can program the class's constructor to keep track of all " "instances by keeping a list of weak references to each instance." msgstr "" -#: ../../faq/programming.rst:1719 +#: ../../faq/programming.rst:1740 msgid "Why does the result of ``id()`` appear to be not unique?" msgstr "" -#: ../../faq/programming.rst:1721 +#: ../../faq/programming.rst:1742 msgid "" "The :func:`id` builtin returns an integer that is guaranteed to be unique " "during the lifetime of the object. Since in CPython, this is the object's " @@ -1874,7 +1890,7 @@ msgid "" "memory. This is illustrated by this example:" msgstr "" -#: ../../faq/programming.rst:1732 +#: ../../faq/programming.rst:1753 msgid "" "The two ids belong to different integer objects that are created before, and " "deleted immediately after execution of the ``id()`` call. To be sure that " @@ -1882,17 +1898,17 @@ msgid "" "reference to the object:" msgstr "" -#: ../../faq/programming.rst:1745 +#: ../../faq/programming.rst:1766 msgid "When can I rely on identity tests with the *is* operator?" msgstr "" -#: ../../faq/programming.rst:1747 +#: ../../faq/programming.rst:1768 msgid "" "The ``is`` operator tests for object identity. The test ``a is b`` is " "equivalent to ``id(a) == id(b)``." msgstr "" -#: ../../faq/programming.rst:1750 +#: ../../faq/programming.rst:1771 msgid "" "The most important property of an identity test is that an object is always " "identical to itself, ``a is a`` always returns ``True``. Identity tests are " @@ -1900,34 +1916,34 @@ msgid "" "tests are guaranteed to return a boolean ``True`` or ``False``." msgstr "" -#: ../../faq/programming.rst:1755 +#: ../../faq/programming.rst:1776 msgid "" "However, identity tests can *only* be substituted for equality tests when " "object identity is assured. Generally, there are three circumstances where " "identity is guaranteed:" msgstr "" -#: ../../faq/programming.rst:1759 +#: ../../faq/programming.rst:1780 msgid "" "1) Assignments create new names but do not change object identity. After " "the assignment ``new = old``, it is guaranteed that ``new is old``." msgstr "" -#: ../../faq/programming.rst:1762 +#: ../../faq/programming.rst:1783 msgid "" "2) Putting an object in a container that stores object references does not " "change object identity. After the list assignment ``s[0] = x``, it is " "guaranteed that ``s[0] is x``." msgstr "" -#: ../../faq/programming.rst:1766 +#: ../../faq/programming.rst:1787 msgid "" "3) If an object is a singleton, it means that only one instance of that " "object can exist. After the assignments ``a = None`` and ``b = None``, it " "is guaranteed that ``a is b`` because ``None`` is a singleton." msgstr "" -#: ../../faq/programming.rst:1770 +#: ../../faq/programming.rst:1791 msgid "" "In most other circumstances, identity tests are inadvisable and equality " "tests are preferred. In particular, identity tests should not be used to " @@ -1935,17 +1951,17 @@ msgid "" "guaranteed to be singletons::" msgstr "" -#: ../../faq/programming.rst:1787 +#: ../../faq/programming.rst:1808 msgid "Likewise, new instances of mutable containers are never identical::" msgstr "" -#: ../../faq/programming.rst:1794 +#: ../../faq/programming.rst:1815 msgid "" "In the standard library code, you will see several common patterns for " "correctly using identity tests:" msgstr "" -#: ../../faq/programming.rst:1797 +#: ../../faq/programming.rst:1818 msgid "" "1) As recommended by :pep:`8`, an identity test is the preferred way to " "check for ``None``. This reads like plain English in code and avoids " @@ -1953,7 +1969,7 @@ msgid "" "false." msgstr "" -#: ../../faq/programming.rst:1801 +#: ../../faq/programming.rst:1822 msgid "" "2) Detecting optional arguments can be tricky when ``None`` is a valid input " "value. In those situations, you can create an singleton sentinel object " @@ -1961,25 +1977,25 @@ msgid "" "implement a method that behaves like :meth:`dict.pop`::" msgstr "" -#: ../../faq/programming.rst:1817 +#: ../../faq/programming.rst:1838 msgid "" "3) Container implementations sometimes need to augment equality tests with " "identity tests. This prevents the code from being confused by objects such " "as ``float('NaN')`` that are not equal to themselves." msgstr "" -#: ../../faq/programming.rst:1821 +#: ../../faq/programming.rst:1842 msgid "" "For example, here is the implementation of :meth:`collections.abc.Sequence." "__contains__`::" msgstr "" -#: ../../faq/programming.rst:1832 +#: ../../faq/programming.rst:1853 msgid "" "How can a subclass control what data is stored in an immutable instance?" msgstr "" -#: ../../faq/programming.rst:1834 +#: ../../faq/programming.rst:1855 msgid "" "When subclassing an immutable type, override the :meth:`__new__` method " "instead of the :meth:`__init__` method. The latter only runs *after* an " @@ -1987,25 +2003,25 @@ msgid "" "instance." msgstr "" -#: ../../faq/programming.rst:1839 +#: ../../faq/programming.rst:1860 msgid "" "All of these immutable classes have a different signature than their parent " "class:" msgstr "" -#: ../../faq/programming.rst:1865 +#: ../../faq/programming.rst:1886 msgid "The classes can be used like this:" msgstr "" -#: ../../faq/programming.rst:1880 +#: ../../faq/programming.rst:1901 msgid "Modules" msgstr "" -#: ../../faq/programming.rst:1883 +#: ../../faq/programming.rst:1904 msgid "How do I create a .pyc file?" msgstr "" -#: ../../faq/programming.rst:1885 +#: ../../faq/programming.rst:1906 msgid "" "When a module is imported for the first time (or when the source file has " "changed since the current compiled file was created) a ``.pyc`` file " @@ -2016,7 +2032,7 @@ msgid "" "particular ``python`` binary that created it. (See :pep:`3147` for details.)" msgstr "" -#: ../../faq/programming.rst:1893 +#: ../../faq/programming.rst:1914 msgid "" "One reason that a ``.pyc`` file may not be created is a permissions problem " "with the directory containing the source file, meaning that the " @@ -2025,7 +2041,7 @@ msgid "" "testing with a web server." msgstr "" -#: ../../faq/programming.rst:1898 +#: ../../faq/programming.rst:1919 msgid "" "Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " "creation of a .pyc file is automatic if you're importing a module and Python " @@ -2034,7 +2050,7 @@ msgid "" "subdirectory." msgstr "" -#: ../../faq/programming.rst:1903 +#: ../../faq/programming.rst:1924 msgid "" "Running Python on a top level script is not considered an import and no ``." "pyc`` will be created. For example, if you have a top-level module ``foo." @@ -2044,27 +2060,27 @@ msgid "" "for ``foo`` since ``foo.py`` isn't being imported." msgstr "" -#: ../../faq/programming.rst:1910 +#: ../../faq/programming.rst:1931 msgid "" "If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``." "pyc`` file for a module that is not imported -- you can, using the :mod:" "`py_compile` and :mod:`compileall` modules." msgstr "" -#: ../../faq/programming.rst:1914 +#: ../../faq/programming.rst:1935 msgid "" "The :mod:`py_compile` module can manually compile any module. One way is to " "use the ``compile()`` function in that module interactively::" msgstr "" -#: ../../faq/programming.rst:1920 +#: ../../faq/programming.rst:1941 msgid "" "This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " "location as ``foo.py`` (or you can override that with the optional parameter " "``cfile``)." msgstr "" -#: ../../faq/programming.rst:1924 +#: ../../faq/programming.rst:1945 msgid "" "You can also automatically compile all files in a directory or directories " "using the :mod:`compileall` module. You can do it from the shell prompt by " @@ -2072,11 +2088,11 @@ msgid "" "Python files to compile::" msgstr "" -#: ../../faq/programming.rst:1933 +#: ../../faq/programming.rst:1954 msgid "How do I find the current module name?" msgstr "" -#: ../../faq/programming.rst:1935 +#: ../../faq/programming.rst:1956 msgid "" "A module can find out its own module name by looking at the predefined " "global variable ``__name__``. If this has the value ``'__main__'``, the " @@ -2085,76 +2101,76 @@ msgid "" "only execute this code after checking ``__name__``::" msgstr "" -#: ../../faq/programming.rst:1950 +#: ../../faq/programming.rst:1971 msgid "How can I have modules that mutually import each other?" msgstr "" -#: ../../faq/programming.rst:1952 +#: ../../faq/programming.rst:1973 msgid "Suppose you have the following modules:" msgstr "" -#: ../../faq/programming.rst:1954 +#: ../../faq/programming.rst:1975 msgid "foo.py::" msgstr "" -#: ../../faq/programming.rst:1959 +#: ../../faq/programming.rst:1980 msgid "bar.py::" msgstr "" -#: ../../faq/programming.rst:1964 +#: ../../faq/programming.rst:1985 msgid "The problem is that the interpreter will perform the following steps:" msgstr "" -#: ../../faq/programming.rst:1966 +#: ../../faq/programming.rst:1987 msgid "main imports foo" msgstr "" -#: ../../faq/programming.rst:1967 +#: ../../faq/programming.rst:1988 msgid "Empty globals for foo are created" msgstr "" -#: ../../faq/programming.rst:1968 +#: ../../faq/programming.rst:1989 msgid "foo is compiled and starts executing" msgstr "" -#: ../../faq/programming.rst:1969 +#: ../../faq/programming.rst:1990 msgid "foo imports bar" msgstr "" -#: ../../faq/programming.rst:1970 +#: ../../faq/programming.rst:1991 msgid "Empty globals for bar are created" msgstr "" -#: ../../faq/programming.rst:1971 +#: ../../faq/programming.rst:1992 msgid "bar is compiled and starts executing" msgstr "" -#: ../../faq/programming.rst:1972 +#: ../../faq/programming.rst:1993 msgid "" "bar imports foo (which is a no-op since there already is a module named foo)" msgstr "" -#: ../../faq/programming.rst:1973 +#: ../../faq/programming.rst:1994 msgid "bar.foo_var = foo.foo_var" msgstr "" -#: ../../faq/programming.rst:1975 +#: ../../faq/programming.rst:1996 msgid "" "The last step fails, because Python isn't done with interpreting ``foo`` yet " "and the global symbol dictionary for ``foo`` is still empty." msgstr "" -#: ../../faq/programming.rst:1978 +#: ../../faq/programming.rst:1999 msgid "" "The same thing happens when you use ``import foo``, and then try to access " "``foo.foo_var`` in global code." msgstr "" -#: ../../faq/programming.rst:1981 +#: ../../faq/programming.rst:2002 msgid "There are (at least) three possible workarounds for this problem." msgstr "" -#: ../../faq/programming.rst:1983 +#: ../../faq/programming.rst:2004 msgid "" "Guido van Rossum recommends avoiding all uses of ``from import ..." "``, and placing all code inside functions. Initializations of global " @@ -2163,59 +2179,59 @@ msgid "" "``.``." msgstr "" -#: ../../faq/programming.rst:1988 +#: ../../faq/programming.rst:2009 msgid "" "Jim Roskind suggests performing steps in the following order in each module:" msgstr "" -#: ../../faq/programming.rst:1990 +#: ../../faq/programming.rst:2011 msgid "" "exports (globals, functions, and classes that don't need imported base " "classes)" msgstr "" -#: ../../faq/programming.rst:1992 +#: ../../faq/programming.rst:2013 msgid "``import`` statements" msgstr "" -#: ../../faq/programming.rst:1993 +#: ../../faq/programming.rst:2014 msgid "" "active code (including globals that are initialized from imported values)." msgstr "" -#: ../../faq/programming.rst:1995 +#: ../../faq/programming.rst:2016 msgid "" "van Rossum doesn't like this approach much because the imports appear in a " "strange place, but it does work." msgstr "" -#: ../../faq/programming.rst:1998 +#: ../../faq/programming.rst:2019 msgid "" "Matthias Urlichs recommends restructuring your code so that the recursive " "import is not necessary in the first place." msgstr "" -#: ../../faq/programming.rst:2001 +#: ../../faq/programming.rst:2022 msgid "These solutions are not mutually exclusive." msgstr "" -#: ../../faq/programming.rst:2005 +#: ../../faq/programming.rst:2026 msgid "__import__('x.y.z') returns ; how do I get z?" msgstr "" -#: ../../faq/programming.rst:2007 +#: ../../faq/programming.rst:2028 msgid "" "Consider using the convenience function :func:`~importlib.import_module` " "from :mod:`importlib` instead::" msgstr "" -#: ../../faq/programming.rst:2014 +#: ../../faq/programming.rst:2035 msgid "" "When I edit an imported module and reimport it, the changes don't show up. " "Why does this happen?" msgstr "" -#: ../../faq/programming.rst:2016 +#: ../../faq/programming.rst:2037 msgid "" "For reasons of efficiency as well as consistency, Python only reads the " "module file on the first time a module is imported. If it didn't, in a " @@ -2224,13 +2240,13 @@ msgid "" "re-reading of a changed module, do this::" msgstr "" -#: ../../faq/programming.rst:2026 +#: ../../faq/programming.rst:2047 msgid "" "Warning: this technique is not 100% fool-proof. In particular, modules " "containing statements like ::" msgstr "" -#: ../../faq/programming.rst:2031 +#: ../../faq/programming.rst:2052 msgid "" "will continue to work with the old version of the imported objects. If the " "module contains class definitions, existing class instances will *not* be " @@ -2238,7 +2254,7 @@ msgid "" "paradoxical behaviour::" msgstr "" -#: ../../faq/programming.rst:2044 +#: ../../faq/programming.rst:2065 msgid "" "The nature of the problem is made clear if you print out the \"identity\" of " "the class objects::" diff --git a/library/hashlib.po b/library/hashlib.po index 64c7992fd6..a2e3953533 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-29 00:11+0000\n" +"POT-Creation-Date: 2021-10-12 19:07+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -584,9 +584,8 @@ msgstr "" msgid "" "Keyed hashing can be used for authentication as a faster and simpler " "replacement for `Hash-based message authentication code `_ (HMAC). BLAKE2 " -"can be securely used in prefix-MAC mode thanks to the indifferentiability " -"property inherited from BLAKE." +"wikipedia.org/wiki/HMAC>`_ (HMAC). BLAKE2 can be securely used in prefix-MAC " +"mode thanks to the indifferentiability property inherited from BLAKE." msgstr "" #: ../../library/hashlib.rst:503 diff --git a/library/html.entities.po b/library/html.entities.po index 34c87914a8..75117c4560 100644 --- a/library/html.entities.po +++ b/library/html.entities.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2021-10-12 19:07+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,5 +61,7 @@ msgid "Footnotes" msgstr "註解" #: ../../library/html.entities.rst:47 -msgid "See https://www.w3.org/TR/html5/syntax.html#named-character-references" +msgid "" +"See https://html.spec.whatwg.org/multipage/syntax.html#named-character-" +"references" msgstr "" diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index 1005383785..2759989ccb 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-10-12 19:07+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -165,7 +165,7 @@ msgid "" msgstr "" #: ../../library/http.cookiejar.rst:129 -msgid "https://curl.haxx.se/rfc/cookie_spec.html" +msgid "https://curl.se/rfc/cookie_spec.html" msgstr "" #: ../../library/http.cookiejar.rst:126 diff --git a/library/ipaddress.po b/library/ipaddress.po index 735c7bb159..fb3c3c2626 100644 --- a/library/ipaddress.po +++ b/library/ipaddress.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-29 00:11+0000\n" +"POT-Creation-Date: 2021-10-12 19:07+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -674,7 +674,7 @@ msgstr "" #: ../../library/ipaddress.rst:683 msgid "" "Note that currently expanded netmasks are not supported. That means ``2001:" -"db00::0/24`` is a valid argument while ``2001:db00::0/ffff:ff00::`` not." +"db00::0/24`` is a valid argument while ``2001:db00::0/ffff:ff00::`` is not." msgstr "" #: ../../library/ipaddress.rst:687 diff --git a/library/json.po b/library/json.po index 4274c24a9a..a169910e09 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-12 19:07+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,12 +29,12 @@ msgstr "" #: ../../library/json.rst:14 msgid "" -"`JSON (JavaScript Object Notation) `_, specified by :rfc:" -"`7159` (which obsoletes :rfc:`4627`) and by `ECMA-404 `_, is a lightweight " -"data interchange format inspired by `JavaScript `_ object literal syntax (although it is not a strict subset " -"of JavaScript [#rfc-errata]_ )." +"`JSON (JavaScript Object Notation) `_, specified by :rfc:" +"`7159` (which obsoletes :rfc:`4627`) and by `ECMA-404 `_, is a " +"lightweight data interchange format inspired by `JavaScript `_ object literal syntax (although it is not a " +"strict subset of JavaScript [#rfc-errata]_ )." msgstr "" #: ../../library/json.rst:21 @@ -582,11 +582,11 @@ msgstr "" #: ../../library/json.rst:546 msgid "" -"The JSON format is specified by :rfc:`7159` and by `ECMA-404 `_. This section " -"details this module's level of compliance with the RFC. For simplicity, :" -"class:`JSONEncoder` and :class:`JSONDecoder` subclasses, and parameters " -"other than those explicitly mentioned, are not considered." +"The JSON format is specified by :rfc:`7159` and by `ECMA-404 `_. " +"This section details this module's level of compliance with the RFC. For " +"simplicity, :class:`JSONEncoder` and :class:`JSONDecoder` subclasses, and " +"parameters other than those explicitly mentioned, are not considered." msgstr "" #: ../../library/json.rst:552 diff --git a/library/random.po b/library/random.po index 498a4169c9..ed4f0bf866 100644 --- a/library/random.po +++ b/library/random.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-19 00:12+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -559,7 +559,7 @@ msgid "" "Simulation of arrival times and service deliveries for a multiserver queue::" msgstr "" -#: ../../library/random.rst:531 +#: ../../library/random.rst:532 msgid "" "`Statistics for Hackers `_ a " "video tutorial by `Jake Vanderplas `_ a simulation of a marketplace by `Peter Norvig `_ a tutorial by `Peter " @@ -585,11 +585,11 @@ msgid "" "Python." msgstr "" -#: ../../library/random.rst:552 +#: ../../library/random.rst:553 msgid "Recipes" msgstr "" -#: ../../library/random.rst:554 +#: ../../library/random.rst:555 msgid "" "The default :func:`.random` returns multiples of 2⁻⁵³ in the range *0.0 ≤ x " "< 1.0*. All such numbers are evenly spaced and are exactly representable as " @@ -598,7 +598,7 @@ msgid "" "integer multiple of 2⁻⁵³." msgstr "" -#: ../../library/random.rst:560 +#: ../../library/random.rst:561 msgid "" "The following recipe takes a different approach. All floats in the interval " "are possible selections. The mantissa comes from a uniform distribution of " @@ -607,13 +607,13 @@ msgid "" "often as the next larger exponent." msgstr "" -#: ../../library/random.rst:582 +#: ../../library/random.rst:583 msgid "" "All :ref:`real valued distributions ` in the " "class will use the new method::" msgstr "" -#: ../../library/random.rst:591 +#: ../../library/random.rst:592 msgid "" "The recipe is conceptually equivalent to an algorithm that chooses from all " "the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such numbers are " @@ -622,7 +622,7 @@ msgid "" "and is equal to ``math.ulp(0.0)``.)" msgstr "" -#: ../../library/random.rst:600 +#: ../../library/random.rst:601 msgid "" "`Generating Pseudo-random Floating-Point Values `_ a paper by Allen B. Downey describing " diff --git a/library/xml.dom.minidom.po b/library/xml.dom.minidom.po index 4414f64cf9..83b9ba5781 100644 --- a/library/xml.dom.minidom.po +++ b/library/xml.dom.minidom.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-12 19:07+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -189,13 +189,18 @@ msgid "" "the user." msgstr "" -#: ../../library/xml.dom.minidom.rst:161 +#: ../../library/xml.dom.minidom.rst:159 ../../library/xml.dom.minidom.rst:180 +#: ../../library/xml.dom.minidom.rst:199 +msgid "The *standalone* parameter was added." +msgstr "" + +#: ../../library/xml.dom.minidom.rst:164 msgid "" "Return a string or byte string containing the XML represented by the DOM " "node." msgstr "" -#: ../../library/xml.dom.minidom.rst:164 +#: ../../library/xml.dom.minidom.rst:167 msgid "" "With an explicit *encoding* [1]_ argument, the result is a byte string in " "the specified encoding. With no *encoding* argument, the result is a Unicode " @@ -204,63 +209,63 @@ msgid "" "incorrect, since UTF-8 is the default encoding of XML." msgstr "" -#: ../../library/xml.dom.minidom.rst:171 ../../library/xml.dom.minidom.rst:187 +#: ../../library/xml.dom.minidom.rst:174 ../../library/xml.dom.minidom.rst:193 msgid "The *standalone* argument behaves exactly as in :meth:`writexml`." msgstr "" -#: ../../library/xml.dom.minidom.rst:173 +#: ../../library/xml.dom.minidom.rst:176 msgid "" "The :meth:`toxml` method now preserves the attribute order specified by the " "user." msgstr "" -#: ../../library/xml.dom.minidom.rst:180 +#: ../../library/xml.dom.minidom.rst:186 msgid "" "Return a pretty-printed version of the document. *indent* specifies the " "indentation string and defaults to a tabulator; *newl* specifies the string " "emitted at the end of each line and defaults to ``\\n``." msgstr "" -#: ../../library/xml.dom.minidom.rst:184 +#: ../../library/xml.dom.minidom.rst:190 msgid "" "The *encoding* argument behaves like the corresponding argument of :meth:" "`toxml`." msgstr "" -#: ../../library/xml.dom.minidom.rst:189 +#: ../../library/xml.dom.minidom.rst:195 msgid "" "The :meth:`toprettyxml` method now preserves the attribute order specified " "by the user." msgstr "" -#: ../../library/xml.dom.minidom.rst:197 +#: ../../library/xml.dom.minidom.rst:205 msgid "DOM Example" msgstr "" -#: ../../library/xml.dom.minidom.rst:199 +#: ../../library/xml.dom.minidom.rst:207 msgid "" "This example program is a fairly realistic example of a simple program. In " "this particular case, we do not take much advantage of the flexibility of " "the DOM." msgstr "" -#: ../../library/xml.dom.minidom.rst:208 +#: ../../library/xml.dom.minidom.rst:216 msgid "minidom and the DOM standard" msgstr "" -#: ../../library/xml.dom.minidom.rst:210 +#: ../../library/xml.dom.minidom.rst:218 msgid "" "The :mod:`xml.dom.minidom` module is essentially a DOM 1.0-compatible DOM " "with some DOM 2 features (primarily namespace features)." msgstr "" -#: ../../library/xml.dom.minidom.rst:213 +#: ../../library/xml.dom.minidom.rst:221 msgid "" "Usage of the DOM interface in Python is straight-forward. The following " "mapping rules apply:" msgstr "" -#: ../../library/xml.dom.minidom.rst:216 +#: ../../library/xml.dom.minidom.rst:224 msgid "" "Interfaces are accessed through instance objects. Applications should not " "instantiate the classes themselves; they should use the creator functions " @@ -269,14 +274,14 @@ msgid "" "operations." msgstr "" -#: ../../library/xml.dom.minidom.rst:221 +#: ../../library/xml.dom.minidom.rst:229 msgid "" "Operations are used as methods. Since the DOM uses only :keyword:`in` " "parameters, the arguments are passed in normal order (from left to right). " "There are no optional arguments. ``void`` operations return ``None``." msgstr "" -#: ../../library/xml.dom.minidom.rst:225 +#: ../../library/xml.dom.minidom.rst:233 msgid "" "IDL attributes map to instance attributes. For compatibility with the OMG " "IDL language mapping for Python, an attribute ``foo`` can also be accessed " @@ -284,13 +289,13 @@ msgid "" "``readonly`` attributes must not be changed; this is not enforced at runtime." msgstr "" -#: ../../library/xml.dom.minidom.rst:230 +#: ../../library/xml.dom.minidom.rst:238 msgid "" "The types ``short int``, ``unsigned int``, ``unsigned long long``, and " "``boolean`` all map to Python integer objects." msgstr "" -#: ../../library/xml.dom.minidom.rst:233 +#: ../../library/xml.dom.minidom.rst:241 msgid "" "The type ``DOMString`` maps to Python strings. :mod:`xml.dom.minidom` " "supports either bytes or strings, but will normally produce strings. Values " @@ -298,21 +303,21 @@ msgid "" "``null`` value by the DOM specification from the W3C." msgstr "" -#: ../../library/xml.dom.minidom.rst:238 +#: ../../library/xml.dom.minidom.rst:246 msgid "" "``const`` declarations map to variables in their respective scope (e.g. " "``xml.dom.minidom.Node.PROCESSING_INSTRUCTION_NODE``); they must not be " "changed." msgstr "" -#: ../../library/xml.dom.minidom.rst:241 +#: ../../library/xml.dom.minidom.rst:249 msgid "" "``DOMException`` is currently not supported in :mod:`xml.dom.minidom`. " "Instead, :mod:`xml.dom.minidom` uses standard Python exceptions such as :exc:" "`TypeError` and :exc:`AttributeError`." msgstr "" -#: ../../library/xml.dom.minidom.rst:245 +#: ../../library/xml.dom.minidom.rst:253 msgid "" ":class:`NodeList` objects are implemented using Python's built-in list type. " "These objects provide the interface defined in the DOM specification, but " @@ -321,30 +326,30 @@ msgid "" "recommendations." msgstr "" -#: ../../library/xml.dom.minidom.rst:251 +#: ../../library/xml.dom.minidom.rst:259 msgid "" "The following interfaces have no implementation in :mod:`xml.dom.minidom`:" msgstr "" -#: ../../library/xml.dom.minidom.rst:253 +#: ../../library/xml.dom.minidom.rst:261 msgid ":class:`DOMTimeStamp`" msgstr "" -#: ../../library/xml.dom.minidom.rst:255 +#: ../../library/xml.dom.minidom.rst:263 msgid ":class:`EntityReference`" msgstr "" -#: ../../library/xml.dom.minidom.rst:257 +#: ../../library/xml.dom.minidom.rst:265 msgid "" "Most of these reflect information in the XML document that is not of general " "utility to most DOM users." msgstr "" -#: ../../library/xml.dom.minidom.rst:261 +#: ../../library/xml.dom.minidom.rst:269 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.dom.minidom.rst:262 +#: ../../library/xml.dom.minidom.rst:270 msgid "" "The encoding name included in the XML output should conform to the " "appropriate standards. For example, \"UTF-8\" is valid, but \"UTF8\" is not " diff --git a/license.po b/license.po index 5088a53a9c..cd5e232933 100644 --- a/license.po +++ b/license.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-24 00:11+0000\n" +"POT-Creation-Date: 2021-10-19 07:44+0000\n" "PO-Revision-Date: 2021-07-04 01:18+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -236,14 +236,14 @@ msgstr "" msgid "Terms and conditions for accessing or otherwise using Python" msgstr "關於存取或以其他方式使用 Python 的合約條款" -#: ../../license.rst:74 +#: ../../license.rst:75 msgid "" "Python software and documentation are licensed under the :ref:`PSF License " "Agreement `." msgstr "" "Python 軟體和說明文件的授權是基於 :ref:`PSF 授權合約 `\\ 。" -#: ../../license.rst:75 +#: ../../license.rst:78 msgid "" "Starting with Python 3.8.6, examples, recipes, and other code in the " "documentation are dual licensed under the PSF License Agreement and the :ref:" @@ -252,7 +252,7 @@ msgstr "" "從 Python 3.8.6 開始,說明文件中的範例、程式庫和其他程式碼,是被雙重授權 " "(dual licensed) 於 PSF 授權合約以及 :ref:`Zero-Clause BSD 授權 `\\ 。" -#: ../../license.rst:76 +#: ../../license.rst:82 msgid "" "Some software incorporated into Python is under different licenses. The " "licenses are listed with code falling under that license. See :ref:" @@ -261,26 +261,6 @@ msgstr "" "有些被納入 Python 中的軟體是基於不同的授權。這些授權將會與其授權之程式碼一起" "被列出。關於這些授權的不完整清單,請參閱\\ :ref:`OtherLicenses`\\ 。" -#: ../../license.rst:75 -msgid "" -"Python software and documentation are licensed under the :ref:`PSF License " -"Agreement `." -msgstr "" - -#: ../../license.rst:78 -msgid "" -"Starting with Python 3.8.6, examples, recipes, and other code in the " -"documentation are dual licensed under the PSF License Agreement and the :ref:" -"`Zero-Clause BSD license `." -msgstr "" - -#: ../../license.rst:82 -msgid "" -"Some software incorporated into Python is under different licenses. The " -"licenses are listed with code falling under that license. See :ref:" -"`OtherLicenses` for an incomplete list of these licenses." -msgstr "" - #: ../../license.rst:90 msgid "PSF LICENSE AGREEMENT FOR PYTHON |release|" msgstr "用於 PYTHON |release| 的 PSF 授權合約" @@ -301,13 +281,9 @@ msgstr "用於 PYTHON 1.6.1 的 CNRI 授權合約" msgid "CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2" msgstr "用於 PYTHON 0.9.0 至 1.2 的 CWI 授權合約" -#: ../../license.rst:252 -msgid "ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON |release| DOCUMENTATION" -msgstr "用於 PYTHON |release| 說明文件內程式碼的 ZERO-CLAUSE BSD 授權" - #: ../../license.rst:277 msgid "ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON |release| DOCUMENTATION" -msgstr "" +msgstr "用於 PYTHON |release| 說明文件內程式碼的 ZERO-CLAUSE BSD 授權" #: ../../license.rst:296 msgid "Licenses and Acknowledgements for Incorporated Software" @@ -481,8 +457,8 @@ msgid "" msgstr "" "如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`\\ 、\\ :mod:`posix`" "\\ 、\\ :mod:`ssl`\\ 、\\ :mod:`crypt` 模組會使用它來提升效能。此外,因為 " -"Windows 和 macOS 的 Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們" -"也在此收錄 OpenSSL 授權的副本:\n" +"Windows 和 macOS 的 Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們也" +"在此收錄 OpenSSL 授權的副本:\n" "\n" "::" diff --git a/reference/executionmodel.po b/reference/executionmodel.po index 49ca27ec35..10f5b70166 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-10-17 00:12+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -143,13 +143,13 @@ msgstr "" #: ../../reference/executionmodel.rst:122 msgid "" "If the :keyword:`global` statement occurs within a block, all uses of the " -"name specified in the statement refer to the binding of that name in the top-" -"level namespace. Names are resolved in the top-level namespace by searching " -"the global namespace, i.e. the namespace of the module containing the code " -"block, and the builtins namespace, the namespace of the module :mod:" -"`builtins`. The global namespace is searched first. If the name is not " +"names specified in the statement refer to the bindings of those names in the " +"top-level namespace. Names are resolved in the top-level namespace by " +"searching the global namespace, i.e. the namespace of the module containing " +"the code block, and the builtins namespace, the namespace of the module :mod:" +"`builtins`. The global namespace is searched first. If the names are not " "found there, the builtins namespace is searched. The :keyword:`!global` " -"statement must precede all uses of the name." +"statement must precede all uses of the listed names." msgstr "" #: ../../reference/executionmodel.rst:131 From 1f1fbbcc663d1da157f334897673320fb64c8ff3 Mon Sep 17 00:00:00 2001 From: grimmer Date: Thu, 21 Oct 2021 11:51:53 +0800 Subject: [PATCH 29/39] docs: update the sentences about searching fuzzy entries --- README.rst | 13 +++++++------ library/heapq.po | 5 ----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index 50f21cc437..5a0ce5eab1 100644 --- a/README.rst +++ b/README.rst @@ -183,8 +183,8 @@ the PSF for inclusion in the documentation. 主要是填入翻譯字串 (*msgid*) 以及更新有標記為 ``#, fuzzy`` 的字串。 -其中最簡單的貢獻方式就是更新 *fuzzy entries*,讓翻譯的內容保持與最新版本的文件\ -同步。請參考 `尋找 fuzzy entries`_ 段落。 +其中最簡單的貢獻方式就是更新 *fuzzy entries*,讓曾經翻譯的內容保持與最新版本的文件\ +同步。請參考 `尋找有翻譯過但需校閱的 fuzzy entries`_ 段落。 此外,當前的目標為完成 **Tutorial** 的翻譯,因此在 ``tutorial/`` 底下的所有 po 檔皆為首要的翻譯對象。您也可以幫忙校對已經翻譯過的內容。 @@ -400,7 +400,7 @@ type 型別 這樣可以避免下載完整的 commit 歷史(對輸出文件沒什麼幫助),但仍然能把所有的 branch clone 下來。 -與 CPython 同步最新的 pot 檔 (目前由 GitHub Actions 代為執行) +與 CPython 同步最新的 pot 檔 (目前由 GitHub Actions 定時代為執行) ---------------------------------------------------------- pot 檔為翻譯的樣板檔案,它包含需要翻譯的原始字串 (*msgid*) 跟其對應的空白翻譯字串 (*msgstr*),\ @@ -411,11 +411,12 @@ pot 檔的 ``msgid`` 已有變動,則此指令會自動加上 ``#, fuzzy`` 的 $ make merge -尋找 fuzzy entries ------------------- +尋找有翻譯過但需校閱的 fuzzy entries +--------------------------------- 在 po 檔中,您會看到 ``#, fuzzy`` 的字樣,這就表示了接下來的字串是 fuzzy entry,需要更新翻譯。\ -執行下列指令會列出有 *Fuzzy entries* 的檔案。 +您可以自行用習慣的文字編輯器、Linux 指令搜尋有包含此字樣的檔案,但請記得 ``#, fuzzy`` 標記的翻譯字串\ +有可能是尚未翻譯過的空白字串 (*msgstr*)。執行下列指令會列出有 *Fuzzy entries* 的檔案且會排除這個情形。 .. code-block:: bash diff --git a/library/heapq.po b/library/heapq.po index 58d9f15ea4..c487b019c7 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -188,8 +188,6 @@ msgid "" "to ``sorted(itertools.chain(*iterables), reverse=True)``, all iterables must " "be sorted from largest to smallest." msgstr "" -"*reverse* 是一個布林值。如果設定為 ``True`` ,那輸入的元素被 merge 時每一個比" -"較結果都是相反的。" #: ../../library/heapq.rst:107 msgid "Added the optional *key* and *reverse* parameters." @@ -218,9 +216,6 @@ msgid "" "example, ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)[:" "n]``." msgstr "" -"回傳一個包含資料 *iterable* 中前 *n* 小元素的 list 。如果有指定 *key* 參數," -"*key* 會是只有一個參數的函式,用來從每一個 *iterable* 的元素中決定一個比較的" -"依據:``key=str.lower`` 等價於 ``sorted(iterable, key=key)[:n]``" #: ../../library/heapq.rst:128 msgid "" From 1200b89e6e5e03cbdd0730627d9c4c2eed0f7adf Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Thu, 21 Oct 2021 14:07:25 +0800 Subject: [PATCH 30/39] fix(README): wrong Telegram invitation link --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5a0ce5eab1..f115795992 100644 --- a/README.rst +++ b/README.rst @@ -362,7 +362,7 @@ type 型別 幫助,則可以使用 Telegram_。 .. _Issue: https://github.com/python-doc-tw/python-docs-zh-tw/issues -.. _Telegram: https://t.me/PyDocT +.. _Telegram: https://t.me/PyDocTW 另外,此翻譯的 coordinator 為 `adrianliaw `_,\ 您也可以透過此 email 聯繫:``adrianliaw2000 at gmail dot com``。 From 80e1d32c6a76db8a1fc47346deceb315d512dbee Mon Sep 17 00:00:00 2001 From: grimmer Date: Thu, 21 Oct 2021 15:22:17 +0800 Subject: [PATCH 31/39] docs: correct some typo --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f115795992..1678698859 100644 --- a/README.rst +++ b/README.rst @@ -80,7 +80,7 @@ the PSF for inclusion in the documentation. - `安裝好 git `_\ (Windows 上請參考 https://gitforwindows.org/) - 一個 ``.po`` 檔的編輯器。推薦使用 `Poedit `_,若熟悉 po 檔用一般文字編輯器亦可。 -- macOS 的使用者還需要先利用 `homebrew `_ 安裝 gettext ,屆時 Sphinx 會使用到。 +- macOS 的使用者還需要先利用 `homebrew `_ 安裝 gettext,屆時 Sphinx 會使用到。 .. code-block:: bash brew install gettext @@ -404,7 +404,7 @@ branch clone 下來。 ---------------------------------------------------------- pot 檔為翻譯的樣板檔案,它包含需要翻譯的原始字串 (*msgid*) 跟其對應的空白翻譯字串 (*msgstr*),\ -此步驟會參考最新的 Cpython 中的 pot 檔來更新 po 檔。如果是之前在 po 檔中已填入過翻議字串但參考的 \ +此步驟會參考最新的 CPython 中的 pot 檔來更新 po 檔。如果是之前在 po 檔中已填入過翻議字串但參考的 \ pot 檔的 ``msgid`` 已有變動,則此指令會自動加上 ``#, fuzzy`` 的標記,代表內容有些許差異需要更新。 .. code-block:: bash From 78ab3d7387968bed0078c5ab67d78c1ca8368b3e Mon Sep 17 00:00:00 2001 From: grimmer Date: Thu, 21 Oct 2021 15:23:20 +0800 Subject: [PATCH 32/39] docs: add back some heapq translations which were accidentally deleted --- library/heapq.po | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/heapq.po b/library/heapq.po index c487b019c7..58d9f15ea4 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -188,6 +188,8 @@ msgid "" "to ``sorted(itertools.chain(*iterables), reverse=True)``, all iterables must " "be sorted from largest to smallest." msgstr "" +"*reverse* 是一個布林值。如果設定為 ``True`` ,那輸入的元素被 merge 時每一個比" +"較結果都是相反的。" #: ../../library/heapq.rst:107 msgid "Added the optional *key* and *reverse* parameters." @@ -216,6 +218,9 @@ msgid "" "example, ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)[:" "n]``." msgstr "" +"回傳一個包含資料 *iterable* 中前 *n* 小元素的 list 。如果有指定 *key* 參數," +"*key* 會是只有一個參數的函式,用來從每一個 *iterable* 的元素中決定一個比較的" +"依據:``key=str.lower`` 等價於 ``sorted(iterable, key=key)[:n]``" #: ../../library/heapq.rst:128 msgid "" From da179b880fa80a8708e023e449e6f60fb5be9fd8 Mon Sep 17 00:00:00 2001 From: Grimmer Date: Thu, 21 Oct 2021 22:42:30 +0800 Subject: [PATCH 33/39] Update README.rst Co-authored-by: Josix --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1678698859..50cfb9b64d 100644 --- a/README.rst +++ b/README.rst @@ -125,7 +125,7 @@ the PSF for inclusion in the documentation. git fetch upstream git checkout -b glossary upstream/3.9 -2. 接著就可以開始翻譯,你可以手動開啟 Poedit 應用程式再選檔案或用以下指令請 Poedit 將檔案\ +2. 接著就可以開始翻譯(翻譯時可參考`翻譯守則`_),你可以手動開啟 Poedit 應用程式再選檔案或用以下指令請 Poedit 將檔案\ 打開,翻譯不同檔案時將 glossary 換成別的檔名) :: poedit glossary.po From 532f75e7763fd68d035953228f0482c35507925f Mon Sep 17 00:00:00 2001 From: grimmer Date: Sat, 23 Oct 2021 09:53:08 +0800 Subject: [PATCH 34/39] fix(README): a translation typo --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 50cfb9b64d..743b0c2280 100644 --- a/README.rst +++ b/README.rst @@ -404,7 +404,7 @@ branch clone 下來。 ---------------------------------------------------------- pot 檔為翻譯的樣板檔案,它包含需要翻譯的原始字串 (*msgid*) 跟其對應的空白翻譯字串 (*msgstr*),\ -此步驟會參考最新的 CPython 中的 pot 檔來更新 po 檔。如果是之前在 po 檔中已填入過翻議字串但參考的 \ +此步驟會參考最新的 CPython 中的 pot 檔來更新 po 檔。如果是之前在 po 檔中已填入過翻譯字串但參考的 \ pot 檔的 ``msgid`` 已有變動,則此指令會自動加上 ``#, fuzzy`` 的標記,代表內容有些許差異需要更新。 .. code-block:: bash From de96fc325febe35772fd1774724d381d102f535d Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Tue, 26 Oct 2021 16:27:54 +0800 Subject: [PATCH 35/39] Translate `library/intro.po` (#131) Co-authored-by: eopXD --- library/intro.po | 49 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/library/intro.po b/library/intro.po index 532eebbbae..ed8099a77c 100644 --- a/library/intro.po +++ b/library/intro.po @@ -3,13 +3,17 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Liang-Bo Wang , 2016 +# eopXD, 2018 +# Matt Wang , 2021 +# msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-24 00:11+0000\n" -"PO-Revision-Date: 2017-09-22 18:26+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"POT-Creation-Date: 2021-09-07 22:47+0800\n" +"PO-Revision-Date: 2021-10-26 15:56+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,6 +21,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.0\n" #: ../../library/intro.rst:5 msgid "Introduction" @@ -24,7 +29,7 @@ msgstr "簡介" #: ../../library/intro.rst:7 msgid "The \"Python library\" contains several different kinds of components." -msgstr "" +msgstr "「Python 函式庫」包含了許多不同的部分。" #: ../../library/intro.rst:9 msgid "" @@ -35,6 +40,10 @@ msgid "" "hand, the language core does define syntactic properties like the spelling " "and priorities of operators.)" msgstr "" +"函式庫中包括被視為程式語言「核心」部分的資料型態,像是數字 (number) 或是串列 " +"(list)。對於這些型別,Python 核心對這些字面值 (literal) 的形式做定義,並對它" +"們的語意制定了一些限制,但在此同時卻不把文字對應的語意完全定義。(另一方面," +"Python 在語法面上有確實的定義,例如拼字或是運算元次序)" #: ../../library/intro.rst:15 msgid "" @@ -43,6 +52,9 @@ msgid "" "statement. Some of these are defined by the core language, but many are not " "essential for the core semantics and are only described here." msgstr "" +"Python 函式庫也囊括了內建函數與例外處理——這些物件都可以不用透過 :keyword:" +"`import` 陳述式來引入 Python 程式中就能使用。函式庫中有部份是被 Python 核心所" +"定義的,但在這裡僅解釋最核心的語意部分。" #: ../../library/intro.rst:20 msgid "" @@ -59,6 +71,14 @@ msgid "" "available only when a particular configuration option was chosen at the time " "when Python was compiled and installed." msgstr "" +"整個函式庫中包含了許多模組,有許多方法可以從函式庫中取用這些模組。有些模組是" +"以 C 語言撰寫並建置於 Python 編譯器之中,其他的是由 Python 撰寫並以源碼的方" +"式 (source form) 引入。有些模組提供的功能是專屬於 Python 的,像是把 stack " +"trace 印出來;有些則是針對特定作業系統,去試著存取特定硬體;還有些提供對特定" +"應用的功能與操作介面,像是 World Wide Web。模組的使用情況會因機器與 Python 的" +"版本而不同,部分模組是開放所有版本以及 Port 的 Python 來使用的,但有些會因系" +"統支援或需求在某些版本或系統下無法使用,甚至有些僅限在特定的設定環境下才能使" +"用。" #: ../../library/intro.rst:32 msgid "" @@ -66,6 +86,8 @@ msgid "" "built-in functions, data types and exceptions, and finally the modules, " "grouped in chapters of related modules." msgstr "" +"這個手冊會「深入淺出」地介紹 Python 函式庫。它會先介紹一些內建函式、資料型" +"態、和一些例外處理,再來一章章的主題式介紹相關模組。" #: ../../library/intro.rst:36 msgid "" @@ -81,14 +103,21 @@ msgid "" "chapter :ref:`built-in-funcs`, as the remainder of the manual assumes " "familiarity with this material." msgstr "" +"這代表如果你從這個手冊的最開始讀起,並在感到無聊時跳到下一個章節,你仍然可以" +"得到一個對 Python 函式庫所支援的模組與其合理應用的概觀。當然,你\\ *沒有必要*" +"\\ 像是在讀一本小說一樣讀這本手冊——你可以快速瀏覽目錄(在手冊的最前頭)、或是" +"你可以利用最後面的索引來查詢特定的函式或模組。最後,如果你享受閱讀一些隨機的" +"主題,你可以選擇一個隨機的數字並開始閱讀(見 :mod:`random` 模組) 。不管你想要" +"以什麼順序來閱讀這個手冊,\\ :ref:`built-in-funcs` 會是一個很好的入門,因為手" +"冊中其他章節都預設你已經對這個章節有一定的熟悉程度。" #: ../../library/intro.rst:48 msgid "Let the show begin!" -msgstr "" +msgstr "讓我們開始吧!" #: ../../library/intro.rst:54 msgid "Notes on availability" -msgstr "" +msgstr "可用性之註釋" #: ../../library/intro.rst:56 msgid "" @@ -96,9 +125,13 @@ msgid "" "Unix systems. It does not make any claims about its existence on a specific " "operating system." msgstr "" +"如果出現「適用:Unix」註釋,則代表該函數普遍存在於 Unix 系統中,但這並不保證" +"其存在於某特定作業系統。" #: ../../library/intro.rst:60 msgid "" "If not separately noted, all functions that claim \"Availability: Unix\" are " -"supported on macOS, which builds on a Unix core." +"supported on Mac OS X, which builds on a Unix core." msgstr "" +"如果沒有分別註釋的話,有標明「適用:Unix」註釋的所有函式也都於 Mac OS X 上支" +"援,因其建於 Unix 核心之上。" From 4edb0b4de2eac1546ce3bfa22835046f98f9f642 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Tue, 26 Oct 2021 17:26:04 +0800 Subject: [PATCH 36/39] Sync with CPython 3.9 (#125) Co-authored-by: github-actions[bot] Co-authored-by: Matt.Wang --- library/collections.abc.po | 208 +++---- library/datetime.po | 1124 ++++++++++++++++++------------------ library/enum.po | 34 +- library/exceptions.po | 290 +++++----- library/functions.po | 197 +++---- library/intro.po | 16 +- library/socket.po | 562 +++++++++--------- tutorial/introduction.po | 150 ++--- 8 files changed, 1322 insertions(+), 1259 deletions(-) diff --git a/library/collections.abc.po b/library/collections.abc.po index f83ca6145f..3c09f72b17 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-20 00:12+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,302 +37,308 @@ msgid "" "for example, whether it is hashable or whether it is a mapping." msgstr "" -#: ../../library/collections.abc.rst:31 +#: ../../library/collections.abc.rst:27 +msgid "" +"These abstract classes now support ``[]``. See :ref:`types-genericalias` " +"and :pep:`585`." +msgstr "" + +#: ../../library/collections.abc.rst:34 msgid "Collections Abstract Base Classes" msgstr "" -#: ../../library/collections.abc.rst:33 +#: ../../library/collections.abc.rst:36 msgid "" "The collections module offers the following :term:`ABCs `:" msgstr "" -#: ../../library/collections.abc.rst:38 +#: ../../library/collections.abc.rst:41 msgid "ABC" msgstr "" -#: ../../library/collections.abc.rst:38 +#: ../../library/collections.abc.rst:41 msgid "Inherits from" msgstr "" -#: ../../library/collections.abc.rst:38 +#: ../../library/collections.abc.rst:41 msgid "Abstract Methods" msgstr "" -#: ../../library/collections.abc.rst:38 +#: ../../library/collections.abc.rst:41 msgid "Mixin Methods" msgstr "" -#: ../../library/collections.abc.rst:40 +#: ../../library/collections.abc.rst:43 msgid ":class:`Container`" msgstr "" -#: ../../library/collections.abc.rst:40 +#: ../../library/collections.abc.rst:43 msgid "``__contains__``" msgstr "" -#: ../../library/collections.abc.rst:41 +#: ../../library/collections.abc.rst:44 msgid ":class:`Hashable`" msgstr "" -#: ../../library/collections.abc.rst:41 +#: ../../library/collections.abc.rst:44 msgid "``__hash__``" msgstr "" -#: ../../library/collections.abc.rst:42 ../../library/collections.abc.rst:43 -#: ../../library/collections.abc.rst:44 +#: ../../library/collections.abc.rst:45 ../../library/collections.abc.rst:46 +#: ../../library/collections.abc.rst:47 msgid ":class:`Iterable`" msgstr "" -#: ../../library/collections.abc.rst:42 ../../library/collections.abc.rst:43 +#: ../../library/collections.abc.rst:45 ../../library/collections.abc.rst:46 msgid "``__iter__``" msgstr "" -#: ../../library/collections.abc.rst:43 ../../library/collections.abc.rst:45 +#: ../../library/collections.abc.rst:46 ../../library/collections.abc.rst:48 msgid ":class:`Iterator`" msgstr "" -#: ../../library/collections.abc.rst:43 +#: ../../library/collections.abc.rst:46 msgid "``__next__``" msgstr "" -#: ../../library/collections.abc.rst:44 +#: ../../library/collections.abc.rst:47 msgid ":class:`Reversible`" msgstr "" -#: ../../library/collections.abc.rst:44 +#: ../../library/collections.abc.rst:47 msgid "``__reversed__``" msgstr "" -#: ../../library/collections.abc.rst:45 +#: ../../library/collections.abc.rst:48 msgid ":class:`Generator`" msgstr "" -#: ../../library/collections.abc.rst:45 ../../library/collections.abc.rst:93 +#: ../../library/collections.abc.rst:48 ../../library/collections.abc.rst:96 msgid "``send``, ``throw``" msgstr "" -#: ../../library/collections.abc.rst:45 +#: ../../library/collections.abc.rst:48 msgid "``close``, ``__iter__``, ``__next__``" msgstr "" -#: ../../library/collections.abc.rst:46 ../../library/collections.abc.rst:85 +#: ../../library/collections.abc.rst:49 ../../library/collections.abc.rst:88 msgid ":class:`Sized`" msgstr "" -#: ../../library/collections.abc.rst:46 ../../library/collections.abc.rst:85 +#: ../../library/collections.abc.rst:49 ../../library/collections.abc.rst:88 msgid "``__len__``" msgstr "" -#: ../../library/collections.abc.rst:47 +#: ../../library/collections.abc.rst:50 msgid ":class:`Callable`" msgstr "" -#: ../../library/collections.abc.rst:47 +#: ../../library/collections.abc.rst:50 msgid "``__call__``" msgstr "" -#: ../../library/collections.abc.rst:48 ../../library/collections.abc.rst:64 -#: ../../library/collections.abc.rst:74 +#: ../../library/collections.abc.rst:51 ../../library/collections.abc.rst:67 +#: ../../library/collections.abc.rst:77 msgid ":class:`Collection`" msgstr "" -#: ../../library/collections.abc.rst:48 +#: ../../library/collections.abc.rst:51 msgid ":class:`Sized`, :class:`Iterable`, :class:`Container`" msgstr "" -#: ../../library/collections.abc.rst:48 ../../library/collections.abc.rst:64 +#: ../../library/collections.abc.rst:51 ../../library/collections.abc.rst:67 msgid "``__contains__``, ``__iter__``, ``__len__``" msgstr "" -#: ../../library/collections.abc.rst:52 ../../library/collections.abc.rst:55 -#: ../../library/collections.abc.rst:61 +#: ../../library/collections.abc.rst:55 ../../library/collections.abc.rst:58 +#: ../../library/collections.abc.rst:64 msgid ":class:`Sequence`" msgstr "" -#: ../../library/collections.abc.rst:52 +#: ../../library/collections.abc.rst:55 msgid ":class:`Reversible`, :class:`Collection`" msgstr "" -#: ../../library/collections.abc.rst:52 ../../library/collections.abc.rst:61 +#: ../../library/collections.abc.rst:55 ../../library/collections.abc.rst:64 msgid "``__getitem__``, ``__len__``" msgstr "" -#: ../../library/collections.abc.rst:52 +#: ../../library/collections.abc.rst:55 msgid "" "``__contains__``, ``__iter__``, ``__reversed__``, ``index``, and ``count``" msgstr "" -#: ../../library/collections.abc.rst:55 +#: ../../library/collections.abc.rst:58 msgid ":class:`MutableSequence`" msgstr "" -#: ../../library/collections.abc.rst:55 +#: ../../library/collections.abc.rst:58 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``" msgstr "" -#: ../../library/collections.abc.rst:55 +#: ../../library/collections.abc.rst:58 msgid "" "Inherited :class:`Sequence` methods and ``append``, ``reverse``, ``extend``, " "``pop``, ``remove``, and ``__iadd__``" msgstr "" -#: ../../library/collections.abc.rst:61 +#: ../../library/collections.abc.rst:64 msgid ":class:`ByteString`" msgstr "" -#: ../../library/collections.abc.rst:61 +#: ../../library/collections.abc.rst:64 msgid "Inherited :class:`Sequence` methods" msgstr "" -#: ../../library/collections.abc.rst:64 ../../library/collections.abc.rst:68 +#: ../../library/collections.abc.rst:67 ../../library/collections.abc.rst:71 msgid ":class:`Set`" msgstr "" -#: ../../library/collections.abc.rst:64 +#: ../../library/collections.abc.rst:67 msgid "" "``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " "``__and__``, ``__or__``, ``__sub__``, ``__xor__``, and ``isdisjoint``" msgstr "" -#: ../../library/collections.abc.rst:68 +#: ../../library/collections.abc.rst:71 msgid ":class:`MutableSet`" msgstr "" -#: ../../library/collections.abc.rst:68 +#: ../../library/collections.abc.rst:71 msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" msgstr "" -#: ../../library/collections.abc.rst:68 +#: ../../library/collections.abc.rst:71 msgid "" "Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, " "``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``" msgstr "" -#: ../../library/collections.abc.rst:74 ../../library/collections.abc.rst:78 +#: ../../library/collections.abc.rst:77 ../../library/collections.abc.rst:81 msgid ":class:`Mapping`" msgstr "" -#: ../../library/collections.abc.rst:74 +#: ../../library/collections.abc.rst:77 msgid "``__getitem__``, ``__iter__``, ``__len__``" msgstr "" -#: ../../library/collections.abc.rst:74 +#: ../../library/collections.abc.rst:77 msgid "" "``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and " "``__ne__``" msgstr "" -#: ../../library/collections.abc.rst:78 +#: ../../library/collections.abc.rst:81 msgid ":class:`MutableMapping`" msgstr "" -#: ../../library/collections.abc.rst:78 +#: ../../library/collections.abc.rst:81 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" msgstr "" -#: ../../library/collections.abc.rst:78 +#: ../../library/collections.abc.rst:81 msgid "" "Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, " "``update``, and ``setdefault``" msgstr "" -#: ../../library/collections.abc.rst:85 +#: ../../library/collections.abc.rst:88 msgid ":class:`MappingView`" msgstr "" -#: ../../library/collections.abc.rst:86 +#: ../../library/collections.abc.rst:89 msgid ":class:`ItemsView`" msgstr "" -#: ../../library/collections.abc.rst:86 ../../library/collections.abc.rst:88 +#: ../../library/collections.abc.rst:89 ../../library/collections.abc.rst:91 msgid ":class:`MappingView`, :class:`Set`" msgstr "" -#: ../../library/collections.abc.rst:86 ../../library/collections.abc.rst:88 -#: ../../library/collections.abc.rst:90 +#: ../../library/collections.abc.rst:89 ../../library/collections.abc.rst:91 +#: ../../library/collections.abc.rst:93 msgid "``__contains__``, ``__iter__``" msgstr "" -#: ../../library/collections.abc.rst:88 +#: ../../library/collections.abc.rst:91 msgid ":class:`KeysView`" msgstr "" -#: ../../library/collections.abc.rst:90 +#: ../../library/collections.abc.rst:93 msgid ":class:`ValuesView`" msgstr "" -#: ../../library/collections.abc.rst:90 +#: ../../library/collections.abc.rst:93 msgid ":class:`MappingView`, :class:`Collection`" msgstr "" -#: ../../library/collections.abc.rst:92 ../../library/collections.abc.rst:93 +#: ../../library/collections.abc.rst:95 ../../library/collections.abc.rst:96 msgid ":class:`Awaitable`" msgstr "" -#: ../../library/collections.abc.rst:92 +#: ../../library/collections.abc.rst:95 msgid "``__await__``" msgstr "" -#: ../../library/collections.abc.rst:93 +#: ../../library/collections.abc.rst:96 msgid ":class:`Coroutine`" msgstr "" -#: ../../library/collections.abc.rst:93 +#: ../../library/collections.abc.rst:96 msgid "``close``" msgstr "" -#: ../../library/collections.abc.rst:94 ../../library/collections.abc.rst:95 +#: ../../library/collections.abc.rst:97 ../../library/collections.abc.rst:98 msgid ":class:`AsyncIterable`" msgstr "" -#: ../../library/collections.abc.rst:94 ../../library/collections.abc.rst:95 +#: ../../library/collections.abc.rst:97 ../../library/collections.abc.rst:98 msgid "``__aiter__``" msgstr "" -#: ../../library/collections.abc.rst:95 ../../library/collections.abc.rst:96 +#: ../../library/collections.abc.rst:98 ../../library/collections.abc.rst:99 msgid ":class:`AsyncIterator`" msgstr "" -#: ../../library/collections.abc.rst:95 +#: ../../library/collections.abc.rst:98 msgid "``__anext__``" msgstr "" -#: ../../library/collections.abc.rst:96 +#: ../../library/collections.abc.rst:99 msgid ":class:`AsyncGenerator`" msgstr "" -#: ../../library/collections.abc.rst:96 +#: ../../library/collections.abc.rst:99 msgid "``asend``, ``athrow``" msgstr "" -#: ../../library/collections.abc.rst:96 +#: ../../library/collections.abc.rst:99 msgid "``aclose``, ``__aiter__``, ``__anext__``" msgstr "" -#: ../../library/collections.abc.rst:102 +#: ../../library/collections.abc.rst:105 msgid "ABC for classes that provide the :meth:`__contains__` method." msgstr "" -#: ../../library/collections.abc.rst:106 +#: ../../library/collections.abc.rst:109 msgid "ABC for classes that provide the :meth:`__hash__` method." msgstr "" -#: ../../library/collections.abc.rst:110 +#: ../../library/collections.abc.rst:113 msgid "ABC for classes that provide the :meth:`__len__` method." msgstr "" -#: ../../library/collections.abc.rst:114 +#: ../../library/collections.abc.rst:117 msgid "ABC for classes that provide the :meth:`__call__` method." msgstr "" -#: ../../library/collections.abc.rst:118 +#: ../../library/collections.abc.rst:121 msgid "ABC for classes that provide the :meth:`__iter__` method." msgstr "" -#: ../../library/collections.abc.rst:120 +#: ../../library/collections.abc.rst:123 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " @@ -341,22 +347,22 @@ msgid "" "call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:128 +#: ../../library/collections.abc.rst:131 msgid "ABC for sized iterable container classes." msgstr "" -#: ../../library/collections.abc.rst:134 +#: ../../library/collections.abc.rst:137 msgid "" "ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" "`~iterator.__next__` methods. See also the definition of :term:`iterator`." msgstr "" -#: ../../library/collections.abc.rst:140 +#: ../../library/collections.abc.rst:143 msgid "" "ABC for iterable classes that also provide the :meth:`__reversed__` method." msgstr "" -#: ../../library/collections.abc.rst:147 +#: ../../library/collections.abc.rst:150 msgid "" "ABC for generator classes that implement the protocol defined in :pep:`342` " "that extends iterators with the :meth:`~generator.send`, :meth:`~generator." @@ -364,11 +370,11 @@ msgid "" "term:`generator`." msgstr "" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:161 msgid "ABCs for read-only and mutable :term:`sequences `." msgstr "" -#: ../../library/collections.abc.rst:160 +#: ../../library/collections.abc.rst:163 msgid "" "Implementation note: Some of the mixin methods, such as :meth:`__iter__`, :" "meth:`__reversed__` and :meth:`index`, make repeated calls to the " @@ -379,37 +385,37 @@ msgid "" "likely need to be overridden." msgstr "" -#: ../../library/collections.abc.rst:169 +#: ../../library/collections.abc.rst:172 msgid "The index() method added support for *stop* and *start* arguments." msgstr "" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:179 msgid "ABCs for read-only and mutable sets." msgstr "" -#: ../../library/collections.abc.rst:181 +#: ../../library/collections.abc.rst:184 msgid "ABCs for read-only and mutable :term:`mappings `." msgstr "" -#: ../../library/collections.abc.rst:188 +#: ../../library/collections.abc.rst:191 msgid "" "ABCs for mapping, items, keys, and values :term:`views `." msgstr "" -#: ../../library/collections.abc.rst:192 +#: ../../library/collections.abc.rst:195 msgid "" "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " "expressions. Custom implementations must provide the :meth:`__await__` " "method." msgstr "" -#: ../../library/collections.abc.rst:196 +#: ../../library/collections.abc.rst:199 msgid "" ":term:`Coroutine ` objects and instances of the :class:" "`~collections.abc.Coroutine` ABC are all instances of this ABC." msgstr "" -#: ../../library/collections.abc.rst:200 +#: ../../library/collections.abc.rst:203 msgid "" "In CPython, generator-based coroutines (generators decorated with :func:" "`types.coroutine` or :func:`asyncio.coroutine`) are *awaitables*, even " @@ -418,7 +424,7 @@ msgid "" "`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:210 +#: ../../library/collections.abc.rst:213 msgid "" "ABC for coroutine compatible classes. These implement the following " "methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" @@ -428,7 +434,7 @@ msgid "" "`coroutine`." msgstr "" -#: ../../library/collections.abc.rst:218 +#: ../../library/collections.abc.rst:221 msgid "" "In CPython, generator-based coroutines (generators decorated with :func:" "`types.coroutine` or :func:`asyncio.coroutine`) are *awaitables*, even " @@ -437,31 +443,31 @@ msgid "" "`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:228 +#: ../../library/collections.abc.rst:231 msgid "" "ABC for classes that provide ``__aiter__`` method. See also the definition " "of :term:`asynchronous iterable`." msgstr "" -#: ../../library/collections.abc.rst:235 +#: ../../library/collections.abc.rst:238 msgid "" "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " "also the definition of :term:`asynchronous iterator`." msgstr "" -#: ../../library/collections.abc.rst:242 +#: ../../library/collections.abc.rst:245 msgid "" "ABC for asynchronous generator classes that implement the protocol defined " "in :pep:`525` and :pep:`492`." msgstr "" -#: ../../library/collections.abc.rst:248 +#: ../../library/collections.abc.rst:251 msgid "" "These ABCs allow us to ask classes or instances if they provide particular " "functionality, for example::" msgstr "" -#: ../../library/collections.abc.rst:255 +#: ../../library/collections.abc.rst:258 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " "classes supporting container APIs. For example, to write a class supporting " @@ -471,11 +477,11 @@ msgid "" "`__and__` and :meth:`isdisjoint`::" msgstr "" -#: ../../library/collections.abc.rst:284 +#: ../../library/collections.abc.rst:287 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" -#: ../../library/collections.abc.rst:287 +#: ../../library/collections.abc.rst:290 msgid "" "Since some set operations create new sets, the default mixin methods need a " "way to create new instances from an iterable. The class constructor is " @@ -488,14 +494,14 @@ msgid "" "iterable argument." msgstr "" -#: ../../library/collections.abc.rst:298 +#: ../../library/collections.abc.rst:301 msgid "" "To override the comparisons (presumably for speed, as the semantics are " "fixed), redefine :meth:`__le__` and :meth:`__ge__`, then the other " "operations will automatically follow suit." msgstr "" -#: ../../library/collections.abc.rst:303 +#: ../../library/collections.abc.rst:306 msgid "" "The :class:`Set` mixin provides a :meth:`_hash` method to compute a hash " "value for the set; however, :meth:`__hash__` is not defined because not all " @@ -504,12 +510,12 @@ msgid "" "Set._hash``." msgstr "" -#: ../../library/collections.abc.rst:311 +#: ../../library/collections.abc.rst:314 msgid "" "`OrderedSet recipe `_ for an " "example built on :class:`MutableSet`." msgstr "" -#: ../../library/collections.abc.rst:314 +#: ../../library/collections.abc.rst:317 msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "" diff --git a/library/datetime.po b/library/datetime.po index 0231b28f63..183dc63e34 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-20 00:12+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,25 +53,33 @@ msgstr "" msgid "Time access and conversions." msgstr "" -#: ../../library/datetime.rst:30 -msgid "Package `dateutil `_" +#: ../../library/datetime.rst:31 +msgid "Module :mod:`zoneinfo`" msgstr "" #: ../../library/datetime.rst:31 +msgid "Concrete time zones representing the IANA time zone database." +msgstr "" + +#: ../../library/datetime.rst:33 +msgid "Package `dateutil `_" +msgstr "" + +#: ../../library/datetime.rst:34 msgid "Third-party library with expanded time zone and parsing support." msgstr "" -#: ../../library/datetime.rst:36 +#: ../../library/datetime.rst:39 msgid "Aware and Naive Objects" msgstr "" -#: ../../library/datetime.rst:38 +#: ../../library/datetime.rst:41 msgid "" "Date and time objects may be categorized as \"aware\" or \"naive\" depending " "on whether or not they include timezone information." msgstr "" -#: ../../library/datetime.rst:41 +#: ../../library/datetime.rst:44 msgid "" "With sufficient knowledge of applicable algorithmic and political time " "adjustments, such as time zone and daylight saving time information, an " @@ -80,7 +88,7 @@ msgid "" "interpretation. [#]_" msgstr "" -#: ../../library/datetime.rst:47 +#: ../../library/datetime.rst:50 msgid "" "A **naive** object does not contain enough information to unambiguously " "locate itself relative to other date/time objects. Whether a naive object " @@ -91,7 +99,7 @@ msgid "" "some aspects of reality." msgstr "" -#: ../../library/datetime.rst:54 +#: ../../library/datetime.rst:57 msgid "" "For applications requiring aware objects, :class:`.datetime` and :class:`." "time` objects have an optional time zone information attribute, :attr:`!" @@ -101,7 +109,7 @@ msgid "" "is in effect." msgstr "" -#: ../../library/datetime.rst:60 +#: ../../library/datetime.rst:63 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " "supplied by the :mod:`datetime` module. The :class:`timezone` class can " @@ -112,38 +120,38 @@ msgid "" "there is no standard suitable for every application aside from UTC." msgstr "" -#: ../../library/datetime.rst:69 +#: ../../library/datetime.rst:72 msgid "Constants" msgstr "" -#: ../../library/datetime.rst:71 +#: ../../library/datetime.rst:74 msgid "The :mod:`datetime` module exports the following constants:" msgstr "" -#: ../../library/datetime.rst:75 +#: ../../library/datetime.rst:78 msgid "" "The smallest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MINYEAR` is ``1``." msgstr "" -#: ../../library/datetime.rst:81 +#: ../../library/datetime.rst:84 msgid "" "The largest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MAXYEAR` is ``9999``." msgstr "" -#: ../../library/datetime.rst:85 +#: ../../library/datetime.rst:88 msgid "Available Types" msgstr "" -#: ../../library/datetime.rst:90 +#: ../../library/datetime.rst:93 msgid "" "An idealized naive date, assuming the current Gregorian calendar always was, " "and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" "attr:`day`." msgstr "" -#: ../../library/datetime.rst:98 +#: ../../library/datetime.rst:101 msgid "" "An idealized time, independent of any particular day, assuming that every " "day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap seconds" @@ -151,20 +159,20 @@ msgid "" "`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:107 +#: ../../library/datetime.rst:110 msgid "" "A combination of a date and a time. Attributes: :attr:`year`, :attr:" "`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" "`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:115 +#: ../../library/datetime.rst:118 msgid "" "A duration expressing the difference between two :class:`date`, :class:`." "time`, or :class:`.datetime` instances to microsecond resolution." msgstr "" -#: ../../library/datetime.rst:122 +#: ../../library/datetime.rst:125 msgid "" "An abstract base class for time zone information objects. These are used by " "the :class:`.datetime` and :class:`.time` classes to provide a customizable " @@ -172,157 +180,157 @@ msgid "" "daylight saving time)." msgstr "" -#: ../../library/datetime.rst:130 +#: ../../library/datetime.rst:133 msgid "" "A class that implements the :class:`tzinfo` abstract base class as a fixed " "offset from the UTC." msgstr "" -#: ../../library/datetime.rst:135 ../../library/datetime.rst:153 +#: ../../library/datetime.rst:138 ../../library/datetime.rst:156 msgid "Objects of these types are immutable." msgstr "" -#: ../../library/datetime.rst:137 +#: ../../library/datetime.rst:140 msgid "Subclass relationships::" msgstr "" -#: ../../library/datetime.rst:148 +#: ../../library/datetime.rst:151 msgid "Common Properties" msgstr "" -#: ../../library/datetime.rst:150 +#: ../../library/datetime.rst:153 msgid "" "The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` " "types share these common features:" msgstr "" -#: ../../library/datetime.rst:154 +#: ../../library/datetime.rst:157 msgid "" "Objects of these types are hashable, meaning that they can be used as " "dictionary keys." msgstr "" -#: ../../library/datetime.rst:156 +#: ../../library/datetime.rst:159 msgid "" "Objects of these types support efficient pickling via the :mod:`pickle` " "module." msgstr "" -#: ../../library/datetime.rst:159 +#: ../../library/datetime.rst:162 msgid "Determining if an Object is Aware or Naive" msgstr "" -#: ../../library/datetime.rst:161 +#: ../../library/datetime.rst:164 msgid "Objects of the :class:`date` type are always naive." msgstr "" -#: ../../library/datetime.rst:163 +#: ../../library/datetime.rst:166 msgid "" "An object of type :class:`.time` or :class:`.datetime` may be aware or naive." msgstr "" -#: ../../library/datetime.rst:165 +#: ../../library/datetime.rst:168 msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:167 +#: ../../library/datetime.rst:170 msgid "``d.tzinfo`` is not ``None``" msgstr "" -#: ../../library/datetime.rst:168 +#: ../../library/datetime.rst:171 msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:170 +#: ../../library/datetime.rst:173 msgid "Otherwise, *d* is naive." msgstr "" -#: ../../library/datetime.rst:172 +#: ../../library/datetime.rst:175 msgid "A :class:`.time` object *t* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:174 +#: ../../library/datetime.rst:177 msgid "``t.tzinfo`` is not ``None``" msgstr "" -#: ../../library/datetime.rst:175 +#: ../../library/datetime.rst:178 msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "" -#: ../../library/datetime.rst:177 +#: ../../library/datetime.rst:180 msgid "Otherwise, *t* is naive." msgstr "" -#: ../../library/datetime.rst:179 +#: ../../library/datetime.rst:182 msgid "" "The distinction between aware and naive doesn't apply to :class:`timedelta` " "objects." msgstr "" -#: ../../library/datetime.rst:185 +#: ../../library/datetime.rst:188 msgid ":class:`timedelta` Objects" msgstr "" -#: ../../library/datetime.rst:187 +#: ../../library/datetime.rst:190 msgid "" "A :class:`timedelta` object represents a duration, the difference between " "two dates or times." msgstr "" -#: ../../library/datetime.rst:192 +#: ../../library/datetime.rst:195 msgid "" "All arguments are optional and default to ``0``. Arguments may be integers " "or floats, and may be positive or negative." msgstr "" -#: ../../library/datetime.rst:195 +#: ../../library/datetime.rst:198 msgid "" "Only *days*, *seconds* and *microseconds* are stored internally. Arguments " "are converted to those units:" msgstr "" -#: ../../library/datetime.rst:198 +#: ../../library/datetime.rst:201 msgid "A millisecond is converted to 1000 microseconds." msgstr "" -#: ../../library/datetime.rst:199 +#: ../../library/datetime.rst:202 msgid "A minute is converted to 60 seconds." msgstr "" -#: ../../library/datetime.rst:200 +#: ../../library/datetime.rst:203 msgid "An hour is converted to 3600 seconds." msgstr "" -#: ../../library/datetime.rst:201 +#: ../../library/datetime.rst:204 msgid "A week is converted to 7 days." msgstr "" -#: ../../library/datetime.rst:203 +#: ../../library/datetime.rst:206 msgid "" "and days, seconds and microseconds are then normalized so that the " "representation is unique, with" msgstr "" -#: ../../library/datetime.rst:206 +#: ../../library/datetime.rst:209 msgid "``0 <= microseconds < 1000000``" msgstr "" -#: ../../library/datetime.rst:207 +#: ../../library/datetime.rst:210 msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" msgstr "" -#: ../../library/datetime.rst:208 +#: ../../library/datetime.rst:211 msgid "``-999999999 <= days <= 999999999``" msgstr "" -#: ../../library/datetime.rst:210 +#: ../../library/datetime.rst:213 msgid "" "The following example illustrates how any arguments besides *days*, " "*seconds* and *microseconds* are \"merged\" and normalized into those three " "resulting attributes::" msgstr "" -#: ../../library/datetime.rst:228 +#: ../../library/datetime.rst:231 msgid "" "If any argument is a float and there are fractional microseconds, the " "fractional microseconds left over from all arguments are combined and their " @@ -331,281 +339,281 @@ msgid "" "processes are exact (no information is lost)." msgstr "" -#: ../../library/datetime.rst:235 +#: ../../library/datetime.rst:238 msgid "" "If the normalized value of days lies outside the indicated range, :exc:" "`OverflowError` is raised." msgstr "" -#: ../../library/datetime.rst:238 +#: ../../library/datetime.rst:241 msgid "" "Note that normalization of negative values may be surprising at first. For " "example::" msgstr "" -#: ../../library/datetime.rst:247 ../../library/datetime.rst:541 -#: ../../library/datetime.rst:1048 ../../library/datetime.rst:1666 -#: ../../library/datetime.rst:2260 +#: ../../library/datetime.rst:250 ../../library/datetime.rst:544 +#: ../../library/datetime.rst:1051 ../../library/datetime.rst:1669 +#: ../../library/datetime.rst:2262 msgid "Class attributes:" msgstr "" -#: ../../library/datetime.rst:251 +#: ../../library/datetime.rst:254 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." msgstr "" -#: ../../library/datetime.rst:256 +#: ../../library/datetime.rst:259 msgid "" "The most positive :class:`timedelta` object, ``timedelta(days=999999999, " "hours=23, minutes=59, seconds=59, microseconds=999999)``." msgstr "" -#: ../../library/datetime.rst:262 +#: ../../library/datetime.rst:265 msgid "" "The smallest possible difference between non-equal :class:`timedelta` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:265 +#: ../../library/datetime.rst:268 msgid "" "Note that, because of normalization, ``timedelta.max`` > ``-timedelta.min``. " "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:268 ../../library/datetime.rst:559 -#: ../../library/datetime.rst:1068 ../../library/datetime.rst:1686 +#: ../../library/datetime.rst:271 ../../library/datetime.rst:562 +#: ../../library/datetime.rst:1071 ../../library/datetime.rst:1689 msgid "Instance attributes (read-only):" msgstr "" -#: ../../library/datetime.rst:271 +#: ../../library/datetime.rst:274 msgid "Attribute" msgstr "" -#: ../../library/datetime.rst:271 +#: ../../library/datetime.rst:274 msgid "Value" msgstr "" -#: ../../library/datetime.rst:273 +#: ../../library/datetime.rst:276 msgid "``days``" msgstr "" -#: ../../library/datetime.rst:273 +#: ../../library/datetime.rst:276 msgid "Between -999999999 and 999999999 inclusive" msgstr "" -#: ../../library/datetime.rst:275 +#: ../../library/datetime.rst:278 msgid "``seconds``" msgstr "" -#: ../../library/datetime.rst:275 +#: ../../library/datetime.rst:278 msgid "Between 0 and 86399 inclusive" msgstr "" -#: ../../library/datetime.rst:277 +#: ../../library/datetime.rst:280 msgid "``microseconds``" msgstr "" -#: ../../library/datetime.rst:277 +#: ../../library/datetime.rst:280 msgid "Between 0 and 999999 inclusive" msgstr "" -#: ../../library/datetime.rst:280 ../../library/datetime.rst:576 -#: ../../library/datetime.rst:1121 +#: ../../library/datetime.rst:283 ../../library/datetime.rst:579 +#: ../../library/datetime.rst:1124 msgid "Supported operations:" msgstr "" -#: ../../library/datetime.rst:285 ../../library/datetime.rst:579 -#: ../../library/datetime.rst:1124 +#: ../../library/datetime.rst:288 ../../library/datetime.rst:582 +#: ../../library/datetime.rst:1127 msgid "Operation" msgstr "" -#: ../../library/datetime.rst:285 ../../library/datetime.rst:579 -#: ../../library/datetime.rst:1124 +#: ../../library/datetime.rst:288 ../../library/datetime.rst:582 +#: ../../library/datetime.rst:1127 msgid "Result" msgstr "" -#: ../../library/datetime.rst:287 +#: ../../library/datetime.rst:290 msgid "``t1 = t2 + t3``" msgstr "" -#: ../../library/datetime.rst:287 +#: ../../library/datetime.rst:290 msgid "" "Sum of *t2* and *t3*. Afterwards *t1*-*t2* == *t3* and *t1*-*t3* == *t2* are " "true. (1)" msgstr "" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:293 msgid "``t1 = t2 - t3``" msgstr "" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:293 msgid "" "Difference of *t2* and *t3*. Afterwards *t1* == *t2* - *t3* and *t2* == *t1* " "+ *t3* are true. (1)(6)" msgstr "" -#: ../../library/datetime.rst:294 +#: ../../library/datetime.rst:297 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "" -#: ../../library/datetime.rst:294 +#: ../../library/datetime.rst:297 msgid "" "Delta multiplied by an integer. Afterwards *t1* // i == *t2* is true, " "provided ``i != 0``." msgstr "" -#: ../../library/datetime.rst:298 +#: ../../library/datetime.rst:301 msgid "In general, *t1* \\* i == *t1* \\* (i-1) + *t1* is true. (1)" msgstr "" -#: ../../library/datetime.rst:301 +#: ../../library/datetime.rst:304 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "" -#: ../../library/datetime.rst:301 +#: ../../library/datetime.rst:304 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:305 +#: ../../library/datetime.rst:308 msgid "``f = t2 / t3``" msgstr "" -#: ../../library/datetime.rst:305 +#: ../../library/datetime.rst:308 msgid "" "Division (3) of overall duration *t2* by interval unit *t3*. Returns a :" "class:`float` object." msgstr "" -#: ../../library/datetime.rst:309 +#: ../../library/datetime.rst:312 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "" -#: ../../library/datetime.rst:309 +#: ../../library/datetime.rst:312 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:313 +#: ../../library/datetime.rst:316 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "" -#: ../../library/datetime.rst:313 +#: ../../library/datetime.rst:316 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" msgstr "" -#: ../../library/datetime.rst:317 +#: ../../library/datetime.rst:320 msgid "``t1 = t2 % t3``" msgstr "" -#: ../../library/datetime.rst:317 +#: ../../library/datetime.rst:320 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "" -#: ../../library/datetime.rst:320 +#: ../../library/datetime.rst:323 msgid "``q, r = divmod(t1, t2)``" msgstr "" -#: ../../library/datetime.rst:320 +#: ../../library/datetime.rst:323 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " "t2``. q is an integer and r is a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:325 +#: ../../library/datetime.rst:328 msgid "``+t1``" msgstr "" -#: ../../library/datetime.rst:325 +#: ../../library/datetime.rst:328 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "" -#: ../../library/datetime.rst:328 +#: ../../library/datetime.rst:331 msgid "``-t1``" msgstr "" -#: ../../library/datetime.rst:328 +#: ../../library/datetime.rst:331 msgid "" "equivalent to :class:`timedelta`\\ (-*t1.days*, -*t1.seconds*, -*t1." "microseconds*), and to *t1*\\* -1. (1)(4)" msgstr "" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:336 msgid "``abs(t)``" msgstr "" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:336 msgid "" "equivalent to +\\ *t* when ``t.days >= 0``, and to -*t* when ``t.days < 0``. " "(2)" msgstr "" -#: ../../library/datetime.rst:336 +#: ../../library/datetime.rst:339 msgid "``str(t)``" msgstr "" -#: ../../library/datetime.rst:336 +#: ../../library/datetime.rst:339 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" msgstr "" -#: ../../library/datetime.rst:340 +#: ../../library/datetime.rst:343 msgid "``repr(t)``" msgstr "" -#: ../../library/datetime.rst:340 +#: ../../library/datetime.rst:343 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." msgstr "" -#: ../../library/datetime.rst:346 ../../library/datetime.rst:593 -#: ../../library/datetime.rst:2473 +#: ../../library/datetime.rst:349 ../../library/datetime.rst:596 +#: ../../library/datetime.rst:2475 msgid "Notes:" msgstr "註解:" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:352 msgid "This is exact but may overflow." msgstr "" -#: ../../library/datetime.rst:352 +#: ../../library/datetime.rst:355 msgid "This is exact and cannot overflow." msgstr "" -#: ../../library/datetime.rst:355 +#: ../../library/datetime.rst:358 msgid "Division by 0 raises :exc:`ZeroDivisionError`." msgstr "" -#: ../../library/datetime.rst:358 +#: ../../library/datetime.rst:361 msgid "-*timedelta.max* is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:361 +#: ../../library/datetime.rst:364 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " "results for negative timedeltas. For example::" msgstr "" -#: ../../library/datetime.rst:371 +#: ../../library/datetime.rst:374 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " "will produce a result while the latter will overflow." msgstr "" -#: ../../library/datetime.rst:375 +#: ../../library/datetime.rst:378 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." "datetime` objects (see below)." msgstr "" -#: ../../library/datetime.rst:379 +#: ../../library/datetime.rst:382 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -613,119 +621,119 @@ msgid "" "`timedelta` object by a :class:`float` object are now supported." msgstr "" -#: ../../library/datetime.rst:386 +#: ../../library/datetime.rst:389 msgid "" "Comparisons of :class:`timedelta` objects are supported, with some caveats." msgstr "" -#: ../../library/datetime.rst:388 +#: ../../library/datetime.rst:391 msgid "" "The comparisons ``==`` or ``!=`` *always* return a :class:`bool`, no matter " "the type of the compared object::" msgstr "" -#: ../../library/datetime.rst:399 +#: ../../library/datetime.rst:402 msgid "" "For all other comparisons (such as ``<`` and ``>``), when a :class:" "`timedelta` object is compared to an object of a different type, :exc:" "`TypeError` is raised::" msgstr "" -#: ../../library/datetime.rst:410 +#: ../../library/datetime.rst:413 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: ../../library/datetime.rst:413 ../../library/datetime.rst:622 -#: ../../library/datetime.rst:1195 ../../library/datetime.rst:1783 +#: ../../library/datetime.rst:416 ../../library/datetime.rst:625 +#: ../../library/datetime.rst:1198 ../../library/datetime.rst:1786 msgid "Instance methods:" msgstr "" -#: ../../library/datetime.rst:417 +#: ../../library/datetime.rst:420 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (e.g. ``td / timedelta(microseconds=1)``)." msgstr "" -#: ../../library/datetime.rst:421 +#: ../../library/datetime.rst:424 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." msgstr "" -#: ../../library/datetime.rst:427 +#: ../../library/datetime.rst:430 msgid "Examples of usage: :class:`timedelta`" msgstr "" -#: ../../library/datetime.rst:429 +#: ../../library/datetime.rst:432 msgid "An additional example of normalization::" msgstr "" -#: ../../library/datetime.rst:441 +#: ../../library/datetime.rst:444 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "" -#: ../../library/datetime.rst:460 +#: ../../library/datetime.rst:463 msgid ":class:`date` Objects" msgstr "" -#: ../../library/datetime.rst:462 +#: ../../library/datetime.rst:465 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " "both directions." msgstr "" -#: ../../library/datetime.rst:466 +#: ../../library/datetime.rst:469 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" msgstr "" -#: ../../library/datetime.rst:471 +#: ../../library/datetime.rst:474 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" msgstr "" -#: ../../library/datetime.rst:474 +#: ../../library/datetime.rst:477 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "" -#: ../../library/datetime.rst:475 +#: ../../library/datetime.rst:478 msgid "``1 <= month <= 12``" msgstr "" -#: ../../library/datetime.rst:476 +#: ../../library/datetime.rst:479 msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:478 ../../library/datetime.rst:840 +#: ../../library/datetime.rst:481 ../../library/datetime.rst:843 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:481 ../../library/datetime.rst:845 +#: ../../library/datetime.rst:484 ../../library/datetime.rst:848 msgid "Other constructors, all class methods:" msgstr "" -#: ../../library/datetime.rst:485 +#: ../../library/datetime.rst:488 msgid "Return the current local date." msgstr "" -#: ../../library/datetime.rst:487 +#: ../../library/datetime.rst:490 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "" -#: ../../library/datetime.rst:491 +#: ../../library/datetime.rst:494 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." msgstr "" -#: ../../library/datetime.rst:494 +#: ../../library/datetime.rst:497 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -735,7 +743,7 @@ msgid "" "ignored by :meth:`fromtimestamp`." msgstr "" -#: ../../library/datetime.rst:501 +#: ../../library/datetime.rst:504 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -743,98 +751,98 @@ msgid "" "`localtime` failure." msgstr "" -#: ../../library/datetime.rst:510 +#: ../../library/datetime.rst:513 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." msgstr "" -#: ../../library/datetime.rst:513 +#: ../../library/datetime.rst:516 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " "For any date *d*, ``date.fromordinal(d.toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:520 +#: ../../library/datetime.rst:523 msgid "" "Return a :class:`date` corresponding to a *date_string* given in the format " "``YYYY-MM-DD``::" msgstr "" -#: ../../library/datetime.rst:527 +#: ../../library/datetime.rst:530 msgid "" "This is the inverse of :meth:`date.isoformat`. It only supports the format " "``YYYY-MM-DD``." msgstr "" -#: ../../library/datetime.rst:535 +#: ../../library/datetime.rst:538 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" -#: ../../library/datetime.rst:545 +#: ../../library/datetime.rst:548 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "" -#: ../../library/datetime.rst:550 +#: ../../library/datetime.rst:553 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "" -#: ../../library/datetime.rst:555 +#: ../../library/datetime.rst:558 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:563 ../../library/datetime.rst:1072 +#: ../../library/datetime.rst:566 ../../library/datetime.rst:1075 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:568 ../../library/datetime.rst:1077 +#: ../../library/datetime.rst:571 ../../library/datetime.rst:1080 msgid "Between 1 and 12 inclusive." msgstr "" -#: ../../library/datetime.rst:573 ../../library/datetime.rst:1082 +#: ../../library/datetime.rst:576 ../../library/datetime.rst:1085 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" -#: ../../library/datetime.rst:581 +#: ../../library/datetime.rst:584 msgid "``date2 = date1 + timedelta``" msgstr "" -#: ../../library/datetime.rst:581 +#: ../../library/datetime.rst:584 msgid "*date2* is ``timedelta.days`` days removed from *date1*. (1)" msgstr "" -#: ../../library/datetime.rst:584 +#: ../../library/datetime.rst:587 msgid "``date2 = date1 - timedelta``" msgstr "" -#: ../../library/datetime.rst:584 +#: ../../library/datetime.rst:587 msgid "Computes *date2* such that ``date2 + timedelta == date1``. (2)" msgstr "" -#: ../../library/datetime.rst:587 +#: ../../library/datetime.rst:590 msgid "``timedelta = date1 - date2``" msgstr "" -#: ../../library/datetime.rst:587 ../../library/datetime.rst:1130 +#: ../../library/datetime.rst:590 ../../library/datetime.rst:1133 msgid "\\(3)" msgstr "" -#: ../../library/datetime.rst:589 +#: ../../library/datetime.rst:592 msgid "``date1 < date2``" msgstr "" -#: ../../library/datetime.rst:589 +#: ../../library/datetime.rst:592 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. (4)" msgstr "" -#: ../../library/datetime.rst:596 +#: ../../library/datetime.rst:599 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -843,17 +851,17 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" -#: ../../library/datetime.rst:603 +#: ../../library/datetime.rst:606 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "" -#: ../../library/datetime.rst:606 +#: ../../library/datetime.rst:609 msgid "" "This is exact, and cannot overflow. timedelta.seconds and timedelta." "microseconds are 0, and date2 + timedelta == date1 after." msgstr "" -#: ../../library/datetime.rst:610 +#: ../../library/datetime.rst:613 msgid "" "In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2." "toordinal()``. Date comparison raises :exc:`TypeError` if the other " @@ -866,74 +874,74 @@ msgid "" "`True`, respectively." msgstr "" -#: ../../library/datetime.rst:620 +#: ../../library/datetime.rst:623 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: ../../library/datetime.rst:626 +#: ../../library/datetime.rst:629 msgid "" "Return a date with the same value, except for those parameters given new " "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:629 ../../library/datetime.rst:1826 +#: ../../library/datetime.rst:632 ../../library/datetime.rst:1829 msgid "Example::" msgstr "" -#: ../../library/datetime.rst:639 ../../library/datetime.rst:1308 +#: ../../library/datetime.rst:642 ../../library/datetime.rst:1311 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" -#: ../../library/datetime.rst:641 +#: ../../library/datetime.rst:644 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:643 ../../library/datetime.rst:1310 +#: ../../library/datetime.rst:646 ../../library/datetime.rst:1313 msgid "``d.timetuple()`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:647 +#: ../../library/datetime.rst:650 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st." msgstr "" -#: ../../library/datetime.rst:653 +#: ../../library/datetime.rst:656 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " "1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:660 +#: ../../library/datetime.rst:663 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" "meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:667 +#: ../../library/datetime.rst:670 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: ../../library/datetime.rst:674 +#: ../../library/datetime.rst:677 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: ../../library/datetime.rst:677 +#: ../../library/datetime.rst:680 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: ../../library/datetime.rst:679 +#: ../../library/datetime.rst:682 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -942,45 +950,45 @@ msgid "" "Gregorian year." msgstr "" -#: ../../library/datetime.rst:684 +#: ../../library/datetime.rst:687 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: ../../library/datetime.rst:693 +#: ../../library/datetime.rst:696 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: ../../library/datetime.rst:698 +#: ../../library/datetime.rst:701 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" -#: ../../library/datetime.rst:704 +#: ../../library/datetime.rst:707 msgid "This is the inverse of :meth:`date.fromisoformat`." msgstr "" -#: ../../library/datetime.rst:708 +#: ../../library/datetime.rst:711 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: ../../library/datetime.rst:713 +#: ../../library/datetime.rst:716 msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:719 ../../library/datetime.rst:1494 +#: ../../library/datetime.rst:722 ../../library/datetime.rst:1497 msgid "``d.ctime()`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:723 +#: ../../library/datetime.rst:726 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: ../../library/datetime.rst:730 +#: ../../library/datetime.rst:733 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -988,7 +996,7 @@ msgid "" "strptime-behavior`." msgstr "" -#: ../../library/datetime.rst:738 +#: ../../library/datetime.rst:741 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals `__." msgstr "" -#: ../../library/datetime.rst:1006 ../../library/datetime.rst:1423 -#: ../../library/datetime.rst:1770 +#: ../../library/datetime.rst:1009 ../../library/datetime.rst:1426 +#: ../../library/datetime.rst:1773 msgid "Examples::" msgstr "" -#: ../../library/datetime.rst:1025 +#: ../../library/datetime.rst:1028 msgid "" "Return a :class:`.datetime` corresponding to the ISO calendar date specified " "by year, week and day. The non-date components of the datetime are populated " @@ -1284,17 +1292,17 @@ msgid "" "`datetime.isocalendar`." msgstr "" -#: ../../library/datetime.rst:1034 +#: ../../library/datetime.rst:1037 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." msgstr "" -#: ../../library/datetime.rst:1037 +#: ../../library/datetime.rst:1040 msgid "This is equivalent to::" msgstr "" -#: ../../library/datetime.rst:1041 +#: ../../library/datetime.rst:1044 msgid "" ":exc:`ValueError` is raised if the date_string and format can't be parsed " "by :func:`time.strptime` or if it returns a value which isn't a time tuple. " @@ -1302,44 +1310,44 @@ msgid "" "behavior`." msgstr "" -#: ../../library/datetime.rst:1052 +#: ../../library/datetime.rst:1055 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1058 +#: ../../library/datetime.rst:1061 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1064 +#: ../../library/datetime.rst:1067 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:1087 ../../library/datetime.rst:1690 +#: ../../library/datetime.rst:1090 ../../library/datetime.rst:1693 msgid "In ``range(24)``." msgstr "" -#: ../../library/datetime.rst:1092 ../../library/datetime.rst:1097 -#: ../../library/datetime.rst:1695 ../../library/datetime.rst:1700 +#: ../../library/datetime.rst:1095 ../../library/datetime.rst:1100 +#: ../../library/datetime.rst:1698 ../../library/datetime.rst:1703 msgid "In ``range(60)``." msgstr "" -#: ../../library/datetime.rst:1102 ../../library/datetime.rst:1705 +#: ../../library/datetime.rst:1105 ../../library/datetime.rst:1708 msgid "In ``range(1000000)``." msgstr "" -#: ../../library/datetime.rst:1107 +#: ../../library/datetime.rst:1110 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1113 ../../library/datetime.rst:1716 +#: ../../library/datetime.rst:1116 ../../library/datetime.rst:1719 msgid "" "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " "(A repeated interval occurs when clocks are rolled back at the end of " @@ -1348,38 +1356,38 @@ msgid "" "(later) of the two moments with the same wall time representation." msgstr "" -#: ../../library/datetime.rst:1126 +#: ../../library/datetime.rst:1129 msgid "``datetime2 = datetime1 + timedelta``" msgstr "" -#: ../../library/datetime.rst:1126 ../../library/datetime.rst:2308 -#: ../../library/datetime.rst:2313 ../../library/datetime.rst:2325 -#: ../../library/datetime.rst:2330 ../../library/datetime.rst:2390 -#: ../../library/datetime.rst:2395 ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:1129 ../../library/datetime.rst:2310 +#: ../../library/datetime.rst:2315 ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2401 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/datetime.rst:1128 +#: ../../library/datetime.rst:1131 msgid "``datetime2 = datetime1 - timedelta``" msgstr "" -#: ../../library/datetime.rst:1128 ../../library/datetime.rst:2341 +#: ../../library/datetime.rst:1131 ../../library/datetime.rst:2343 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/datetime.rst:1130 +#: ../../library/datetime.rst:1133 msgid "``timedelta = datetime1 - datetime2``" msgstr "" -#: ../../library/datetime.rst:1132 +#: ../../library/datetime.rst:1135 msgid "``datetime1 < datetime2``" msgstr "" -#: ../../library/datetime.rst:1132 +#: ../../library/datetime.rst:1135 msgid "Compares :class:`.datetime` to :class:`.datetime`. (4)" msgstr "" -#: ../../library/datetime.rst:1137 +#: ../../library/datetime.rst:1140 msgid "" "datetime2 is a duration of timedelta removed from datetime1, moving forward " "in time if ``timedelta.days`` > 0, or backward if ``timedelta.days`` < 0. " @@ -1390,7 +1398,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1146 +#: ../../library/datetime.rst:1149 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1398,14 +1406,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1151 +#: ../../library/datetime.rst:1154 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1155 +#: ../../library/datetime.rst:1158 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1413,7 +1421,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1160 +#: ../../library/datetime.rst:1163 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes " @@ -1422,20 +1430,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1166 +#: ../../library/datetime.rst:1169 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1169 +#: ../../library/datetime.rst:1172 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1173 +#: ../../library/datetime.rst:1176 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1445,13 +1453,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1179 +#: ../../library/datetime.rst:1182 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1185 +#: ../../library/datetime.rst:1188 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1464,27 +1472,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1199 +#: ../../library/datetime.rst:1202 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1204 +#: ../../library/datetime.rst:1207 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1207 ../../library/datetime.rst:1216 +#: ../../library/datetime.rst:1210 ../../library/datetime.rst:1219 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1213 +#: ../../library/datetime.rst:1216 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1224 +#: ../../library/datetime.rst:1227 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1492,21 +1500,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1235 +#: ../../library/datetime.rst:1238 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1239 +#: ../../library/datetime.rst:1242 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system timezone." msgstr "" -#: ../../library/datetime.rst:1243 +#: ../../library/datetime.rst:1246 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1514,7 +1522,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1248 +#: ../../library/datetime.rst:1251 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1523,7 +1531,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1254 +#: ../../library/datetime.rst:1257 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1531,56 +1539,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1259 +#: ../../library/datetime.rst:1262 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1271 +#: ../../library/datetime.rst:1274 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1274 +#: ../../library/datetime.rst:1277 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1281 +#: ../../library/datetime.rst:1284 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1285 ../../library/datetime.rst:1868 -#: ../../library/datetime.rst:1974 ../../library/datetime.rst:2220 -#: ../../library/datetime.rst:2232 ../../library/datetime.rst:2529 +#: ../../library/datetime.rst:1288 ../../library/datetime.rst:1871 +#: ../../library/datetime.rst:1977 ../../library/datetime.rst:2222 +#: ../../library/datetime.rst:2234 ../../library/datetime.rst:2531 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1291 +#: ../../library/datetime.rst:1294 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1295 ../../library/datetime.rst:1878 -#: ../../library/datetime.rst:2028 +#: ../../library/datetime.rst:1298 ../../library/datetime.rst:1881 +#: ../../library/datetime.rst:2031 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1301 +#: ../../library/datetime.rst:1304 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1316 +#: ../../library/datetime.rst:1319 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st. The :" @@ -1590,14 +1598,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1327 +#: ../../library/datetime.rst:1330 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`tm_isdst` is forced to 0 regardless of what " "``d.dst()`` returns. DST is never in effect for a UTC time." msgstr "" -#: ../../library/datetime.rst:1331 +#: ../../library/datetime.rst:1334 msgid "" "If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -1606,7 +1614,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1340 +#: ../../library/datetime.rst:1343 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1616,20 +1624,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1349 +#: ../../library/datetime.rst:1352 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1354 +#: ../../library/datetime.rst:1357 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1358 +#: ../../library/datetime.rst:1361 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -1638,18 +1646,18 @@ msgid "" "`OverflowError` for times far in the past or far in the future." msgstr "" -#: ../../library/datetime.rst:1365 +#: ../../library/datetime.rst:1368 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1372 +#: ../../library/datetime.rst:1375 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1378 +#: ../../library/datetime.rst:1381 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1657,145 +1665,145 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1386 +#: ../../library/datetime.rst:1389 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1392 +#: ../../library/datetime.rst:1395 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1398 +#: ../../library/datetime.rst:1401 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1405 +#: ../../library/datetime.rst:1408 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1411 +#: ../../library/datetime.rst:1414 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1413 +#: ../../library/datetime.rst:1416 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1414 +#: ../../library/datetime.rst:1417 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1416 +#: ../../library/datetime.rst:1419 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" -#: ../../library/datetime.rst:1419 +#: ../../library/datetime.rst:1422 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" msgstr "" -#: ../../library/datetime.rst:1421 +#: ../../library/datetime.rst:1424 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1431 +#: ../../library/datetime.rst:1434 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1445 ../../library/datetime.rst:1806 +#: ../../library/datetime.rst:1448 ../../library/datetime.rst:1809 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1449 ../../library/datetime.rst:1810 +#: ../../library/datetime.rst:1452 ../../library/datetime.rst:1813 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1451 ../../library/datetime.rst:1812 +#: ../../library/datetime.rst:1454 ../../library/datetime.rst:1815 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1452 ../../library/datetime.rst:1813 +#: ../../library/datetime.rst:1455 ../../library/datetime.rst:1816 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1453 ../../library/datetime.rst:1814 +#: ../../library/datetime.rst:1456 ../../library/datetime.rst:1817 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1455 ../../library/datetime.rst:1816 +#: ../../library/datetime.rst:1458 ../../library/datetime.rst:1819 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1457 ../../library/datetime.rst:1818 +#: ../../library/datetime.rst:1460 ../../library/datetime.rst:1821 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1461 ../../library/datetime.rst:1822 +#: ../../library/datetime.rst:1464 ../../library/datetime.rst:1825 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1463 +#: ../../library/datetime.rst:1466 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1473 ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1840 msgid "Added the *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1479 +#: ../../library/datetime.rst:1482 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1485 +#: ../../library/datetime.rst:1488 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1491 +#: ../../library/datetime.rst:1494 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1498 +#: ../../library/datetime.rst:1501 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1504 +#: ../../library/datetime.rst:1507 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. For a complete list of formatting directives, see :ref:" "`strftime-strptime-behavior`." msgstr "" -#: ../../library/datetime.rst:1511 +#: ../../library/datetime.rst:1514 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -1803,70 +1811,70 @@ msgid "" "of formatting directives, see :ref:`strftime-strptime-behavior`." msgstr "" -#: ../../library/datetime.rst:1518 +#: ../../library/datetime.rst:1521 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1520 +#: ../../library/datetime.rst:1523 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1573 +#: ../../library/datetime.rst:1576 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1620 +#: ../../library/datetime.rst:1623 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1646 +#: ../../library/datetime.rst:1649 msgid ":class:`.time` Objects" msgstr "" -#: ../../library/datetime.rst:1648 +#: ../../library/datetime.rst:1651 msgid "" "A :class:`time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1653 +#: ../../library/datetime.rst:1656 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1663 +#: ../../library/datetime.rst:1666 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1671 +#: ../../library/datetime.rst:1674 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1676 +#: ../../library/datetime.rst:1679 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1681 +#: ../../library/datetime.rst:1684 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1710 +#: ../../library/datetime.rst:1713 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1724 +#: ../../library/datetime.rst:1727 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1875,7 +1883,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1730 +#: ../../library/datetime.rst:1733 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1889,18 +1897,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1740 +#: ../../library/datetime.rst:1743 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1744 +#: ../../library/datetime.rst:1747 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1746 +#: ../../library/datetime.rst:1749 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -1908,24 +1916,24 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1753 +#: ../../library/datetime.rst:1756 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1757 +#: ../../library/datetime.rst:1760 msgid "" "Return a :class:`.time` corresponding to a *time_string* in one of the " "formats emitted by :meth:`time.isoformat`. Specifically, this function " "supports strings in the format:" msgstr "" -#: ../../library/datetime.rst:1767 +#: ../../library/datetime.rst:1770 msgid "" "This does *not* support parsing arbitrary ISO 8601 strings. It is only " "intended as the inverse operation of :meth:`time.isoformat`." msgstr "" -#: ../../library/datetime.rst:1788 +#: ../../library/datetime.rst:1791 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1933,46 +1941,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1799 +#: ../../library/datetime.rst:1802 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1801 +#: ../../library/datetime.rst:1804 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1802 +#: ../../library/datetime.rst:1805 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1803 +#: ../../library/datetime.rst:1806 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1804 +#: ../../library/datetime.rst:1807 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1824 +#: ../../library/datetime.rst:1827 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1843 +#: ../../library/datetime.rst:1846 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1848 +#: ../../library/datetime.rst:1851 msgid "" "Return a string representing the time, controlled by an explicit format " "string. For a complete list of formatting directives, see :ref:`strftime-" "strptime-behavior`." msgstr "" -#: ../../library/datetime.rst:1855 +#: ../../library/datetime.rst:1858 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2111 +#: ../../library/datetime.rst:2114 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -2239,7 +2247,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2125 +#: ../../library/datetime.rst:2128 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2248,7 +2256,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2144 +#: ../../library/datetime.rst:2147 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2263,13 +2271,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2166 +#: ../../library/datetime.rst:2169 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2169 +#: ../../library/datetime.rst:2172 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2279,28 +2287,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2184 -msgid "`dateutil.tz `_" +#: ../../library/datetime.rst:2186 +msgid ":mod:`zoneinfo`" msgstr "" -#: ../../library/datetime.rst:2178 +#: ../../library/datetime.rst:2181 msgid "" "The :mod:`datetime` module has a basic :class:`timezone` class (for handling " "arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " "UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2182 +#: ../../library/datetime.rst:2185 msgid "" -"*dateutil.tz* library brings the *IANA timezone database* (also known as the " -"Olson database) to Python, and its usage is recommended." +"``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " +"database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2190 +#: ../../library/datetime.rst:2192 msgid "`IANA timezone database `_" msgstr "" -#: ../../library/datetime.rst:2187 +#: ../../library/datetime.rst:2189 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2309,24 +2317,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2197 +#: ../../library/datetime.rst:2199 msgid ":class:`timezone` Objects" msgstr "" -#: ../../library/datetime.rst:2199 +#: ../../library/datetime.rst:2201 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2203 +#: ../../library/datetime.rst:2205 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2210 +#: ../../library/datetime.rst:2212 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2334,25 +2342,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2215 +#: ../../library/datetime.rst:2217 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2226 ../../library/datetime.rst:2237 +#: ../../library/datetime.rst:2228 ../../library/datetime.rst:2239 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2229 +#: ../../library/datetime.rst:2231 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2240 +#: ../../library/datetime.rst:2242 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2361,138 +2369,138 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2246 +#: ../../library/datetime.rst:2248 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain `'UTC'`, not ``'UTC" "+00:00'``." msgstr "" -#: ../../library/datetime.rst:2253 +#: ../../library/datetime.rst:2255 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2257 +#: ../../library/datetime.rst:2259 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2264 +#: ../../library/datetime.rst:2266 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2273 +#: ../../library/datetime.rst:2275 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr "" -#: ../../library/datetime.rst:2275 +#: ../../library/datetime.rst:2277 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2279 +#: ../../library/datetime.rst:2281 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2283 +#: ../../library/datetime.rst:2285 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2287 +#: ../../library/datetime.rst:2289 msgid "``strftime``" msgstr "" -#: ../../library/datetime.rst:2287 +#: ../../library/datetime.rst:2289 msgid "``strptime``" msgstr "" -#: ../../library/datetime.rst:2289 +#: ../../library/datetime.rst:2291 msgid "Usage" msgstr "" -#: ../../library/datetime.rst:2289 +#: ../../library/datetime.rst:2291 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2289 +#: ../../library/datetime.rst:2291 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2291 +#: ../../library/datetime.rst:2293 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2291 +#: ../../library/datetime.rst:2293 msgid "Instance method" msgstr "" -#: ../../library/datetime.rst:2291 +#: ../../library/datetime.rst:2293 msgid "Class method" msgstr "" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2295 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2295 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2295 msgid ":class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:2295 +#: ../../library/datetime.rst:2297 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2295 +#: ../../library/datetime.rst:2297 msgid "``strftime(format)``" msgstr "" -#: ../../library/datetime.rst:2295 +#: ../../library/datetime.rst:2297 msgid "``strptime(date_string, format)``" msgstr "" -#: ../../library/datetime.rst:2300 +#: ../../library/datetime.rst:2302 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2302 +#: ../../library/datetime.rst:2304 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2308 ../../library/datetime.rst:2411 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2308 ../../library/datetime.rst:2411 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2308 ../../library/datetime.rst:2411 msgid "Example" msgstr "" -#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2308 ../../library/datetime.rst:2411 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2310 msgid "``%a``" msgstr "" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2310 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2504,11 +2512,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2315 msgid "``%A``" msgstr "" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2315 msgid "Weekday as locale's full name." msgstr "" @@ -2520,42 +2528,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2318 +#: ../../library/datetime.rst:2320 msgid "``%w``" msgstr "" -#: ../../library/datetime.rst:2318 +#: ../../library/datetime.rst:2320 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2318 +#: ../../library/datetime.rst:2320 msgid "0, 1, ..., 6" msgstr "" -#: ../../library/datetime.rst:2322 +#: ../../library/datetime.rst:2324 msgid "``%d``" msgstr "" -#: ../../library/datetime.rst:2322 +#: ../../library/datetime.rst:2324 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2322 +#: ../../library/datetime.rst:2324 msgid "01, 02, ..., 31" msgstr "" -#: ../../library/datetime.rst:2322 ../../library/datetime.rst:2335 -#: ../../library/datetime.rst:2338 ../../library/datetime.rst:2344 -#: ../../library/datetime.rst:2347 ../../library/datetime.rst:2353 -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2324 ../../library/datetime.rst:2337 +#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2346 +#: ../../library/datetime.rst:2349 ../../library/datetime.rst:2355 +#: ../../library/datetime.rst:2373 msgid "\\(9)" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2327 msgid "``%b``" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2327 msgid "Month as locale's abbreviated name." msgstr "" @@ -2567,11 +2575,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2330 +#: ../../library/datetime.rst:2332 msgid "``%B``" msgstr "" -#: ../../library/datetime.rst:2330 +#: ../../library/datetime.rst:2332 msgid "Month as locale's full name." msgstr "" @@ -2583,67 +2591,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2335 +#: ../../library/datetime.rst:2337 msgid "``%m``" msgstr "" -#: ../../library/datetime.rst:2335 +#: ../../library/datetime.rst:2337 msgid "Month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2335 ../../library/datetime.rst:2347 +#: ../../library/datetime.rst:2337 ../../library/datetime.rst:2349 msgid "01, 02, ..., 12" msgstr "" -#: ../../library/datetime.rst:2338 +#: ../../library/datetime.rst:2340 msgid "``%y``" msgstr "" -#: ../../library/datetime.rst:2338 +#: ../../library/datetime.rst:2340 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2338 +#: ../../library/datetime.rst:2340 msgid "00, 01, ..., 99" msgstr "" -#: ../../library/datetime.rst:2341 +#: ../../library/datetime.rst:2343 msgid "``%Y``" msgstr "" -#: ../../library/datetime.rst:2341 +#: ../../library/datetime.rst:2343 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2341 ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2343 ../../library/datetime.rst:2413 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2346 msgid "``%H``" msgstr "" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2346 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2346 msgid "00, 01, ..., 23" msgstr "" -#: ../../library/datetime.rst:2347 +#: ../../library/datetime.rst:2349 msgid "``%I``" msgstr "" -#: ../../library/datetime.rst:2347 +#: ../../library/datetime.rst:2349 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2350 +#: ../../library/datetime.rst:2352 msgid "``%p``" msgstr "" -#: ../../library/datetime.rst:2350 +#: ../../library/datetime.rst:2352 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2655,127 +2663,127 @@ msgstr "" msgid "am, pm (de_DE)" msgstr "" -#: ../../library/datetime.rst:2350 +#: ../../library/datetime.rst:2352 msgid "\\(1), \\(3)" msgstr "" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2355 msgid "``%M``" msgstr "" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2355 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2353 ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2355 ../../library/datetime.rst:2358 msgid "00, 01, ..., 59" msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2358 msgid "``%S``" msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2358 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2358 msgid "\\(4), \\(9)" msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2361 msgid "``%f``" msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2361 msgid "Microsecond as a decimal number, zero-padded on the left." msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2361 msgid "000000, 000001, ..., 999999" msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2361 msgid "\\(5)" msgstr "" -#: ../../library/datetime.rst:2363 ../../library/datetime.rst:2527 +#: ../../library/datetime.rst:2365 ../../library/datetime.rst:2529 msgid "``%z``" msgstr "" -#: ../../library/datetime.rst:2363 +#: ../../library/datetime.rst:2365 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2363 +#: ../../library/datetime.rst:2365 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2363 ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2365 ../../library/datetime.rst:2370 msgid "\\(6)" msgstr "" -#: ../../library/datetime.rst:2368 ../../library/datetime.rst:2551 +#: ../../library/datetime.rst:2370 ../../library/datetime.rst:2553 msgid "``%Z``" msgstr "" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2370 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2370 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2373 msgid "``%j``" msgstr "" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2373 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2373 msgid "001, 002, ..., 366" msgstr "" -#: ../../library/datetime.rst:2374 +#: ../../library/datetime.rst:2376 msgid "``%U``" msgstr "" -#: ../../library/datetime.rst:2374 +#: ../../library/datetime.rst:2376 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero " "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2374 ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2376 ../../library/datetime.rst:2384 msgid "00, 01, ..., 53" msgstr "" -#: ../../library/datetime.rst:2374 ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2376 ../../library/datetime.rst:2384 msgid "\\(7), \\(9)" msgstr "" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2384 msgid "``%W``" msgstr "" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2384 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number. All days in a new year preceding the first Monday are considered to " "be in week 0." msgstr "" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2392 msgid "``%c``" msgstr "" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2392 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2787,11 +2795,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2397 msgid "``%x``" msgstr "" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2397 msgid "Locale's appropriate date representation." msgstr "" @@ -2807,11 +2815,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2401 msgid "``%X``" msgstr "" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2401 msgid "Locale's appropriate time representation." msgstr "" @@ -2823,69 +2831,69 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2404 msgid "``%%``" msgstr "" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2404 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2404 msgid "%" msgstr "" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2407 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2413 msgid "``%G``" msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2413 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2413 msgid "\\(8)" msgstr "" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2418 msgid "``%u``" msgstr "" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2418 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2418 msgid "1, 2, ..., 7" msgstr "" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2421 msgid "``%V``" msgstr "" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2421 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2421 msgid "01, 02, ..., 53" msgstr "" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2421 msgid "\\(8), \\(9)" msgstr "" -#: ../../library/datetime.rst:2426 +#: ../../library/datetime.rst:2428 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -2894,7 +2902,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2431 +#: ../../library/datetime.rst:2433 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -2904,40 +2912,40 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2439 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "" -#: ../../library/datetime.rst:2441 +#: ../../library/datetime.rst:2443 msgid "Technical Detail" msgstr "" -#: ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2445 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2447 +#: ../../library/datetime.rst:2449 msgid "" "For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2453 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2455 +#: ../../library/datetime.rst:2457 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2461 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`time` objects have no such values. If they're used " @@ -2945,14 +2953,14 @@ msgid "" "day." msgstr "" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2465 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " "values. If they're used anyway, ``0`` is substituted for them." msgstr "" -#: ../../library/datetime.rst:2467 +#: ../../library/datetime.rst:2469 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -2961,7 +2969,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2476 +#: ../../library/datetime.rst:2478 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -2972,37 +2980,37 @@ msgid "" "to determine the current locale's encoding)." msgstr "" -#: ../../library/datetime.rst:2485 +#: ../../library/datetime.rst:2487 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2488 +#: ../../library/datetime.rst:2490 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2492 +#: ../../library/datetime.rst:2494 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2499 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2501 +#: ../../library/datetime.rst:2503 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2505 +#: ../../library/datetime.rst:2507 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3010,17 +3018,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2512 +#: ../../library/datetime.rst:2514 msgid "" "For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty " "strings." msgstr "" -#: ../../library/datetime.rst:2515 +#: ../../library/datetime.rst:2517 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2518 +#: ../../library/datetime.rst:2520 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3034,7 +3042,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2532 +#: ../../library/datetime.rst:2534 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3042,47 +3050,47 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2540 +#: ../../library/datetime.rst:2542 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2544 +#: ../../library/datetime.rst:2546 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2546 +#: ../../library/datetime.rst:2548 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2547 +#: ../../library/datetime.rst:2549 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2549 +#: ../../library/datetime.rst:2551 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2553 +#: ../../library/datetime.rst:2555 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2559 +#: ../../library/datetime.rst:2561 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2566 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:" @@ -3090,22 +3098,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2570 +#: ../../library/datetime.rst:2572 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%J``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2575 +#: ../../library/datetime.rst:2577 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2576 +#: ../../library/datetime.rst:2578 msgid "If, that is, we ignore the effects of Relativity" msgstr "" -#: ../../library/datetime.rst:2578 +#: ../../library/datetime.rst:2580 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3114,14 +3122,14 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2584 +#: ../../library/datetime.rst:2586 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a " "good explanation." msgstr "" -#: ../../library/datetime.rst:2588 +#: ../../library/datetime.rst:2590 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." diff --git a/library/enum.po b/library/enum.po index e31d966819..c16acac0bb 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-22 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -984,9 +984,10 @@ msgstr "" #: ../../library/enum.rst:1128 msgid "" -"Private names will be normal attributes in Python 3.10 instead of either an " -"error or a member (depending on if the name ends with an underscore). Using " -"these names in 3.9 will issue a :exc:`DeprecationWarning`." +":ref:`Private names ` will be normal attributes in " +"Python 3.11 instead of either an error or a member (depending on if the name " +"ends with an underscore). Using these names in 3.9 and 3.10 will issue a :" +"exc:`DeprecationWarning`." msgstr "" #: ../../library/enum.rst:1134 @@ -1003,11 +1004,15 @@ msgid "" "uppercase names for members)::" msgstr "" -#: ../../library/enum.rst:1157 +#: ../../library/enum.rst:1155 +msgid "This behavior is deprecated and will be removed in 3.12." +msgstr "" + +#: ../../library/enum.rst:1161 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../library/enum.rst:1159 +#: ../../library/enum.rst:1163 msgid "" ":class:`Enum` members that are mixed with non-:class:`Enum` types (such as :" "class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in " @@ -1016,27 +1021,34 @@ msgid "" "to your class::" msgstr "" -#: ../../library/enum.rst:1168 +#: ../../library/enum.rst:1172 msgid ":class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../library/enum.rst:1172 +#: ../../library/enum.rst:1176 msgid "``Enum`` classes with methods" msgstr "" -#: ../../library/enum.rst:1174 +#: ../../library/enum.rst:1178 msgid "" "If you give your :class:`Enum` subclass extra methods, like the `Planet`_ " "class above, those methods will show up in a :func:`dir` of the member, but " "not of the class::" msgstr "" -#: ../../library/enum.rst:1185 +#: ../../library/enum.rst:1189 msgid "Combining members of ``Flag``" msgstr "" -#: ../../library/enum.rst:1187 +#: ../../library/enum.rst:1191 msgid "" "If a combination of Flag members is not named, the :func:`repr` will include " "all named flags and all named combinations of flags that are in the value::" msgstr "" + +#: ../../library/enum.rst:1209 +msgid "" +"In 3.11 unnamed combinations of flags will only produce the canonical flag " +"members (aka single-value flags). So ``Color(7)`` would produce something " +"like ````." +msgstr "" diff --git a/library/exceptions.po b/library/exceptions.po index 434e9163b4..c3ab11cb7c 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-21 00:12+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,7 +61,11 @@ msgid "" "the Python Tutorial under :ref:`tut-userexceptions`." msgstr "" -#: ../../library/exceptions.rst:37 +#: ../../library/exceptions.rst:39 +msgid "Exception context" +msgstr "" + +#: ../../library/exceptions.rst:41 msgid "" "When raising (or re-raising) an exception in an :keyword:`except` or :" "keyword:`finally` clause :attr:`__context__` is automatically set to the " @@ -70,7 +74,7 @@ msgid "" "the final exception." msgstr "" -#: ../../library/exceptions.rst:43 +#: ../../library/exceptions.rst:47 msgid "" "When raising a new exception (rather than using a bare ``raise`` to re-raise " "the exception currently being handled), the implicit exception context can " @@ -78,7 +82,7 @@ msgid "" "keyword:`raise`::" msgstr "" -#: ../../library/exceptions.rst:50 +#: ../../library/exceptions.rst:54 msgid "" "The expression following :keyword:`from` must be an exception or " "``None``. It will be set as :attr:`__cause__` on the raised exception. " @@ -90,7 +94,7 @@ msgid "" "introspection when debugging." msgstr "" -#: ../../library/exceptions.rst:59 +#: ../../library/exceptions.rst:63 msgid "" "The default traceback display code shows these chained exceptions in " "addition to the traceback for the exception itself. An explicitly chained " @@ -99,24 +103,46 @@ msgid "" "is :const:`None` and :attr:`__suppress_context__` is false." msgstr "" -#: ../../library/exceptions.rst:65 +#: ../../library/exceptions.rst:69 msgid "" "In either case, the exception itself is always shown after any chained " "exceptions so that the final line of the traceback always shows the last " "exception that was raised." msgstr "" -#: ../../library/exceptions.rst:71 +#: ../../library/exceptions.rst:75 +msgid "Inheriting from built-in exceptions" +msgstr "繼承自內建的例外" + +#: ../../library/exceptions.rst:77 +msgid "" +"User code can create subclasses that inherit from an exception type. It's " +"recommended to only subclass one exception type at a time to avoid any " +"possible conflicts between how the bases handle the ``args`` attribute, as " +"well as due to possible memory layout incompatibilities." +msgstr "" + +#: ../../library/exceptions.rst:84 +msgid "" +"Most built-in exceptions are implemented in C for efficiency, see: :source:" +"`Objects/exceptions.c`. Some have custom memory layouts which makes it " +"impossible to create a subclass that inherits from multiple exception types. " +"The memory layout of a type is an implementation detail and might change " +"between Python versions, leading to new conflicts in the future. Therefore, " +"it's recommended to avoid subclassing multiple exception types altogether." +msgstr "" + +#: ../../library/exceptions.rst:94 msgid "Base classes" msgstr "" -#: ../../library/exceptions.rst:73 +#: ../../library/exceptions.rst:96 msgid "" "The following exceptions are used mostly as base classes for other " "exceptions." msgstr "" -#: ../../library/exceptions.rst:77 +#: ../../library/exceptions.rst:100 msgid "" "The base class for all built-in exceptions. It is not meant to be directly " "inherited by user-defined classes (for that, use :exc:`Exception`). If :" @@ -125,7 +151,7 @@ msgid "" "were no arguments." msgstr "" -#: ../../library/exceptions.rst:85 +#: ../../library/exceptions.rst:108 msgid "" "The tuple of arguments given to the exception constructor. Some built-in " "exceptions (like :exc:`OSError`) expect a certain number of arguments and " @@ -133,69 +159,69 @@ msgid "" "usually called only with a single string giving an error message." msgstr "" -#: ../../library/exceptions.rst:92 +#: ../../library/exceptions.rst:115 msgid "" "This method sets *tb* as the new traceback for the exception and returns the " "exception object. It is usually used in exception handling code like this::" msgstr "" -#: ../../library/exceptions.rst:105 +#: ../../library/exceptions.rst:128 msgid "" "All built-in, non-system-exiting exceptions are derived from this class. " "All user-defined exceptions should also be derived from this class." msgstr "" -#: ../../library/exceptions.rst:111 +#: ../../library/exceptions.rst:134 msgid "" "The base class for those built-in exceptions that are raised for various " "arithmetic errors: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:" "`FloatingPointError`." msgstr "" -#: ../../library/exceptions.rst:118 +#: ../../library/exceptions.rst:141 msgid "" "Raised when a :ref:`buffer ` related operation cannot be " "performed." msgstr "" -#: ../../library/exceptions.rst:124 +#: ../../library/exceptions.rst:147 msgid "" "The base class for the exceptions that are raised when a key or index used " "on a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. " "This can be raised directly by :func:`codecs.lookup`." msgstr "" -#: ../../library/exceptions.rst:130 +#: ../../library/exceptions.rst:153 msgid "Concrete exceptions" msgstr "" -#: ../../library/exceptions.rst:132 +#: ../../library/exceptions.rst:155 msgid "The following exceptions are the exceptions that are usually raised." msgstr "" -#: ../../library/exceptions.rst:138 +#: ../../library/exceptions.rst:161 msgid "Raised when an :keyword:`assert` statement fails." msgstr "" -#: ../../library/exceptions.rst:143 +#: ../../library/exceptions.rst:166 msgid "" "Raised when an attribute reference (see :ref:`attribute-references`) or " "assignment fails. (When an object does not support attribute references or " "attribute assignments at all, :exc:`TypeError` is raised.)" msgstr "" -#: ../../library/exceptions.rst:150 +#: ../../library/exceptions.rst:173 msgid "" "Raised when the :func:`input` function hits an end-of-file condition (EOF) " "without reading any data. (N.B.: the :meth:`io.IOBase.read` and :meth:`io." "IOBase.readline` methods return an empty string when they hit EOF.)" msgstr "" -#: ../../library/exceptions.rst:157 +#: ../../library/exceptions.rst:180 msgid "Not currently used." msgstr "" -#: ../../library/exceptions.rst:162 +#: ../../library/exceptions.rst:185 msgid "" "Raised when a :term:`generator` or :term:`coroutine` is closed; see :meth:" "`generator.close` and :meth:`coroutine.close`. It directly inherits from :" @@ -203,14 +229,14 @@ msgid "" "an error." msgstr "" -#: ../../library/exceptions.rst:170 +#: ../../library/exceptions.rst:193 msgid "" "Raised when the :keyword:`import` statement has troubles trying to load a " "module. Also raised when the \"from list\" in ``from ... import`` has a " "name that cannot be found." msgstr "" -#: ../../library/exceptions.rst:174 +#: ../../library/exceptions.rst:197 msgid "" "The :attr:`name` and :attr:`path` attributes can be set using keyword-only " "arguments to the constructor. When set they represent the name of the module " @@ -218,31 +244,31 @@ msgid "" "the exception, respectively." msgstr "" -#: ../../library/exceptions.rst:179 +#: ../../library/exceptions.rst:202 msgid "Added the :attr:`name` and :attr:`path` attributes." msgstr "" -#: ../../library/exceptions.rst:184 +#: ../../library/exceptions.rst:207 msgid "" "A subclass of :exc:`ImportError` which is raised by :keyword:`import` when a " "module could not be located. It is also raised when ``None`` is found in :" "data:`sys.modules`." msgstr "" -#: ../../library/exceptions.rst:193 +#: ../../library/exceptions.rst:216 msgid "" "Raised when a sequence subscript is out of range. (Slice indices are " "silently truncated to fall in the allowed range; if an index is not an " "integer, :exc:`TypeError` is raised.)" msgstr "" -#: ../../library/exceptions.rst:202 +#: ../../library/exceptions.rst:225 msgid "" "Raised when a mapping (dictionary) key is not found in the set of existing " "keys." msgstr "" -#: ../../library/exceptions.rst:209 +#: ../../library/exceptions.rst:232 msgid "" "Raised when the user hits the interrupt key (normally :kbd:`Control-C` or :" "kbd:`Delete`). During execution, a check for interrupts is made regularly. " @@ -251,7 +277,7 @@ msgid "" "the interpreter from exiting." msgstr "" -#: ../../library/exceptions.rst:218 +#: ../../library/exceptions.rst:241 msgid "" "Raised when an operation runs out of memory but the situation may still be " "rescued (by deleting some objects). The associated value is a string " @@ -262,14 +288,14 @@ msgid "" "stack traceback can be printed, in case a run-away program was the cause." msgstr "" -#: ../../library/exceptions.rst:229 +#: ../../library/exceptions.rst:252 msgid "" "Raised when a local or global name is not found. This applies only to " "unqualified names. The associated value is an error message that includes " "the name that could not be found." msgstr "" -#: ../../library/exceptions.rst:236 +#: ../../library/exceptions.rst:259 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " @@ -277,28 +303,28 @@ msgid "" "developed to indicate that the real implementation still needs to be added." msgstr "" -#: ../../library/exceptions.rst:243 +#: ../../library/exceptions.rst:266 msgid "" "It should not be used to indicate that an operator or method is not meant to " "be supported at all -- in that case either leave the operator / method " "undefined or, if a subclass, set it to :data:`None`." msgstr "" -#: ../../library/exceptions.rst:249 +#: ../../library/exceptions.rst:272 msgid "" "``NotImplementedError`` and ``NotImplemented`` are not interchangeable, even " "though they have similar names and purposes. See :data:`NotImplemented` for " "details on when to use it." msgstr "" -#: ../../library/exceptions.rst:258 +#: ../../library/exceptions.rst:281 msgid "" "This exception is raised when a system function returns a system-related " "error, including I/O failures such as \"file not found\" or \"disk full" "\" (not for illegal argument types or other incidental errors)." msgstr "" -#: ../../library/exceptions.rst:262 +#: ../../library/exceptions.rst:285 msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " @@ -307,7 +333,7 @@ msgid "" "constructor arguments." msgstr "" -#: ../../library/exceptions.rst:268 +#: ../../library/exceptions.rst:291 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -316,18 +342,18 @@ msgid "" "subclassing." msgstr "" -#: ../../library/exceptions.rst:276 +#: ../../library/exceptions.rst:299 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "" -#: ../../library/exceptions.rst:280 +#: ../../library/exceptions.rst:303 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " "native error code." msgstr "" -#: ../../library/exceptions.rst:284 +#: ../../library/exceptions.rst:307 msgid "" "Under Windows, if the *winerror* constructor argument is an integer, the :" "attr:`.errno` attribute is determined from the Windows error code, and the " @@ -335,14 +361,14 @@ msgid "" "ignored, and the :attr:`winerror` attribute does not exist." msgstr "" -#: ../../library/exceptions.rst:292 +#: ../../library/exceptions.rst:315 msgid "" "The corresponding error message, as provided by the operating system. It is " "formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" "`FormatMessage` under Windows." msgstr "" -#: ../../library/exceptions.rst:300 +#: ../../library/exceptions.rst:323 msgid "" "For exceptions that involve a file system path (such as :func:`open` or :" "func:`os.unlink`), :attr:`filename` is the file name passed to the function. " @@ -351,14 +377,14 @@ msgid "" "the function." msgstr "" -#: ../../library/exceptions.rst:307 +#: ../../library/exceptions.rst:330 msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." "error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" "`OSError`, and the constructor may return a subclass." msgstr "" -#: ../../library/exceptions.rst:313 +#: ../../library/exceptions.rst:336 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " "function, instead of the name encoded to or decoded from the filesystem " @@ -366,7 +392,7 @@ msgid "" "added." msgstr "" -#: ../../library/exceptions.rst:322 +#: ../../library/exceptions.rst:345 msgid "" "Raised when the result of an arithmetic operation is too large to be " "represented. This cannot occur for integers (which would rather raise :exc:" @@ -376,18 +402,18 @@ msgid "" "in C, most floating point operations are not checked." msgstr "" -#: ../../library/exceptions.rst:332 +#: ../../library/exceptions.rst:355 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " "interpreter detects that the maximum recursion depth (see :func:`sys." "getrecursionlimit`) is exceeded." msgstr "" -#: ../../library/exceptions.rst:336 +#: ../../library/exceptions.rst:359 msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/exceptions.rst:342 +#: ../../library/exceptions.rst:365 msgid "" "This exception is raised when a weak reference proxy, created by the :func:" "`weakref.proxy` function, is used to access an attribute of the referent " @@ -395,65 +421,65 @@ msgid "" "references, see the :mod:`weakref` module." msgstr "" -#: ../../library/exceptions.rst:350 +#: ../../library/exceptions.rst:373 msgid "" "Raised when an error is detected that doesn't fall in any of the other " "categories. The associated value is a string indicating what precisely went " "wrong." msgstr "" -#: ../../library/exceptions.rst:357 +#: ../../library/exceptions.rst:380 msgid "" "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" "`~iterator.__next__` method to signal that there are no further items " "produced by the iterator." msgstr "" -#: ../../library/exceptions.rst:361 +#: ../../library/exceptions.rst:384 msgid "" "The exception object has a single attribute :attr:`value`, which is given as " "an argument when constructing the exception, and defaults to :const:`None`." msgstr "" -#: ../../library/exceptions.rst:365 +#: ../../library/exceptions.rst:388 msgid "" "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" "`StopIteration` instance is raised, and the value returned by the function " "is used as the :attr:`value` parameter to the constructor of the exception." msgstr "" -#: ../../library/exceptions.rst:370 +#: ../../library/exceptions.rst:393 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " "as the new exception's cause)." msgstr "" -#: ../../library/exceptions.rst:374 +#: ../../library/exceptions.rst:397 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." msgstr "" -#: ../../library/exceptions.rst:378 +#: ../../library/exceptions.rst:401 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." msgstr "" -#: ../../library/exceptions.rst:382 +#: ../../library/exceptions.rst:405 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." msgstr "" -#: ../../library/exceptions.rst:388 +#: ../../library/exceptions.rst:411 msgid "" "Must be raised by :meth:`__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" -#: ../../library/exceptions.rst:395 +#: ../../library/exceptions.rst:418 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" @@ -461,33 +487,33 @@ msgid "" "or standard input (also interactively)." msgstr "" -#: ../../library/exceptions.rst:401 +#: ../../library/exceptions.rst:424 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." msgstr "" -#: ../../library/exceptions.rst:406 +#: ../../library/exceptions.rst:429 msgid "The name of the file the syntax error occurred in." msgstr "" -#: ../../library/exceptions.rst:410 +#: ../../library/exceptions.rst:433 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" -#: ../../library/exceptions.rst:415 +#: ../../library/exceptions.rst:438 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." msgstr "" -#: ../../library/exceptions.rst:420 +#: ../../library/exceptions.rst:443 msgid "The source code text involved in the error." msgstr "" -#: ../../library/exceptions.rst:422 +#: ../../library/exceptions.rst:445 msgid "" "For errors in f-string fields, the message is prefixed by \"f-string: \" and " "the offsets are offsets in a text constructed from the replacement " @@ -495,26 +521,26 @@ msgid "" "attribute: ('f-string: ...', ('', 1, 4, '(a b)\\n'))." msgstr "" -#: ../../library/exceptions.rst:430 +#: ../../library/exceptions.rst:453 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" -#: ../../library/exceptions.rst:436 +#: ../../library/exceptions.rst:459 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" -#: ../../library/exceptions.rst:442 +#: ../../library/exceptions.rst:465 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " "a string indicating what went wrong (in low-level terms)." msgstr "" -#: ../../library/exceptions.rst:446 +#: ../../library/exceptions.rst:469 msgid "" "You should report this to the author or maintainer of your Python " "interpreter. Be sure to report the version of the Python interpreter (``sys." @@ -523,7 +549,7 @@ msgid "" "possible the source of the program that triggered the error." msgstr "" -#: ../../library/exceptions.rst:455 +#: ../../library/exceptions.rst:478 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -537,7 +563,7 @@ msgid "" "printed and the exit status is one." msgstr "" -#: ../../library/exceptions.rst:466 +#: ../../library/exceptions.rst:489 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -547,20 +573,20 @@ msgid "" "child process after a call to :func:`os.fork`)." msgstr "" -#: ../../library/exceptions.rst:475 +#: ../../library/exceptions.rst:498 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "" -#: ../../library/exceptions.rst:481 +#: ../../library/exceptions.rst:504 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " "the type mismatch." msgstr "" -#: ../../library/exceptions.rst:484 +#: ../../library/exceptions.rst:507 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -568,7 +594,7 @@ msgid "" "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" -#: ../../library/exceptions.rst:489 +#: ../../library/exceptions.rst:512 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -576,135 +602,135 @@ msgid "" "should result in a :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:496 +#: ../../library/exceptions.rst:519 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" "`NameError`." msgstr "" -#: ../../library/exceptions.rst:503 +#: ../../library/exceptions.rst:526 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:506 +#: ../../library/exceptions.rst:529 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " "invalid input that the codec failed on." msgstr "" -#: ../../library/exceptions.rst:512 +#: ../../library/exceptions.rst:535 msgid "The name of the encoding that raised the error." msgstr "" -#: ../../library/exceptions.rst:516 +#: ../../library/exceptions.rst:539 msgid "A string describing the specific codec error." msgstr "" -#: ../../library/exceptions.rst:520 +#: ../../library/exceptions.rst:543 msgid "The object the codec was attempting to encode or decode." msgstr "" -#: ../../library/exceptions.rst:524 +#: ../../library/exceptions.rst:547 msgid "The first index of invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:528 +#: ../../library/exceptions.rst:551 msgid "The index after the last invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:533 +#: ../../library/exceptions.rst:556 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:539 +#: ../../library/exceptions.rst:562 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:545 +#: ../../library/exceptions.rst:568 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:551 +#: ../../library/exceptions.rst:574 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " "more precise exception such as :exc:`IndexError`." msgstr "" -#: ../../library/exceptions.rst:558 +#: ../../library/exceptions.rst:581 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " "operation." msgstr "" -#: ../../library/exceptions.rst:563 +#: ../../library/exceptions.rst:586 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." msgstr "" -#: ../../library/exceptions.rst:572 +#: ../../library/exceptions.rst:595 msgid "Only available on Windows." msgstr "" -#: ../../library/exceptions.rst:576 +#: ../../library/exceptions.rst:599 msgid "OS exceptions" msgstr "" -#: ../../library/exceptions.rst:578 +#: ../../library/exceptions.rst:601 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "" -#: ../../library/exceptions.rst:583 +#: ../../library/exceptions.rst:606 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` ``EAGAIN``, ``EALREADY``, " "``EWOULDBLOCK`` and ``EINPROGRESS``." msgstr "" -#: ../../library/exceptions.rst:588 +#: ../../library/exceptions.rst:611 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" -#: ../../library/exceptions.rst:593 +#: ../../library/exceptions.rst:616 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " "from the :mod:`io` module." msgstr "" -#: ../../library/exceptions.rst:599 +#: ../../library/exceptions.rst:622 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` ``ECHILD``." msgstr "" -#: ../../library/exceptions.rst:604 +#: ../../library/exceptions.rst:627 msgid "A base class for connection-related issues." msgstr "" -#: ../../library/exceptions.rst:606 +#: ../../library/exceptions.rst:629 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." msgstr "" -#: ../../library/exceptions.rst:611 +#: ../../library/exceptions.rst:634 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " @@ -712,56 +738,56 @@ msgid "" "``ESHUTDOWN``." msgstr "" -#: ../../library/exceptions.rst:618 +#: ../../library/exceptions.rst:641 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` ``ECONNABORTED``." msgstr "" -#: ../../library/exceptions.rst:624 +#: ../../library/exceptions.rst:647 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` ``ECONNREFUSED``." msgstr "" -#: ../../library/exceptions.rst:630 +#: ../../library/exceptions.rst:653 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` ``ECONNRESET``." msgstr "" -#: ../../library/exceptions.rst:636 +#: ../../library/exceptions.rst:659 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` ``EEXIST``." msgstr "" -#: ../../library/exceptions.rst:641 +#: ../../library/exceptions.rst:664 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` ``ENOENT``." msgstr "" -#: ../../library/exceptions.rst:646 +#: ../../library/exceptions.rst:669 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:data:`~errno.EINTR`." msgstr "" -#: ../../library/exceptions.rst:649 +#: ../../library/exceptions.rst:672 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " "rationale), instead of raising :exc:`InterruptedError`." msgstr "" -#: ../../library/exceptions.rst:656 +#: ../../library/exceptions.rst:679 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` ``EISDIR``." msgstr "" -#: ../../library/exceptions.rst:662 +#: ../../library/exceptions.rst:685 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " @@ -769,123 +795,123 @@ msgid "" "as if it were a directory. Corresponds to :c:data:`errno` ``ENOTDIR``." msgstr "" -#: ../../library/exceptions.rst:670 +#: ../../library/exceptions.rst:693 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` " "``EACCES`` and ``EPERM``." msgstr "" -#: ../../library/exceptions.rst:676 +#: ../../library/exceptions.rst:699 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` " "``ESRCH``." msgstr "" -#: ../../library/exceptions.rst:681 +#: ../../library/exceptions.rst:704 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` ``ETIMEDOUT``." msgstr "" -#: ../../library/exceptions.rst:684 +#: ../../library/exceptions.rst:707 msgid "All the above :exc:`OSError` subclasses were added." msgstr "" -#: ../../library/exceptions.rst:690 +#: ../../library/exceptions.rst:713 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:696 +#: ../../library/exceptions.rst:719 msgid "Warnings" msgstr "" -#: ../../library/exceptions.rst:698 +#: ../../library/exceptions.rst:721 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" -#: ../../library/exceptions.rst:703 +#: ../../library/exceptions.rst:726 msgid "Base class for warning categories." msgstr "" -#: ../../library/exceptions.rst:708 +#: ../../library/exceptions.rst:731 msgid "Base class for warnings generated by user code." msgstr "" -#: ../../library/exceptions.rst:713 +#: ../../library/exceptions.rst:736 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -#: ../../library/exceptions.rst:716 +#: ../../library/exceptions.rst:739 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " "warning." msgstr "" -#: ../../library/exceptions.rst:720 ../../library/exceptions.rst:736 +#: ../../library/exceptions.rst:743 ../../library/exceptions.rst:759 msgid "The deprecation policy is described in :pep:`387`." msgstr "" -#: ../../library/exceptions.rst:725 +#: ../../library/exceptions.rst:748 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "" -#: ../../library/exceptions.rst:729 +#: ../../library/exceptions.rst:752 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " "already active deprecations." msgstr "" -#: ../../library/exceptions.rst:733 ../../library/exceptions.rst:759 -#: ../../library/exceptions.rst:777 +#: ../../library/exceptions.rst:756 ../../library/exceptions.rst:782 +#: ../../library/exceptions.rst:800 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." msgstr "" -#: ../../library/exceptions.rst:741 +#: ../../library/exceptions.rst:764 msgid "Base class for warnings about dubious syntax." msgstr "" -#: ../../library/exceptions.rst:746 +#: ../../library/exceptions.rst:769 msgid "Base class for warnings about dubious runtime behavior." msgstr "" -#: ../../library/exceptions.rst:751 +#: ../../library/exceptions.rst:774 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." msgstr "" -#: ../../library/exceptions.rst:757 +#: ../../library/exceptions.rst:780 msgid "Base class for warnings about probable mistakes in module imports." msgstr "" -#: ../../library/exceptions.rst:765 +#: ../../library/exceptions.rst:788 msgid "Base class for warnings related to Unicode." msgstr "" -#: ../../library/exceptions.rst:770 +#: ../../library/exceptions.rst:793 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/exceptions.rst:775 +#: ../../library/exceptions.rst:798 msgid "Base class for warnings related to resource usage." msgstr "" -#: ../../library/exceptions.rst:785 +#: ../../library/exceptions.rst:808 msgid "Exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:787 +#: ../../library/exceptions.rst:810 msgid "The class hierarchy for built-in exceptions is:" msgstr "" diff --git a/library/functions.po b/library/functions.po index fbe892253d..4cd099c260 100644 --- a/library/functions.po +++ b/library/functions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-07 00:10+0000\n" +"POT-Creation-Date: 2021-10-22 00:14+0000\n" "PO-Revision-Date: 2018-11-10 18:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2244,10 +2244,13 @@ msgid "" "operands, the result has the same type as the operands (after coercion) " "unless the second argument is negative; in that case, all arguments are " "converted to float and a float result is delivered. For example, ``pow(10, " -"2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``." +"2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative " +"base of type :class:`int` or :class:`float` and a non-integral exponent, a " +"complex result is delivered. For example, ``pow(-9, 0.5)`` returns a value " +"close to ``3j``." msgstr "" -#: ../../library/functions.rst:1304 +#: ../../library/functions.rst:1307 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -2256,29 +2259,29 @@ msgid "" "*base* modulo *mod*." msgstr "" -#: ../../library/functions.rst:1310 +#: ../../library/functions.rst:1313 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" -#: ../../library/functions.rst:1317 +#: ../../library/functions.rst:1320 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." msgstr "" -#: ../../library/functions.rst:1322 +#: ../../library/functions.rst:1325 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" -#: ../../library/functions.rst:1329 +#: ../../library/functions.rst:1332 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " "by *end*. *sep*, *end*, *file* and *flush*, if present, must be given as " "keyword arguments." msgstr "" -#: ../../library/functions.rst:1333 +#: ../../library/functions.rst:1336 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -2287,7 +2290,7 @@ msgid "" "*end*." msgstr "" -#: ../../library/functions.rst:1339 +#: ../../library/functions.rst:1342 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -2295,40 +2298,40 @@ msgid "" "binary mode file objects. For these, use ``file.write(...)`` instead." msgstr "" -#: ../../library/functions.rst:1344 +#: ../../library/functions.rst:1347 msgid "" "Whether output is buffered is usually determined by *file*, but if the " "*flush* keyword argument is true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1347 +#: ../../library/functions.rst:1350 #, fuzzy msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* keyword 實參。" -#: ../../library/functions.rst:1353 +#: ../../library/functions.rst:1356 #, fuzzy msgid "Return a property attribute." msgstr "返回 property 屬性。" -#: ../../library/functions.rst:1355 +#: ../../library/functions.rst:1358 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " "attribute value. And *doc* creates a docstring for the attribute." msgstr "" -#: ../../library/functions.rst:1359 +#: ../../library/functions.rst:1362 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1376 +#: ../../library/functions.rst:1379 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter and ``del c.x`` the deleter." msgstr "" -#: ../../library/functions.rst:1379 +#: ../../library/functions.rst:1382 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2336,14 +2339,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1392 +#: ../../library/functions.rst:1395 msgid "" "The ``@property`` decorator turns the :meth:`voltage` method into a \"getter" "\" for a read-only attribute with the same name, and it sets the docstring " "for *voltage* to \"Get the current voltage.\"" msgstr "" -#: ../../library/functions.rst:1396 +#: ../../library/functions.rst:1399 msgid "" "A property object has :attr:`~property.getter`, :attr:`~property.setter`, " "and :attr:`~property.deleter` methods usable as decorators that create a " @@ -2351,30 +2354,30 @@ msgid "" "decorated function. This is best explained with an example::" msgstr "" -#: ../../library/functions.rst:1418 +#: ../../library/functions.rst:1421 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " "case.)" msgstr "" -#: ../../library/functions.rst:1422 +#: ../../library/functions.rst:1425 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1425 +#: ../../library/functions.rst:1428 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1434 +#: ../../library/functions.rst:1437 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1440 +#: ../../library/functions.rst:1443 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2385,7 +2388,7 @@ msgid "" "function returns for its instances by defining a :meth:`__repr__` method." msgstr "" -#: ../../library/functions.rst:1451 +#: ../../library/functions.rst:1454 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" @@ -2393,14 +2396,14 @@ msgid "" "starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1459 +#: ../../library/functions.rst:1462 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -#: ../../library/functions.rst:1463 +#: ../../library/functions.rst:1466 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2411,13 +2414,13 @@ msgid "" "``None``. Otherwise the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1472 +#: ../../library/functions.rst:1475 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1477 +#: ../../library/functions.rst:1480 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2426,21 +2429,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1488 +#: ../../library/functions.rst:1491 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" "set` for documentation about this class." msgstr "" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1495 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " "module." msgstr "" -#: ../../library/functions.rst:1499 +#: ../../library/functions.rst:1502 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string and an arbitrary value. The string may name an existing attribute or " @@ -2449,14 +2452,14 @@ msgid "" "equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1507 +#: ../../library/functions.rst:1510 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -#: ../../library/functions.rst:1516 +#: ../../library/functions.rst:1519 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -2469,35 +2472,35 @@ msgid "" "func:`itertools.islice` for an alternate version that returns an iterator." msgstr "" -#: ../../library/functions.rst:1529 +#: ../../library/functions.rst:1532 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1531 +#: ../../library/functions.rst:1534 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性參數,只能使用關鍵字參數指定。" -#: ../../library/functions.rst:1533 +#: ../../library/functions.rst:1536 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -#: ../../library/functions.rst:1537 +#: ../../library/functions.rst:1540 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/functions.rst:1540 +#: ../../library/functions.rst:1543 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1543 +#: ../../library/functions.rst:1546 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -2505,7 +2508,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1548 +#: ../../library/functions.rst:1551 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2517,22 +2520,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1557 +#: ../../library/functions.rst:1560 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1561 +#: ../../library/functions.rst:1564 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1563 +#: ../../library/functions.rst:1566 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1570 +#: ../../library/functions.rst:1573 #, fuzzy msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" @@ -2541,20 +2544,20 @@ msgstr "" "``@classmethod`` 形式是一個函式 :term:`decorator` - 參見 :ref:`function` 中關" "於函式定義的詳細介紹。" -#: ../../library/functions.rst:1573 +#: ../../library/functions.rst:1576 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``)." msgstr "" -#: ../../library/functions.rst:1576 +#: ../../library/functions.rst:1579 msgid "" "Static methods in Python are similar to those found in Java or C++. Also " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" -#: ../../library/functions.rst:1580 +#: ../../library/functions.rst:1583 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -2563,30 +2566,30 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1589 +#: ../../library/functions.rst:1592 #, fuzzy msgid "For more information on static methods, see :ref:`types`." msgstr "關於類方法的更多資訊,請參考文件 :ref:`types` 中的標準型別的層次。" -#: ../../library/functions.rst:1600 +#: ../../library/functions.rst:1603 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1602 +#: ../../library/functions.rst:1605 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1608 +#: ../../library/functions.rst:1611 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -#: ../../library/functions.rst:1612 +#: ../../library/functions.rst:1615 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -2595,32 +2598,32 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1618 +#: ../../library/functions.rst:1621 #, fuzzy msgid "The *start* parameter can be specified as a keyword argument." msgstr "有兩個選擇性參數,只能使用關鍵字參數指定。" -#: ../../library/functions.rst:1623 +#: ../../library/functions.rst:1626 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " "been overridden in a class." msgstr "" -#: ../../library/functions.rst:1627 +#: ../../library/functions.rst:1630 msgid "" "The *object-or-type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -#: ../../library/functions.rst:1631 +#: ../../library/functions.rst:1634 msgid "" "For example, if :attr:`~class.__mro__` of *object-or-type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1635 +#: ../../library/functions.rst:1638 msgid "" "The :attr:`~class.__mro__` attribute of the *object-or-type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2628,7 +2631,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1640 +#: ../../library/functions.rst:1643 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -2636,7 +2639,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1645 +#: ../../library/functions.rst:1648 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -2644,7 +2647,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1650 +#: ../../library/functions.rst:1653 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -2657,18 +2660,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1660 +#: ../../library/functions.rst:1663 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1667 +#: ../../library/functions.rst:1670 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " "` in a parent or sibling class." msgstr "" -#: ../../library/functions.rst:1671 +#: ../../library/functions.rst:1674 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2678,7 +2681,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1678 +#: ../../library/functions.rst:1681 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -2688,33 +2691,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1685 +#: ../../library/functions.rst:1688 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1694 +#: ../../library/functions.rst:1697 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1703 +#: ../../library/functions.rst:1706 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." "__class__ `." msgstr "" -#: ../../library/functions.rst:1707 +#: ../../library/functions.rst:1710 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." msgstr "" -#: ../../library/functions.rst:1711 +#: ../../library/functions.rst:1714 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -2727,11 +2730,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1726 +#: ../../library/functions.rst:1729 msgid "See also :ref:`bltin-type-objects`." msgstr "" -#: ../../library/functions.rst:1728 +#: ../../library/functions.rst:1731 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2739,24 +2742,24 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1733 +#: ../../library/functions.rst:1736 #, fuzzy msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:1735 +#: ../../library/functions.rst:1738 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../library/functions.rst:1741 +#: ../../library/functions.rst:1744 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/functions.rst:1744 +#: ../../library/functions.rst:1747 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2764,25 +2767,25 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1749 +#: ../../library/functions.rst:1752 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " "dictionary are ignored." msgstr "" -#: ../../library/functions.rst:1753 +#: ../../library/functions.rst:1756 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " "defines the :attr:`~object.__slots__` attribute)." msgstr "" -#: ../../library/functions.rst:1759 +#: ../../library/functions.rst:1762 msgid "Make an iterator that aggregates elements from each of the iterables." msgstr "" -#: ../../library/functions.rst:1761 +#: ../../library/functions.rst:1764 msgid "" "Returns an iterator of tuples, where the *i*-th tuple contains the *i*-th " "element from each of the argument sequences or iterables. The iterator " @@ -2791,7 +2794,7 @@ msgid "" "an empty iterator. Equivalent to::" msgstr "" -#: ../../library/functions.rst:1780 +#: ../../library/functions.rst:1783 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -2800,26 +2803,26 @@ msgid "" "This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1786 +#: ../../library/functions.rst:1789 msgid "" ":func:`zip` should only be used with unequal length inputs when you don't " "care about trailing, unmatched values from the longer iterables. If those " "values are important, use :func:`itertools.zip_longest` instead." msgstr "" -#: ../../library/functions.rst:1790 +#: ../../library/functions.rst:1793 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1811 +#: ../../library/functions.rst:1814 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1814 +#: ../../library/functions.rst:1817 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -2831,7 +2834,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1823 +#: ../../library/functions.rst:1826 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -2841,7 +2844,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1830 +#: ../../library/functions.rst:1833 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -2850,7 +2853,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:1836 +#: ../../library/functions.rst:1839 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -2858,58 +2861,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:1841 +#: ../../library/functions.rst:1844 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:1846 +#: ../../library/functions.rst:1849 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:1850 +#: ../../library/functions.rst:1853 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1853 +#: ../../library/functions.rst:1856 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:1860 +#: ../../library/functions.rst:1863 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " "respective names." msgstr "" -#: ../../library/functions.rst:1864 +#: ../../library/functions.rst:1867 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1867 +#: ../../library/functions.rst:1870 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:1871 +#: ../../library/functions.rst:1874 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -#: ../../library/functions.rst:1876 +#: ../../library/functions.rst:1879 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:1877 +#: ../../library/functions.rst:1880 #, fuzzy msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " diff --git a/library/intro.po b/library/intro.po index ed8099a77c..d35e35be72 100644 --- a/library/intro.po +++ b/library/intro.po @@ -4,15 +4,15 @@ # # Translators: # Liang-Bo Wang , 2016 -# eopXD, 2018 +# eopXD , 2018 # Matt Wang , 2021 # msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 22:47+0800\n" -"PO-Revision-Date: 2021-10-26 15:56+0800\n" +"POT-Creation-Date: 2021-10-26 08:56+0000\n" +"PO-Revision-Date: 2021-10-26 17:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -108,8 +108,8 @@ msgstr "" "\\ 像是在讀一本小說一樣讀這本手冊——你可以快速瀏覽目錄(在手冊的最前頭)、或是" "你可以利用最後面的索引來查詢特定的函式或模組。最後,如果你享受閱讀一些隨機的" "主題,你可以選擇一個隨機的數字並開始閱讀(見 :mod:`random` 模組) 。不管你想要" -"以什麼順序來閱讀這個手冊,\\ :ref:`built-in-funcs` 會是一個很好的入門,因為手" -"冊中其他章節都預設你已經對這個章節有一定的熟悉程度。" +"以什麼順序來閱讀這個手冊,\\ :ref:`built-in-funcs`\\ 會是一個很好的入門,因為" +"手冊中其他章節都預設你已經對這個章節有一定的熟悉程度。" #: ../../library/intro.rst:48 msgid "Let the show begin!" @@ -131,7 +131,7 @@ msgstr "" #: ../../library/intro.rst:60 msgid "" "If not separately noted, all functions that claim \"Availability: Unix\" are " -"supported on Mac OS X, which builds on a Unix core." +"supported on macOS, which builds on a Unix core." msgstr "" -"如果沒有分別註釋的話,有標明「適用:Unix」註釋的所有函式也都於 Mac OS X 上支" -"援,因其建於 Unix 核心之上。" +"如果沒有分別註釋的話,有標明「適用:Unix」註釋的所有函式也都於 macOS 上支援," +"因其建於 Unix 核心之上。" diff --git a/library/socket.po b/library/socket.po index 80cae64d48..15bc6adc8f 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-06 00:11+0000\n" +"POT-Creation-Date: 2021-10-22 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -100,8 +100,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:63 ../../library/socket.rst:966 -#: ../../library/socket.rst:1008 ../../library/socket.rst:1738 +#: ../../library/socket.rst:63 ../../library/socket.rst:970 +#: ../../library/socket.rst:1012 ../../library/socket.rst:1742 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -338,7 +338,7 @@ msgid "" "address, whose interpretation depends on the device." msgstr "" -#: ../../library/socket.rst:200 +#: ../../library/socket.rst:202 msgid "" ":const:`AF_QIPCRTR` is a Linux-only socket based interface for communicating " "with services running on co-processors in Qualcomm platforms. The address " @@ -346,7 +346,7 @@ msgid "" "*port* are non-negative integers." msgstr "" -#: ../../library/socket.rst:207 +#: ../../library/socket.rst:211 msgid "" ":const:`IPPROTO_UDPLITE` is a variant of UDP which allows you to specify " "what portion of a packet is covered with the checksum. It adds two socket " @@ -357,14 +357,14 @@ msgid "" "of their data. In both cases ``length`` should be in ``range(8, 2**16, 8)``." msgstr "" -#: ../../library/socket.rst:216 +#: ../../library/socket.rst:220 msgid "" "Such a socket should be constructed with ``socket(AF_INET, SOCK_DGRAM, " "IPPROTO_UDPLITE)`` for IPv4 or ``socket(AF_INET6, SOCK_DGRAM, " "IPPROTO_UDPLITE)`` for IPv6." msgstr "" -#: ../../library/socket.rst:224 +#: ../../library/socket.rst:228 msgid "" "If you use a hostname in the *host* portion of IPv4/v6 socket address, the " "program may show a nondeterministic behavior, as Python uses the first " @@ -374,7 +374,7 @@ msgid "" "deterministic behavior use a numeric address in *host* portion." msgstr "" -#: ../../library/socket.rst:231 +#: ../../library/socket.rst:235 msgid "" "All errors raise exceptions. The normal exceptions for invalid argument " "types and out-of-memory conditions can be raised; starting from Python 3.3, " @@ -382,34 +382,34 @@ msgid "" "its subclasses (they used to raise :exc:`socket.error`)." msgstr "" -#: ../../library/socket.rst:236 +#: ../../library/socket.rst:240 msgid "" "Non-blocking mode is supported through :meth:`~socket.setblocking`. A " "generalization of this based on timeouts is supported through :meth:`~socket." "settimeout`." msgstr "" -#: ../../library/socket.rst:242 +#: ../../library/socket.rst:246 msgid "Module contents" msgstr "" -#: ../../library/socket.rst:244 +#: ../../library/socket.rst:248 msgid "The module :mod:`socket` exports the following elements." msgstr "" -#: ../../library/socket.rst:248 +#: ../../library/socket.rst:252 msgid "Exceptions" msgstr "" -#: ../../library/socket.rst:252 +#: ../../library/socket.rst:256 msgid "A deprecated alias of :exc:`OSError`." msgstr "" -#: ../../library/socket.rst:254 +#: ../../library/socket.rst:258 msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." msgstr "" -#: ../../library/socket.rst:260 +#: ../../library/socket.rst:264 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " "errors, i.e. for functions that use *h_errno* in the POSIX C API, including :" @@ -419,12 +419,12 @@ msgid "" "description of *h_errno*, as returned by the :c:func:`hstrerror` C function." msgstr "" -#: ../../library/socket.rst:268 ../../library/socket.rst:281 -#: ../../library/socket.rst:292 +#: ../../library/socket.rst:272 ../../library/socket.rst:285 +#: ../../library/socket.rst:296 msgid "This class was made a subclass of :exc:`OSError`." msgstr "" -#: ../../library/socket.rst:273 +#: ../../library/socket.rst:277 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " "errors by :func:`getaddrinfo` and :func:`getnameinfo`. The accompanying " @@ -434,7 +434,7 @@ msgid "" "match one of the :const:`EAI_\\*` constants defined in this module." msgstr "" -#: ../../library/socket.rst:286 +#: ../../library/socket.rst:290 msgid "" "A subclass of :exc:`OSError`, this exception is raised when a timeout occurs " "on a socket which has had timeouts enabled via a prior call to :meth:" @@ -443,17 +443,17 @@ msgid "" "currently always \"timed out\"." msgstr "" -#: ../../library/socket.rst:297 +#: ../../library/socket.rst:301 msgid "Constants" msgstr "" -#: ../../library/socket.rst:299 +#: ../../library/socket.rst:303 msgid "" "The AF_* and SOCK_* constants are now :class:`AddressFamily` and :class:" "`SocketKind` :class:`.IntEnum` collections." msgstr "" -#: ../../library/socket.rst:308 +#: ../../library/socket.rst:312 msgid "" "These constants represent the address (and protocol) families, used for the " "first argument to :func:`.socket`. If the :const:`AF_UNIX` constant is not " @@ -461,7 +461,7 @@ msgid "" "depending on the system." msgstr "" -#: ../../library/socket.rst:320 +#: ../../library/socket.rst:324 msgid "" "These constants represent the socket types, used for the second argument to :" "func:`.socket`. More constants may be available depending on the system. " @@ -469,24 +469,24 @@ msgid "" "useful.)" msgstr "" -#: ../../library/socket.rst:328 +#: ../../library/socket.rst:332 msgid "" "These two constants, if defined, can be combined with the socket types and " "allow you to set some flags atomically (thus avoiding possible race " "conditions and the need for separate calls)." msgstr "" -#: ../../library/socket.rst:334 +#: ../../library/socket.rst:338 msgid "" "`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" -#: ../../library/socket.rst:338 +#: ../../library/socket.rst:342 msgid ":ref:`Availability `: Linux >= 2.6.27." msgstr "" -#: ../../library/socket.rst:356 +#: ../../library/socket.rst:360 msgid "" "Many constants of these forms, documented in the Unix documentation on " "sockets and/or the IP protocol, are also defined in the socket module. They " @@ -496,181 +496,181 @@ msgid "" "default values are provided." msgstr "" -#: ../../library/socket.rst:363 +#: ../../library/socket.rst:367 msgid "" "``SO_DOMAIN``, ``SO_PROTOCOL``, ``SO_PEERSEC``, ``SO_PASSSEC``, " "``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added." msgstr "" -#: ../../library/socket.rst:367 +#: ../../library/socket.rst:371 msgid "" "On Windows, ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:371 +#: ../../library/socket.rst:375 msgid "``TCP_NOTSENT_LOWAT`` was added." msgstr "" -#: ../../library/socket.rst:374 +#: ../../library/socket.rst:378 msgid "" "On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:382 ../../library/socket.rst:449 -#: ../../library/socket.rst:460 +#: ../../library/socket.rst:386 ../../library/socket.rst:453 +#: ../../library/socket.rst:464 msgid "" "Many constants of these forms, documented in the Linux documentation, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:386 ../../library/socket.rst:397 -#: ../../library/socket.rst:432 +#: ../../library/socket.rst:390 ../../library/socket.rst:401 +#: ../../library/socket.rst:436 msgid ":ref:`Availability `: Linux >= 2.6.25." msgstr "" -#: ../../library/socket.rst:392 +#: ../../library/socket.rst:396 msgid "" "CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) " "protocol. Broadcast manager constants, documented in the Linux " "documentation, are also defined in the socket module." msgstr "" -#: ../../library/socket.rst:399 +#: ../../library/socket.rst:403 msgid "" "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." msgstr "" -#: ../../library/socket.rst:405 +#: ../../library/socket.rst:409 msgid "" "Enables CAN FD support in a CAN_RAW socket. This is disabled by default. " "This allows your application to send both CAN and CAN FD frames; however, " "you must accept both CAN and CAN FD frames when reading from the socket." msgstr "" -#: ../../library/socket.rst:409 ../../library/socket.rst:420 +#: ../../library/socket.rst:413 ../../library/socket.rst:424 msgid "This constant is documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:412 +#: ../../library/socket.rst:416 msgid ":ref:`Availability `: Linux >= 3.6." msgstr "" -#: ../../library/socket.rst:417 +#: ../../library/socket.rst:421 msgid "" "Joins the applied CAN filters such that only CAN frames that match all given " "CAN filters are passed to user space." msgstr "" -#: ../../library/socket.rst:423 +#: ../../library/socket.rst:427 msgid ":ref:`Availability `: Linux >= 4.1." msgstr "" -#: ../../library/socket.rst:428 +#: ../../library/socket.rst:432 msgid "" "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. " "ISO-TP constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:437 +#: ../../library/socket.rst:441 msgid "" "CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. J1939 " "constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:441 +#: ../../library/socket.rst:445 msgid ":ref:`Availability `: Linux >= 5.4." msgstr "" -#: ../../library/socket.rst:452 +#: ../../library/socket.rst:456 msgid ":ref:`Availability `: Linux >= 2.2." msgstr "" -#: ../../library/socket.rst:464 +#: ../../library/socket.rst:468 msgid ":ref:`Availability `: Linux >= 2.6.30." msgstr "" -#: ../../library/socket.rst:473 +#: ../../library/socket.rst:477 msgid "" "Constants for Windows' WSAIoctl(). The constants are used as arguments to " "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:476 ../../library/socket.rst:1360 +#: ../../library/socket.rst:480 ../../library/socket.rst:1364 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "" -#: ../../library/socket.rst:482 +#: ../../library/socket.rst:486 msgid "" "TIPC related constants, matching the ones exported by the C socket API. See " "the TIPC documentation for more information." msgstr "" -#: ../../library/socket.rst:489 +#: ../../library/socket.rst:493 msgid "Constants for Linux Kernel cryptography." msgstr "" -#: ../../library/socket.rst:492 ../../library/socket.rst:1660 +#: ../../library/socket.rst:496 ../../library/socket.rst:1664 msgid ":ref:`Availability `: Linux >= 2.6.38." msgstr "" -#: ../../library/socket.rst:501 +#: ../../library/socket.rst:505 msgid "Constants for Linux host/guest communication." msgstr "" -#: ../../library/socket.rst:504 +#: ../../library/socket.rst:508 msgid ":ref:`Availability `: Linux >= 4.8." msgstr "" -#: ../../library/socket.rst:510 +#: ../../library/socket.rst:514 msgid ":ref:`Availability `: BSD, macOS." msgstr "" -#: ../../library/socket.rst:515 +#: ../../library/socket.rst:519 msgid "" "This constant contains a boolean value which indicates if IPv6 is supported " "on this platform." msgstr "" -#: ../../library/socket.rst:521 +#: ../../library/socket.rst:525 msgid "" "These are string constants containing Bluetooth addresses with special " "meanings. For example, :const:`BDADDR_ANY` can be used to indicate any " "address when specifying the binding socket with :const:`BTPROTO_RFCOMM`." msgstr "" -#: ../../library/socket.rst:530 +#: ../../library/socket.rst:534 msgid "" "For use with :const:`BTPROTO_HCI`. :const:`HCI_FILTER` is not available for " "NetBSD or DragonFlyBSD. :const:`HCI_TIME_STAMP` and :const:`HCI_DATA_DIR` " "are not available for FreeBSD, NetBSD, or DragonFlyBSD." msgstr "" -#: ../../library/socket.rst:537 +#: ../../library/socket.rst:541 msgid "" "Constant for Qualcomm's IPC router protocol, used to communicate with " "service providing remote processors." msgstr "" -#: ../../library/socket.rst:540 +#: ../../library/socket.rst:544 msgid ":ref:`Availability `: Linux >= 4.7." msgstr "" -#: ../../library/socket.rst:543 +#: ../../library/socket.rst:547 msgid "Functions" msgstr "" -#: ../../library/socket.rst:546 +#: ../../library/socket.rst:550 msgid "Creating sockets" msgstr "" -#: ../../library/socket.rst:548 +#: ../../library/socket.rst:552 msgid "" "The following functions all create :ref:`socket objects `." msgstr "" -#: ../../library/socket.rst:553 +#: ../../library/socket.rst:557 msgid "" "Create a new socket using the given address family, socket type and protocol " "number. The address family should be :const:`AF_INET` (the default), :const:" @@ -683,7 +683,7 @@ msgid "" "`CAN_J1939`." msgstr "" -#: ../../library/socket.rst:563 +#: ../../library/socket.rst:567 msgid "" "If *fileno* is specified, the values for *family*, *type*, and *proto* are " "auto-detected from the specified file descriptor. Auto-detection can be " @@ -694,51 +694,51 @@ msgid "" "This may help close a detached socket using :meth:`socket.close()`." msgstr "" -#: ../../library/socket.rst:572 ../../library/socket.rst:706 -#: ../../library/socket.rst:1190 ../../library/socket.rst:1277 +#: ../../library/socket.rst:576 ../../library/socket.rst:710 +#: ../../library/socket.rst:1194 ../../library/socket.rst:1281 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:574 +#: ../../library/socket.rst:578 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." msgstr "" -#: ../../library/socket.rst:576 +#: ../../library/socket.rst:580 msgid "The AF_CAN family was added. The AF_RDS family was added." msgstr "" -#: ../../library/socket.rst:580 +#: ../../library/socket.rst:584 msgid "The CAN_BCM protocol was added." msgstr "" -#: ../../library/socket.rst:583 ../../library/socket.rst:708 +#: ../../library/socket.rst:587 ../../library/socket.rst:712 msgid "The returned socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:586 +#: ../../library/socket.rst:590 msgid "The CAN_ISOTP protocol was added." msgstr "" -#: ../../library/socket.rst:589 +#: ../../library/socket.rst:593 msgid "" "When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " "to *type* they are cleared, and :attr:`socket.type` will not reflect them. " "They are still passed to the underlying system `socket()` call. Therefore," msgstr "" -#: ../../library/socket.rst:601 +#: ../../library/socket.rst:605 msgid "" "will still create a non-blocking socket on OSes that support " "``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." msgstr "" -#: ../../library/socket.rst:605 +#: ../../library/socket.rst:609 msgid "The CAN_J1939 protocol was added." msgstr "" -#: ../../library/socket.rst:610 +#: ../../library/socket.rst:614 msgid "" "Build a pair of connected socket objects using the given address family, " "socket type, and protocol number. Address family, socket type, and protocol " @@ -747,25 +747,25 @@ msgid "" "`AF_INET`." msgstr "" -#: ../../library/socket.rst:615 +#: ../../library/socket.rst:619 msgid "The newly created sockets are :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:617 +#: ../../library/socket.rst:621 msgid "" "The returned socket objects now support the whole socket API, rather than a " "subset." msgstr "" -#: ../../library/socket.rst:621 +#: ../../library/socket.rst:625 msgid "The returned sockets are now non-inheritable." msgstr "" -#: ../../library/socket.rst:624 +#: ../../library/socket.rst:628 msgid "Windows support added." msgstr "" -#: ../../library/socket.rst:630 +#: ../../library/socket.rst:634 msgid "" "Connect to a TCP service listening on the Internet *address* (a 2-tuple " "``(host, port)``), and return the socket object. This is a higher-level " @@ -776,31 +776,31 @@ msgid "" "IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:638 +#: ../../library/socket.rst:642 msgid "" "Passing the optional *timeout* parameter will set the timeout on the socket " "instance before attempting to connect. If no *timeout* is supplied, the " "global default timeout setting returned by :func:`getdefaulttimeout` is used." msgstr "" -#: ../../library/socket.rst:643 +#: ../../library/socket.rst:647 msgid "" "If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the " "socket to bind to as its source address before connecting. If host or port " "are '' or 0 respectively the OS default behavior will be used." msgstr "" -#: ../../library/socket.rst:647 +#: ../../library/socket.rst:651 msgid "*source_address* was added." msgstr "" -#: ../../library/socket.rst:652 +#: ../../library/socket.rst:656 msgid "" "Convenience function which creates a TCP socket bound to *address* (a 2-" "tuple ``(host, port)``) and return the socket object." msgstr "" -#: ../../library/socket.rst:655 +#: ../../library/socket.rst:659 msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; when ``0`` a default " @@ -808,7 +808,7 @@ msgid "" "`SO_REUSEPORT` socket option." msgstr "" -#: ../../library/socket.rst:660 +#: ../../library/socket.rst:664 msgid "" "If *dualstack_ipv6* is true and the platform supports it the socket will be " "able to accept both IPv4 and IPv6 connections, else it will raise :exc:" @@ -821,20 +821,20 @@ msgid "" "func:`has_dualstack_ipv6`:" msgstr "" -#: ../../library/socket.rst:682 +#: ../../library/socket.rst:686 msgid "" "On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to " "immediately reuse previous sockets which were bound on the same *address* " "and remained in TIME_WAIT state." msgstr "" -#: ../../library/socket.rst:690 +#: ../../library/socket.rst:694 msgid "" "Return ``True`` if the platform supports creating a TCP socket which can " "handle both IPv4 and IPv6 connections." msgstr "" -#: ../../library/socket.rst:697 +#: ../../library/socket.rst:701 msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " "object's :meth:`fileno` method) and build a socket object from the result. " @@ -847,38 +847,38 @@ msgid "" "socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:714 +#: ../../library/socket.rst:718 msgid "" "Instantiate a socket from data obtained from the :meth:`socket.share` " "method. The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:718 ../../library/socket.rst:1763 +#: ../../library/socket.rst:722 ../../library/socket.rst:1767 msgid ":ref:`Availability `: Windows." msgstr "" -#: ../../library/socket.rst:724 +#: ../../library/socket.rst:728 msgid "" "This is a Python type object that represents the socket object type. It is " "the same as ``type(socket(...))``." msgstr "" -#: ../../library/socket.rst:729 +#: ../../library/socket.rst:733 msgid "Other functions" msgstr "" -#: ../../library/socket.rst:731 +#: ../../library/socket.rst:735 msgid "The :mod:`socket` module also offers various network-related services:" msgstr "" -#: ../../library/socket.rst:736 +#: ../../library/socket.rst:740 msgid "" "Close a socket file descriptor. This is like :func:`os.close`, but for " "sockets. On some platforms (most noticeable Windows) :func:`os.close` does " "not work for socket file descriptors." msgstr "" -#: ../../library/socket.rst:744 +#: ../../library/socket.rst:748 msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " @@ -888,7 +888,7 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: ../../library/socket.rst:751 +#: ../../library/socket.rst:755 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " "order to narrow the list of addresses returned. Passing zero as a value for " @@ -899,15 +899,15 @@ msgid "" "domain name." msgstr "" -#: ../../library/socket.rst:759 +#: ../../library/socket.rst:763 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: ../../library/socket.rst:761 +#: ../../library/socket.rst:765 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "" -#: ../../library/socket.rst:763 +#: ../../library/socket.rst:767 msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`.socket` function. *canonname* will be a string " @@ -919,30 +919,30 @@ msgid "" "be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:773 +#: ../../library/socket.rst:777 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." msgstr "" -#: ../../library/socket.rst:775 +#: ../../library/socket.rst:779 msgid "" "The following example fetches address information for a hypothetical TCP " "connection to ``example.org`` on port 80 (results may differ on your system " "if IPv6 isn't enabled)::" msgstr "" -#: ../../library/socket.rst:785 +#: ../../library/socket.rst:789 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: ../../library/socket.rst:788 +#: ../../library/socket.rst:792 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: ../../library/socket.rst:794 +#: ../../library/socket.rst:798 msgid "" "Return a fully qualified domain name for *name*. If *name* is omitted or " "empty, it is interpreted as the local host. To find the fully qualified " @@ -953,7 +953,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:805 +#: ../../library/socket.rst:809 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -963,13 +963,13 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:811 ../../library/socket.rst:825 +#: ../../library/socket.rst:815 ../../library/socket.rst:829 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." msgstr "" -#: ../../library/socket.rst:816 +#: ../../library/socket.rst:820 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a " "triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -981,25 +981,25 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:830 +#: ../../library/socket.rst:834 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:833 +#: ../../library/socket.rst:837 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" -#: ../../library/socket.rst:835 +#: ../../library/socket.rst:839 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:841 +#: ../../library/socket.rst:845 msgid "" "Return a triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1010,13 +1010,13 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:849 +#: ../../library/socket.rst:853 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." msgstr "" -#: ../../library/socket.rst:854 +#: ../../library/socket.rst:858 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully-" @@ -1024,24 +1024,24 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:859 +#: ../../library/socket.rst:863 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: ../../library/socket.rst:862 +#: ../../library/socket.rst:866 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:864 +#: ../../library/socket.rst:868 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." msgstr "" -#: ../../library/socket.rst:868 +#: ../../library/socket.rst:872 msgid "" "Translate an Internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`.socket` " @@ -1050,47 +1050,47 @@ msgid "" "chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:877 +#: ../../library/socket.rst:881 msgid "" "Translate an Internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:881 +#: ../../library/socket.rst:885 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." msgstr "" -#: ../../library/socket.rst:886 +#: ../../library/socket.rst:890 msgid "" "Translate an Internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:890 +#: ../../library/socket.rst:894 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." msgstr "" -#: ../../library/socket.rst:895 +#: ../../library/socket.rst:899 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:902 +#: ../../library/socket.rst:906 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:906 ../../library/socket.rst:926 +#: ../../library/socket.rst:910 ../../library/socket.rst:930 msgid "" "In case *x* does not fit in 16-bit unsigned integer, but does fit in a " "positive C int, it is silently truncated to 16-bit unsigned integer. This " @@ -1098,21 +1098,21 @@ msgid "" "future versions of Python." msgstr "" -#: ../../library/socket.rst:915 +#: ../../library/socket.rst:919 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:922 +#: ../../library/socket.rst:926 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:935 +#: ../../library/socket.rst:939 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1122,26 +1122,26 @@ msgid "" "returns." msgstr "" -#: ../../library/socket.rst:941 +#: ../../library/socket.rst:945 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: ../../library/socket.rst:944 +#: ../../library/socket.rst:948 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: ../../library/socket.rst:948 +#: ../../library/socket.rst:952 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:954 +#: ../../library/socket.rst:958 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1151,7 +1151,7 @@ msgid "" "an argument." msgstr "" -#: ../../library/socket.rst:961 +#: ../../library/socket.rst:965 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1159,7 +1159,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:972 +#: ../../library/socket.rst:976 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1167,7 +1167,7 @@ msgid "" "func:`inet_aton`) or :c:type:`struct in6_addr`." msgstr "" -#: ../../library/socket.rst:977 +#: ../../library/socket.rst:981 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1176,16 +1176,16 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:984 ../../library/socket.rst:1004 +#: ../../library/socket.rst:988 ../../library/socket.rst:1008 msgid "" ":ref:`Availability `: Unix (maybe not all platforms), Windows." msgstr "" -#: ../../library/socket.rst:985 ../../library/socket.rst:1005 +#: ../../library/socket.rst:989 ../../library/socket.rst:1009 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:991 +#: ../../library/socket.rst:995 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1194,7 +1194,7 @@ msgid "" "in_addr` (similar to :func:`inet_ntoa`) or :c:type:`struct in6_addr`." msgstr "" -#: ../../library/socket.rst:998 +#: ../../library/socket.rst:1002 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1202,7 +1202,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1020 +#: ../../library/socket.rst:1024 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1213,14 +1213,14 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1030 ../../library/socket.rst:1051 -#: ../../library/socket.rst:1496 ../../library/socket.rst:1538 -#: ../../library/socket.rst:1644 +#: ../../library/socket.rst:1034 ../../library/socket.rst:1055 +#: ../../library/socket.rst:1500 ../../library/socket.rst:1542 +#: ../../library/socket.rst:1648 msgid "" ":ref:`Availability `: most Unix platforms, possibly others." msgstr "" -#: ../../library/socket.rst:1036 +#: ../../library/socket.rst:1040 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1230,7 +1230,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1044 +#: ../../library/socket.rst:1048 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1238,143 +1238,143 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1057 +#: ../../library/socket.rst:1061 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: ../../library/socket.rst:1064 +#: ../../library/socket.rst:1068 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: ../../library/socket.rst:1072 +#: ../../library/socket.rst:1076 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:1075 +#: ../../library/socket.rst:1079 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." msgstr "" -#: ../../library/socket.rst:1078 +#: ../../library/socket.rst:1082 msgid ":ref:`Availability `: Unix." msgstr "" -#: ../../library/socket.rst:1084 +#: ../../library/socket.rst:1088 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1089 ../../library/socket.rst:1116 -#: ../../library/socket.rst:1133 +#: ../../library/socket.rst:1093 ../../library/socket.rst:1120 +#: ../../library/socket.rst:1137 msgid ":ref:`Availability `: Unix, Windows." msgstr "" -#: ../../library/socket.rst:1092 ../../library/socket.rst:1119 -#: ../../library/socket.rst:1136 +#: ../../library/socket.rst:1096 ../../library/socket.rst:1123 +#: ../../library/socket.rst:1140 msgid "Windows support was added." msgstr "" -#: ../../library/socket.rst:1097 +#: ../../library/socket.rst:1101 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: ../../library/socket.rst:1100 +#: ../../library/socket.rst:1104 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "" -#: ../../library/socket.rst:1101 +#: ../../library/socket.rst:1105 msgid "name: ``ethernet_32770``" msgstr "" -#: ../../library/socket.rst:1102 +#: ../../library/socket.rst:1106 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: ../../library/socket.rst:1103 +#: ../../library/socket.rst:1107 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: ../../library/socket.rst:1105 +#: ../../library/socket.rst:1109 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: ../../library/socket.rst:1111 +#: ../../library/socket.rst:1115 msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: ../../library/socket.rst:1123 ../../library/socket.rst:1140 +#: ../../library/socket.rst:1127 ../../library/socket.rst:1144 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: ../../library/socket.rst:1128 +#: ../../library/socket.rst:1132 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: ../../library/socket.rst:1145 +#: ../../library/socket.rst:1149 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " "*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" "`sendmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1150 +#: ../../library/socket.rst:1154 msgid "" ":ref:`Availability `: Unix supporting :meth:`~socket.sendmsg` " "and :const:`SCM_RIGHTS` mechanism." msgstr "" -#: ../../library/socket.rst:1156 +#: ../../library/socket.rst:1160 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " "*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`recvmsg` " "for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1161 +#: ../../library/socket.rst:1165 msgid "" ":ref:`Availability `: Unix supporting :meth:`~socket.recvmsg` " "and :const:`SCM_RIGHTS` mechanism." msgstr "" -#: ../../library/socket.rst:1166 +#: ../../library/socket.rst:1170 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: ../../library/socket.rst:1172 +#: ../../library/socket.rst:1176 msgid "Socket Objects" msgstr "" -#: ../../library/socket.rst:1174 +#: ../../library/socket.rst:1178 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: ../../library/socket.rst:1178 +#: ../../library/socket.rst:1182 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: ../../library/socket.rst:1185 +#: ../../library/socket.rst:1189 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1383,33 +1383,33 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1192 ../../library/socket.rst:1279 +#: ../../library/socket.rst:1196 ../../library/socket.rst:1283 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1195 ../../library/socket.rst:1410 -#: ../../library/socket.rst:1424 ../../library/socket.rst:1499 -#: ../../library/socket.rst:1570 ../../library/socket.rst:1589 -#: ../../library/socket.rst:1606 ../../library/socket.rst:1649 +#: ../../library/socket.rst:1199 ../../library/socket.rst:1414 +#: ../../library/socket.rst:1428 ../../library/socket.rst:1503 +#: ../../library/socket.rst:1574 ../../library/socket.rst:1593 +#: ../../library/socket.rst:1610 ../../library/socket.rst:1653 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1203 +#: ../../library/socket.rst:1207 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1206 +#: ../../library/socket.rst:1210 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1210 +#: ../../library/socket.rst:1214 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile()` are " @@ -1418,20 +1418,20 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1216 +#: ../../library/socket.rst:1220 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: ../../library/socket.rst:1220 +#: ../../library/socket.rst:1224 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: ../../library/socket.rst:1226 +#: ../../library/socket.rst:1230 msgid "" ":meth:`close()` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " @@ -1439,13 +1439,13 @@ msgid "" "`close()`." msgstr "" -#: ../../library/socket.rst:1234 +#: ../../library/socket.rst:1238 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1237 +#: ../../library/socket.rst:1241 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`socket.timeout` on timeout, if the " @@ -1455,13 +1455,13 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1244 ../../library/socket.rst:1262 +#: ../../library/socket.rst:1248 ../../library/socket.rst:1266 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1246 +#: ../../library/socket.rst:1250 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1469,7 +1469,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1255 +#: ../../library/socket.rst:1259 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1479,38 +1479,38 @@ msgid "" "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1266 +#: ../../library/socket.rst:1270 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: ../../library/socket.rst:1275 +#: ../../library/socket.rst:1279 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1285 +#: ../../library/socket.rst:1289 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: ../../library/socket.rst:1288 +#: ../../library/socket.rst:1292 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: ../../library/socket.rst:1294 +#: ../../library/socket.rst:1298 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: ../../library/socket.rst:1303 +#: ../../library/socket.rst:1307 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1518,14 +1518,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1311 +#: ../../library/socket.rst:1315 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1318 +#: ../../library/socket.rst:1322 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:const:`SO_\\*` etc.) are " @@ -1537,16 +1537,16 @@ msgid "" "`struct` for a way to decode C structures encoded as byte strings)." msgstr "" -#: ../../library/socket.rst:1330 +#: ../../library/socket.rst:1334 msgid "" "Return ``True`` if socket is in blocking mode, ``False`` if in non-blocking." msgstr "" -#: ../../library/socket.rst:1333 +#: ../../library/socket.rst:1337 msgid "This is equivalent to checking ``socket.gettimeout() == 0``." msgstr "" -#: ../../library/socket.rst:1340 +#: ../../library/socket.rst:1344 msgid "" "Return the timeout in seconds (float) associated with socket operations, or " "``None`` if no timeout is set. This reflects the last call to :meth:" @@ -1557,30 +1557,30 @@ msgstr "" msgid "platform" msgstr "" -#: ../../library/socket.rst:1347 +#: ../../library/socket.rst:1351 msgid "Windows" msgstr "" -#: ../../library/socket.rst:1349 +#: ../../library/socket.rst:1353 msgid "" "The :meth:`ioctl` method is a limited interface to the WSAIoctl system " "interface. Please refer to the `Win32 documentation `_ for more information." msgstr "" -#: ../../library/socket.rst:1354 +#: ../../library/socket.rst:1358 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: ../../library/socket.rst:1357 +#: ../../library/socket.rst:1361 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1365 +#: ../../library/socket.rst:1369 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1588,11 +1588,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1370 +#: ../../library/socket.rst:1374 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1378 +#: ../../library/socket.rst:1382 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1601,28 +1601,28 @@ msgid "" "``'b'``." msgstr "" -#: ../../library/socket.rst:1383 +#: ../../library/socket.rst:1387 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: ../../library/socket.rst:1387 +#: ../../library/socket.rst:1391 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: ../../library/socket.rst:1393 +#: ../../library/socket.rst:1397 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: ../../library/socket.rst:1400 +#: ../../library/socket.rst:1404 msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " @@ -1631,13 +1631,13 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1407 +#: ../../library/socket.rst:1411 msgid "" "For best match with hardware and network realities, the value of *bufsize* " "should be a relatively small power of 2, for example, 4096." msgstr "" -#: ../../library/socket.rst:1418 +#: ../../library/socket.rst:1422 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1647,14 +1647,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1429 +#: ../../library/socket.rst:1433 msgid "" "For multicast IPv6 address, first item of *address* does not contain ``" "%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1436 +#: ../../library/socket.rst:1440 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1665,7 +1665,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1446 +#: ../../library/socket.rst:1450 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1680,7 +1680,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1460 +#: ../../library/socket.rst:1464 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1693,7 +1693,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1471 +#: ../../library/socket.rst:1475 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1702,7 +1702,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1478 +#: ../../library/socket.rst:1482 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1711,7 +1711,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1507 +#: ../../library/socket.rst:1511 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1724,7 +1724,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1518 +#: ../../library/socket.rst:1522 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -1732,11 +1732,11 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1523 +#: ../../library/socket.rst:1527 msgid "Example::" msgstr "" -#: ../../library/socket.rst:1544 +#: ../../library/socket.rst:1548 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -1746,7 +1746,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1554 +#: ../../library/socket.rst:1558 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -1755,7 +1755,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1563 +#: ../../library/socket.rst:1567 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1765,7 +1765,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1578 +#: ../../library/socket.rst:1582 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1775,13 +1775,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1585 +#: ../../library/socket.rst:1589 msgid "" "The socket timeout is no more reset each time data is sent successfully. The " "socket timeout is now the maximum total duration to send all data." msgstr "" -#: ../../library/socket.rst:1598 +#: ../../library/socket.rst:1602 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -1790,13 +1790,13 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1604 +#: ../../library/socket.rst:1608 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1614 +#: ../../library/socket.rst:1618 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -1816,27 +1816,27 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1634 +#: ../../library/socket.rst:1638 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1645 +#: ../../library/socket.rst:1649 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1656 +#: ../../library/socket.rst:1660 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1665 +#: ../../library/socket.rst:1669 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -1850,38 +1850,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1681 +#: ../../library/socket.rst:1685 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1689 +#: ../../library/socket.rst:1693 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1692 +#: ../../library/socket.rst:1696 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1694 +#: ../../library/socket.rst:1698 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "" -#: ../../library/socket.rst:1696 +#: ../../library/socket.rst:1700 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "" -#: ../../library/socket.rst:1698 +#: ../../library/socket.rst:1702 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1705 +#: ../../library/socket.rst:1709 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating point number expressing seconds, or ``None``. If a non-" @@ -1891,19 +1891,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1712 +#: ../../library/socket.rst:1716 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1714 +#: ../../library/socket.rst:1718 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1727 +#: ../../library/socket.rst:1731 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in the :mod:" @@ -1916,11 +1916,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1741 +#: ../../library/socket.rst:1745 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1747 +#: ../../library/socket.rst:1751 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -1928,7 +1928,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1755 +#: ../../library/socket.rst:1759 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -1939,48 +1939,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1767 +#: ../../library/socket.rst:1771 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:1770 +#: ../../library/socket.rst:1774 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:1776 +#: ../../library/socket.rst:1780 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:1781 +#: ../../library/socket.rst:1785 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:1786 +#: ../../library/socket.rst:1790 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:1793 +#: ../../library/socket.rst:1797 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:1795 +#: ../../library/socket.rst:1799 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:1799 +#: ../../library/socket.rst:1803 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:1802 +#: ../../library/socket.rst:1806 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -1988,14 +1988,14 @@ msgid "" "for reading or writing." msgstr "" -#: ../../library/socket.rst:1807 +#: ../../library/socket.rst:1811 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:1812 +#: ../../library/socket.rst:1816 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2004,11 +2004,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno()` of a socket." msgstr "" -#: ../../library/socket.rst:1819 +#: ../../library/socket.rst:1823 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:1821 +#: ../../library/socket.rst:1825 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2018,24 +2018,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:1829 +#: ../../library/socket.rst:1833 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:1831 +#: ../../library/socket.rst:1835 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:1835 +#: ../../library/socket.rst:1839 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1842 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2043,11 +2043,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:1847 +#: ../../library/socket.rst:1851 msgid "Example" msgstr "" -#: ../../library/socket.rst:1849 +#: ../../library/socket.rst:1853 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2060,11 +2060,11 @@ msgid "" "new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:1859 +#: ../../library/socket.rst:1863 msgid "The first two examples support IPv4 only. ::" msgstr "" -#: ../../library/socket.rst:1890 +#: ../../library/socket.rst:1894 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2074,73 +2074,73 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:1962 +#: ../../library/socket.rst:1966 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:1987 +#: ../../library/socket.rst:1991 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:1993 +#: ../../library/socket.rst:1997 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send`, and the :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:1997 +#: ../../library/socket.rst:2001 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2037 +#: ../../library/socket.rst:2041 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2042 +#: ../../library/socket.rst:2046 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2045 +#: ../../library/socket.rst:2049 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :data:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2052 +#: ../../library/socket.rst:2056 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2058 +#: ../../library/socket.rst:2062 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2060 +#: ../../library/socket.rst:2064 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2062 +#: ../../library/socket.rst:2066 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2065 +#: ../../library/socket.rst:2069 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " diff --git a/tutorial/introduction.po b/tutorial/introduction.po index fca7a71e27..67b71bb464 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-21 15:40+0000\n" "PO-Revision-Date: 2021-06-08 13:21+0800\n" "Last-Translator: Ching-Hao Liu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,6 +42,14 @@ msgstr "" #: ../../tutorial/introduction.rst:16 msgid "" +"You can toggle the display of prompts and output by clicking on ``>>>`` in " +"the upper-right corner of an example box. If you hide the prompts and " +"output for an example, then you can easily copy and paste the input lines " +"into your interpreter." +msgstr "" + +#: ../../tutorial/introduction.rst:23 +msgid "" "Many of the examples in this manual, even those entered at the interactive " "prompt, include comments. Comments in Python start with the hash character, " "``#``, and extend to the end of the physical line. A comment may appear at " @@ -56,18 +64,18 @@ msgstr "" "字串文本之中時仍視為一 hash 字元。因為註解只是用來說明程式而不會被 Python 解" "讀,在練習範例時不一定要輸入。" -#: ../../tutorial/introduction.rst:24 +#: ../../tutorial/introduction.rst:31 msgid "Some examples::" msgstr "" "一些範例如下:\n" "\n" "::" -#: ../../tutorial/introduction.rst:35 +#: ../../tutorial/introduction.rst:42 msgid "Using Python as a Calculator" msgstr "把 Python 當作計算機使用" -#: ../../tutorial/introduction.rst:37 +#: ../../tutorial/introduction.rst:44 msgid "" "Let's try some simple Python commands. Start the interpreter and wait for " "the primary prompt, ``>>>``. (It shouldn't take long.)" @@ -75,11 +83,11 @@ msgstr "" "讓我們來試試一些簡單的 Python 指令。啟動直譯器並等待第一個主提示符 ``>>>`` 出" "現。(應該不會等太久)" -#: ../../tutorial/introduction.rst:44 +#: ../../tutorial/introduction.rst:51 msgid "Numbers" msgstr "數字 (Number)" -#: ../../tutorial/introduction.rst:46 +#: ../../tutorial/introduction.rst:53 msgid "" "The interpreter acts as a simple calculator: you can type an expression at " "it and it will write the value. Expression syntax is straightforward: the " @@ -93,7 +101,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:61 +#: ../../tutorial/introduction.rst:68 msgid "" "The integer numbers (e.g. ``2``, ``4``, ``20``) have type :class:`int`, the " "ones with a fractional part (e.g. ``5.0``, ``1.6``) have type :class:" @@ -103,7 +111,7 @@ msgstr "" "(即 ``5.0``、``1.6``)為 :class:`float` 型態。我們將在之後的教學中看到更多數" "字相關的型態。" -#: ../../tutorial/introduction.rst:65 +#: ../../tutorial/introduction.rst:72 msgid "" "Division (``/``) always returns a float. To do :term:`floor division` and " "get an integer result (discarding any fractional result) you can use the ``//" @@ -115,7 +123,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:79 +#: ../../tutorial/introduction.rst:86 msgid "" "With Python, it is possible to use the ``**`` operator to calculate powers " "[#]_::" @@ -124,7 +132,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:86 +#: ../../tutorial/introduction.rst:93 msgid "" "The equal sign (``=``) is used to assign a value to a variable. Afterwards, " "no result is displayed before the next interactive prompt::" @@ -134,7 +142,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:94 +#: ../../tutorial/introduction.rst:101 msgid "" "If a variable is not \"defined\" (assigned a value), trying to use it will " "give you an error::" @@ -144,7 +152,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:102 +#: ../../tutorial/introduction.rst:109 msgid "" "There is full support for floating point; operators with mixed type operands " "convert the integer operand to floating point::" @@ -154,7 +162,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:108 +#: ../../tutorial/introduction.rst:115 msgid "" "In interactive mode, the last printed expression is assigned to the variable " "``_``. This means that when you are using Python as a desk calculator, it " @@ -165,7 +173,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:121 +#: ../../tutorial/introduction.rst:128 msgid "" "This variable should be treated as read-only by the user. Don't explicitly " "assign a value to it --- you would create an independent local variable with " @@ -174,7 +182,7 @@ msgstr "" "這個變數應該被使用者視為只能讀取。不應該明確地為它賦值 --- 你可以創一個獨立但" "名稱相同的本地變數來覆蓋掉預設變數和它的神奇行為。" -#: ../../tutorial/introduction.rst:125 +#: ../../tutorial/introduction.rst:132 msgid "" "In addition to :class:`int` and :class:`float`, Python supports other types " "of numbers, such as :class:`~decimal.Decimal` and :class:`~fractions." @@ -187,11 +195,11 @@ msgstr "" "\\ :ref:`複數 (complex numbers) `,並使用 ``j`` 和 ``J`` 後綴來" "指定虛數的部份(即 ``3+5j``)。" -#: ../../tutorial/introduction.rst:135 +#: ../../tutorial/introduction.rst:142 msgid "Strings" msgstr "字串 (String)" -#: ../../tutorial/introduction.rst:137 +#: ../../tutorial/introduction.rst:144 msgid "" "Besides numbers, Python can also manipulate strings, which can be expressed " "in several ways. They can be enclosed in single quotes (``'...'``) or " @@ -204,7 +212,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:155 +#: ../../tutorial/introduction.rst:162 msgid "" "In the interactive interpreter, the output string is enclosed in quotes and " "special characters are escaped with backslashes. While this might sometimes " @@ -223,7 +231,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:175 +#: ../../tutorial/introduction.rst:182 msgid "" "If you don't want characters prefaced by ``\\`` to be interpreted as special " "characters, you can use *raw strings* by adding an ``r`` before the first " @@ -234,7 +242,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:185 +#: ../../tutorial/introduction.rst:192 msgid "" "String literals can span multiple lines. One way is using triple-quotes: ``" "\"\"\"...\"\"\"`` or ``'''...'''``. End of lines are automatically included " @@ -247,13 +255,13 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:196 +#: ../../tutorial/introduction.rst:203 msgid "" "produces the following output (note that the initial newline is not " "included):" msgstr "會產生以下的輸出(注意第一個換行並沒有被包含進字串值中):" -#: ../../tutorial/introduction.rst:204 +#: ../../tutorial/introduction.rst:211 msgid "" "Strings can be concatenated (glued together) with the ``+`` operator, and " "repeated with ``*``::" @@ -262,7 +270,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:211 +#: ../../tutorial/introduction.rst:218 msgid "" "Two or more *string literals* (i.e. the ones enclosed between quotes) next " "to each other are automatically concatenated. ::" @@ -272,7 +280,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:217 +#: ../../tutorial/introduction.rst:224 msgid "" "This feature is particularly useful when you want to break long strings::" msgstr "" @@ -280,7 +288,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:224 +#: ../../tutorial/introduction.rst:231 msgid "" "This only works with two literals though, not with variables or expressions::" msgstr "" @@ -288,7 +296,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:238 +#: ../../tutorial/introduction.rst:245 msgid "" "If you want to concatenate variables or a variable and a literal, use ``+``::" msgstr "" @@ -296,7 +304,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:243 +#: ../../tutorial/introduction.rst:250 msgid "" "Strings can be *indexed* (subscripted), with the first character having " "index 0. There is no separate character type; a character is simply a string " @@ -307,7 +315,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:253 +#: ../../tutorial/introduction.rst:260 msgid "" "Indices may also be negative numbers, to start counting from the right::" msgstr "" @@ -315,11 +323,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:262 +#: ../../tutorial/introduction.rst:269 msgid "Note that since -0 is the same as 0, negative indices start from -1." msgstr "注意到因為 -0 等同於 0,負的索引值由 -1 開始。" -#: ../../tutorial/introduction.rst:264 +#: ../../tutorial/introduction.rst:271 msgid "" "In addition to indexing, *slicing* is also supported. While indexing is " "used to obtain individual characters, *slicing* allows you to obtain " @@ -330,7 +338,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:272 +#: ../../tutorial/introduction.rst:279 msgid "" "Slice indices have useful defaults; an omitted first index defaults to zero, " "an omitted second index defaults to the size of the string being sliced. ::" @@ -340,7 +348,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:282 +#: ../../tutorial/introduction.rst:289 msgid "" "Note how the start is always included, and the end always excluded. This " "makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::" @@ -350,7 +358,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:290 +#: ../../tutorial/introduction.rst:297 msgid "" "One way to remember how slices work is to think of the indices as pointing " "*between* characters, with the left edge of the first character numbered 0. " @@ -363,7 +371,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:301 +#: ../../tutorial/introduction.rst:308 msgid "" "The first row of numbers gives the position of the indices 0...6 in the " "string; the second row gives the corresponding negative indices. The slice " @@ -373,7 +381,7 @@ msgstr "" "第一行數字給定字串索引值為 0...6 的位置;第二行則標示了負索引值的位置。由 " "*i* 至 *j* 的 slice 包含了標示 *i* 和 *j* 邊緣間的所有字元。" -#: ../../tutorial/introduction.rst:306 +#: ../../tutorial/introduction.rst:313 msgid "" "For non-negative indices, the length of a slice is the difference of the " "indices, if both are within bounds. For example, the length of " @@ -382,14 +390,14 @@ msgstr "" "對非負數的索引值而言,一個 slice 的長度等於其索引值之差,如果索引值落在字串邊" "界內。例如,``word[1:3]`` 的長度是 2。" -#: ../../tutorial/introduction.rst:310 +#: ../../tutorial/introduction.rst:317 msgid "Attempting to use an index that is too large will result in an error::" msgstr "" "嘗試使用一個過大的索引值會造成錯誤:\n" "\n" "::" -#: ../../tutorial/introduction.rst:317 +#: ../../tutorial/introduction.rst:324 msgid "" "However, out of range slice indexes are handled gracefully when used for " "slicing::" @@ -398,7 +406,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:325 +#: ../../tutorial/introduction.rst:332 msgid "" "Python strings cannot be changed --- they are :term:`immutable`. Therefore, " "assigning to an indexed position in the string results in an error::" @@ -408,61 +416,61 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:337 +#: ../../tutorial/introduction.rst:344 msgid "If you need a different string, you should create a new one::" msgstr "" "如果你需要一個不一樣的字串,你必須建立一個新的:\n" "\n" "::" -#: ../../tutorial/introduction.rst:344 +#: ../../tutorial/introduction.rst:351 msgid "The built-in function :func:`len` returns the length of a string::" msgstr "" "內建的函式 :func:`len` 回傳一個字串的長度:\n" "\n" "::" -#: ../../tutorial/introduction.rst:355 +#: ../../tutorial/introduction.rst:362 msgid ":ref:`textseq`" msgstr ":ref:`textseq`" -#: ../../tutorial/introduction.rst:354 +#: ../../tutorial/introduction.rst:361 msgid "" "Strings are examples of *sequence types*, and support the common operations " "supported by such types." msgstr "字串是 *sequence 型別*\\ 的範例之一,並支援該型別常用的操作。" -#: ../../tutorial/introduction.rst:359 +#: ../../tutorial/introduction.rst:366 msgid ":ref:`string-methods`" msgstr ":ref:`string-methods`" -#: ../../tutorial/introduction.rst:358 +#: ../../tutorial/introduction.rst:365 msgid "" "Strings support a large number of methods for basic transformations and " "searching." msgstr "字串支援非常多種基本轉換和搜尋的 method(方法)。" -#: ../../tutorial/introduction.rst:362 +#: ../../tutorial/introduction.rst:369 msgid ":ref:`f-strings`" msgstr ":ref:`f-strings`" -#: ../../tutorial/introduction.rst:362 +#: ../../tutorial/introduction.rst:369 msgid "String literals that have embedded expressions." msgstr "包含有運算式的字串文本。" -#: ../../tutorial/introduction.rst:365 +#: ../../tutorial/introduction.rst:372 msgid ":ref:`formatstrings`" msgstr ":ref:`formatstrings`" -#: ../../tutorial/introduction.rst:365 +#: ../../tutorial/introduction.rst:372 msgid "Information about string formatting with :meth:`str.format`." msgstr "關於透過 :meth:`str.format` 字串格式化 (string formatting) 的資訊。" -#: ../../tutorial/introduction.rst:368 +#: ../../tutorial/introduction.rst:375 msgid ":ref:`old-string-formatting`" msgstr ":ref:`old-string-formatting`" -#: ../../tutorial/introduction.rst:368 +#: ../../tutorial/introduction.rst:375 msgid "" "The old formatting operations invoked when strings are the left operand of " "the ``%`` operator are described in more detail here." @@ -470,11 +478,11 @@ msgstr "" "在字串為 ``%`` 運算子的左運算元時,將觸發舊的字串格式化操作,更多的細節在本連" "結中介紹。" -#: ../../tutorial/introduction.rst:375 +#: ../../tutorial/introduction.rst:382 msgid "Lists" msgstr "List(串列)" -#: ../../tutorial/introduction.rst:377 +#: ../../tutorial/introduction.rst:384 msgid "" "Python knows a number of *compound* data types, used to group together other " "values. The most versatile is the *list*, which can be written as a list of " @@ -487,7 +495,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:386 +#: ../../tutorial/introduction.rst:393 msgid "" "Like strings (and all other built-in :term:`sequence` types), lists can be " "indexed and sliced::" @@ -497,7 +505,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:396 +#: ../../tutorial/introduction.rst:403 msgid "" "All slice operations return a new list containing the requested elements. " "This means that the following slice returns a :ref:`shallow copy " @@ -508,14 +516,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:403 +#: ../../tutorial/introduction.rst:410 msgid "Lists also support operations like concatenation::" msgstr "" "List 對支援如接合 (concatenation) 等操作:\n" "\n" "::" -#: ../../tutorial/introduction.rst:408 +#: ../../tutorial/introduction.rst:415 msgid "" "Unlike strings, which are :term:`immutable`, lists are a :term:`mutable` " "type, i.e. it is possible to change their content::" @@ -525,7 +533,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:418 +#: ../../tutorial/introduction.rst:425 msgid "" "You can also add new items at the end of the list, by using the :meth:`~list." "append` *method* (we will see more about methods later)::" @@ -535,7 +543,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:426 +#: ../../tutorial/introduction.rst:433 msgid "" "Assignment to slices is also possible, and this can even change the size of " "the list or clear it entirely::" @@ -544,14 +552,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:445 +#: ../../tutorial/introduction.rst:452 msgid "The built-in function :func:`len` also applies to lists::" msgstr "" "內建的函式 :func:`len` 亦可以作用在 list 上:\n" "\n" "::" -#: ../../tutorial/introduction.rst:451 +#: ../../tutorial/introduction.rst:458 msgid "" "It is possible to nest lists (create lists containing other lists), for " "example::" @@ -560,11 +568,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:467 +#: ../../tutorial/introduction.rst:474 msgid "First Steps Towards Programming" msgstr "初探程式設計的前幾步" -#: ../../tutorial/introduction.rst:469 +#: ../../tutorial/introduction.rst:476 msgid "" "Of course, we can use Python for more complicated tasks than adding two and " "two together. For instance, we can write an initial sub-sequence of the " @@ -577,11 +585,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:489 +#: ../../tutorial/introduction.rst:496 msgid "This example introduces several new features." msgstr "這例子引入了許多新的特性。" -#: ../../tutorial/introduction.rst:491 +#: ../../tutorial/introduction.rst:498 msgid "" "The first line contains a *multiple assignment*: the variables ``a`` and " "``b`` simultaneously get the new values 0 and 1. On the last line this is " @@ -593,7 +601,7 @@ msgstr "" "同樣的賦值再被使用了一次,示範了等號的右項運算 (expression) 會先被計算 " "(evaluate),賦值再發生。右項的運算式由左至右依序被計算。" -#: ../../tutorial/introduction.rst:497 +#: ../../tutorial/introduction.rst:504 msgid "" "The :keyword:`while` loop executes as long as the condition (here: ``a < " "10``) remains true. In Python, like in C, any non-zero integer value is " @@ -612,7 +620,7 @@ msgstr "" "``==``\\ (等於)、\\ ``<=``\\ (小於等於)、\\ ``>=``\\ (大於等於)以及 ``!" "=``\\ (不等於)。" -#: ../../tutorial/introduction.rst:506 +#: ../../tutorial/introduction.rst:513 msgid "" "The *body* of the loop is *indented*: indentation is Python's way of " "grouping statements. At the interactive prompt, you have to type a tab or " @@ -630,7 +638,7 @@ msgstr "" "析器無法判斷你何時輸入複合陳述的最後一行)。注意在一個縮排段落內的縮排方式與" "數量必須維持一致。" -#: ../../tutorial/introduction.rst:515 +#: ../../tutorial/introduction.rst:522 msgid "" "The :func:`print` function writes the value of the argument(s) it is given. " "It differs from just writing the expression you want to write (as we did " @@ -646,7 +654,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:526 +#: ../../tutorial/introduction.rst:533 msgid "" "The keyword argument *end* can be used to avoid the newline after the " "output, or end the output with a different string::" @@ -656,11 +664,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:538 +#: ../../tutorial/introduction.rst:545 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/introduction.rst:539 +#: ../../tutorial/introduction.rst:546 msgid "" "Since ``**`` has higher precedence than ``-``, ``-3**2`` will be interpreted " "as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you " @@ -670,7 +678,7 @@ msgstr "" "得到 ``-9``\\ 。如果要避免這樣的優先順序以得到 ``9``,你可以使用 ``(-3)**2``" "\\ 。" -#: ../../tutorial/introduction.rst:543 +#: ../../tutorial/introduction.rst:550 msgid "" "Unlike other languages, special characters such as ``\\n`` have the same " "meaning with both single (``'...'``) and double (``\"...\"``) quotes. The " From 29cb70799c6b7aacb1b98d43d4add0ee09055245 Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Tue, 26 Oct 2021 21:45:51 +0800 Subject: [PATCH 37/39] Apply suggestions from code review Apply a part of suggestions. Working on the rest part. Co-authored-by: Wei-Hsiang (Matt) Wang --- glossary.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/glossary.po b/glossary.po index ae39b45ae2..fce8caea5d 100644 --- a/glossary.po +++ b/glossary.po @@ -158,7 +158,7 @@ msgid "" "following calls to :func:`complex`::" msgstr "" ":dfn:`關鍵字引數 (keyword argument)`\\ :在函式呼叫中,以識別字(identifier," -"例如 ``name=``\\ )開頭的引數, 或是以 ``**`` 後面 dictionary(字典)內的值被" +"例如 ``name=``\\ )開頭的引數,或是以 ``**`` 後面 dictionary(字典)內的值被" "傳遞的引數。例如,``3`` 和 ``5`` 都是以下 :func:`complex` 呼叫中的關鍵字引" "數:\n" "\n" @@ -668,7 +668,7 @@ msgstr "" "任何定義了 :meth:`__get__`\\ 、\\ :meth:`__set__` 或 :meth:`__delete__` " "method(方法)的物件。當一個 class(類別)屬性是一個描述器時,它的特殊連結行" "為會在屬性查找時被觸發。通常,使用 *a.b* 來取得、設定或刪除某個屬性時,會在 " -"*a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器, 則相對應" +"*a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器,則相對應" "的描述器 method 會被呼叫。對描述器的理解是深入理解 Python 的關鍵,因為它們是" "許多功能的基礎,這些功能包括函式、method、屬性 (property)、class method、靜" "態 method,以及對 super class(父類別)的參照。" @@ -1506,8 +1506,8 @@ msgid "" "thread removes *key* from *mapping* after the test, but before the lookup. " "This issue can be solved with locks or by using the EAFP approach." msgstr "" -"在一個多執行緒環境中,LBYL 方式會因為在「三思」和「後行」之間引入了競爭條件 " -"(race condition),而存在風險。例如以下程式碼 ``if key in mapping: return " +"在一個多執行緒環境中,LBYL 方式有在「三思」和「後行」之間引入了競爭條件 " +"(race condition) 的風險。例如以下程式碼 ``if key in mapping: return " "mapping[key]``,如果另一個執行緒在測試之後但在查找之前,從 *mapping* 中移除" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" @@ -1538,8 +1538,8 @@ msgid "" "numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is " "optional. If omitted, all elements in ``range(256)`` are processed." msgstr "" -"一種緊密的方法,用來處理一個序列中的全部或部分元素,並將處理結果以一個 list " -"回傳。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會" +"一種用來處理一個序列中的全部或部分元素,並將處理結果以一個 list 回傳的簡要" +"方法。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會" "產生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 " "(0x..)。\\ :keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所" "有元素都會被處理。" From be98cd159d6e49b4655bad1d7ddb07d22e8749fb Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Wed, 27 Oct 2021 00:06:10 +0800 Subject: [PATCH 38/39] Apply suggestions from code review Apply all suggestions. --- glossary.po | 204 ++++++++++++++++++++++++++-------------------------- 1 file changed, 101 insertions(+), 103 deletions(-) diff --git a/glossary.po b/glossary.po index fce8caea5d..5228e8a0a7 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2021-08-18 14:00+0800\n" +"PO-Revision-Date: 2021-10-27 00:04+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -101,12 +101,12 @@ msgstr "" "抽象基底類別(又稱為 ABC)提供了一種定義介面的方法,作為 :term:`duck-typing`" "\\ (鴨子型別)的補充。其他類似的技術,像是 :func:`hasattr`\\ ,則顯得笨拙或" "是帶有細微的錯誤(例如使用\\ :ref:`魔術方法 (magic method) `" -"\\ )。ABC 採用虛擬的 subclass(子類別),它們並不繼承自另一個 class,但仍可" -"被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參閱 :mod:`abc` 模組的說" -"明文件。Python 有許多內建的 ABC,用於資料結構(在 :mod:`collections.abc` 模" -"組)、數字(在 :mod:`numbers` 模組)、串流(在 :mod:`io` 模組)及 import 尋檢" -"器和載入器(在 :mod:`importlib.abc` 模組)。你可以使用 :mod:`abc` 模組建立自" -"己的 ABC。" +"\\ )。ABC 採用虛擬的 subclass(子類別),它們並不繼承自另一個 class(類" +"別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參閱 :mod:" +"`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構(在 :mod:" +"`collections.abc` 模組)、數字(在 :mod:`numbers` 模組)、串流(在 :mod:`io` " +"模組)及 import 尋檢器和載入器(在 :mod:`importlib.abc` 模組)。你可以使用 :" +"mod:`abc` 模組建立自己的 ABC。" #: ../../glossary.rst:46 msgid "annotation" @@ -117,8 +117,8 @@ msgid "" "A label associated with a variable, a class attribute or a function " "parameter or return value, used by convention as a :term:`type hint`." msgstr "" -"一個與變數、class(類別)屬性、函式的參數或回傳值相關聯的標籤。照慣例,它被用" -"來作為 :term:`type hint`\\ (型別提示)。" +"一個與變數、class 屬性、函式的參數或回傳值相關聯的標籤。照慣例,它被用來作" +"為 :term:`type hint`\\ (型別提示)。" #: ../../glossary.rst:52 msgid "" @@ -208,8 +208,8 @@ msgid "" "Introduced by :pep:`492`." msgstr "" "一個可以控制 :keyword:`async with` 陳述式中所見環境的物件,而它是透過定義 :" -"meth:`__aenter__` 和 :meth:`__aexit__` method(方法)來控制的。於 :pep:`492` " -"中介紹。" +"meth:`__aenter__` 和 :meth:`__aexit__` method(方法)來控制的。由 :pep:`492` " +"引入。" #: ../../glossary.rst:95 msgid "asynchronous generator" @@ -262,8 +262,8 @@ msgid "" "expression." msgstr "" "這是一個 :term:`asynchronous iterator`\\ (非同步疊代器),當它以 :meth:" -"`__anext__` method(方法)被呼叫時,會回傳一個可等待物件 (awaitable object)," -"該物件將執行非同步產生器的函式主體,直到遇到下一個 :keyword:`yield` 運算式。" +"`__anext__` method 被呼叫時,會回傳一個可等待物件 (awaitable object),該物件" +"將執行非同步產生器的函式主體,直到遇到下一個 :keyword:`yield` 運算式。" #: ../../glossary.rst:118 msgid "" @@ -289,8 +289,8 @@ msgid "" "Introduced by :pep:`492`." msgstr "" "一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它的 :meth:" -"`__aiter__` method(方法)回傳一個 :term:`asynchronous iterator`\\ (非同步疊" -"代器)。於 :pep:`492` 中介紹。" +"`__aiter__` method 回傳一個 :term:`asynchronous iterator`\\ (非同步疊代" +"器)。由 :pep:`492` 引入。" #: ../../glossary.rst:128 msgid "asynchronous iterator" @@ -304,10 +304,10 @@ msgid "" "meth:`__anext__` method until it raises a :exc:`StopAsyncIteration` " "exception. Introduced by :pep:`492`." msgstr "" -"一個實作 :meth:`__aiter__` 和 :meth:`__anext__` method(方法)的物件。\\ " +"一個實作 :meth:`__aiter__` 和 :meth:`__anext__` method 的物件。\\ " "``__anext__`` 必須回傳一個 :term:`awaitable`\\ (可等待物件)。\\ :keyword:" "`async for` 會解析非同步疊代器的 :meth:`__anext__` method 所回傳的可等待物" -"件,直到它引發 :exc:`StopAsyncIteration` 例外。於 :pep:`492` 中介紹。" +"件,直到它引發 :exc:`StopAsyncIteration` 例外。由 :pep:`492` 引入。" #: ../../glossary.rst:135 msgid "attribute" @@ -333,8 +333,8 @@ msgid "" "pep:`492`." msgstr "" "一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一個 :term:" -"`coroutine`\\ (協程),或是一個有 :meth:`__await__` method(方法)的物件。另" -"請參閱 :pep:`492`。" +"`coroutine`\\ (協程),或是一個有 :meth:`__await__` method 的物件。另請參" +"閱 :pep:`492`。" #: ../../glossary.rst:145 msgid "BDFL" @@ -390,8 +390,8 @@ msgstr "" "一個支援\\ :ref:`bufferobjects`\\ 且能夠匯出 C-:term:`contiguous` 緩衝區的物" "件。這包括所有的 :class:`bytes`、\\ :class:`bytearray` 和 :class:`array." "array` 物件,以及許多常見的 :class:`memoryview` 物件。類位元組串物件可用於處" -"理二進制資料的各種運算;這些運算包括壓縮、儲存至二進制檔案和透過插座 " -"(socket) 發送。" +"理二進制資料的各種運算;這些運算包括壓縮、儲存至二進制檔案和透過 socket(插" +"座)發送。" #: ../../glossary.rst:169 msgid "" @@ -458,8 +458,8 @@ msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." msgstr "" -"一個用於建立使用者定義物件的模板。Class 的定義通常會包含 method(方法)的定" -"義,這些 method 可以在 class 的實例上進行操作。" +"一個用於建立使用者定義物件的模板。Class 的定義通常會包含 method 的定義,這些 " +"method 可以在 class 的實例上進行操作。" #: ../../glossary.rst:196 msgid "class variable" @@ -529,8 +529,7 @@ msgid "" "by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." msgstr "" "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" -"`__enter__` 和 :meth:`__exit__` method(方法)來控制的。請參閱 :pep:`343`" -"\\ 。" +"`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`\\ 。" #: ../../glossary.rst:227 msgid "context variable" @@ -600,7 +599,7 @@ msgid "" msgstr "" "一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能以 :keyword:" "`async def` 陳述式被定義,並可能會包含 :keyword:`await`\\ 、\\ :keyword:" -"`async for` 和 :keyword:`async with` 關鍵字。這些關鍵字於 :pep:`492` 中介紹。" +"`async for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" #: ../../glossary.rst:262 msgid "CPython" @@ -646,8 +645,8 @@ msgid "" "the documentation for :ref:`function definitions ` and :ref:`class " "definitions ` for more about decorators." msgstr "" -"Class(類別)也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參" -"閱\\ :ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" +"Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" +"ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" #: ../../glossary.rst:288 msgid "descriptor" @@ -666,12 +665,12 @@ msgid "" "reference to super classes." msgstr "" "任何定義了 :meth:`__get__`\\ 、\\ :meth:`__set__` 或 :meth:`__delete__` " -"method(方法)的物件。當一個 class(類別)屬性是一個描述器時,它的特殊連結行" -"為會在屬性查找時被觸發。通常,使用 *a.b* 來取得、設定或刪除某個屬性時,會在 " -"*a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器,則相對應" -"的描述器 method 會被呼叫。對描述器的理解是深入理解 Python 的關鍵,因為它們是" -"許多功能的基礎,這些功能包括函式、method、屬性 (property)、class method、靜" -"態 method,以及對 super class(父類別)的參照。" +"method 的物件。當一個 class 屬性是一個描述器時,它的特殊連結行為會在屬性查找" +"時被觸發。通常,使用 *a.b* 來取得、設定或刪除某個屬性時,會在 *a* 的 class 字" +"典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器,則相對應的描述器 method " +"會被呼叫。對描述器的理解是深入理解 Python 的關鍵,因為它們是許多功能的基礎," +"這些功能包括函式、method、屬性 (property)、class method、靜態 method,以及對 " +"super class(父類別)的參照。" #: ../../glossary.rst:300 msgid "" @@ -692,8 +691,8 @@ msgid "" "hash in Perl." msgstr "" "一個關聯陣列 (associative array),其中任意的鍵會被映射到值。鍵可以是任何帶" -"有 :meth:`__hash__` 和 :meth:`__eq__` method(方法)的物件。在 Perl 中被稱為" -"雜湊 (hash)。" +"有 :meth:`__hash__` 和 :meth:`__eq__` method 的物件。在 Perl 中被稱為雜湊 " +"(hash)。" #: ../../glossary.rst:304 msgid "dictionary comprehension" @@ -739,10 +738,10 @@ msgid "" "class, function or module. Since it is available via introspection, it is " "the canonical place for documentation of the object." msgstr "" -"一個在 class(類別)、函式或模組中,作為第一個運算式出現的字串文本。雖然它在" -"套件執行時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組的 :" -"attr:`__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此" -"它是物件的說明文件存放的標準位置。" +"一個在 class、函式或模組中,作為第一個運算式出現的字串文本。雖然它在套件執行" +"時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組的 :attr:" +"`__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此它是物" +"件的說明文件存放的標準位置。" #: ../../glossary.rst:322 msgid "duck-typing" @@ -761,13 +760,13 @@ msgid "" "employs :func:`hasattr` tests or :term:`EAFP` programming." msgstr "" "一種程式設計風格,它不是藉由檢查一個物件的型別來確定它是否具有正確的介面;取" -"而代之的是,method(方法)或屬性會單純地被呼叫或使用。(「如果它看起來像一隻" -"鴨子而且叫起來像一隻鴨子,那麼它一定是一隻鴨子。」)因為強調介面而非特定型" -"別,精心設計的程式碼能讓多形替代 (polymorphic substitution) 來增進它的靈活" -"性。鴨子型別要避免使用 :func:`type` 或 :func:`isinstance` 進行測試。(但是請" -"注意,鴨子型別可以用\\ :term:`抽象基底類別 (abstract base class) ` 來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:" -"`EAFP` 程式設計風格。" +"而代之的是,method 或屬性會單純地被呼叫或使用。(「如果它看起來像一隻鴨子而且" +"叫起來像一隻鴨子,那麼它一定是一隻鴨子。」)因為強調介面而非特定型別,精心設" +"計的程式碼能讓多形替代 (polymorphic substitution) 來增進它的靈活性。鴨子型別" +"要避免使用 :func:`type` 或 :func:`isinstance` 進行測試。(但是請注意,鴨子型" +"別可以用\\ :term:`抽象基底類別 (abstract base class) ` " +"來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" +"風格。" #: ../../glossary.rst:333 msgid "EAFP" @@ -846,11 +845,11 @@ msgid "" "output, in-memory buffers, sockets, pipes, etc.). File objects are also " "called :dfn:`file-like objects` or :dfn:`streams`." msgstr "" -"一個能夠將檔案導向 (file-oriented) API(以 :meth:`read()` 或 :meth:`write()` " -"等 method)展現給底層資源的物件。根據檔案物件被建立的方式,它能夠協調對真實磁" -"碟檔案或是其他類型的儲存器或通訊裝置(例如標準輸入/輸出、記憶體內緩衝區、插" -"座 (socket)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔案物件 " -"(file-like object)` 或\\ :dfn:`串流 (stream)`\\ 。" +"一個讓使用者透過檔案導向 (file-oriented) API(如 :meth:`read()` 或 :meth:" +"`write()` 等 method)來操作底層資源的物件。根據檔案物件被建立的方式,它能夠協" +"調對真實磁碟檔案或是其他類型的儲存器或通訊裝置(例如標準輸入/輸出、記憶體內" +"緩衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔" +"案物件 (file-like object)` 或\\ :dfn:`串流 (stream)`\\ 。" #: ../../glossary.rst:369 msgid "" @@ -1202,10 +1201,10 @@ msgid "" "value is derived from their :func:`id`." msgstr "" "大多數的 Python 不可變內建物件都是可雜湊的;可變的容器(例如 list 或 " -"dictionary)並不是;而不可變的容器(例如 tuple(值組)和 frozenset),只有當" -"它們的元素是可雜湊的,它們本身才是可雜湊的。若物件是使用者自定 class(類別)" -"的實例,則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們" -"與自己比較),而它們的雜湊值則是衍生自它們的 :func:`id`\\ 。" +"dictionary)並不是;而不可變的容器(例如 tuple(元組)和 frozenset),只有當" +"它們的元素是可雜湊的,它們本身才是可雜湊的。若物件是使用者自定 class 的實例," +"則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" +"較),而它們的雜湊值則是衍生自它們的 :func:`id`\\ 。" #: ../../glossary.rst:522 msgid "IDLE" @@ -1232,7 +1231,7 @@ msgid "" "in places where a constant hash value is needed, for example as a key in a " "dictionary." msgstr "" -"一個具有固定值的物件。不可變物件包括數字、字串和 tuple(值組)。這類物件是不" +"一個具有固定值的物件。不可變物件包括數字、字串和 tuple(元組)。這類物件是不" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" @@ -1356,9 +1355,9 @@ msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" "是 :class:`list`\\ 、\\ :class:`str` 和 :class:`tuple`\\ )和某些非序列型別," "像是 :class:`dict`\\ 、\\ :term:`檔案物件 `\\ ,以及你所定義的任" -"何 class(類別)物件,只要那些 class 有 :meth:`__iter__` method(方法)或是實" -"作 :term:`Sequence `\\ (序列)語意的 :meth:`__getitem__` method," -"該物件就是可疊代物件。" +"何 class 物件,只要那些 class 有 :meth:`__iter__` method 或是實作 :term:" +"`Sequence `\\ (序列)語意的 :meth:`__getitem__` method,該物件就是" +"可疊代物件。" #: ../../glossary.rst:588 msgid "" @@ -1454,12 +1453,12 @@ msgid "" "methodcaller`. See the :ref:`Sorting HOW TO ` for examples of " "how to create and use key functions." msgstr "" -"有幾種方法可以建立一個鍵函式。例如,\\ :meth:`str.lower` method(方法)可以作" -"為不分大小寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被" -"建造,例如 ``lambda r: (r[0], r[2])``。另外,\\ :mod:`operator` 模組提供了三" -"個鍵函式的建構函式 (constructor):\\ :func:`~operator.attrgetter`\\ 、\\ :" -"func:`~operator.itemgetter` 和 :func:`~operator.methodcaller`\\ 。關於如何建" -"立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 `\\ 。" +"有幾種方法可以建立一個鍵函式。例如,\\ :meth:`str.lower` method 可以作為不分" +"大小寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造," +"例如 ``lambda r: (r[0], r[2])``。另外,\\ :mod:`operator` 模組提供了三個鍵函" +"式的建構函式 (constructor):\\ :func:`~operator.attrgetter`\\ 、\\ :func:" +"`~operator.itemgetter` 和 :func:`~operator.methodcaller`\\ 。關於如何建立和使" +"用鍵函式的範例,請參閱\\ :ref:`如何排序 `\\ 。" #: ../../glossary.rst:637 msgid "keyword argument" @@ -1538,11 +1537,11 @@ msgid "" "numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is " "optional. If omitted, all elements in ``range(256)`` are processed." msgstr "" -"一種用來處理一個序列中的全部或部分元素,並將處理結果以一個 list 回傳的簡要" -"方法。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會" -"產生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 " -"(0x..)。\\ :keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所" -"有元素都會被處理。" +"一種用來處理一個序列中的全部或部分元素,並將處理結果以一個 list 回傳的簡要方" +"法。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會產" +"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 (0x..)。\\ :" +"keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" +"處理。" #: ../../glossary.rst:670 msgid "loader" @@ -1584,9 +1583,8 @@ msgstr "" "一個容器物件,它支援任意鍵的查找,且能實作 :ref:`abstract base classes(抽象" "基底類別) `\\ 中,\\ :class:" "`~collections.abc.Mapping` 或 :class:`~collections.abc.MutableMapping` 所指定" -"的 method(方法)。範例包括 :class:`dict`\\ 、\\ :class:`collections." -"defaultdict`\\ 、\\ :class:`collections.OrderedDict` 和 :class:`collections." -"Counter`\\ 。" +"的 method。範例包括 :class:`dict`\\ 、\\ :class:`collections.defaultdict`" +"\\ 、\\ :class:`collections.OrderedDict` 和 :class:`collections.Counter`\\ 。" #: ../../glossary.rst:689 msgid "meta path finder" @@ -1607,8 +1605,8 @@ msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" -"關於元路徑尋檢器實作的 method(方法),請參閱 :class:`importlib.abc." -"MetaPathFinder`\\ 。" +"關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`" +"\\ 。" #: ../../glossary.rst:697 msgid "metaclass" @@ -1626,7 +1624,7 @@ msgid "" "access, adding thread-safety, tracking object creation, implementing " "singletons, and many other tasks." msgstr "" -"一種 class(類別)的 class。Class 定義過程會建立一個 class 名稱、一個 class " +"一種 class 的 class。Class 定義過程會建立一個 class 名稱、一個 class " "dictionary(字典),以及一個 base class(基底類別)的列表。Metaclass 負責接受" "這三個引數,並建立該 class。大多數的物件導向程式語言會提供一個預設的實作。" "Python 的特別之處在於它能夠建立自訂的 metaclass。大部分的使用者從未需要此工" @@ -1649,10 +1647,10 @@ msgid "" "first :term:`argument` (which is usually called ``self``). See :term:" "`function` and :term:`nested scope`." msgstr "" -"一個在 class(類別)本體內被定義的函式。如果 method 作為其 class 實例的一個屬" -"性被呼叫,則它將會得到該實例物件成為它的第一個 :term:`argument`\\ (引數)" -"(此引數通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:" -"`nested scope`\\ (巢狀作用域)。" +"一個在 class 本體內被定義的函式。如果 method 作為其 class 實例的一個屬性被呼" +"叫,則它將會得到該實例物件成為它的第一個 :term:`argument`\\ (引數)(此引數" +"通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " +"scope`\\ (巢狀作用域)。" #: ../../glossary.rst:716 msgid "method resolution order" @@ -1721,7 +1719,7 @@ msgstr "" #: ../../glossary.rst:740 msgid "named tuple" -msgstr "named tuple(附名值組)" +msgstr "named tuple(附名元組)" #: ../../glossary.rst:742 msgid "" @@ -1729,9 +1727,9 @@ msgid "" "tuple and whose indexable elements are also accessible using named " "attributes. The type or class may have other features as well." msgstr "" -"術語「named tuple(附名值組)」是指從 tuple 繼承的任何型別或 class(類別)," -"且它的可索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以" -"具有其他的特性。" +"術語「named tuple(附名元組)」是指從 tuple 繼承的任何型別或 class,且它的可" +"索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" +"的特性。" #: ../../glossary.rst:746 msgid "" @@ -1757,8 +1755,8 @@ msgstr "" "規的 class 定義來建立,只要該 class 是繼承自 :class:`tuple`\\ ,且定義了附名" "欄位 (named field) 即可。這類的 class 可以手工編寫,也可以使用工廠函式 " "(factory function) :func:`collections.namedtuple` 來建立。後者技術也增加了一" -"些額外的 method(方法),這些 method 可能是在手寫或內建的 named tuple 中,無" -"法找到的。" +"些額外的 method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到" +"的。" #: ../../glossary.rst:764 msgid "namespace" @@ -1833,9 +1831,9 @@ msgid "" "versatile features like :attr:`~object.__slots__`, descriptors, properties, :" "meth:`__getattribute__`, class methods, and static methods." msgstr "" -"一個舊名,它是指現在所有的 class(類別)物件所使用的 class 風格。在早期的 " -"Python 版本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像是 :attr:" -"`~object.__slots__`\\ 、描述器 (descriptor)、屬性 (property)、\\ :meth:" +"一個舊名,它是指現在所有的 class 物件所使用的 class 風格。在早期的 Python 版" +"本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像是 :attr:`~object." +"__slots__`\\ 、描述器 (descriptor)、屬性 (property)、\\ :meth:" "`__getattribute__`\\ 、class method(類別方法)和 static method(靜態方法)。" #: ../../glossary.rst:799 @@ -1880,9 +1878,9 @@ msgid "" "an :term:`argument` (or in some cases, arguments) that the function can " "accept. There are five kinds of parameter:" msgstr "" -"在 :term:`function`\\ (函式)或 method(方法)定義中的一個命名實體 (named " -"entity),它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況" -"下指示多個引數。共有有五種不同的參數類型:" +"在 :term:`function`\\ (函式)或 method 定義中的一個命名實體 (named entity)," +"它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" +"個引數。共有有五種不同的參數類型:" #: ../../glossary.rst:817 msgid "" @@ -1966,7 +1964,7 @@ msgid "" msgstr "" "另請參閱術語表的 :term:`argument`\\ (引數)條目、常見問題中的\\ :ref:`引數和" "參數之間的差異 `\\ 、\\ :class:`inspect." -"Parameter` class(類別)、\\ :ref:`function`\\ 章節,以及 :pep:`362`\\ 。" +"Parameter` class、\\ :ref:`function`\\ 章節,以及 :pep:`362`\\ 。" #: ../../glossary.rst:864 msgid "path entry" @@ -1999,7 +1997,7 @@ msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" -"關於路徑項目尋檢器實作的 method(方法),請參閱 :class:`importlib.abc." +"關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`\\ 。" #: ../../glossary.rst:876 @@ -2047,8 +2045,8 @@ msgstr "" "class:`bytes` 物件,或是一個實作 :class:`os.PathLike` 協定的物件。透過呼叫 :" "func:`os.fspath` 函式,一個支援 :class:`os.PathLike` 協定的物件可以被轉換為 :" "class:`str` 或 :class:`bytes` 檔案系統路徑;而 :func:`os.fsdecode` 及 :func:" -"`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。於 :" -"pep:`519` 中介紹。" +"`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" +"pep:`519` 引入。" #: ../../glossary.rst:895 msgid "PEP" @@ -2194,9 +2192,9 @@ msgid "" "top-level functions and classes, the qualified name is the same as the " "object's name::" msgstr "" -"一個「點分隔名稱」,它顯示從一個模組的全域作用域到該模組中定義的 class(類" -"別)、函式或 method(方法)的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函" -"式和 class 而言,限定名稱與其物件名稱相同:\n" +"一個「點分隔名稱」,它顯示從一個模組的全域作用域到該模組中定義的 class、函式" +"或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," +"限定名稱與其物件名稱相同:\n" "\n" "::" @@ -2474,8 +2472,8 @@ msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." msgstr "" -"一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class(類別)屬性或" -"一個函式的參數或回傳值的預期型別。" +"一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" +"的參數或回傳值的預期型別。" #: ../../glossary.rst:1104 msgid "" @@ -2517,7 +2515,7 @@ msgstr "variable annotation(變數註釋)" #: ../../glossary.rst:1122 msgid "An :term:`annotation` of a variable or a class attribute." -msgstr "一個變數或 class(類別)屬性的 :term:`annotation`\\ (註釋)。" +msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" #: ../../glossary.rst:1124 msgid "" From 22e66a54e80cc5a4378b20b298436e9491e765a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 26 Oct 2021 16:31:48 +0000 Subject: [PATCH 39/39] sync with cpython 269bf56e --- glossary.po | 544 ++++++++++++++++++++++++++-------------------------- 1 file changed, 272 insertions(+), 272 deletions(-) diff --git a/glossary.po b/glossary.po index 5228e8a0a7..73fb64b92b 100644 --- a/glossary.po +++ b/glossary.po @@ -7,8 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-10-26 16:30+0000\n" "PO-Revision-Date: 2021-10-27 00:04+0800\n" +"Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -16,7 +17,6 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"Last-Translator: Steven Hsu \n" "X-Generator: Poedit 2.4.3\n" #: ../../glossary.rst:5 @@ -438,22 +438,22 @@ msgid "" msgstr "" "位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" -#: ../../glossary.rst:190 +#: ../../glossary.rst:191 msgid "callback" msgstr "callback(回呼)" -#: ../../glossary.rst:191 +#: ../../glossary.rst:193 msgid "" "A subroutine function which is passed as an argument to be executed at some " "point in the future." msgstr "" "作為引數被傳遞的一個副程式 (subroutine) 函式,會在未來的某個時間點被執行。" -#: ../../glossary.rst:192 +#: ../../glossary.rst:195 msgid "class" msgstr "class(類別)" -#: ../../glossary.rst:193 +#: ../../glossary.rst:197 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." @@ -461,11 +461,11 @@ msgstr "" "一個用於建立使用者定義物件的模板。Class 的定義通常會包含 method 的定義,這些 " "method 可以在 class 的實例上進行操作。" -#: ../../glossary.rst:196 +#: ../../glossary.rst:200 msgid "class variable" msgstr "class variable(類別變數)" -#: ../../glossary.rst:198 +#: ../../glossary.rst:202 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." @@ -473,11 +473,11 @@ msgstr "" "一個在 class 中被定義,且應該只能在 class 層次(意即不是在 class 的實例中)被" "修改的變數。" -#: ../../glossary.rst:200 +#: ../../glossary.rst:204 msgid "coercion" msgstr "coercion(強制轉型)" -#: ../../glossary.rst:202 +#: ../../glossary.rst:206 msgid "" "The implicit conversion of an instance of one type to another during an " "operation which involves two arguments of the same type. For example, " @@ -495,11 +495,11 @@ msgstr "" "\\ 。如果沒有強制轉型,即使所有的引數型別皆相容,它們都必須要由程式設計師正規" "化 (normalize) 為相同的值,例如,要用 ``float(3)+4.5`` 而不能只是 ``3+4.5``。" -#: ../../glossary.rst:210 +#: ../../glossary.rst:214 msgid "complex number" msgstr "complex number(複數)" -#: ../../glossary.rst:212 +#: ../../glossary.rst:216 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " @@ -519,11 +519,11 @@ msgstr "" "相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" "忽略它們。" -#: ../../glossary.rst:222 +#: ../../glossary.rst:226 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../glossary.rst:224 +#: ../../glossary.rst:228 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " "by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." @@ -531,11 +531,11 @@ msgstr "" "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" "`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`\\ 。" -#: ../../glossary.rst:227 +#: ../../glossary.rst:231 msgid "context variable" msgstr "context variable(情境變數)" -#: ../../glossary.rst:229 +#: ../../glossary.rst:233 msgid "" "A variable which can have different values depending on its context. This is " "similar to Thread-Local Storage in which each execution thread may have a " @@ -550,11 +550,11 @@ msgstr "" "任務 (concurrent asynchronous task) 中,對於變數狀態的追蹤。請參閱 :mod:" "`contextvars`\\ 。" -#: ../../glossary.rst:236 +#: ../../glossary.rst:240 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../glossary.rst:240 +#: ../../glossary.rst:244 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -571,11 +571,11 @@ msgstr "" "的順序訪問各個項目時,最後一個索引的變化最快。然而,在 Fortran contiguous 陣" "列中,第一個索引的變化最快。" -#: ../../glossary.rst:248 +#: ../../glossary.rst:252 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../glossary.rst:250 +#: ../../glossary.rst:254 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -586,11 +586,11 @@ msgstr "" "在另一個時間點被退出。協程可以在許多不同的時間點被進入、退出和回復。它們能夠" "以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`\\ 。" -#: ../../glossary.rst:255 +#: ../../glossary.rst:259 msgid "coroutine function" msgstr "coroutine function(協程函式)" -#: ../../glossary.rst:257 +#: ../../glossary.rst:261 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain :" @@ -601,11 +601,11 @@ msgstr "" "`async def` 陳述式被定義,並可能會包含 :keyword:`await`\\ 、\\ :keyword:" "`async for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" -#: ../../glossary.rst:262 +#: ../../glossary.rst:266 msgid "CPython" msgstr "CPython" -#: ../../glossary.rst:264 +#: ../../glossary.rst:268 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -616,11 +616,11 @@ msgstr "" "`_ 上。「CPython」這個術語在必要時被使用,以區分此實" "作與其它語言的實作,例如 Jython 或 IronPython。" -#: ../../glossary.rst:268 +#: ../../glossary.rst:272 msgid "decorator" msgstr "decorator(裝飾器)" -#: ../../glossary.rst:270 +#: ../../glossary.rst:274 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " @@ -630,7 +630,7 @@ msgstr "" "式的變換 (function transformation)。裝飾器的常見範例是 :func:`classmethod` " "和 :func:`staticmethod`\\ 。" -#: ../../glossary.rst:274 +#: ../../glossary.rst:278 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" @@ -639,7 +639,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:285 +#: ../../glossary.rst:289 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " @@ -648,11 +648,11 @@ msgstr "" "Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" "ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" -#: ../../glossary.rst:288 +#: ../../glossary.rst:292 msgid "descriptor" msgstr "descriptor(描述器)" -#: ../../glossary.rst:290 +#: ../../glossary.rst:294 msgid "" "Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or :" "meth:`__delete__`. When a class attribute is a descriptor, its special " @@ -672,7 +672,7 @@ msgstr "" "這些功能包括函式、method、屬性 (property)、class method、靜態 method,以及對 " "super class(父類別)的參照。" -#: ../../glossary.rst:300 +#: ../../glossary.rst:304 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." @@ -680,11 +680,11 @@ msgstr "" "關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" "使用指南 `\\ 。" -#: ../../glossary.rst:301 +#: ../../glossary.rst:306 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../glossary.rst:303 +#: ../../glossary.rst:308 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`__hash__` and :meth:`__eq__` methods. Called a " @@ -694,11 +694,11 @@ msgstr "" "有 :meth:`__hash__` 和 :meth:`__eq__` method 的物件。在 Perl 中被稱為雜湊 " "(hash)。" -#: ../../glossary.rst:304 +#: ../../glossary.rst:311 msgid "dictionary comprehension" msgstr "dictionary comprehension(字典綜合運算)" -#: ../../glossary.rst:305 +#: ../../glossary.rst:313 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " @@ -709,11 +709,11 @@ msgstr "" "字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" "了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`\\ 。" -#: ../../glossary.rst:306 +#: ../../glossary.rst:317 msgid "dictionary view" msgstr "dictionary view(字典檢視)" -#: ../../glossary.rst:308 +#: ../../glossary.rst:319 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -726,11 +726,11 @@ msgstr "" "檢視會反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " "``list(dictview)``。請參閱\\ :ref:`dict-views`\\ 。" -#: ../../glossary.rst:314 +#: ../../glossary.rst:325 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../glossary.rst:316 +#: ../../glossary.rst:327 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " @@ -743,11 +743,11 @@ msgstr "" "`__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此它是物" "件的說明文件存放的標準位置。" -#: ../../glossary.rst:322 +#: ../../glossary.rst:333 msgid "duck-typing" msgstr "duck-typing(鴨子型別)" -#: ../../glossary.rst:324 +#: ../../glossary.rst:335 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " @@ -768,11 +768,11 @@ msgstr "" "來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" "風格。" -#: ../../glossary.rst:333 +#: ../../glossary.rst:344 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:335 +#: ../../glossary.rst:346 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -787,11 +787,11 @@ msgstr "" "keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" "格形成了對比。" -#: ../../glossary.rst:341 +#: ../../glossary.rst:352 msgid "expression" msgstr "expression(運算式)" -#: ../../glossary.rst:343 +#: ../../glossary.rst:354 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -807,11 +807,11 @@ msgstr "" "(陳述式)不能被用作運算式,例如 :keyword:`while`\\ 。賦值 (assignment) 也是" "陳述式,而不是運算式。" -#: ../../glossary.rst:350 +#: ../../glossary.rst:361 msgid "extension module" msgstr "extension module(擴充模組)" -#: ../../glossary.rst:352 +#: ../../glossary.rst:363 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -819,11 +819,11 @@ msgstr "" "一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" "互動。" -#: ../../glossary.rst:354 +#: ../../glossary.rst:365 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../glossary.rst:356 +#: ../../glossary.rst:367 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " @@ -832,11 +832,11 @@ msgstr "" "以 ``'f'`` 或 ``'F'`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" "化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`\\ 。" -#: ../../glossary.rst:359 +#: ../../glossary.rst:370 msgid "file object" msgstr "file object(檔案物件)" -#: ../../glossary.rst:361 +#: ../../glossary.rst:372 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`read()` " "or :meth:`write()`) to an underlying resource. Depending on the way it was " @@ -851,7 +851,7 @@ msgstr "" "緩衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔" "案物件 (file-like object)` 或\\ :dfn:`串流 (stream)`\\ 。" -#: ../../glossary.rst:369 +#: ../../glossary.rst:380 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -864,26 +864,26 @@ msgstr "" "它們的介面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:" "`open` 函式。" -#: ../../glossary.rst:374 +#: ../../glossary.rst:385 msgid "file-like object" msgstr "file-like object(類檔案物件)" -#: ../../glossary.rst:376 +#: ../../glossary.rst:387 msgid "A synonym for :term:`file object`." msgstr ":term:`file object`\\ (檔案物件)的同義字。" -#: ../../glossary.rst:377 +#: ../../glossary.rst:388 msgid "finder" msgstr "finder(尋檢器)" -#: ../../glossary.rst:379 +#: ../../glossary.rst:390 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" -#: ../../glossary.rst:382 +#: ../../glossary.rst:393 msgid "" "Since Python 3.3, there are two types of finder: :term:`meta path finders " "` for use with :data:`sys.meta_path`, and :term:`path " @@ -894,15 +894,15 @@ msgstr "" "項目尋檢器 (path entry finder) ` 會使用 :data:`sys." "path_hooks`\\ 。" -#: ../../glossary.rst:386 +#: ../../glossary.rst:397 msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." msgstr "請參閱 :pep:`302`\\ 、\\ :pep:`420` 和 :pep:`451` 以了解更多細節。" -#: ../../glossary.rst:387 +#: ../../glossary.rst:398 msgid "floor division" msgstr "floor division(向下取整除法)" -#: ../../glossary.rst:389 +#: ../../glossary.rst:400 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -915,11 +915,11 @@ msgstr "" "``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " "*向下*\\ 無條件捨去。請參閱 :pep:`238`\\ 。" -#: ../../glossary.rst:394 +#: ../../glossary.rst:405 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:396 +#: ../../glossary.rst:407 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -931,15 +931,15 @@ msgstr "" "`parameter`\\ (參數)、\\ :term:`method`\\ (方法),以及\\ :ref:`function`" "\\ 章節。" -#: ../../glossary.rst:400 +#: ../../glossary.rst:411 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:402 +#: ../../glossary.rst:413 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:404 +#: ../../glossary.rst:415 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -950,22 +950,22 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:412 +#: ../../glossary.rst:423 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:414 +#: ../../glossary.rst:425 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality." msgstr "" "請參閱 :term:`variable annotation` 和 :pep:`484`\\ ,皆有此功能的描述。" -#: ../../glossary.rst:416 +#: ../../glossary.rst:427 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:418 +#: ../../glossary.rst:429 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -983,11 +983,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:428 +#: ../../glossary.rst:440 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:430 +#: ../../glossary.rst:442 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -999,11 +999,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:436 +#: ../../glossary.rst:448 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:438 +#: ../../glossary.rst:450 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1014,7 +1014,7 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:443 +#: ../../glossary.rst:455 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " @@ -1023,15 +1023,15 @@ msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" "代器*\\ 。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:446 +#: ../../glossary.rst:458 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:448 +#: ../../glossary.rst:460 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:450 +#: ../../glossary.rst:462 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" @@ -1042,11 +1042,11 @@ msgstr "" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" "那些每次調用時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:457 +#: ../../glossary.rst:469 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:459 +#: ../../glossary.rst:471 msgid "" "An expression that returns an iterator. It looks like a normal expression " "followed by a :keyword:`!for` clause defining a loop variable, range, and an " @@ -1059,11 +1059,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:466 +#: ../../glossary.rst:478 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:468 +#: ../../glossary.rst:480 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1072,7 +1072,7 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:472 +#: ../../glossary.rst:484 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." @@ -1080,11 +1080,11 @@ msgstr "" "另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、\\ :func:" "`functools.singledispatch` 裝飾器和 :pep:`443`\\ 。" -#: ../../glossary.rst:473 +#: ../../glossary.rst:486 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:474 +#: ../../glossary.rst:488 msgid "" "A :term:`type` that can be parameterized; typically a container like :class:" "`list`. Used for :term:`type hints ` and :term:`annotations " @@ -1094,7 +1094,7 @@ msgstr "" "像是 :class:`list`\\ (串列)。它被用於\\ :term:`型別提示 `\\ 和" "\\ :term:`註釋 `\\ 。" -#: ../../glossary.rst:475 +#: ../../glossary.rst:492 msgid "" "See :pep:`483` for more details, and :mod:`typing` or :ref:`generic alias " "type ` for its uses." @@ -1102,19 +1102,19 @@ msgstr "" "請參閱 :pep:`483` 了解更多細節,以及 :mod:`typing` 或 :ref:`泛型別名型別 " "(generic alias type) ` 了解其用途。" -#: ../../glossary.rst:476 +#: ../../glossary.rst:494 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:477 +#: ../../glossary.rst:496 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:478 +#: ../../glossary.rst:497 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:480 +#: ../../glossary.rst:499 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1131,7 +1131,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:489 +#: ../../glossary.rst:508 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally-intensive tasks " @@ -1142,7 +1142,7 @@ msgstr "" "計算密集 (computationally-intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:494 +#: ../../glossary.rst:513 msgid "" "Past efforts to create a \"free-threaded\" interpreter (one which locks " "shared data at a much finer granularity) have not been successful because " @@ -1154,11 +1154,11 @@ msgstr "" "力並未成功,因為在一般的單一處理器情況下,效能會有所損失。一般認為,若要克服" "這個效能問題,會使實作變得複雜許多,進而付出更高的維護成本。" -#: ../../glossary.rst:500 +#: ../../glossary.rst:519 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:502 +#: ../../glossary.rst:521 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" @@ -1167,11 +1167,11 @@ msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" "間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`\\ 。" -#: ../../glossary.rst:505 +#: ../../glossary.rst:524 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:507 +#: ../../glossary.rst:526 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`__hash__` method), and can be compared to " @@ -1183,7 +1183,7 @@ msgstr "" "method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的多個可雜湊物件," "它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:512 +#: ../../glossary.rst:531 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1191,7 +1191,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:515 +#: ../../glossary.rst:534 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1206,11 +1206,11 @@ msgstr "" "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" "較),而它們的雜湊值則是衍生自它們的 :func:`id`\\ 。" -#: ../../glossary.rst:522 +#: ../../glossary.rst:541 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:524 +#: ../../glossary.rst:543 msgid "" "An Integrated Development Environment for Python. IDLE is a basic editor " "and interpreter environment which ships with the standard distribution of " @@ -1219,11 +1219,11 @@ msgstr "" "Python 的 Integrated Development Environment(整合開發環境)。IDLE 是一個基本" "的編輯器和直譯器環境,它和 Python 的標準發行版本一起被提供。" -#: ../../glossary.rst:527 +#: ../../glossary.rst:546 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:529 +#: ../../glossary.rst:548 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1235,11 +1235,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:534 +#: ../../glossary.rst:553 msgid "import path" msgstr "import path(匯入路徑)" -#: ../../glossary.rst:536 +#: ../../glossary.rst:555 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1251,11 +1251,11 @@ msgstr "" "的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`\\ ,但對於子套" "件 (subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:541 +#: ../../glossary.rst:560 msgid "importing" msgstr "importing(匯入)" -#: ../../glossary.rst:543 +#: ../../glossary.rst:562 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1263,11 +1263,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:545 +#: ../../glossary.rst:564 msgid "importer" msgstr "importer(匯入器)" -#: ../../glossary.rst:547 +#: ../../glossary.rst:566 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1275,11 +1275,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:549 +#: ../../glossary.rst:568 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:551 +#: ../../glossary.rst:570 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1292,11 +1292,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" "記住help(x))。" -#: ../../glossary.rst:557 +#: ../../glossary.rst:576 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:559 +#: ../../glossary.rst:578 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1310,11 +1310,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:566 +#: ../../glossary.rst:585 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:568 +#: ../../glossary.rst:587 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1332,18 +1332,18 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:577 +#: ../../glossary.rst:596 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:579 +#: ../../glossary.rst:598 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:581 +#: ../../glossary.rst:600 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1359,7 +1359,7 @@ msgstr "" "`Sequence `\\ (序列)語意的 :meth:`__getitem__` method,該物件就是" "可疊代物件。" -#: ../../glossary.rst:588 +#: ../../glossary.rst:607 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1379,11 +1379,11 @@ msgstr "" "於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、\\ :term:" "`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:598 +#: ../../glossary.rst:617 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:600 +#: ../../glossary.rst:619 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1412,15 +1412,15 @@ msgstr "" "事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" "件,使其看起來就像一個空的容器。" -#: ../../glossary.rst:615 +#: ../../glossary.rst:634 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:616 +#: ../../glossary.rst:635 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:618 +#: ../../glossary.rst:637 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1430,7 +1430,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,\\ :func:`locale." "strxfrm` 被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:623 +#: ../../glossary.rst:642 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1442,7 +1442,7 @@ msgstr "" "\\ 、\\ :func:`heapq.merge`\\ 、\\ :func:`heapq.nsmallest`\\ 、\\ :func:" "`heapq.nlargest` 和 :func:`itertools.groupby`\\ 。" -#: ../../glossary.rst:629 +#: ../../glossary.rst:648 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1460,19 +1460,19 @@ msgstr "" "`~operator.itemgetter` 和 :func:`~operator.methodcaller`\\ 。關於如何建立和使" "用鍵函式的範例,請參閱\\ :ref:`如何排序 `\\ 。" -#: ../../glossary.rst:637 +#: ../../glossary.rst:656 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:639 ../../glossary.rst:916 +#: ../../glossary.rst:658 ../../glossary.rst:935 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:640 +#: ../../glossary.rst:659 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:642 +#: ../../glossary.rst:661 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1482,11 +1482,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``\\ 。" -#: ../../glossary.rst:645 +#: ../../glossary.rst:664 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:647 +#: ../../glossary.rst:666 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1497,7 +1497,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:652 +#: ../../glossary.rst:671 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1511,11 +1511,11 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:657 +#: ../../glossary.rst:676 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:659 +#: ../../glossary.rst:678 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -1525,11 +1525,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 O(1)。" -#: ../../glossary.rst:662 +#: ../../glossary.rst:681 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:664 +#: ../../glossary.rst:683 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1543,11 +1543,11 @@ msgstr "" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:670 +#: ../../glossary.rst:689 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:672 +#: ../../glossary.rst:691 msgid "" "An object that loads a module. It must define a method named :meth:" "`load_module`. A loader is typically returned by a :term:`finder`. See :pep:" @@ -1559,19 +1559,19 @@ msgstr "" "`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" "`importlib.abc.Loader`\\ 。" -#: ../../glossary.rst:676 +#: ../../glossary.rst:695 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:680 +#: ../../glossary.rst:699 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:681 +#: ../../glossary.rst:700 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:683 +#: ../../glossary.rst:702 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`~collections.abc.Mapping` or :class:" @@ -1586,11 +1586,11 @@ msgstr "" "的 method。範例包括 :class:`dict`\\ 、\\ :class:`collections.defaultdict`" "\\ 、\\ :class:`collections.OrderedDict` 和 :class:`collections.Counter`\\ 。" -#: ../../glossary.rst:689 +#: ../../glossary.rst:708 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:691 +#: ../../glossary.rst:710 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:695 +#: ../../glossary.rst:714 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." @@ -1608,11 +1608,11 @@ msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`" "\\ 。" -#: ../../glossary.rst:697 +#: ../../glossary.rst:716 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:699 +#: ../../glossary.rst:718 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1632,15 +1632,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:709 +#: ../../glossary.rst:728 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:710 +#: ../../glossary.rst:729 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:712 +#: ../../glossary.rst:731 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1652,11 +1652,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:716 +#: ../../glossary.rst:735 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:718 +#: ../../glossary.rst:737 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See `The Python 2.3 Method Resolution Order `_\\ 。" -#: ../../glossary.rst:722 +#: ../../glossary.rst:741 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:724 +#: ../../glossary.rst:743 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1681,15 +1681,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:728 +#: ../../glossary.rst:747 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:729 +#: ../../glossary.rst:748 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:731 +#: ../../glossary.rst:750 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1697,19 +1697,19 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:733 +#: ../../glossary.rst:752 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:735 +#: ../../glossary.rst:754 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:736 +#: ../../glossary.rst:755 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:738 +#: ../../glossary.rst:757 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." @@ -1717,11 +1717,11 @@ msgstr "" "可變物件可以改變它們的值,但維持它們的 :func:`id`\\ 。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:740 +#: ../../glossary.rst:759 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:742 +#: ../../glossary.rst:761 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -1731,7 +1731,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:746 +#: ../../glossary.rst:765 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -1742,7 +1742,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:757 +#: ../../glossary.rst:776 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -1758,11 +1758,11 @@ msgstr "" "些額外的 method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到" "的。" -#: ../../glossary.rst:764 +#: ../../glossary.rst:783 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:766 +#: ../../glossary.rst:785 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -1782,11 +1782,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:776 +#: ../../glossary.rst:795 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:778 +#: ../../glossary.rst:797 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -1797,15 +1797,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:783 +#: ../../glossary.rst:802 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:784 +#: ../../glossary.rst:803 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:786 +#: ../../glossary.rst:805 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -1820,11 +1820,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。\\ :keyword:`nonlocal` 容" "許對外層作用域進行寫入。" -#: ../../glossary.rst:793 +#: ../../glossary.rst:812 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:795 +#: ../../glossary.rst:814 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -1836,11 +1836,11 @@ msgstr "" "__slots__`\\ 、描述器 (descriptor)、屬性 (property)、\\ :meth:" "`__getattribute__`\\ 、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:799 +#: ../../glossary.rst:818 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:801 +#: ../../glossary.rst:820 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -1848,11 +1848,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:804 +#: ../../glossary.rst:823 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:806 +#: ../../glossary.rst:825 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with an ``__path__`` " @@ -1862,17 +1862,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:810 +#: ../../glossary.rst:829 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace package`" "\\ (命名空間套件)。" -#: ../../glossary.rst:811 +#: ../../glossary.rst:830 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:813 +#: ../../glossary.rst:832 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -1882,7 +1882,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:817 +#: ../../glossary.rst:836 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -1895,7 +1895,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:826 +#: ../../glossary.rst:845 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -1908,7 +1908,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:835 +#: ../../glossary.rst:854 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -1923,7 +1923,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:843 +#: ../../glossary.rst:862 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -1937,7 +1937,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:851 +#: ../../glossary.rst:870 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -1948,14 +1948,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:857 +#: ../../glossary.rst:876 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:860 +#: ../../glossary.rst:879 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -1966,11 +1966,11 @@ msgstr "" "參數之間的差異 `\\ 、\\ :class:`inspect." "Parameter` class、\\ :ref:`function`\\ 章節,以及 :pep:`362`\\ 。" -#: ../../glossary.rst:864 +#: ../../glossary.rst:883 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:866 +#: ../../glossary.rst:885 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -1978,11 +1978,11 @@ msgstr "" "在 :term:`import path`\\ (匯入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:868 +#: ../../glossary.rst:887 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:870 +#: ../../glossary.rst:889 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -1992,7 +1992,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`\\ ,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:874 +#: ../../glossary.rst:893 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2000,11 +2000,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`\\ 。" -#: ../../glossary.rst:876 +#: ../../glossary.rst:895 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:878 +#: ../../glossary.rst:897 msgid "" "A callable on the :data:`sys.path_hook` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2014,11 +2014,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:881 +#: ../../glossary.rst:900 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:883 +#: ../../glossary.rst:902 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2026,11 +2026,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:885 +#: ../../glossary.rst:904 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:887 +#: ../../glossary.rst:906 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2048,11 +2048,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:895 +#: ../../glossary.rst:914 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:897 +#: ../../glossary.rst:916 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2063,7 +2063,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:903 +#: ../../glossary.rst:922 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2075,15 +2075,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:909 +#: ../../glossary.rst:928 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`\\ 。" -#: ../../glossary.rst:910 +#: ../../glossary.rst:929 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:912 +#: ../../glossary.rst:931 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2091,15 +2091,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:914 +#: ../../glossary.rst:933 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:917 +#: ../../glossary.rst:936 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:919 +#: ../../glossary.rst:938 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2115,7 +2115,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:928 +#: ../../glossary.rst:947 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2124,7 +2124,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:932 +#: ../../glossary.rst:951 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2133,19 +2133,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:935 +#: ../../glossary.rst:954 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:937 +#: ../../glossary.rst:956 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:938 +#: ../../glossary.rst:957 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:940 +#: ../../glossary.rst:959 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2154,11 +2154,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:943 +#: ../../glossary.rst:962 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:945 +#: ../../glossary.rst:964 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2174,18 +2174,18 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:955 +#: ../../glossary.rst:974 msgid "As opposed to the cleaner, Pythonic method::" msgstr "" "相較之下,以下方法更簡潔、更具有 Python 風格:\n" "\n" "::" -#: ../../glossary.rst:959 +#: ../../glossary.rst:978 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:961 +#: ../../glossary.rst:980 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2198,7 +2198,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:978 +#: ../../glossary.rst:997 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2209,11 +2209,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:985 +#: ../../glossary.rst:1004 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:987 +#: ../../glossary.rst:1006 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Reference counting is generally " @@ -2227,11 +2227,11 @@ msgstr "" "`CPython` 實作的一個關鍵元素。\\ :mod:`sys` 模組定義了一個 :func:`~sys." "getrefcount` 函式,程序設計師可以呼叫該函式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:993 +#: ../../glossary.rst:1012 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:995 +#: ../../glossary.rst:1014 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2239,15 +2239,15 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:998 +#: ../../glossary.rst:1017 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:999 +#: ../../glossary.rst:1018 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1001 +#: ../../glossary.rst:1020 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2260,11 +2260,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1006 +#: ../../glossary.rst:1025 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1008 +#: ../../glossary.rst:1027 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`__getitem__` special method and defines a :meth:" @@ -2282,7 +2282,7 @@ msgstr "" "對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` 鍵," "而不是整數。" -#: ../../glossary.rst:1017 +#: ../../glossary.rst:1036 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`__getitem__` and :meth:" @@ -2296,11 +2296,11 @@ msgstr "" "`__reversed__`\\ 。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta." "register` 被明確地註冊。" -#: ../../glossary.rst:1019 +#: ../../glossary.rst:1043 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1020 +#: ../../glossary.rst:1045 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2311,11 +2311,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`\\ 。" -#: ../../glossary.rst:1024 +#: ../../glossary.rst:1049 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1026 +#: ../../glossary.rst:1051 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2323,11 +2323,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1028 +#: ../../glossary.rst:1053 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1030 +#: ../../glossary.rst:1055 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2339,11 +2339,11 @@ msgstr "" "之間使用冒號,例如 ``in variable_name[1:3:5]``。在括號(下標)符號的內部,會" "使用 :class:`slice` 物件。" -#: ../../glossary.rst:1034 +#: ../../glossary.rst:1059 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1038 +#: ../../glossary.rst:1063 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2354,11 +2354,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1042 +#: ../../glossary.rst:1067 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1044 +#: ../../glossary.rst:1069 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2368,19 +2368,19 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`\\ 、\\ :" "keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1047 +#: ../../glossary.rst:1072 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1049 +#: ../../glossary.rst:1074 msgid "A codec which encodes Unicode strings to bytes." msgstr "將 Unicode 字串編碼為位元組的一個編解碼器 (codec)。" -#: ../../glossary.rst:1050 +#: ../../glossary.rst:1075 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1052 +#: ../../glossary.rst:1077 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2394,7 +2394,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`\\ 、\\ :" "data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1059 +#: ../../glossary.rst:1084 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2402,11 +2402,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進制檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1061 +#: ../../glossary.rst:1086 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1063 +#: ../../glossary.rst:1088 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2421,11 +2421,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1070 +#: ../../glossary.rst:1095 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1072 +#: ../../glossary.rst:1097 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~instance." @@ -2435,15 +2435,15 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1076 +#: ../../glossary.rst:1101 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1078 +#: ../../glossary.rst:1103 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1080 +#: ../../glossary.rst:1105 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" @@ -2452,22 +2452,22 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1089 +#: ../../glossary.rst:1112 msgid "could be made more readable like this::" msgstr "" "可以寫成這樣,更具有可讀性:\n" "\n" "::" -#: ../../glossary.rst:1098 ../../glossary.rst:1112 +#: ../../glossary.rst:1119 ../../glossary.rst:1133 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`\\ ,有此功能的描述。" -#: ../../glossary.rst:1099 +#: ../../glossary.rst:1120 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1101 +#: ../../glossary.rst:1122 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2475,7 +2475,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1125 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to static type analysis tools, and aid IDEs with code completion and " @@ -2484,7 +2484,7 @@ msgstr "" "型別提示是選擇性的,而不是被 Python 強制的,但它們對靜態型別分析工具很有用," "並能協助 IDE 完成程式碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1108 +#: ../../glossary.rst:1129 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2492,11 +2492,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1113 +#: ../../glossary.rst:1134 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1115 +#: ../../glossary.rst:1136 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -2509,15 +2509,15 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`\\ ,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1120 +#: ../../glossary.rst:1141 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1122 +#: ../../glossary.rst:1143 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1124 +#: ../../glossary.rst:1145 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "" @@ -2525,7 +2525,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1129 +#: ../../glossary.rst:1150 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -2535,11 +2535,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1135 +#: ../../glossary.rst:1156 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1137 +#: ../../glossary.rst:1158 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality." @@ -2547,11 +2547,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、\\ :pep:`484` 和 :pep:" "`526`\\ ,皆有此功能的描述。" -#: ../../glossary.rst:1139 +#: ../../glossary.rst:1160 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1141 +#: ../../glossary.rst:1162 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2562,15 +2562,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1146 +#: ../../glossary.rst:1167 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`\\ 。" -#: ../../glossary.rst:1147 +#: ../../glossary.rst:1168 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1149 +#: ../../glossary.rst:1170 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2578,11 +2578,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1151 +#: ../../glossary.rst:1172 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1153 +#: ../../glossary.rst:1174 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing "