@@ -1764,6 +1764,10 @@ msgid ""
17641764"one sub-interpreter into a namespace of another (sub-)interpreter; this "
17651765"should be avoided if possible."
17661766msgstr ""
1767+ "由于子解释器 (以及主解释器) 都是同一个进程的组成部分,它们之间的隔离状态并非完美 --- 举例来说,使用低层级的文件操作如 "
1768+ ":func:`os.close` 时它们可能 (无意或恶意地) 影响它们各自打开的文件。 由于 (子) "
1769+ "解释器之间共享扩展的方式,某些扩展可能无法正常工作;在使用单阶段初始化或者 (静态) 全局变量时尤其如此。 "
1770+ "在一个子解释器中创建的对象有可能被插入到另一个 (子) 解释器的命名空间中;这种情况应当尽可能地避免。"
17671771
17681772#: ../../c-api/init.rst:1368
17691773msgid ""
@@ -1773,6 +1777,8 @@ msgid ""
17731777" dictionary of loaded modules. It is equally important to avoid sharing "
17741778"objects from which the above are reachable."
17751779msgstr ""
1780+ "应当特别注意避免在子解释器之间共享用户自定义的函数、方法、实例或类,因为由这些对象执行的导入 操作可能会影响错误的已加载模块的 (子) 解释器的字典。 "
1781+ "同样重要的一点是应当避免共享可被上述对象访问的对象 。"
17761782
17771783#: ../../c-api/init.rst:1374
17781784msgid ""
@@ -1858,6 +1864,9 @@ msgid ""
18581864"calling Python code from arbitrary C threads. Instead, use the "
18591865":ref:`PyGILState API<gilstate>`."
18601866msgstr ""
1867+ "这是一个低层级函数,只在非常特殊的情况下有用。 不能保证 *func* 会尽快被调用。 如果主线程忙于执行某个系统调用,*func* "
1868+ "将不会在系统调用返回之前被调用。 此函数 通常 **不适合** 从任意 C 线程调用 Python 代码。 作为替代,请使用 "
1869+ ":ref:`PyGILStateAPI <gilstate>`。"
18611870
18621871#: ../../c-api/init.rst:1429
18631872msgid ""
@@ -1866,6 +1875,7 @@ msgid ""
18661875"from the main interpreter. Each subinterpreter now has its own list of "
18671876"scheduled calls."
18681877msgstr ""
1878+ "如果此函数在子解释器中被调用,则函数 *func* 将被安排在子解释器中调用,而不是在主解释器中调用。现在每个子解释器都有自己的计划调用列表。"
18691879
18701880#: ../../c-api/init.rst:1440
18711881msgid "Profiling and Tracing"
@@ -1876,7 +1886,7 @@ msgid ""
18761886"The Python interpreter provides some low-level support for attaching "
18771887"profiling and execution tracing facilities. These are used for profiling, "
18781888"debugging, and coverage analysis tools."
1879- msgstr ""
1889+ msgstr "Python 解释器为附加的性能分析和执行跟踪工具提供了一些低层级的支持。 它们可被用于性能分析、调试和覆盖分析工具。 "
18801890
18811891#: ../../c-api/init.rst:1449
18821892msgid ""
@@ -1887,6 +1897,8 @@ msgid ""
18871897"basic events reported to the trace function are the same as had been "
18881898"reported to the Python-level trace functions in previous versions."
18891899msgstr ""
1900+ "这个 C 接口允许性能分析或跟踪代码避免调用 Python 层级的可调用对象带来的开销,它能直接执行 C 函数调用。 "
1901+ "此工具的基本属性没有变化;这个接口允许针对每个线程安装跟踪函数,并且向跟踪函数报告的基本事件与之前版本中向 Python 层级跟踪函数报告的事件相同。"
18901902
18911903#: ../../c-api/init.rst:1459
18921904msgid ""
@@ -1967,6 +1979,8 @@ msgid ""
19671979"is not reported as there is no control transfer to the Python bytecode in "
19681980"the corresponding frame."
19691981msgstr ""
1982+ "当对一个函数或方法的新调用被报告,或是向一个生成器增加新条目时传给 :c:type:`Py_tracefunc` 函数的 *what* 形参的值。 "
1983+ "请注意针对生成器函数的迭代器的创建情况不会被报告因为在相应的帧中没有向 Python字节码转移控制权。"
19701984
19711985#: ../../c-api/init.rst:1500
19721986msgid ""
0 commit comments