diff --git a/c-api/object.po b/c-api/object.po index e422f0647c..a2be5438c2 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -36,15 +36,15 @@ msgstr "" #: ../../c-api/object.rst:20 msgid "Constant Identifier" -msgstr "" +msgstr "常數識別字" #: ../../c-api/object.rst:20 msgid "Value" -msgstr "" +msgstr "數值" #: ../../c-api/object.rst:20 msgid "Returned object" -msgstr "" +msgstr "回傳物件" #: ../../c-api/object.rst:22 ../../c-api/object.rst:27 msgid "``0``" @@ -126,7 +126,7 @@ msgstr "" #: ../../c-api/object.rst:42 msgid "In CPython, all of these constants are :term:`immortal`." -msgstr "" +msgstr "在 CPython 中,所有這些常數都是\\ :term:`不滅 `\\ 的。" #: ../../c-api/object.rst:47 msgid "" diff --git a/faq/library.po b/faq/library.po index 3a9a9e0094..648029c94e 100644 --- a/faq/library.po +++ b/faq/library.po @@ -1301,7 +1301,7 @@ msgstr "``uniform(a, b)`` 會選擇 [a, b) 範圍內的浮點數。" #: ../../faq/library.rst:805 msgid "" "``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." -msgstr "``normalvariate(mean, sdev)`` 對常態(高斯)分佈進行採樣 (sample)。" +msgstr "``normalvariate(mean, sdev)`` 對常態(高斯)分佈進行取樣 (sample)。" #: ../../faq/library.rst:807 msgid "Some higher-level functions operate on sequences directly, such as:" diff --git a/faq/programming.po b/faq/programming.po index 3a4d4abfe8..1d9f44ebb3 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -4205,7 +4205,7 @@ msgid "" msgstr "" "模組可以透過查看預定義的全域變數 ``__name__`` 來找出自己的模組名稱。如果它的" "值為``'__main__'``,則該程式作為腳本運行。許多通常透過引入使用的模組還提供命" -"令行界面或自檢,只有在檢查 ``__name__`` 後才執行此程式碼: ::" +"令行介面或自檢,只有在檢查 ``__name__`` 後才執行此程式碼: ::" #: ../../faq/programming.rst:2134 msgid "" @@ -4216,11 +4216,16 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"def main():\n" +" print('Running test...')\n" +" ...\n" +"\n" +"if __name__ == '__main__':\n" +" main()" #: ../../faq/programming.rst:2143 -#, fuzzy msgid "How can I have modules that mutually import each other?" -msgstr "我怎樣才能擁有相互引入的模組?" +msgstr "要怎樣才能擁有相互引入的模組?" #: ../../faq/programming.rst:2145 msgid "Suppose you have the following modules:" diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po index 3aa5cec884..62fdf4ecdd 100644 --- a/howto/argparse-optparse.po +++ b/howto/argparse-optparse.po @@ -17,39 +17,41 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: ../../howto/argparse-optparse.rst:8 -#, fuzzy msgid "Migrating ``optparse`` code to ``argparse``" -msgstr "升級 optparse 程式碼" +msgstr "將 ``optparse`` 程式碼遷移到 ``argparse``" #: ../../howto/argparse-optparse.rst:10 msgid "" "The :mod:`argparse` module offers several higher level features not natively " "provided by the :mod:`optparse` module, including:" msgstr "" +":mod:`argparse` 模組提供了一些高階功能,這些功能在 :mod:`optparse` 模組中並未" +"原生提供,包括:" #: ../../howto/argparse-optparse.rst:13 msgid "Handling positional arguments." -msgstr "" +msgstr "處理位置引數。" #: ../../howto/argparse-optparse.rst:14 msgid "Supporting subcommands." -msgstr "" +msgstr "支援子命令。" #: ../../howto/argparse-optparse.rst:15 msgid "Allowing alternative option prefixes like ``+`` and ``/``." -msgstr "" +msgstr "允許替代選項前綴,如 ``+`` 和 ``/``。" #: ../../howto/argparse-optparse.rst:16 msgid "Handling zero-or-more and one-or-more style arguments." msgstr "" +"處理零或多個 (zero-or-more) 和一個或多個 (and one-or-more) 樣式的引數。" #: ../../howto/argparse-optparse.rst:17 msgid "Producing more informative usage messages." -msgstr "" +msgstr "產生更多資訊的使用訊息。" #: ../../howto/argparse-optparse.rst:18 msgid "Providing a much simpler interface for custom ``type`` and ``action``." -msgstr "" +msgstr "為自訂 ``type`` 和 ``action`` 提供了一個更簡單的介面。" #: ../../howto/argparse-optparse.rst:20 msgid "" @@ -60,6 +62,10 @@ msgid "" "named options and positional arguments in the declarative interface mean " "that the API has diverged from that of ``optparse`` over time." msgstr "" +"最初 :mod:`argparse` 模組試圖保持與 :mod:`optparse` 的相容性,但在基礎設計上" +"的存在差異 -- 支援宣告式 (declarative) 命令列選項處理 (同時將位置引數處理留給" +"應用程式的程式碼) 和在宣告式介面中支援命名選項 (named options) 和位置引數 -- " +"代表 API 隨著時間的推移已經與 ``optparse`` API 分歧。" #: ../../howto/argparse-optparse.rst:27 msgid "" @@ -67,6 +73,8 @@ msgid "" "currently using :mod:`optparse` and are happy with the way it works can just " "continue to use ``optparse``." msgstr "" +"如 :ref:`choosing-an-argument-parser` 中所述,目前使用 :mod:`optparse` 並對其" +"運作方式滿意的應用程式可以繼續使用 ``optparse``。" #: ../../howto/argparse-optparse.rst:31 msgid "" @@ -74,18 +82,24 @@ msgid "" "list of intrinsic behavioural differences described in that section before " "deciding whether or not migration is desirable." msgstr "" +"在決定是否遷移之前,應用程式開發人員應該先檢閱該段落中描述的內在行為差異清" +"單,來決定是否值得遷移。" #: ../../howto/argparse-optparse.rst:35 msgid "" "For applications that do choose to migrate from :mod:`optparse` to :mod:" "`argparse`, the following suggestions should be helpful:" msgstr "" +"對於選擇從 :mod:`optparse` 遷移到 :mod:`argparse` 的應用程式,以下建議應會有" +"所幫助:" #: ../../howto/argparse-optparse.rst:38 msgid "" "Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" "`ArgumentParser.add_argument` calls." msgstr "" +"將所有 :meth:`optparse.OptionParser.add_option` 呼叫替換為 :meth:" +"`ArgumentParser.add_argument` 呼叫。" #: ../../howto/argparse-optparse.rst:41 msgid "" @@ -94,6 +108,10 @@ msgid "" "for the positional arguments. Keep in mind that what was previously called " "``options``, now in the :mod:`argparse` context is called ``args``." msgstr "" +"將 ``(options, args) = parser.parse_args()`` 替換為 ``args = parser." +"parse_args()``,並為位置引數新增額外的 :meth:`ArgumentParser.add_argument` 呼" +"叫。請記住,以前稱為 ``options`` 的東西,在 :mod:`argparse` 情境中現在稱為 " +"``args``。" #: ../../howto/argparse-optparse.rst:46 msgid "" @@ -101,24 +119,33 @@ msgid "" "meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" "`~ArgumentParser.parse_args`." msgstr "" +"使用 :meth:`~ArgumentParser.parse_intermixed_args` 來替換掉 :meth:`optparse." +"OptionParser.disable_interspersed_args`,而不是使用 :meth:`~ArgumentParser." +"parse_args`。" #: ../../howto/argparse-optparse.rst:50 msgid "" "Replace callback actions and the ``callback_*`` keyword arguments with " "``type`` or ``action`` arguments." msgstr "" +"將回呼動作和 ``callback_*`` 關鍵字引數替換為 ``type`` 或 ``action`` 引數。" #: ../../howto/argparse-optparse.rst:53 msgid "" "Replace string names for ``type`` keyword arguments with the corresponding " "type objects (e.g. int, float, complex, etc)." msgstr "" +"將 ``type`` 關鍵字引數的字串名稱替換為相應的類型物件 (例如 int、float、" +"complex 等)。" #: ../../howto/argparse-optparse.rst:56 msgid "" "Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." "OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." msgstr "" +"將 :class:`optparse.Values` 替換為 :class:`Namespace`,並將 :exc:`optparse." +"OptionError` 和 :exc:`optparse.OptionValueError` 替換為 :exc:" +"`ArgumentError`。" #: ../../howto/argparse-optparse.rst:60 msgid "" @@ -126,6 +153,8 @@ msgid "" "with the standard Python syntax to use dictionaries to format strings, that " "is, ``%(default)s`` and ``%(prog)s``." msgstr "" +"將隱式引數的字串,如 ``%default`` 或 ``%prog`` 替換為使用字典來格式化字串的標" +"準 Python 語法,即 ``%(default)s`` 和 ``%(prog)s``。" #: ../../howto/argparse-optparse.rst:64 msgid "" @@ -133,3 +162,5 @@ msgid "" "``parser.add_argument('--version', action='version', version='')``." msgstr "" +"將 OptionParser 建構函式的 ``version`` 引數替換為呼叫 ``parser." +"add_argument('--version', action='version', version='')``。" diff --git a/howto/argparse.po b/howto/argparse.po index cc55e2dddf..323727fd39 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -57,6 +57,12 @@ msgid "" "``optparse``, so some aspects of this tutorial will also be relevant to " "``optparse`` users." msgstr "" +"標準函式庫包含另外兩個與命令列參數處理直接相關的函式庫:較低階的 :mod:" +"`optparse` 模組(可能需要更多程式碼來為給定應用程式設定,但也允許應用程式要" +"求 ``argparse`` 不支援的行為),以及非常低階的 :mod:`getopt`\\ (專門用作 C " +"程式設計師可用的 :c:func:`!getopt` 函式系列的等價)。雖然這個指南並未直接涵蓋" +"這些模組,但 ``argparse`` 的許多核心概念最初來自於 ``optparse``,因此本教學的" +"某些部分也適用於 ``optparse`` 使用者。" #: ../../howto/argparse.rst:29 msgid "Concepts" @@ -1733,13 +1739,3 @@ msgid "" msgstr "" ":mod:`argparse` 模組提供的功能比此篇內容的要多得多。它的文件非常詳細與透徹並" "有很多範例。讀完本教學後,你應該可以輕鬆消化它們,而不會感到不知所措。" - -#~ msgid "" -#~ "There are two other modules that fulfill the same task, namely :mod:" -#~ "`getopt` (an equivalent for ``getopt()`` from the C language) and the " -#~ "deprecated :mod:`optparse`. Note also that :mod:`argparse` is based on :" -#~ "mod:`optparse`, and therefore very similar in terms of usage." -#~ msgstr "" -#~ "另外還有兩個模組可以完成相同的任務,即 :mod:`getopt`\\ (相當於 C 語言中" -#~ "的 ``getopt()``)和已棄用的 :mod:`optparse`。另請注意,:mod:`argparse` 是" -#~ "基於 :mod:`optparse` 的,因此在用法上非常相似。" diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index d2f09a2deb..fe26e49d23 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -20,7 +19,7 @@ msgstr "" #: ../../howto/free-threading-python.rst:5 msgid "Python experimental support for free threading" -msgstr "" +msgstr "Python 自由執行緒的實驗性支援" #: ../../howto/free-threading-python.rst:7 msgid "" @@ -54,7 +53,7 @@ msgstr "" #: ../../howto/free-threading-python.rst:28 msgid "Installation" -msgstr "" +msgstr "安裝" #: ../../howto/free-threading-python.rst:30 msgid "" @@ -130,7 +129,7 @@ msgstr "https://hugovk.github.io/free-threaded-wheels/" #: ../../howto/free-threading-python.rst:75 msgid "Thread safety" -msgstr "" +msgstr "執行緒安全" #: ../../howto/free-threading-python.rst:77 msgid "" @@ -153,7 +152,7 @@ msgstr "" #: ../../howto/free-threading-python.rst:94 msgid "Known limitations" -msgstr "" +msgstr "已知限制" #: ../../howto/free-threading-python.rst:96 msgid "" @@ -162,7 +161,7 @@ msgstr "" #: ../../howto/free-threading-python.rst:99 msgid "Immortalization" -msgstr "" +msgstr "不滅化 (Immortalization)" #: ../../howto/free-threading-python.rst:101 msgid "" @@ -182,23 +181,23 @@ msgstr "" #: ../../howto/free-threading-python.rst:109 msgid "" ":ref:`function ` objects declared at the module level" -msgstr "" +msgstr "在模組層級宣告的\\ :ref:`函式 `\\ 物件" #: ../../howto/free-threading-python.rst:110 msgid ":ref:`method ` descriptors" -msgstr "" +msgstr ":ref:`方法 `\\ 描述器" #: ../../howto/free-threading-python.rst:111 msgid ":ref:`code ` objects" -msgstr "" +msgstr ":ref:`程式碼 `\\ 物件" #: ../../howto/free-threading-python.rst:112 msgid ":term:`module` objects and their dictionaries" -msgstr "" +msgstr ":term:`模組 `\\ 物件及其字典" #: ../../howto/free-threading-python.rst:113 msgid ":ref:`classes ` (type objects)" -msgstr "" +msgstr ":ref:`類別 `\\ (型別物件)" #: ../../howto/free-threading-python.rst:115 msgid "" @@ -241,7 +240,7 @@ msgstr "" #: ../../howto/free-threading-python.rst:143 msgid "Single-threaded performance" -msgstr "" +msgstr "單執行緒效能" #: ../../howto/free-threading-python.rst:145 msgid "" diff --git a/howto/functional.po b/howto/functional.po index a145631968..15ccb13599 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -164,23 +164,23 @@ msgstr "" #: ../../howto/functional.rst:94 msgid "Formal provability." -msgstr "" +msgstr "形式可證明性 (Formal provability)。" #: ../../howto/functional.rst:95 msgid "Modularity." -msgstr "" +msgstr "模組化 (Modularity)。" #: ../../howto/functional.rst:96 msgid "Composability." -msgstr "" +msgstr "可組合性 (Composability)。" #: ../../howto/functional.rst:97 msgid "Ease of debugging and testing." -msgstr "" +msgstr "容易除錯與測試。" #: ../../howto/functional.rst:101 msgid "Formal provability" -msgstr "" +msgstr "形式可證明性" #: ../../howto/functional.rst:103 msgid "" @@ -231,7 +231,7 @@ msgstr "" #: ../../howto/functional.rst:137 msgid "Modularity" -msgstr "" +msgstr "模組化" #: ../../howto/functional.rst:139 msgid "" @@ -244,7 +244,7 @@ msgstr "" #: ../../howto/functional.rst:147 msgid "Ease of debugging and testing" -msgstr "" +msgstr "容易除錯與測試" #: ../../howto/functional.rst:149 msgid "Testing and debugging a functional-style program is easier." @@ -269,7 +269,7 @@ msgstr "" #: ../../howto/functional.rst:163 msgid "Composability" -msgstr "" +msgstr "可組合性" #: ../../howto/functional.rst:165 msgid "" @@ -498,7 +498,7 @@ msgstr "" #: ../../howto/functional.rst:333 msgid "Generator expressions and list comprehensions" -msgstr "" +msgstr "產生器運算式與串列綜合運算式" #: ../../howto/functional.rst:335 msgid "" @@ -527,6 +527,13 @@ msgid "" ">>> # List comprehension -- returns list\n" ">>> stripped_list = [line.strip() for line in line_list]" msgstr "" +">>> line_list = [' line 1\\n', 'line 2 \\n', ' \\n', '']\n" +"\n" +">>> # 產生器運算式 -- 回傳疊代器\n" +">>> stripped_iter = (line.strip() for line in line_list)\n" +"\n" +">>> # 串列綜合運算式 -- 回傳串列\n" +">>> stripped_list = [line.strip() for line in line_list]" #: ../../howto/functional.rst:354 msgid "" @@ -692,7 +699,7 @@ msgstr "" #: ../../howto/functional.rst:454 msgid "Here's the simplest example of a generator function:" -msgstr "" +msgstr "以下是最簡單的產生器函式範例:" #: ../../howto/functional.rst:460 msgid "" @@ -715,7 +722,7 @@ msgstr "" #: ../../howto/functional.rst:473 msgid "Here's a sample usage of the ``generate_ints()`` generator:" -msgstr "" +msgstr "以下是 ``generate_ints()`` 產生器的使用範例:" #: ../../howto/functional.rst:490 msgid "" @@ -840,6 +847,15 @@ msgid "" " else:\n" " i += 1" msgstr "" +"def counter(maximum):\n" +" i = 0\n" +" while i < maximum:\n" +" val = (yield i)\n" +" # 如有提供值則改變計數器\n" +" if val is not None:\n" +" i = val\n" +" else:\n" +" i += 1" #: ../../howto/functional.rst:576 msgid "And here's an example of changing the counter:" @@ -917,12 +933,14 @@ msgstr "" #: ../../howto/functional.rst:633 msgid "" ":func:`map(f, iterA, iterB, ...) ` returns an iterator over the sequence" -msgstr "" +msgstr ":func:`map(f, iterA, iterB, ...) ` 回傳一個元素為序列的疊代器" #: ../../howto/functional.rst:634 msgid "" "``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``." msgstr "" +"``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ..." +"``。" #: ../../howto/functional.rst:644 msgid "You can of course achieve the same effect with a list comprehension." diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index d89ee4250b..0274ff095f 100644 --- a/howto/perf_profiling.po +++ b/howto/perf_profiling.po @@ -115,7 +115,7 @@ msgstr "" #: ../../howto/perf_profiling.rst:55 msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::" -msgstr "我們可以執行 ``perf`` 以 9999 赫茲採樣 CPU 堆疊追蹤 (stack trace): ::" +msgstr "我們可以執行 ``perf`` 以 9999 赫茲取樣 CPU 堆疊追蹤 (stack trace): ::" #: ../../howto/perf_profiling.rst:57 msgid "$ perf record -F 9999 -g -o perf.data python my_script.py" diff --git a/howto/sorting.po b/howto/sorting.po index f66a0870ce..dcdc529f4e 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -697,7 +697,7 @@ msgid "" msgstr "" ":func:`heapq.nsmallest` 以及 :func:`heapq.nlargest` 會分別回傳 *n* 個最小值及" "最大值。這些函式會將資料進行一次傳遞且一次只會保留 *n* 個元素在記憶體中。對於" -"相對於輸入數量較小的 *n* 個值,這些函數進行的比較比完整排序要少得多。" +"相對於輸入數量較小的 *n* 個值,這些函式進行的比較比完整排序要少得多。" #: ../../howto/sorting.rst:342 msgid "" diff --git a/library/_thread.po b/library/_thread.po index 91130e2cc2..1dbd585c96 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -319,7 +319,7 @@ msgid "" "Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is " "equivalent to calling :func:`_thread.exit`." msgstr "" -"呼叫 :func:`sys.exit` 函數或引發 :exc:`SystemExit` 例外等同於呼叫 :func:" +"呼叫 :func:`sys.exit` 函式或引發 :exc:`SystemExit` 例外等同於呼叫 :func:" "`_thread.exit` 函式。" #: ../../library/_thread.rst:222 diff --git a/library/argparse.po b/library/argparse.po index 09302f374c..b0188fae49 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -22,7 +21,7 @@ msgstr "" msgid "" ":mod:`!argparse` --- Parser for command-line options, arguments and " "subcommands" -msgstr "" +msgstr ":mod:`!argparse` --- 命令列選項、引數和子命令的剖析器" #: ../../library/argparse.rst:12 msgid "**Source code:** :source:`Lib/argparse.py`" @@ -77,6 +76,10 @@ msgid "" " description='What the program does',\n" " epilog='Text at the bottom of help')" msgstr "" +"parser = argparse.ArgumentParser(\n" +" prog='ProgramName',\n" +" description='What the program does',\n" +" epilog='Text at the bottom of help')" #: ../../library/argparse.rst:49 msgid "" @@ -92,6 +95,10 @@ msgid "" "parser.add_argument('-v', '--verbose',\n" " action='store_true') # on/off flag" msgstr "" +"parser.add_argument('filename') # 位置引數\n" +"parser.add_argument('-c', '--count') # 接收一個值的選項\n" +"parser.add_argument('-v', '--verbose',\n" +" action='store_true') # 開關旗標" #: ../../library/argparse.rst:58 msgid "" @@ -104,6 +111,8 @@ msgid "" "args = parser.parse_args()\n" "print(args.filename, args.count, args.verbose)" msgstr "" +"args = parser.parse_args()\n" +"print(args.filename, args.count, args.verbose)" #: ../../library/argparse.rst:65 msgid "" @@ -126,38 +135,38 @@ msgstr "" #: ../../library/argparse.rst:82 msgid "" "prog_ - The name of the program (default: ``os.path.basename(sys.argv[0])``)" -msgstr "" +msgstr "prog_ - 程式的名稱(預設值:``os.path.basename(sys.argv[0])``)" #: ../../library/argparse.rst:85 msgid "" "usage_ - The string describing the program usage (default: generated from " "arguments added to parser)" -msgstr "" +msgstr "usage_ - 描述程式用法的字串(預設值:從新增到剖析器的引數產生)" #: ../../library/argparse.rst:88 msgid "" "description_ - Text to display before the argument help (by default, no text)" -msgstr "" +msgstr "description_ - 引數說明之前要顯示的文字(預設值:無文字)" #: ../../library/argparse.rst:91 msgid "epilog_ - Text to display after the argument help (by default, no text)" -msgstr "" +msgstr "epilog_ - 引數說明之後要顯示的文字(預設值:無文字)" #: ../../library/argparse.rst:93 msgid "" "parents_ - A list of :class:`ArgumentParser` objects whose arguments should " "also be included" -msgstr "" +msgstr "parents_ - 一個 :class:`ArgumentParser` 物件的串列,其引數也應該被包含" #: ../../library/argparse.rst:96 msgid "formatter_class_ - A class for customizing the help output" -msgstr "" +msgstr "formatter_class_ - 用於自訂說明輸出的類別" #: ../../library/argparse.rst:98 msgid "" "prefix_chars_ - The set of characters that prefix optional arguments " "(default: '-')" -msgstr "" +msgstr "prefix_chars_ - 前綴可選引數的字元集合(預設值:'-')" #: ../../library/argparse.rst:101 msgid "" @@ -214,7 +223,7 @@ msgstr "" #: ../../library/argparse.rst:134 msgid "prog" -msgstr "" +msgstr "prog" #: ../../library/argparse.rst:137 msgid "" @@ -293,7 +302,7 @@ msgstr "" #: ../../library/argparse.rst:176 msgid "usage" -msgstr "" +msgstr "usage" #: ../../library/argparse.rst:178 msgid "" @@ -340,7 +349,7 @@ msgstr "" #: ../../library/argparse.rst:202 msgid "description" -msgstr "描述" +msgstr "description" #: ../../library/argparse.rst:204 msgid "" @@ -359,7 +368,7 @@ msgstr "" #: ../../library/argparse.rst:215 msgid "epilog" -msgstr "" +msgstr "epilog" #: ../../library/argparse.rst:217 msgid "" @@ -405,7 +414,7 @@ msgstr "" #: ../../library/argparse.rst:240 msgid "parents" -msgstr "" +msgstr "parents" #: ../../library/argparse.rst:242 msgid "" @@ -534,6 +543,27 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.RawDescriptionHelpFormatter,\n" +"... description=textwrap.dedent('''\\\n" +"... Please do not mess up this text!\n" +"... --------------------------------\n" +"... I have indented it\n" +"... exactly the way\n" +"... I want it\n" +"... '''))\n" +">>> parser.print_help()\n" +"usage: PROG [-h]\n" +"\n" +"Please do not mess up this text!\n" +"--------------------------------\n" +" I have indented it\n" +" exactly the way\n" +" I want it\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" #: ../../library/argparse.rst:337 msgid "" @@ -956,7 +986,7 @@ msgstr "" #: ../../library/argparse.rst:572 msgid "The add_argument() method" -msgstr "" +msgstr "add_argument() 方法" #: ../../library/argparse.rst:578 msgid "" @@ -1026,7 +1056,7 @@ msgstr "" #: ../../library/argparse.rst:616 msgid "name or flags" -msgstr "" +msgstr "name or flags" #: ../../library/argparse.rst:618 msgid "" @@ -1086,7 +1116,7 @@ msgstr "" #: ../../library/argparse.rst:651 msgid "action" -msgstr "" +msgstr "action" #: ../../library/argparse.rst:653 msgid "" @@ -1499,7 +1529,7 @@ msgstr "" #: ../../library/argparse.rst:887 msgid "const" -msgstr "" +msgstr "const" #: ../../library/argparse.rst:889 msgid "" @@ -1537,7 +1567,7 @@ msgstr "" #: ../../library/argparse.rst:915 msgid "default" -msgstr "" +msgstr "default" #: ../../library/argparse.rst:917 msgid "" @@ -1658,7 +1688,7 @@ msgstr "" #: ../../library/argparse.rst:978 msgid "type" -msgstr "" +msgstr "type" #: ../../library/argparse.rst:980 msgid "" @@ -1777,7 +1807,7 @@ msgstr "" #: ../../library/argparse.rst:1050 msgid "choices" -msgstr "" +msgstr "choices" #: ../../library/argparse.rst:1052 msgid "" @@ -1837,7 +1867,7 @@ msgstr "" #: ../../library/argparse.rst:1086 msgid "required" -msgstr "" +msgstr "required" #: ../../library/argparse.rst:1088 msgid "" @@ -1880,7 +1910,7 @@ msgstr "" #: ../../library/argparse.rst:1114 msgid "help" -msgstr "幫助" +msgstr "help" #: ../../library/argparse.rst:1116 msgid "" @@ -2151,7 +2181,7 @@ msgstr "" #: ../../library/argparse.rst:1264 msgid "deprecated" -msgstr "" +msgstr "deprecated" #: ../../library/argparse.rst:1266 msgid "" @@ -2186,7 +2216,7 @@ msgstr "" #: ../../library/argparse.rst:1289 msgid "Action classes" -msgstr "" +msgstr "Action 類別" #: ../../library/argparse.rst:1291 msgid "" @@ -2403,6 +2433,24 @@ msgid "" "usage: PROG [-h] [--foo FOO] [bar]\n" "PROG: error: extra arguments found: badger" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo', type=int)\n" +">>> parser.add_argument('bar', nargs='?')\n" +"\n" +">>> # 無效型別\n" +">>> parser.parse_args(['--foo', 'spam'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: argument --foo: invalid int value: 'spam'\n" +"\n" +">>> # 無效選項\n" +">>> parser.parse_args(['--bar'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: no such option: --bar\n" +"\n" +">>> # 錯誤引數數量\n" +">>> parser.parse_args(['spam', 'badger'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: extra arguments found: badger" #: ../../library/argparse.rst:1428 msgid "Arguments containing ``-``" @@ -2477,7 +2525,7 @@ msgstr "" #: ../../library/argparse.rst:1482 msgid "Argument abbreviations (prefix matching)" -msgstr "" +msgstr "引數縮寫 (前綴匹配)" #: ../../library/argparse.rst:1484 msgid "" @@ -2620,7 +2668,7 @@ msgstr "" #: ../../library/argparse.rst:1563 msgid "Sub-commands" -msgstr "" +msgstr "子命令" #: ../../library/argparse.rst:1570 msgid "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index dba9cad94d..d668319414 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -229,8 +229,8 @@ msgid "" "and then exit." msgstr "" "如果在呼叫 :meth:`run_forever` 之前呼叫 :meth:`stop`,則迴圈將使用超時為零的" -"方式輪詢 I/O 選擇器,運行所有回應 I/O 事件(以及已經排程的事件)的回呼函數," -"然後退出。" +"方式輪詢 I/O 選擇器,運行所有回應 I/O 事件(以及已經排程的事件)的回呼,然後" +"退出。" #: ../../library/asyncio-eventloop.rst:134 msgid "" diff --git a/library/cmdlinelibs.po b/library/cmdlinelibs.po index c3f4611a88..74afa150da 100644 --- a/library/cmdlinelibs.po +++ b/library/cmdlinelibs.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -11,7 +10,8 @@ msgstr "" "POT-Creation-Date: 2024-12-29 11:18+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,14 +19,14 @@ msgstr "" #: ../../library/cmdlinelibs.rst:5 msgid "Command Line Interface Libraries" -msgstr "" +msgstr "命令列介面函式庫" #: ../../library/cmdlinelibs.rst:7 msgid "" "The modules described in this chapter assist with implementing command line " "and terminal interfaces for applications." -msgstr "" +msgstr "本章節所描述的模組協助實作應用程式的命令列與終端介面。" #: ../../library/cmdlinelibs.rst:10 msgid "Here's an overview:" -msgstr "" +msgstr "以下為概覽:" diff --git a/library/csv.po b/library/csv.po index 05f0cd536c..afc879deaf 100644 --- a/library/csv.po +++ b/library/csv.po @@ -486,7 +486,7 @@ msgid "" "Twenty rows after the first row are sampled; if more than half of columns + " "rows meet the criteria, :const:`True` is returned." msgstr "" -"對第一列之後的二十個列進行採樣;如果超過一半的行及列滿足條件,則返回 :const:" +"對第一列之後的二十個列進行取樣;如果超過一半的行及列滿足條件,則返回 :const:" "`True`。" #: ../../library/csv.rst:302 diff --git a/library/enum.po b/library/enum.po index 6abaf380f4..285fdae837 100644 --- a/library/enum.po +++ b/library/enum.po @@ -238,13 +238,12 @@ msgstr "" "對如何處理非法值做更細微的控制。" #: ../../library/enum.rst:113 -#, fuzzy msgid ":class:`EnumDict`" -msgstr ":class:`Enum`" +msgstr ":class:`EnumDict`" #: ../../library/enum.rst:115 msgid "A subclass of :class:`dict` for use when subclassing :class:`EnumType`." -msgstr "" +msgstr ":class:`dict` 的子類別,用於當作 :class:`EnumType` 的子類別時使用。" #: ../../library/enum.rst:117 msgid ":class:`auto`" @@ -342,7 +341,7 @@ msgstr "" #: ../../library/enum.rst:159 msgid "``EnumDict``" -msgstr "" +msgstr "``EnumDict``" #: ../../library/enum.rst:164 msgid "Data Types" @@ -1505,6 +1504,10 @@ msgid "" "created, otherwise private names and internal classes will not be handled " "correctly." msgstr "" +"*EnumDict* 是 :class:`dict` 的子類別,用來作為定義列舉類別的命名空間(參見 :" +"ref:`prepare`)。它被公開來使得 :class:`EnumType` 的子類別能具有進階行為,例" +"如讓每個成員有多個值。它應該在被呼叫時帶上正在建立的列舉類別名稱,否則私有名" +"稱和內部類別將無法被正確處理。" #: ../../library/enum.rst:840 msgid "" @@ -1513,11 +1516,13 @@ msgid "" "possible to bypass the checks using other :class:`!dict` operations like :" "meth:`|= `." msgstr "" +"注意只有 :class:`~collections.abc.MutableMapping` 介面(:meth:`~object." +"__setitem__` 和 :meth:`~dict.update`)被覆寫。可能可以使用其他 :class:`!" +"dict` 操作來繞過檢查,例如 :meth:`|= `。" #: ../../library/enum.rst:847 -#, fuzzy msgid "A list of member names." -msgstr "一個之前值的串列。" +msgstr "一個成員名稱的串列。" #: ../../library/enum.rst:854 msgid "Supported ``__dunder__`` names" @@ -1622,8 +1627,8 @@ msgstr "" msgid "" "``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_" msgstr "" -"``_repr_*``(例如 ``_repr_html_``),例如用於 `IPython 的豐富顯示 `_" +"``_repr_*``\\ (例如 ``_repr_html_``),例如用於 `IPython 的豐富顯示 " +"`_" #: ../../library/enum.rst:896 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" diff --git a/library/filesys.po b/library/filesys.po index c591fe4685..9c42ea3858 100644 --- a/library/filesys.po +++ b/library/filesys.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: diff --git a/library/getopt.po b/library/getopt.po index 8051f0ed20..f9d84aca9d 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -55,7 +55,7 @@ msgstr "" #: ../../library/getopt.rst:33 msgid "This module provides two functions and an exception:" -msgstr "" +msgstr "這個模組提供兩個函式和一個例外:" #: ../../library/getopt.rst:39 msgid "" @@ -129,11 +129,11 @@ msgstr "" #: ../../library/getopt.rst:98 msgid "Alias for :exc:`GetoptError`; for backward compatibility." -msgstr "" +msgstr "為了向後相容性而設的 :exc:`GetoptError` 別名。" #: ../../library/getopt.rst:100 msgid "An example using only Unix style options:" -msgstr "" +msgstr "一個僅使用 Unix 風格選項的範例:" #: ../../library/getopt.rst:102 msgid "" @@ -159,7 +159,7 @@ msgstr "" #: ../../library/getopt.rst:114 msgid "Using long option names is equally easy:" -msgstr "" +msgstr "使用長選項名稱同樣容易:" #: ../../library/getopt.rst:116 msgid "" @@ -191,10 +191,9 @@ msgstr "" #: ../../library/getopt.rst:129 msgid "In a script, typical usage is something like this:" -msgstr "" +msgstr "在腳本中,典型的用法如下:" #: ../../library/getopt.rst:131 -#, fuzzy msgid "" "import getopt, sys\n" "\n" @@ -248,7 +247,7 @@ msgstr "" " output = a\n" " else:\n" " assert False, \"unhandled option\"\n" -" # ...\n" +" process(args, output=output, verbose=verbose)\n" "\n" "if __name__ == \"__main__\":\n" " main()" @@ -271,6 +270,14 @@ msgid "" " opts, args = parser.parse_args()\n" " process(args, output=opts.output, verbose=opts.verbose)" msgstr "" +"import optparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = optparse.OptionParser()\n" +" parser.add_option('-o', '--output')\n" +" parser.add_option('-v', dest='verbose', action='store_true')\n" +" opts, args = parser.parse_args()\n" +" process(args, output=opts.output, verbose=opts.verbose)" #: ../../library/getopt.rst:174 msgid "" @@ -290,6 +297,15 @@ msgid "" " args = parser.parse_args()\n" " process(args.rest, output=args.output, verbose=args.verbose)" msgstr "" +"import argparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-o', '--output')\n" +" parser.add_argument('-v', dest='verbose', action='store_true')\n" +" parser.add_argument('rest', nargs='*')\n" +" args = parser.parse_args()\n" +" process(args.rest, output=args.output, verbose=args.verbose)" #: ../../library/getopt.rst:189 msgid "" @@ -297,15 +313,16 @@ msgid "" "version of this code differs in behaviour from the ``optparse`` (and " "``getopt``) version." msgstr "" +"參見 :ref:`choosing-an-argument-parser` 以瞭解這段程式碼的 ``argparse`` 版本" +"與 ``optparse``\\(以及 ``getopt``)版本在行為上的差異。" #: ../../library/getopt.rst:195 -#, fuzzy msgid "Module :mod:`optparse`" -msgstr ":mod:`argparse` 模組" +msgstr ":mod:`optparse` 模組" #: ../../library/getopt.rst:196 msgid "Declarative command line option parsing." -msgstr "" +msgstr "宣告式命令列選項剖析。" #: ../../library/getopt.rst:198 msgid "Module :mod:`argparse`" diff --git a/library/io.po b/library/io.po index feecd18d50..22a257e59f 100644 --- a/library/io.po +++ b/library/io.po @@ -345,7 +345,7 @@ msgid "" "This is a helper function for callables that use :func:`open` or :class:" "`TextIOWrapper` and have an ``encoding=None`` parameter." msgstr "" -"這是個輔助函數,適用於使用 :func:`open` 或 :class:`TextIOWrapper` 且具有 " +"這是個輔助函式,適用於使用 :func:`open` 或 :class:`TextIOWrapper` 且具有 " "``encoding=None`` 參數的可呼叫物件。" #: ../../library/io.rst:203 diff --git a/library/json.po b/library/json.po index a910b316ff..76e792b8cb 100644 --- a/library/json.po +++ b/library/json.po @@ -1153,7 +1153,7 @@ msgid "" "The :mod:`json.tool` module provides a simple command line interface to " "validate and pretty-print JSON objects." msgstr "" -":mod:`json.tool` 模組提供了一個簡易的命令列界面以供校驗與美化呈現 JSON 物件。" +":mod:`json.tool` 模組提供了一個簡易的命令列介面以供校驗與美化呈現 JSON 物件。" #: ../../library/json.rst:694 msgid "" diff --git a/library/optparse.po b/library/optparse.po index c188fa875f..b23b142f75 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -28,11 +27,11 @@ msgstr "**原始碼:**\\ :source:`Lib/optparse.py`" #: ../../library/optparse.rst:17 msgid "Choosing an argument parsing library" -msgstr "" +msgstr "選擇一個命令列參數剖析函式庫" #: ../../library/optparse.rst:19 msgid "The standard library includes three argument parsing libraries:" -msgstr "" +msgstr "標準函式庫包含三個命令列引數剖析函式庫:" #: ../../library/optparse.rst:21 msgid "" @@ -139,6 +138,14 @@ msgid "" " opts, args = parser.parse_args()\n" " process(args, output=opts.output, verbose=opts.verbose)" msgstr "" +"import optparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = optparse.OptionParser()\n" +" parser.add_option('-o', '--output')\n" +" parser.add_option('-v', dest='verbose', action='store_true')\n" +" opts, args = parser.parse_args()\n" +" process(args, output=opts.output, verbose=opts.verbose)" #: ../../library/optparse.rst:77 msgid "" @@ -152,6 +159,15 @@ msgid "" " args = parser.parse_args()\n" " process(args.rest, output=args.output, verbose=args.verbose)" msgstr "" +"import argparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-o', '--output')\n" +" parser.add_argument('-v', dest='verbose', action='store_true')\n" +" parser.add_argument('rest', nargs='*')\n" +" args = parser.parse_args()\n" +" process(args.rest, output=args.output, verbose=args.verbose)" #: ../../library/optparse.rst:89 msgid "" @@ -245,6 +261,16 @@ msgid "" "\n" "(options, args) = parser.parse_args()" msgstr "" +"from optparse import OptionParser\n" +"...\n" +"parser = OptionParser()\n" +"parser.add_option(\"-f\", \"--file\", dest=\"filename\",\n" +" help=\"write report to FILE\", metavar=\"FILE\")\n" +"parser.add_option(\"-q\", \"--quiet\",\n" +" action=\"store_false\", dest=\"verbose\", default=True,\n" +" help=\"don't print status messages to stdout\")\n" +"\n" +"(options, args) = parser.parse_args()" #: ../../library/optparse.rst:150 msgid "" @@ -254,7 +280,7 @@ msgstr "" #: ../../library/optparse.rst:153 msgid " --file=outfile -q" -msgstr "" +msgstr " --file=outfile -q" #: ../../library/optparse.rst:155 msgid "" @@ -286,6 +312,8 @@ msgid "" " -h\n" " --help" msgstr "" +" -h\n" +" --help" #: ../../library/optparse.rst:174 msgid "" @@ -301,6 +329,12 @@ msgid "" " -f FILE, --file=FILE write report to FILE\n" " -q, --quiet don't print status messages to stdout" msgstr "" +"Usage: [options]\n" +"\n" +"Options:\n" +" -h, --help show this help message and exit\n" +" -f FILE, --file=FILE write report to FILE\n" +" -q, --quiet don't print status messages to stdout" #: ../../library/optparse.rst:185 msgid "" @@ -329,7 +363,7 @@ msgstr "術語" #: ../../library/optparse.rst:207 msgid "argument" -msgstr "" +msgstr "引數" #: ../../library/optparse.rst:208 msgid "" @@ -349,7 +383,7 @@ msgstr "" #: ../../library/optparse.rst:218 msgid "option" -msgstr "" +msgstr "選項" #: ../../library/optparse.rst:219 msgid "" @@ -402,7 +436,7 @@ msgstr "" #: ../../library/optparse.rst:248 msgid "option argument" -msgstr "" +msgstr "選項引數" #: ../../library/optparse.rst:249 msgid "" @@ -417,6 +451,8 @@ msgid "" "-f foo\n" "--file foo" msgstr "" +"-f foo\n" +"--file foo" #: ../../library/optparse.rst:259 msgid "or included in the same argument:" @@ -427,6 +463,8 @@ msgid "" "-ffoo\n" "--file=foo" msgstr "" +"-ffoo\n" +"--file=foo" #: ../../library/optparse.rst:266 msgid "" @@ -441,7 +479,7 @@ msgstr "" #: ../../library/optparse.rst:274 msgid "positional argument" -msgstr "" +msgstr "位置引數" #: ../../library/optparse.rst:275 msgid "" @@ -468,7 +506,7 @@ msgstr "" #: ../../library/optparse.rst:287 msgid "prog -v --report report.txt foo bar" -msgstr "" +msgstr "prog -v --report report.txt foo bar" #: ../../library/optparse.rst:289 msgid "" @@ -515,6 +553,8 @@ msgid "" "cp SOURCE DEST\n" "cp SOURCE ... DEST-DIR" msgstr "" +"cp SOURCE DEST\n" +"cp SOURCE ... DEST-DIR" #: ../../library/optparse.rst:321 msgid "" @@ -583,6 +623,9 @@ msgid "" "...\n" "parser = OptionParser()" msgstr "" +"from optparse import OptionParser\n" +"...\n" +"parser = OptionParser()" #: ../../library/optparse.rst:371 msgid "Then you can start defining options. The basic syntax is::" @@ -593,6 +636,8 @@ msgid "" "parser.add_option(opt_str, ...,\n" " attr=value, ...)" msgstr "" +"parser.add_option(opt_str, ...,\n" +" attr=value, ...)" #: ../../library/optparse.rst:376 msgid "" @@ -609,7 +654,7 @@ msgstr "" #: ../../library/optparse.rst:383 msgid "parser.add_option(\"-f\", \"--file\", ...)" -msgstr "" +msgstr "parser.add_option(\"-f\", \"--file\", ...)" #: ../../library/optparse.rst:385 msgid "" @@ -634,7 +679,7 @@ msgstr "" #: ../../library/optparse.rst:398 msgid "(options, args) = parser.parse_args()" -msgstr "" +msgstr "(options, args) = parser.parse_args()" #: ../../library/optparse.rst:400 msgid "" @@ -707,6 +752,8 @@ msgid "" "parser.add_option(\"-f\", \"--file\",\n" " action=\"store\", type=\"string\", dest=\"filename\")" msgstr "" +"parser.add_option(\"-f\", \"--file\",\n" +" action=\"store\", type=\"string\", dest=\"filename\")" #: ../../library/optparse.rst:447 msgid "" @@ -718,6 +765,8 @@ msgid "" "args = [\"-f\", \"foo.txt\"]\n" "(options, args) = parser.parse_args(args)" msgstr "" +"args = [\"-f\", \"foo.txt\"]\n" +"(options, args) = parser.parse_args(args)" #: ../../library/optparse.rst:452 msgid "" @@ -735,7 +784,7 @@ msgstr "" #: ../../library/optparse.rst:459 msgid "parser.add_option(\"-n\", type=\"int\", dest=\"num\")" -msgstr "" +msgstr "parser.add_option(\"-n\", type=\"int\", dest=\"num\")" #: ../../library/optparse.rst:461 msgid "" @@ -755,10 +804,12 @@ msgid "" "(options, args) = parser.parse_args([\"-n42\"])\n" "print(options.num)" msgstr "" +"(options, args) = parser.parse_args([\"-n42\"])\n" +"print(options.num)" #: ../../library/optparse.rst:471 msgid "will print ``42``." -msgstr "" +msgstr "會印出 ``42``。" #: ../../library/optparse.rst:473 msgid "" @@ -769,7 +820,7 @@ msgstr "" #: ../../library/optparse.rst:477 msgid "parser.add_option(\"-f\", \"--file\", dest=\"filename\")" -msgstr "" +msgstr "parser.add_option(\"-f\", \"--file\", dest=\"filename\")" #: ../../library/optparse.rst:479 msgid "" @@ -803,6 +854,8 @@ msgid "" "parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\")\n" "parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\")" msgstr "" +"parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\")\n" +"parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\")" #: ../../library/optparse.rst:502 msgid "" @@ -866,7 +919,7 @@ msgstr "" #: ../../library/optparse.rst:537 msgid "Default values" -msgstr "" +msgstr "預設值" #: ../../library/optparse.rst:539 msgid "" @@ -890,6 +943,9 @@ msgid "" "default=True)\n" "parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\")" msgstr "" +"parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\", " +"default=True)\n" +"parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\")" #: ../../library/optparse.rst:552 msgid "" @@ -916,6 +972,10 @@ msgid "" "parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\", " "default=True)" msgstr "" +"parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\", " +"default=False)\n" +"parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\", " +"default=True)" #: ../../library/optparse.rst:564 msgid "" @@ -936,6 +996,9 @@ msgid "" "parser.add_option(...)\n" "(options, args) = parser.parse_args()" msgstr "" +"parser.set_defaults(verbose=True)\n" +"parser.add_option(...)\n" +"(options, args) = parser.parse_args()" #: ../../library/optparse.rst:575 msgid "" @@ -974,6 +1037,20 @@ msgid "" " help=\"interaction mode: novice, intermediate, \"\n" " \"or expert [default: %default]\")" msgstr "" +"usage = \"usage: %prog [options] arg1 arg2\"\n" +"parser = OptionParser(usage=usage)\n" +"parser.add_option(\"-v\", \"--verbose\",\n" +" action=\"store_true\", dest=\"verbose\", default=True,\n" +" help=\"make lots of noise [default]\")\n" +"parser.add_option(\"-q\", \"--quiet\",\n" +" action=\"store_false\", dest=\"verbose\",\n" +" help=\"be vewwy quiet (I'm hunting wabbits)\")\n" +"parser.add_option(\"-f\", \"--filename\",\n" +" metavar=\"FILE\", help=\"write output to FILE\")\n" +"parser.add_option(\"-m\", \"--mode\",\n" +" default=\"intermediate\",\n" +" help=\"interaction mode: novice, intermediate, \"\n" +" \"or expert [default: %default]\")" #: ../../library/optparse.rst:606 msgid "" @@ -995,6 +1072,16 @@ msgid "" " -m MODE, --mode=MODE interaction mode: novice, intermediate, or\n" " expert [default: intermediate]" msgstr "" +"Usage: [options] arg1 arg2\n" +"\n" +"Options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbose make lots of noise [default]\n" +" -q, --quiet be vewwy quiet (I'm hunting wabbits)\n" +" -f FILE, --filename=FILE\n" +" write output to FILE\n" +" -m MODE, --mode=MODE interaction mode: novice, intermediate, or\n" +" expert [default: intermediate]" #: ../../library/optparse.rst:623 msgid "" @@ -1014,7 +1101,7 @@ msgstr "" #: ../../library/optparse.rst:631 msgid "usage = \"usage: %prog [options] arg1 arg2\"" -msgstr "" +msgstr "usage = \"usage: %prog [options] arg1 arg2\"" #: ../../library/optparse.rst:633 msgid "" @@ -1045,7 +1132,7 @@ msgstr "" #: ../../library/optparse.rst:648 msgid "-m MODE, --mode=MODE" -msgstr "" +msgstr "-m MODE, --mode=MODE" #: ../../library/optparse.rst:650 msgid "" @@ -1059,7 +1146,7 @@ msgstr "" #: ../../library/optparse.rst:657 msgid "-f FILE, --filename=FILE" -msgstr "" +msgstr "-f FILE, --filename=FILE" #: ../../library/optparse.rst:659 msgid "" @@ -1138,6 +1225,11 @@ msgid "" "group.add_option(\"-g\", action=\"store_true\", help=\"Group option.\")\n" "parser.add_option_group(group)" msgstr "" +"group = OptionGroup(parser, \"Dangerous Options\",\n" +" \"Caution: use these options at your own risk. \"\n" +" \"It is believed that some of them bite.\")\n" +"group.add_option(\"-g\", action=\"store_true\", help=\"Group option.\")\n" +"parser.add_option_group(group)" #: ../../library/optparse.rst:704 msgid "This would result in the following help output:" @@ -1162,6 +1254,22 @@ msgid "" "\n" " -g Group option." msgstr "" +"Usage: [options] arg1 arg2\n" +"\n" +"Options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbose make lots of noise [default]\n" +" -q, --quiet be vewwy quiet (I'm hunting wabbits)\n" +" -f FILE, --filename=FILE\n" +" write output to FILE\n" +" -m MODE, --mode=MODE interaction mode: novice, intermediate, or\n" +" expert [default: intermediate]\n" +"\n" +" Dangerous Options:\n" +" Caution: use these options at your own risk. It is believed that some\n" +" of them bite.\n" +"\n" +" -g Group option." #: ../../library/optparse.rst:725 msgid "" @@ -1186,6 +1294,20 @@ msgid "" "done\")\n" "parser.add_option_group(group)" msgstr "" +"group = OptionGroup(parser, \"Dangerous Options\",\n" +" \"Caution: use these options at your own risk. \"\n" +" \"It is believed that some of them bite.\")\n" +"group.add_option(\"-g\", action=\"store_true\", help=\"Group option.\")\n" +"parser.add_option_group(group)\n" +"\n" +"group = OptionGroup(parser, \"Debug Options\")\n" +"group.add_option(\"-d\", \"--debug\", action=\"store_true\",\n" +" help=\"Print debug information\")\n" +"group.add_option(\"-s\", \"--sql\", action=\"store_true\",\n" +" help=\"Print all SQL statements executed\")\n" +"group.add_option(\"-e\", action=\"store_true\", help=\"Print every action " +"done\")\n" +"parser.add_option_group(group)" #: ../../library/optparse.rst:742 msgid "that results in the following output:" @@ -1215,6 +1337,27 @@ msgid "" " -s, --sql Print all SQL statements executed\n" " -e Print every action done" msgstr "" +"Usage: [options] arg1 arg2\n" +"\n" +"Options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbose make lots of noise [default]\n" +" -q, --quiet be vewwy quiet (I'm hunting wabbits)\n" +" -f FILE, --filename=FILE\n" +" write output to FILE\n" +" -m MODE, --mode=MODE interaction mode: novice, intermediate, or expert\n" +" [default: intermediate]\n" +"\n" +" Dangerous Options:\n" +" Caution: use these options at your own risk. It is believed that some\n" +" of them bite.\n" +"\n" +" -g Group option.\n" +"\n" +" Debug Options:\n" +" -d, --debug Print debug information\n" +" -s, --sql Print all SQL statements executed\n" +" -e Print every action done" #: ../../library/optparse.rst:768 msgid "" @@ -1243,6 +1386,7 @@ msgstr "" #: ../../library/optparse.rst:786 msgid "parser = OptionParser(usage=\"%prog [-f] [-q]\", version=\"%prog 1.0\")" msgstr "" +"parser = OptionParser(usage=\"%prog [-f] [-q]\", version=\"%prog 1.0\")" #: ../../library/optparse.rst:788 msgid "" @@ -1262,6 +1406,8 @@ msgid "" "$ /usr/bin/foo --version\n" "foo 1.0" msgstr "" +"$ /usr/bin/foo --version\n" +"foo 1.0" #: ../../library/optparse.rst:801 msgid "" @@ -1315,6 +1461,10 @@ msgid "" "if options.a and options.b:\n" " parser.error(\"options -a and -b are mutually exclusive\")" msgstr "" +"(options, args) = parser.parse_args()\n" +"...\n" +"if options.a and options.b:\n" +" parser.error(\"options -a and -b are mutually exclusive\")" #: ../../library/optparse.rst:841 msgid "" @@ -1336,6 +1486,10 @@ msgid "" "\n" "foo: error: option -n: invalid integer value: '4x'" msgstr "" +"$ /usr/bin/foo -n 4x\n" +"Usage: foo [options]\n" +"\n" +"foo: error: option -n: invalid integer value: '4x'" #: ../../library/optparse.rst:855 msgid "Or, where the user fails to pass a value at all:" @@ -1348,6 +1502,10 @@ msgid "" "\n" "foo: error: -n option requires an argument" msgstr "" +"$ /usr/bin/foo -n\n" +"Usage: foo [options]\n" +"\n" +"foo: error: -n option requires an argument" #: ../../library/optparse.rst:864 msgid "" @@ -1395,6 +1553,27 @@ msgid "" "if __name__ == \"__main__\":\n" " main()" msgstr "" +"from optparse import OptionParser\n" +"...\n" +"def main():\n" +" usage = \"usage: %prog [options] arg\"\n" +" parser = OptionParser(usage)\n" +" parser.add_option(\"-f\", \"--file\", dest=\"filename\",\n" +" help=\"read data from FILENAME\")\n" +" parser.add_option(\"-v\", \"--verbose\",\n" +" action=\"store_true\", dest=\"verbose\")\n" +" parser.add_option(\"-q\", \"--quiet\",\n" +" action=\"store_false\", dest=\"verbose\")\n" +" ...\n" +" (options, args) = parser.parse_args()\n" +" if len(args) != 1:\n" +" parser.error(\"incorrect number of arguments\")\n" +" if options.verbose:\n" +" print(\"reading %s...\" % options.filename)\n" +" ...\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" #: ../../library/optparse.rst:906 msgid "Reference Guide" @@ -1562,6 +1741,13 @@ msgid "" " ]\n" "parser = OptionParser(option_list=option_list)" msgstr "" +"option_list = [\n" +" make_option(\"-f\", \"--filename\",\n" +" action=\"store\", type=\"string\", dest=\"filename\"),\n" +" make_option(\"-q\", \"--quiet\",\n" +" action=\"store_false\", dest=\"verbose\"),\n" +" ]\n" +"parser = OptionParser(option_list=option_list)" #: ../../library/optparse.rst:998 msgid "" @@ -1574,7 +1760,7 @@ msgstr "" #: ../../library/optparse.rst:1007 msgid "Defining options" -msgstr "" +msgstr "定義選項" #: ../../library/optparse.rst:1009 msgid "" @@ -1595,7 +1781,7 @@ msgstr "" #: ../../library/optparse.rst:1021 msgid "parser.add_option(\"-f\", attr=value, ...)" -msgstr "" +msgstr "parser.add_option(\"-f\", attr=value, ...)" #: ../../library/optparse.rst:1023 msgid "And to define an option with only a long option string::" @@ -1603,7 +1789,7 @@ msgstr "" #: ../../library/optparse.rst:1025 msgid "parser.add_option(\"--foo\", attr=value, ...)" -msgstr "" +msgstr "parser.add_option(\"--foo\", attr=value, ...)" #: ../../library/optparse.rst:1027 msgid "" @@ -1755,7 +1941,7 @@ msgstr "" #: ../../library/optparse.rst:1114 msgid "Option attributes" -msgstr "" +msgstr "選項屬性" #: ../../library/optparse.rst:1118 msgid "" diff --git a/library/os.path.po b/library/os.path.po index 2019487b8c..9518aa11e3 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -38,7 +38,7 @@ msgid "" "object implementing the :class:`os.PathLike` protocol." msgstr "" "該模組實現了一些有用的路徑名操作函式。若要讀取或寫入檔案,請參閱 :func:" -"`open` 函數,要存取檔案系統,請參閱 :mod:`os` 模組。路徑參數可以以字串、位元" +"`open` 函式,要存取檔案系統,請參閱 :mod:`os` 模組。路徑參數可以以字串、位元" "組或任何依照 :class:`os.PathLike` 協議實作的物件傳遞。" #: ../../library/os.path.rst:19 @@ -62,7 +62,7 @@ msgid "" "their parameters. The result is an object of the same type, if a path or " "file name is returned." msgstr "" -"所有這些函數都只接受位元組或字串物件作為參數。如果回傳的是路徑或檔案名稱,結" +"所有這些函式都只接受位元組或字串物件作為參數。如果回傳的是路徑或檔案名稱,結" "果將是相同型別的物件。" #: ../../library/os.path.rst:37 diff --git a/library/pickle.po b/library/pickle.po index 4846877e33..111cb91b47 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -562,9 +562,9 @@ msgid "" "class:`io.BytesIO` instance, or any other custom object that meets this " "interface." msgstr "" -"傳予引數 *file* 的物件必須支援可寫入單一位元組的 write() 方法。只要滿足此條" -"件,傳入的物件可以是一個硬碟上二進位檔案、一個 :class:`io.BytesIO` 實例或任何" -"其他滿足這個介面要求的物件。" +"引數 *file* 必須支援可寫入單一位元組引數的 write() 方法。只要滿足此條件,傳入" +"的物件可以是一個硬碟上二進位檔案、一個 :class:`io.BytesIO` 實例或任何其他滿足" +"這個介面要求的物件。" #: ../../library/pickle.rst:313 msgid "" @@ -585,8 +585,8 @@ msgid "" "If *buffer_callback* is ``None`` (the default), buffer views are serialized " "into *file* as part of the pickle stream." msgstr "" -"如果 *buffer_callback* 是 ``None`` (預設值),緩衝區的視圖會作為 pickle 封裝" -"串流的一部分被序列化進 *file* 中。" +"如果 *buffer_callback* 是 ``None``\\ (預設值),緩衝區的視圖會作為 pickle 封" +"裝串流的一部分被序列化進 *file* 中。" #: ../../library/pickle.rst:320 msgid "" @@ -658,10 +658,10 @@ msgid "" "reduction function takes a single argument of the associated class and " "should conform to the same interface as a :meth:`~object.__reduce__` method." msgstr "" -"封裝器(pickler)物件含有的的調度表是一個 *縮減函式* (reduction function)的" -"註冊表,可以使用 :func:`copyreg.pickle` 來宣告這類縮減函式。它是一個以類別為" -"鍵、還原函式為值的映射表。縮減函式應準備接收一個對應類別的引數,並應遵循與 :" -"meth:`~object.__reduce__` 方法相同的介面。" +"封裝器(pickler)物件含有的的調度表是一個\\ *縮減函式*\\ (reduction " +"function)的註冊表,可以使用 :func:`copyreg.pickle` 來宣告這類縮減函式。它是" +"一個以類別為鍵、還原函式為值的映射表。縮減函式應準備接收一個對應類別的引數," +"並應遵循與 :meth:`~object.__reduce__` 方法相同的介面。" #: ../../library/pickle.rst:362 msgid "" @@ -693,7 +693,7 @@ msgid "" msgstr "" "一個可以在 :class:`Pickler` 子類別中被定義的縮減器(reducer)。這個方法的優先" "度高於任何其他 :attr:`分派表 ` 中的縮減器。他應該要有和 :" -"meth:`~object.__reduce__` 方法相同的函數界面,且可以可選地回傳 :data:" +"meth:`~object.__reduce__` 方法相同的函式介面,且可以可選地回傳 :data:" "`NotImplemented` 以退回(fallback)使用 :attr:`分派表 ` 中登" "錄的縮減方法來封裝 ``obj``。" @@ -782,7 +782,7 @@ msgid "" msgstr "" "如果 *buffers* 不是 ``None``,則其應該是一個可疊代物件,內含數個支援緩衝區的" "物件,並且每當 pickle 串流引用一個\\ :ref:`帶外 `\\ 緩衝區視圖時" -"將會被照順序消耗。這些緩衝資料當初建立時應已按照順序給定予 Pickler 物件中的 " +"將會被照順序消耗。這些緩衝資料當初建立時應已按照順序給定於 Pickler 物件中的 " "*buffer_callback*。" #: ../../library/pickle.rst:438 @@ -796,7 +796,7 @@ msgstr "" #: ../../library/pickle.rst:445 msgid "Raise an :exc:`UnpicklingError` by default." -msgstr "預設會拋出 :exc:`UnpicklingError` 例外。" +msgstr "預設會引發 :exc:`UnpicklingError` 例外。" #: ../../library/pickle.rst:447 msgid "" @@ -820,7 +820,7 @@ msgid "" "unlike its name suggests, :meth:`find_class` is also used for finding " "functions." msgstr "" -"如有需要將引入 *module* ,並從中返回名為 *name* 的物件,這裡的 *module* 和 " +"如有需要將引入 *module* ,並從中回傳名為 *name* 的物件,這裡的 *module* 和 " "*name* 引數接受的輸入是 :class:`str` 物件。注意,雖然名稱上看起來不像,但 :" "meth:`find_class` 亦可被用於尋找其他函式。" @@ -850,7 +850,7 @@ msgid "" "`buffer-providing ` object, such as a :term:`bytes-like " "object` or a N-dimensional array." msgstr "" -"一個表示了含有可封裝數據緩衝區的包裝函數(wrapper function)。*buffer* 必須是" +"一個表示了含有可封裝資料緩衝區的包裝函式(wrapper function)。*buffer* 必須是" "一個 :ref:`提供緩衝區 ` 的物件,例如一個 :term:`類位元組物件 " "` 或 N 維陣列。" @@ -883,7 +883,7 @@ msgid "" "``B`` (unsigned bytes). :exc:`BufferError` is raised if the buffer is " "neither C- nor Fortran-contiguous." msgstr "" -"返回此緩衝區底層記憶體區域的 :class:`memoryview`。被返回的物件是一個(在 C 語" +"回傳此緩衝區底層記憶體區域的 :class:`memoryview`。被回傳的物件是一個(在 C 語" "言的 formatter 格式中)以 ``B`` (unsigned bytes) 二進位格式儲存、一維且列連續" "(C-contiguous)的 memoryview。如果緩衝區既不是列連續(C-contiguous)也不是行" "連續(Fortran-contiguous)的,則會引發 :exc:`BufferError`。" @@ -1016,7 +1016,7 @@ msgid "" msgstr "" "同樣地,當類別實例被封裝時,它所屬類別具有的程式碼和資料不會被一起封裝。只有" "實例資料本身會被封裝。這是有意而為的,因為如此你才可以在類別中修正錯誤或新增" -"其他方法,且於此同時仍能夠載入使用較早期版本的類別所建立的物件實例。如果您預" +"其他方法,且於此同時仍能夠載入使用較早期版本的類別所建立的物件實例。如果你預" "計將有長期存在的物件、且該物件將經歷許多版本的更替,你可以在物件中存放一個版" "本號,以便未來能透過 :meth:`~object.__setstate__` 方法來進行適當的版本轉換。" @@ -1131,7 +1131,7 @@ msgid "" "are several cases:" msgstr "" "目標類別可以透過覆寫方法 :meth:`__getstate__` 進一步影響其實例被封裝的方式。" -"封裝時,呼叫該方法所返回的物件將作為該實例的內容被封裝、而非一個預設狀態。以" +"封裝時,呼叫該方法所回傳的物件將作為該實例的內容被封裝、而非一個預設狀態。以" "下列出幾種預設狀態:" #: ../../library/pickle.rst:625 @@ -1195,7 +1195,7 @@ msgid "" "If :meth:`__reduce__` returns a state with value ``None`` at pickling, the :" "meth:`__setstate__` method will not be called upon unpickling." msgstr "" -"如果 :meth:`__reduce__` 在封裝時返回了 ``None`` 狀態,則拆封時就不會去呼叫 :" +"如果 :meth:`__reduce__` 在封裝時回傳了 ``None`` 狀態,則拆封時就不會去呼叫 :" "meth:`__setstate__`。" #: ../../library/pickle.rst:660 @@ -1274,14 +1274,14 @@ msgid "" "Optional items can either be omitted, or ``None`` can be provided as their " "value. The semantics of each item are in order:" msgstr "" -"當返回一個元組時,其長度必須介於兩至六項元素之間。可選項可以被省略,或者其值" +"當回傳一個元組時,其長度必須介於兩至六項元素之間。可選項可以被省略,或者其值" "可以被設為 ``None``。各項物件的語意依序為:" #: ../../library/pickle.rst:704 msgid "" "A callable object that will be called to create the initial version of the " "object." -msgstr "一個將會被呼叫來創建初始版本物件的可呼叫物件。" +msgstr "一個將會被呼叫來建立初始版本物件的可呼叫物件。" #: ../../library/pickle.rst:707 msgid "" @@ -1539,7 +1539,7 @@ msgstr "" "庫中的特定紀錄。\n" " return (\"MemoRecord\", obj.key)\n" " else:\n" -" # 如果 obj 沒有持久 ID,則返回 None。這表示 obj 像平常那樣封裝即" +" # 如果 obj 沒有持久 ID,則回傳 None。這表示 obj 像平常那樣封裝即" "可。\n" " return None\n" "\n" @@ -1556,13 +1556,13 @@ msgstr "" " cursor = self.connection.cursor()\n" " type_tag, key_id = pid\n" " if type_tag == \"MemoRecord\":\n" -" # 從資料庫中抓取所引用的紀錄並返回。\n" +" # 從資料庫中抓取所引用的紀錄並回傳。\n" " cursor.execute(\"SELECT * FROM memos WHERE key=?\", " "(str(key_id),))\n" " key, task = cursor.fetchone()\n" " return MemoRecord(key, task)\n" " else:\n" -" # 如果無法返回正確的物件,則必須拋出錯誤。\n" +" # 如果無法回傳正確的物件,則必須引發錯誤。\n" " # 否則 unpickler 會誤認為 None 是持久 ID 所引用的物件。\n" " raise pickle.UnpicklingError(\"unsupported persistent object\")\n" "\n" @@ -1628,7 +1628,7 @@ msgid "" "modified copy of :data:`!copyreg.dispatch_table` as a private dispatch table." msgstr "" "由 :mod:`copyreg` 模組管理的全域調度表可以 :data:`!copyreg.dispatch_table` 呼" -"叫。你可以透過這個方式來基於原始 :data:`!copyreg.dispatch_table` 創建一個修改" +"叫。你可以透過這個方式來基於原始 :data:`!copyreg.dispatch_table` 建立一個修改" "過的版本,作為你的專屬用途的調度表。" #: ../../library/pickle.rst:801 @@ -1816,7 +1816,7 @@ msgstr "" #: ../../library/pickle.rst:896 msgid "Custom Reduction for Types, Functions, and Other Objects" -msgstr "針對型別、函數或特定物件定製縮減函數" +msgstr "針對型別、函式或特定物件定製縮減函式" #: ../../library/pickle.rst:900 msgid "" @@ -1907,7 +1907,7 @@ msgstr "" "\n" "class MyPickler(pickle.Pickler):\n" " def reducer_override(self, obj):\n" -" \"\"\"MyClass 的自訂縮減函數。\"\"\"\n" +" \"\"\"MyClass 的自訂縮減函式。\"\"\"\n" " if getattr(obj, \"__name__\", None) == \"MyClass\":\n" " return type, (obj.__name__, obj.__bases__,\n" " {'my_attribute': obj.my_attribute})\n" @@ -1967,8 +1967,8 @@ msgid "" "for any large data." msgstr "" "要封裝的大型資料物件,則必須實作一個針對 5 版協定及以上的 :meth:`~object." -"__reduce_ex__` 方法,該方法應返回一個 :class:`PickleBuffer` 實例來處理任何大" -"型資料(而非返回如 :class:`bytes` 物件)。" +"__reduce_ex__` 方法,該方法應回傳一個 :class:`PickleBuffer` 實例來處理任何大" +"型資料(而非回傳如 :class:`bytes` 物件)。" #: ../../library/pickle.rst:980 msgid "" @@ -2002,8 +2002,8 @@ msgid "" "graph. Buffers accumulated by the *buffer_callback* will not see their data " "copied into the pickle stream, only a cheap marker will be inserted." msgstr "" -"傳送端需要傳遞一個調用緩衝區的回呼函數給 :class:`Pickler`\\ (或 :func:" -"`dump` 或 :func:`dumps` 函數)的 *buffer_callback* 引數,使每次生成 :class:" +"傳送端需要傳遞一個調用緩衝區的回呼函式給 :class:`Pickler`\\ (或 :func:" +"`dump` 或 :func:`dumps` 函式)的 *buffer_callback* 引數,使每次生成 :class:" "`PickleBuffer` 時,該物件在處理物件圖時能被呼叫。除了一個簡易標記以外,由 " "*buffer_callback* 累積的緩衝區資料不會被複製到 pickle 串流中。" @@ -2095,7 +2095,7 @@ msgid "" "providing object if it has the right type. This is an easy way to simulate " "zero-copy behaviour on this toy example." msgstr "" -"如果型別正確,重建器(``_reconstruct`` 類別方法)會返回當時提供緩衝區的物件。" +"如果型別正確,重建器(``_reconstruct`` 類別方法)會回傳當時提供緩衝區的物件。" "這個簡易實作可以模擬一個無複製行為的重建器。" #: ../../library/pickle.rst:1043 @@ -2125,7 +2125,7 @@ msgid "" "But if we pass a *buffer_callback* and then give back the accumulated " "buffers when unserializing, we are able to get back the original object::" msgstr "" -"但如果我們傳一個 *buffer_callback* 並在去序列化時正確返回積累的緩衝資料,我們" +"但如果我們傳一個 *buffer_callback* 並在去序列化時正確回傳積累的緩衝資料,我們" "就能拿回原始的物件:::" #: ../../library/pickle.rst:1055 @@ -2153,7 +2153,7 @@ msgid "" "making as few copies as possible) when transferring between distinct " "processes or systems." msgstr "" -"此範例是因為受限於 :class:`bytearray` 會自行分配記憶體:您無法創建以其他物件" +"此範例是因為受限於 :class:`bytearray` 會自行分配記憶體:你無法建立以其他物件" "的記憶體為基礎的 :class:`bytearray` 實例。不過第三方資料型態(如 NumPy 陣列)" "則可能沒有這個限制,而允許在不同程序或系統之間傳輸資料時使用零拷貝封裝(或儘" "可能地減少拷貝次數)。" @@ -2208,7 +2208,7 @@ msgid "" "requested. Thus it is possible to either completely forbid globals or " "restrict them to a safe subset." msgstr "" -"基於以上原因,您可能會希望透過自訂 :meth:`Unpickler.find_class` 來控制哪些是" +"基於以上原因,你可能會希望透過自訂 :meth:`Unpickler.find_class` 來控制哪些是" "能夠被拆封的內容。與其名稱字面意義暗示的不同,實際上每當你請求一個全域物件" "(例如,類別或函式)時,就會調用 :meth:`Unpickler.find_class`。因此,可以透過" "這個方法完全禁止全域物件或將其限制在安全的子集合。" @@ -2272,7 +2272,7 @@ msgstr "" " (module, name))\n" "\n" "def restricted_loads(s):\n" -" \"\"\"一個模擬 pickle.loads() 的輔助函數\"\"\"\n" +" \"\"\"一個模擬 pickle.loads() 的輔助函式\"\"\"\n" " return RestrictedUnpickler(io.BytesIO(s)).load()" #: ../../library/pickle.rst:1129 @@ -2314,8 +2314,8 @@ msgid "" "alternatives such as the marshalling API in :mod:`xmlrpc.client` or third-" "party solutions." msgstr "" -"正如我們的範例所示,必須謹慎審視能被拆封的內容。因此,如果您的應用場景非常關" -"心安全性,您可能需要考慮其他選擇,例如 :mod:`xmlrpc.client` 中的 marshalling " +"正如我們的範例所示,必須謹慎審視能被拆封的內容。因此,如果你的應用場景非常關" +"心安全性,你可能需要考慮其他選擇,例如 :mod:`xmlrpc.client` 中的 marshalling " "API 或其他第三方解決方案。" #: ../../library/pickle.rst:1155 @@ -2449,7 +2449,7 @@ msgid "" "The exception raised will likely be an :exc:`ImportError` or an :exc:" "`AttributeError` but it could be something else." msgstr "" -"拋出的例外應該是 :exc:`ImportError` 或 :exc:`AttributeError`,但也可能是其他" +"引發的例外應該是 :exc:`ImportError` 或 :exc:`AttributeError`,但也可能是其他" "例外。" #: ../../library/pickle.rst:1225 diff --git a/library/random.po b/library/random.po index 08679f4e90..a2417c7d11 100644 --- a/library/random.po +++ b/library/random.po @@ -41,7 +41,7 @@ msgid "" "replacement." msgstr "" "對於整數,可以從範圍中進行均勻選擇。對於序列,有一個隨機元素的均勻選擇,一個" -"用來原地 (in-place) 產生隨機排列清單的函式,以及一個用來隨機採樣不替換的函" +"用來原地 (in-place) 產生隨機排列清單的函式,以及一個用來隨機取樣不替換的函" "式。" #: ../../library/random.rst:19 diff --git a/library/superseded.po b/library/superseded.po index 3b7edee567..c9dd877050 100644 --- a/library/superseded.po +++ b/library/superseded.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -24,14 +24,13 @@ msgid "Superseded Modules" msgstr "已被取代的模組" #: ../../library/superseded.rst:7 -#, fuzzy msgid "" "The modules described in this chapter have been superseded by other modules " "for most use cases, and are retained primarily to preserve backwards " "compatibility." msgstr "" -"此章節所描述的模組 (modules) 均已被棄用,僅為了向後相容性而被保留下來。它們已" -"經被其他模組所取代。" +"此章節所描述的模組在大多數使用情況下已被其他模組取代,僅為了向後相容性而被保" +"留下來。" #: ../../library/superseded.rst:10 msgid "" diff --git a/library/timeit.po b/library/timeit.po index b7a9d153b8..4b5e7eb49d 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -110,7 +110,7 @@ msgid "" "repetitions only when the command-line interface is used. In the :ref:" "`timeit-examples` section you can find more advanced examples." msgstr "" -"但請注意,僅當使用命令列界面時 :func:`.timeit` 才會自動確定重複次數。在\\ :" +"但請注意,僅當使用命令列介面時 :func:`.timeit` 才會自動確定重複次數。在\\ :" "ref:`timeit-examples`\\ 章節中有更進階的範例。" #: ../../library/timeit.rst:60 diff --git a/library/tty.po b/library/tty.po index 86b6a46e29..6b2b0efbc6 100644 --- a/library/tty.po +++ b/library/tty.po @@ -81,7 +81,7 @@ msgid "" msgstr "" "將檔案描述器 *fd* 的模式更改為 raw。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。:func:`termios." -"tcgetattr` 的回傳值會在設定 *fd* 模式為 raw 之前先儲存起來。此函數回傳這個" +"tcgetattr` 的回傳值會在設定 *fd* 模式為 raw 之前先儲存起來。此函式回傳這個" "值。" #: ../../library/tty.rst:55 ../../library/tty.rst:69 @@ -98,7 +98,7 @@ msgid "" msgstr "" "將檔案描述器 *fd* 的模式更改為 cbreak。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。:func:`termios." -"tcgetattr` 的回傳值會在設定 *fd* 模式為 raw 之前先儲存起來。此函數回傳這個" +"tcgetattr` 的回傳值會在設定 *fd* 模式為 raw 之前先儲存起來。此函式回傳這個" "值。" #: ../../library/tty.rst:66 diff --git a/library/unittest.po b/library/unittest.po index bd134aa24b..9b00ef635a 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -548,11 +548,11 @@ msgstr "" #: ../../library/unittest.rst:291 msgid "The ``discover`` sub-command has the following options:" -msgstr "``discover`` 子指令有以下幾個選項:" +msgstr "``discover`` 子命令有以下幾個選項:" #: ../../library/unittest.rst:297 msgid "Verbose output" -msgstr "詳細(verbose)輸出" +msgstr "詳細 (verbose) 輸出" #: ../../library/unittest.rst:301 msgid "Directory to start discovery (``.`` default)" @@ -564,7 +564,7 @@ msgstr "匹配測試檔案的模式(預設為 ``test*.py``\\ )" #: ../../library/unittest.rst:309 msgid "Top level directory of project (defaults to start directory)" -msgstr "專案的最高階層目錄 (defaults to start directory)" +msgstr "專案的最高階層目錄(預設為開始的資料夾)" #: ../../library/unittest.rst:311 msgid "" @@ -1186,6 +1186,35 @@ msgid "" " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" "AssertionError: 1 != 0" msgstr "" +"======================================================================\n" +"FAIL: test_even (__main__.NumbersTest.test_even) (i=1)\n" +"Test that numbers between 0 and 5 are all even.\n" +"----------------------------------------------------------------------\n" +"Traceback (most recent call last):\n" +" File \"subtests.py\", line 11, in test_even\n" +" self.assertEqual(i % 2, 0)\n" +" ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +"AssertionError: 1 != 0\n" +"\n" +"======================================================================\n" +"FAIL: test_even (__main__.NumbersTest.test_even) (i=3)\n" +"Test that numbers between 0 and 5 are all even.\n" +"----------------------------------------------------------------------\n" +"Traceback (most recent call last):\n" +" File \"subtests.py\", line 11, in test_even\n" +" self.assertEqual(i % 2, 0)\n" +" ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +"AssertionError: 1 != 0\n" +"\n" +"======================================================================\n" +"FAIL: test_even (__main__.NumbersTest.test_even) (i=5)\n" +"Test that numbers between 0 and 5 are all even.\n" +"----------------------------------------------------------------------\n" +"Traceback (most recent call last):\n" +" File \"subtests.py\", line 11, in test_even\n" +" self.assertEqual(i % 2, 0)\n" +" ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +"AssertionError: 1 != 0" #: ../../library/unittest.rst:699 msgid "" @@ -1214,7 +1243,7 @@ msgstr "" #: ../../library/unittest.rst:715 msgid "Classes and functions" -msgstr "" +msgstr "類別與函式" #: ../../library/unittest.rst:717 msgid "This section describes in depth the API of :mod:`unittest`." @@ -1378,7 +1407,7 @@ msgstr "" #: ../../library/unittest.rst:853 ../../library/unittest.rst:974 #: ../../library/unittest.rst:1188 ../../library/unittest.rst:1312 msgid "Method" -msgstr "" +msgstr "方法" #: ../../library/unittest.rst:853 ../../library/unittest.rst:974 #: ../../library/unittest.rst:1188 @@ -1589,13 +1618,15 @@ msgstr ":meth:`assertRaises(exc, fun, *args, **kwds) `" #: ../../library/unittest.rst:976 msgid "``fun(*args, **kwds)`` raises *exc*" -msgstr "" +msgstr "``fun(*args, **kwds)`` 會引發 *exc*" #: ../../library/unittest.rst:979 msgid "" ":meth:`assertRaisesRegex(exc, r, fun, *args, **kwds) `" msgstr "" +":meth:`assertRaisesRegex(exc, r, fun, *args, **kwds) `" #: ../../library/unittest.rst:979 msgid "``fun(*args, **kwds)`` raises *exc* and the message matches regex *r*" @@ -1607,7 +1638,7 @@ msgstr ":meth:`assertWarns(warn, fun, *args, **kwds) `" #: ../../library/unittest.rst:982 msgid "``fun(*args, **kwds)`` raises *warn*" -msgstr "" +msgstr "``fun(*args, **kwds)`` 會引發 *warn*" #: ../../library/unittest.rst:985 msgid "" @@ -1725,6 +1756,8 @@ msgid "" "self.assertRaisesRegex(ValueError, \"invalid literal for.*XYZ'$\",\n" " int, 'XYZ')" msgstr "" +"self.assertRaisesRegex(ValueError, \"invalid literal for.*XYZ'$\",\n" +" int, 'XYZ')" #: ../../library/unittest.rst:1046 ../../library/unittest.rst:1114 msgid "or::" @@ -1818,12 +1851,17 @@ msgid "" " r'legacy_function\\(\\) is deprecated',\n" " legacy_function, 'XYZ')" msgstr "" +"self.assertWarnsRegex(DeprecationWarning,\n" +" r'legacy_function\\(\\) is deprecated',\n" +" legacy_function, 'XYZ')" #: ../../library/unittest.rst:1116 msgid "" "with self.assertWarnsRegex(RuntimeWarning, 'unsafe frobnicating'):\n" " frobnicate('/etc/passwd')" msgstr "" +"with self.assertWarnsRegex(RuntimeWarning, 'unsafe frobnicating'):\n" +" frobnicate('/etc/passwd')" #: ../../library/unittest.rst:1126 msgid "" @@ -1881,6 +1919,11 @@ msgid "" "self.assertEqual(cm.output, ['INFO:foo:first message',\n" " 'ERROR:foo.bar:second message'])" msgstr "" +"with self.assertLogs('foo', level='INFO') as cm:\n" +" logging.getLogger('foo').info('first message')\n" +" logging.getLogger('foo.bar').error('second message')\n" +"self.assertEqual(cm.output, ['INFO:foo:first message',\n" +" 'ERROR:foo.bar:second message'])" #: ../../library/unittest.rst:1168 msgid "" @@ -2016,6 +2059,8 @@ msgid "" ">>> self.assertGreaterEqual(3, 4)\n" "AssertionError: \"3\" unexpectedly not greater than or equal to \"4\"" msgstr "" +">>> self.assertGreaterEqual(3, 4)\n" +"AssertionError: \"3\" unexpectedly not greater than or equal to \"4\"" #: ../../library/unittest.rst:1257 msgid "" @@ -2034,7 +2079,7 @@ msgstr "以 ``assertRegexpMatches`` 為名新增。" msgid "" "The method ``assertRegexpMatches()`` has been renamed to :meth:`." "assertRegex`." -msgstr "" +msgstr "``assertRegexpMatches()`` 方法已重新命名為 :meth:`.assertRegex`。" #: ../../library/unittest.rst:1268 msgid ":meth:`.assertNotRegex`." @@ -2091,7 +2136,7 @@ msgstr ":meth:`assertMultiLineEqual(a, b) `" #: ../../library/unittest.rst:1314 msgid "strings" -msgstr "" +msgstr "字串" #: ../../library/unittest.rst:1317 msgid ":meth:`assertSequenceEqual(a, b) `" @@ -2099,7 +2144,7 @@ msgstr ":meth:`assertSequenceEqual(a, b) `" #: ../../library/unittest.rst:1317 msgid "sequences" -msgstr "" +msgstr "序列" #: ../../library/unittest.rst:1320 msgid ":meth:`assertListEqual(a, b) `" @@ -2107,7 +2152,7 @@ msgstr ":meth:`assertListEqual(a, b) `" #: ../../library/unittest.rst:1320 msgid "lists" -msgstr "" +msgstr "串列" #: ../../library/unittest.rst:1323 msgid ":meth:`assertTupleEqual(a, b) `" @@ -2115,7 +2160,7 @@ msgstr ":meth:`assertTupleEqual(a, b) `" #: ../../library/unittest.rst:1323 msgid "tuples" -msgstr "" +msgstr "元組" #: ../../library/unittest.rst:1326 msgid ":meth:`assertSetEqual(a, b) `" @@ -2123,7 +2168,7 @@ msgstr ":meth:`assertSetEqual(a, b) `" #: ../../library/unittest.rst:1326 msgid "sets or frozensets" -msgstr "" +msgstr "集合或凍結集合" #: ../../library/unittest.rst:1329 msgid ":meth:`assertDictEqual(a, b) `" @@ -2131,7 +2176,7 @@ msgstr ":meth:`assertDictEqual(a, b) `" #: ../../library/unittest.rst:1329 msgid "dicts" -msgstr "" +msgstr "字典" #: ../../library/unittest.rst:1337 msgid "" @@ -3332,7 +3377,7 @@ msgstr "" #: ../../library/unittest.rst:2337 msgid "load_tests Protocol" -msgstr "" +msgstr "load_tests 協定" #: ../../library/unittest.rst:2341 msgid "" @@ -3359,7 +3404,7 @@ msgstr "" #: ../../library/unittest.rst:2352 msgid "It should return a :class:`TestSuite`." -msgstr "" +msgstr "它應該回傳一個 :class:`TestSuite`。" #: ../../library/unittest.rst:2354 msgid "" @@ -3497,7 +3542,7 @@ msgstr "" #: ../../library/unittest.rst:2440 msgid "setUpClass and tearDownClass" -msgstr "" +msgstr "setUpClass 和 tearDownClass" #: ../../library/unittest.rst:2442 msgid "These must be implemented as class methods::" @@ -3545,7 +3590,7 @@ msgstr "" #: ../../library/unittest.rst:2467 msgid "setUpModule and tearDownModule" -msgstr "" +msgstr "setUpModule 和 tearDownModule" #: ../../library/unittest.rst:2469 msgid "These should be implemented as functions::" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 27e2467fec..d5a74fad17 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -630,7 +630,6 @@ msgid "is semantically equivalent to::" msgstr "在語義上等同於: ::" #: ../../reference/compound_stmts.rst:533 -#, fuzzy msgid "" "manager = (EXPRESSION)\n" "enter = type(manager).__enter__\n" @@ -650,9 +649,9 @@ msgid "" " exit(manager, None, None, None)" msgstr "" "manager = (EXPRESSION)\n" -"aenter = type(manager).__aenter__\n" -"aexit = type(manager).__aexit__\n" -"value = await aenter(manager)\n" +"enter = type(manager).__enter__\n" +"exit = type(manager).__exit__\n" +"value = enter(manager)\n" "hit_except = False\n" "\n" "try:\n" @@ -660,11 +659,11 @@ msgstr "" " SUITE\n" "except:\n" " hit_except = True\n" -" if not await aexit(manager, *sys.exc_info()):\n" +" if not exit(manager, *sys.exc_info()):\n" " raise\n" "finally:\n" " if not hit_except:\n" -" await aexit(manager, None, None, None)" +" exit(manager, None, None, None)" #: ../../reference/compound_stmts.rst:550 msgid "" @@ -3059,32 +3058,3 @@ msgstr "async with" #: ../../reference/compound_stmts.rst:1633 msgid "type parameters" msgstr "type parameter(型別參數)" - -#~ msgid "" -#~ "manager = (EXPRESSION)\n" -#~ "enter = type(manager).__enter__\n" -#~ "exit = type(manager).__exit__\n" -#~ "value = enter(manager)\n" -#~ "\n" -#~ "try:\n" -#~ " TARGET = value\n" -#~ " SUITE\n" -#~ "except:\n" -#~ " if not exit(manager, *sys.exc_info()):\n" -#~ " raise\n" -#~ "else:\n" -#~ " exit(manager, None, None, None)" -#~ msgstr "" -#~ "manager = (EXPRESSION)\n" -#~ "enter = type(manager).__enter__\n" -#~ "exit = type(manager).__exit__\n" -#~ "value = enter(manager)\n" -#~ "\n" -#~ "try:\n" -#~ " TARGET = value\n" -#~ " SUITE\n" -#~ "except:\n" -#~ " if not exit(manager, *sys.exc_info()):\n" -#~ " raise\n" -#~ "else:\n" -#~ " exit(manager, None, None, None)" diff --git a/tutorial/index.po b/tutorial/index.po index 47eb0a648b..1ed8787fa7 100644 --- a/tutorial/index.po +++ b/tutorial/index.po @@ -59,7 +59,7 @@ msgid "" msgstr "" "使用 C 或 C++(或其他可被 C 呼叫的程式語言),可以很容易在 Python 直譯器內新" "增功能函式及資料型別。同時,對可讓使用者自製功能的應用程式來說,Python 也適合" -"作為其擴充用界面語言 (extension language)。" +"作為其擴充用介面語言 (extension language)。" #: ../../tutorial/index.rst:23 msgid "" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index ee2fe63fc7..44170c01ff 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -849,7 +849,7 @@ msgid "" "of the subject's type and shape." msgstr "" "雖然使用巢狀 \"if\" 陳述式的「命令式 (imperative)」指令系列可用於完成類似於結" -"構模式匹配的操作,但它不如「聲明式 (declarative)」方法清晰。相反地,「聲明" +"構模式匹配的操作,但它不如「宣告式 (declarative)」方法清晰。相反地,「聲明" "式」方法規定了匹配所需滿足的條件,並且因其明確表達模式而更具可讀性。雖然結構" "模式匹配可以用其最簡單的形式達成,將變數與 case 陳述式中的字面值進行比較,但" "它對 Python 的真正價值在於它對主語的型態和特徵的處理。" @@ -2486,7 +2486,7 @@ msgid "" "Add ``--quiet`` option to command-line interface of :mod:`py_compile`. " "(Contributed by Gregory Schevchenko in :issue:`38731`.)" msgstr "" -"將 ``--quiet`` 選項新增到 :mod:`py_compile` 的命令列界面。(由 Gregory " +"將 ``--quiet`` 選項新增到 :mod:`py_compile` 的命令列介面。(由 Gregory " "Schevchenko 在 :issue:`38731` 中貢獻。)" #: ../../whatsnew/3.10.rst:1316 diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 3202bc30a7..8bddce6733 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -521,6 +521,16 @@ msgid "" "}\n" "/* The new interpreter is now active in the current thread. */" msgstr "" +"PyInterpreterConfig config = {\n" +" .check_multi_interp_extensions = 1,\n" +" .gil = PyInterpreterConfig_OWN_GIL,\n" +"};\n" +"PyThreadState *tstate = NULL;\n" +"PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);\n" +"if (PyStatus_Exception(status)) {\n" +" return -1;\n" +"}\n" +"/* 新的直譯器現在會在當前執行緒中啟用。 */" #: ../../whatsnew/3.12.rst:361 msgid "" @@ -1021,12 +1031,16 @@ msgid "" ":func:`importlib.resources.as_file` now supports resource directories. " "(Contributed by Jason R. Coombs in :gh:`97930`.)" msgstr "" +":func:`importlib.resources.as_file` 現在支援資源目錄。(由 Jason R. Coombs " +"於 :gh:`97930` 中貢獻。)" #: ../../whatsnew/3.12.rst:721 msgid "" "Rename first parameter of :func:`importlib.resources.files` to *anchor*. " "(Contributed by Jason R. Coombs in :gh:`100598`.)" msgstr "" +"將 :func:`importlib.resources.files` 的第一個參數重新命名為 *anchor*。(由 " +"Jason R. Coombs 於 :gh:`100598` 中貢獻。)" #: ../../whatsnew/3.12.rst:725 msgid "inspect" @@ -1038,6 +1052,9 @@ msgid "" "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed by Carlton Gibson in :gh:`99247`.)" msgstr "" +"新增 :func:`inspect.markcoroutinefunction` 以標記會回傳 :term:`coroutine` 的" +"同步函式,以供 :func:`inspect.iscoroutinefunction` 使用。(由 Carlton Gibson " +"於 :gh:`99247` 中貢獻。)" #: ../../whatsnew/3.12.rst:731 msgid "" @@ -1045,6 +1062,9 @@ msgid "" "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :gh:`79940`.)" msgstr "" +"新增 :func:`inspect.getasyncgenstate` 和 :func:`inspect.getasyncgenlocals` 以" +"確定非同步產生器的當前狀態。(由 Thomas Krennwallner 於 :gh:`79940` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:735 msgid "" @@ -1052,6 +1072,8 @@ msgid "" "improved. Most calls to the function should be at least 2x faster than they " "were in Python 3.11. (Contributed by Alex Waygood in :gh:`103193`.)" msgstr "" +":func:`inspect.getattr_static` 的效能已大幅改善。大多數對該函式的呼叫應該比 " +"Python 3.11 中快至少 2 倍。(由 Alex Waygood 於 :gh:`103193` 中貢獻。)" #: ../../whatsnew/3.12.rst:740 msgid "itertools" @@ -1063,6 +1085,8 @@ msgid "" "the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" +"新增 :func:`itertools.batched` 以將元素收集到大小均等的元組中,其中最後一批次" +"可能比其他的少。(由 Raymond Hettinger 於 :gh:`98363` 中貢獻。)" #: ../../whatsnew/3.12.rst:747 msgid "math" @@ -1130,12 +1154,16 @@ msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" +"新增 :func:`os.path.isjunction` 以檢查給定路徑是否為連結點 (junction)。(由 " +"Charles Machalow 於 :gh:`99547` 中貢獻。)" #: ../../whatsnew/3.12.rst:787 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" +"新增 :func:`os.path.splitroot` 以將路徑分割為三元組 ``(drive, root, tail)``。" +"(由 Barney Gale 於 :gh:`101000` 中貢獻。)" #: ../../whatsnew/3.12.rst:791 msgid "pathlib" @@ -1455,6 +1483,22 @@ msgid "" "attribute\n" "True" msgstr "" +">>> from typing import Protocol, runtime_checkable\n" +">>> @runtime_checkable\n" +"... class HasX(Protocol):\n" +"... x = 1\n" +"...\n" +">>> class Foo: ...\n" +"...\n" +">>> f = Foo()\n" +">>> isinstance(f, HasX)\n" +"False\n" +">>> f.x = 1\n" +">>> isinstance(f, HasX)\n" +"True\n" +">>> HasX.y = 2\n" +">>> isinstance(f, HasX) # 沒有改變,即便 HasX 現在有 \"y\" 屬性\n" +"True" #: ../../whatsnew/3.12.rst:1001 msgid "" @@ -1584,6 +1628,8 @@ msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar Oren in :gh:`103793`.)" msgstr "" +"透過延遲運算較繁重的字串格式化來加速 :class:`asyncio.Task` 的建立。(由 " +"Itamar Oren 於 :gh:`103793` 中貢獻。)" #: ../../whatsnew/3.12.rst:1072 msgid "" @@ -1611,6 +1657,9 @@ msgid "" "`!LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " "by Ken Jin in :gh:`93429`.)" msgstr "" +"移除 :opcode:`!LOAD_METHOD` 指令。它已經合併至 :opcode:`LOAD_ATTR`。:opcode:" +"`LOAD_ATTR` 現在會像舊的 :opcode:`!LOAD_METHOD` 指令一樣行為,如果其 oparg 的" +"低位元 (low bit) 有被設定。(由 Ken Jin 於 :gh:`93429` 中貢獻。)" #: ../../whatsnew/3.12.rst:1090 msgid "" @@ -1618,54 +1667,70 @@ msgid "" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" +"移除 :opcode:`!JUMP_IF_FALSE_OR_POP` 和 :opcode:`!JUMP_IF_TRUE_OR_POP` 指令。" +"(由 Irit Katriel 於 :gh:`102859` 中貢獻。)" #: ../../whatsnew/3.12.rst:1093 msgid "" "Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" "gh:`92925`.)" msgstr "" +"移除 :opcode:`!PRECALL` 指令。(由 Mark Shannon 於 :gh:`92925` 中貢獻。)" #: ../../whatsnew/3.12.rst:1096 msgid "" "Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. " "(Contributed by Mark Shannon in :gh:`94163`.)" msgstr "" +"新增 :opcode:`BINARY_SLICE` 和 :opcode:`STORE_SLICE` 指令。(由 Mark Shannon " +"於 :gh:`94163` 中貢獻。)" #: ../../whatsnew/3.12.rst:1099 msgid "" "Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark " "Shannon in :gh:`99005`.)" msgstr "" +"新增 :opcode:`CALL_INTRINSIC_1` 指令。(由 Mark Shannon 於 :gh:`99005` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1102 msgid "" "Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel " "in :gh:`101799`.)" msgstr "" +"新增 :opcode:`CALL_INTRINSIC_2` 指令。(由 Irit Katriel 於 :gh:`101799` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1105 msgid "" "Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher " "in :gh:`90997`.)" msgstr "" +"新增 :opcode:`CLEANUP_THROW` 指令。(由 Brandt Bucher 於 :gh:`90997` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1108 msgid "" "Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" +"新增 :opcode:`!END_SEND` 指令。(由 Mark Shannon 於 :gh:`103082` 中貢獻。)" #: ../../whatsnew/3.12.rst:1111 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" +"新增 :opcode:`LOAD_FAST_AND_CLEAR` 指令作為 :pep:`709` 實作的一部分。(由 " +"Carl Meyer 於 :gh:`101441` 中貢獻。)" #: ../../whatsnew/3.12.rst:1114 msgid "" "Add the :opcode:`LOAD_FAST_CHECK` instruction. (Contributed by Dennis " "Sweeney in :gh:`93143`.)" msgstr "" +"新增 :opcode:`LOAD_FAST_CHECK` 指令。(由 Dennis Sweeney 於 :gh:`93143` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1117 msgid "" @@ -1675,18 +1740,27 @@ msgid "" "opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" +"新增 :opcode:`LOAD_FROM_DICT_OR_DEREF`、:opcode:`LOAD_FROM_DICT_OR_GLOBALS` " +"和 :opcode:`LOAD_LOCALS` 操作碼作為 :pep:`695` 實作的一部分。移除 :opcode:`!" +"LOAD_CLASSDEREF` 操作碼,可以用 :opcode:`LOAD_LOCALS` 加上 :opcode:" +"`LOAD_FROM_DICT_OR_DEREF` 來取代。(由 Jelle Zijlstra 於 :gh:`103764` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1123 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" +"新增 :opcode:`LOAD_SUPER_ATTR` 指令。(由 Carl Meyer 和 Vladimir Matveev 於 :" +"gh:`103497` 中貢獻。)" #: ../../whatsnew/3.12.rst:1126 msgid "" "Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" "gh:`101632`.)" msgstr "" +"新增 :opcode:`RETURN_CONST` 指令。(由 Wenyang Wang 於 :gh:`101632` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1129 msgid "Demos and Tools" @@ -1728,6 +1802,9 @@ msgid "" "emitted at runtime when they are accessed or used, and will be removed in " "Python 3.14:" msgstr "" +":mod:`ast`:以下 :mod:`ast` 功能自 Python 3.8 起已在文件中被棄用,現在在存取" +"或使用時會在 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移" +"除:" #: ../../whatsnew/3.12.rst:1154 #: ../../deprecations/pending-removal-in-3.14.rst:13 @@ -3096,6 +3173,7 @@ msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" +"根據 :gh:`89336`,已移除了在 3.2 中被 :mod:`configparser` 棄用的幾個名稱:" #: ../../whatsnew/3.12.rst:1364 msgid "" @@ -3110,12 +3188,16 @@ msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" +":mod:`configparser` 不再具有 ``SafeConfigParser`` 類別。請改用較短的 :class:" +"`~configparser.ConfigParser` 名稱。" #: ../../whatsnew/3.12.rst:1368 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" +":class:`configparser.ConfigParser` 不再具有 ``readfp`` 方法。請改用 :meth:" +"`~configparser.ConfigParser.read_file`。" #: ../../whatsnew/3.12.rst:1374 msgid "distutils" @@ -3171,6 +3253,8 @@ msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" +"移除 :mod:`enum` 的 ``EnumMeta.__getattr__``,對於列舉屬性的訪問不再會需要" +"它。" #: ../../whatsnew/3.12.rst:1411 msgid "ftplib" @@ -3255,11 +3339,11 @@ msgstr "imp" msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" -msgstr "" +msgstr ":mod:`!imp` 模組已被移除。(由 Barry Warsaw 在 :gh:`98040` 中貢獻。)" #: ../../whatsnew/3.12.rst:1462 msgid "To migrate, consult the following correspondence table:" -msgstr "" +msgstr "要遷移的話請參考以下對應表:" #: ../../whatsnew/3.12.rst:1467 msgid "``imp.NullImporter``" @@ -3302,6 +3386,8 @@ msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" +":attr:`importlib.machinery.SOURCE_SUFFIXES`、:attr:`importlib.machinery." +"EXTENSION_SUFFIXES` 和 :attr:`importlib.machinery.BYTECODE_SUFFIXES`" #: ../../whatsnew/3.12.rst:1472 msgid "``imp.get_tag()``" @@ -3371,6 +3457,19 @@ msgid "" " loader.exec_module(module)\n" " return module" msgstr "" +"import importlib.util\n" +"import importlib.machinery\n" +"\n" +"def load_source(modname, filename):\n" +" loader = importlib.machinery.SourceFileLoader(modname, filename)\n" +" spec = importlib.util.spec_from_file_location(modname, filename, " +"loader=loader)\n" +" module = importlib.util.module_from_spec(spec)\n" +" # 此模組都會被執行且不會被快取於 sys.modules。\n" +" # 要快取模組的話可以把下面一行取消註解\n" +" # sys.modules[module.__name__] = module\n" +" loader.exec_module(module)\n" +" return module" #: ../../whatsnew/3.12.rst:1495 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" @@ -3672,6 +3771,8 @@ msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" +"對 :class:`~unittest.TextTestResult` 類別的別名:``_TextTestResult``\\ (自 " +"Python 3.2 起已棄用)。" #: ../../whatsnew/3.12.rst:1617 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" @@ -4802,6 +4903,9 @@ msgid "" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" +"使用 :c:func:`PyType_FromSpec`、:c:func:`PyType_FromSpecWithBases` 或 :c:" +"func:`PyType_FromModuleAndSpec` 建立一個其元類別覆寫 :c:member:" +"`~PyTypeObject.tp_new` 的類別已被棄用。請改為呼叫元類別。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:4 msgid "" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 0ac154ca95..8515c9a886 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -286,13 +286,12 @@ msgstr "重要的移除:" #: ../../whatsnew/3.13.rst:182 msgid "" -":ref:`PEP 594 `: The remaining 19 \"dead " -"batteries\" (legacy stdlib modules) have been removed from the standard " -"library: :mod:`!aifc`, :mod:`!audioop`, :mod:`!cgi`, :mod:`!cgitb`, :mod:`!" -"chunk`, :mod:`!crypt`, :mod:`!imghdr`, :mod:`!mailcap`, :mod:`!msilib`, :mod:" -"`!nis`, :mod:`!nntplib`, :mod:`!ossaudiodev`, :mod:`!pipes`, :mod:`!" -"sndhdr`, :mod:`!spwd`, :mod:`!sunau`, :mod:`!telnetlib`, :mod:`!uu` and :mod:" -"`!xdrlib`." +":ref:`PEP 594 `: The remaining 19 \"dead batteries\" " +"(legacy stdlib modules) have been removed from the standard library: :mod:`!" +"aifc`, :mod:`!audioop`, :mod:`!cgi`, :mod:`!cgitb`, :mod:`!chunk`, :mod:`!" +"crypt`, :mod:`!imghdr`, :mod:`!mailcap`, :mod:`!msilib`, :mod:`!nis`, :mod:`!" +"nntplib`, :mod:`!ossaudiodev`, :mod:`!pipes`, :mod:`!sndhdr`, :mod:`!spwd`, :" +"mod:`!sunau`, :mod:`!telnetlib`, :mod:`!uu` and :mod:`!xdrlib`." msgstr "" ":ref:`PEP 594 `: 剩下的 19 個 \"dead batteries\" (遺留標" "準函式庫模組)已自標準函式庫中移除::mod:`!aifc`、:mod:`!audioop`、:mod:`!" @@ -1358,13 +1357,14 @@ msgstr "" #: ../../whatsnew/3.13.rst:893 msgid "enum" -msgstr "" +msgstr "enum" #: ../../whatsnew/3.13.rst:895 msgid "" ":class:`~enum.EnumDict` has been made public to better support subclassing :" "class:`~enum.EnumType`." msgstr "" +"公開 :class:`~enum.EnumDict` 以更好地支援 :class:`~enum.EnumType` 的子類別。" #: ../../whatsnew/3.13.rst:900 msgid "fractions" @@ -2377,6 +2377,8 @@ msgid "" "(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" "`104780`.)" msgstr "" +"(由 Victor Stinner 和 Zachary Ware 在 :gh:`104773` 和 :gh:`104780` 中貢" +"獻。)" #: ../../whatsnew/3.13.rst:1596 msgid "2to3" @@ -2460,9 +2462,8 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:1661 -#, fuzzy msgid "optparse" -msgstr "argparse" +msgstr "optparse" #: ../../whatsnew/3.13.rst:1663 msgid "" @@ -2535,7 +2536,7 @@ msgstr "unittest" #: ../../whatsnew/3.13.rst:1726 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" -msgstr "" +msgstr "移除以下在 Python 3.11 中已被棄用的 :mod:`unittest` 函式:" #: ../../whatsnew/3.13.rst:1728 msgid ":func:`!unittest.findTestCases`" @@ -3898,7 +3899,7 @@ msgstr ":c:func:`PyMonitoring_ExitScope`" #: ../../whatsnew/3.13.rst:2010 msgid "(Contributed by Irit Katriel in :gh:`111997`)." -msgstr "" +msgstr "(由 Irit Katriel 在 :gh:`111997` 中貢獻。)" #: ../../whatsnew/3.13.rst:2012 msgid "" @@ -4185,24 +4186,28 @@ msgstr "" #: ../../whatsnew/3.13.rst:2196 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." -msgstr "" +msgstr ":c:func:`PyObject_HasAttrWithError` 取代 :c:func:`PyObject_HasAttr`。" #: ../../whatsnew/3.13.rst:2197 msgid "" ":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" "`PyObject_HasAttrString`." msgstr "" +":c:func:`PyObject_HasAttrStringWithError` 取代 :c:func:" +"`PyObject_HasAttrString`。" #: ../../whatsnew/3.13.rst:2199 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." -msgstr "" +msgstr ":c:func:`PyMapping_HasKeyWithError` 取代 :c:func:`PyMapping_HasKey`。" #: ../../whatsnew/3.13.rst:2200 msgid "" ":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" "`PyMapping_HasKeyString`." msgstr "" +":c:func:`PyMapping_HasKeyStringWithError` 取代 :c:func:" +"`PyMapping_HasKeyString`。" #: ../../whatsnew/3.13.rst:2203 msgid "" @@ -5429,6 +5434,3 @@ msgid "" "only exists in specialized builds of Python, may now return objects from " "other interpreters than the one it's called in." msgstr "" - -#~ msgid ":mod:`getopt` and :mod:`optparse`:" -#~ msgstr ":mod:`getopt` 和 :mod:`optparse`:" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index d928fca84e..8bdcc0eaaf 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -95,7 +95,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:98 msgid "New library modules:" -msgstr "" +msgstr "新的函式庫模組:" #: ../../whatsnew/3.4.rst:100 msgid "" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 9de8d2caae..36ad7689e8 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -71,7 +71,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:67 msgid "New library modules:" -msgstr "" +msgstr "新的函式庫模組:" #: ../../whatsnew/3.5.rst:69 msgid ":mod:`typing`: :ref:`PEP 484 -- Type Hints `." diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index d4e6ccd8c2..2b7dfedd6b 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -70,7 +70,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:73 msgid "New library modules:" -msgstr "" +msgstr "新的函式庫模組:" #: ../../whatsnew/3.6.rst:75 msgid "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index b2c04d4e21..9416588394 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -58,7 +58,7 @@ msgstr ":keyword:`async` 和 :keyword:`await` 現為保留關鍵字。" #: ../../whatsnew/3.7.rst:66 msgid "New library modules:" -msgstr "" +msgstr "新的函式庫模組:" #: ../../whatsnew/3.7.rst:68 msgid "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 4c88343623..c85271fcb3 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -126,7 +126,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:94 msgid "New library modules:" -msgstr "" +msgstr "新的函式庫模組:" #: ../../whatsnew/3.9.rst:96 msgid ""