@@ -32,9 +32,9 @@ msgid ""
32
32
"with each Python release; this module helps to find out programmatically "
33
33
"what the current grammar looks like."
34
34
msgstr ""
35
- ":mod:`ast` 模組可以幫助 Python 應用程式處理 Python 抽象語法樹狀資料結構。抽象 "
36
- "語法本身可能會隨著每個 Python 版本發布而改變;此模組有助於以程式化的方式來得 "
37
- "知當前語法的面貌 。"
35
+ ":mod:`ast` 模組可以幫助 Python 應用程式處理 Python 抽象語法文法 (abstract "
36
+ "syntax grammar) 樹狀資料結構。抽象語法本身可能會隨著每個 Python 版本發布而改 "
37
+ "變;此模組有助於以程式化的方式來得知當前文法的面貌 。"
38
38
39
39
#: ../../library/ast.rst:23
40
40
msgid ""
@@ -83,8 +83,8 @@ msgid ""
83
83
"rules with alternatives (aka \" sums\" ), the left-hand side class is "
84
84
"abstract: only instances of specific constructor nodes are ever created."
85
85
msgstr ""
86
- "抽象文法中為每個左側符號定義了一個類別(例如, :class:`ast.stmt` 或 :class:"
87
- "`ast.expr`\\ )。另外 ,也為每個右側的建構函式 (constructor) 定義了一個類別;"
86
+ "抽象文法中為每個左側符號定義了一個類別(例如 :class:`ast.stmt` 或 :class:"
87
+ "`ast.expr`\\ )。此外 ,也為每個右側的建構函式 (constructor) 定義了一個類別;"
88
88
"這些類別繼承自左側樹的類別。例如,:class:`ast.BinOp` 繼承自 :class:`ast."
89
89
"expr`。對於具有替代方案(即為「和 (sums)」)的生產規則,左側類別是抽象的:僅"
90
90
"有特定建構函式節點的實例會被建立。"
@@ -141,7 +141,7 @@ msgid ""
141
141
"one can get the source segment of a one-line expression node using "
142
142
"``source_line[node.col_offset : node.end_col_offset]``."
143
143
msgstr ""
144
- "請注意,編譯器不需要知道結束位置,因此為可選的 。結束偏移量在最後一個符號\\ *"
144
+ "請注意,編譯器並不需要結束位置,因此其為可選的 。結束偏移量在最後一個符號\\ *"
145
145
"之後*,例如可以使用 ``source_line[node.col_offset : node.end_col_offset]`` 來"
146
146
"獲取單列運算式節點 (expression node) 的原始片段。"
147
147
@@ -229,7 +229,7 @@ msgstr ""
229
229
230
230
#: ../../library/ast.rst:160
231
231
msgid "*body* is a :class:`list` of the module's :ref:`ast-statements`."
232
- msgstr "*body* 是模組的\\ :ref:`ast-statements` :class:`list`。"
232
+ msgstr "*body* 是模組的\\ :ref:`ast-statements` 的一個 :class:`list`。"
233
233
234
234
#: ../../library/ast.rst:162
235
235
msgid ""
@@ -244,22 +244,23 @@ msgid ""
244
244
"A single Python :ref:`expression input <expression-input>`. Node type "
245
245
"generated by :func:`ast.parse` when *mode* is ``\" eval\" ``."
246
246
msgstr ""
247
- "單個 Python :ref:`運算式輸入 <expression-input>`,為當 *mode* 是 "
248
- "`` \" eval \" `` 時, :func:`ast.parse` 生成的節點型別 。"
247
+ "單個 Python :ref:`運算式輸入 <expression-input>`。當 *mode* 是 `` \" eval \" `` "
248
+ "時節點型別由 :func:`ast.parse` 生成 。"
249
249
250
250
#: ../../library/ast.rst:182
251
251
msgid ""
252
252
"*body* is a single node, one of the :ref:`expression types <ast-"
253
253
"expressions>`."
254
- msgstr "*body* 是單個節點,是\\ :ref:`運算式型別 <ast-expressions>`\\ 之一。"
254
+ msgstr ""
255
+ "*body* 是單個節點,是\\ :ref:`運算式型別 <ast-expressions>`\\ 的其中之一。"
255
256
256
257
#: ../../library/ast.rst:194
257
258
msgid ""
258
259
"A single :ref:`interactive input <interactive>`, like in :ref:`tut-interac`. "
259
260
"Node type generated by :func:`ast.parse` when *mode* is ``\" single\" ``."
260
261
msgstr ""
261
262
"單個\\ :ref:`互動式輸入 <interactive>`,和\\ :ref:`tut-interac`\\ 中所述的相"
262
- "似。為當 *mode* 是 ``\" single\" `` 時 :func:`ast.parse` 生成的節點型別 。"
263
+ "似。當 *mode* 是 ``\" single\" `` 時節點型別由 :func:`ast.parse` 生成 。"
263
264
264
265
#: ../../library/ast.rst:197
265
266
msgid "*body* is a :class:`list` of :ref:`statement nodes <ast-statements>`."
@@ -274,7 +275,7 @@ msgid ""
274
275
"generated by :func:`ast.parse` when *mode* is ``\" func_type\" ``."
275
276
msgstr ""
276
277
"函式的舊式型別註解的表示法,因為 3.5 之前的 Python 版本不支援 :pep:`484` 註"
277
- "釋。當 *mode* 為 ``\" func_type\" `` 時 :func:`ast.parse` 產生的節點型別 。"
278
+ "釋。當 *mode* 是 ``\" func_type\" `` 時節點型別由 :func:`ast.parse` 生成 。"
278
279
279
280
#: ../../library/ast.rst:220
280
281
msgid "Such type comments would look like this::"
@@ -348,8 +349,8 @@ msgid ""
348
349
"the value, or ``None`` if no format was specified. Both ``conversion`` and "
349
350
"``format_spec`` can be set at the same time."
350
351
msgstr ""
351
- "``format_spec`` 是一個 :class:`JoinedStr` 節點,表示值的格式,``None`` 則代表 "
352
- "未指定格式 。``conversion`` 和 ``format_spec`` 可以同時設定。"
352
+ "``format_spec`` 是一個 :class:`JoinedStr` 節點,表示值的格式,若未指定格式則 "
353
+ "為 ``None`` 。``conversion`` 和 ``format_spec`` 可以同時設定。"
353
354
354
355
#: ../../library/ast.rst:284
355
356
msgid ""
@@ -533,7 +534,7 @@ msgid ""
533
534
"An expression such as ``a if b else c``. Each field holds a single node, so "
534
535
"in the following example, all three are :class:`Name` nodes."
535
536
msgstr ""
536
- "像是 ``a if b else c`` 之類的運算式。每個欄位都包含一個節點 ,因此在以下範例"
537
+ "像是 ``a if b else c`` 之類的運算式。每個欄位都保存一個節點 ,因此在以下範例"
537
538
"中,所有三個都是 :class:`Name` 節點。"
538
539
539
540
#: ../../library/ast.rst:636
@@ -580,8 +581,8 @@ msgid ""
580
581
"occur only inside the *slice* field of :class:`Subscript`, either directly "
581
582
"or as an element of :class:`Tuple`."
582
583
msgstr ""
583
- "常規切片(形式為 ``lower:upper`` 或 ``lower:upper:step``\\ )。只能直接出現 "
584
- "在 :class:`Subscript` 的 *slice* 欄位內,或者作為 :class:`Tuple` 的元素出現 。"
584
+ "常規切片(形式為 ``lower:upper`` 或 ``lower:upper:step``\\ )。只能直接或者或 "
585
+ "者作為 :class:`Tuple` 的元素出現在 :class:` Subscript` 的 *slice* 欄位內。"
585
586
586
587
#: ../../library/ast.rst:714
587
588
msgid "Comprehensions"
@@ -685,7 +686,7 @@ msgid ""
685
686
"``raise``. ``cause`` is the optional part for ``y`` in ``raise x from y``."
686
687
msgstr ""
687
688
"一個 ``raise`` 陳述式。``exc`` 是要引發的例外物件,通常是 :class:`Call` 或 :"
688
- "class:`Name`,或者獨立 ``raise`` 的則為 ``None``。``cause`` 是 ``raise x "
689
+ "class:`Name`,若是獨立的 ``raise`` 則為 ``None``。``cause`` 是 ``raise x "
689
690
"from y`` 中的可選部分 ``y``。"
690
691
691
692
#: ../../library/ast.rst:977
@@ -741,7 +742,7 @@ msgid ""
741
742
"import (0 means absolute import)."
742
743
msgstr ""
743
744
"代表 ``from x import y``。``module`` 是 'from' 名稱的原始字串,前面沒有任何的"
744
- "點 (dot),或者對於諸如 ``from . import foo`` 之類的陳述式為 ``None``。"
745
+ "點 (dot),或者對於諸如 ``from . import foo`` 之類的陳述式則為 ``None``。"
745
746
"``level`` 是一個整數,保存相對引入的級別(0 表示絕對引入)。"
746
747
747
748
#: ../../library/ast.rst:1089
@@ -865,7 +866,7 @@ msgid ""
865
866
"iterable of :class:`match_case` nodes with the different cases."
866
867
msgstr ""
867
868
"一個 ``match`` 陳述式。``subject`` 保存匹配的主題(與案例匹配的物件),"
868
- "``cases`` 包含具有不同案例的可疊代 :class:`match_case` 節點 。"
869
+ "``cases`` 包含具有不同案例的 :class:`match_case` 節點的可疊代物件 。"
869
870
870
871
#: ../../library/ast.rst:1417
871
872
msgid ""
@@ -967,7 +968,7 @@ msgid ""
967
968
"pattern)."
968
969
msgstr ""
969
970
"匹配類別模式。``cls`` 是一個給定要匹配的名義類別 (nominal class) 的運算式。"
970
- "``patterns`` 是要與類定義的模式匹配屬性序列進行匹配的模式節點序列 。"
971
+ "``patterns`` 是要與類別定義的模式匹配屬性序列進行匹配的模式節點序列 。"
971
972
"``kwd_attrs`` 是要匹配的附加屬性序列(在類別模式中指定為關鍵字引數),"
972
973
"``kwd_patterns`` 是相應的模式(在類別模式中指定為關鍵字的值)。"
973
974
@@ -1101,7 +1102,7 @@ msgid ""
1101
1102
"expression. Unlike :class:`FunctionDef`, ``body`` holds a single node."
1102
1103
msgstr ""
1103
1104
"``lambda`` 是可以在運算式內使用的最小函式定義。與 :class:`FunctionDef` 不同,"
1104
- "``body`` 持有單個節點 。"
1105
+ "``body`` 保存單個節點 。"
1105
1106
1106
1107
#: ../../library/ast.rst:1923
1107
1108
msgid "The arguments for a function."
@@ -1188,7 +1189,7 @@ msgid ""
1188
1189
"'metaclass'. Other keywords will be passed to the metaclass, as per "
1189
1190
"`PEP-3115 <https://peps.python.org/pep-3115/>`_."
1190
1191
msgstr ""
1191
- "``keywords`` 是一個 :class:`keyword` 節點的串列,主要用於 'metaclass'(元類"
1192
+ "``keywords`` 是一個 :class:`. keyword` 節點的串列,主要用於 'metaclass'(元類"
1192
1193
"別)。如 `PEP-3115 <https://peps.python.org/pep-3115/>`_ 所述,其他關鍵字將被"
1193
1194
"傳遞到 metaclass。"
1194
1195
0 commit comments