Skip to content

Commit 1ec6524

Browse files
committed
#752 - remove fuzzy flags
1 parent cfd2c56 commit 1ec6524

File tree

1 file changed

+123
-25
lines changed

1 file changed

+123
-25
lines changed

โ€Žlibrary/weakref.poโ€Ž

Lines changed: 123 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,17 @@ msgstr ""
121121
"๋…ธ์ถœํ•ฉ๋‹ˆ๋‹ค."
122122

123123
#: ../../library/weakref.rst:68
124-
#, fuzzy
125124
msgid ""
126125
"Not all objects can be weakly referenced. Objects which support weak "
127126
"references include class instances, functions written in Python (but not "
128127
"in C), instance methods, sets, frozensets, some :term:`file objects <file"
129128
" object>`, :term:`generators <generator>`, type objects, sockets, arrays,"
130129
" deques, regular expression pattern objects, and code objects."
131130
msgstr ""
132-
"๋ชจ๋“  ๊ฐ์ฒด๋ฅผ ์•ฝํ•˜๊ฒŒ ์ฐธ์กฐํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์€ ์•„๋‹™๋‹ˆ๋‹ค; ๊ฐ€๋Šฅํ•œ ๊ฐ์ฒด์—๋Š” ํด๋ž˜์Šค ์ธ์Šคํ„ด์Šค, ํŒŒ์ด์ฌ์œผ๋กœ ์ž‘์„ฑ๋œ ํ•จ์ˆ˜ (C๋กœ ์ž‘์„ฑ๋œ ํ•จ์ˆ˜๋Š” "
133-
"์•„๋‹™๋‹ˆ๋‹ค), ์ธ์Šคํ„ด์Šค ๋ฉ”์„œ๋“œ, ์ง‘ํ•ฉ, ๋ถˆ๋ณ€ ์ง‘ํ•ฉ(frozenset), ์ผ๋ถ€ :term:`ํŒŒ์ผ ๊ฐ์ฒด <file object>`, "
134-
":term:`์ œ๋„ˆ๋ ˆ์ดํ„ฐ <generator>`, ํ˜• ๊ฐ์ฒด, ์†Œ์ผ“, ๋ฐฐ์—ด, ๋ฐํฌ(deque), ์ •๊ทœ์‹ ํŒจํ„ด ๊ฐ์ฒด ๋ฐ ์ฝ”๋“œ ๊ฐ์ฒด๊ฐ€ "
135-
"ํฌํ•จ๋ฉ๋‹ˆ๋‹ค."
131+
"๋ชจ๋“  ๊ฐ์ฒด๋ฅผ ์•ฝํ•˜๊ฒŒ ์ฐธ์กฐํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์€ ์•„๋‹™๋‹ˆ๋‹ค. ์•ฝํ•œ ์ฐธ์กฐ๋ฅผ ์ง€์›ํ•˜๋Š” ๊ฐ์ฒด์—๋Š” ํด๋ž˜์Šค ์ธ์Šคํ„ด์Šค, ํŒŒ์ด์ฌ์œผ๋กœ ์ž‘์„ฑ๋œ ํ•จ์ˆ˜ (C๋กœ "
132+
"์ž‘์„ฑ๋œ ํ•จ์ˆ˜๋Š” ์•„๋‹™๋‹ˆ๋‹ค), ์ธ์Šคํ„ด์Šค ๋ฉ”์„œ๋“œ, ์ง‘ํ•ฉ, ๋ถˆ๋ณ€ ์ง‘ํ•ฉ(frozenset), ์ผ๋ถ€ :term:`ํŒŒ์ผ ๊ฐ์ฒด <file "
133+
"object>`, :term:`์ œ๋„ˆ๋ ˆ์ดํ„ฐ <generator>`, ํ˜• ๊ฐ์ฒด, ์†Œ์ผ“, ๋ฐฐ์—ด, ๋ฐํฌ(deque), ์ •๊ทœ์‹ ํŒจํ„ด ๊ฐ์ฒด ๋ฐ"
134+
" ์ฝ”๋“œ ๊ฐ์ฒด๊ฐ€ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค."
136135

