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

Commitb80dc54

Browse files
committed
fix: Apply suggestions from code review
1 parentad888b0 commitb80dc54

File tree

1 file changed

+35
-36
lines changed

1 file changed

+35
-36
lines changed

‎library/weakref.po

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version:Python 3.12\n"
99
"Report-Msgid-Bugs-To:\n"
1010
"POT-Creation-Date:2023-10-11 17:13+0000\n"
11-
"PO-Revision-Date:2024-05-17 00:33+0800\n"
11+
"PO-Revision-Date:2024-05-22 20:58+0800\n"
1212
"Last-Translator:Adrian Liaw <adrianliaw2000@gmail.com>\n"
1313
"Language-Team:Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1414
"tw)\n"
@@ -112,7 +112,7 @@ msgid ""
112112
msgstr""
113113
":class:`finalize` 提供了一種直接的方法來註冊在物件被垃圾回收時呼叫的清理函"
114114
"式。這比在原始弱參照上設定回呼函式更容易使用,因為模組在物件被回收前會自動確"
115-
"保最終化函式(finalizer) 保持存活。"
115+
"保最終化器(finalizer) 保持存活。"
116116

117117
#:../../library/weakref.rst:63
118118
msgid""
@@ -188,7 +188,7 @@ msgid ""
188188
"passed as the only parameter to the callback; the referent will no longer be "
189189
"available."
190190
msgstr""
191-
"傳回對 *object* 的弱參照。如果參照目標仍存活,則可以透過呼叫參照物件來取回原"
191+
"回傳對 *object* 的弱參照。如果參照目標仍存活,則可以透過呼叫參照物件來取回原"
192192
"始物件;如果參照目標已不存活,呼叫參照物件將導致 :const:`None` 被回傳。如果 "
193193
"*callback* 被提供而非 :const:`None`,且回傳的弱參照物件仍存活,那麼當物件即將"
194194
"被最終化 (finalize) 時,回呼將被呼叫;弱參照物件將作為唯一的參數傳遞給回呼;"
@@ -264,7 +264,7 @@ msgid ""
264264
"keys. *callback* is the same as the parameter of the same name to the :func:"
265265
"`ref` function."
266266
msgstr""
267-
"傳回一個使用弱參照的 *object* 的代理 (proxy)。這支援在大多數情境中使用代理,"
267+
"回傳一個使用弱參照的 *object* 的代理 (proxy)。這支援在大多數情境中使用代理,"
268268
"而不需要對弱參照物件明確地取消參照。回傳的物件將具有 ``ProxyType`` 或 "
269269
"``CallableProxyType`` 型別,具體取決於 *object* 是否為可呼叫物件。無論參照目"
270270
"標如何,代理物件都不是 :term:`hashable`;這避免了與其基本可變物件本質相關的許"
@@ -340,7 +340,7 @@ msgstr ""
340340

341341
#:../../library/weakref.rst:212
342342
msgid"Return an iterable of the weak references to the keys."
343-
msgstr"傳回對鍵的弱參照的可疊代物件。"
343+
msgstr"回傳對鍵的弱參照的可疊代物件。"
344344

345345
#:../../library/weakref.rst:217
346346
msgid""
@@ -363,7 +363,7 @@ msgstr ""
363363

364364
#:../../library/weakref.rst:229
365365
msgid"Return an iterable of the weak references to the values."
366-
msgstr"傳回對值的弱參照的可疊代物件。"
366+
msgstr"回傳對值的弱參照的可疊代物件。"
367367

368368
#:../../library/weakref.rst:234
369369
msgid""
@@ -399,9 +399,9 @@ msgid ""
399399
"always survive until the reference object is collected, greatly simplifying "
400400
"lifecycle management."
401401
msgstr""
402-
"傳回可呼叫的最終化函式物件,此物件在 *obj* 被垃圾回收時會被呼叫。與一般的弱參"
403-
"照不同,最終化函式將始終存在,直到參照物件被回收為止,從而大大簡化了生命週期"
404-
"管理。"
402+
"回傳可呼叫的最終化器物件,此物件在 *obj* 被垃圾回收時會被呼叫。與一般的弱參照"
403+
"不同,最終化器將始終存在,直到參照物件被回收為止,從而大大簡化了生命週期管"
404+
"。"
405405

406406
#:../../library/weakref.rst:275
407407
msgid""
@@ -410,9 +410,9 @@ msgid ""
410410
"finalizer returns the result of evaluating ``func(*arg, **kwargs)``, whereas "
411411
"calling a dead finalizer returns :const:`None`."
412412
msgstr""
413-
"最終化函式在被呼叫(明確呼叫或在垃圾回收時)之前被視為\\ *存活*,之後它就會"
414-
"\\ *死亡*。呼叫存活的最終化函式會回傳 ``func(*arg, **kwargs)`` 的計算結果,"
415-
"呼叫死亡的最終化函式會回傳 :const:`None`。"
413+
"最終化器在被呼叫(明確呼叫或在垃圾回收時)之前被視為\\ *存活*,之後它就會\\ *"
414+
"死亡*。呼叫存活的最終化器會回傳 ``func(*arg, **kwargs)`` 的計算結果,而呼叫死"
415+
"亡的最終化器會回傳 :const:`None`。"
416416

417417
#:../../library/weakref.rst:280
418418
msgid""
@@ -421,26 +421,25 @@ msgid ""
421421
"handled in the same way as exceptions raised from an object's :meth:`~object."
422422
"__del__` method or a weak reference's callback."
423423
msgstr""
424-
"垃圾回收期間最終化函式回呼引發的例外會在標準錯誤輸出中顯示,但無法傳播。它們"
425-
"的處理方式與從物件的 :meth:`~object.__del__` 方法或弱參照的回呼引發的例外相"
426-
"同。"
424+
"垃圾回收期間最終化器回呼引發的例外會在標準錯誤輸出中顯示,但無法傳播。它們的"
425+
"處理方式與從物件的 :meth:`~object.__del__` 方法或弱參照的回呼引發的例外相同。"
427426

428427
#:../../library/weakref.rst:286
429428
msgid""
430429
"When the program exits, each remaining live finalizer is called unless its :"
431430
"attr:`atexit` attribute has been set to false. They are called in reverse "
432431
"order of creation."
433432
msgstr""
434-
"當程式結束時,除非該最終化函式的 :attr:`atexit` 屬性已被設定為 false,否則每"
435-
"個存活的最終化函式會被呼叫。它們以與建立相反的順序被呼叫。"
433+
"當程式結束時,除非該最終化器的 :attr:`atexit` 屬性已被設定為 false,否則每個"
434+
"存活的最終化器會被呼叫。它們以與建立相反的順序被呼叫。"
436435

437436
#:../../library/weakref.rst:290
438437
msgid""
439438
"A finalizer will never invoke its callback during the later part of the :"
440439
"term:`interpreter shutdown` when module globals are liable to have been "
441440
"replaced by :const:`None`."
442441
msgstr""
443-
"當模組的 globals 可能被 :const:`None` 取代時,最終化函式永遠不會在 :term:"
442+
"當模組的 globals 可能被 :const:`None` 取代時,最終化器永遠不會在 :term:"
444443
"`interpreter shutdown` 的後期調用(invoke)其回呼。"
445444

446445
#:../../library/weakref.rst:296
@@ -469,7 +468,7 @@ msgstr ""
469468

470469
#:../../library/weakref.rst:313
471470
msgid"Property which is true if the finalizer is alive, false otherwise."
472-
msgstr"如果最終化函式仍存活,則屬性為 true,否則為 false。"
471+
msgstr"如果最終化器仍存活,則屬性為 true,否則為 false。"
473472

474473
#:../../library/weakref.rst:317
475474
msgid""
@@ -478,7 +477,7 @@ msgid ""
478477
"true. They are called in reverse order of creation."
479478
msgstr""
480479
"一個可寫的布林屬性,預設為 true。當程式結束時,它會呼叫 :attr:`.atexit` 為 "
481-
"true的所有剩餘且仍存活的最終化函式。它們以與建立相反的順序被呼叫。"
480+
"true的所有剩餘且仍存活的最終化器。它們以與建立相反的順序被呼叫。"
482481

483482
#:../../library/weakref.rst:324
484483
msgid""
@@ -600,31 +599,31 @@ msgstr ""
600599

601600
#:../../library/weakref.rst:465
602601
msgid"Finalizer Objects"
603-
msgstr"最終化函式物件"
602+
msgstr"最終化器物件"
604603

605604
#:../../library/weakref.rst:467
606605
msgid""
607606
"The main benefit of using :class:`finalize` is that it makes it simple to "
608607
"register a callback without needing to preserve the returned finalizer "
609608
"object. For instance"
610609
msgstr""
611-
"使用 :class:`finalize` 的最大優點是可以輕鬆註冊回呼,而無需保留回傳的最終化函"
612-
"式物件。例如"
610+
"使用 :class:`finalize` 的最大優點是可以輕鬆註冊回呼,而無需保留回傳的最終化器"
611+
"物件。例如"
613612

