Skip to content

Commit 8b14c96

Browse files
committed
Translate faq/design.html#how-does-python-manage-memory
1 parent bad48ad commit 8b14c96

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

faq/design.po

+24-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgstr ""
99
"Project-Id-Version: Python 3.10\n"
1010
"Report-Msgid-Bugs-To: \n"
1111
"POT-Creation-Date: 2022-07-06 00:17+0000\n"
12-
"PO-Revision-Date: 2022-08-18 11:19+0800\n"
12+
"PO-Revision-Date: 2022-08-19 21:55+0800\n"
1313
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1515
"tw)\n"
@@ -19,7 +19,7 @@ msgstr ""
1919
"Content-Transfer-Encoding: 8bit\n"
2020
"Plural-Forms: nplurals=1; plural=0;\n"
2121
"X-Generator: Poedit 3.1.1\n"
22-
"X-Poedit-Bookmarks: -1,-1,-1,-1,-1,-1,25,-1,-1,-1\n"
22+
"X-Poedit-Bookmarks: -1,-1,-1,-1,-1,93,25,-1,-1,-1\n"
2323

2424
#: ../../faq/design.rst:3
2525
msgid "Design and History FAQ"
@@ -570,7 +570,7 @@ msgstr ""
570570

571571
#: ../../faq/design.rst:331
572572
msgid "How does Python manage memory?"
573-
msgstr "Python如何管理記憶體?"
573+
msgstr "Python 如何管理記憶體?"
574574

575575
#: ../../faq/design.rst:333
576576
msgid ""
@@ -582,6 +582,11 @@ msgid ""
582582
"provides functions to perform a garbage collection, obtain debugging "
583583
"statistics, and tune the collector's parameters."
584584
msgstr ""
585+
"Python 記憶體管理的細節取決於實作。Python 的標準實作 :term:`CPython` 使用參照"
586+
"計次 (reference counting) 來偵測不再被存取的物件,並用另一個機制來收集參照循"
587+
"環 (reference cycle)、定期執行循環偵測演算法來找不再使用的循環並刪除相關物"
588+
"件。 :mod:`gc` 模組提供了可以執行垃圾收集、抓取除錯統計數據和調整收集器參數的"
589+
"函式。"
585590

586591
#: ../../faq/design.rst:341
587592
msgid ""
@@ -591,12 +596,20 @@ msgid ""
591596
"porting problems if your Python code depends on the behavior of the "
592597
"reference counting implementation."
593598
msgstr ""
599+
"然而,在其他實作(像是 `Jython <http://www.jython.org>`_ 或 `PyPy <http://"
600+
"www.pypy.org>`_)中,會使用像是成熟的垃圾收集器等不同機制。如果你的 Python 程"
601+
"式碼的表現取決於參照計次 (reference counting) 的實作,這個相異處會導致一些微"
602+
"小的移植問題。"
594603

595604
#: ../../faq/design.rst:347
596605
msgid ""
597606
"In some Python implementations, the following code (which is fine in "
598607
"CPython) will probably run out of file descriptors::"
599608
msgstr ""
609+
"在一些 Python 實作中,下面這段程式碼(在 CPython 可以正常運作)可能會把檔案描"
610+
"述子 (file descriptors) 用盡:\n"
611+
"\n"
612+
"::"
600613

601614
#: ../../faq/design.rst:354
602615
msgid ""
@@ -605,13 +618,21 @@ msgid ""
605618
"those file objects will only get collected (and closed) at varying and "
606619
"possibly long intervals."
607620
msgstr ""
621+
"實際上,使用 CPython 的參照計次 (reference counting) 和解構方案 (destructor "
622+
"scheme),每個對 *f* 的新指派都會關閉前面打開的檔案。然而用傳統的垃圾回收 "
623+
"(GC) 的話,這些檔案物件只會在不固定且有可能很長的時間後被收集(並關閉)。"
608624

609625
#: ../../faq/design.rst:359
610626
msgid ""
611627
"If you want to write code that will work with any Python implementation, you "
612628
"should explicitly close the file or use the :keyword:`with` statement; this "
613629
"will work regardless of memory management scheme::"
614630
msgstr ""
631+
"如果你希望你的程式碼在任何 Python 實作版本中都可以運作,那你應該清楚地關閉檔"
632+
"案或是使用 :keyword:`with` 陳述句,如此一來,不用管記憶體管理的方法,他也會正"
633+
"常運作:\n"
634+
"\n"
635+
"::"
615636

616637
#: ../../faq/design.rst:369
617638
msgid "Why doesn't CPython use a more traditional garbage collection scheme?"

0 commit comments

Comments
 (0)