137136
#: ../../library/weakref.rst:74
138137
msgid "Added support for thread.lock, threading.Lock, and code objects."
@@ -154,6 +153,10 @@ msgid ""
154153
"\n"
155154
"obj = Dict(red=1, green=2, blue=3) # this object is weak referenceable"
156155
msgstr ""
156+
"class Dict(dict):\n"
157+
" pass\n"
158+
"\n"
159+
"obj = Dict(red=1, green=2, blue=3) # ์ด ๊ฐ์ฒด๋Š” ์•ฝํ•œ ์ฐธ์กฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค"
157160

158161
#: ../../library/weakref.rst:87
159162
msgid ""
@@ -201,14 +204,13 @@ msgstr ""
201204
"์˜ค๋ž˜์ „์— ๋“ฑ๋ก๋œ ์ฝœ๋ฐฑ ์ˆœ์œผ๋กœ ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค."
202205

203206
#: ../../library/weakref.rst:112
204-
#, fuzzy
205207
msgid ""
206208
"Exceptions raised by the callback will be noted on the standard error "
207209
"output, but cannot be propagated; they are handled in exactly the same "
208210
"way as exceptions raised from an object's :meth:`~object.__del__` method."
209211
msgstr ""
210-
"์ฝœ๋ฐฑ์— ์˜ํ•ด ๋ฐœ์ƒํ•œ ์˜ˆ์™ธ๋Š” ํ‘œ์ค€ ์—๋Ÿฌ ์ถœ๋ ฅ์— ํ‘œ์‹œ๋˜์ง€๋งŒ, ์ „ํŒŒ๋  ์ˆ˜๋Š” ์—†์Šต๋‹ˆ๋‹ค; ๊ฐ์ฒด์˜ :meth:`__del__` ๋ฉ”์„œ๋“œ์—์„œ "
211-
"๋ฐœ์ƒํ•œ ์˜ˆ์™ธ์™€ ์ •ํ™•ํžˆ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค."
212+
"์ฝœ๋ฐฑ์— ์˜ํ•ด ๋ฐœ์ƒํ•œ ์˜ˆ์™ธ๋Š” ํ‘œ์ค€ ์—๋Ÿฌ ์ถœ๋ ฅ์— ํ‘œ์‹œ๋˜์ง€๋งŒ, ์ „ํŒŒ๋  ์ˆ˜๋Š” ์—†์Šต๋‹ˆ๋‹ค; ๊ฐ์ฒด์˜ :meth:`~object.__del__` "
213+
"๋ฉ”์„œ๋“œ์—์„œ ๋ฐœ์ƒํ•œ ์˜ˆ์™ธ์™€ ์ •ํ™•ํžˆ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค."
212214

213215
#: ../../library/weakref.rst:116
214216
msgid ""
@@ -251,7 +253,6 @@ msgid "Added the :attr:`__callback__` attribute."
251253
msgstr ":attr:`__callback__` ์–ดํŠธ๋ฆฌ๋ทฐํŠธ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค."
252254

253255
#: ../../library/weakref.rst:140
254-
#, fuzzy
255256
msgid ""
256257
"Return a proxy to *object* which uses a weak reference. This supports "
257258
"use of the proxy in most contexts instead of requiring the explicit "
@@ -323,6 +324,13 @@ msgid ""
323324
">>> d[k2] = 2 # d = {k1: 2}\n"
324325
">>> del k1 # d = {}"
325326
msgstr ""
327+
">>> class T(str): pass\n"
328+
"...\n"
329+
">>> k1, k2 = T(), T()\n"
330+
">>> d = weakref.WeakKeyDictionary()\n"
331+
">>> d[k1] = 1 # d = {k1: 1}\n"
332+
">>> d[k2] = 2 # d = {k1: 2}\n"
333+
">>> del k1 # d = {}"
326334

