8000 [po] auto sync · python/python-docs-zh-cn@a3379f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit a3379f2

Browse files
[po] auto sync
1 parent 9afff08 commit a3379f2

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "81.15%", "updated_at": "2025-03-24T01:19:35Z"}
1+
{"translation": "81.17%", "updated_at": "2025-03-25T23:55:27Z"}

reference/datamodel.po

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
# LeeWendao <LeeWendao@outlook.com>, 2023
2727
# Alpha Du <alphanow@gmail.com>, 2024
2828
# lqks, 2024
29+
# Nyuan Zhang, 2025
2930
# Freesand Leo <yuqinju@163.com>, 2025
3031
#
3132
#, fuzzy
@@ -1186,6 +1187,10 @@ msgid ""
11861187
" manually set on the module object after it has been created when using this"
11871188
" approach."
11881189
msgstr ""
1190+
"要动态创建模块而非使用导入系统创建,建议使用 "
1191+
":func:`importlib.util.module_from_spec`,它会将各种由导入控制的属性设置为适当的值。也可以使用 "
1192+
":class:`types.ModuleType` "
1193+
"构造器直接创建模块,但这种方法更容易出错,因为在使用这种方法时,必须在创建模块对象后手动设置其大部分属性。"
11891194

11901195
#: ../../reference/datamodel.rst:912
11911196
msgid ""
@@ -1195,6 +1200,8 @@ msgid ""
11951200
" Note that updating an attribute on :attr:`!__spec__` will not update the "
11961201
"corresponding attribute on the module itself:"
11971202
msgstr ""
1203+
"对 :attr:`~module.__name__` 以外的用例,**强烈** 建议使用 :attr:`~module.__spec__` "
1204+
"及其属性,而非此处列出的其他单独属性。请注意更新 :attr:`!__spec__` 上的属性时不会连带更新模块本身的同名属性。"
11981205

11991206
#: ../../reference/datamodel.rst:918
12001207
msgid ""
@@ -1257,6 +1264,8 @@ msgid ""
12571264
":attr:`module.__name__` if the module itself is a package). See :pep:`366` "
12581265
"for further details."
12591266
msgstr ""
1267+
"如果一个模块是顶层模块(不是任何包的一部分),该属性应被设置为空字符串 ``''``。否则,它应被设置为模块所属包的名字(如果模块本身是一个包,它可以是"
1268+
" :attr:`module.__name__` 的值)。详见 :pep:`366`。"
12601269

12611270
#: ../../reference/datamodel.rst:958
12621271
msgid ""
@@ -1266,6 +1275,9 @@ msgid ""
12661275
" use :func:`importlib.util.module_from_spec` instead to ensure the attribute"
12671276
" is set to a :class:`str`."
12681277
msgstr ""
1278+
"在为主模块计算显式相对导入时,这个属性而非 :attr:`~module.__name__` 被使用。在使用 "
1279+
":class:`types.ModuleType` 构造器动态创建模块时会被默认设为 ``None``。要确保这个属性是 "
1280+
":class:`str`,请使用 :func:`importlib.util.module_from_spec`。"
12691281

12701282
#: ../../reference/datamodel.rst:964
12711283
msgid ""
@@ -1275,13 +1287,17 @@ msgid ""
12751287
"fallback if :attr:`!__spec__.parent` is not set, and this fallback path is "
12761288
"deprecated."
12771289
msgstr ""
1290+
"**强烈** 建议使用 :attr:`module.__spec__.parent "
1291+
"<importlib.machinery.ModuleSpec.parent>` 而非 :attr:`!module.__package__`。 "
1292+
":attr:`__package__` 现在仅作 :attr:`!__spec__.parent` 未被设置时的回退路径,且这条回退路径已被弃用。"
12781293

12791294
#: ../../reference/datamodel.rst:970 ../../reference/datamodel.rst:1011
12801295
msgid ""
12811296
"This attribute now defaults to ``None`` for modules created dynamically "
12821297
"using the :class:`types.ModuleType` constructor. Previously the attribute "
12831298
"was optional."
12841299
msgstr ""
1300+
"对于使用 :class:`types.ModuleType` 构造器动态创建的模块,该属性现在默认为 ``None``。先前该属性是可选的。"
12851301

12861302
#: ../../reference/datamodel.rst:975
12871303
msgid ""
@@ -1290,37 +1306,44 @@ msgid ""
12901306
":attr:`__package__` is now only used as a fallback during import resolution "
12911307
"if :attr:`!__spec__.parent` is not defined."
12921308
msgstr ""
1309+
":attr:`!__package__` 的值应与 :attr:`__spec__.parent "
1310+
"<importlib.machinery.ModuleSpec.parent>` 相同。:attr:`__package__` 现在仅作导入解析期间 "
1311+
":attr:`!__spec__.parent` 未被定义时的回退值。"
12931312

12941313
#: ../../reference/datamodel.rst:981
12951314
msgid ""
12961315
":exc:`ImportWarning` is raised if an import resolution falls back to "
12971316
":attr:`!__package__` instead of :attr:`__spec__.parent "
12981317
"<importlib.machinery.ModuleSpec.parent>`."
12991318
msgstr ""
1319+
"如果导入解析回退到 :attr:`!__package__` 而非 :attr:`__spec__.parent "
1320+
"<importlib.machinery.ModuleSpec.parent>`,会引发 :exc:`ImportWarning`。"
13001321

13011322
#: ../../reference/datamodel.rst:986
13021323
msgid ""
13031324
"Raise :exc:`DeprecationWarning` instead of :exc:`ImportWarning` when falling"
13041325
" back to :attr:`!__package__` during import resolution."
13051326
msgstr ""
1327+
"在导入解析期间回退到 :attr:`!__package__` 时会引发 :exc:`DeprecationWarning` 而非 "
1328+
":exc:`ImportWarning`。"
13061329

13071330
#: ../../reference/datamodel.rst:990
13081331
msgid ""
13091332
":attr:`!__package__` will cease to be set or taken into consideration by the"
13101333
" import system or standard library."
1311-
msgstr ""
1334+
msgstr ":attr:`!__package__` 将不再被设置或者被导入系统或标准库纳入考量。"
13121335

13131336
#: ../../reference/datamodel.rst:996
13141337
msgid ""
13151338
"The :term:`loader` object that the import machinery used to load the module."
1316-
msgstr ""
1339+
msgstr "导入系统用来加载模块的 :term:`loader` 对象。"
13171340

13181341
#: ../../reference/datamodel.rst:998
13191342
msgid ""
13201343
"This attribute is mostly useful for introspection, but can be used for "
13211344
"additional loader-specific functionality, for example getting data "
13221345
"associated with a loader."
1323-
msgstr ""
1346+
msgstr "该属性主要适用于内省,但也可用于额外的加载器专属功能,例如获取与加载器相关联的数据。"
13241347

13251348
#: ../../reference/datamodel.rst:1002
13261349
msgid ""

0 commit comments

Comments
 (0)
0