@@ -16,7 +16,7 @@ msgid ""
1616msgstr ""
1717"Project-Id-Version : Python 3.12\n "
1818"Report-Msgid-Bugs-To : \n "
19- "POT-Creation-Date : 2023-07-28 14:13+0000\n "
19+ "POT-Creation-Date : 2023-08-25 14:13+0000\n "
2020"PO-Revision-Date : 2021-06-28 00:52+0000\n "
2121"Last-Translator : Freesand Leo <yuqinju@163.com>, 2023\n "
2222"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -190,8 +190,8 @@ msgstr "Python 中存在类似 C 的 onexit() 函数的东西吗?"
190190#: ../../faq/library.rst:113
191191msgid ""
192192"The :mod:`atexit` module provides a register function that is similar to C's"
193- " :c:func:`onexit`."
194- msgstr ":mod:`atexit` 模块提供了一个与 C 的 :c:func:`onexit` 函数类似的注册函数。 "
193+ " :c:func:`! onexit`."
194+ msgstr ""
195195
196196#: ../../faq/library.rst:118
197197msgid "Why don't my signal handlers work?"
@@ -439,12 +439,10 @@ msgstr "这些不是原子的:"
439439#: ../../faq/library.rst:399
440440msgid ""
441441"Operations that replace other objects may invoke those other objects' "
442- ":meth:`__del__` method when their reference count reaches zero, and that can "
443- " affect things. This is especially true for the mass updates to "
442+ ":meth:`~object. __del__` method when their reference count reaches zero, and "
443+ "that can affect things. This is especially true for the mass updates to "
444444"dictionaries and lists. When in doubt, use a mutex!"
445445msgstr ""
446- "覆盖其他对象的操作会在其他对象的引用计数变成 0 时触发其 :meth:`__del__` "
447- "方法,这可能会产生一些影响。对字典和列表进行大量操作时尤其如此。如果有疑问的话,使用互斥锁!"
448446
449447#: ../../faq/library.rst:406
450448msgid "Can't we get rid of the Global Interpreter Lock?"
@@ -839,29 +837,24 @@ msgstr "通常会用 :mod:`select` 模块处理 socket 异步 I/O。"
839837#: ../../faq/library.rst:767
840838msgid ""
841839"To prevent the TCP connect from blocking, you can set the socket to non-"
842- "blocking mode. Then when you do the :meth:`socket.connect`, you will either"
843- " connect immediately (unlikely) or get an exception that contains the error "
844- "number as ``.errno``. ``errno.EINPROGRESS`` indicates that the connection is"
845- " in progress, but hasn't finished yet. Different OSes will return different"
846- " values, so you're going to have to check what's returned on your system."
847- msgstr ""
848- "要防止 TCP 连接发生阻塞,你可以将 socket 设为非阻塞模式。 这样当你执行 :meth:`socket.connect` "
849- "时,你将或是立即完成连接(不大可能)或是收到一个包含 ``.errno`` 错误码的异常。 ``errno.EINPROGRESS`` "
850- "表示连接正在进行但还没有完成。 不同的操作系统将返回不同的值,因此你需要确认你的系统会返回什么值。"
851-
852- #: ../../faq/library.rst:774
853- msgid ""
854- "You can use the :meth:`socket.connect_ex` method to avoid creating an "
855- "exception. It will just return the errno value. To poll, you can call "
856- ":meth:`socket.connect_ex` again later -- ``0`` or ``errno.EISCONN`` indicate"
857- " that you're connected -- or you can pass this socket to "
840+ "blocking mode. Then when you do the :meth:`~socket.socket.connect`, you "
841+ "will either connect immediately (unlikely) or get an exception that contains"
842+ " the error number as ``.errno``. ``errno.EINPROGRESS`` indicates that the "
843+ "connection is in progress, but hasn't finished yet. Different OSes will "
844+ "return different values, so you're going to have to check what's returned on"
845+ " your system."
846+ msgstr ""
847+
848+ #: ../../faq/library.rst:775
849+ msgid ""
850+ "You can use the :meth:`~socket.socket.connect_ex` method to avoid creating "
851+ "an exception. It will just return the errno value. To poll, you can call "
852+ ":meth:`~socket.socket.connect_ex` again later -- ``0`` or ``errno.EISCONN`` "
853+ "indicate that you're connected -- or you can pass this socket to "
858854":meth:`select.select` to check if it's writable."
859855msgstr ""
860- "你可以使用 :meth:`socket.connect_ex` 方法来避免生成异常。 它将只返回 errno 值。 要进行轮询,你可以稍后再次调用 "
861- ":meth:`socket.connect_ex` -- ``0`` 或 ``errno.EISCONN`` 表示连接已完成 -- 或者你也可以将此 "
862- "socket 传给 :meth:`select.select` 来检查它是否可写。"
863856
864- #: ../../faq/library.rst:780
857+ #: ../../faq/library.rst:783
865858msgid ""
866859"The :mod:`asyncio` module provides a general purpose single-threaded and "
867860"concurrent asynchronous library, which can be used for writing non-blocking "
@@ -871,19 +864,19 @@ msgstr ""
871864":mod:`asyncio` 模块提供了通用的单线程并发异步库,它可被用来编写非阻塞的网络代码。 第三方的 `Twisted "
872865"<https://twisted.org/>`_ 库是一个热门且功能丰富的替代选择。"
873866
874- #: ../../faq/library.rst:788
867+ #: ../../faq/library.rst:791
875868msgid "Databases"
876869msgstr "数据库"
877870
878- #: ../../faq/library.rst:791
871+ #: ../../faq/library.rst:794
879872msgid "Are there any interfaces to database packages in Python?"
880873msgstr "Python 中有数据库包的接口吗?"
881874
882- #: ../../faq/library.rst:793
875+ #: ../../faq/library.rst:796
883876msgid "Yes."
884877msgstr "有的。"
885878
886- #: ../../faq/library.rst:795
879+ #: ../../faq/library.rst:798
887880msgid ""
888881"Interfaces to disk-based hashes such as :mod:`DBM <dbm.ndbm>` and :mod:`GDBM"
889882" <dbm.gnu>` are also included with standard Python. There is also the "
@@ -893,7 +886,7 @@ msgstr ""
893886"标准 Python 还包含了基于磁盘的哈希接口例如 :mod:`DBM <dbm.ndbm>` 和 :mod:`GDBM <dbm.gnu>` "
894887"。除此之外还有 :mod:`sqlite3` 模块,该模块提供了一个轻量级的基于磁盘的关系型数据库。"
895888
896- #: ../../faq/library.rst:800
889+ #: ../../faq/library.rst:803
897890msgid ""
898891"Support for most relational databases is available. See the "
899892"`DatabaseProgramming wiki page "
@@ -902,11 +895,11 @@ msgstr ""
902895"大多数关系型数据库都已经支持。查看 `数据库编程 wiki 页面 "
903896"<https://wiki.python.org/moin/DatabaseProgramming>`_ 获取更多信息。"
904897
905- #: ../../faq/library.rst:806
898+ #: ../../faq/library.rst:809
906899msgid "How do you implement persistent objects in Python?"
907900msgstr "在 Python 中如何实现持久化对象?"
908901
909- #: ../../faq/library.rst:808
902+ #: ../../faq/library.rst:811
910903msgid ""
911904"The :mod:`pickle` library module solves this in a very general way (though "
912905"you still can't store things like open files, sockets or windows), and the "
@@ -916,55 +909,55 @@ msgstr ""
916909":mod:`pickle` 库模块以一种非常通用的方式解决了这个问题(虽然你依然不能用它保存打开的文件、套接字或窗口之类的东西),此外 "
917910":mod:`shelve` 库模块可使用 pickle 和 (g)dbm 来创建包含任意 Python 对象的持久化映射。"
918911
919- #: ../../faq/library.rst:815
912+ #: ../../faq/library.rst:818
920913msgid "Mathematics and Numerics"
921914msgstr "数学和数字"
922915
923- #: ../../faq/library.rst:818
916+ #: ../../faq/library.rst:821
924917msgid "How do I generate random numbers in Python?"
925918msgstr "Python 中怎样生成随机数?"
926919
927- #: ../../faq/library.rst:820
920+ #: ../../faq/library.rst:823
928921msgid ""
929922"The standard module :mod:`random` implements a random number generator. "
930923"Usage is simple::"
931924msgstr ":mod:`random` 标准库模块实现了随机数生成器,使用起来非常简单:"
932925
933- #: ../../faq/library.rst:826
926+ #: ../../faq/library.rst:829
934927msgid "This returns a random floating point number in the range [0, 1)."
935928msgstr "这个函数会返回 [0, 1) 之间的随机浮点数。"
936929
937- #: ../../faq/library.rst:828
930+ #: ../../faq/library.rst:831
938931msgid ""
939932"There are also many other specialized generators in this module, such as:"
940933msgstr "该模块中还有许多其他的专门的生成器,例如:"
941934
942- #: ../../faq/library.rst:830
935+ #: ../../faq/library.rst:833
943936msgid "``randrange(a, b)`` chooses an integer in the range [a, b)."
944937msgstr "``randrange(a, b)`` 返回 [a, b) 区间内的一个整型数。"
945938
946- #: ../../faq/library.rst:831
939+ #: ../../faq/library.rst:834
947940msgid "``uniform(a, b)`` chooses a floating point number in the range [a, b)."
948941msgstr "``uniform(a, b)`` 返回 [a, b) 区间之间的浮点数。"
949942
950- #: ../../faq/library.rst:832
943+ #: ../../faq/library.rst:835
951944msgid ""
952945"``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution."
953946msgstr "``normalvariate(mean, sdev)`` 使用正态(高斯)分布采样。"
954947
955- #: ../../faq/library.rst:834
948+ #: ../../faq/library.rst:837
956949msgid "Some higher-level functions operate on sequences directly, such as:"
957950msgstr "还有一些高级函数直接对序列进行操作,例如:"
958951
959- #: ../../faq/library.rst:836
952+ #: ../../faq/library.rst:839
960953msgid "``choice(S)`` chooses a random element from a given sequence."
961954msgstr "``choice(S)`` 从给定的序列中随机选择一个元素。"
962955
963- #: ../../faq/library.rst:837
956+ #: ../../faq/library.rst:840
964957msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly."
965958msgstr "``shuffle(L)`` 会对列表执行原地重排,即将其随机地打乱。"
966959
967- #: ../../faq/library.rst:839
960+ #: ../../faq/library.rst:842
968961msgid ""
969962"There's also a ``Random`` class you can instantiate to create independent "
970963"multiple random number generators."
0 commit comments