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

Commite1c5ebd

Browse files
committed
Update tutorial/errors.po
Update with cpython 3.11
1 parentf75093f commite1c5ebd

File tree

1 file changed

+59
-7
lines changed

1 file changed

+59
-7
lines changed

‎tutorial/errors.po

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
#
55
# Translators:
66
# jerrychen <jerrychen.ee@gmail.com>, 2016
7-
# Steven Hsu <hsuhaochun@gmail.com>, 2021
7+
# Steven Hsu <hsuhaochun@gmail.com>, 2021-2022
88
# Matt Wang <mattwang44@gmail.com>, 2021
99
msgid ""
1010
msgstr ""
1111
"Project-Id-Version:Python 3.11\n"
1212
"Report-Msgid-Bugs-To:\n"
1313
"POT-Creation-Date:2022-10-15 20:43+0000\n"
14-
"PO-Revision-Date:2022-10-16 05:53+0800\n"
15-
"Last-Translator:Matt Wang <mattwang44@gmail.com>\n"
14+
"PO-Revision-Date:2022-10-24 14:54+0800\n"
15+
"Last-Translator:Steven Hsu <hsuhaochun@gmail.com>\n"
1616
"Language-Team:Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1717
"tw)\n"
1818
"Language:zh_TW\n"
1919
"MIME-Version:1.0\n"
2020
"Content-Type:text/plain; charset=UTF-8\n"
2121
"Content-Transfer-Encoding:8bit\n"
2222
"Plural-Forms:nplurals=1; plural=0;\n"
23-
"X-Generator:Poedit 3.1.1\n"
23+
"X-Generator:Poedit 3.2\n"
2424

2525
#:../../tutorial/errors.rst:5
2626
msgid"Errors and Exceptions"
@@ -265,6 +265,11 @@ msgid ""
265265
"exit` and :exc:`KeyboardInterrupt` which is raised when a user wishes to "
266266
"interrupt the program."
267267
msgstr""
268+
":exc:`BaseException` 是由全部的例外所共用的 base class。它的 subclass(子類"
269+
"別)之一,:exc:`Exception`,則是所有非嚴重例外 (non-fatal exception) 的 base "
270+
"class。有些例外不是 :exc:`Exception` 的 subclass,而它們通常不會被處理,因為"
271+
"它們是用來指示程式應該終止。這些例外包括了由 :meth:`sys.exit` 所引發的 :exc:"
272+
"`SystemExit`,以及當使用者想要中斷程式時所引發的 :exc:`KeyboardInterrupt`。"
268273

269274
#:../../tutorial/errors.rst:188
270275
msgid""
@@ -273,13 +278,20 @@ msgid ""
273278
"exceptions that we intend to handle, and to allow any unexpected exceptions "
274279
"to propagate on."
275280
msgstr""
281+
":exc:`Exception` 可以用作通配符 (wildcard) 來捕獲(幾乎)所有的例外。然而,比"
282+
"較好的做法是盡可能具體地說明我們打算處理的例外類型,並容許任何非預期例外的傳"
283+
"遞 (propagate)。"
276284

277285
#:../../tutorial/errors.rst:193
278286
msgid""
279287
"The most common pattern for handling :exc:`Exception` is to print or log the "
280288
"exception and then re-raise it (allowing a caller to handle the exception as "
281289
"well)::"
282290
msgstr""
291+
"處理 :exc:`Exception` 的最常見模式,是先將該例外印出或記錄,然後再重新引發它"
292+
"(也允許一個呼叫函式 (caller) 來處理該例外):\n"
293+
"\n"
294+
"::"
283295

284296
#:../../tutorial/errors.rst:211
285297
msgid""
@@ -338,7 +350,7 @@ msgid ""
338350
"instantiated by calling its constructor with no arguments::"
339351
msgstr""
340352
":keyword:`raise` 唯一的引數就是要引發的例外。該引數必須是一個例外實例或例外 "
341-
"class(衍生自 :class:`BaseException` 的 class,例如 :class:`Exception`與他"
353+
"class(衍生自 :class:`BaseException` 的 class,例如 :class:`Exception`與它"
342354
"的 subclass)。如果一個例外 class 被傳遞,它會不含引數地呼叫它的建構函式 "
343355
"(constructor) ,使它被自動建立實例 (implicitly instantiated):\n"
344356
"\n"
@@ -365,12 +377,20 @@ msgid ""
365377
"will have the exception being handled attached to it and included in the "
366378
"error message::"
367379
msgstr""
380+
"如果在 :keyword:`except` 段落內部發生了一個未處理的例外,則它會讓這個將要被處"
381+
"理的例外附加在後,並將其包含在錯誤訊息中:\n"
382+
"\n"
383+
"::"
368384

369385
#:../../tutorial/errors.rst:306
370386
msgid""
371387
"To indicate that an exception is a direct consequence of another, the :"
372388
"keyword:`raise` statement allows an optional :keyword:`from<raise>` clause::"
373389
msgstr""
390+
"為了表明一個例外是另一個例外的直接結果,:keyword:`raise` 陳述式容許一個選擇性"
391+
"的 :keyword:`from<raise>` 子句:\n"
392+
"\n"
393+
"::"
374394

375395
#:../../tutorial/errors.rst:312
376396
msgid"This can be useful when you are transforming exceptions. For example::"
@@ -384,6 +404,9 @@ msgid ""
384404
"It also allows disabling automatic exception chaining using the ``from "
385405
"None`` idiom::"
386406
msgstr""
407+
"它也容許使用慣用語 ``from None`` 來停用自動例外鏈接:\n"
408+
"\n"
409+
"::"
387410

388411
#:../../tutorial/errors.rst:345
389412
msgid""
@@ -583,7 +606,7 @@ msgstr ""
583606

584607
#:../../tutorial/errors.rst:496
585608
msgid"Raising and Handling Multiple Unrelated Exceptions"
586-
msgstr""
609+
msgstr"引發及處理多個無關的例外"
587610

588611
#:../../tutorial/errors.rst:498
589612
msgid""
@@ -593,13 +616,21 @@ msgid ""
593616
"cases where it is desirable to continue execution and collect multiple "
594617
"errors rather than raise the first exception."
595618
msgstr""
619+
"在某些情況下,必須回報已經發生的多個例外。在並行框架 (concurrency framework) "
620+
"中經常會出現這種情況,當平行的 (parallel) 某些任務可能已經失效,但還有其他用"
621+
"例 (use case) 希望能繼續執行並收集多個例外,而不是只有引發第一個例外時。"
596622

597623
#:../../tutorial/errors.rst:504
598624
msgid""
599625
"The builtin :exc:`ExceptionGroup` wraps a list of exception instances so "
600626
"that they can be raised together. It is an exception itself, so it can be "
601627
"caught like any other exception. ::"
602628
msgstr""
629+
"內建的 :exc:`ExceptionGroup` 會包裝一個例外實例 (exception instance) 的 "
630+
"list(串列),使得它們可以一起被引發。由於它本身就是一個例外,因此它也可以像"
631+
"任何其他例外一樣被捕獲。\n"
632+
"\n"
633+
"::"
603634

604635
#:../../tutorial/errors.rst:530
605636
msgid""
@@ -609,6 +640,12 @@ msgid ""
609640
"extracts from the group exceptions of a certain type while letting all other "
610641
"exceptions propagate to other clauses and eventually to be reraised. ::"
611642
msgstr""
643+
"若使用 ``except*`` 代替 ``except``,我們可以選擇性地只處理該群組中與特定類型"
644+
"匹配的例外。在以下範例中,展示了一個巢狀的例外群組 (exception group),每個 "
645+
"``except*`` 子句分別從該群組中提取一個特定類型的例外,同時讓所有其他的例外都"
646+
"傳遞到其他子句,最後再被重新引發。\n"
647+
"\n"
648+
"::"
612649

613650
#:../../tutorial/errors.rst:564
614651
msgid""
@@ -617,10 +654,14 @@ msgid ""
617654
"that have already been raised and caught by the program, along the following "
618655
"pattern::"
619656
msgstr""
657+
"請注意,被巢套在例外群組中的例外必須是實例,而不是類型。這是因為在實務上,這"
658+
"些例外通常是已經被程式引發並捕獲的例外,類似以下的模式:\n"
659+
"\n"
660+
"::"
620661

621662
#:../../tutorial/errors.rst:582
622663
msgid"Enriching Exceptions with Notes"
623-
msgstr""
664+
msgstr"用註解使例外更詳細"
624665

625666
#:../../tutorial/errors.rst:584
626667
msgid""
@@ -632,13 +673,24 @@ msgid ""
632673
"standard traceback rendering includes all notes, in the order they were "
633674
"added, after the exception. ::"
634675
msgstr""
676+
"當一個例外是為了被引發而建立時,它通常會伴隨著一些資訊被初始化,這些資訊描述"
677+
"了當下發生的錯誤。在某些情況,在例外被捕獲之後添加資訊會很有用。為此,例外具"
678+
"有一個 ``add_note(note)`` method(方法),它可以接收一個字串並將其添加到例外"
679+
"的註解清單中。標準的回溯呈現會在例外之後列出所有的註解,並按照其被添加的順序"
680+
"來排列。\n"
681+
"\n"
682+
"::"
635683

636684
#:../../tutorial/errors.rst:605
637685
msgid""
638686
"For example, when collecting exceptions into an exception group, we may want "
639687
"to add context information for the individual errors. In the following each "
640688
"exception in the group has a note indicating when this error has occurred. ::"
641689
msgstr""
690+
"例如,在將例外收集到例外群組中時,我們可能希望為各個錯誤添加一些上下文的資"
691+
"訊。在以下範例中,群組中的每個例外都有一條註解,指示此錯誤是在何時發生。\n"
692+
"\n"
693+
"::"
642694

643695
#~ msgid ""
644696
#~ "All exceptions inherit from :exc:`BaseException`, and so it can be used "

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp