Repository navigation
Expand file tree
/
Copy pathlifecycle.po
More file actions
528 lines (483 loc) · 29.9 KB
/
Copy pathlifecycle.po
File metadata and controls
528 lines (483 loc) · 29.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# python-doc bot, 2025
# Inada Naoki <songofacandy@gmail.com>, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-10-25 17:19+0000\n"
"PO-Revision-Date: 2025-09-16 00:00+0000\n"
"Last-Translator: Inada Naoki <songofacandy@gmail.com>, 2026\n"
"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/"
"ja/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ja\n"
"Plural-Forms: nplurals=1; plural=0;\n"
msgid "Object Life Cycle"
msgstr "オブジェクトのライフサイクル"
msgid ""
"This section explains how a type's slots relate to each other throughout the "
"life of an object. It is not intended to be a complete canonical reference "
"for the slots; instead, refer to the slot-specific documentation "
"in :ref:`type-structs` for details about a particular slot."
msgstr ""
"この節では、オブジェクトの生存期間を通じて型の各スロットがどのように関係する"
"かを説明します。\n"
"各スロットの完全なリファレンスを意図したものではありません。\n"
"個々のスロットの詳細は :ref:`type-structs` の該当する説明を参照してください。"
msgid "Life Events"
msgstr "生存期間中のイベント"
msgid ""
"The figure below illustrates the order of events that can occur throughout "
"an object's life. An arrow from *A* to *B* indicates that event *B* can "
"occur after event *A* has occurred, with the arrow's label indicating the "
"condition that must be true for *B* to occur after *A*."
msgstr ""
"次の図は、オブジェクトの生存期間中に起こり得るイベントの順序を示していま"
"す。\n"
"*A* から *B* への矢印は、イベント *A* の後にイベント *B* が起こり得ることを示"
"します。\n"
"矢印のラベルは、*A* の後に *B* が起こるために必要な条件を表します。"
msgid "Diagram showing events in an object's life. Explained in detail below."
msgstr ""
"オブジェクトの生存期間中のイベントを示す図。\n"
"詳細は後述します。"
msgid "Explanation:"
msgstr "説明:"
msgid "When a new object is constructed by calling its type:"
msgstr "型を呼び出して新しいオブジェクトを構築するとき:"
msgid ":c:member:`~PyTypeObject.tp_new` is called to create a new object."
msgstr ""
"新しいオブジェクトを作成するために :c:member:`~PyTypeObject.tp_new` が呼び出"
"されます。"
msgid ""
":c:member:`~PyTypeObject.tp_alloc` is directly called "
"by :c:member:`~PyTypeObject.tp_new` to allocate the memory for the new "
"object."
msgstr ""
":c:member:`~PyTypeObject.tp_new` が :c:member:`~PyTypeObject.tp_alloc` を直接"
"呼び出し、新しいオブジェクトのメモリを割り当てます。"
msgid ""
":c:member:`~PyTypeObject.tp_init` initializes the newly created "
"object. :c:member:`!tp_init` can be called again to re-initialize an object, "
"if desired. The :c:member:`!tp_init` call can also be skipped entirely, for "
"example by Python code calling :py:meth:`~object.__new__`."
msgstr ""
":c:member:`~PyTypeObject.tp_init` が新しく作成されたオブジェクトを初期化しま"
"す。\n"
"必要であれば :c:member:`!tp_init` を再度呼び出してオブジェクトを再初期化でき"
"ます。\n"
"また、例えば Python コードから :py:meth:`~object.__new__` を呼び出す場合な"
"ど、:c:member:`!tp_init` の呼び出しを完全に省くこともできます。"
msgid "After :c:member:`!tp_init` completes, the object is ready to use."
msgstr ""
":c:member:`!tp_init` が完了すると、オブジェクトを使えるようになります。"
msgid "Some time after the last reference to an object is removed:"
msgstr "オブジェクトへの最後の参照が取り除かれてからしばらく後:"
msgid ""
"If an object is not marked as *finalized*, it might be finalized by marking "
"it as *finalized* and calling its :c:member:`~PyTypeObject.tp_finalize` "
"function. Python does *not* finalize an object when the last reference to "
"it is deleted; use :c:func:`PyObject_CallFinalizerFromDealloc` to ensure "
"that :c:member:`~PyTypeObject.tp_finalize` is always called."
msgstr ""
"オブジェクトに *ファイナライズ済み* の印が付いていない場合、*ファイナライズ済"
"み* として印を付けて :c:member:`~PyTypeObject.tp_finalize` 関数を呼び出すこと"
"により、ファイナライズされる可能性があります。\n"
"Python は最後の参照が削除されたときにオブジェクトをファイナライズするわけで"
"は *ありません*。\n"
":c:member:`~PyTypeObject.tp_finalize` が必ず呼び出されるようにするに"
"は、:c:func:`PyObject_CallFinalizerFromDealloc` を使ってください。"
msgid ""
"If the object is marked as finalized, :c:member:`~PyTypeObject.tp_clear` "
"might be called by the garbage collector to clear references held by the "
"object. It is *not* called when the object's reference count reaches zero."
msgstr ""
"オブジェクトにファイナライズ済みの印が付いている場合、ガベージコレクタ"
"が :c:member:`~PyTypeObject.tp_clear` を呼び出して、オブジェクトの保持する参"
"照をクリアする可能性があります。\n"
"オブジェクトの参照カウントがゼロになったときに呼び出されるわけでは *ありませ"
"ん*。"
msgid ""
":c:member:`~PyTypeObject.tp_dealloc` is called to destroy the object. To "
"avoid code duplication, :c:member:`~PyTypeObject.tp_dealloc` typically calls "
"into :c:member:`~PyTypeObject.tp_clear` to free up the object's references."
msgstr ""
"オブジェクトを破棄するために :c:member:`~PyTypeObject.tp_dealloc` が呼び出さ"
"れます。\n"
"コードの重複を避けるため、:c:member:`~PyTypeObject.tp_dealloc` は通"
"常 :c:member:`~PyTypeObject.tp_clear` を呼び出してオブジェクトの参照を解放し"
"ます。"
msgid ""
"When :c:member:`~PyTypeObject.tp_dealloc` finishes object destruction, it "
"directly calls :c:member:`~PyTypeObject.tp_free` (usually set "
"to :c:func:`PyObject_Free` or :c:func:`PyObject_GC_Del` automatically as "
"appropriate for the type) to deallocate the memory."
msgstr ""
":c:member:`~PyTypeObject.tp_dealloc` はオブジェクトの破棄を終える"
"と、:c:member:`~PyTypeObject.tp_free` を直接呼び出してメモリを解放します。\n"
"このスロットには通常、型に応じて :c:func:`PyObject_Free` また"
"は :c:func:`PyObject_GC_Del` が自動的に設定されます。"
msgid ""
"The :c:member:`~PyTypeObject.tp_finalize` function is permitted to add a "
"reference to the object if desired. If it does, the object is "
"*resurrected*, preventing its pending destruction. (Only :c:member:`!"
"tp_finalize` is allowed to resurrect an "
"object; :c:member:`~PyTypeObject.tp_clear` "
"and :c:member:`~PyTypeObject.tp_dealloc` cannot without calling "
"into :c:member:`!tp_finalize`.) Resurrecting an object may or may not cause "
"the object's *finalized* mark to be removed. Currently, Python does not "
"remove the *finalized* mark from a resurrected object if it supports garbage "
"collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set) but does "
"remove the mark if the object does not support garbage collection; either or "
"both of these behaviors may change in the future."
msgstr ""
":c:member:`~PyTypeObject.tp_finalize` 関数は、必要に応じてオブジェクトへの参"
"照を追加できます。\n"
"参照を追加するとオブジェクトが *復活* し、予定されていた破棄が阻止されま"
"す。\n"
"オブジェクトを復活させられるのは :c:member:`!tp_finalize` だけです。\n"
":c:member:`~PyTypeObject.tp_clear` と :c:member:`~PyTypeObject.tp_dealloc` "
"は、:c:member:`!tp_finalize` を呼び出さずに復活させることはできません。\n"
"復活したオブジェクトの *ファイナライズ済み* の印は、取り除かれる場合も残る場"
"合もあります。\n"
"現在の Python は、ガベージコレクションをサポートするオブジェクト "
"(:c:macro:`Py_TPFLAGS_HAVE_GC` フラグが設定されているもの) が復活した場合は *"
"ファイナライズ済み* の印を残し、サポートしない場合は印を取り除きます。\n"
"これらの動作の一方または両方は、将来変更される可能性があります。"
msgid ""
":c:member:`~PyTypeObject.tp_dealloc` can optionally "
"call :c:member:`~PyTypeObject.tp_finalize` "
"via :c:func:`PyObject_CallFinalizerFromDealloc` if it wishes to reuse that "
"code to help with object destruction. This is recommended because it "
"guarantees that :c:member:`!tp_finalize` is always called before "
"destruction. See the :c:member:`~PyTypeObject.tp_dealloc` documentation for "
"example code."
msgstr ""
":c:member:`~PyTypeObject.tp_dealloc` は、オブジェクトの破棄処理にコードを再利"
"用したい場合、:c:func:`PyObject_CallFinalizerFromDealloc` を介し"
"て :c:member:`~PyTypeObject.tp_finalize` を呼び出すことができます。\n"
"これによって破棄前に必ず :c:member:`!tp_finalize` が呼び出されるので、この方"
"法を推奨します。\n"
"コード例は :c:member:`~PyTypeObject.tp_dealloc` の説明を参照してください。"
msgid ""
"If the object is a member of a :term:`cyclic isolate` and "
"either :c:member:`~PyTypeObject.tp_clear` fails to break the reference cycle "
"or the cyclic isolate is not detected (perhaps :func:`gc.disable` was "
"called, or the :c:macro:`Py_TPFLAGS_HAVE_GC` flag was erroneously omitted in "
"one of the involved types), the objects remain indefinitely uncollectable "
"(they \"leak\"). See :data:`gc.garbage`."
msgstr ""
"オブジェクトが :term:`孤立した循環参照群 <cyclic isolate>` の一部であ"
"り、:c:member:`~PyTypeObject.tp_clear` が循環参照を解消できないか、その循環参"
"照群が検出されない場合、オブジェクトはいつまでも回収できずに残ります (「リー"
"ク」します)。\n"
"検出されない原因としては、:func:`gc.disable` が呼び出された場合や、関連する型"
"のいずれかで誤って :c:macro:`Py_TPFLAGS_HAVE_GC` フラグが省かれた場合などが考"
"えられます。\n"
":data:`gc.garbage` を参照してください。"
msgid ""
"If the object is marked as supporting garbage collection "
"(the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set "
"in :c:member:`~PyTypeObject.tp_flags`), the following events are also "
"possible:"
msgstr ""
"オブジェクトがガベージコレクションをサポートすると示されている場合 "
"(:c:member:`~PyTypeObject.tp_flags` に :c:macro:`Py_TPFLAGS_HAVE_GC` フラグが"
"設定されている場合)、次のイベントも起こり得ます。"
msgid ""
"The garbage collector occasionally "
"calls :c:member:`~PyTypeObject.tp_traverse` to identify :term:`cyclic "
"isolates <cyclic isolate>`."
msgstr ""
"ガベージコレクタは、ときどき :c:member:`~PyTypeObject.tp_traverse` を呼び出し"
"て :term:`孤立した循環参照群 <cyclic isolate>` を特定します。"
msgid ""
"When the garbage collector discovers a :term:`cyclic isolate`, it finalizes "
"one of the objects in the group by marking it as *finalized* and calling "
"its :c:member:`~PyTypeObject.tp_finalize` function, if it has one. This "
"repeats until the cyclic isolate doesn't exist or all of the objects have "
"been finalized."
msgstr ""
"ガベージコレクタは :term:`孤立した循環参照群 <cyclic isolate>` を発見すると、"
"その群のオブジェクトの 1 つに *ファイナライズ済み* の印を付"
"け、:c:member:`~PyTypeObject.tp_finalize` 関数があれば呼び出して、ファイナラ"
"イズします。\n"
"これを、孤立した循環参照群がなくなるか、すべてのオブジェクトがファイナライズ"
"されるまで繰り返します。"
msgid ""
":c:member:`~PyTypeObject.tp_finalize` is permitted to resurrect the object "
"by adding a reference from outside the :term:`cyclic isolate`. The new "
"reference causes the group of objects to no longer form a cyclic isolate "
"(the reference cycle may still exist, but if it does the objects are no "
"longer isolated)."
msgstr ""
":c:member:`~PyTypeObject.tp_finalize` は、:term:`孤立した循環参照群 <cyclic "
"isolate>` の外から参照を追加することで、オブジェクトを復活させられます。\n"
"新しい参照が加わると、その群は孤立した循環参照群ではなくなります (循環参照が"
"残っていても、オブジェクトはもはや孤立していません)。"
msgid ""
"When the garbage collector discovers a :term:`cyclic isolate` and all of the "
"objects in the group have already been marked as *finalized*, the garbage "
"collector clears one or more of the uncleared objects in the group (possibly "
"concurrently) by calling each's :c:member:`~PyTypeObject.tp_clear` "
"function. This repeats as long as the cyclic isolate still exists and not "
"all of the objects have been cleared."
msgstr ""
"ガベージコレクタが :term:`孤立した循環参照群 <cyclic isolate>` を発見し、その"
"群のすべてのオブジェクトに *ファイナライズ済み* の印が付いている場合、\n"
"まだクリアされていないオブジェクトのうち 1 つ以上について、それぞれ"
"の :c:member:`~PyTypeObject.tp_clear` 関数を呼び出してクリアします (並行して"
"行われる場合もあります)。\n"
"孤立した循環参照群が残っており、まだすべてのオブジェクトがクリアされていない"
"間、この処理を繰り返します。"
msgid "Cyclic Isolate Destruction"
msgstr "孤立した循環参照群の破棄"
msgid ""
"Listed below are the stages of life of a hypothetical :term:`cyclic isolate` "
"that continues to exist after each member object is finalized or cleared. "
"It is a memory leak if a cyclic isolate progresses through all of these "
"stages; it should vanish once all objects are cleared, if not sooner. A "
"cyclic isolate can vanish either because the reference cycle is broken or "
"because the objects are no longer isolated due to finalizer resurrection "
"(see :c:member:`~PyTypeObject.tp_finalize`)."
msgstr ""
"以下では、各オブジェクトをファイナライズまたはクリアした後も残り続けると仮定"
"した :term:`孤立した循環参照群 <cyclic isolate>` の段階を示します。\n"
"孤立した循環参照群がすべての段階を通過するなら、それはメモリリークです。\n"
"遅くともすべてのオブジェクトをクリアした時点で、孤立した循環参照群はなくなる"
"べきです。\n"
"循環参照が解消されるか、ファイナライザによる復活によってオブジェクトが孤立し"
"なくなると、孤立した循環参照群はなくなります "
"(:c:member:`~PyTypeObject.tp_finalize` を参照)。"
msgid ""
"**Reachable** (not yet a cyclic isolate): All objects are in their normal, "
"reachable state. A reference cycle could exist, but an external reference "
"means the objects are not yet isolated."
msgstr ""
"**到達可能** (まだ孤立した循環参照群ではありません): すべてのオブジェクトが通"
"常の到達可能な状態にあります。\n"
"循環参照があっても、外部からの参照があるのでまだ孤立していません。"
msgid ""
"**Unreachable but consistent:** The final reference from outside the cyclic "
"group of objects has been removed, causing the objects to become isolated "
"(thus a cyclic isolate is born). None of the group's objects have been "
"finalized or cleared yet. The cyclic isolate remains at this stage until "
"some future run of the garbage collector (not necessarily the next run "
"because the next run might not scan every object)."
msgstr ""
"**到達不能だが整合性は保たれている:** 循環参照しているオブジェクト群への外部"
"からの最後の参照が取り除かれ、オブジェクトが孤立した状態です (これによって孤"
"立した循環参照群が生じます)。\n"
"群のどのオブジェクトも、まだファイナライズもクリアもされていません。\n"
"孤立した循環参照群は、将来ガベージコレクタが実行されるまでこの段階にとどまり"
"ます (次の実行で全オブジェクトを調べるとは限らないため、必ずしも次回とは限り"
"ません)。"
msgid ""
"**Mix of finalized and not finalized:** Objects in a cyclic isolate are "
"finalized one at a time, which means that there is a period of time when the "
"cyclic isolate is composed of a mix of finalized and non-finalized objects. "
"Finalization order is unspecified, so it can appear random. A finalized "
"object must behave in a sane manner when non-finalized objects interact with "
"it, and a non-finalized object must be able to tolerate the finalization of "
"an arbitrary subset of its referents."
msgstr ""
"**ファイナライズ済みと未ファイナライズが混在:** 孤立した循環参照群のオブジェ"
"クトは 1 つずつファイナライズされるため、ファイナライズ済みとそうでないオブ"
"ジェクトが混在する期間があります。\n"
"ファイナライズの順序は規定されていないため、無作為に見えることがあります。\n"
"ファイナライズ済みオブジェクトは、未ファイナライズのオブジェクトから操作され"
"ても適切に動作しなければなりません。\n"
"また、未ファイナライズのオブジェクトは、自分の参照先の任意の一部がファイナラ"
"イズされても問題なく扱える必要があります。"
msgid ""
"**All finalized:** All objects in a cyclic isolate are finalized before any "
"of them are cleared."
msgstr ""
"**すべてファイナライズ済み:** 孤立した循環参照群では、どのオブジェクトもクリ"
"アされる前に、すべてのオブジェクトがファイナライズされます。"
msgid ""
"**Mix of finalized and cleared:** The objects can be cleared serially or "
"concurrently (but with the :term:`GIL` held); either way, some will finish "
"before others. A finalized object must be able to tolerate the clearing of "
"a subset of its referents. :pep:`442` calls this stage \"cyclic trash\"."
msgstr ""
"**ファイナライズ済みとクリア済みが混在:** オブジェクトは逐次的にも並行的にも"
"クリアされ得ますが、:term:`GIL` を保持して行われます。\n"
"いずれの場合も、他のオブジェクトより先にクリアが完了するものがあります。\n"
"ファイナライズ済みオブジェクトは、自分の参照先の一部がクリアされても問題なく"
"扱える必要があります。\n"
":pep:`442` ではこの段階を「cyclic trash」と呼んでいます。"
msgid ""
"**Leaked:** If a cyclic isolate still exists after all objects in the group "
"have been finalized and cleared, then the objects remain indefinitely "
"uncollectable (see :data:`gc.garbage`). It is a bug if a cyclic isolate "
"reaches this stage---it means the :c:member:`~PyTypeObject.tp_clear` methods "
"of the participating objects have failed to break the reference cycle as "
"required."
msgstr ""
"**リーク:** 群のすべてのオブジェクトをファイナライズし、クリアした後も孤立し"
"た循環参照群が残る場合、それらのオブジェクトはいつまでも回収できずに残ります "
"(:data:`gc.garbage` を参照)。\n"
"孤立した循環参照群がこの段階に達するのはバグです。\n"
"関与するオブジェクトの :c:member:`~PyTypeObject.tp_clear` メソッドが、必要な"
"循環参照の解消に失敗したことを意味します。"
msgid ""
"If :c:member:`~PyTypeObject.tp_clear` did not exist, then Python would have "
"no way to safely break a reference cycle. Simply destroying an object in a "
"cyclic isolate would result in a dangling pointer, triggering undefined "
"behavior when an object referencing the destroyed object is itself "
"destroyed. The clearing step makes object destruction a two-phase process: "
"first :c:member:`~PyTypeObject.tp_clear` is called to partially destroy the "
"objects enough to detangle them from each other, "
"then :c:member:`~PyTypeObject.tp_dealloc` is called to complete the "
"destruction."
msgstr ""
":c:member:`~PyTypeObject.tp_clear` がなければ、Python には循環参照を安全に解"
"消する方法がありません。\n"
"孤立した循環参照群のオブジェクトを単に破棄すると、ダングリングポインタが生じ"
"ます。\n"
"破棄済みのオブジェクトを参照するオブジェクトが破棄される際に、未定義の動作を"
"引き起こします。\n"
"クリアの段階を設けることで、オブジェクトの破棄は 2 段階になります。\n"
"まず :c:member:`~PyTypeObject.tp_clear` を呼び出し、オブジェクト同士の結び付"
"きを解くのに十分なだけ部分的に破棄します。\n"
"次に :c:member:`~PyTypeObject.tp_dealloc` を呼び出し、破棄を完了します。"
msgid ""
"Unlike clearing, finalization is not a phase of destruction. A finalized "
"object must still behave properly by continuing to fulfill its design "
"contracts. An object's finalizer is allowed to execute arbitrary Python "
"code, and is even allowed to prevent the impending destruction by adding a "
"reference. The finalizer is only related to destruction by call order---if "
"it runs, it runs before destruction, which starts "
"with :c:member:`~PyTypeObject.tp_clear` (if called) and concludes "
"with :c:member:`~PyTypeObject.tp_dealloc`."
msgstr ""
"クリアとは異なり、ファイナライズは破棄の一段階ではありません。\n"
"ファイナライズ済みのオブジェクトも、設計上の契約を引き続き満たし、正しく動作"
"しなければなりません。\n"
"オブジェクトのファイナライザは任意の Python コードを実行でき、参照を追加し"
"て、間近に迫った破棄を防ぐことさえできます。\n"
"ファイナライザと破棄が関係するのは呼び出し順序だけです。\n"
"ファイナライザが実行されるなら、それは破棄より前です。\n"
"破棄は :c:member:`~PyTypeObject.tp_clear` (呼び出す場合) から始ま"
"り、:c:member:`~PyTypeObject.tp_dealloc` で完了します。"
msgid ""
"The finalization step is not necessary to safely reclaim the objects in a "
"cyclic isolate, but its existence makes it easier to design types that "
"behave in a sane manner when objects are cleared. Clearing an object might "
"necessarily leave it in a broken, partially destroyed state---it might be "
"unsafe to call any of the cleared object's methods or access any of its "
"attributes. With finalization, only finalized objects can possibly interact "
"with cleared objects; non-finalized objects are guaranteed to interact with "
"only non-cleared (but potentially finalized) objects."
msgstr ""
"孤立した循環参照群のオブジェクトを安全に回収するために、ファイナライズの段階"
"は必須ではありません。\n"
"ただし、この段階があることで、オブジェクトがクリアされても適切に動作する型を"
"設計しやすくなります。\n"
"オブジェクトのクリアでは、部分的に破棄された壊れた状態を避けられない場合があ"
"ります。\n"
"クリア済みのオブジェクトのメソッド呼び出しや属性へのアクセスは、どれも安全で"
"ないかもしれません。\n"
"ファイナライズの段階があれば、クリア済みのオブジェクトとやり取りする可能性が"
"あるのはファイナライズ済みのオブジェクトだけです。\n"
"未ファイナライズのオブジェクトがやり取りする相手は、未クリア (ただしファイナ"
"ライズ済みの場合もあります) のオブジェクトだけであると保証されます。"
msgid "To summarize the possible interactions:"
msgstr "起こり得る参照関係をまとめると、次のようになります。"
msgid ""
"A non-finalized object might have references to or from non-finalized and "
"finalized objects, but not to or from cleared objects."
msgstr ""
"未ファイナライズのオブジェクトは、未ファイナライズまたはファイナライズ済みの"
"オブジェクトへの参照や、それらからの参照を持つことがあります。\n"
"クリア済みオブジェクトとの間には、そのような参照はありません。"
msgid ""
"A finalized object might have references to or from non-finalized, "
"finalized, and cleared objects."
msgstr ""
"ファイナライズ済みのオブジェクトは、未ファイナライズ、ファイナライズ済み、ク"
"リア済みのいずれのオブジェクトへの参照や、それらからの参照も持ち得ます。"
msgid ""
"A cleared object might have references to or from finalized and cleared "
"objects, but not to or from non-finalized objects."
msgstr ""
"クリア済みのオブジェクトは、ファイナライズ済みまたはクリア済みのオブジェクト"
"への参照や、それらからの参照を持つことがあります。\n"
"未ファイナライズのオブジェクトとの間には、そのような参照はありません。"
msgid ""
"Without any reference cycles, an object can be simply destroyed once its "
"last reference is deleted; the finalization and clearing steps are not "
"necessary to safely reclaim unused objects. However, it can be useful to "
"automatically call :c:member:`~PyTypeObject.tp_finalize` "
"and :c:member:`~PyTypeObject.tp_clear` before destruction anyway because "
"type design is simplified when all objects always experience the same series "
"of events regardless of whether they participated in a cyclic isolate. "
"Python currently only calls :c:member:`~PyTypeObject.tp_finalize` "
"and :c:member:`~PyTypeObject.tp_clear` as needed to destroy a cyclic "
"isolate; this may change in a future version."
msgstr ""
"循環参照がなければ、最後の参照が削除された時点でオブジェクトを単に破棄できま"
"す。\n"
"使われなくなったオブジェクトを安全に回収するために、ファイナライズやクリアの"
"段階は必要ありません。\n"
"それでも、破棄前に :c:member:`~PyTypeObject.tp_finalize` "
"と :c:member:`~PyTypeObject.tp_clear` を自動的に呼び出すことには利点がありま"
"す。\n"
"孤立した循環参照群に属していたかどうかにかかわらず、すべてのオブジェクトが常"
"に同じ一連のイベントを経るようにすると、型の設計が簡単になるためです。\n"
"現在の Python は、孤立した循環参照群の破棄に必要な場合にだ"
"け :c:member:`~PyTypeObject.tp_finalize` "
"と :c:member:`~PyTypeObject.tp_clear` を呼び出します。\n"
"これは将来のバージョンで変更される可能性があります。"
#: ../../c-api/lifecycle.rst:237
msgid "Functions"
msgstr "関数"
msgid "To allocate and free memory, see :ref:`allocating-objects`."
msgstr ""
"メモリの割り当てと解放については :ref:`allocating-objects` を参照してくださ"
"い。"
msgid ""
"Finalizes the object as described in :c:member:`~PyTypeObject.tp_finalize`. "
"Call this function (or :c:func:`PyObject_CallFinalizerFromDealloc`) instead "
"of calling :c:member:`~PyTypeObject.tp_finalize` directly because this "
"function may deduplicate multiple calls to :c:member:`!tp_finalize`. "
"Currently, calls are only deduplicated if the type supports garbage "
"collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set); this may "
"change in the future."
msgstr ""
":c:member:`~PyTypeObject.tp_finalize` の説明に従ってオブジェクトをファイナラ"
"イズします。\n"
":c:member:`~PyTypeObject.tp_finalize` を直接呼び出すのではなく、この関数"
"か :c:func:`PyObject_CallFinalizerFromDealloc` を呼び出してください。\n"
"この関数は :c:member:`!tp_finalize` の重複する呼び出しを省く場合があるためで"
"す。\n"
"現在は、型がガベージコレクションをサポートする場合 "
"(:c:macro:`Py_TPFLAGS_HAVE_GC` フラグが設定されている場合) にだけ重複を省きま"
"すが、将来変更される可能性があります。"
msgid ""
"Same as :c:func:`PyObject_CallFinalizer` but meant to be called at the "
"beginning of the object's destructor (:c:member:`~PyTypeObject.tp_dealloc`). "
"There must not be any references to the object. If the object's finalizer "
"resurrects the object, this function returns -1; no further destruction "
"should happen. Otherwise, this function returns 0 and destruction can "
"continue normally."
msgstr ""
":c:func:`PyObject_CallFinalizer` と同じですが、オブジェクトのデストラクタ "
"(:c:member:`~PyTypeObject.tp_dealloc`) の冒頭で呼び出すための関数です。\n"
"オブジェクトへの参照が残っていてはいけません。\n"
"ファイナライザがオブジェクトを復活させた場合は -1 を返します。\n"
"この場合、これ以上破棄を進めてはいけません。\n"
"それ以外の場合は 0 を返し、通常どおり破棄を続行できます。"
msgid ":c:member:`~PyTypeObject.tp_dealloc` for example code."
msgstr "コード例は :c:member:`~PyTypeObject.tp_dealloc` を参照してください。"