Skip to content

Commit b672c19

Browse files
pydoc-zh-tw[bot]github-actions[bot]mattwang44
authored
Sync with CPython 3.13 (#1142)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt.Wang <mattwang44@gmail.com>
1 parent 5fbfbd1 commit b672c19

23 files changed

+6984
-7176
lines changed

extending/extending.po

Lines changed: 5 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgid ""
99
msgstr ""
1010
"Project-Id-Version: Python 3.13\n"
1111
"Report-Msgid-Bugs-To: \n"
12-
"POT-Creation-Date: 2025-08-27 00:15+0000\n"
12+
"POT-Creation-Date: 2025-09-04 00:15+0000\n"
1313
"PO-Revision-Date: 2025-02-17 14:34+0000\n"
1414
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1515
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -859,11 +859,11 @@ msgstr ""
859859
#: ../../extending/extending.rst:428
860860
msgid ""
861861
"When embedding Python, the :c:func:`!PyInit_spam` function is not called "
862-
"automatically unless there's an entry in the :c:data:`PyImport_Inittab` "
862+
"automatically unless there's an entry in the :c:data:`!PyImport_Inittab` "
863863
"table. To add the module to the initialization table, use :c:func:"
864864
"`PyImport_AppendInittab`, optionally followed by an import of the module::"
865865
msgstr ""
866-
"嵌入 Python 時,除非在 :c:data:`PyImport_Inittab` 表中有相關條目,否則不會自"
866+
"嵌入 Python 時,除非在 :c:data:`!PyImport_Inittab` 表中有相關條目,否則不會自"
867867
"動呼叫 :c:func:`!PyInit_spam` 函式。要將模組加入初始化表,請使用 :c:func:"
868868
"`PyImport_AppendInittab` 並在隨後選擇性地將該模組引入: ::"
869869

@@ -1522,7 +1522,7 @@ msgstr ""
15221522

15231523
#: ../../extending/extending.rst:899
15241524
msgid "Reference Counts"
1525-
msgstr ""
1525+
msgstr "參照計數"
15261526

15271527
#: ../../extending/extending.rst:901
15281528
msgid ""
@@ -1616,7 +1616,7 @@ msgstr ""
16161616

16171617
#: ../../extending/extending.rst:971
16181618
msgid "Reference Counting in Python"
1619-
msgstr ""
1619+
msgstr "Python 中的參照計數"
16201620

16211621
#: ../../extending/extending.rst:973
16221622
msgid ""
@@ -2303,129 +2303,3 @@ msgstr "PyArg_ParseTupleAndKeywords(C 函式)"
23032303
#: ../../extending/extending.rst:797
23042304
msgid "Philbrick, Geoff"
23052305
msgstr "Philbrick, Geoff"
2306-
2307-
#~ msgid ""
2308-
#~ "All user-visible symbols defined by :file:`Python.h` have a prefix of "
2309-
#~ "``Py`` or ``PY``, except those defined in standard header files. For "
2310-
#~ "convenience, and since they are used extensively by the Python "
2311-
#~ "interpreter, ``\"Python.h\"`` includes a few standard header files: "
2312-
#~ "``<stdio.h>``, ``<string.h>``, ``<errno.h>``, and ``<stdlib.h>``. If the "
2313-
#~ "latter header file does not exist on your system, it declares the "
2314-
#~ "functions :c:func:`malloc`, :c:func:`free` and :c:func:`realloc` directly."
2315-
#~ msgstr ""
2316-
#~ "除了那些在標準標頭檔中定義的符號以外,所有由 :file:`Python.h` 定義的使用者"
2317-
#~ "可見符號 (user-visible symbols) 的前綴都是 ``Py`` 或 ``PY``。為了方便,也"
2318-
#~ "因為 Python 直譯器的大量使用,``\"Python.h\"`` 也引入了一些標準的標頭檔:"
2319-
#~ "``<stdio.h>``、``<string.h>``、``<errno.h>`` 和 ``<stdlib.h>``。如果 "
2320-
#~ "``<stdlib.h>`` 在你的系統上不存在,它會直接宣告 :c:func:`malloc`、:c:func:"
2321-
#~ "`free` 和 :c:func:`realloc` 函式。"
2322-
2323-
#~ msgid ""
2324-
#~ "and initialize it in your module's initialization function (:c:func:`!"
2325-
#~ "PyInit_spam`) with an exception object::"
2326-
#~ msgstr ""
2327-
#~ "並在你的模組初始化函式中使用一個例外物件來初始化它 (:c:func:`!"
2328-
#~ "PyInit_spam`): ::"
2329-
2330-
#~ msgid ""
2331-
#~ "PyMODINIT_FUNC\n"
2332-
#~ "PyInit_spam(void)\n"
2333-
#~ "{\n"
2334-
#~ " PyObject *m;\n"
2335-
#~ "\n"
2336-
#~ " m = PyModule_Create(&spammodule);\n"
2337-
#~ " if (m == NULL)\n"
2338-
#~ " return NULL;\n"
2339-
#~ "\n"
2340-
#~ " SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);\n"
2341-
#~ " if (PyModule_AddObjectRef(m, \"error\", SpamError) < 0) {\n"
2342-
#~ " Py_CLEAR(SpamError);\n"
2343-
#~ " Py_DECREF(m);\n"
2344-
#~ " return NULL;\n"
2345-
#~ " }\n"
2346-
#~ "\n"
2347-
#~ " return m;\n"
2348-
#~ "}"
2349-
#~ msgstr ""
2350-
#~ "PyMODINIT_FUNC\n"
2351-
#~ "PyInit_spam(void)\n"
2352-
#~ "{\n"
2353-
#~ " PyObject *m;\n"
2354-
#~ "\n"
2355-
#~ " m = PyModule_Create(&spammodule);\n"
2356-
#~ " if (m == NULL)\n"
2357-
#~ " return NULL;\n"
2358-
#~ "\n"
2359-
#~ " SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);\n"
2360-
#~ " if (PyModule_AddObjectRef(m, \"error\", SpamError) < 0) {\n"
2361-
#~ " Py_CLEAR(SpamError);\n"
2362-
#~ " Py_DECREF(m);\n"
2363-
#~ " return NULL;\n"
2364-
#~ " }\n"
2365-
#~ "\n"
2366-
#~ " return m;\n"
2367-
#~ "}"
2368-
2369-
#~ msgid ""
2370-
#~ "static struct PyModuleDef spammodule = {\n"
2371-
#~ " PyModuleDef_HEAD_INIT,\n"
2372-
#~ " \"spam\", /* name of module */\n"
2373-
#~ " spam_doc, /* module documentation, may be NULL */\n"
2374-
#~ " -1, /* size of per-interpreter state of the module,\n"
2375-
#~ " or -1 if the module keeps state in global variables. */\n"
2376-
#~ " SpamMethods\n"
2377-
#~ "};"
2378-
#~ msgstr ""
2379-
#~ "static struct PyModuleDef spammodule = {\n"
2380-
#~ " PyModuleDef_HEAD_INIT,\n"
2381-
#~ " \"spam\", /* 模組名稱 */\n"
2382-
#~ " spam_doc, /* 模組文件,可能為 NULL */\n"
2383-
#~ " -1, /* 模組的個別直譯器狀態的大小,\n"
2384-
#~ " 如果模組將狀態保存在全域變數中則為 -1 */\n"
2385-
#~ " SpamMethods\n"
2386-
#~ "};"
2387-
2388-
#~ msgid ""
2389-
#~ "When the Python program imports module :mod:`!spam` for the first time, :"
2390-
#~ "c:func:`!PyInit_spam` is called. (See below for comments about embedding "
2391-
#~ "Python.) It calls :c:func:`PyModule_Create`, which returns a module "
2392-
#~ "object, and inserts built-in function objects into the newly created "
2393-
#~ "module based upon the table (an array of :c:type:`PyMethodDef` "
2394-
#~ "structures) found in the module definition. :c:func:`PyModule_Create` "
2395-
#~ "returns a pointer to the module object that it creates. It may abort "
2396-
#~ "with a fatal error for certain errors, or return ``NULL`` if the module "
2397-
#~ "could not be initialized satisfactorily. The init function must return "
2398-
#~ "the module object to its caller, so that it then gets inserted into ``sys."
2399-
#~ "modules``."
2400-
#~ msgstr ""
2401-
#~ "當 Python 程式第一次引入模組 :mod:`!spam` 時,:c:func:`!PyInit_spam` 會被"
2402-
#~ "呼叫。(有關嵌入 Python 的註解請參見下文。)它會呼叫回傳一個模組物件的 :c:"
2403-
#~ "func:`PyModule_Create`,並根據在模組定義中所找到的表(一個 :c:type:"
2404-
#~ "`PyMethodDef` 結構的陣列)將內建的函式物件插入到新建立的模組中。:c:func:"
2405-
#~ "`PyModule_Create` 會回傳一個指向它建立之模組物件的指標。對於某些錯誤情況,"
2406-
#~ "它可能會以嚴重錯誤的形式來中止;如果模組無法令人滿意地被初始化,它也會回"
2407-
#~ "傳 ``NULL``。初始化函式必須把模組物件回傳給它的呼叫者,這樣它才會被插入到 "
2408-
#~ "``sys.modules`` 中。"
2409-
2410-
#~ msgid ""
2411-
#~ "Removing entries from ``sys.modules`` or importing compiled modules into "
2412-
#~ "multiple interpreters within a process (or following a :c:func:`fork` "
2413-
#~ "without an intervening :c:func:`exec`) can create problems for some "
2414-
#~ "extension modules. Extension module authors should exercise caution when "
2415-
#~ "initializing internal data structures."
2416-
#~ msgstr ""
2417-
#~ "從 ``sys.modules`` 中移除項目,或在一個行程中將已編譯模組引入到多個直譯器"
2418-
#~ "中(或在沒有 :c:func:`exec` 介入的情況下使用 :c:func:`fork`)可能會對某些"
2419-
#~ "擴充模組造成問題。擴充模組作者在初始化內部資料結構時應特別小心。"
2420-
2421-
#~ msgid ""
2422-
#~ "Unlike our ``spam`` example, ``xxmodule`` uses *multi-phase "
2423-
#~ "initialization* (new in Python 3.5), where a PyModuleDef structure is "
2424-
#~ "returned from ``PyInit_spam``, and creation of the module is left to the "
2425-
#~ "import machinery. For details on multi-phase initialization, see :PEP:"
2426-
#~ "`489`."
2427-
#~ msgstr ""
2428-
#~ "不像我們的 ``spam`` 範例,``xxmodule`` 使用了\\ *多階段初始化 (multi-"
2429-
#~ "phase initialization)*\\ (Python 3.5 新增),其中的 PyModuleDef 結構會從 "
2430-
#~ "``PyInit_spam`` 回傳,而模組的建立則交由引入機制來完成。關於多階段初始化的"
2431-
#~ "詳細資訊請參閱 :PEP:`489`。"

howto/instrumentation.po

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.13\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2024-09-03 11:11+0800\n"
10+
"POT-Creation-Date: 2025-09-04 00:15+0000\n"
1111
"PO-Revision-Date: 2023-08-17 22:17+0800\n"
1212
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -574,18 +574,18 @@ msgstr ""
574574
msgid "(assuming a :ref:`debug build <debug-build>` of CPython 3.6)"
575575
msgstr "(假設 CPython 3.6 的\\ :ref:`除錯建置版本 <debug-build>`)"
576576

577-
#: ../../howto/instrumentation.rst:273
577+
#: ../../howto/instrumentation.rst:275
578578
msgid "Available static markers"
579579
msgstr "可用的靜態標記"
580580

581-
#: ../../howto/instrumentation.rst:277
581+
#: ../../howto/instrumentation.rst:279
582582
msgid ""
583583
"This marker indicates that execution of a Python function has begun. It is "
584584
"only triggered for pure-Python (bytecode) functions."
585585
msgstr ""
586586
"該標記表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸發。"
587587

588-
#: ../../howto/instrumentation.rst:280
588+
#: ../../howto/instrumentation.rst:282
589589
msgid ""
590590
"The filename, function name, and line number are provided back to the "
591591
"tracing script as positional arguments, which must be accessed using "
@@ -594,25 +594,25 @@ msgstr ""
594594
"檔案名稱、函式名稱和列號作為位置引數提供給追蹤腳本,必須使用 ``$arg1``、"
595595
"``$arg2``、``$arg3`` 來存取:"
596596

597-
#: ../../howto/instrumentation.rst:284
597+
#: ../../howto/instrumentation.rst:286
598598
msgid ""
599599
"``$arg1`` : ``(const char *)`` filename, accessible using "
600600
"``user_string($arg1)``"
601601
msgstr ""
602602
"``$arg1`` : ``(const char *)`` 檔案名稱,可使用 ``user_string($arg1)`` 存取"
603603

604-
#: ../../howto/instrumentation.rst:286
604+
#: ../../howto/instrumentation.rst:288
605605
msgid ""
606606
"``$arg2`` : ``(const char *)`` function name, accessible using "
607607
"``user_string($arg2)``"
608608
msgstr ""
609609
"``$arg2`` :``(const char *)`` 函式名稱,可使用 ``user_string($arg2)`` 存取"
610610

611-
#: ../../howto/instrumentation.rst:289
611+
#: ../../howto/instrumentation.rst:291
612612
msgid "``$arg3`` : ``int`` line number"
613613
msgstr "``$arg3`` : ``int`` 列號"
614614

615-
#: ../../howto/instrumentation.rst:293
615+
#: ../../howto/instrumentation.rst:295
616616
msgid ""
617617
"This marker is the converse of :c:func:`!function__entry`, and indicates "
618618
"that execution of a Python function has ended (either via ``return``, or via "
@@ -621,11 +621,11 @@ msgstr ""
621621
"該標記與 :c:func:`!function__entry` 相反,表示 Python 函式的執行已結束(透過 "
622622
"``return`` 或透過例外)。它僅針對純 Python(位元組碼)函式觸發。"
623623

624-
#: ../../howto/instrumentation.rst:297
624+
#: ../../howto/instrumentation.rst:299
625625
msgid "The arguments are the same as for :c:func:`!function__entry`"
626626
msgstr "引數與 :c:func:`!function__entry` 相同"
627627

628-
#: ../../howto/instrumentation.rst:301
628+
#: ../../howto/instrumentation.rst:303
629629
msgid ""
630630
"This marker indicates a Python line is about to be executed. It is the "
631631
"equivalent of line-by-line tracing with a Python profiler. It is not "
@@ -634,39 +634,39 @@ msgstr ""
634634
"該標記表示一列 Python 即將被執行。它相當於使用 Python 分析器來逐行追蹤。它不"
635635
"在 C 函式內觸發。"
636636

637-
#: ../../howto/instrumentation.rst:305
637+
#: ../../howto/instrumentation.rst:307
638638
msgid "The arguments are the same as for :c:func:`!function__entry`."
639639
msgstr "引數與 :c:func:`!function__entry` 相同。"
640640

641-
#: ../../howto/instrumentation.rst:309
641+
#: ../../howto/instrumentation.rst:311
642642
msgid ""
643643
"Fires when the Python interpreter starts a garbage collection cycle. "
644644
"``arg0`` is the generation to scan, like :func:`gc.collect`."
645645
msgstr ""
646646
"當 Python 直譯器開始垃圾回收 (garbage collection) 週期時觸發。``arg0`` 是要掃"
647647
"描的一代 (generation),如 :func:`gc.collect`。"
648648

649-
#: ../../howto/instrumentation.rst:314
649+
#: ../../howto/instrumentation.rst:316
650650
msgid ""
651651
"Fires when the Python interpreter finishes a garbage collection cycle. "
652652
"``arg0`` is the number of collected objects."
653653
msgstr "當 Python 直譯器完成垃圾回收週期時觸發。``arg0`` 是收集到的物件數量。"
654654

655-
#: ../../howto/instrumentation.rst:319
655+
#: ../../howto/instrumentation.rst:321
656656
msgid ""
657657
"Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` "
658658
"is the module name."
659659
msgstr "在 :mod:`importlib` 嘗試查找並載入模組之前觸發。``arg0`` 是模組名稱。"
660660

661-
#: ../../howto/instrumentation.rst:326
661+
#: ../../howto/instrumentation.rst:328
662662
msgid ""
663663
"Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is "
664664
"the module name, ``arg1`` indicates if module was successfully loaded."
665665
msgstr ""
666666
"在呼叫 :mod:`importlib` 的 find_and_load 函式後觸發。 ``arg0`` 是模組名稱,"
667667
"``arg1`` 代表模組是否已成功載入。"
668668

669-
#: ../../howto/instrumentation.rst:335
669+
#: ../../howto/instrumentation.rst:337
670670
msgid ""
671671
"Fires when :func:`sys.audit` or :c:func:`PySys_Audit` is called. ``arg0`` is "
672672
"the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a "
@@ -675,11 +675,11 @@ msgstr ""
675675
"當呼叫 :func:`sys.audit` 或 :c:func:`PySys_Audit` 時觸發。``arg0`` 是 C 字串"
676676
"形式的事件名稱,``arg1`` 是指向元組 (tuple) 物件的 :c:type:`PyObject` 指標。"
677677

678-
#: ../../howto/instrumentation.rst:343
678+
#: ../../howto/instrumentation.rst:345
679679
msgid "SystemTap Tapsets"
680680
msgstr "SystemTap Tapsets"
681681

682-
#: ../../howto/instrumentation.rst:345
682+
#: ../../howto/instrumentation.rst:347
683683
msgid ""
684684
"The higher-level way to use the SystemTap integration is to use a "
685685
"\"tapset\": SystemTap's equivalent of a library, which hides some of the "
@@ -688,11 +688,11 @@ msgstr ""
688688
"使用 SystemTap 整合的高階方法是使用 \"tapset\":SystemTap 相當於一個函式庫,"
689689
"它隱藏了靜態標記的一些低階詳細資訊。"
690690

691-
#: ../../howto/instrumentation.rst:349
691+
#: ../../howto/instrumentation.rst:351
692692
msgid "Here is a tapset file, based on a non-shared build of CPython:"
693693
msgstr "這是一個 tapset 檔案,是基於 CPython 的非共享建置版本:"
694694

695-
#: ../../howto/instrumentation.rst:351
695+
#: ../../howto/instrumentation.rst:353
696696
msgid ""
697697
"/*\n"
698698
" Provide a higher-level wrapping around the function__entry and\n"
@@ -733,23 +733,23 @@ msgstr ""
733733
" frameptr = $arg4\n"
734734
"}"
735735

736-
#: ../../howto/instrumentation.rst:372
736+
#: ../../howto/instrumentation.rst:374
737737
msgid ""
738738
"If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/"
739739
"systemtap/tapset``), then these additional probepoints become available:"
740740
msgstr ""
741741
"如果此檔案是安裝在 SystemTap 的 tapset 目錄中(例如 ``/usr/share/systemtap/"
742742
"tapset``),則這些額外的探測點將可被使用:"
743743

744-
#: ../../howto/instrumentation.rst:378
744+
#: ../../howto/instrumentation.rst:380
745745
msgid ""
746746
"This probe point indicates that execution of a Python function has begun. It "
747747
"is only triggered for pure-Python (bytecode) functions."
748748
msgstr ""
749749
"該探測點表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸"
750750
"發。"
751751

752-
#: ../../howto/instrumentation.rst:383
752+
#: ../../howto/instrumentation.rst:385
753753
msgid ""
754754
"This probe point is the converse of ``python.function.return``, and "
755755
"indicates that execution of a Python function has ended (either via "
@@ -759,11 +759,11 @@ msgstr ""
759759
"這個探測點與 ``python.function.return`` 相反,表示 Python 函式的執行已經結束"
760760
"(透過 ``return`` 或者透過例外)。它僅針對純 Python(位元組碼)函式觸發。"
761761

762-
#: ../../howto/instrumentation.rst:390
762+
#: ../../howto/instrumentation.rst:392
763763
msgid "Examples"
764764
msgstr "範例"
765765

766-
#: ../../howto/instrumentation.rst:391
766+
#: ../../howto/instrumentation.rst:393
767767
msgid ""
768768
"This SystemTap script uses the tapset above to more cleanly implement the "
769769
"example given above of tracing the Python function-call hierarchy, without "
@@ -772,7 +772,7 @@ msgstr ""
772772
"此 SystemTap 腳本使用上面的 tapset 來更清晰地實作上面給出的追蹤 Python 函式呼"
773773
"叫階層結構的範例,而無需直接命名靜態標記:"
774774

775-
#: ../../howto/instrumentation.rst:395
775+
#: ../../howto/instrumentation.rst:397
776776
msgid ""
777777
"probe python.function.entry\n"
778778
"{\n"
@@ -798,7 +798,7 @@ msgstr ""
798798
" thread_indent(-1), funcname, filename, lineno);\n"
799799
"}"
800800

801-
#: ../../howto/instrumentation.rst:410
801+
#: ../../howto/instrumentation.rst:412
802802
msgid ""
803803
"The following script uses the tapset above to provide a top-like view of all "
804804
"running CPython code, showing the top 20 most frequently entered bytecode "
@@ -807,7 +807,7 @@ msgstr ""
807807
"以下腳本使用上面的 tapset 來提供所有正在運行之 CPython 程式碼的近乎最高層視"
808808
"角,顯示整個系統中每秒最常被進入的 20 個位元組碼幀 (bytecode frame):"
809809

810-
#: ../../howto/instrumentation.rst:414
810+
#: ../../howto/instrumentation.rst:416
811811
msgid ""
812812
"global fn_calls;\n"
813813
"\n"

0 commit comments

Comments
 (0)