327335
#: ../../library/weakref.rst:188
328336
msgid "A workaround would be to remove the key prior to reassignment::"
@@ -340,6 +348,14 @@ msgid ""
340348
">>> d[k2] = 2 # d = {k2: 2}\n"
341349
">>> del k1 # d = {k2: 2}"
342350
msgstr ""
351+
">>> class T(str): pass\n"
352+
"...\n"
353+
">>> k1, k2 = T(), T()\n"
354+
">>> d = weakref.WeakKeyDictionary()\n"
355+
">>> d[k1] = 1 # d = {k1: 1}\n"
356+
">>> del d[k1]\n"
357+
">>> d[k2] = 2 # d = {k2: 2}\n"
358+
">>> del k1 # d = {k2: 2}"
343359

344360
#: ../../library/weakref.rst:199 ../../library/weakref.rst:220
345361
msgid "Added support for ``|`` and ``|=`` operators, as specified in :pep:`584`."
@@ -369,13 +385,12 @@ msgid ""
369385
msgstr "๊ฐ’์„ ์•ฝํ•˜๊ฒŒ ์ฐธ์กฐํ•˜๋Š” ๋งคํ•‘ ํด๋ž˜์Šค. ๊ฐ’์— ๋Œ€ํ•œ ๊ฐ•ํ•œ ์ฐธ์กฐ๊ฐ€ ๋”๋Š” ์กด์žฌํ•˜์ง€ ์•Š์„ ๋•Œ ๋”•์…”๋„ˆ๋ฆฌ์˜ ํ•ญ๋ชฉ์ด ์‚ญ์ œ๋ฉ๋‹ˆ๋‹ค."
370386

371387
#: ../../library/weakref.rst:223
372-
#, fuzzy
373388
msgid ""
374389
":class:`WeakValueDictionary` objects have an additional method that has "
375390
"the same issues as the :meth:`WeakKeyDictionary.keyrefs` method."
376391
msgstr ""
377-
":class:`WeakValueDictionary` ๊ฐ์ฒด์—๋Š” :class:`WeakKeyDictionary` ๊ฐ์ฒด์˜ "
378-
":meth:`keyrefs` ๋ฉ”์„œ๋“œ์™€ ๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š” ์ถ”๊ฐ€ ๋ฉ”์„œ๋“œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค."
392+
":class:`WeakValueDictionary` ๊ฐ์ฒด์—๋Š” :class:`WeakKeyDictionary.keyrefs` ๋ฉ”์„œ๋“œ์™€"
393+
" ๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š” ์ถ”๊ฐ€ ๋ฉ”์„œ๋“œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค."
379394

380395
#: ../../library/weakref.rst:229
381396
msgid "Return an iterable of the weak references to the values."
@@ -419,6 +434,23 @@ msgid ""
419434
">>> r()\n"
420435
">>>"
421436
msgstr ""
437+
">>> class C:\n"
438+
"... def method(self):\n"
439+
"... print(\"method called!\")\n"
440+
"...\n"
441+
">>> c = C()\n"
442+
">>> r = weakref.ref(c.method)\n"
443+
">>> r()\n"
444+
">>> r = weakref.WeakMethod(c.method)\n"
445+
">>> r()\n"
446+
"<bound method C.method of <__main__.C object at 0x7fc859830220>>\n"
447+
">>> r()()\n"
448+
"method called!\n"
449+
">>> del c\n"
450+
">>> gc.collect()\n"
451+
"0\n"
452+
">>> r()\n"
453+
">>>"
422454

423455
#: ../../library/weakref.rst:264
424456
msgid ""
@@ -448,15 +480,14 @@ msgstr ""
448480
":const:`None`\\์ด ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค."
449481

450482
#: ../../library/weakref.rst:280
451-
#, fuzzy
452483
msgid ""
453484
"Exceptions raised by finalizer callbacks during garbage collection will "
454485
"be shown on the standard error output, but cannot be propagated. They "
455486
"are handled in the same way as exceptions raised from an object's "
456487
":meth:`~object.__del__` method or a weak reference's callback."
457488
msgstr ""
458489
"๊ฐ€๋น„์ง€ ์ˆ˜๊ฑฐ ์ค‘์— ํŒŒ์ด๋„๋ผ์ด์ € ์ฝœ๋ฐฑ์—์„œ ๋ฐœ์ƒํ•œ ์˜ˆ์™ธ๋Š” ํ‘œ์ค€ ์—๋Ÿฌ ์ถœ๋ ฅ์— ํ‘œ์‹œ๋˜์ง€๋งŒ, ์ „ํŒŒํ•  ์ˆ˜๋Š” ์—†์Šต๋‹ˆ๋‹ค. ๊ฐ์ฒด์˜ "
459-
":meth:`__del__` ๋ฉ”์„œ๋“œ๋‚˜ ์•ฝํ•œ ์ฐธ์กฐ์˜ ์ฝœ๋ฐฑ์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์˜ˆ์™ธ์™€ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค."
490+
":meth:`~object.__del__` ๋ฉ”์„œ๋“œ๋‚˜ ์•ฝํ•œ ์ฐธ์กฐ์˜ ์ฝœ๋ฐฑ์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์˜ˆ์™ธ์™€ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค."
460491

461492
#: ../../library/weakref.rst:286
462493
msgid ""
@@ -595,6 +626,14 @@ msgid ""
595626
" print(\"Object is still live!\")\n"
596627
" o.do_something_useful()"
597628
msgstr ""
629+
"# r์€ ์•ฝํ•œ ์ฐธ์กฐ ๊ฐ์ฒด์ž…๋‹ˆ๋‹ค\n"
630+
"o = r()\n"
631+
"if o is None:\n"
632+
" # ์ฐธ์กฐ๋Œ€์ƒ์ด ๊ฐ€๋น„์ง€ ์ˆ˜๊ฑฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค\n"
633+
" print(\"Object has been deallocated; can't frobnicate.\")\n"
634+
"else:\n"
635+
" print(\"Object is still live!\")\n"
636+
" o.do_something_useful()"
598637

599638
#: ../../library/weakref.rst:400
600639
msgid ""
@@ -652,6 +691,23 @@ msgid ""
652691
" ob = (ob, self.__counter)\n"
653692
" return ob"
654693
msgstr ""
694+
"import weakref\n"
695+
"\n"
696+
"class ExtendedRef(weakref.ref):\n"
697+
" def __init__(self, ob, callback=None, /, **annotations):\n"
698+
" super().__init__(ob, callback)\n"
699+
" self.__counter = 0\n"
700+
" for k, v in annotations.items():\n"
701+
" setattr(self, k, v)\n"
702+
"\n"
703+
" def __call__(self):\n"
704+
" \"\"\"์ฐธ์กฐ๋Œ€์ƒ๊ณผ ์ฐธ์กฐ๊ฐ€ ํ˜ธ์ถœ๋œ ํšŸ์ˆ˜๋ฅผ ํฌํ•จํ•˜๋Š” ์Œ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.\n"
705+
" \"\"\"\n"
706+
" ob = super().__call__()\n"
707+
" if ob is not None:\n"
708+
" self.__counter += 1\n"
709+
" ob = (ob, self.__counter)\n"
710+
" return ob"
655711

656712
#: ../../library/weakref.rst:438
657713
msgid "Example"
@@ -681,6 +737,17 @@ msgid ""
681737
"def id2obj(oid):\n"
682738
" return _id2obj_dict[oid]"
683739
msgstr ""
740+
"import weakref\n"
741+
"\n"
742+
"_id2obj_dict = weakref.WeakValueDictionary()\n"
743+
"\n"
744+
"def remember(obj):\n"
745+
" oid = id(obj)\n"
746+
" _id2obj_dict[oid] = obj\n"
747+
" return oid\n"
748+
"\n"
749+
"def id2obj(oid):\n"
750+
" return _id2obj_dict[oid]"
684751

685752
#: ../../library/weakref.rst:465
686753
msgid "Finalizer Objects"
@@ -727,11 +794,15 @@ msgid ""
727794
">>> exit()\n"
728795
"obj dead or exiting"
729796
msgstr ""
797+
">>> obj = Object()\n"
798+
">>> weakref.finalize(obj, print, \"obj dead or exiting\")\n"
799+
"<finalize object at ...; for 'Object' at ...>\n"
800+
">>> exit()\n"
801+
"obj dead or exiting"
730802

731803
#: ../../library/weakref.rst:526
732-
#, fuzzy
733804
msgid "Comparing finalizers with :meth:`~object.__del__` methods"
734-
msgstr "ํŒŒ์ด๋„๋ผ์ด์ €์™€ :meth:`__del__` ๋ฉ”์„œ๋“œ์˜ ๋น„๊ต"
805+
msgstr "ํŒŒ์ด๋„๋ผ์ด์ €์™€ :meth:`~object.__del__` ๋ฉ”์„œ๋“œ์˜ ๋น„๊ต"
735806

736807
#: ../../library/weakref.rst:528
737808
msgid ""
@@ -747,20 +818,18 @@ msgid "the object is garbage collected,"
747818
msgstr "๊ฐ์ฒด๊ฐ€ ๊ฐ€๋น„์ง€ ์ˆ˜๊ฑฐ๋ฉ๋‹ˆ๋‹ค,"
748819

749820
#: ../../library/weakref.rst:533
750-
#, fuzzy
751821
msgid "the object's :meth:`!remove` method is called, or"
752-
msgstr "๊ฐ์ฒด์˜ :meth:`remove` ๋ฉ”์„œ๋“œ๊ฐ€ ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค, ๋˜๋Š”"
822+
msgstr "๊ฐ์ฒด์˜ :meth:`!remove` ๋ฉ”์„œ๋“œ๊ฐ€ ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค, ๋˜๋Š”"
753823

754824
#: ../../library/weakref.rst:534
755825
msgid "the program exits."
756826
msgstr "ํ”„๋กœ๊ทธ๋žจ์ด ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค."
757827

758828
#: ../../library/weakref.rst:536
759-
#, fuzzy
760829
msgid ""
761830
"We might try to implement the class using a :meth:`~object.__del__` "
762831
"method as follows::"
763-
msgstr "๋‹ค์Œ๊ณผ ๊ฐ™์ด :meth:`__del__` ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํด๋ž˜์Šค๋ฅผ ๊ตฌํ˜„ํ•˜๋ ค๊ณ  ์‹œ๋„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค::"
832+
msgstr "๋‹ค์Œ๊ณผ ๊ฐ™์ด :meth:`~object.__del__` ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํด๋ž˜์Šค๋ฅผ ๊ตฌํ˜„ํ•˜๋ ค๊ณ  ์‹œ๋„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค::"
764833

765834
#: ../../library/weakref.rst:539
766835
msgid ""
@@ -780,28 +849,41 @@ msgid ""
780849
" def __del__(self):\n"
781850
" self.remove()"
782851
msgstr ""
852+
"class TempDir:\n"
853+
" def __init__(self):\n"
854+
" self.name = tempfile.mkdtemp()\n"
855+
"\n"
856+
" def remove(self):\n"
857+
" if self.name is not None:\n"
858+
" shutil.rmtree(self.name)\n"
859+
" self.name = None\n"
860+
"\n"
861+
" @property\n"
862+
" def removed(self):\n"
863+
" return self.name is None\n"
864+
"\n"
865+
" def __del__(self):\n"
866+
" self.remove()"
783867

784868
#: ../../library/weakref.rst:555
785-
#, fuzzy
786869
msgid ""
787870
"Starting with Python 3.4, :meth:`~object.__del__` methods no longer "
788871
"prevent reference cycles from being garbage collected, and module globals"
789872
" are no longer forced to :const:`None` during :term:`interpreter "
790873
"shutdown`. So this code should work without any issues on CPython."
791874
msgstr ""
792-
"ํŒŒ์ด์ฌ 3.4๋ถ€ํ„ฐ, :meth:`__del__` ๋ฉ”์„œ๋“œ๋Š” ๋”๋Š” ์ฐธ์กฐ ์ˆœํ™˜์ด ๊ฐ€๋น„์ง€ ์ˆ˜๊ฑฐ๋˜๋Š” ๊ฒƒ์„ ๋ง‰์ง€ ์•Š์œผ๋ฉฐ, "
875+
"ํŒŒ์ด์ฌ 3.4๋ถ€ํ„ฐ, :meth:`~object.__del__` ๋ฉ”์„œ๋“œ๋Š” ๋”๋Š” ์ฐธ์กฐ ์ˆœํ™˜์ด ๊ฐ€๋น„์ง€ ์ˆ˜๊ฑฐ๋˜๋Š” ๊ฒƒ์„ ๋ง‰์ง€ ์•Š์œผ๋ฉฐ, "
793876
":term:`์ธํ„ฐํ”„๋ฆฌํ„ฐ ์ข…๋ฃŒ <interpreter shutdown>` ์ค‘์— ๋ชจ๋“ˆ ์ „์—ญ์ด ๋”๋Š” :const:`None`\\์œผ๋กœ "
794877
"๊ฐ•์ œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ด ์ฝ”๋“œ๋Š” CPython์—์„œ ์•„๋ฌด๋Ÿฐ ๋ฌธ์ œ ์—†์ด ์ž‘๋™ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค."
795878

796879
#: ../../library/weakref.rst:560
797-
#, fuzzy
798880
msgid ""
799881
"However, handling of :meth:`~object.__del__` methods is notoriously "
800882
"implementation specific, since it depends on internal details of the "
801883
"interpreter's garbage collector implementation."
802884
msgstr ""
803-
"๊ทธ๋Ÿฌ๋‚˜, :meth:`__del__` ๋ฉ”์„œ๋“œ์˜ ์ฒ˜๋ฆฌ๋Š” ์ธํ„ฐํ”„๋ฆฌํ„ฐ์˜ ๊ฐ€๋น„์ง€ ์ˆ˜๊ฑฐ๊ธฐ ๊ตฌํ˜„์— ๋Œ€ํ•œ ๋‚ด๋ถ€ ์„ธ๋ถ€ ์‚ฌํ•ญ์— ์˜์กดํ•˜๊ธฐ ๋•Œ๋ฌธ์— "
804-
"๊ตฌํ˜„์— ๋”ฐ๋ผ ๋‹ค๋ฅด๊ธฐ๋กœ ์•…๋ช… ๋†’์Šต๋‹ˆ๋‹ค."
885+
"๊ทธ๋Ÿฌ๋‚˜, :meth:`~object.__del__` ๋ฉ”์„œ๋“œ์˜ ์ฒ˜๋ฆฌ๋Š” ์ธํ„ฐํ”„๋ฆฌํ„ฐ์˜ ๊ฐ€๋น„์ง€ ์ˆ˜๊ฑฐ๊ธฐ ๊ตฌํ˜„์— ๋Œ€ํ•œ ๋‚ด๋ถ€ ์„ธ๋ถ€ ์‚ฌํ•ญ์— "
886+
"์˜์กดํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๊ตฌํ˜„์— ๋”ฐ๋ผ ๋‹ค๋ฅด๊ธฐ๋กœ ์•…๋ช… ๋†’์Šต๋‹ˆ๋‹ค."
805887

806888
#: ../../library/weakref.rst:564
807889
msgid ""
@@ -825,6 +907,18 @@ msgid ""
825907
" def removed(self):\n"
826908
" return not self._finalizer.alive"
827909
msgstr ""
910+
"class TempDir:\n"
911+
" def __init__(self):\n"
912+
" self.name = tempfile.mkdtemp()\n"
913+
" self._finalizer = weakref.finalize(self, shutil.rmtree, "
914+
"self.name)\n"
915+
"\n"
916+
" def remove(self):\n"
917+
" self._finalizer()\n"
918+
"\n"
919+
" @property\n"
920+
" def removed(self):\n"
921+
" return not self._finalizer.alive"
828922

829923
#: ../../library/weakref.rst:580
830924
msgid ""
@@ -851,6 +945,10 @@ msgid ""
851945
" # implicit reference to the module globals from the function body\n"
852946
"weakref.finalize(sys.modules[__name__], unloading_module)"
853947
msgstr ""
948+
"import weakref, sys\n"
949+
"def unloading_module():\n"
950+
" # ํ•จ์ˆ˜ ๋ฐ”๋””์—์„œ ๋ชจ๋“ˆ ์ „์—ญ์œผ๋กœ์˜ ๋ฌต์‹œ์  ์ฐธ์กฐ\n"
951+
"weakref.finalize(sys.modules[__name__], unloading_module)"
854952

855953
#: ../../library/weakref.rst:596
856954
msgid ""

0 commit comments

Comments
ย (0)