Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f749f01

Browse files
[po] auto sync
1 parent 9716178 commit f749f01

3 files changed

Lines changed: 6854 additions & 6781 deletions

File tree

c-api/intro.po

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ msgid ""
377377
" (There's an obvious problem with objects that reference each other here; "
378378
"for now, the solution is \"don't do that.\")"
379379
msgstr ""
380+
"引用计数非常重要,因为现代计算机内存(通常十分)有限;它计算有多少不同的地方引用同一个对象。这样的地方可以是某个对象,或者是某个全局(或静态)C "
381+
"变量,亦或是某个 C 函数的局部变量。当一个对象的引用计数变为 "
382+
"0,释放该对象。如果这个已释放的对象包含其它对象的引用计数,则递减这些对象的引用计数。如果这些对象的引用计数减少为零,则可以依次释放这些对象,依此类推。(这里有一个很明显的问题——对象之间相互引用;目前,解决方案是“不要那样做”。)"
380383

381384
#: ../../c-api/intro.rst:270
382385
msgid ""
@@ -395,6 +398,11 @@ msgid ""
395398
"memory (assuming ``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the "
396399
"reference count increment is a simple operation."
397400
msgstr ""
401+
"总是显式操作引用计数。通常的方法是使用宏 :c:func:`Py_INCREF` 来增加一个对象的引用计数,使用宏 "
402+
":c:func:`Py_DECREF` 来减少一个对象的引用计数。宏 :c:func:`Py_DECREF` "
403+
"必须检查引用计数是否为零,然后调用对象的释放器, 因此它比 incref "
404+
"宏复杂得多。释放器是一个包含在对象类型结构中的函数指针。如果对象是复合对象类型(例如列表),则类型特定的释放器负责递减包含在对象中的其他对象的引用计数,并执行所需的终结。引用计数不会溢出,至少用与虚拟内存中不同内存位置一样多的位用于保存引用计数(即"
405+
" ``sizeof(Py_ssize_t) >= sizeof(void*)`` )。因此,引用计数递增是一个简单的操作。"
398406

399407
#: ../../c-api/intro.rst:284
400408
msgid ""
@@ -413,6 +421,10 @@ msgid ""
413421
"guarantees to hold a reference to every argument for the duration of the "
414422
"call."
415423
msgstr ""
424+
"没有必要为每个包含指向对象的指针的局部变量增加对象的引用计数。理论上,当变量指向对象时,对象的引用计数增加 1 ,当变量超出范围时,对象的引用计数减少 "
425+
"1 "
426+
"。但是,这两者相互抵消,所以最后引用计数没有改变。使用引用计数的唯一真正原因是只要我们的变量指向它,就可以防止对象被释放。如果知道至少有一个对该对象的其他引用存活时间至少和我们的变量一样长,则没必要临时增加引用计数。一个典型的情形是,对象作为参数从"
427+
" Python 中传递给被调用的扩展模块中的 C 函数时,调用机制会保证在调用期间持有对所有参数的引用。"
416428

417429
#: ../../c-api/intro.rst:298
418430
msgid ""

howto/urllib2.po

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# 汪心禾 <[email protected]>, 2019
1313
# Yi Cao <[email protected]>, 2019
1414
# Freesand Leo <[email protected]>, 2020
15+
# Dai Xu <[email protected]>, 2021
16+
# Jiuh-star <[email protected]>, 2021
1517
#
1618
#, fuzzy
1719
msgid ""
@@ -20,7 +22,7 @@ msgstr ""
2022
"Report-Msgid-Bugs-To: \n"
2123
"POT-Creation-Date: 2021-02-06 05:23+0000\n"
2224
"PO-Revision-Date: 2017-02-16 17:46+0000\n"
23-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2020\n"
25+
"Last-Translator: Jiuh-star <jiuh.star@gmail.com>, 2021\n"
2426
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2527
"MIME-Version: 1.0\n"
2628
"Content-Type: text/plain; charset=UTF-8\n"
@@ -30,7 +32,7 @@ msgstr ""
3032

3133
#: ../../howto/urllib2.rst:5
3234
msgid "HOWTO Fetch Internet Resources Using The urllib Package"
33-
msgstr "HOWTO 使用 urllib 包获取网络资源"
35+
msgstr "如何利用 urllib 包获取网络资源"
3436

3537
#: ../../howto/urllib2.rst:0
3638
msgid "Author"
@@ -57,18 +59,19 @@ msgstr "概述"
5759
msgid ""
5860
"You may also find useful the following article on fetching web resources "
5961
"with Python:"
60-
msgstr "关于使用 Python 获取网页资源,你或许还可以找到下列有用的文章:"
62+
msgstr "关于如何用 Python 获取 web 资源,以下文章或许也很有用:"
6163