614613
#:../../library/weakref.rst:481
615614
msgid""
616615
"The finalizer can be called directly as well. However the finalizer will "
617616
"invoke the callback at most once."
618-
msgstr"最終化函式也可以直接被呼叫。然而,最終化函式最多會調用回乎一次。"
617+
msgstr"最終化器也可以直接被呼叫。然而,最終化器最多會調用回乎一次。"
619618

620619
#:../../library/weakref.rst:497
621620
msgid""
622621
"You can unregister a finalizer using its :meth:`~finalize.detach` method. "
623622
"This kills the finalizer and returns the arguments passed to the constructor "
624623
"when it was created."
625624
msgstr""
626-
"你可以使用最終化函式的 :meth:`~finalize.detach`方法來取消註冊最終化函式。這"
627-
"會殺死最終化函式並回傳建立建構函式時傳遞給建構函式的引數。"
625+
"你可以使用最終化器的 :meth:`~finalize.detach`方法來取消註冊最終化器。這會殺"
626+
"死最終化器並回傳建立建構函式時傳遞給建構函式的引數。"
628627

629628
#:../../library/weakref.rst:511
630629
msgid""
@@ -633,11 +632,11 @@ msgid ""
633632
"instance"
634633
msgstr""
635634
"除非你將 :attr:`~finalize.atexit` 屬性設為 :const:`False`,否則當程式結束時,"
636-
"最終化函式將會被呼叫如果其仍然存在。例如"
635+
"最終化器將會被呼叫如果其仍然存在。例如"
637636

638637
#:../../library/weakref.rst:526
639638
msgid"Comparing finalizers with :meth:`~object.__del__` methods"
640-
msgstr"最終化函式與 :meth:`~object.__del__` 方法的比較"
639+
msgstr"最終化器與 :meth:`~object.__del__` 方法的比較"
641640

642641
#:../../library/weakref.rst:528
643642
msgid""
@@ -693,26 +692,26 @@ msgid ""
693692
"the specific functions and objects that it needs, rather than having access "
694693
"to the full state of the object::"
695694
msgstr""
696-
"更耐用的替代方案可以是定義一個最終化函式,其僅參照需要的特定函式和物件,而不"
697-
"是存取物件的完整狀態: ::"
695+
"更耐用的替代方案可以是定義一個最終化器,其僅參照需要的特定函式和物件,而不是"
696+
"存取物件的完整狀態: ::"
698697

699698
#:../../library/weakref.rst:580
700699
msgid""
701700
"Defined like this, our finalizer only receives a reference to the details it "
702701
"needs to clean up the directory appropriately. If the object never gets "
703702
"garbage collected the finalizer will still be called at exit."
704703
msgstr""
705-
"定義如下,我們的最終化函式僅接收對適當清理目錄所需的詳細資訊的參照。如果物件"
706-
"從未被垃圾回收,則最終化函式仍將在結束時被呼叫。"
704+
"定義如下,我們的最終化器僅接收對適當清理目錄所需的詳細資訊的參照。如果物件從"
705+
"未被垃圾回收,則最終化器仍將在結束時被呼叫。"
707706

708707
#:../../library/weakref.rst:584
709708
msgid""
710709
"The other advantage of weakref based finalizers is that they can be used to "
711710
"register finalizers for classes where the definition is controlled by a "
712711
"third party, such as running code when a module is unloaded::"
713712
msgstr""
714-
"基於 weakref的最終化函式的另一個優點是它們可用於為定義由第三方控制的類別註冊"
715-
"最終化函式,例如在卸載模組時執行程式碼: ::"
713+
"基於 weakref的最終化器的另一個優點是它們可用於為定義由第三方控制的類別註冊最"
714+
"終化器,例如在卸載模組時執行程式碼: ::"
716715

717716
#:../../library/weakref.rst:596
718717
msgid""
@@ -721,6 +720,6 @@ msgid ""
721720
"at exit. However, in a daemonic thread :func:`atexit.register`, ``try: ... "
722721
"finally: ...`` and ``with: ...`` do not guarantee that cleanup occurs either."
723722
msgstr""
724-
"如果在程式結束時在常駐的 (daemonic)執行緒中建立最終化函式物件,則最終化函式"
725-
"有可能在結束時不會被呼叫。然而,在常駐的執行緒中 :func:`atexit.register`、"
723+
"如果在程式結束時在常駐的 (daemonic)執行緒中建立最終化器物件,則最終化器有可"
724+
"能在結束時不會被呼叫。然而,在常駐的執行緒中 :func:`atexit.register`、"
726725
"``try: ... finally: ...`` 和 ``with: ...`` 也不保證清理會發生。"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp