@@ -979,6 +979,12 @@ msgid ""
979979"subprocess is still running and the :meth:`~multiprocessing.Process.join` "
980980"method to wait for the process to exit."
981981msgstr ""
982+ "The :mod:`multiprocessing` 模块起初是作为 :mod:`threading` 模块的精确模拟,使用进程而不是线程。 这个目标在"
983+ " Python 2.6 的开发过程中被放弃了,但模块的总体思路仍然是类似的。 基础的类是 "
984+ ":class:`~multiprocessing.Process`,它接受一个可调用对象和一组参数。 "
985+ ":meth:`~multiprocessing.Process.start` 方法将设置在一个子进程中运行的可调用对象,之后你可以调用 "
986+ ":meth:`~multiprocessing.Process.is_alive` 方法来检查子进程是否仍在运行并调用 "
987+ ":meth:`~multiprocessing.Process.join` 方法来等待进程退出。"
982988
983989#: ../../whatsnew/2.6.rst:579
984990msgid ""
@@ -1075,6 +1081,15 @@ msgid ""
10751081"The following code uses a :class:`~multiprocessing.pool.Pool` to spread "
10761082"requests across 5 worker processes and retrieve a list of results::"
10771083msgstr ""
1084+ "另外两个类,:class:`~multiprocessing.pool.Pool` 和 "
1085+ ":class:`~multiprocessing.Manager`,提供更高层级的接口。 "
1086+ ":class:`~multiprocessing.pool.Pool` 将创建固定数量的工作进程,然后可以通过调用will create a fixed"
1087+ " number of worker processes, and requests can then be distributed to the "
1088+ "workers by calling :meth:`~multiprocessing.pool.Pool.apply` 或 "
1089+ ":meth:`~multiprocessing.pool.Pool.apply_async` 来添加单个请求,通过调用 "
1090+ ":meth:`~multiprocessing.pool.Pool.map` 或 "
1091+ ":meth:`~multiprocessing.pool.Pool.map_async` 来添加多个请求以将请求分发给这些工作进程。 以下代码使用 "
1092+ ":class:`~multiprocessing.pool.Pool` 将请求分散到 5 个工作进程并获取结果列表::"
10781093
10791094#: ../../whatsnew/2.6.rst:635
10801095msgid ""
@@ -1133,6 +1148,13 @@ msgid ""
11331148":meth:`~multiprocessing.managers.SyncManager.Semaphore` to create shared "
11341149"locks.)"
11351150msgstr ""
1151+ "另一个高层级的接口,:class:`~multiprocessing.Manager` 类,将创建一个单独的可以拥有 Python "
1152+ "数据结构的主副本的服务器进程。 之后其他的进程可以使用代理对象来访问和修改这些数据结构。 以下示例通过调用 :meth:`dict` "
1153+ "方法创建了一个共享字典;随后工作进程可将值插入到字典中。 (不会自动为你执行锁定,这在本示例中无关紧要。 "
1154+ ":class:`~multiprocessing.Manager` 的方法还包括 "
1155+ ":meth:`~multiprocessing.managers.SyncManager.Lock`, "
1156+ ":meth:`~multiprocessing.managers.SyncManager.RLock` 和 "
1157+ ":meth:`~multiprocessing.managers.SyncManager.Semaphore` 用于创建共享锁。)"
11361158
11371159#: ../../whatsnew/2.6.rst:669
11381160msgid ""
@@ -1563,6 +1585,8 @@ msgid ""
15631585"calls the type's :meth:`~object.__format__` method with the provided "
15641586"specifier::"
15651587msgstr ""
1588+ "还有一个内置函数 :func:`format` 可以格式化单个值。 它会调用类型的 :meth:`~object.__format__` "
1589+ "方法并传入给定的说明符::"
15661590
15671591#: ../../whatsnew/2.6.rst:848
15681592msgid ""
@@ -1913,6 +1937,9 @@ msgid ""
19131937" in the :mod:`io` module that separates buffering and text-handling features"
19141938" from the fundamental read and write operations."
19151939msgstr ""
1940+ "Python 的内置文件对象支持多种方法,但文件型对象并不一定支持所有这些方法。 例如,模仿文件的对象通常支持 :meth:`!read` 和 "
1941+ ":meth:`!write`,但它们可能不支持 :meth:`!readline`。 Python 3.0 在 :mod:`io` "
1942+ "模块中引入了一个分层的 I/O 库,它将缓冲和文本处理特性从基本读写操作中分离出来。"
19161943
19171944#: ../../whatsnew/2.6.rst:1046
19181945msgid ""
@@ -1931,6 +1958,13 @@ msgid ""
19311958":meth:`~io.IOBase.writable`, and :meth:`~io.IOBase.seekable` methods for "
19321959"determining what operations a given object will allow."
19331960msgstr ""
1961+ ":class:`~io.RawIOBase` 定义了原始 I/O 操作: :meth:`~io.RawIOBase.read`, "
1962+ ":meth:`~io.RawIOBase.readinto`, :meth:`~io.RawIOBase.write`, "
1963+ ":meth:`~io.IOBase.seek`, :meth:`~io.IOBase.tell`, "
1964+ ":meth:`~io.IOBase.truncate` 和 :meth:`~io.IOBase.close`。 "
1965+ "这个类的大多数方法通常会映射到单个系统调用。 还有 :meth:`~io.IOBase.readable`, "
1966+ ":meth:`~io.IOBase.writable` 和 :meth:`~io.IOBase.seekable` "
1967+ "等方法用于确定给定的对象允许哪些操作。"
19341968
19351969#: ../../whatsnew/2.6.rst:1058
19361970msgid ""
@@ -1946,6 +1980,9 @@ msgid ""
19461980"adds a :attr:`~io.BufferedIOBase.raw` attribute holding the underlying raw "
19471981"object."
19481982msgstr ""
1983+ ":class:`~io.BufferedIOBase` 是一个抽象基类,它在内存中缓冲数据以减少使用的系统调用次数,使 I/O 处理更为高效。 它支持 "
1984+ ":class:`~io.RawIOBase` 的所有方法,并增加了一个 :attr:`~io.BufferedIOBase.raw` "
1985+ "属性用于存放下层的原始对象。"
19491986
19501987#: ../../whatsnew/2.6.rst:1069
19511988msgid ""
@@ -5101,6 +5138,8 @@ msgid ""
51015138"versions of these built-in functions that can be imported when writing "
51025139"3.0-compatible code."
51035140msgstr ""
5141+ "Python 3.0 对内置函数库进行了许多更改,大多数更改无法在 Python 2.x 系统中引入因为它们会破坏兼容性。 "
5142+ ":mod:`!future_builtins` 模块提供了这些内置函数的不同版本,可以在编写 3.0 兼容的代码时导入。"
51045143
51055144#: ../../whatsnew/2.6.rst:2762
51065145msgid "The functions in this module currently include:"