6264
#: ../../howto/urllib2.rst:25
6365
msgid ""
6466
"`Basic Authentication "
6567
"<http://www.voidspace.org.uk/python/articles/authentication.shtml>`_"
6668
msgstr ""
67-
"`基本的验证 <http://www.voidspace.org.uk/python/articles/authentication.shtml>`_"
69+
"`基础的身份认证 "
70+
"<http://www.voidspace.org.uk/python/articles/authentication.shtml>`_"
6871

6972
#: ../../howto/urllib2.rst:27
7073
msgid "A tutorial on *Basic Authentication*, with examples in Python."
71-
msgstr "关于 *基本的验证* 的入门指南,带有一些 Python 的示例。"
74+
msgstr "*基础身份验证* 的教程,带有一些 Python 示例。"
7275

7376
#: ../../howto/urllib2.rst:29
7477
msgid ""
@@ -79,10 +82,10 @@ msgid ""
7982
"common situations - like basic authentication, cookies, proxies and so on. "
8083
"These are provided by objects called handlers and openers."
8184
msgstr ""
82-
"**urllib.request** 是一个用于获取 URL (统一资源定位地址)的 Python 模块。它以 *urlopen* "
83-
"函数的形式提供了一个非常简单的接口。该接口能够使用不同的协议获取 "
84-
"URL。同时它也提供了一个略微复杂的接口来处理常见情形——如:基本验证、cookies、代理等等。这些功能是通过叫做 handlers 和 opener"
85-
" 的对象来提供的。"
85+
"**urllib.request** 是用于获取 URL (统一资源定位符)的 Python 模块。它以 *urlopen* "
86+
"函数的形式提供了一个非常简单的接口,能用不同的协议获取 "
87+
"URL。同时它还为处理各种常见情形提供了一个稍微复杂一些的接口——比如:基础身份认证、cookies、代理等等。这些功能是由名为 handlers 和 "
88+
"opener 的对象提供的。"
8689

8790
#: ../../howto/urllib2.rst:36
8891
msgid ""
@@ -92,9 +95,9 @@ msgid ""
9295
"protocols (e.g. FTP, HTTP). This tutorial focuses on the most common case, "
9396
"HTTP."
9497
msgstr ""
95-
"urllib.request 支持多种 \"URL 网址方案\" (通过 URL中 ``\":\"`` 之前的字符串加以区分——如 URL 地址 "
96-
"``\"ftp://python.org/\"` 中的 ``\"ftp\"```) ,使用与之相关的网络协议(如:FTP、 HTTP)来获取 URL "
97-
"资源。本指南重点关注最常用的情形—— HTTP。"
98+
"urllib.request 支持多种 \"URL 方案\" (通过 URL中 ``\":\"`` 之前的字符串加以区分——如 "
99+
"``\"ftp://python.org/\"` 中的 ``\"ftp\"```)即为采用其关联网络协议(FTP、HTTP 之类)的 URL 方案 "
100+
"。本教程重点关注最常用的 HTTP 场景。"
98101

99102
#: ../../howto/urllib2.rst:41
100103
msgid ""
@@ -107,14 +110,18 @@ msgid ""
107110
"through. It is not intended to replace the :mod:`urllib.request` docs, but "
108111
"is supplementary to them."
109112
msgstr ""
113+
"对于简单场景而言, *urlopen* 用起来十分容易。但只要在打开 HTTP URL "
114+
"时遇到错误或非常情况,就需要对超文本传输协议有所了解才行。最全面、最权威的 HTTP 参考是 :rfc:`2616` "
115+
"。那是一份技术文档,并没有追求可读性。本 文旨在说明 *urllib* 的用法,为了便于阅读也附带了足够详细的 HTTP 信息。本文并不是为了替代 "
116+
":mod:`urllib.request` 文档,只是其补充说明而已。 "
110117

111118
#: ../../howto/urllib2.rst:51
112119
msgid "Fetching URLs"
113-
msgstr "提取URL"
120+
msgstr "获取 URL 资源"
114121

115122
#: ../../howto/urllib2.rst:53
116123
msgid "The simplest way to use urllib.request is as follows::"
117-
msgstr "下面是使用 urllib.request 最简单的方式:"
124+
msgstr "urllib.request 最简单的使用方式如下所示:"
118125

119126
#: ../../howto/urllib2.rst:59
120127
msgid ""

0 commit comments

Comments
 (0)