8000 Translate faq/design.html#why-can-t-lambda-expressions-contain-statem… · python/python-docs-zh-tw@4813c28 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4813c28

Browse files
committed
Translate faq/design.html#why-can-t-lambda-expressions-contain-statements
1 parent 7fcdf2c commit 4813c28

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

faq/design.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ msgstr ""
525525

526526
#: ../../faq/design.rst:306
527527
msgid "Why can't lambda expressions contain statements?"
528-
msgstr "為何lambda表示式不能包含在敘述內"
528+
msgstr "為何 lambda 運算式不能包含陳述式?"
529529

530530
#: ../../faq/design.rst:308
531531
msgid ""
@@ -535,6 +535,10 @@ msgid ""
535535
"other languages, where they add functionality, Python lambdas are only a "
536536
"shorthand notation if you're too lazy to define a function."
537537
msgstr ""
538+
"Python 的 lambda 運算式不能包含陳述式是因為 Python 的語法框架無法處理包在運算"
539+
"式中的陳述式。然而,在 Python 裡這並不是一個嚴重的問題。不像在其他語言中有獨"
540+
"立功能的 lambda,Python 的 lambda 只是一個在你懶得定義函式時可用的一個簡寫表"
541+
"達法。"
538542

539543
#: ../../faq/design.rst:314
540544
msgid ""
@@ -545,6 +549,9 @@ msgid ""
545549
"(which is exactly the same type of object that a lambda expression yields) "
546550
"is assigned!"
547551
msgstr ""
552+
"函式已經是 Python 裡的一級物件 (first class objects),而且可以在區域範圍內被"
553+
"宣告。因此唯一用 lambda 而非區域性的函式的優點就是你不需要多想一個函式名稱 — "
554+
"但這樣就會是一個區域變數被指定成函數物件(和 lambda 運算式的結果同類)!"
548555

549556
#: ../../faq/design.rst:322
550557
msgid "Can Python be compiled to machine code, C or some other language?"

0 commit comments

Comments
 (0)
0