Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita3418ca

Browse files
committed
Translate faq/design.html#how-fast-are-exceptions
1 parentbe90f1f commita3418ca

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎faq/design.po‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,27 +421,38 @@ msgstr ""
421421

422422
#:../../faq/design.rst:233
423423
msgid"How fast are exceptions?"
424-
msgstr""
424+
msgstr"例外處理有多快?"
425425

426426
#:../../faq/design.rst:235
427427
msgid""
428428
"A try/except block is extremely efficient if no exceptions are raised. "
429429
"Actually catching an exception is expensive. In versions of Python prior to "
430430
"2.0 it was common to use this idiom::"
431431
msgstr""
432+
"如果沒有例外被丟出,一個 try/except 區塊是非常有效率的。事實上,抓捕例外要付"
433+
"出昂貴的代價。在 Python 2.0 以前,這樣使用是相當常見的:\n"
434+
"\n"
435+
"::"
432436

433437
#:../../faq/design.rst:245
434438
msgid""
435439
"This only made sense when you expected the dict to have the key almost all "
436440
"the time. If that wasn't the case, you coded it like this::"
437441
msgstr""
442+
"這只有在你預料這個字典大多數時候都有鍵的時候才合理。如果並非如此,你應該寫"
443+
"成:\n"
444+
"\n"
445+
"::"
438446

439447
#:../../faq/design.rst:253
440448
msgid""
441449
"For this specific case, you could also use ``value = dict.setdefault(key, "
442450
"getvalue(key))``, but only if the ``getvalue()`` call is cheap enough "
443451
"because it is evaluated in all cases."
444452
msgstr""
453+
"單就這個情況來說,你也可以用 ``value = dict.setdefault(key, "
454+
"getvalue(key))``,不過只有在 ``getvalue()`` 代價不大的時候才能用,畢竟他每次"
455+
"都會被執行。"
445456

446457
#:../../faq/design.rst:259
447458
msgid"Why isn't there a switch or case statement in Python?"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp