55#
66# Translators:
77# cissoid <[email protected] >, 20188- # Freesand Leo <[email protected] >, 201898# ppcfish <[email protected] >, 20199+ # Freesand Leo <[email protected] >, 20201010#
1111#, fuzzy
1212msgid ""
@@ -15,7 +15,7 @@ msgstr ""
1515"Report-Msgid-Bugs-To : \n "
1616"POT-Creation-Date : 2020-05-31 09:25+0000\n "
1717"PO-Revision-Date : 2017-02-16 17:43+0000\n "
18- "Last-Translator : ppcfish <ppcfish@gmail .com>, 2019 \n "
18+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2020 \n "
1919"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2020"MIME-Version : 1.0\n "
2121"Content-Type : text/plain; charset=UTF-8\n "
@@ -209,7 +209,7 @@ msgstr "最常见的问题是信号处理函数没有正确定义参数列表。
209209
210210#: ../../faq/library.rst:128
211211msgid "so it should be declared with two parameters::"
212- msgstr ""
212+ msgstr "因此它应当声明为带有两个形参:: "
213213
214214#: ../../faq/library.rst:135
215215msgid "Common tasks"
@@ -266,6 +266,9 @@ msgid ""
266266"the \" production code\" , since this makes it easy to find bugs and even "
267267"design flaws earlier."
268268msgstr ""
269+ "一旦你的程序已经组织为一个函数和类行为的有完整集合,你就应该编写测试函数来检测这些行为。 可以将自动执行一系列测试的测试集关联到每个模块。 "
270+ "这听起来似乎需要大量的工作,但是由于 Python 是如此简洁灵活因此它会极其容易。 "
271+ "你可以通过与“生产代码”同步编写测试函数使编程更为愉快和有趣,因为这将更容易并更早发现代码问题甚至设计缺陷。"
269272
270273#: ../../faq/library.rst:170
271274msgid ""
@@ -377,6 +380,8 @@ msgid ""
377380"The easiest way is to use the :mod:`concurrent.futures` module, especially "
378381"the :mod:`~concurrent.futures.ThreadPoolExecutor` class."
379382msgstr ""
383+ "最简单的方式是使用 :mod:`concurrent.futures` 模块,特别是其中的 "
384+ ":mod:`~concurrent.futures.ThreadPoolExecutor` 类。"
380385
381386#: ../../faq/library.rst:301
382387msgid ""
@@ -771,7 +776,7 @@ msgstr "我需要通过 POST 表单获取网页,有什么代码能简单做到
771776
772777#: ../../faq/library.rst:682
773778msgid "Yes. Here's a simple example that uses :mod:`urllib.request`::"
774- msgstr ""
779+ msgstr "是的。 这里是一个使用 :mod:`urllib.request` 的简单例子:: "
775780
776781#: ../../faq/library.rst:697
777782msgid ""
@@ -842,6 +847,9 @@ msgid ""
842847" in progress, but hasn't finished yet. Different OSes will return different"
843848" values, so you're going to have to check what's returned on your system."
844849msgstr ""
850+ "要防止 TCP 连接发生阻塞,你可以将 socket 设为非阻塞模式。 这样当你执行 :meth:`socket.connect` "
851+ "时,你将或是立即完成连接(不大可能)或是收到一个包含 ``.errno`` 错误码的异常。 ``errno.EINPROGRESS`` "
852+ "表示连接正在进行但还没有完成。 不同的操作系统将返回不同的值,因此你需要确认你的系统会返回什么值。"
845853
846854#: ../../faq/library.rst:774
847855msgid ""
@@ -851,6 +859,9 @@ msgid ""
851859" that you're connected -- or you can pass this socket to "
852860":meth:`select.select` to check if it's writable."
853861msgstr ""
862+ "你可以使用 :meth:`socket.connect_ex` 方法来避免生成异常。 它将只返回 errno 值。 要进行轮询,你可以稍后再次调用 "
863+ ":meth:`socket.connect_ex` -- ``0`` 或 ``errno.EISCONN`` 表示连接已完成 -- 或者你也可以将此 "
864+ "socket 传给 :meth:`select.select` 来检查它是否可写。"
854865
855866#: ../../faq/library.rst:780
856867msgid ""
0 commit comments