diff --git a/reference/introduction.po b/reference/introduction.po index 762487aea6..688abd83a0 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-09-08 15:25+0800\n" -"PO-Revision-Date: 2017-09-22 18:27+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"PO-Revision-Date: 2025-11-23 21:36+0800\n" +"Last-Translator: Junli Xiao \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -16,6 +16,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.8\n" #: ../../reference/introduction.rst:6 msgid "Introduction" @@ -25,7 +26,7 @@ msgstr "簡介" msgid "" "This reference manual describes the Python programming language. It is not " "intended as a tutorial." -msgstr "" +msgstr "這份參考手冊將會描述 Python 的程式語言特性,而非用於教學。" #: ../../reference/introduction.rst:11 msgid "" @@ -41,6 +42,13 @@ msgid "" "like to see a more formal definition of the language, maybe you could " "volunteer your time --- or invent a cloning machine :-)." msgstr "" +"在我想要盡可能精確表達的同時,除了語法和詞法分析部分,我仍選擇使用英語來描述" +"這些特性,而不是透過形式化的規格。如此一來,這份文件對於一般讀者來說將更容易" +"理解,只是某些意思表達會有模糊之處。因此,如果你是來自火星,並想要僅僅藉由這" +"份文件來重新實作 Python,你可能有些時候必須猜測做出判斷——事實上,你很有可能實" +"作出一個不同的語言。另一方面,如果你已經在使用 Python,並且好奇這個語言的某個" +"特定領域的精確規則為何,那麼你一定能在這份手冊裡找到它們。而如果你想要看到關" +"於這語言更形式化的一個定義,也許你可以自告奮勇——或是發明一台複製機器。:-)" #: ../../reference/introduction.rst:23 msgid "" @@ -53,6 +61,10 @@ msgid "" "implementation imposes additional limitations. Therefore, you'll find short " "\"implementation notes\" sprinkled throughout the text." msgstr "" +"在一份語言的參考文件中加入太多實作細節,是很危險的——這些細節將來可能變化,同" +"一個語言的其他實作也可能有不一樣的運作方式。然而,CPython 是一個廣泛使用的 " +"Python 實作,而有時候它的一些特別古怪之處確實值得提及,尤其當那樣的實作作法帶" +"來了額外限制。基於這個原因,手冊內你會發現簡短的實作細節說明散落在各處。" #: ../../reference/introduction.rst:32 msgid "" @@ -61,10 +73,12 @@ msgid "" "modules are mentioned when they interact in a significant way with the " "language definition." msgstr "" +"每一個 Python 實作都附帶內建模組和標準模組。它們會在 :ref:`library-index` 得" +"到說明。一些內建模組因為和語言定義有深刻的交互影響,之後也將提及。" #: ../../reference/introduction.rst:41 msgid "Alternate Implementations" -msgstr "" +msgstr "可選實作" #: ../../reference/introduction.rst:43 msgid "" @@ -72,10 +86,12 @@ msgid "" "there are some alternate implementations which are of particular interest to " "different audiences." msgstr "" +"儘管已有一個 Python 實作是目前最廣為流傳,仍存在其他種類的實作適合不同需求的" +"族群所使用。" #: ../../reference/introduction.rst:47 msgid "Known implementations include:" -msgstr "" +msgstr "知名的實作如下:" #: ../../reference/introduction.rst:49 msgid "CPython" @@ -86,6 +102,8 @@ msgid "" "This is the original and most-maintained implementation of Python, written " "in C. New language features generally appear here first." msgstr "" +"以 C 語言開發,是 Python 一開始的實作,同時也是維護程度最好的。新的語言特性通" +"常會先在這裡問世。" #: ../../reference/introduction.rst:53 msgid "Jython" @@ -99,10 +117,13 @@ msgid "" "libraries. More information can be found at `the Jython website `_." msgstr "" +"基於 Java 所實作的 Python。這個實作可以作為針對 Java 應用程式的腳本語言,或是" +"用它來從 Java 函式庫建立應用程式。它也經常用於撰寫 Java 函式庫的測試。如需更" +"多資訊,請參閱 `Jython 網站 `_。" #: ../../reference/introduction.rst:59 msgid "Python for .NET" -msgstr "" +msgstr "Python.NET" #: ../../reference/introduction.rst:60 msgid "" @@ -111,6 +132,9 @@ msgid "" "by Brian Lloyd. For more information, see the `Python for .NET home page " "`_." msgstr "" +"這個實作實際上使用到 CPython,但它是託管式的 .NET 應用程式,也使得 .NET 函式" +"庫可用。它是由 Brian Lloyd 所設計。如需更多資訊,請參閱 `Python.NET 首頁 " +"`_。" #: ../../reference/introduction.rst:65 msgid "IronPython" @@ -124,6 +148,10 @@ msgid "" "For more information, see `the IronPython website `_." msgstr "" +"另一個基於 .NET 的 Python 實作選項。不像 Python.NET,這是一個會產出中繼語言 " +"(IL) 的完整 Python 實作,並會將 Python 程式碼直接編譯為 .NET 組件。它由 " +"Jython 的原始設計者 Jim Hugunin 所設計。如需更多資訊,請參閱 `IronPython 網" +"站 `_。" #: ../../reference/introduction.rst:71 msgid "PyPy" @@ -139,6 +167,9 @@ msgid "" "information is available on `the PyPy project's home page `_." msgstr "" +"一個完全透過 Python 來撰寫的 Python 實作。它有一些其他實作所沒有的進階特性," +"像是它支援無堆疊 Python 以及採用即時編譯器。額外資訊可參閱 `PyPy 專案網站 " +"`_。" #: ../../reference/introduction.rst:79 msgid "" @@ -148,10 +179,13 @@ msgid "" "implementation-specific documentation to determine what else you need to " "know about the specific implementation you're using." msgstr "" +"上述每一個實作都和這份手冊裡所描述的 Python 語言有些許不同,可能需要特定的、" +"在標準 Python 文件涵蓋內容以外的資訊才能掌握。如果在使用它們時有需要瞭解更" +"多,請參閱特定實作的相關文件。" #: ../../reference/introduction.rst:89 msgid "Notation" -msgstr "" +msgstr "表示法" #: ../../reference/introduction.rst:93 msgid "" @@ -160,6 +194,9 @@ msgid "" "Extended_Backus%E2%80%93Naur_form>`_ and `PEG `_. For example:" msgstr "" +"為了描述詞法分析和語法,我使用了混合 `EBNF `_ 和 `PEG `_ 的文法表示系統。例如:" #: ../../reference/introduction.rst:106 msgid "" @@ -169,6 +206,10 @@ msgid "" "through ``'z'`` and ``A`` through ``Z``; a ``digit`` is a single character " "from ``0`` to ``9``." msgstr "" +"在這個例子裡,第一行說明 ``name`` 是由一個 ``letter`` 接續零或多個 " +"``letter``、``digit`` 或底線所組成。而 ``letter`` 則是 ``'a'`` 到 ``'z'``、" +"``A`` 到 ``Z`` 之中任一個單一字元;``digit`` 是 ``0`` 到 ``9`` 之中的單一字" +"元。" #: ../../reference/introduction.rst:112 msgid "" @@ -176,18 +217,23 @@ msgid "" "defined) followed by a colon, ``:``. The definition to the right of the " "colon uses the following syntax elements:" msgstr "" +"每一條規則的開頭即規則名稱,接著一個分號 ``:``。分號右側是由下列語法元素所構" +"成的規則定義 :" #: ../../reference/introduction.rst:116 msgid "" "``name``: A name refers to another rule. Where possible, it is a link to the " "rule's definition." msgstr "" +"``name``:表示另一條規則的名稱。只要可行,它也會是一個連到規則定義的連結。" #: ../../reference/introduction.rst:119 msgid "" "``TOKEN``: An uppercase name refers to a :term:`token`. For the purposes of " "grammar definitions, tokens are the same as rules." msgstr "" +"``TOKEN``:大寫的名稱代表的是 :term:`token`。就這裡文法定義的目的而言,token " +"和規則的意義是相同的。" #: ../../reference/introduction.rst:122 msgid "" @@ -195,16 +241,18 @@ msgid "" "literally (without the quotes). The type of quote is chosen according to the " "meaning of ``text``:" msgstr "" +"``”text”``、``’text’``:單引號或雙引號內的文字必須完全相符,不含外面的引號。" +"依據 ``text`` 的意義,會決定使用何種引號 :" #: ../../reference/introduction.rst:126 msgid "``'if'``: A name in single quotes denotes a :ref:`keyword `." -msgstr "" +msgstr "``'if'``:單引號內的文字為 :ref:`keyword `。" #: ../../reference/introduction.rst:127 msgid "" "``\"case\"``: A name in double quotes denotes a :ref:`soft-keyword `." -msgstr "" +msgstr "``\"case\"``:雙引號內的文字為 :ref:`soft-keyword `。" #: ../../reference/introduction.rst:129 msgid "" @@ -212,12 +260,16 @@ msgid "" "an :py:data:`~token.OP` token, that is, a :ref:`delimiter ` " "or :ref:`operator `." msgstr "" +"``'@'``:單引號內的非字母(非 ``letter``)符號為 :py:data:`~token.OP` token," +"也就是 :ref:`delimiter ` 或 :ref:`operator `。" #: ../../reference/introduction.rst:133 msgid "" "``e1 e2``: Items separated only by whitespace denote a sequence. Here, " "``e1`` must be followed by ``e2``." msgstr "" +"``e1 e2``:僅由空白所開的多個項目代表一個序列。這裡,``e1`` 之後必須以 " +"``e2`` 接續。" #: ../../reference/introduction.rst:135 msgid "" @@ -226,36 +278,42 @@ msgid "" "traditional PEG grammars, this is written as a slash, ``/``, rather than a " "vertical bar. See :pep:`617` for more background and details." msgstr "" +"``e1 | e2``:垂直槓符號用來隔開可匹配的項目。它代表 PEG 的「有序選擇」——如果 " +"``e1`` 已匹配,那麼 ``e2`` 便不考慮。在傳統的 PEG 文法裡,使用的是斜線 ``/`` " +"而非垂直槓。如需更多背景細節,可參考 :pep:`617`。" #: ../../reference/introduction.rst:141 msgid "``e*``: A star means zero or more repetitions of the preceding item." -msgstr "" +msgstr "``e*``:星號表示星號前的項目重複零次或多次。" #: ../../reference/introduction.rst:142 msgid "``e+``: Likewise, a plus means one or more repetitions." -msgstr "" +msgstr "``e+``:同樣方式,加號表示重複一次或多次。" #: ../../reference/introduction.rst:143 msgid "" "``[e]``: A phrase enclosed in square brackets means zero or one occurrences. " "In other words, the enclosed phrase is optional." msgstr "" +"``[e]``:以方括號包圍的元素意謂零次或一次。換句話說,方括號裡的元素為選擇性" +"的。" #: ../../reference/introduction.rst:145 msgid "" "``e?``: A question mark has exactly the same meaning as square brackets: the " "preceding item is optional." -msgstr "" +msgstr "``e?``:問號的用途和方括號一樣,表示問號前的項目是選擇性的。" #: ../../reference/introduction.rst:147 msgid "``(e)``: Parentheses are used for grouping." -msgstr "" +msgstr "``(e)``:括號用於分組。" #: ../../reference/introduction.rst:149 msgid "" "The following notation is only used in :ref:`lexical definitions `." msgstr "" +"以下的表示法僅會用於\\ :ref:`詞法定義 `。" #: ../../reference/introduction.rst:152 msgid "" @@ -263,6 +321,8 @@ msgid "" "choice of any single character in the given (inclusive) range of ASCII " "characters." msgstr "" +"``”a”…”z”``:兩個字面值字元由三個點隔開,表示在此界定範圍內(含)任一個 " +"ASCII 字元皆合文法。" #: ../../reference/introduction.rst:154 msgid "" @@ -271,37 +331,43 @@ msgid "" "\">``), or an abbreviation that is defined in nearby text (for example, " "````)." msgstr "" +"``<…>``:角括號內的文字片語是對匹配符號(例如,``<除了 “\\” 以外的任何 ASCII " +"字元>``)的非正式說明,或是在附近段落有解釋的縮寫(例如 ````)。" #: ../../reference/introduction.rst:160 msgid "" "Some definitions also use *lookaheads*, which indicate that an element must " "(or must not) match at a given position, but without consuming any input:" msgstr "" +"有些定義會採用\\ *預看*\\作法,也就是指定位置的元素必須(或必須不)匹配,但不" +"消耗任何輸入:" #: ../../reference/introduction.rst:163 msgid "``&e``: a positive lookahead (that is, ``e`` is required to match)" -msgstr "" +msgstr "``&e``:正向預看,也就是 ``e`` 必須匹配" #: ../../reference/introduction.rst:164 msgid "" "``!e``: a negative lookahead (that is, ``e`` is required *not* to match)" -msgstr "" +msgstr "``!e``:負向預看,也就是 ``e`` 必須\\ *不匹配*" #: ../../reference/introduction.rst:166 msgid "" "The unary operators (``*``, ``+``, ``?``) bind as tightly as possible; the " "vertical bar (``|``) binds most loosely." msgstr "" +"一元運算子(``*``、``+``、``?``)跟元素的繫結關係最緊密;垂直槓 (``|``) 的則" +"最鬆散。" #: ../../reference/introduction.rst:169 msgid "White space is only meaningful to separate tokens." -msgstr "" +msgstr "空格的用途只在於隔開 token。" #: ../../reference/introduction.rst:171 msgid "" "Rules are normally contained on a single line, but rules that are too long " "may be wrapped:" -msgstr "" +msgstr "通常而言,規則長度都在一行以內,但太長的規則也可以換行表示:" #: ../../reference/introduction.rst:180 msgid "" @@ -309,10 +375,12 @@ msgid "" "colon, and each alternative beginning with a vertical bar on a new line. For " "example:" msgstr "" +"或者,規則可以呈現為第一行以分號結束,而每一種可匹配選項皆在新一行以垂直槓開" +"頭表示。例如:" #: ../../reference/introduction.rst:195 msgid "This does *not* mean that there is an empty first alternative." -msgstr "" +msgstr "這\\ *不代表*\\一開始有一個空白匹配選項。" #: ../../reference/introduction.rst:202 msgid "Lexical and Syntactic definitions" @@ -327,6 +395,10 @@ msgid "" "some cases the exact boundary between the two phases is a CPython " "implementation detail." msgstr "" +"\\ *詞法* (lexical) 和\\ *語法* (syntactic) 分析是有一些差異" +"的::term:`lexical analyzer` 處理的對象是輸入來源的各個字元,而\\ *剖析器* " +"(語法分析器)處理的則是詞法分析產生的 :term:`tokens ` 流。然而在某些" +"時候,這兩個階段的確切分界會是 CPython 實作細節的問題。" #: ../../reference/introduction.rst:211 msgid "" @@ -336,6 +408,10 @@ msgid "" "like :data:`token.INDENT` or :data:`~token.NEWLINE`. *Syntactic* definitions " "then use these tokens, rather than source characters." msgstr "" +"實務上,這兩個的差異在於:在\\ *詞法*\\定義裡,任何空格都是有影響的。詞法分析" +"器\\ :ref:`捨棄`\\了那些無法轉換成 token(例" +"如 :data:`token.INDENT` 或 :data:`~token.NEWLINE`)的空白。\\ *語法*\\定義才" +"接著處理這些 tokens,而非來源字元。" #: ../../reference/introduction.rst:217 msgid "" @@ -343,6 +419,9 @@ msgid "" "All uses of BNF in the next chapter (:ref:`lexical`) are lexical " "definitions; uses in subsequent chapters are syntactic definitions." msgstr "" +"這份手冊裡不管是為了定義還是風格表現,都使用了同樣的 BNF 文法。在下一個章節" +"(:ref:`lexical`)裡所有 BNF 的使用都是詞法定義;在那之後的章節裡則是語法定" +"義。" #: ../../reference/introduction.rst:91 msgid "BNF"